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

#include <GetLCDeadMaterialTree.h>

Inheritance diagram for GetLCDeadMaterialTree:
Collaboration diagram for GetLCDeadMaterialTree:

Public Member Functions

 GetLCDeadMaterialTree (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~GetLCDeadMaterialTree ()
virtual StatusCode initialize ()
virtual StatusCode execute (const EventContext &ctx)
 Execute method.
virtual StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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

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 std::pair< std::string, xAOD::CaloCluster::MomentTypemoment_name_pair
typedef std::vector< moment_name_pairmoment_name_vector
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

std::string m_HadDMCoeffInitFile
 Name of text file with initial parameters for coefficients calculation.
TTree * m_outputTree
 Output tree.
std::string m_outputFileName
 Name of the output file to save tree in.
TFile * m_outputFile
 Output file to save tree in.
SG::ReadHandleKey< xAOD::CaloClusterContainerm_clusterCollName
 Name of the uncalibrated CaloClusterContainer to use.
SG::ReadHandleKey< xAOD::CaloClusterContainerm_clusterCollNameCalib
 Name of the calibrated CaloClusterContainer to use.
CaloLocalHadCoeffm_HadDMCoeff
 Collection of dead material correction coeffitients.
CaloHadDMCoeffDatam_data
 data to save into the tree
bool m_doSaveCalibClusInfo
 save additional cluster info from calibrated collections
double m_energyMin
std::vector< xAOD::CaloCluster::MomentTypem_momentForDMArea
const CaloCell_IDm_calo_id
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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 33 of file GetLCDeadMaterialTree.h.

Member Typedef Documentation

◆ moment_name_pair

Definition at line 94 of file GetLCDeadMaterialTree.h.

◆ moment_name_vector

Definition at line 95 of file GetLCDeadMaterialTree.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ GetLCDeadMaterialTree()

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

Definition at line 58 of file GetLCDeadMaterialTree.cxx.

60 : AthAlgorithm(name, pSvcLocator),
61 m_HadDMCoeffInitFile("CaloHadDMCoeff_init_v2.txt"),
62 m_outputTree(nullptr),
63 m_outputFileName("DeadMaterialTree.root"),
64 m_outputFile(nullptr),
65 m_clusterCollName("CaloTopoClusters"),
66 m_HadDMCoeff(nullptr),
67 m_data(nullptr),
69 m_energyMin(200*MeV),
70 m_calo_id(nullptr)
71{
72
73 // dead material zone description
74 declareProperty("HadDMCoeffInitFile",m_HadDMCoeffInitFile);
75
76 // Name of output file to save histograms in
77 declareProperty("OutputFileName",m_outputFileName);
78
79 // Name of ClusterContainer (uncalibrated) to use
80 declareProperty("ClusterCollectionName",m_clusterCollName);
81
82 // Name of ClusterContainer (calibrated) to use
83 declareProperty("ClusterCollectionNameCalib",m_clusterCollNameCalib);
84
85 // to save additional info from the collection with calibrated clusters
86 declareProperty("doSaveCalibClusInfo", m_doSaveCalibClusInfo);
87
88}
static const double MeV
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
CaloLocalHadCoeff * m_HadDMCoeff
Collection of dead material correction coeffitients.
std::string m_outputFileName
Name of the output file to save tree in.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterCollNameCalib
Name of the calibrated CaloClusterContainer to use.
const CaloCell_ID * m_calo_id
bool m_doSaveCalibClusInfo
save additional cluster info from calibrated collections
TTree * m_outputTree
Output tree.
std::string m_HadDMCoeffInitFile
Name of text file with initial parameters for coefficients calculation.
CaloHadDMCoeffData * m_data
data to save into the tree
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterCollName
Name of the uncalibrated CaloClusterContainer to use.
TFile * m_outputFile
Output file to save tree in.

◆ ~GetLCDeadMaterialTree()

GetLCDeadMaterialTree::~GetLCDeadMaterialTree ( )
virtual

Definition at line 95 of file GetLCDeadMaterialTree.cxx.

96{
97 if( m_HadDMCoeff ) delete m_HadDMCoeff;
98}

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()

StatusCode GetLCDeadMaterialTree::execute ( const EventContext & ctx)
virtual

Execute method.

Implements AthAlgorithm.

Definition at line 190 of file GetLCDeadMaterialTree.cxx.

191{
192 //bool useLink = true;
193
194 /* ********************************************
195 access to cluster container
196 ******************************************** */
197 SG::ReadHandle<xAOD::CaloClusterContainer> pClusColl (m_clusterCollName, ctx);
198
199 /* ********************************************
200 reading primary particle
201 ******************************************** */
202 const McEventCollection* truthEvent=nullptr;
203 ATH_CHECK( evtStore()->retrieve(truthEvent, "TruthEvent") );
204 const HepMC::ConstGenParticlePtr& gen = truthEvent->at(0)->particles().front();
205
206 double mc_eta = gen->momentum().pseudoRapidity();
207 double mc_phi = gen->momentum().phi();
208
209 m_data->clear();
210
211 m_data->m_mc_pdg = gen->pdg_id();
212 m_data->m_mc_ener = gen->momentum().e();
213 m_data->m_mc_eta = mc_eta;
214 m_data->m_mc_phi = mc_phi;
215
216 int nClus = pClusColl->size();
217 m_data->m_ncls = nClus;
218 m_data->m_cls_ener->resize(nClus, 0.0);
219 m_data->m_cls_ener_unw->resize(nClus, 0.0);
220 m_data->m_cls_lambda->resize(nClus, 0.0);
221 m_data->m_cls_eta->resize(nClus, 0.0);
222 m_data->m_cls_phi->resize(nClus, 0.0);
223 //m_data->m_cls_emfrac->resize(nClus, 0.0);
224 m_data->m_cls_smpener->resize(nClus);
225 m_data->m_cls_smpener_unw->resize(nClus);
226 //m_data->m_cls_ibin->resize(nClus);
227 m_data->m_cls_eprep->resize(nClus);
228 m_data->m_cls_dmener->resize(nClus);
229 m_data->m_narea = m_HadDMCoeff->getSizeAreaSet();
230 for(int i_cls=0; i_cls<nClus; i_cls++){
231 //(*m_cls_ibin)[i_cls].resize(m_narea, -1);
232 (*m_data->m_cls_smpener)[i_cls].resize(CaloSampling::Unknown, 0.0);
233 (*m_data->m_cls_smpener_unw)[i_cls].resize(CaloSampling::Unknown, 0.0);
234 (*m_data->m_cls_eprep)[i_cls].resize(m_data->m_narea, 0.0);
235 (*m_data->m_cls_dmener)[i_cls].resize(m_data->m_narea, 0.0);
236 }
237 m_data->m_cls_engcalib->resize(nClus, 0.0);
238 m_data->m_cls_recostat->resize(nClus, 0);
239 m_data->m_cls_pi0prob->resize(nClus, 0.0);
240 m_data->m_cls_isol->resize(nClus, 0.0);
241 m_data->m_cls_oocener->resize(nClus, 0.0);
242 m_data->m_cls_calib_emfrac->resize(nClus, 0.0);
243 m_data->m_cls_engcalibpres->resize(nClus, 0.0);
244
245 xAOD::CaloClusterContainer::const_iterator clusIter = pClusColl->begin();
246 xAOD::CaloClusterContainer::const_iterator clusIterEnd = pClusColl->end();
247 unsigned int iClus = 0;
248 for( ;clusIter!=clusIterEnd;++clusIter,++iClus) {
249 const xAOD::CaloCluster * theCluster = (*clusIter);
250
251 (*m_data->m_cls_ener)[iClus] = theCluster->e();
252 // cluster energy in samplings
253 for(int i_smp=0; i_smp<(int)CaloSampling::Unknown; i_smp++){
254 (*m_data->m_cls_smpener)[iClus][i_smp] = theCluster->eSample((CaloSampling::CaloSample)i_smp);
255 }
256
257 // calibration energy of clusters
258 double mx_calib_tot=0;
259 if( !theCluster->retrieveMoment( xAOD::CaloCluster::ENG_CALIB_TOT, mx_calib_tot) ) {
260 ATH_MSG_ERROR( "Moment ENG_CALIB_TOT is absent" );
261 return StatusCode::FAILURE;
262 }
263 m_data->m_engClusSumCalib += mx_calib_tot;
264 (*m_data->m_cls_engcalib)[iClus] = mx_calib_tot;
265
266 double mx_calib_emb0=0, mx_calib_eme0=0, mx_calib_tileg3=0;
267 if( !theCluster->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_EMB0, mx_calib_emb0)
268 || !theCluster->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_EME0, mx_calib_eme0)
269 || !theCluster->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_TILEG3, mx_calib_tileg3)){
270 ATH_MSG_ERROR( "One of the moment ENG_CALIB_EMB0, ENG_CALIB_EME0, ENG_CALIB_TILEG3 is absent" );
271 return StatusCode::FAILURE;
272 }else{
273 (*m_data->m_cls_engcalibpres)[iClus] = (mx_calib_emb0+mx_calib_eme0+mx_calib_tileg3);
274 }
275
277 SG::ReadHandle<xAOD::CaloClusterContainer> pClusCollCalib (m_clusterCollNameCalib, ctx);
278 if(pClusColl->size() != pClusCollCalib->size()) {
279 ATH_MSG_WARNING( "Different size of calibrated and uncalibrated cluster collection "
280 << pClusColl->size() << " " << pClusCollCalib->size() );
281 return StatusCode::SUCCESS;
282 }
283
284 const xAOD::CaloCluster * theClusterCalib = pClusCollCalib->at(iClus);
285
286 // reco status
287 const CaloRecoStatus& recoStatus = theClusterCalib->recoStatus();
288
289 (*m_data->m_cls_recostat)[iClus] = recoStatus.getStatusWord();
290
291 // classification pi0 probability (available on calibrated cluster)
292 double pi0Prob = 0;
293 if( !theClusterCalib->retrieveMoment( xAOD::CaloCluster::EM_PROBABILITY, pi0Prob) ) {
294 //ATH_MSG_ERROR( "Moment ENG_CALIB_TOT is absent" );
295 pi0Prob = -1.0;
296 } else {
297 if ( pi0Prob < 0 ) pi0Prob = 0;
298 if ( pi0Prob > 1 ) pi0Prob = 1;
299 }
300 (*m_data->m_cls_pi0prob)[iClus] = pi0Prob;
301 } // m_doSaveCalibClusInfo
302
303 // cluster isolation moment and out of cluster energy
304 double mx_isol;
305 if ( !theCluster->retrieveMoment(xAOD::CaloCluster::ISOLATION, mx_isol)) {
306 ATH_MSG_ERROR( "Moment ISOLATION is absent" );
307 return StatusCode::FAILURE;
308 }else{
309 (*m_data->m_cls_isol)[iClus] = mx_isol;
310 }
311
312 double mx_calib_oocL;
313 if ( !theCluster->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_OUT_L, mx_calib_oocL)) {
314 ATH_MSG_ERROR( "Moment ENG_CALIB_OUT_L is absent" );
315 return StatusCode::FAILURE;
316 }else{
317 (*m_data->m_cls_oocener)[iClus] = mx_calib_oocL;
318 }
319
320 double mx_calib_emfrac;
321 if ( !theCluster->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_FRAC_EM, mx_calib_emfrac)) {
322 ATH_MSG_WARNING( "Moment ENG_CALIB_FRAC_EM is absent" );
323 return StatusCode::FAILURE;
324 }else{
325 (*m_data->m_cls_calib_emfrac)[iClus] = mx_calib_emfrac;
326 }
327
328
329 // calculation of cluster energy and energy in samplings without accounting
330 // cells weights
331 xAOD::CaloCluster::const_cell_iterator cellIter = theCluster->cell_begin();
332 xAOD::CaloCluster::const_cell_iterator cellIterEnd = theCluster->cell_end();
333 for(; cellIter != cellIterEnd; cellIter++ ){
334 const CaloCell* pCell = (*cellIter);
335 Identifier myId = pCell->ID();
337 (*m_data->m_cls_ener_unw)[iClus] += pCell->e();
338 (*m_data->m_cls_smpener_unw)[iClus][(int)nsmp] += pCell->e();
339 }
340
341 double clusEner = (*m_data->m_cls_ener_unw)[iClus];
342 double clusLambda=0;
343 if (!theCluster->retrieveMoment(xAOD::CaloCluster::CENTER_LAMBDA,clusLambda)) {
344 ATH_MSG_WARNING( "Moment CENTER_LAMBDA is absent" );
345 return StatusCode::FAILURE;
346 }
347 (*m_data->m_cls_lambda)[iClus] = clusLambda;
348 (*m_data->m_cls_eta)[iClus] = theCluster->eta();
349 (*m_data->m_cls_phi)[iClus] = theCluster->phi();
350 if(clusEner > m_energyMin ) {
351 //clusEner = log10(clusEner);
352 //if(clusEner > 6.3) clusEner = 6.2999;
353 //clusLambda = log10(clusLambda);
354 //if(clusLambda > 4.0) clusLambda = 3.9999;
355 //double clusEta=fabs(theCluster->eta());
356
357 for(int i_dma=0; i_dma<m_data->m_narea; i_dma++){
358 //(*m_cls_ibin)[iClus][i_dma] = m_HadDMCoeff->getBin(i_dma, (float)clusEmFrac, (float)clusEner, (float)clusLambda, (float)clusEta);
359 double dmVal=0;
360 if (!theCluster->retrieveMoment( m_momentForDMArea[i_dma],dmVal)) {
361 ATH_MSG_WARNING( "Moment "<< m_momentForDMArea[i_dma] << " is absent" );
362 return StatusCode::FAILURE;
363 }
364 (*m_data->m_cls_dmener)[iClus][i_dma] = dmVal;
365
366 // now we have to calculate cluster quantities which we will use later for
367 // reconstruction of given dead material calibration moment
368 double eprep = 0.0;
369 double x(0), y(0);
370 switch ( m_momentForDMArea[i_dma] ) {
372 x = (*m_data->m_cls_smpener_unw)[iClus][CaloSampling::PreSamplerB];
373 if(x > 0.0) {
374 eprep = x;
375 }
376 break;
378 x = (*m_data->m_cls_smpener_unw)[iClus][CaloSampling::EMB3];
379 y = (*m_data->m_cls_smpener_unw)[iClus][CaloSampling::TileBar0];
380 if(x>0.0 && y>0.0) {
381 eprep = sqrt(x*y);
382 }
383 break;
385 x = (*m_data->m_cls_smpener_unw)[iClus][CaloSampling::TileGap3];
386 if(x > 0.0) {
387 eprep = x;
388 }
389 break;
391 x = (*m_data->m_cls_smpener_unw)[iClus][CaloSampling::PreSamplerE];
392 if( x > 0.0 ) {
393 eprep = x;
394 }
395 break;
397 x = (*m_data->m_cls_smpener_unw)[iClus][CaloSampling::EME3];
398 y = (*m_data->m_cls_smpener_unw)[iClus][CaloSampling::HEC0];
399 if(x>0.0 && y>0.0) {
400 eprep = sqrt(x*y);
401 }
402 break;
404 eprep = (*m_data->m_cls_ener_unw)[iClus];
405 break;
407 eprep = (*m_data->m_cls_ener_unw)[iClus];
408 break;
410 eprep = (*m_data->m_cls_ener_unw)[iClus];
411 break;
412 default:
413 ATH_MSG_ERROR( "No such moment registered " << m_momentForDMArea[i_dma] );
414 return StatusCode::FAILURE;
415 break;
416 }
417 (*m_data->m_cls_eprep)[iClus][i_dma] = eprep;
418
419 } // loop over dm areas
420
421 } // good cluster
422 } // loop over clusters
423
424 // now we have to process special case, when we have DM energy, say, in front of the
425 // calorimeter but there is no signal in presampler itself. When we have to add this
426 // DM energy into 'unclassified' area
427 for(int i_cls=0; i_cls<m_data->m_ncls; i_cls++){
428 double edm_uncorrected = 0.0;
429 for(int i_dma=0; i_dma<m_data->m_narea; i_dma++){
431 if( (*m_data->m_cls_eprep)[i_cls][i_dma] <= 0.0 &&
437 {
438 edm_uncorrected += (*m_data->m_cls_dmener)[i_cls][i_dma];
439 (*m_data->m_cls_dmener)[i_cls][i_dma] = 0.0;
440 }
441 } // i_dma
442 // now let's put this energy into unclassified area
443 for(int i_dma=0; i_dma<m_data->m_narea; i_dma++){
445 (*m_data->m_cls_dmener)[i_cls][i_dma] += edm_uncorrected;
446 }
447 } // i_dma
448 } // i_cls
449
450 m_outputTree->Fill();
451
452 return StatusCode::SUCCESS;
453}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define y
#define x
ServiceHandle< StoreGateSvc > & evtStore()
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition CaloCell.h:333
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition CaloCell.h:295
virtual const store_type & getStatusWord() const
retrieve the entire status word
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const T * at(size_type n) const
Access an element, as an rvalue.
std::vector< xAOD::CaloCluster::MomentType > m_momentForDMArea
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
CaloClusterCellLink::const_iterator const_cell_iterator
Iterator of the underlying CaloClusterCellLink (explicitly const version).
const_cell_iterator cell_end() const
float eSample(const CaloSample sampling) const
virtual double phi() const
The azimuthal angle ( ) of the particle.
MomentType
Enums to identify different moments.
@ ENG_CALIB_OUT_L
Attached Calibration Hit energy outside clusters but inside the calorimeter with loose matching (Angl...
@ EM_PROBABILITY
Classification probability to be em-like.
@ ENG_CALIB_DEAD_UNCLASS
Attached Calibration Hit energy in dead material in unclassified areas of the detector.
@ ENG_CALIB_DEAD_HEC0
Attached Calibration Hit energy in dead material between EME3 and HEC0.
@ ENG_CALIB_DEAD_TILEG3
Attached Calibration Hit energy in dead material before scintillator.
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ ENG_CALIB_DEAD_EME0
Attached Calibration Hit energy in dead material before EME0, between EME0 and EME1.
@ ENG_CALIB_DEAD_TILE0
Attached Calibration Hit energy in dead material between EMB3 and TILE0.
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
@ ENG_CALIB_DEAD_FCAL
Attached Calibration Hit energy in dead material before FCAL, between FCAL and HEC.
@ ENG_CALIB_TOT
Calibration Hit energy inside the cluster.
@ ENG_CALIB_DEAD_LEAKAGE
Attached Calibration Hit energy in dead material behind calorimeters.
@ ENG_CALIB_EMB0
Calibration Hit energy inside the cluster barrel presampler.
@ ENG_CALIB_EME0
Calibration Hit energy inside the cluster endcap presampler.
@ ENG_CALIB_DEAD_EMB0
Attached Calibration Hit energy in dead material before EMB0, between EMB0 and EMB1.
@ ISOLATION
Energy weighted fraction of non-clustered perimeter cells.
@ ENG_CALIB_TILEG3
Calibration Hit energy inside the cluster scintillator.
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version).
CaloRecoStatus & recoStatus()
Accesssor to CaloRecoStatus (non-const).
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
Definition GenParticle.h:20
virtual bool resize(size_t sz) override
Change the size of all aux data vectors.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ 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 & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode GetLCDeadMaterialTree::finalize ( )
virtual

Definition at line 175 of file GetLCDeadMaterialTree.cxx.

176{
177 ATH_MSG_INFO( "Writing out tree" );
178 m_outputFile->cd();
179 m_outputTree->Write();
180 m_outputFile->Close();
181
182 return StatusCode::SUCCESS;
183}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode GetLCDeadMaterialTree::initialize ( )
virtual

Definition at line 105 of file GetLCDeadMaterialTree.cxx.

106{
107 ATH_CHECK(detStore()->retrieve(m_calo_id, "CaloCell_ID"));
108
109 /* ********************************************
110 set list of valid moments
111 ******************************************** */
112 moment_name_vector validNames;
113 validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_EMB0"),xAOD::CaloCluster::ENG_CALIB_DEAD_EMB0));
114 validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_TILE0"),xAOD::CaloCluster::ENG_CALIB_DEAD_TILE0));
115 validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_TILEG3"),xAOD::CaloCluster::ENG_CALIB_DEAD_TILEG3));
116 validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_EME0"),xAOD::CaloCluster::ENG_CALIB_DEAD_EME0));
117 validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_HEC0"),xAOD::CaloCluster::ENG_CALIB_DEAD_HEC0));
118 validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_FCAL"),xAOD::CaloCluster::ENG_CALIB_DEAD_FCAL));
119 validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_LEAKAGE"),xAOD::CaloCluster::ENG_CALIB_DEAD_LEAKAGE));
120 validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_UNCLASS"),xAOD::CaloCluster::ENG_CALIB_DEAD_UNCLASS));
121
122 /* ********************************************
123 initial coefficients
124 ******************************************** */
125 CaloLocalHadCoeffHelper dmHelper;
126 std::string fileName = PathResolver::find_file (m_HadDMCoeffInitFile, "DATAPATH");
127 m_HadDMCoeff = dmHelper.InitDataFromFile(fileName.c_str());
128 if( !m_HadDMCoeff ) {
129 ATH_MSG_FATAL( " Error while initializing default dead material coefficients " );
130 return StatusCode::FAILURE;
131 }
132 // how we have to set correspondance between dead material areas and calibration moments
133 m_momentForDMArea.resize( m_HadDMCoeff->getSizeAreaSet());
134 for(int i_dm=0; i_dm<m_HadDMCoeff->getSizeAreaSet(); i_dm++){
135 bool isValid(false);
136 for (const moment_name_pair& vname : validNames) {
137 if ( m_HadDMCoeff->getArea(i_dm)->getTitle() == vname.first ) {
138 m_momentForDMArea[i_dm] = vname.second;
139 isValid = true;
140 break;
141 }
142 }
143 if ( !isValid) {
144 ATH_MSG_FATAL( " Unknown moment name '" << m_HadDMCoeff->getArea(i_dm)->getTitle() << "' in the m_HadDMCoeff!" );
145 return StatusCode::FAILURE;
146 }
147 }
148
149 /* ********************************************
150 output file&tree
151 ******************************************** */
152 m_data = new CaloHadDMCoeffData(nullptr);
153
154 m_outputFile = new TFile(m_outputFileName.c_str(),"RECREATE");
155 m_outputFile->cd();
156
157 m_outputTree = m_data->MakeTree("DeadMaterialTree");
158
159 ATH_CHECK( m_clusterCollName.initialize() );
161 ATH_CHECK( m_clusterCollNameCalib.initialize() );
162 }
163 else {
165 }
166
167 return StatusCode::SUCCESS;
168}
#define ATH_MSG_FATAL(x)
const ServiceHandle< StoreGateSvc > & detStore() const
CaloLocalHadCoeff * InitDataFromFile(const char *fname)
std::pair< std::string, xAOD::CaloCluster::MomentType > moment_name_pair
std::vector< moment_name_pair > moment_name_vector
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)

◆ 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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ 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()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::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, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
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_calo_id

const CaloCell_ID* GetLCDeadMaterialTree::m_calo_id
private

Definition at line 98 of file GetLCDeadMaterialTree.h.

◆ m_clusterCollName

SG::ReadHandleKey<xAOD::CaloClusterContainer> GetLCDeadMaterialTree::m_clusterCollName
private

Name of the uncalibrated CaloClusterContainer to use.

Definition at line 72 of file GetLCDeadMaterialTree.h.

◆ m_clusterCollNameCalib

SG::ReadHandleKey<xAOD::CaloClusterContainer> GetLCDeadMaterialTree::m_clusterCollNameCalib
private

Name of the calibrated CaloClusterContainer to use.

Definition at line 76 of file GetLCDeadMaterialTree.h.

◆ m_data

CaloHadDMCoeffData* GetLCDeadMaterialTree::m_data
private

data to save into the tree

Definition at line 84 of file GetLCDeadMaterialTree.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_doSaveCalibClusInfo

bool GetLCDeadMaterialTree::m_doSaveCalibClusInfo
private

save additional cluster info from calibrated collections

Definition at line 88 of file GetLCDeadMaterialTree.h.

◆ m_energyMin

double GetLCDeadMaterialTree::m_energyMin
private

Definition at line 91 of file GetLCDeadMaterialTree.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 AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_HadDMCoeff

CaloLocalHadCoeff* GetLCDeadMaterialTree::m_HadDMCoeff
private

Collection of dead material correction coeffitients.

Definition at line 80 of file GetLCDeadMaterialTree.h.

◆ m_HadDMCoeffInitFile

std::string GetLCDeadMaterialTree::m_HadDMCoeffInitFile
private

Name of text file with initial parameters for coefficients calculation.

File contains binning info for cluster's emfrac, log10ener, log10lambda and eta to recover energy losses in specific dead material zones

Definition at line 49 of file GetLCDeadMaterialTree.h.

◆ m_momentForDMArea

std::vector<xAOD::CaloCluster::MomentType> GetLCDeadMaterialTree::m_momentForDMArea
private

Definition at line 96 of file GetLCDeadMaterialTree.h.

◆ m_outputFile

TFile* GetLCDeadMaterialTree::m_outputFile
private

Output file to save tree in.

Internal variable pointing to the output file.

Definition at line 68 of file GetLCDeadMaterialTree.h.

◆ m_outputFileName

std::string GetLCDeadMaterialTree::m_outputFileName
private

Name of the output file to save tree in.

Use this property to set the name of the output file containing the DM data tree.

Definition at line 62 of file GetLCDeadMaterialTree.h.

◆ m_outputTree

TTree* GetLCDeadMaterialTree::m_outputTree
private

Output tree.

Output tree to fill and save.

Definition at line 55 of file GetLCDeadMaterialTree.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: