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 "k4FWCore/DataHandle.h"
9#include "k4Interface/IGeoSvc.h"
10
11// EDM4hep & Podio
12#include "edm4hep/CalorimeterHitCollection.h"
13#include "edm4hep/MCParticleCollection.h"
14#include "podio/UserDataCollection.h"
15
30class EnergyInCaloLayers : public Gaudi::Algorithm {
31public:
32 explicit EnergyInCaloLayers(const std::string&, ISvcLocator*);
33 virtual ~EnergyInCaloLayers();
37 virtual StatusCode initialize() final;
41 virtual StatusCode execute(const EventContext&) const final;
45 virtual StatusCode finalize() final;
46
47private:
49 mutable k4FWCore::DataHandle<edm4hep::CalorimeterHitCollection> m_deposits{"det/caloDeposits",
50 Gaudi::DataHandle::Reader, this};
52 mutable k4FWCore::DataHandle<edm4hep::MCParticleCollection> m_particle{"det/particles", Gaudi::DataHandle::Reader,
53 this};
55 mutable k4FWCore::DataHandle<podio::UserDataCollection<double>> m_energyInLayer{"energyInLayer",
56 Gaudi::DataHandle::Writer, this};
58 mutable k4FWCore::DataHandle<podio::UserDataCollection<double>> m_energyInCryo{"energyInCryo",
59 Gaudi::DataHandle::Writer, this};
61 mutable k4FWCore::DataHandle<podio::UserDataCollection<double>> m_particleVec{"particleVec",
62 Gaudi::DataHandle::Writer, this};
63
65 ServiceHandle<IGeoSvc> m_geoSvc;
66
68 Gaudi::Property<size_t> m_numLayers{this, "numLayers", 11, "Number of layers"};
70 Gaudi::Property<std::vector<double>> m_samplingFractions{
71 this, "samplingFractions", {}, "Values of sampling fraction per layer"};
73 Gaudi::Property<std::string> m_readoutName{this, "readoutName", "", "Name of the readout"};
74};
75
76#endif /* DETSTUDIES_ENERGYINCALOLAYERS_H */
Sums energy deposited in every calorimeter layer separately, sums also energy deposited in the dead m...
Definition EnergyInCaloLayers.h:30
k4FWCore::DataHandle< podio::UserDataCollection< double > > m_particleVec
Handle for initial particle vector.
Definition EnergyInCaloLayers.h:61
k4FWCore::DataHandle< edm4hep::CalorimeterHitCollection > m_deposits
Handle for the energy deposits.
Definition EnergyInCaloLayers.h:49
EnergyInCaloLayers(const std::string &, ISvcLocator *)
Definition EnergyInCaloLayers.cpp:13
virtual StatusCode initialize() final
Initialize.
Definition EnergyInCaloLayers.cpp:25
ServiceHandle< IGeoSvc > m_geoSvc
Pointer to the geometry service.
Definition EnergyInCaloLayers.h:65
virtual ~EnergyInCaloLayers()
Definition EnergyInCaloLayers.cpp:23
k4FWCore::DataHandle< podio::UserDataCollection< double > > m_energyInLayer
Handle for vector with energy deposited in every layer.
Definition EnergyInCaloLayers.h:55
virtual StatusCode execute(const EventContext &) const final
Fills the histograms.
Definition EnergyInCaloLayers.cpp:59
Gaudi::Property< size_t > m_numLayers
Number of layers/cells cells.
Definition EnergyInCaloLayers.h:68
Gaudi::Property< std::vector< double > > m_samplingFractions
Values of sampling fraction.
Definition EnergyInCaloLayers.h:70
Gaudi::Property< std::string > m_readoutName
Name of the detector readout.
Definition EnergyInCaloLayers.h:73
virtual StatusCode finalize() final
Finalize.
Definition EnergyInCaloLayers.cpp:143
k4FWCore::DataHandle< podio::UserDataCollection< double > > m_energyInCryo
Handle for vector with energy deposited in cryostat and in its parts.
Definition EnergyInCaloLayers.h:58
k4FWCore::DataHandle< edm4hep::MCParticleCollection > m_particle
Handle for the particle.
Definition EnergyInCaloLayers.h:52