k4SimGeant4
Loading...
Searching...
No Matches
EnergyInCaloLayers.h
Go to the documentation of this file.
1#ifndef DETSTUDIES_ENERGYINCALOLAYERS_H
2#define DETSTUDIES_ENERGYINCALOLAYERS_H
3
4// GAUDI
5#include "Gaudi/Algorithm.h"
6
7// Key4HEP
8#include "k4Interface/IGeoSvc.h"
9#include "k4FWCore/DataHandle.h"
10
11// EDM4hep & Podio
12#include "edm4hep/CalorimeterHitCollection.h"
13#include "edm4hep/MCParticleCollection.h"
14#include "podio/UserDataCollection.h"
15
16
31class EnergyInCaloLayers : public Gaudi::Algorithm {
32public:
33 explicit EnergyInCaloLayers(const std::string&, ISvcLocator*);
34 virtual ~EnergyInCaloLayers();
38 virtual StatusCode initialize() final;
42 virtual StatusCode execute(const EventContext&) const final;
46 virtual StatusCode finalize() final;
47
48private:
50 mutable DataHandle<edm4hep::CalorimeterHitCollection> m_deposits{"det/caloDeposits", Gaudi::DataHandle::Reader, this};
52 mutable DataHandle<edm4hep::MCParticleCollection> m_particle{"det/particles", Gaudi::DataHandle::Reader, this};
54 mutable DataHandle<podio::UserDataCollection<double>> m_energyInLayer {"energyInLayer", Gaudi::DataHandle::Writer, this};
56 mutable DataHandle<podio::UserDataCollection<double>> m_energyInCryo {"energyInCryo", Gaudi::DataHandle::Writer, this};
58 mutable DataHandle<podio::UserDataCollection<double>> m_particleVec {"particleVec", Gaudi::DataHandle::Writer, this};
59
61 ServiceHandle<IGeoSvc> m_geoSvc;
62
64 Gaudi::Property<size_t> m_numLayers{this, "numLayers", 11, "Number of layers"};
66 Gaudi::Property<std::vector<double>> m_samplingFractions{
67 this, "samplingFractions", {}, "Values of sampling fraction per layer"};
69 Gaudi::Property<std::string> m_readoutName{this, "readoutName", "", "Name of the readout"};
70};
71
72#endif /* DETSTUDIES_ENERGYINCALOLAYERS_H */
Sums energy deposited in every calorimeter layer separately, sums also energy deposited in the dead m...
Definition EnergyInCaloLayers.h:31
DataHandle< podio::UserDataCollection< double > > m_energyInCryo
Handle for vector with energy deposited in cryostat and in its parts.
Definition EnergyInCaloLayers.h:56
EnergyInCaloLayers(const std::string &, ISvcLocator *)
Definition EnergyInCaloLayers.cpp:15
DataHandle< edm4hep::MCParticleCollection > m_particle
Handle for the particle.
Definition EnergyInCaloLayers.h:52
virtual StatusCode initialize() final
Initialize.
Definition EnergyInCaloLayers.cpp:29
ServiceHandle< IGeoSvc > m_geoSvc
Pointer to the geometry service.
Definition EnergyInCaloLayers.h:61
virtual ~EnergyInCaloLayers()
Definition EnergyInCaloLayers.cpp:26
DataHandle< podio::UserDataCollection< double > > m_energyInLayer
Handle for vector with energy deposited in every layer.
Definition EnergyInCaloLayers.h:54
virtual StatusCode execute(const EventContext &) const final
Fills the histograms.
Definition EnergyInCaloLayers.cpp:63
Gaudi::Property< size_t > m_numLayers
Number of layers/cells cells.
Definition EnergyInCaloLayers.h:64
Gaudi::Property< std::vector< double > > m_samplingFractions
Values of sampling fraction.
Definition EnergyInCaloLayers.h:66
Gaudi::Property< std::string > m_readoutName
Name of the detector readout.
Definition EnergyInCaloLayers.h:69
virtual StatusCode finalize() final
Finalize.
Definition EnergyInCaloLayers.cpp:147
DataHandle< edm4hep::CalorimeterHitCollection > m_deposits
Handle for the energy deposits.
Definition EnergyInCaloLayers.h:50
DataHandle< podio::UserDataCollection< double > > m_particleVec
Handle for initial particle vector.
Definition EnergyInCaloLayers.h:58