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

#include <LarEMSamplingFraction.h>

Inheritance diagram for LarEMSamplingFraction:

Public Member Functions

 LarEMSamplingFraction (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~LarEMSamplingFraction ()
virtual StatusCode initialize () override
virtual StatusCode execute () override
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
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

Protected Member Functions

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

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

Private Attributes

bool m_docells {true}
int m_mc_pdg {0}
double m_mc_eta {0.}
double m_mc_phi {0.}
double m_mc_e {0.}
double m_mc_pt {0.}
std::vector< Long64_t > * m_cell_identifier {nullptr}
std::vector< float > * m_cell_energy_reco {nullptr}
std::vector< float > * m_cell_energy_active_total_corrected {nullptr}
std::vector< float > * m_cell_energy_active_total {nullptr}
std::vector< float > * m_cell_energy_inactive_total {nullptr}
std::vector< int > * m_cell_sampling {nullptr}
std::vector< float > * m_cell_eta {nullptr}
std::vector< float > * m_cell_phi {nullptr}
std::vector< float > * m_energy_reco {nullptr}
std::vector< float > * m_energy_hit {nullptr}
std::vector< float > * m_energy_inactive_total {nullptr}
std::vector< float > * m_energy_inactive_em {nullptr}
std::vector< float > * m_energy_inactive_nonem {nullptr}
std::vector< float > * m_energy_inactive_inv {nullptr}
std::vector< float > * m_energy_inactive_esc {nullptr}
std::vector< float > * m_energy_active_total_corrected {nullptr}
std::vector< float > * m_energy_active_total {nullptr}
std::vector< float > * m_energy_active_em {nullptr}
std::vector< float > * m_energy_active_nonem {nullptr}
std::vector< float > * m_energy_active_inv {nullptr}
std::vector< float > * m_energy_active_esc {nullptr}
TTree * m_mytree {nullptr}
std::vector< std::string > m_CalibrationHitContainerNames
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
const CaloCell_IDm_calo_id {nullptr}
const TileIDm_tileID {nullptr}
const TileHWIDm_tileHWID {nullptr}
const TileCablingServicem_tileCabling {nullptr}
SG::ReadCondHandleKey< ILArfSamplm_fSamplKey {this,"fSamplKey","LArfSamplSym","SG Key of LArfSampl object"}
SG::ReadCondHandleKey< TileSamplingFractionm_tileSamplingFractionKey
 Name of TileSamplingFraction in condition store.
ServiceHandle< TileCablingSvcm_tileCablingSvc
 Name of Tile cabling service.
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 27 of file LarEMSamplingFraction.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LarEMSamplingFraction() [1/2]

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

Definition at line 30 of file LarEMSamplingFraction.cxx.

32 : AthAlgorithm(name, pSvcLocator)
33{
34 // Name of ClusterContainer to use
35 declareProperty("DoCells",m_docells);
36 declareProperty("CalibrationHitContainerNames",m_CalibrationHitContainerNames);
37}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< std::string > m_CalibrationHitContainerNames

◆ ~LarEMSamplingFraction()

LarEMSamplingFraction::~LarEMSamplingFraction ( )
virtual

Definition at line 41 of file LarEMSamplingFraction.cxx.

42{ }

◆ LarEMSamplingFraction() [2/2]

LarEMSamplingFraction::LarEMSamplingFraction ( )
private

Default constructor:

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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< 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< 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< 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()

StatusCode LarEMSamplingFraction::execute ( )
overridevirtual

!

Definition at line 117 of file LarEMSamplingFraction.cxx.

118{
119 SG::ReadCondHandle<ILArfSampl> fSamplHdl(m_fSamplKey);
120 const ILArfSampl* fSampl=*fSamplHdl;
121
122 SG::ReadCondHandle<TileSamplingFraction> tileSamplingFraction(m_tileSamplingFractionKey);
123 ATH_CHECK( tileSamplingFraction.isValid() );
124
125 const CaloCalibrationHitContainer* cchc;
126 std::vector<const CaloCalibrationHitContainer *> v_cchc;
127 for (const std::string& containerName : m_CalibrationHitContainerNames) {
128 if ( !evtStore()->contains<CaloCalibrationHitContainer>(containerName))
129 {
130 ATH_MSG_WARNING("SG does not contain calibration hit container " << containerName);
131 }
132 else
133 {
134 StatusCode sc = evtStore()->retrieve(cchc,containerName);
135 if (sc.isFailure() )
136 {
137 ATH_MSG_ERROR("Cannot retrieve calibration hit container " << containerName);
138 return sc;
139 }
140 else
141 {
142 v_cchc.push_back(cchc);
143 }
144 }
145 }
146
147 const McEventCollection* truthEvent{};
148 StatusCode sc = evtStore()->retrieve(truthEvent, "TruthEvent");
149 if (sc.isFailure()||!truthEvent)
150 {
151 ATH_MSG_ERROR("No McEventCollection found");
152 return StatusCode::FAILURE;
153 }
154 auto gen = *HepMC::begin(*truthEvent->at(0));
155 m_mc_pdg = gen->pdg_id();
156 m_mc_eta = gen->momentum().pseudoRapidity();
157 m_mc_phi = gen->momentum().phi();
158 m_mc_e = gen->momentum().e();
159 m_mc_pt = sqrt(pow(gen->momentum().px(),2)+pow(gen->momentum().py(),2));
160
161 //inspiration:
162 //see https://gitlab.cern.ch/atlas/athena/blob/master/Calorimeter/CaloCalibHitRec/src/CalibHitToCaloCell.cxx
163 //and https://gitlab.cern.ch/atlas/athena/blob/master/Calorimeter/CaloCalibHitRec/src/CaloDmEnergy.cxx
164
165 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
166 ATH_CHECK(caloMgrHandle.isValid());
167 const CaloDetDescrManager* caloMgr = *caloMgrHandle;
168
169 m_energy_reco =new vector<float>;
170 m_energy_hit =new vector<float>;
171
172 m_energy_inactive_total=new vector<float>;
173 m_energy_inactive_em =new vector<float>;
174 m_energy_inactive_nonem=new vector<float>;
175 m_energy_inactive_inv =new vector<float>;
176 m_energy_inactive_esc =new vector<float>;
177
178 m_energy_active_total_corrected=new vector<float>;
179 m_energy_active_total=new vector<float>;
180 m_energy_active_em =new vector<float>;
181 m_energy_active_nonem=new vector<float>;
182 m_energy_active_inv =new vector<float>;
183 m_energy_active_esc =new vector<float>;
184
185 if(m_docells) {
186 m_cell_identifier =new std::vector<Long64_t>;
187 m_cell_energy_reco =new std::vector<float>;
188 m_cell_energy_active_total_corrected=new std::vector<float>;
189 m_cell_energy_active_total =new std::vector<float>;
190 m_cell_energy_inactive_total =new std::vector<float>;
191 m_cell_sampling =new std::vector<int>;
192 m_cell_eta =new std::vector<float>;
193 m_cell_phi =new std::vector<float>;
194 }
195
196 struct cell_info {
197 Long64_t cell_identifier=0;
198 float cell_energy_reco=0;
199 float cell_energy_active_total_corrected=0;
200 float cell_energy_active_total=0;
201 float cell_energy_inactive_total=0;
202 int cell_sampling=0;
203 float cell_eta=0;
204 float cell_phi=0;
205 };
206
207 std::map< Long64_t , cell_info > cell_info_map;
208
209 for(int s=0;s<24;s++)
210 {
211 m_energy_reco->push_back(0.0);
212 m_energy_hit->push_back(0.0);
213
214 m_energy_inactive_total->push_back(0.0);
215 m_energy_inactive_em ->push_back(0.0);
216 m_energy_inactive_nonem->push_back(0.0);
217 m_energy_inactive_inv ->push_back(0.0);
218 m_energy_inactive_esc ->push_back(0.0);
219
220 m_energy_active_total_corrected->push_back(0.0);
221 m_energy_active_total->push_back(0.0);
222 m_energy_active_em ->push_back(0.0);
223 m_energy_active_nonem->push_back(0.0);
224 m_energy_active_inv ->push_back(0.0);
225 m_energy_active_esc ->push_back(0.0);
226 }
227
228 int count=0;
229 for (const CaloCalibrationHitContainer* calibHitContainer: v_cchc)
230 {
232 for(const CaloCalibrationHit* calibHit : *calibHitContainer)
233 {
234 Identifier id=calibHit->cellID();
235
236 double Etot = calibHit->energyTotal();
237 double Eem = calibHit->energyEM();
238 double Enonem = calibHit->energyNonEM();
239 double Einv = calibHit->energyInvisible();
240 double Eesc = calibHit->energyEscaped();
241
242 double Efactor=1.0;
243
244 const CaloDetDescrElement* caloDDE = caloMgr->get_element(id);
245 int sampling=-1;
246 if(caloDDE) {
247 sampling = caloDDE->getSampling();
248
249 if((sampling>=0 && sampling<=11) || (sampling>=21 && sampling<=23)) Efactor=1/fSampl->FSAMPL(id);
250 if((sampling>=12 && sampling<=20)) {
251 HWIdentifier channel_id = m_tileCabling->s2h_channel_id(id);
252 int channel = m_tileHWID->channel(channel_id);
253 int drawerIdx = m_tileHWID->drawerIdx(channel_id);
254 Efactor = tileSamplingFraction->getSamplingFraction(drawerIdx, channel);
255 Identifier cell_id = m_tileID->cell_id(id);
256 if(caloMgr->get_element(cell_id)) {
257 id=cell_id;
258 }
259 }
260 }
261
262 ATH_MSG_VERBOSE( "cellID "<<id<<" layer "<<sampling<<" energyTotal "<<Etot<<" Eem "<<Eem<<" Enonem "<<Enonem<<" Einv "<<Einv<<" Eesc "<<Eesc<<" Efactor="<<Efactor);
263
264 if(sampling>=0 && sampling<=23)
265 {
266 if(m_docells) {
267 cell_info_map[id.get_compact()].cell_identifier=id.get_compact();
268 cell_info_map[id.get_compact()].cell_sampling=sampling;
269 cell_info_map[id.get_compact()].cell_eta=caloDDE->eta_raw();
270 cell_info_map[id.get_compact()].cell_phi=caloDDE->phi_raw();
271 }
272
273 if(m_CalibrationHitContainerNames[count]=="LArCalibrationHitInactive" || m_CalibrationHitContainerNames[count]=="TileCalibHitInactiveCell")
274 {
275 m_energy_inactive_total->at(sampling)+=Etot;
276 m_energy_inactive_em ->at(sampling)+=Eem;
277 m_energy_inactive_nonem->at(sampling)+=Enonem;
278 m_energy_inactive_inv ->at(sampling)+=Einv;
279 m_energy_inactive_esc ->at(sampling)+=Eesc;
280
281 if(m_docells) cell_info_map[id.get_compact()].cell_energy_inactive_total+=Etot;
282 }
283
284 if(m_CalibrationHitContainerNames[count]=="LArCalibrationHitActive" || m_CalibrationHitContainerNames[count]=="TileCalibHitActiveCell")
285 {
286 m_energy_active_total_corrected->at(sampling)+=Etot*Efactor;
287 m_energy_active_total->at(sampling)+=Etot;
288 m_energy_active_em ->at(sampling)+=Eem;
289 m_energy_active_nonem->at(sampling)+=Enonem;
290 m_energy_active_inv ->at(sampling)+=Einv;
291 m_energy_active_esc ->at(sampling)+=Eesc;
292
293 if(m_docells) {
294 cell_info_map[id.get_compact()].cell_energy_active_total_corrected+=Etot*Efactor;
295 cell_info_map[id.get_compact()].cell_energy_active_total+=Etot;
296 }
297 }
298
299 }
300
301 }
302
303 count++;
304 }
305
306 //Get reco cells if available
307 const CaloCellContainer *cellColl{};
308 sc = evtStore()->retrieve(cellColl, "AllCalo");
309
310 if (sc.isFailure()) {
311 ATH_MSG_WARNING( "Couldn't read AllCalo cells from StoreGate");
312 //return NULL;
313 } else {
314 ATH_MSG_DEBUG( "Found: "<<cellColl->size()<<" calorimeter cells");
315 for (const CaloCell* cell : *cellColl) {
316 Identifier id=cell->ID();
317 const CaloDetDescrElement* caloDDE = caloMgr->get_element(id);
318 int sampling=-1;
319 if(caloDDE) {
320 sampling = caloDDE->getSampling();
321 m_energy_reco->at(sampling)+=cell->energy();
322 if((sampling>=12 && sampling<=20)) {
323 Identifier cell_id = m_tileID->cell_id(id);
324 if(caloMgr->get_element(cell_id)) {
325 id=cell_id;
326 }
327 }
328 }
329 if(m_docells) {
330 cell_info_map[id.get_compact()].cell_identifier=id.get_compact();
331 cell_info_map[id.get_compact()].cell_sampling=sampling;
332 if (caloDDE)[[likely]]{
333 cell_info_map[id.get_compact()].cell_eta=caloDDE->eta_raw();
334 cell_info_map[id.get_compact()].cell_phi=caloDDE->phi_raw();
335 }
336 cell_info_map[id.get_compact()].cell_energy_reco+=cell->energy();
337 }
338 }
339 } //calorimeter cells
340
341
342 //Get all G4Hits (from CaloHitAnalysis)
343 const std::vector<std::string> lArKeys = {"LArHitEMB", "LArHitEMEC", "LArHitFCAL", "LArHitHEC"};
344 for (const std::string& containerName: lArKeys) {
345 const LArHitContainer* larContainer{};
346 ATH_MSG_DEBUG( "Checking G4Hits: "<<containerName);
347 if(evtStore()->retrieve(larContainer,containerName)==StatusCode::SUCCESS) {
348 int hitnumber = 0;
349 for (const LArHit* larHit : *larContainer) {
350 hitnumber++;
351 const CaloDetDescrElement *hitElement = caloMgr->get_element(larHit->cellID());
352 if(!hitElement) continue;
353 Identifier larhitid = hitElement->identify();
354 if(caloMgr->get_element(larhitid)) {
355 CaloCell_ID::CaloSample larlayer = caloMgr->get_element(larhitid)->getSampling();
356 m_energy_hit->at(larlayer)+=larHit->energy();
357 }
358 } // End while LAr hits
359 ATH_MSG_DEBUG( "Read "<<hitnumber<<" G4Hits from "<<containerName);
360 }
361 else {
362 ATH_MSG_INFO( "Can't retrieve LAr hits");
363 }// End statuscode success upon retrieval of hits
364 }// End detector type loop
365
366 const TileHitVector * hitVec{};
367 if (evtStore()->retrieve(hitVec,"TileHitVec")==StatusCode::SUCCESS && m_tileID ) {
368 int hitnumber = 0;
369 for(const TileHit& hit : *hitVec) {
370 ++hitnumber;
371 Identifier pmt_id = hit.identify();
372 Identifier cell_id = m_tileID->cell_id(pmt_id);
373
374 if (caloMgr->get_element(cell_id)) {
376
377 //could there be more subhits??
378 for (int tilesubhit_i = 0; tilesubhit_i<hit.size(); tilesubhit_i++) {
380 ATH_MSG_DEBUG( "Tile subhit: "<<tilesubhit_i<<"/"<<hit.size()<< " E: "<<hit.energy(tilesubhit_i) );
381 m_energy_hit->at(layer) += hit.energy(tilesubhit_i);
382 }
383 }
384 }
385 ATH_MSG_DEBUG( "Read "<<hitnumber<<" G4Hits from TileHitVec");
386 }
387
388 for(auto& cell:cell_info_map) {
389 m_cell_identifier ->push_back(cell.second.cell_identifier);
390 m_cell_sampling ->push_back(cell.second.cell_sampling);
391 m_cell_eta ->push_back(cell.second.cell_eta);
392 m_cell_phi ->push_back(cell.second.cell_phi);
393 m_cell_energy_reco ->push_back(cell.second.cell_energy_reco);
394 m_cell_energy_active_total_corrected->push_back(cell.second.cell_energy_active_total_corrected);
395 m_cell_energy_active_total ->push_back(cell.second.cell_energy_active_total);
396 m_cell_energy_inactive_total ->push_back(cell.second.cell_energy_inactive_total);
397 }
398
399 m_mytree->Fill();
400
401 delete m_energy_reco;
402 delete m_energy_hit;
408
411 delete m_energy_active_em;
413 delete m_energy_active_inv;
414 delete m_energy_active_esc;
415
416 if(m_docells) {
417 delete m_cell_identifier;
418 delete m_cell_energy_reco;
422 delete m_cell_sampling;
423 delete m_cell_eta;
424 delete m_cell_phi;
425 }
426
427 return StatusCode::SUCCESS;
428}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
CaloCalibrationHitContainer
static Double_t sc
LArHitContainer
AtlasHitsVector< TileHit > TileHitVector
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
CaloCell_ID::CaloSample getSampling() const
cell sampling
Identifier identify() const override final
cell identifier
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual const float & FSAMPL(const HWIdentifier &id) const =0
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
std::vector< float > * m_energy_inactive_nonem
std::vector< float > * m_cell_eta
const TileCablingService * m_tileCabling
std::vector< float > * m_energy_active_total
std::vector< float > * m_energy_active_em
std::vector< float > * m_energy_active_inv
std::vector< float > * m_energy_active_esc
std::vector< int > * m_cell_sampling
SG::ReadCondHandleKey< ILArfSampl > m_fSamplKey
std::vector< float > * m_cell_energy_active_total
std::vector< float > * m_energy_hit
std::vector< float > * m_energy_inactive_em
std::vector< float > * m_energy_inactive_inv
std::vector< float > * m_cell_energy_reco
SG::ReadCondHandleKey< TileSamplingFraction > m_tileSamplingFractionKey
Name of TileSamplingFraction in condition store.
std::vector< float > * m_cell_phi
std::vector< float > * m_energy_active_nonem
std::vector< float > * m_cell_energy_active_total_corrected
std::vector< Long64_t > * m_cell_identifier
std::vector< float > * m_energy_inactive_total
std::vector< float > * m_energy_reco
std::vector< float > * m_cell_energy_inactive_total
std::vector< float > * m_energy_active_total_corrected
std::vector< float > * m_energy_inactive_esc
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:116
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
::StatusCode StatusCode
StatusCode definition for legacy code.
GenEvent::particle_iterator begin(HepMC::GenEvent &e)
Definition GenEvent.h:640
@ layer
Definition HitInfo.h:79
constexpr int pow(int x)
Definition conifer.h:27
#define likely(x)

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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

◆ finalize()

StatusCode LarEMSamplingFraction::finalize ( )
overridevirtual

Definition at line 109 of file LarEMSamplingFraction.cxx.

110{
111
112 return StatusCode::SUCCESS;
113}

◆ initialize()

StatusCode LarEMSamplingFraction::initialize ( )
overridevirtual

Definition at line 46 of file LarEMSamplingFraction.cxx.

47{
48 //---- initialize the StoreGateSvc ptr ----------------
49
50 ServiceHandle<ITHistSvc> histSvc("THistSvc",name());
51 ATH_CHECK( histSvc.retrieve() );
52
53 m_mytree = new TTree("mytree","mytree");
54 m_mytree->Branch("energy_reco", &m_energy_reco);
55 m_mytree->Branch("energy_hit", &m_energy_hit);
56 m_mytree->Branch("energy_inactive_total",&m_energy_inactive_total);
57 m_mytree->Branch("energy_inactive_em", &m_energy_inactive_em);
58 m_mytree->Branch("energy_inactive_nonem",&m_energy_inactive_nonem);
59 m_mytree->Branch("energy_inactive_inv", &m_energy_inactive_inv);
60 m_mytree->Branch("energy_inactive_esc", &m_energy_inactive_esc);
61 m_mytree->Branch("energy_active_total_corrected",&m_energy_active_total_corrected);
62 m_mytree->Branch("energy_active_total",&m_energy_active_total);
63 m_mytree->Branch("energy_active_em", &m_energy_active_em);
64 m_mytree->Branch("energy_active_nonem",&m_energy_active_nonem);
65 m_mytree->Branch("energy_active_inv", &m_energy_active_inv);
66 m_mytree->Branch("energy_active_esc", &m_energy_active_esc);
67 m_mytree->Branch("mc_pdg", &m_mc_pdg);
68 m_mytree->Branch("mc_eta", &m_mc_eta);
69 m_mytree->Branch("mc_phi", &m_mc_phi);
70 m_mytree->Branch("mc_e", &m_mc_e);
71 m_mytree->Branch("mc_pt", &m_mc_pt);
72
73 if(m_docells) {
74 m_mytree->Branch("cell_identifier",&m_cell_identifier);
75 m_mytree->Branch("cell_energy_reco",&m_cell_energy_reco);
76 m_mytree->Branch("cell_energy_inactive_total",&m_cell_energy_inactive_total);
77 m_mytree->Branch("cell_energy_active_total_corrected",&m_cell_energy_active_total_corrected);
78 m_mytree->Branch("cell_energy_active_total",&m_cell_energy_active_total);
79 m_mytree->Branch("cell_sampling",&m_cell_sampling);
80 m_mytree->Branch("cell_eta",&m_cell_eta);
81 m_mytree->Branch("cell_phi",&m_cell_phi);
82 }
83
84 histSvc->regTree("/MYSTREAM/myTree",m_mytree).ignore();
85
86 // pointer to detector manager:
87 ATH_CHECK(m_caloMgrKey.initialize());
88 ATH_CHECK(detStore()->retrieve(m_calo_id, "CaloCell_ID"));
89
90 const CaloIdManager* caloIdManager;
91 ATH_CHECK(detStore()->retrieve(caloIdManager));
92
93 m_tileID=caloIdManager->getTileID();
94 if(m_tileID==0) throw std::runtime_error("ISF_HitAnalysis: Invalid Tile ID helper");
95
96 ATH_CHECK(detStore()->retrieve(m_tileHWID));
97
98 ATH_CHECK(m_fSamplKey.initialize());
100
101 ATH_CHECK( m_tileCablingSvc.retrieve() );
102 m_tileCabling = m_tileCablingSvc->cablingService();
103
104 return StatusCode::SUCCESS;
105}
const ServiceHandle< StoreGateSvc > & detStore() const
const TileID * getTileID(void) const
ServiceHandle< TileCablingSvc > m_tileCablingSvc
Name of Tile cabling service.
const CaloCell_ID * m_calo_id

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< 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.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< 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< 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< 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< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ 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< 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}
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< 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< 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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_CalibrationHitContainerNames

std::vector<std::string> LarEMSamplingFraction::m_CalibrationHitContainerNames
private

Definition at line 78 of file LarEMSamplingFraction.h.

◆ m_calo_id

const CaloCell_ID* LarEMSamplingFraction::m_calo_id {nullptr}
private

Definition at line 85 of file LarEMSamplingFraction.h.

85{nullptr};

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> LarEMSamplingFraction::m_caloMgrKey
private
Initial value:
{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }

Definition at line 80 of file LarEMSamplingFraction.h.

80 { this
81 , "CaloDetDescrManager"
82 , "CaloDetDescrManager"
83 , "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_cell_energy_active_total

std::vector<float>* LarEMSamplingFraction::m_cell_energy_active_total {nullptr}
private

Definition at line 54 of file LarEMSamplingFraction.h.

54{nullptr};

◆ m_cell_energy_active_total_corrected

std::vector<float>* LarEMSamplingFraction::m_cell_energy_active_total_corrected {nullptr}
private

Definition at line 53 of file LarEMSamplingFraction.h.

53{nullptr};

◆ m_cell_energy_inactive_total

std::vector<float>* LarEMSamplingFraction::m_cell_energy_inactive_total {nullptr}
private

Definition at line 55 of file LarEMSamplingFraction.h.

55{nullptr};

◆ m_cell_energy_reco

std::vector<float>* LarEMSamplingFraction::m_cell_energy_reco {nullptr}
private

Definition at line 52 of file LarEMSamplingFraction.h.

52{nullptr};

◆ m_cell_eta

std::vector<float>* LarEMSamplingFraction::m_cell_eta {nullptr}
private

Definition at line 57 of file LarEMSamplingFraction.h.

57{nullptr};

◆ m_cell_identifier

std::vector<Long64_t>* LarEMSamplingFraction::m_cell_identifier {nullptr}
private

Definition at line 51 of file LarEMSamplingFraction.h.

51{nullptr};

◆ m_cell_phi

std::vector<float>* LarEMSamplingFraction::m_cell_phi {nullptr}
private

Definition at line 58 of file LarEMSamplingFraction.h.

58{nullptr};

◆ m_cell_sampling

std::vector<int>* LarEMSamplingFraction::m_cell_sampling {nullptr}
private

Definition at line 56 of file LarEMSamplingFraction.h.

56{nullptr};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_docells

bool LarEMSamplingFraction::m_docells {true}
private

Definition at line 43 of file LarEMSamplingFraction.h.

43{true};

◆ m_energy_active_em

std::vector<float>* LarEMSamplingFraction::m_energy_active_em {nullptr}
private

Definition at line 71 of file LarEMSamplingFraction.h.

71{nullptr};

◆ m_energy_active_esc

std::vector<float>* LarEMSamplingFraction::m_energy_active_esc {nullptr}
private

Definition at line 74 of file LarEMSamplingFraction.h.

74{nullptr};

◆ m_energy_active_inv

std::vector<float>* LarEMSamplingFraction::m_energy_active_inv {nullptr}
private

Definition at line 73 of file LarEMSamplingFraction.h.

73{nullptr};

◆ m_energy_active_nonem

std::vector<float>* LarEMSamplingFraction::m_energy_active_nonem {nullptr}
private

Definition at line 72 of file LarEMSamplingFraction.h.

72{nullptr};

◆ m_energy_active_total

std::vector<float>* LarEMSamplingFraction::m_energy_active_total {nullptr}
private

Definition at line 70 of file LarEMSamplingFraction.h.

70{nullptr};

◆ m_energy_active_total_corrected

std::vector<float>* LarEMSamplingFraction::m_energy_active_total_corrected {nullptr}
private

Definition at line 69 of file LarEMSamplingFraction.h.

69{nullptr};

◆ m_energy_hit

std::vector<float>* LarEMSamplingFraction::m_energy_hit {nullptr}
private

Definition at line 61 of file LarEMSamplingFraction.h.

61{nullptr};

◆ m_energy_inactive_em

std::vector<float>* LarEMSamplingFraction::m_energy_inactive_em {nullptr}
private

Definition at line 64 of file LarEMSamplingFraction.h.

64{nullptr};

◆ m_energy_inactive_esc

std::vector<float>* LarEMSamplingFraction::m_energy_inactive_esc {nullptr}
private

Definition at line 67 of file LarEMSamplingFraction.h.

67{nullptr};

◆ m_energy_inactive_inv

std::vector<float>* LarEMSamplingFraction::m_energy_inactive_inv {nullptr}
private

Definition at line 66 of file LarEMSamplingFraction.h.

66{nullptr};

◆ m_energy_inactive_nonem

std::vector<float>* LarEMSamplingFraction::m_energy_inactive_nonem {nullptr}
private

Definition at line 65 of file LarEMSamplingFraction.h.

65{nullptr};

◆ m_energy_inactive_total

std::vector<float>* LarEMSamplingFraction::m_energy_inactive_total {nullptr}
private

Definition at line 63 of file LarEMSamplingFraction.h.

63{nullptr};

◆ m_energy_reco

std::vector<float>* LarEMSamplingFraction::m_energy_reco {nullptr}
private

Definition at line 60 of file LarEMSamplingFraction.h.

60{nullptr};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< 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 79 of file AthAlgorithm.h.

◆ m_fSamplKey

SG::ReadCondHandleKey<ILArfSampl> LarEMSamplingFraction::m_fSamplKey {this,"fSamplKey","LArfSamplSym","SG Key of LArfSampl object"}
private

Definition at line 91 of file LarEMSamplingFraction.h.

91{this,"fSamplKey","LArfSamplSym","SG Key of LArfSampl object"};

◆ m_mc_e

double LarEMSamplingFraction::m_mc_e {0.}
private

Definition at line 48 of file LarEMSamplingFraction.h.

48{0.};

◆ m_mc_eta

double LarEMSamplingFraction::m_mc_eta {0.}
private

Definition at line 46 of file LarEMSamplingFraction.h.

46{0.};

◆ m_mc_pdg

int LarEMSamplingFraction::m_mc_pdg {0}
private

Definition at line 45 of file LarEMSamplingFraction.h.

45{0};

◆ m_mc_phi

double LarEMSamplingFraction::m_mc_phi {0.}
private

Definition at line 47 of file LarEMSamplingFraction.h.

47{0.};

◆ m_mc_pt

double LarEMSamplingFraction::m_mc_pt {0.}
private

Definition at line 49 of file LarEMSamplingFraction.h.

49{0.};

◆ m_mytree

TTree* LarEMSamplingFraction::m_mytree {nullptr}
private

Definition at line 76 of file LarEMSamplingFraction.h.

76{nullptr};

◆ m_tileCabling

const TileCablingService* LarEMSamplingFraction::m_tileCabling {nullptr}
private

Definition at line 89 of file LarEMSamplingFraction.h.

89{nullptr};

◆ m_tileCablingSvc

ServiceHandle<TileCablingSvc> LarEMSamplingFraction::m_tileCablingSvc
private
Initial value:
{ this,
"TileCablingSvc", "TileCablingSvc", "Tile cabling service"}

Name of Tile cabling service.

Definition at line 102 of file LarEMSamplingFraction.h.

102 { this,
103 "TileCablingSvc", "TileCablingSvc", "Tile cabling service"};

◆ m_tileHWID

const TileHWID* LarEMSamplingFraction::m_tileHWID {nullptr}
private

Definition at line 88 of file LarEMSamplingFraction.h.

88{nullptr};

◆ m_tileID

const TileID* LarEMSamplingFraction::m_tileID {nullptr}
private

Definition at line 87 of file LarEMSamplingFraction.h.

87{nullptr};

◆ m_tileSamplingFractionKey

SG::ReadCondHandleKey<TileSamplingFraction> LarEMSamplingFraction::m_tileSamplingFractionKey
private
Initial value:
{this,
"TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"}

Name of TileSamplingFraction in condition store.

Definition at line 96 of file LarEMSamplingFraction.h.

96 {this,
97 "TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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