18 m_ntpath =
"/NTUPLES/FILE1/LARDIGITS";
31 if (
sc!=StatusCode::SUCCESS) {
37 if (
sc!=StatusCode::SUCCESS) {
43 if (
sc!=StatusCode::SUCCESS) {
50 if (
sc!=StatusCode::SUCCESS) {
58 if (
sc!=StatusCode::SUCCESS) {
108 return StatusCode::SUCCESS;
119 unsigned long long thisevent;
120 unsigned long thisbcid = 0;
121 unsigned long thisELVL1Id = 0;
124 thisevent = evt->eventNumber();
134 if(
m_fillBCID) thisbcid = (*hdrCont->begin())->BCId() ;
136 thisELVL1Id = (*hdrCont->begin())->ELVL1Id();
137 ATH_MSG_DEBUG(
"NSAMPLES FROM FEB HEADER " << (*hdrCont->begin())->NbSamples() );
141 thisbcid = evt->bcid();
149 return StatusCode::SUCCESS;
157 unsigned cellCounter=0;
163 sc =
evtStore()->retrieve(etcontainer,
"SC_ET");
164 if (
sc.isFailure()) {
ATH_MSG_WARNING(
"Unable to retrieve LArRawSCContainer with key SC_ET from DetectorStore. " );}
165 else ATH_MSG_DEBUG(
"Got LArRawSCContainer with key SC_ET " );
167 sc =
evtStore()->retrieve(etcontainer_next,
"SC_ET_ID");
168 if (
sc.isFailure()) {
ATH_MSG_WARNING(
"Unable to retrieve LArRawSCContainer with key SC_ET_ID from DetectorStore. " );}
169 else ATH_MSG_DEBUG(
"Got LArRawSCContainer with key SC_ET_ID" );
173 for(
const LArDigit *digi : DigitContainer ){
175 unsigned int trueMaxSample = digi->nsamples();
179 m_gain[cellCounter] = digi->gain();
185 ATH_MSG_WARNING(
"The number of samples in data is larger than the one specified by JO: " << trueMaxSample <<
" > " <<
m_Nsamples <<
" --> only " <<
m_Nsamples <<
" will be available in the ntuple " );
194 for(
unsigned i = 0; i<trueMaxSample;++i)
m_samples[cellCounter][i] = digi->samples().at(i);
197 const LArRawSC*rawSC = etcontainer->
at(cellCounter);
199 unsigned int truenet =
m_Net;
201 if(truenet > rawSC->
bcids().size()) truenet=rawSC->
bcids().size();
202 for(
unsigned i=0; i<truenet;++i){
207 for(
unsigned i=0; i<truenet;++i){
212 if(truenet > rawSC->
satur().size()) truenet=rawSC->
satur().size();
214 for(
unsigned i = 0; i<truenet;++i){
221 if( etcontainer_next ){
222 const LArRawSC*rawSC = etcontainer_next->
at(cellCounter);
224 for(
unsigned i=0; i<rawSC->
bcids().size();++i){
227 for(
unsigned i=0; i<rawSC->
energies().size();++i){
230 for(
unsigned i = 0; i<rawSC->
satur().size();++i){
241 ATH_MSG_DEBUG(
"LArDigits2NtupleEB has finished, filled"<< cellCounter <<
" cells" );
242 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
ServiceHandle< StoreGateSvc > & evtStore()
const T * at(size_type n) const
Access an element, as an rvalue.
Gaudi::Property< bool > m_isSC
bool fillFromIdentifier(const HWIdentifier &id, int C)
LArCond2NtupleBaseEB(const std::string &name, ISvcLocator *pSvcLocator)
Container class for LArDigit.
Liquid Argon digit base class.
NTuple::Array< short > m_ELVL1Id
Gaudi::Property< unsigned int > m_Net
NTuple::Item< unsigned long long > m_IEvent
NTuple::Array< int > m_ntNsamples
NTuple::Matrix< float > m_bcidVec_ET
LArDigits2NtupleEB(const std::string &name, ISvcLocator *pSvcLocator)
NTuple::Array< short > m_gain
virtual StatusCode initialize() override
virtual StatusCode execute() override
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
SG::ReadHandleKey< LArFebHeaderContainer > m_LArFebHeaderContainerKey
Gaudi::Property< unsigned int > m_Nsamples
Gaudi::Property< bool > m_fillBCID
NTuple::Matrix< float > m_energyVec_ET_ID
NTuple::Matrix< short > m_samples
NTuple::Matrix< bool > m_saturVec_ET_ID
NTuple::Matrix< bool > m_saturVec_ET
NTuple::Matrix< float > m_bcidVec_ET_ID
NTuple::Matrix< float > m_energyVec_ET
NTuple::Item< short > m_bcid
SG::ReadHandleKey< LArDigitContainer > m_contKey
Container class for LArRawSC.
Liquid Argon SuperCell raw data.
const std::vector< bool > & satur() const
const std::vector< unsigned short > & bcids() const
const std::vector< int > & energies() const
virtual bool isValid() override final
Can the handle be successfully dereferenced?