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
10
13
18
23
27
29
30#include "GaudiKernel/ToolHandle.h"
31#include "GaudiKernel/ITHistSvc.h"
32#include "GaudiKernel/IPartPropSvc.h"
33
36
38#include "HepPDT/ParticleDataTable.hh"
39
40#include "CLHEP/Units/SystemOfUnits.h"
41#include <TLorentzVector.h>
42#include <Rtypes.h>
43#include <string>
44
45/* *************************************************************
46 This is a modified copy of Simulation/Tools/CaloHitAnalysis
47 Aug 27, 2013 Zdenek Hubacek (CERN)
48 ************************************************************** */
49
50namespace Trk
51{
52 class TrackingVolume;
53}
54
55class TileID;
56class TileHWID;
58class TTree;
59class LArEM_ID;
60class LArFCAL_ID;
61class LArHEC_ID;
62
63//############################
64
66
67public:
68
69 ISF_HitAnalysis(const std::string& name, ISvcLocator* pSvcLocator);
71
72 virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE () override;
73 virtual StatusCode finalize ATLAS_NOT_THREAD_SAFE () override;
74 virtual StatusCode execute() override;
75
76 const static int MAX_LAYER = 25;
77
78private:
79 // extrapolation through Calo
80 std::vector<Trk::HitInfo>* caloHits(const HepMC::GenParticle& part ) const;
81 void extrapolate(const HepMC::ConstGenParticlePtr& part,std::vector<Trk::HitInfo>* hitVector);
82 void extrapolate_to_ID(const HepMC::ConstGenParticlePtr& part,std::vector<Trk::HitInfo>* hitVector);
83 // Configurable properties
85 "GeoModelSvc", "GeoModelSvc", "GeoModel service"};
87 , "CaloDetDescrManager"
88 , "CaloDetDescrManager"
89 , "SG Key for CaloDetDescrManager in the Condition Store" };
91 "fSamplKey", "LArfSamplSym", "SG Key of LArfSampl object"};
92
96 "TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"};
97
101 "TileCablingSvc", "TileCablingSvc", "Tile cabling service"};
102 StringProperty m_ntupleFileName{this, "NtupleFileName", "ISF_HitAnalysis"};
103 StringProperty m_ntupleTreeName{this, "NtupleTreeName", "CaloHitAna"};
104 StringProperty m_metadataTreeName{this, "MetadataTreeName", "MetaData"};
105 StringProperty m_geoFileName{this, "GeoFileName", "ISF_Geometry"};
106 IntegerProperty m_NtruthParticles{this, "NTruthParticles", 1, "Number of truth particles saved from the truth collection, -1 to save all"};
108 "THistSvc", "THistSvc", "Tile histogramming service"};
109 PublicToolHandle<Trk::ITimedExtrapolator> m_extrapolator{this, "Extrapolator", {}};
110 PublicToolHandle<ICaloCoordinateTool> m_calo_tb_coord{this, "CaloCoordinateTool", "TBCaloCoordinate"};
111 StringProperty m_caloEntranceName{this, "CaloEntrance", ""};
113 PublicToolHandle<IFastCaloSimCaloExtrapolation> m_FastCaloSimCaloExtrapolation{this, "FastCaloSimCaloExtrapolation", {} };
114 DoubleProperty m_CaloBoundaryR{this, "CaloBoundaryR", 1148};
115 DoubleProperty m_CaloBoundaryZ{this, "CaloBoundaryZ", 3550};
116 DoubleProperty m_calomargin{this, "CaloMargin", 0.0};
117 BooleanProperty m_saveAllBranches{this,"SaveAllBranches", false};
118 BooleanProperty m_doAllCells{this, "DoAllCells", false};
119 BooleanProperty m_doClusterInfo{this, "DoClusterInfo", false};
120 BooleanProperty m_doLayers{this, "DoLayers", false};
121 BooleanProperty m_doLayerSums{this, "DoLayerSums", true};
122 BooleanProperty m_doG4Hits{this, "DoG4Hits", false};
123 IntegerProperty m_TimingCut{this, "TimingCut", 999999};
124 StringProperty m_MC_DIGI_PARAM{this, "MetaDataDigi", "/Digitization/Parameters"};
125 StringProperty m_MC_SIM_PARAM{this, "MetaDataSim", "/Simulation/Parameters"};
126
130 const TileID * m_tileID{};
133
135
137 std::vector<float>* m_hit_x{};
138 std::vector<float>* m_hit_y{};
139 std::vector<float>* m_hit_z{};
140 std::vector<float>* m_hit_energy{};
141 std::vector<float>* m_hit_time{};
142 std::vector<Long64_t>* m_hit_identifier{};
143 std::vector<Long64_t>* m_hit_cellidentifier{};
144 std::vector<bool>* m_islarbarrel{};
145 std::vector<bool>* m_islarendcap{};
146 std::vector<bool>* m_islarhec{};
147 std::vector<bool>* m_islarfcal{};
148 std::vector<bool>* m_istile{};
149 std::vector<int>* m_hit_sampling{};
150 std::vector<float>* m_hit_samplingfraction{};
151
152 std::vector<float>* m_truth_energy{};
153 std::vector<float>* m_truth_px{};
154 std::vector<float>* m_truth_py{};
155 std::vector<float>* m_truth_pz{};
156 std::vector<int>* m_truth_pdg{};
157 std::vector<int>* m_truth_barcode{};
158 std::vector<int>* m_truth_vtxbarcode{}; //production vertex barcode
159
160 std::vector<float>* m_cluster_energy{};
161 std::vector<float>* m_cluster_eta{};
162 std::vector<float>* m_cluster_phi{};
163 std::vector<unsigned>* m_cluster_size{};
164 std::vector<std::vector<Long64_t >>* m_cluster_cellID{};
165
166
167 std::vector<Long64_t>* m_cell_identifier{};
168 std::vector<float>* m_cell_energy{};
169 std::vector<int>* m_cell_sampling{};
170
171 std::vector<float>* m_g4hit_energy{};
172 std::vector<float>* m_g4hit_time{};
173 std::vector<Long64_t>* m_g4hit_identifier{};
174 std::vector<Long64_t>* m_g4hit_cellidentifier{};
175 std::vector<float>* m_g4hit_samplingfraction{};
176 std::vector<int>* m_g4hit_sampling{};
177
178 //CaloHitAna variables
179 FCS_matchedcellvector* m_oneeventcells = nullptr; //these are all matched cells in a single event
180 FCS_matchedcellvector* m_layercells[MAX_LAYER]{}; //these are all matched cells in a given layer in a given event
181
182 Float_t m_total_cell_e{};
183 Float_t m_total_hit_e{};
185
186 std::vector<Float_t>* m_final_cell_energy{};
187 std::vector<Float_t>* m_final_hit_energy{};
188 std::vector<Float_t>* m_final_g4hit_energy{};
189
190 TTree * m_tree{};
191 //####################################################
195 double m_ptruth_eta{};
196 double m_ptruth_phi{};
197 double m_ptruth_e{};
198 double m_ptruth_et{};
199 double m_ptruth_pt{};
200 double m_ptruth_p{};
201 int m_pdgid{};
202
203 std::vector<std::vector<float> >* m_newTTC_entrance_eta{};
204 std::vector<std::vector<float> >* m_newTTC_entrance_phi{};
205 std::vector<std::vector<float> >* m_newTTC_entrance_r{};
206 std::vector<std::vector<float> >* m_newTTC_entrance_z{};
207 std::vector<std::vector<float> >* m_newTTC_entrance_detaBorder{};
208 std::vector<std::vector<bool> >* m_newTTC_entrance_OK{};
209 std::vector<std::vector<float> >* m_newTTC_back_eta{};
210 std::vector<std::vector<float> >* m_newTTC_back_phi{};
211 std::vector<std::vector<float> >* m_newTTC_back_r{};
212 std::vector<std::vector<float> >* m_newTTC_back_z{};
213 std::vector<std::vector<float> >* m_newTTC_back_detaBorder{};
214 std::vector<std::vector<bool> >* m_newTTC_back_OK{};
215 std::vector<std::vector<float> >* m_newTTC_mid_eta{};
216 std::vector<std::vector<float> >* m_newTTC_mid_phi{};
217 std::vector<std::vector<float> >* m_newTTC_mid_r{};
218 std::vector<std::vector<float> >* m_newTTC_mid_z{};
219 std::vector<std::vector<float> >* m_newTTC_mid_detaBorder{};
220 std::vector<std::vector<bool> >* m_newTTC_mid_OK{};
221 std::vector<float>* m_newTTC_IDCaloBoundary_eta{};
222 std::vector<float>* m_newTTC_IDCaloBoundary_phi{};
223 std::vector<float>* m_newTTC_IDCaloBoundary_r{};
224 std::vector<float>* m_newTTC_IDCaloBoundary_z{};
225 std::vector<float>* m_newTTC_Angle3D{};
226 std::vector<float>* m_newTTC_AngleEta{};
227
228 std::vector<float>* m_MuonEntryLayer_E{};
229 std::vector<float>* m_MuonEntryLayer_px{};
230 std::vector<float>* m_MuonEntryLayer_py{};
231 std::vector<float>* m_MuonEntryLayer_pz{};
232 std::vector<float>* m_MuonEntryLayer_x{};
233 std::vector<float>* m_MuonEntryLayer_y{};
234 std::vector<float>* m_MuonEntryLayer_z{};
235 std::vector<int>* m_MuonEntryLayer_pdg{};
236
239 // extrapolation through Calo
242
244 std::vector< CaloCell_ID_FCS::CaloSample > m_surfacelist;
245
253
255 ServiceHandle<IPartPropSvc> m_partPropSvc{this, "PartPropSvc", "PartPropSvc"};
256
257 HepPDT::ParticleDataTable* m_particleDataTable{};
258
259 //###################################################################
260
261
262};
263
264#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....
defines and typedefs for IOVSvc
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
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
virtual StatusCode execute() override
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,...
const GenParticle * ConstGenParticlePtr
Definition GenParticle.h:38
Ensure that the ATLAS eigen extensions are properly loaded.
void initialize()
Cached pointer with atomic update.