ATLAS Offline Software
Loading...
Searching...
No Matches
ISF_HitAnalysis.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ISF_FASTCALOSIMPARAMETRIZATION_ISF_HIT_ANALYSIS_H
6#define ISF_FASTCALOSIMPARAMETRIZATION_ISF_HIT_ANALYSIS_H
7
9
12
17
22
26
28
29#include "GaudiKernel/ToolHandle.h"
30#include "GaudiKernel/ITHistSvc.h"
31#include "GaudiKernel/IPartPropSvc.h"
32
35
37#include "HepPDT/ParticleDataTable.hh"
38
39#include "CLHEP/Units/SystemOfUnits.h"
40#include <TLorentzVector.h>
41#include <Rtypes.h>
42#include <string>
43
44/* *************************************************************
45 This is a modified copy of Simulation/Tools/CaloHitAnalysis
46 Aug 27, 2013 Zdenek Hubacek (CERN)
47 ************************************************************** */
48
49namespace Trk
50{
51 class TrackingVolume;
52}
53
54class TileID;
55class TileHWID;
57class TTree;
58class LArEM_ID;
59class LArFCAL_ID;
60class LArHEC_ID;
61
62//############################
63
65
66public:
67
68 ISF_HitAnalysis(const std::string& name, ISvcLocator* pSvcLocator);
70
71 virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE () override;
72 virtual StatusCode finalize ATLAS_NOT_THREAD_SAFE () override;
73 virtual StatusCode execute(const EventContext& ctx) override;
74
75 const static int MAX_LAYER = 25;
76
77private:
78 // extrapolation through Calo
79 std::vector<Trk::HitInfo>* caloHits(const HepMC::GenParticle& part ) const;
80 void extrapolate(const HepMC::ConstGenParticlePtr& part,std::vector<Trk::HitInfo>* hitVector);
81 void extrapolate_to_ID(const HepMC::ConstGenParticlePtr& part,std::vector<Trk::HitInfo>* hitVector);
82 // Configurable properties
84 "GeoModelSvc", "GeoModelSvc", "GeoModel service"};
86 , "CaloDetDescrManager"
87 , "CaloDetDescrManager"
88 , "SG Key for CaloDetDescrManager in the Condition Store" };
90 "fSamplKey", "LArfSamplSym", "SG Key of LArfSampl object"};
91
95 "TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"};
96
100 "TileCablingSvc", "TileCablingSvc", "Tile cabling service"};
101 StringProperty m_ntupleFileName{this, "NtupleFileName", "ISF_HitAnalysis"};
102 StringProperty m_ntupleTreeName{this, "NtupleTreeName", "CaloHitAna"};
103 StringProperty m_metadataTreeName{this, "MetadataTreeName", "MetaData"};
104 StringProperty m_geoFileName{this, "GeoFileName", "ISF_Geometry"};
105 IntegerProperty m_NtruthParticles{this, "NTruthParticles", 1, "Number of truth particles saved from the truth collection, -1 to save all"};
107 "THistSvc", "THistSvc", "Tile histogramming service"};
108 PublicToolHandle<Trk::ITimedExtrapolator> m_extrapolator{this, "Extrapolator", {}};
109 PublicToolHandle<ICaloCoordinateTool> m_calo_tb_coord{this, "CaloCoordinateTool", "TBCaloCoordinate"};
110 StringProperty m_caloEntranceName{this, "CaloEntrance", ""};
112 PublicToolHandle<IFastCaloSimCaloExtrapolation> m_FastCaloSimCaloExtrapolation{this, "FastCaloSimCaloExtrapolation", {} };
113 DoubleProperty m_CaloBoundaryR{this, "CaloBoundaryR", 1148};
114 DoubleProperty m_CaloBoundaryZ{this, "CaloBoundaryZ", 3550};
115 DoubleProperty m_calomargin{this, "CaloMargin", 0.0};
116 BooleanProperty m_saveAllBranches{this,"SaveAllBranches", false};
117 BooleanProperty m_doAllCells{this, "DoAllCells", false};
118 BooleanProperty m_doClusterInfo{this, "DoClusterInfo", false};
119 BooleanProperty m_doLayers{this, "DoLayers", false};
120 BooleanProperty m_doLayerSums{this, "DoLayerSums", true};
121 BooleanProperty m_doG4Hits{this, "DoG4Hits", false};
122 IntegerProperty m_TimingCut{this, "TimingCut", 999999};
123 StringProperty m_MC_DIGI_PARAM{this, "MetaDataDigi", "/Digitization/Parameters"};
124 StringProperty m_MC_SIM_PARAM{this, "MetaDataSim", "/Simulation/Parameters"};
125
129 const TileID * m_tileID{};
132
134
136 std::vector<float>* m_hit_x{};
137 std::vector<float>* m_hit_y{};
138 std::vector<float>* m_hit_z{};
139 std::vector<float>* m_hit_energy{};
140 std::vector<float>* m_hit_time{};
141 std::vector<Long64_t>* m_hit_identifier{};
142 std::vector<Long64_t>* m_hit_cellidentifier{};
143 std::vector<bool>* m_islarbarrel{};
144 std::vector<bool>* m_islarendcap{};
145 std::vector<bool>* m_islarhec{};
146 std::vector<bool>* m_islarfcal{};
147 std::vector<bool>* m_istile{};
148 std::vector<int>* m_hit_sampling{};
149 std::vector<float>* m_hit_samplingfraction{};
150
151 std::vector<float>* m_truth_energy{};
152 std::vector<float>* m_truth_px{};
153 std::vector<float>* m_truth_py{};
154 std::vector<float>* m_truth_pz{};
155 std::vector<int>* m_truth_pdg{};
156 std::vector<int>* m_truth_barcode{};
157 std::vector<int>* m_truth_vtxbarcode{}; //production vertex barcode
158
159 std::vector<float>* m_cluster_energy{};
160 std::vector<float>* m_cluster_eta{};
161 std::vector<float>* m_cluster_phi{};
162 std::vector<unsigned>* m_cluster_size{};
163 std::vector<std::vector<Long64_t >>* m_cluster_cellID{};
164
165
166 std::vector<Long64_t>* m_cell_identifier{};
167 std::vector<float>* m_cell_energy{};
168 std::vector<int>* m_cell_sampling{};
169
170 std::vector<float>* m_g4hit_energy{};
171 std::vector<float>* m_g4hit_time{};
172 std::vector<Long64_t>* m_g4hit_identifier{};
173 std::vector<Long64_t>* m_g4hit_cellidentifier{};
174 std::vector<float>* m_g4hit_samplingfraction{};
175 std::vector<int>* m_g4hit_sampling{};
176
177 //CaloHitAna variables
178 FCS_matchedcellvector* m_oneeventcells = nullptr; //these are all matched cells in a single event
179 FCS_matchedcellvector* m_layercells[MAX_LAYER]{}; //these are all matched cells in a given layer in a given event
180
181 Float_t m_total_cell_e{};
182 Float_t m_total_hit_e{};
184
185 std::vector<Float_t>* m_final_cell_energy{};
186 std::vector<Float_t>* m_final_hit_energy{};
187 std::vector<Float_t>* m_final_g4hit_energy{};
188
189 TTree * m_tree{};
190 //####################################################
194 double m_ptruth_eta{};
195 double m_ptruth_phi{};
196 double m_ptruth_e{};
197 double m_ptruth_et{};
198 double m_ptruth_pt{};
199 double m_ptruth_p{};
200 int m_pdgid{};
201
202 std::vector<std::vector<float> >* m_newTTC_entrance_eta{};
203 std::vector<std::vector<float> >* m_newTTC_entrance_phi{};
204 std::vector<std::vector<float> >* m_newTTC_entrance_r{};
205 std::vector<std::vector<float> >* m_newTTC_entrance_z{};
206 std::vector<std::vector<float> >* m_newTTC_entrance_detaBorder{};
207 std::vector<std::vector<bool> >* m_newTTC_entrance_OK{};
208 std::vector<std::vector<float> >* m_newTTC_back_eta{};
209 std::vector<std::vector<float> >* m_newTTC_back_phi{};
210 std::vector<std::vector<float> >* m_newTTC_back_r{};
211 std::vector<std::vector<float> >* m_newTTC_back_z{};
212 std::vector<std::vector<float> >* m_newTTC_back_detaBorder{};
213 std::vector<std::vector<bool> >* m_newTTC_back_OK{};
214 std::vector<std::vector<float> >* m_newTTC_mid_eta{};
215 std::vector<std::vector<float> >* m_newTTC_mid_phi{};
216 std::vector<std::vector<float> >* m_newTTC_mid_r{};
217 std::vector<std::vector<float> >* m_newTTC_mid_z{};
218 std::vector<std::vector<float> >* m_newTTC_mid_detaBorder{};
219 std::vector<std::vector<bool> >* m_newTTC_mid_OK{};
220 std::vector<float>* m_newTTC_IDCaloBoundary_eta{};
221 std::vector<float>* m_newTTC_IDCaloBoundary_phi{};
222 std::vector<float>* m_newTTC_IDCaloBoundary_r{};
223 std::vector<float>* m_newTTC_IDCaloBoundary_z{};
224 std::vector<float>* m_newTTC_Angle3D{};
225 std::vector<float>* m_newTTC_AngleEta{};
226
227 std::vector<float>* m_MuonEntryLayer_E{};
228 std::vector<float>* m_MuonEntryLayer_px{};
229 std::vector<float>* m_MuonEntryLayer_py{};
230 std::vector<float>* m_MuonEntryLayer_pz{};
231 std::vector<float>* m_MuonEntryLayer_x{};
232 std::vector<float>* m_MuonEntryLayer_y{};
233 std::vector<float>* m_MuonEntryLayer_z{};
234 std::vector<int>* m_MuonEntryLayer_pdg{};
235
238 // extrapolation through Calo
241
243 std::vector< CaloCell_ID_FCS::CaloSample > m_surfacelist;
244
252
254 ServiceHandle<IPartPropSvc> m_partPropSvc{this, "PartPropSvc", "PartPropSvc"};
255
256 HepPDT::ParticleDataTable* m_particleDataTable{};
257
258 //###################################################################
259
260
261};
262
263#endif // ISF_HIT_ANALYSIS_H
Cached pointer with atomic update.
Definition of CaloDetDescrManager.
std::vector< FPGATrackSimHit > hitVector
ICaloCoordinateTool interface declaration 30.9.2004 Creation of the class TBCalocoordinate by claire....
Define macros for attributes used to control the static checker.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
std::vector< std::vector< bool > > * m_newTTC_entrance_OK
double m_dCalo[CaloCell_ID_FCS::MaxSample][3]
std::vector< std::vector< float > > * m_newTTC_back_r
std::vector< Float_t > * m_final_hit_energy
std::vector< float > * m_MuonEntryLayer_pz
bool m_layerCaloOK[CaloCell_ID_FCS::MaxSample][3]
double m_lrCalo[CaloCell_ID_FCS::MaxSample][3]
std::vector< std::vector< float > > * m_newTTC_back_detaBorder
double m_lphiCalo[CaloCell_ID_FCS::MaxSample][3]
ServiceHandle< IPartPropSvc > m_partPropSvc
Handle on the particle property service.
std::vector< std::vector< float > > * m_newTTC_entrance_phi
const LArHEC_ID * m_larHecID
FCS_matchedcellvector * m_oneeventcells
std::vector< std::vector< float > > * m_newTTC_mid_r
std::vector< Long64_t > * m_g4hit_cellidentifier
std::vector< bool > * m_islarhec
std::vector< std::vector< Long64_t > > * m_cluster_cellID
SG::ReadCondHandleKey< ILArfSampl > m_fSamplKey
std::vector< float > * m_newTTC_IDCaloBoundary_phi
std::vector< float > * m_MuonEntryLayer_py
std::vector< float > * m_cluster_eta
std::vector< int > * m_truth_barcode
std::vector< std::vector< float > > * m_newTTC_back_phi
std::vector< int > * m_truth_pdg
BooleanProperty m_doAllCells
const LArFCAL_ID * m_larFcalID
std::vector< float > * m_truth_py
std::vector< std::vector< float > > * m_newTTC_mid_eta
std::vector< float > * m_MuonEntryLayer_x
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
HepPDT::ParticleDataTable * m_particleDataTable
std::vector< int > * m_g4hit_sampling
StringProperty m_ntupleTreeName
std::vector< float > * m_newTTC_IDCaloBoundary_eta
StringProperty m_caloEntranceName
std::vector< float > * m_newTTC_IDCaloBoundary_z
PublicToolHandle< IFastCaloSimCaloExtrapolation > m_FastCaloSimCaloExtrapolation
The FastCaloSimCaloExtrapolation tool.
BooleanProperty m_doLayerSums
std::vector< std::vector< float > > * m_newTTC_mid_detaBorder
std::vector< std::vector< float > > * m_newTTC_entrance_z
SG::ReadCondHandleKey< TileSamplingFraction > m_tileSamplingFractionKey
Name of TileSamplingFraction in condition store.
std::vector< float > * m_hit_y
IntegerProperty m_TimingCut
std::vector< std::vector< float > > * m_newTTC_entrance_eta
std::vector< float > * m_MuonEntryLayer_z
StringProperty m_MC_DIGI_PARAM
Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis
std::vector< float > * m_truth_pz
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
std::vector< float > * m_cluster_energy
std::vector< std::vector< float > > * m_newTTC_back_eta
std::vector< std::vector< float > > * m_newTTC_mid_z
std::vector< float > * m_hit_z
double m_lzCalo[CaloCell_ID_FCS::MaxSample][3]
CaloCell_ID_FCS::CaloSample m_sample_calo_surf
End new Extrapolator setup.
std::vector< float > * m_newTTC_AngleEta
std::vector< float > * m_truth_px
CxxUtils::CachedPointer< const Trk::TrackingVolume > m_caloEntrance
The new Extrapolator setup.
ISF_HitAnalysis(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< float > * m_hit_x
Simple variables by Ketevi.
ServiceHandle< TileCablingSvc > m_tileCablingSvc
Name of Tile cabling service.
double m_letaCalo[CaloCell_ID_FCS::MaxSample][3]
std::vector< std::vector< bool > > * m_newTTC_back_OK
const TileHWID * m_tileHWID
std::vector< float > * m_hit_time
BooleanProperty m_doG4Hits
void extrapolate_to_ID(const HepMC::ConstGenParticlePtr &part, std::vector< Trk::HitInfo > *hitVector)
std::vector< float > * m_cluster_phi
std::vector< std::vector< bool > > * m_newTTC_mid_OK
std::vector< float > * m_g4hit_time
std::vector< float > * m_truth_energy
std::vector< float > * m_hit_samplingfraction
std::vector< Long64_t > * m_cell_identifier
std::vector< bool > * m_islarbarrel
std::vector< int > * m_truth_vtxbarcode
PublicToolHandle< Trk::ITimedExtrapolator > m_extrapolator
std::vector< float > * m_newTTC_Angle3D
double m_distetaCaloBorder[CaloCell_ID_FCS::MaxSample][3]
const TileID * m_tileID
BooleanProperty m_doClusterInfo
std::vector< Long64_t > * m_hit_identifier
std::vector< float > * m_MuonEntryLayer_E
std::vector< std::vector< float > > * m_newTTC_entrance_r
DoubleProperty m_calomargin
std::vector< float > * m_hit_energy
std::vector< Trk::HitInfo > * caloHits(const HepMC::GenParticle &part) const
DoubleProperty m_CaloBoundaryR
std::vector< int > * m_MuonEntryLayer_pdg
BooleanProperty m_saveAllBranches
const TileDetDescrManager * m_tileMgr
DoubleProperty m_CaloBoundaryZ
std::vector< unsigned > * m_cluster_size
ServiceHandle< ITHistSvc > m_thistSvc
std::vector< float > * m_MuonEntryLayer_y
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
StringProperty m_ntupleFileName
std::vector< bool > * m_islarendcap
StringProperty m_metadataTreeName
std::vector< std::vector< float > > * m_newTTC_mid_phi
std::vector< int > * m_cell_sampling
void extrapolate(const HepMC::ConstGenParticlePtr &part, std::vector< Trk::HitInfo > *hitVector)
std::vector< Long64_t > * m_hit_cellidentifier
std::vector< CaloCell_ID_FCS::CaloSample > m_surfacelist
StringProperty m_geoFileName
std::vector< float > * m_g4hit_samplingfraction
BooleanProperty m_doLayers
std::vector< float > * m_newTTC_IDCaloBoundary_r
std::vector< float > * m_cell_energy
FCS_matchedcellvector * m_layercells[MAX_LAYER]
std::vector< bool > * m_istile
std::vector< std::vector< float > > * m_newTTC_entrance_detaBorder
static const int MAX_LAYER
std::vector< std::vector< float > > * m_newTTC_back_z
const LArEM_ID * m_larEmID
std::vector< int > * m_hit_sampling
std::vector< float > * m_g4hit_energy
ServiceHandle< IGeoModelSvc > m_geoModel
std::vector< Float_t > * m_final_cell_energy
std::vector< Long64_t > * m_g4hit_identifier
std::vector< float > * m_MuonEntryLayer_px
IntegerProperty m_NtruthParticles
std::vector< bool > * m_islarfcal
PublicToolHandle< ICaloCoordinateTool > m_calo_tb_coord
std::vector< Float_t > * m_final_g4hit_energy
virtual StatusCode finalize ATLAS_NOT_THREAD_SAFE() override
StringProperty m_MC_SIM_PARAM
const TileCablingService * m_tileCabling
Helper class for LArEM offline identifiers.
Definition LArEM_ID.h:111
Helper class for LArFCAL offline identifiers.
Definition LArFCAL_ID.h:49
Helper class for LArHEC offline identifiers.
Definition LArHEC_ID.h:76
Helper class for TileCal online (hardware) identifiers.
Definition TileHWID.h:49
Helper class for TileCal offline identifiers.
Definition TileID.h:67
small converter from the (abs) PDG code to the particle hypothsis used in Tracking
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
Definition GenParticle.h:20
Ensure that the ATLAS eigen extensions are properly loaded.
void initialize()
Cached pointer with atomic update.