k4SimGeant4
Loading...
Searching...
No Matches
SamplingFractionInLayers.h
Go to the documentation of this file.
1#ifndef DETSTUDIES_SAMPLINGFRACTIONINLAYERS_H
2#define DETSTUDIES_SAMPLINGFRACTIONINLAYERS_H
3
4// GAUDI
5#include "Gaudi/Algorithm.h"
6#include "GaudiKernel/ServiceHandle.h"
7
8// FCCSW
9#include "k4FWCore/DataHandle.h"
10class IGeoSvc;
11
12// datamodel
13namespace edm4hep {
14class SimCalorimeterHitCollection;
15}
16
17class TH1F;
18class ITHistSvc;
29class SamplingFractionInLayers : public Gaudi::Algorithm {
30public:
31 explicit SamplingFractionInLayers(const std::string&, ISvcLocator*);
36 virtual StatusCode initialize() final;
40 virtual StatusCode execute(const EventContext&) const final;
44 virtual StatusCode finalize() final;
45
46private:
48 ServiceHandle<ITHistSvc> m_histSvc;
50 ServiceHandle<IGeoSvc> m_geoSvc;
52 mutable DataHandle<edm4hep::SimCalorimeterHitCollection> m_deposits{"rec/caloHits", Gaudi::DataHandle::Reader, this};
54 Gaudi::Property<std::string> m_activeFieldName{this, "activeFieldName", "", "Identifier of active material"};
56 Gaudi::Property<int> m_activeFieldValue{this, "activeFieldValue", 0, "Value of identifier for active material"};
58 Gaudi::Property<std::string> m_layerFieldName{this, "layerFieldName", "", "Identifier of layers"};
60 Gaudi::Property<uint> m_numLayers{this, "numLayers", 8, "Number of layers"};
62 Gaudi::Property<uint> m_firstLayerId{this, "firstLayerId", 0, "ID of first layer"};
64 Gaudi::Property<std::string> m_readoutName{this, "readoutName", "", "Name of the detector readout"};
65 // Maximum energy for the axis range
66 Gaudi::Property<double> m_energy{this, "energyAxis", 500, "Maximum energy for axis range"};
67 // Histograms of total deposited energy within layer
68 // Layers are numbered starting at 1. Layer 0 includes total energy deposited in cryostat and bath (in front and
69 // behind calo)
70 std::vector<TH1F*> m_totalEnLayers;
71 // Histogram of total deposited energy in the calorimeter (in active and passive material, excluding cryostat and
72 // bath)
74 // Histograms of energy deposited in the active material within layer
75 std::vector<TH1F*> m_activeEnLayers;
76 // Histogram of energy deposited in the active material of the calorimeter
78 // Histograms of sampling fraction (active/total energy) calculated within layer
79 std::vector<TH1F*> m_sfLayers;
80 // Histogram of sampling fraction (active/total energy) calculated for the calorimeter (excluding cryostat and bath)
81 TH1F* m_sf;
82};
83#endif /* DETSTUDIES_SAMPLINGFRACTIONINLAYERS_H */
Histograms of energy deposited in active material and total energy deposited in the calorimeter.
Definition SamplingFractionInLayers.h:29
Gaudi::Property< uint > m_numLayers
Number of layers/cells.
Definition SamplingFractionInLayers.h:60
std::vector< TH1F * > m_totalEnLayers
Definition SamplingFractionInLayers.h:70
Gaudi::Property< std::string > m_layerFieldName
Name of the layer/cell field.
Definition SamplingFractionInLayers.h:58
Gaudi::Property< int > m_activeFieldValue
Value of the active material.
Definition SamplingFractionInLayers.h:56
SamplingFractionInLayers(const std::string &, ISvcLocator *)
Definition SamplingFractionInLayers.cpp:19
Gaudi::Property< uint > m_firstLayerId
Id of the first layer.
Definition SamplingFractionInLayers.h:62
TH1F * m_totalEnergy
Definition SamplingFractionInLayers.h:73
Gaudi::Property< std::string > m_readoutName
Name of the detector readout.
Definition SamplingFractionInLayers.h:64
virtual StatusCode execute(const EventContext &) const final
Fills the histograms.
Definition SamplingFractionInLayers.cpp:80
ServiceHandle< IGeoSvc > m_geoSvc
Pointer to the geometry service.
Definition SamplingFractionInLayers.h:50
TH1F * m_sf
Definition SamplingFractionInLayers.h:81
ServiceHandle< ITHistSvc > m_histSvc
Pointer to the interface of histogram service.
Definition SamplingFractionInLayers.h:48
virtual StatusCode initialize() final
Initialize.
Definition SamplingFractionInLayers.cpp:30
virtual StatusCode finalize() final
Finalize.
Definition SamplingFractionInLayers.cpp:127
std::vector< TH1F * > m_sfLayers
Definition SamplingFractionInLayers.h:79
Gaudi::Property< double > m_energy
Definition SamplingFractionInLayers.h:66
TH1F * m_totalActiveEnergy
Definition SamplingFractionInLayers.h:77
Gaudi::Property< std::string > m_activeFieldName
Name of the active field.
Definition SamplingFractionInLayers.h:54
std::vector< TH1F * > m_activeEnLayers
Definition SamplingFractionInLayers.h:75
DataHandle< edm4hep::SimCalorimeterHitCollection > m_deposits
Handle for the energy deposits.
Definition SamplingFractionInLayers.h:52
virtual ~SamplingFractionInLayers()
Definition SamplingFractionInLayers.cpp:28
Definition EventInformation.h:10