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