|
ATLAS Offline Software
|
Go to the documentation of this file.
21 m_DataLocation(
"FREE"),
22 m_ChannelContainerName(
"LArRawChannels"),
25 m_ADCtoMeVEMECInner(),
26 m_ADCtoMeVEMECOuter(),
63 return StatusCode::SUCCESS;
74 return StatusCode::FAILURE;
82 ATH_MSG_DEBUG (
"1) LArDigitContainer container size = " << digitContainer->
size() );
84 ATH_MSG_DEBUG (
"2) LArDigitContainer container size = " << digitContainer->
size() );
85 if( digitContainer->
size() < 1 ) {
87 return StatusCode::SUCCESS;
93 larRawChannelContainer->reserve(digitContainer->
size());
102 const std::vector<short>& samples =
digit->samples();
103 unsigned int nSamples = samples.size();
108 std::vector<float> mySamples;
109 mySamples.resize(samples.size());
114 for (
unsigned int i=0;
i<samples.size();
i++ )
116 mySamples[
i] = ((
float)samples[
i]) - thePedestal;
122 GainFactor = 9.8*9.8;
133 float maxADCPeak = 0.;
134 unsigned int iPeakSamp = 0;
136 if ( maxADCPeak < mySamples[
i] )
138 maxADCPeak = mySamples[
i];
143 bool CubicFailed =
false;
150 ADCPeak = maxADCPeak;
155 else if (
m_mode ==
"CUBIC" &&
160 const float invT[4][4]
162 { -1.83333, 3, -1.5, 0.333333},
164 {-0.166666, 0.5, -0.5, 0.166666} };
167 if ( iPeakSamp <= 1 )
172 else if ( iPeakSamp >=
nSamples - 2 )
179 it0 = ( mySamples[iPeakSamp-2] > mySamples[iPeakSamp+2] )
185 float A[4] = {0, 0, 0, 0};
189 for (
int ia = 0; ia < 4; ia++)
190 for (
int it = 0;
it < 4;
it++)
191 A[ia] += invT[ia][
it] * mySamples[it0+
it];
194 disc =
A[2]*
A[2] - 3*
A[1]*
A[3];
195 if ( ! ( CubicFailed = ( disc < 0 ||
A[3] == 0 ) ) )
197 dtmax = (-
A[2]-sqrt(disc))/(3*
A[3]);
198 if ( ! ( CubicFailed = ( dtmax < 0 || dtmax > 3 ) ) )
201 for(
int ia = 0; ia < 4; ia++)
202 ADCPeak +=
A[ia] *
pow(dtmax, ia);
218 if(
m_mode ==
"FIXED" || CubicFailed )
226 float ADCtoMeV = 10.0;
256 float Energy = ADCPeak * ADCtoMeV * GainFactor;
262 larRawChannelContainer->
add(larRawChannel);
270 ATH_MSG_DEBUG (
"sorted RawChannelContainer, now lock it " );
274 return StatusCode::SUCCESS;
280 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
const LArEM_ID * em_idHelper() const
access to EM idHelper
bool is_lar_fcal(Identifier id) const
virtual StatusCode execute() override
bool is_em_endcap_outer(const Identifier id) const
test if the id belongs to the EM Endcap outer wheel
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::vector< double > Energy
virtual StatusCode initialize() override
int module(const Identifier id) const
module [1,3]
int sampling(const Identifier id) const
return sampling according to :
float m_ADCtoMeVEMECInner[2]
virtual StatusCode finalize() override
const std::string & key() const
Return the StoreGate ID for the referenced object.
TBLArRawChannelBuilder(const std::string &name, ISvcLocator *pSvcLocator)
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Liquid Argon digit base class.
void add(const LArRawChannel &rc)
Liquid Argon ROD output object base class.
Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old LArRawChannelContainer
std::string m_DataLocation
::StatusCode StatusCode
StatusCode definition for legacy code.
const LArOnlineID * m_onlineHelper
const LArHEC_ID * m_hecId
std::string m_ChannelContainerName
bool is_lar_hec(Identifier id) const
Helper class for offline cell identifiers.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
StatusCode initialize(bool used=true)
bool is_em_endcap_inner(const Identifier id) const
test if the id belongs to the EM Endcap inner wheel
def time(flags, cells_name, *args, **kw)
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
float m_ADCtoMeVEMECOuter[2]
Container class for LArDigit.
const LArFCAL_ID * m_fcalId
constexpr int pow(int base, int exp) noexcept
size_type size() const noexcept
Returns the number of elements in the collection.
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Container for LArRawChannel (IDC using LArRawChannelCollection)