ATLAS Offline Software
Loading...
Searching...
No Matches
ReadTBLArDigits Class Reference

#include <ReadTBLArDigits.h>

Inheritance diagram for ReadTBLArDigits:
Collaboration diagram for ReadTBLArDigits:

Classes

class  SortDigits

Public Member Functions

 ReadTBLArDigits (const std::string &name, ISvcLocator *pSvcLocator)
 ~ReadTBLArDigits ()
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method with EventContext.
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual StatusCode execute ()
 Execute method without EventContext (deprecated).
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
const EventContext & getContext () const
 Deprecated methods (use the ones with EventContext).
bool filterPassed () const
void setFilterPassed (bool state) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

int m_count
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
const LArEM_IDm_emId
const LArFCAL_IDm_fcalId
const LArHEC_IDm_hecId
const LArOnlineIDm_onlineHelper
std::ofstream m_outfile
std::string m_containerKey
std::string m_dumpFile
bool m_printCellLoc
bool m_printFebChan
NTuple::Tuple * m_ntuplePtr
NTuple::Item< long > m_cellIndex
NTuple::Array< long > m_layer
NTuple::Array< long > m_eta
NTuple::Array< long > m_phi
NTuple::Array< long > m_gain
NTuple::Array< long > m_barrel_ec
NTuple::Array< long > m_pos_neg
NTuple::Array< long > m_FT
NTuple::Array< long > m_slot
NTuple::Array< long > m_channel
NTuple::Matrix< long > m_samples
NTuple::Item< long > m_Nsamples
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 25 of file ReadTBLArDigits.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ReadTBLArDigits()

ReadTBLArDigits::ReadTBLArDigits ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 18 of file ReadTBLArDigits.cxx.

19 : AthAlgorithm(name, pSvcLocator),
20 m_count(0),
21 m_emId(0),
22 m_fcalId(0),
23 m_hecId(0),
26{
27 declareProperty("ContainerKey",m_containerKey="");
28 declareProperty("DumpFile",m_dumpFile="");
29 declareProperty("PrintCellLocation",m_printCellLoc=false);
30 declareProperty("PrintFebChan",m_printFebChan=true);
31
32}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const LArFCAL_ID * m_fcalId
const LArEM_ID * m_emId
const LArHEC_ID * m_hecId
std::string m_containerKey
std::string m_dumpFile
const LArOnlineID * m_onlineHelper
NTuple::Tuple * m_ntuplePtr

◆ ~ReadTBLArDigits()

ReadTBLArDigits::~ReadTBLArDigits ( )

Definition at line 34 of file ReadTBLArDigits.cxx.

35{//empty
36}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute() [1/2]

virtual StatusCode AthAlgorithm::execute ( )
inlinevirtualinherited

Execute method without EventContext (deprecated).

Override this method if the EventContext is not needed.

Reimplemented in AthenaMonManager, AthPrescaler, BuildVertexPointingAlg, CP::AsgClassificationDecorationAlg, CP::AsgEnergyDecoratorAlg, CP::AsgEventScaleFactorAlg, CP::AsgLeptonTrackDecorationAlg, CP::AsgObjectScaleFactorAlg, CP::AsgPriorityDecorationAlg, CP::AsgSelectionAlg, CP::AsgShallowCopyAlg, CP::AsgUnionPreselectionAlg, CP::AsgUnionSelectionAlg, CP::AsgViewFromSelectionAlg, CP::AsgxAODNTupleMakerAlg, CP::BJetCalibrationAlg, CP::BootstrapGeneratorAlg, CP::BTaggingEfficiencyAlg, CP::BTaggingInformationDecoratorAlg, CP::BTaggingTriggerEfficiencyAlg, CP::BTaggingTriggerMatchingAlg, CP::ChargeSelectorAlg, CP::CopyNominalSelectionAlg, CP::DileptonInvariantMassSelectorAlg, CP::DileptonInvariantMassWindowSelectorAlg, CP::DileptonOSSFInvariantMassWindowSelectorAlg, CP::DiTauEfficiencyCorrectionsAlg, CP::DiTauMassCalculatorAlg, CP::DiTauSmearingAlg, CP::DiTauTruthMatchingAlg, CP::EgammaCalibrationAndSmearingAlg, CP::EgammaFSRForMuonsCollectorAlg, CP::EgammaIsolationCorrectionAlg, CP::EgammaIsolationSelectionAlg, CP::ElectronEfficiencyCorrectionAlg, CP::ElectronSiHitDecAlg, CP::EventCutFlowHistAlg, CP::EventFlagSelectionAlg, CP::EventSelectionByObjectFlagAlg, CP::EventStatusSelectionAlg, CP::FakeBkgCalculatorAlg, CP::InDetTrackBiasingAlg, CP::InDetTrackExtraVarDecoratorAlg, CP::InDetTrackSelectionAlg, CP::InDetTrackSmearingAlg, CP::JetCalibAlg, CP::JetCalibrationAlg, CP::JetDecoratorAlg, CP::JetFFSmearingAlg, CP::JetGhostMuonAssociationAlg, CP::JetModifierAlg, CP::JetNGhostSelectorAlg, CP::JetReclusteringAlg, CP::JetSelectionAlg, CP::JetTriggerDecoratorAlg, CP::JetUncertaintiesAlg, CP::JvtEfficiencyAlg, CP::JvtUpdateAlg, CP::KinematicHistAlg, CP::LeptonSFCalculatorAlg, CP::MCTCDecorationAlg, CP::MetadataHistAlg, CP::MetBuilderAlg, CP::MetMakerAlg, CP::MetSignificanceAlg, CP::MissingETPlusTransverseMassSelectorAlg, CP::MissingETSelectorAlg, CP::MuonCalibrationAndSmearingAlg, CP::MuonEfficiencyScaleFactorAlg, CP::MuonIsolationAlg, CP::MuonSelectionAlgV2, CP::MuonTriggerEfficiencyScaleFactorAlg, CP::NJetDecoratorAlg, CP::NLargeRJetMassWindowSelectorAlg, CP::NObjectMassSelectorAlg, CP::NObjectPtSelectorAlg, CP::ObjectCutFlowHistAlg, CP::OverlapRemovalAlg, CP::PhotonEfficiencyCorrectionAlg, CP::PhotonExtraVariablesAlg, CP::PhotonShowerShapeFudgeAlg, CP::PileupReweightingAlg, CP::PileupReweightingProvider, CP::PMGTruthWeightAlg, CP::RNtupleTreeMakerAlg, CP::RunNumberSelectorAlg, CP::RunPartonHistoryAlg, CP::SaveFilterAlg, CP::SecVertexTruthMatchAlg, CP::SSVWeightsAlg, CP::SumNLeptonPtSelectorAlg, CP::SysListDumperAlg, CP::SysTruthWeightAlg, CP::TauCombineMuonRMTausAlg, CP::TauEfficiencyCorrectionsAlg, CP::TauSmearingAlg, CP::TauTruthMatchingAlg, CP::TransverseMassSelectorAlg, CP::TreeFillerAlg, CP::TreeMakerAlg, CP::TrigEventSelectionAlg, CP::TrigGlobalEfficiencyAlg, CP::TrigMatchingAlg, CP::TrigPrescalesAlg, CP::VGammaORAlg, CP::xAODWriterAlg, CP::XbbEfficiencyAlg, CP::XbbInformationDecoratorAlg, DecoratePhotonPointingAlg, DecorateVertexScoreAlg, DumpGeo, EL::AnaAlgorithm, EL::UnitTestAlg2, EL::UnitTestAlg3, EL::UnitTestAlg4, EL::UnitTestAlg5, EL::UnitTestAlg7, EventReco::KLFitterFinalizeOutputAlg, EventReco::RunKLFitterAlg, GRLSelectorAlg, IdDictCnvTest, InDetUpdateCaches, JetGlobalEventSetup, LArAutoCorrAlgToDB, LArAutoCorrFromStdNtuple, LArBadChannelHunter, LArBlockCorrections, LArCalibCopyAlg< CONDITIONSCONTAINER >, LArCalibCopyAlg< LArDAC2uAMC >, LArCalibCopyAlg< LArPhysWaveContainer >, LArCalibCopyAlg< LArTdriftComplete >, LArCalibPatchingAlg< CONDITIONSCONTAINER >, LArCalibPatchingAlg< LArAutoCorrComplete >, LArCalibPatchingAlg< LArCaliWaveContainer >, LArCalibPatchingAlg< LArMphysOverMcalComplete >, LArCalibPatchingAlg< LArRampComplete >, LArCalibValidationAlg< CONDITIONSCONTAINER, REFCONTAINER >, LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >, LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >, LArCalibValidationAlg< LArPedestalComplete, ILArPedestal >, LArCalibValidationAlg< LArRampComplete, ILArRamp >, LArCaliWaveSelector, LArCompleteToFlat, LArDeltaRespPredictor, LArDSPThresholdFillInline, LArDuplicateConstants, LArFillDSPConfig, LArFlatFromFile, LArGeoWeightsFill, LArMasterWaveBuilder, LArMphysOverMcalFromTuple, LArOFCAlg, LArOFCBin_PhysCaliTdiffFromStdNtuple, LArOFCtoOFC, LArOFPhaseFill, LArParamsFromStdNtuple, LArPhysWaveFromAscii, LArPhysWaveFromStdNtuple, LArPhysWaveFromTuple, LArPhysWavePredictor, LArPhysWaveShifter, LArRampAdHocPatchingAlg, LArReadParamsFromFile< DATA >, LArReadParamsFromFile< LArCableAttenuationComplete >, LArReadParamsFromFile< LArCableLengthComplete >, LArReadParamsFromFile< LArCaliPulseParamsComplete >, LArReadParamsFromFile< LArDetCellParamsComplete >, LArReadParamsFromFile< LArEMEC_CphiComplete >, LArReadParamsFromFile< LArEMEC_HValphaComplete >, LArReadParamsFromFile< LArEMEC_HVbetaComplete >, LArReadParamsFromFile< LArMphysOverMcalComplete >, LArReadParamsFromFile< LArPhysCaliTdiffComplete >, LArReadParamsFromFile< LArRinjComplete >, LArReadParamsFromFile< LArTdriftComplete >, LArReadParamsFromFile< LArTshaperComplete >, LArRTMParamExtractor, LArShapeFromStdNtuple, LArTimePhysPrediction, LisNtuple, LVL1::eFEXDriver, LVL1::L1CaloTriggerTowerDecoratorAlg, LVL1::L1TopoSimulation, LVL1::TrigT1MBTS, OverlapRemovalGenUseAlg, PyAthena::Alg, SGInputLoader, SUSYToolsAlg, TBBPCRec, TBMWPCRec, TBScintillatorRec, TBTailCatcherRec, TBTrackInfoFromTag, Trig::TrigMatchTestAlg, TrkEDMTestAlg, ZdcLEDNtuple, and ZdcNtuple.

Definition at line 76 of file AthAlgorithm.h.

76 {
77 throw GaudiException( "execute() or execute(const EventContext&) needs to be implemented", name(),
78 StatusCode::FAILURE );
79 }

◆ execute() [2/2]

StatusCode ReadTBLArDigits::execute ( const EventContext & )
overridevirtual

Execute method with EventContext.

Override this method if acccess to the EventContext is needed.

Reimplemented from AthAlgorithm.

Definition at line 91 of file ReadTBLArDigits.cxx.

92{
93
94 MsgStream log(msgSvc(), name());
95 m_count++;
97 log << MSG::DEBUG << "======== executing event "<< m_count << " ========" << endmsg;
98 log << MSG::DEBUG << "Retrieving TBLArDigitContainer. Key= " << m_containerKey << endmsg;
99 TBLArDigitContainer* larDigitCont = nullptr;
100 if (m_containerKey.size())
101 sc = evtStore()->retrieve(larDigitCont ,m_containerKey);
102 else
103 sc = evtStore()->retrieve(larDigitCont);
104 if (sc.isFailure())
105 {log << MSG::FATAL << " Cannot read TBLArDigitContainer from StoreGate! key=" << m_containerKey << endmsg;
106 return StatusCode::FAILURE;
107 }
108
109
110 if (m_outfile.is_open()) {
111 log << MSG::DEBUG << "Sorting digits" << endmsg;
112 SortDigits sortDigits(m_onlineHelper);
113 std::sort(larDigitCont->begin(),larDigitCont->end(),sortDigits);
114 }
115
116 SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey, ctx);
117
118 log << MSG::DEBUG << "Finished sorting" << endmsg;
119 unsigned cellCounter=0;
120 if (larDigitCont->size()>0)
121 m_Nsamples=larDigitCont->front()->samples().size();
122 else
123 m_Nsamples=0;
124 log << MSG::DEBUG << "Now loop over digits" << endmsg;
125 for (const LArDigit* digit : *larDigitCont) {
126 HWIdentifier chid=digit->hardwareID();
127 log << MSG::DEBUG << "Get offline ID" << endmsg;
128 const Identifier id=cabling->cnvToIdentifier(chid);
129 const std::vector<short>& vSamples=digit->samples();
130 m_cellIndex=cellCounter;
131 log << MSG::DEBUG << "Now find eta/phi (EM only right now)" << endmsg;
132 if (m_emId->is_lar_em(id)) {
133 m_eta[m_cellIndex]=m_emId->eta(id);
134 m_phi[m_cellIndex]=m_emId->phi(id);
135 m_layer[m_cellIndex]=m_emId->sampling(id);
136 } else if (m_fcalId->is_lar_fcal(id)) {
137 m_eta[m_cellIndex]=m_fcalId->eta(id);
138 m_phi[m_cellIndex]=m_fcalId->phi(id);
139 m_layer[m_cellIndex]=m_fcalId->module(id);
140 } else if (m_hecId->is_lar_hec(id)) {
141 m_eta[m_cellIndex]=m_hecId->eta(id);
142 m_phi[m_cellIndex]=m_hecId->phi(id);
143 m_layer[m_cellIndex]=m_hecId->sampling(id);
144 } else {
148 }
149 log << MSG::DEBUG << "Store identifier arrays" << endmsg;
150 m_barrel_ec[m_cellIndex]=m_onlineHelper->barrel_ec(chid);
151 m_pos_neg[m_cellIndex] = m_onlineHelper->pos_neg(chid);
152 m_FT[m_cellIndex] = m_onlineHelper->feedthrough(chid);
153 m_slot[m_cellIndex] = m_onlineHelper->slot(chid);
154 m_channel[m_cellIndex] = m_onlineHelper->channel(chid);
155 m_gain[m_cellIndex]=digit->gain();
156
157 log << MSG::DEBUG << "Loop over samples" << endmsg;
158 int nSamples=vSamples.size();
159 for (int i=0;i<nSamples && i<32;i++)
160 m_samples[m_cellIndex][i]=vSamples[i];
161
162 if (m_outfile.is_open()) {
163 m_outfile << "Evt="<< m_count << " ";
164 if (m_printCellLoc)
165 m_outfile << "Cell l/e/p= " << m_layer[m_cellIndex] << "/" << m_eta[m_cellIndex]
166 << "/" << m_phi[m_cellIndex] << " ";
167 if (m_printFebChan)
168 m_outfile << "FebId= 0x" << std::hex << m_onlineHelper->feb_Id(chid).get_compact()
169 << std::dec << " Ch= " << m_onlineHelper->channel(chid) << " ";
170 for (int i=0;i<nSamples;i++) {
171 m_outfile << " " << vSamples[i];
172 }
173 m_outfile << " G=" << m_gain[m_cellIndex] << std::endl;
174 }
175 cellCounter++;
176 }
177 sc=ntupleSvc()->writeRecord(m_ntuplePtr);
178 if (sc!=StatusCode::SUCCESS) {
179 log << MSG::ERROR << "writeRecord failed" << endmsg;
180 return StatusCode::FAILURE;
181 }
182
183 if (m_count%1000==0)
184 log << MSG::INFO << "Event " << m_count << " contains " << cellCounter << " channels\n";
185 return StatusCode::SUCCESS;
186}
#define endmsg
static Double_t sc
INTupleSvc * ntupleSvc()
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const T * front() const
Access the first element in the collection as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
const std::vector< short > & samples() const
Definition LArDigit.h:78
NTuple::Array< long > m_phi
std::ofstream m_outfile
NTuple::Array< long > m_slot
NTuple::Array< long > m_pos_neg
NTuple::Array< long > m_eta
NTuple::Item< long > m_cellIndex
NTuple::Item< long > m_Nsamples
NTuple::Array< long > m_barrel_ec
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
NTuple::Array< long > m_layer
NTuple::Array< long > m_gain
NTuple::Matrix< long > m_samples
NTuple::Array< long > m_FT
NTuple::Array< long > m_channel
::StatusCode StatusCode
StatusCode definition for legacy code.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ filterPassed()

bool AthAlgorithm::filterPassed ( ) const
inherited

Definition at line 94 of file AthAlgorithm.cxx.

94 {
95 return execState( Gaudi::Hive::currentContext() ).filterPassed();
96}

◆ finalize()

StatusCode ReadTBLArDigits::finalize ( )
overridevirtual

Definition at line 188 of file ReadTBLArDigits.cxx.

189{ MsgStream log(msgSvc(), name());
190 if (m_outfile.is_open())
191 m_outfile.close();
192 log << MSG::INFO << "finalize ReadTBLArDigits" << endmsg;
193 return StatusCode::SUCCESS;
194}

◆ getContext()

const EventContext & AthAlgorithm::getContext ( ) const
inherited

Deprecated methods (use the ones with EventContext).

Definition at line 90 of file AthAlgorithm.cxx.

90 {
91 return Gaudi::Hive::currentContext();
92}

◆ initialize()

StatusCode ReadTBLArDigits::initialize ( )
overridevirtual

Definition at line 38 of file ReadTBLArDigits.cxx.

39{ MsgStream log(msgSvc(), name());
40 log << MSG::INFO << "Initialize" << endmsg;
41
42 const CaloCell_ID* idHelper = nullptr;
43 ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
44 m_emId=idHelper->em_idHelper();
45 m_fcalId=idHelper->fcal_idHelper();
46 m_hecId=idHelper->hec_idHelper();
47
48 ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
49
50 if (m_dumpFile.size()>0)
51 m_outfile.open(m_dumpFile.c_str(),std::ios::out);
52 //Ntuple booking
53
54
55 NTupleFilePtr file1(ntupleSvc(),"/NTUPLES/FILE1");
56 if (!file1)
57 {log << MSG::ERROR << "Booking of NTuple failed" << endmsg;
58 return StatusCode::FAILURE;
59 }
60 NTuplePtr nt(ntupleSvc(),"/NTUPLES/FILE1/LARDIGITS");
61 if (!nt) {
62 nt=ntupleSvc()->book("/NTUPLES/FILE1/LARDIGITS",CLID_ColumnWiseTuple,"LArDigits");
63 }
64 if (!nt)
65 {log << MSG::ERROR << "Booking of NTuple failed" << endmsg;
66 return StatusCode::FAILURE;
67 }
68
69 ATH_CHECK( nt->addItem("icell",m_cellIndex,0,3600) );
70 ATH_CHECK( nt->addItem("layer",m_cellIndex,m_layer) );
71 ATH_CHECK( nt->addItem("ieta",m_cellIndex,m_eta) );
72 ATH_CHECK( nt->addItem("iphi",m_cellIndex,m_phi) );
73 ATH_CHECK( nt->addItem("barrel_ec",m_cellIndex,m_barrel_ec) );
74 ATH_CHECK( nt->addItem("pos_neg",m_cellIndex,m_pos_neg) );
75 ATH_CHECK( nt->addItem("FT",m_cellIndex,m_FT) );
76 ATH_CHECK( nt->addItem("slot",m_cellIndex,m_slot) );
77 ATH_CHECK( nt->addItem("channel",m_cellIndex,m_channel) );
78 ATH_CHECK( nt->addItem("gain",m_cellIndex,m_gain) );
79 ATH_CHECK( nt->addItem("NSamples",m_Nsamples,0,32) );
80 ATH_CHECK( nt->addItem("Samples",m_cellIndex,m_samples,32) );
81
82 ATH_CHECK( m_cablingKey.initialize() );
83
85 m_count=0;
86 log << MSG::INFO << "======== ReadTBLArDigits initialize successfully ========" << endmsg;
87 return StatusCode::SUCCESS;
88}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Definition CaloCell_ID.h:75
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition CaloCell_ID.h:63
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Definition CaloCell_ID.h:69

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 118 of file AthAlgorithm.h.

118{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

void AthAlgorithm::setFilterPassed ( bool state) const
inherited

Definition at line 98 of file AthAlgorithm.cxx.

98 {
99 execState( Gaudi::Hive::currentContext() ).setFilterPassed(state);
100}

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc.

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_barrel_ec

NTuple::Array<long> ReadTBLArDigits::m_barrel_ec
private

Definition at line 56 of file ReadTBLArDigits.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> ReadTBLArDigits::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 39 of file ReadTBLArDigits.h.

40{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_cellIndex

NTuple::Item<long> ReadTBLArDigits::m_cellIndex
private

Definition at line 54 of file ReadTBLArDigits.h.

◆ m_channel

NTuple::Array<long> ReadTBLArDigits::m_channel
private

Definition at line 56 of file ReadTBLArDigits.h.

◆ m_containerKey

std::string ReadTBLArDigits::m_containerKey
private

Definition at line 46 of file ReadTBLArDigits.h.

◆ m_count

int ReadTBLArDigits::m_count
private

Definition at line 38 of file ReadTBLArDigits.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dumpFile

std::string ReadTBLArDigits::m_dumpFile
private

Definition at line 47 of file ReadTBLArDigits.h.

◆ m_emId

const LArEM_ID* ReadTBLArDigits::m_emId
private

Definition at line 41 of file ReadTBLArDigits.h.

◆ m_eta

NTuple::Array<long> ReadTBLArDigits::m_eta
private

Definition at line 55 of file ReadTBLArDigits.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 121 of file AthAlgorithm.h.

◆ m_fcalId

const LArFCAL_ID* ReadTBLArDigits::m_fcalId
private

Definition at line 42 of file ReadTBLArDigits.h.

◆ m_FT

NTuple::Array<long> ReadTBLArDigits::m_FT
private

Definition at line 56 of file ReadTBLArDigits.h.

◆ m_gain

NTuple::Array<long> ReadTBLArDigits::m_gain
private

Definition at line 55 of file ReadTBLArDigits.h.

◆ m_hecId

const LArHEC_ID* ReadTBLArDigits::m_hecId
private

Definition at line 43 of file ReadTBLArDigits.h.

◆ m_layer

NTuple::Array<long> ReadTBLArDigits::m_layer
private

Definition at line 55 of file ReadTBLArDigits.h.

◆ m_Nsamples

NTuple::Item<long> ReadTBLArDigits::m_Nsamples
private

Definition at line 58 of file ReadTBLArDigits.h.

◆ m_ntuplePtr

NTuple::Tuple* ReadTBLArDigits::m_ntuplePtr
private

Definition at line 52 of file ReadTBLArDigits.h.

◆ m_onlineHelper

const LArOnlineID* ReadTBLArDigits::m_onlineHelper
private

Definition at line 44 of file ReadTBLArDigits.h.

◆ m_outfile

std::ofstream ReadTBLArDigits::m_outfile
private

Definition at line 45 of file ReadTBLArDigits.h.

◆ m_phi

NTuple::Array<long> ReadTBLArDigits::m_phi
private

Definition at line 55 of file ReadTBLArDigits.h.

◆ m_pos_neg

NTuple::Array<long> ReadTBLArDigits::m_pos_neg
private

Definition at line 56 of file ReadTBLArDigits.h.

◆ m_printCellLoc

bool ReadTBLArDigits::m_printCellLoc
private

Definition at line 48 of file ReadTBLArDigits.h.

◆ m_printFebChan

bool ReadTBLArDigits::m_printFebChan
private

Definition at line 49 of file ReadTBLArDigits.h.

◆ m_samples

NTuple::Matrix<long> ReadTBLArDigits::m_samples
private

Definition at line 57 of file ReadTBLArDigits.h.

◆ m_slot

NTuple::Array<long> ReadTBLArDigits::m_slot
private

Definition at line 56 of file ReadTBLArDigits.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: