ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimLayerStudyTool Class Reference

#include <FPGATrackSimLayerStudyTool.h>

Inheritance diagram for FPGATrackSimLayerStudyTool:

Public Member Functions

 FPGATrackSimLayerStudyTool (const std::string &, const std::string &, const IInterface *)
virtual StatusCode initialize () override
StatusCode registerHistograms (const FPGATrackSimBinnedHits *binnedhits, bool skipTruth)
void allocateDataFlowCounters ()
void resetDataFlowCounters ()
const std::string dir () const
void parseTruthInfo ATLAS_NOT_THREAD_SAFE (std::vector< FPGATrackSimTruthTrack > const &truthtracks)
FPGATrackSimBinUtil::IdxSettruthBin (unsigned stepnum)
std::vector< FPGATrackSimBinUtil::IdxSet > & truthBin ()
void fillHitLevelInput (const FPGATrackSimHit *hit)
void fillBinLevelOutput ATLAS_NOT_THREAD_SAFE (const FPGATrackSimBinUtil::IdxSet &idx, const FPGATrackSimBinnedHits::BinEntry &data)
void fillBinningSummary ATLAS_NOT_THREAD_SAFE (const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits)
void sliceCheck ()
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void setBinPlotsActive (const FPGATrackSimBinUtil::IdxSet &idx)
StatusCode bookTrees ()
void ClearTreeVectors ()
template<typename HistType, typename... HistDef>
StatusCode makeAndRegHist (HistType *&ptr, HistDef... histargs)
template<typename HistType, typename... HistDef>
StatusCode makeAndRegHistVector (std::vector< HistType * > &vec, unsigned len, const std::vector< std::string > *namevec, const char *namebase, HistDef... histargs)
StatusCode regGraph (TGraph *g) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< ITHistSvc > m_tHistSvc {this, "THistSvc", "THistSvc"}
Gaudi::Property< std::string > m_dir {this, "dir", {"/GENSCAN/"}, "String name of output directory"}
Gaudi::Property< double > m_phiScale {this, "phiScale", {}, "Scale for Delta Phi variable"}
Gaudi::Property< double > m_etaScale {this, "etaScale", {}, "Scale for Delta Eta variable"}
Gaudi::Property< double > m_drScale {this, "drScale", {}, "Scale for radius differences"}
Gaudi::Property< bool > m_plotAllBins {this, "plotAllBins", {false}, "Default is to plot only truth bin values, this set to plot all bins"}
Gaudi::Property< double > m_d0pad {this, "D0Pad", 0.0, "Extra phi padding from d0 resolution"}
Gaudi::Property< double > m_phipad {this, "PhiPad", 0.0, "Extra phi padding from phi resolution"}
Gaudi::Property< double > m_qptpad {this, "QPtPad", 0.0, "Extra phi padding from q/pT resolution"}
Gaudi::Property< double > m_z0pad {this, "Z0Pad", 0.0, "Extra eta padding from z0 resolution"}
Gaudi::Property< double > m_etapad {this, "EtaPad", 0.0, "Extra eta padding from eta resolution"}
Gaudi::Property< std::string > m_layerStudyTreeName {this, "LayerStudyTreeName", "LayerStudy", "Name of the LayerStudy TTree"}
Gaudi::Property< std::string > m_truthTreeName {this,"TruthTreeName","TruthTree","Name of the Truth TTree"}
const FPGATrackSimBinnedHitsm_binnedhits {nullptr}
bool m_isSingleParticle = false
bool m_truthIsValid = false
FPGATrackSimTrackPars m_truthpars
std::vector< FPGATrackSimBinUtil::IdxSetm_truthbin
FPGATrackSimBinUtil::ParSet m_truthparset
bool m_binPlotsActive = false
std::vector< TH2D * > m_rZ_allhits
TH1D * m_truthpars_hists [5] = {0, 0, 0, 0, 0}
TH1D * m_inputHits = 0
int m_binsFilledCnt {0}
TH1D * m_binsFilled = 0
std::vector< TH1D * > m_phiResidual
std::vector< TH1D * > m_etaResidual
std::vector< TH1D * > m_phiTrueBinShift
std::vector< TH1D * > m_etaTrueBinShift
int m_N_ptplot {5}
std::vector< TH2D * > m_phiResidual_v_r
std::vector< TH2D * > m_etaResidual_v_r
std::vector< TH2D * > m_phiScale_v_r
std::vector< TH2D * > m_etaScale_v_r
TH1D * m_phiShift_road = 0
TH1D * m_etaShift_road = 0
TH2D * m_phiShift2D_road = 0
TH2D * m_etaShift2D_road = 0
std::vector< TH1D * > m_hitsPerStepBin
TH1D * m_hitsPerLayer = 0
TH2D * m_hitsPerLayer2D = 0
TH2D * m_hitsPerLayer_bin = 0
std::vector< std::string > m_distPlotClasses {"truth","ThrshNlayer","ThrshNlayerm1"}
std::vector< TH1D * > m_ptDist
std::vector< TH1D * > m_etaDist
std::vector< TH1D * > m_phiDist
std::vector< TH1D * > m_d0Dist
std::vector< TH1D * > m_z0Dist
TTree * m_bin_tree = nullptr
int m_bin_tree_event {0}
std::vector< unsigned > m_bin_tree_bin
std::vector< float > m_bin_tree_r
std::vector< float > m_bin_tree_z
std::vector< int > m_bin_tree_id
std::vector< int > m_bin_tree_hash
std::vector< int > m_bin_tree_layer
std::vector< int > m_bin_tree_side
std::vector< int > m_bin_tree_etamod
std::vector< int > m_bin_tree_phimod
std::vector< int > m_bin_tree_dettype
std::vector< int > m_bin_tree_detzone
TTree * m_truth_tree = nullptr
double m_truth_tree_phi {0.0}
double m_truth_tree_qOverPt {0.0}
double m_truth_tree_d0 {0.0}
double m_truth_tree_z0 {0.0}
double m_truth_tree_eta {0.0}
std::vector< double > m_truth_tree_parset
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 39 of file FPGATrackSimLayerStudyTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FPGATrackSimLayerStudyTool()

FPGATrackSimLayerStudyTool::FPGATrackSimLayerStudyTool ( const std::string & algname,
const std::string & name,
const IInterface * ifc )

Definition at line 23 of file FPGATrackSimLayerStudyTool.cxx.

23 :
24 AthAlgTool(algname, name, ifc)
25{
26}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ allocateDataFlowCounters()

void FPGATrackSimLayerStudyTool::allocateDataFlowCounters ( )

◆ ATLAS_NOT_THREAD_SAFE() [1/3]

void fillBinLevelOutput FPGATrackSimLayerStudyTool::ATLAS_NOT_THREAD_SAFE ( const FPGATrackSimBinUtil::IdxSet & idx,
const FPGATrackSimBinnedHits::BinEntry & data )

◆ ATLAS_NOT_THREAD_SAFE() [2/3]

void fillBinningSummary FPGATrackSimLayerStudyTool::ATLAS_NOT_THREAD_SAFE ( const std::vector< std::shared_ptr< const FPGATrackSimHit > > & hits)

◆ ATLAS_NOT_THREAD_SAFE() [3/3]

void parseTruthInfo FPGATrackSimLayerStudyTool::ATLAS_NOT_THREAD_SAFE ( std::vector< FPGATrackSimTruthTrack > const & truthtracks)

◆ bookTrees()

StatusCode FPGATrackSimLayerStudyTool::bookTrees ( )
private

Definition at line 127 of file FPGATrackSimLayerStudyTool.cxx.

127 {
128 ATH_MSG_DEBUG("Booking Layer Study Tree: " << m_layerStudyTreeName
129 << " and Truth Tree: " << m_truthTreeName);
130
131 // Create the LayerStudy tree
132 m_bin_tree = new TTree(m_layerStudyTreeName.value().c_str(),
133 m_layerStudyTreeName.value().c_str());
134 m_bin_tree->Branch("event", &m_bin_tree_event);
135 m_bin_tree->Branch("bin", &m_bin_tree_bin);
136 m_bin_tree->Branch("r", &m_bin_tree_r);
137 m_bin_tree->Branch("z", &m_bin_tree_z);
138 m_bin_tree->Branch("id", &m_bin_tree_id);
139 m_bin_tree->Branch("hash", &m_bin_tree_hash);
140 m_bin_tree->Branch("layer", &m_bin_tree_layer);
141 m_bin_tree->Branch("side", &m_bin_tree_side);
142 m_bin_tree->Branch("etamod", &m_bin_tree_etamod);
143 m_bin_tree->Branch("phimod", &m_bin_tree_phimod);
144 m_bin_tree->Branch("dettype", &m_bin_tree_dettype);
145 m_bin_tree->Branch("detzone", &m_bin_tree_detzone);
146
147 // Create the Truth tree
148 m_truth_tree = new TTree(m_truthTreeName.value().c_str(),
149 m_truthTreeName.value().c_str());
150 m_truth_tree->Branch("stdpars", &m_truth_tree_phi);
151 m_truth_tree->Branch("stdpars", &m_truth_tree_qOverPt);
152 m_truth_tree->Branch("stdpars", &m_truth_tree_eta);
153 m_truth_tree->Branch("stdpars", &m_truth_tree_d0);
154 m_truth_tree->Branch("stdpars", &m_truth_tree_z0);
155 m_truth_tree->Branch("parset", &m_truth_tree_parset);
156
157 // Register with THistSvc — convert Gaudi::Property to std::string before concatenation
158 ATH_CHECK(m_tHistSvc->regTree(m_dir.value() + m_layerStudyTreeName.value(), m_bin_tree));
159 ATH_CHECK(m_tHistSvc->regTree(m_dir.value() + m_truthTreeName.value(), m_truth_tree));
160
161 return StatusCode::SUCCESS;
162}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Gaudi::Property< std::string > m_layerStudyTreeName
Gaudi::Property< std::string > m_truthTreeName
ServiceHandle< ITHistSvc > m_tHistSvc
Gaudi::Property< std::string > m_dir

◆ ClearTreeVectors()

void FPGATrackSimLayerStudyTool::ClearTreeVectors ( )
private

Definition at line 164 of file FPGATrackSimLayerStudyTool.cxx.

165{
166 m_bin_tree_bin.clear();
167 m_bin_tree_r.clear();
168 m_bin_tree_z.clear();
169 m_bin_tree_id.clear();
170 m_bin_tree_hash.clear();
171 m_bin_tree_layer.clear();
172 m_bin_tree_side.clear();
173 m_bin_tree_etamod.clear();
174 m_bin_tree_phimod.clear();
175 m_bin_tree_dettype.clear();
176 m_bin_tree_detzone.clear();
177
178 m_truth_tree_parset.clear();
179}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ dir()

const std::string FPGATrackSimLayerStudyTool::dir ( ) const
inline

Definition at line 57 of file FPGATrackSimLayerStudyTool.h.

57{return m_dir;}

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillHitLevelInput()

void FPGATrackSimLayerStudyTool::fillHitLevelInput ( const FPGATrackSimHit * hit)

Definition at line 265 of file FPGATrackSimLayerStudyTool.cxx.

265 {
266 const IFPGATrackSimBinDesc* bindesc = m_binnedhits->getBinTool().binDesc();
267 m_rZ_allhits[m_binnedhits->getNLayers()]->Fill(hit->getZ(), hit->getR()); // all layer plot
268 if (m_truthIsValid)
269 {
270 m_etaResidual[m_binnedhits->getNLayers()]->Fill(bindesc->etaResidual(m_truthparset, hit));
271 m_phiResidual[m_binnedhits->getNLayers()]->Fill(bindesc->phiResidual(m_truthparset, hit));
272
273 int ptbin =
274 floor((m_truthpars[FPGATrackSimTrackPars::IHIP] + 1.0) / 2.0 * m_N_ptplot);
275 ptbin = std::min(std::max(ptbin,0),4);
276 m_etaResidual_v_r[ptbin]->Fill(hit->getR(), bindesc->etaResidual(m_truthparset, hit));
277 m_phiResidual_v_r[ptbin]->Fill(hit->getR(), bindesc->phiResidual(m_truthparset, hit));
278
280 double phiscale = -1.0*(hit->getGPhi()-m_truthpars[FPGATrackSimTrackPars::IPHI])/expectedshift;
281 m_phiScale_v_r[ptbin]->Fill(hit->getR(), phiscale);
282
283
285 FPGATrackSimBinUtil::ParSet binCenter = m_binnedhits->getBinTool().lastStep()->binCenter(m_truthbin.back());
286 m_etaTrueBinShift[m_binnedhits->getNLayers()]->Fill(bindesc->etaResidual(binCenter, hit));
287 m_phiTrueBinShift[m_binnedhits->getNLayers()]->Fill(bindesc->phiResidual(binCenter, hit));
288 }
289 }
290}
static double dPhiHitTrkFromPars(double r, const FPGATrackSimTrackPars &pars)
float getGPhi() const
float getZ() const
float getR() const
FPGATrackSimBinUtil::ParSet m_truthparset
std::vector< FPGATrackSimBinUtil::IdxSet > m_truthbin
const FPGATrackSimBinnedHits * m_binnedhits
virtual double phiResidual(const FPGATrackSimBinUtil::ParSet &parset, FPGATrackSimHit const *hit) const =0
virtual double etaResidual(const FPGATrackSimBinUtil::ParSet &parset, FPGATrackSimHit const *hit) const =0

◆ initialize()

StatusCode FPGATrackSimLayerStudyTool::initialize ( )
overridevirtual

Definition at line 28 of file FPGATrackSimLayerStudyTool.cxx.

29{
30 // Dump the configuration to make sure it propagated through right
31 auto props = this->getProperties();
32 for( Gaudi::Details::PropertyBase* prop : props ) {
33 if (prop->ownerTypeName()==this->type()) {
34 ATH_MSG_DEBUG("Property:\t" << prop->name() << "\t : \t" << prop->toString());
35 }
36 }
37
38 ATH_CHECK(m_tHistSvc.retrieve());
39
41
42 return StatusCode::SUCCESS;
43
44}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ makeAndRegHist()

template<typename HistType, typename... HistDef>
StatusCode FPGATrackSimLayerStudyTool::makeAndRegHist ( HistType *& ptr,
HistDef... histargs )
inlineprivate

Definition at line 189 of file FPGATrackSimLayerStudyTool.h.

190 {
191 ptr = new HistType(histargs...);
192 ATH_CHECK(m_tHistSvc->regHist(m_dir + ptr->GetName(), ptr));
193 return StatusCode::SUCCESS;
194 }
void * ptr(T *p)
Definition SGImplSvc.cxx:74

◆ makeAndRegHistVector()

template<typename HistType, typename... HistDef>
StatusCode FPGATrackSimLayerStudyTool::makeAndRegHistVector ( std::vector< HistType * > & vec,
unsigned len,
const std::vector< std::string > * namevec,
const char * namebase,
HistDef... histargs )
inlineprivate

Definition at line 198 of file FPGATrackSimLayerStudyTool.h.

199 {
200 if (vec.size()==0){
201 for (unsigned i = 0; i < len; i++) {
202 HistType *ptr = 0;
203 std::string name = std::string(namebase);
204 if (!namevec) {
205 name += std::to_string(i);
206 } else {
207 if (namevec->size()==len) {
208 name += (*namevec)[i];
209 } else {
210 return StatusCode::FAILURE;
211 }
212 }
213 ATH_CHECK(makeAndRegHist(ptr, name.c_str(), histargs...));
214 vec.push_back(ptr);
215 }
216 }
217 return StatusCode::SUCCESS;
218 }
std::vector< size_t > vec
StatusCode makeAndRegHist(HistType *&ptr, HistDef... histargs)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ regGraph()

StatusCode FPGATrackSimLayerStudyTool::regGraph ( TGraph * g) const
inlineprivate

Definition at line 221 of file FPGATrackSimLayerStudyTool.h.

221{ return m_tHistSvc->regGraph(m_dir + g->GetName(), g);}

◆ registerHistograms()

StatusCode FPGATrackSimLayerStudyTool::registerHistograms ( const FPGATrackSimBinnedHits * binnedhits,
bool skipTruth )

Definition at line 46 of file FPGATrackSimLayerStudyTool.cxx.

47{
48 m_binnedhits = binnedhits;
49 const FPGATrackSimBinTool &bintool = m_binnedhits->getBinTool();
50 const IFPGATrackSimBinDesc* bindesc = bintool.binDesc();
51 int nLyrs = m_binnedhits->getNLayers();
52
53 // *Technically* this is a bit fragile. Since we are testing if the event selection service is set to
54 // the "skip truth" type rather than testing if it's set to the SingleMuon, SingleElectron, or SinglePion types.
55 // At the moment though we either set skip truth or we are running single particle, so it could be changed later.
57
58 // This is because if you change the binning class you can change what axis
59 // ranges you need for the plotting
60 ATH_MSG_INFO("Hist scales phi: " << m_phiScale << " eta: " << m_etaScale << " dr:" << m_drScale);
61
62 // Truth Parameter distributions, bounds should cover 3x nominal range
63 for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++) {
65 m_truthpars_hists[i], ("truth" + bindesc->parNames(i)).c_str(),
66 (";" + m_binnedhits->getBinTool().binDesc()->parNames(i) + ";").c_str(), 2000,
67 -2 * m_binnedhits->getBinTool().parRange(i),
68 2 * m_binnedhits->getBinTool().parRange(i)));
69 }
70
71 // Data flow hists. We may not need these for the layer study.
72 ATH_CHECK(makeAndRegHist(m_inputHits, "InputHits", ";Input Hits", 200, 0, 100000));
74 &bintool.stepNames(), "hitsPerStep",
75 "; Hits per bin in step", 20, 0, m_isSingleParticle ? 50 : 10000));
76 ATH_CHECK(makeAndRegHist(m_hitsPerLayer, "hitsPerLayer", "; Layer ; Hits ", nLyrs, 0, nLyrs));
77 ATH_CHECK(makeAndRegHist(m_hitsPerLayer2D, "hitsPerLayer2D", "; Layer ; Hits ", nLyrs, 0, nLyrs, 20, 0, m_isSingleParticle ? 20 : 10000));
78 ATH_CHECK(makeAndRegHist(m_binsFilled, "binsFilled", "; Bins Filled per Event", 2000, 0, 2000));
79
80
81 // All Hit level histograms
82 ATH_CHECK(makeAndRegHistVector(m_rZ_allhits, nLyrs + 1, NULL, "RZ_allhits",
83 "; Z [mm] ; R [mm] ", 500, -2000, 2000, 500, 0, 500));
84
85 ATH_CHECK(makeAndRegHistVector(m_phiResidual, nLyrs + 1, NULL, "phiResidual",
86 "phi residual [mm]", 1000, -10, 10));
87 ATH_CHECK(makeAndRegHistVector(m_etaResidual, nLyrs + 1, NULL, "etaResidual",
88 "eta residual [mm]", 1000, -10, 10));
89
91 "; R[mm]; phi residual [mm]", 1200, 0, 1200, 1000, -100, 100));
93 "; R[mm]; eta residual [mm]", 1200, 0, 1200, 1000, -100, 100));
94
96 "; R[mm]; phi scale", 1200, 0, 1200, 1000, -2, 2.0));
98 "; R[mm]; eta scale", 1200, 0, 1200, 1000, -2.0, 2.0));
99
101 "phiTrueBinShift", "phi TrueBinShift [mm]", 1000, -10, 10));
103 "etaTrueBinShift", "eta TrueBinShift [mm]",1000, -10, 10));
104
105 // Road statistics
106 ATH_CHECK(makeAndRegHist(m_phiShift_road, "phiShift_road", ";Phi Shift", 2000, -m_phiScale, m_phiScale));
107 ATH_CHECK(makeAndRegHist(m_etaShift_road, "etaShift_road", ";Eta Shift", 2000, -m_etaScale, m_etaScale));
108 ATH_CHECK(makeAndRegHist(m_phiShift2D_road, "phiShift2D_road", ";Phi Shift; R", 400, -m_phiScale, m_phiScale, 100, 0, 400));
109 ATH_CHECK(makeAndRegHist(m_etaShift2D_road, "etaShift2D_road", ";Phi Shift; R", 400, -m_etaScale, m_etaScale, 100, 0, 400));
110
111 // Efficiency monitoring
113 "ptDist", "pT [GeV]",400, 0, 100));
115 "etaDist", "#eta",1000, -5, 5));
117 "phiDist", "#phi",640, 0, 2*std::numbers::pi));
119 "d0Dist", "d_{0} [mm]",120, -3.0, 3.0));
121 "z0Dist", "z_{0} [mm]",400, -200.0, 200.0));
122
123 return StatusCode::SUCCESS;
124}
#define ATH_MSG_INFO(x)
const std::vector< std::string > & stepNames() const
const IFPGATrackSimBinDesc * binDesc() const
const ToolHandleArray< FPGATrackSimBinStep > & steps() const
Gaudi::Property< double > m_etaScale
Gaudi::Property< double > m_phiScale
StatusCode makeAndRegHistVector(std::vector< HistType * > &vec, unsigned len, const std::vector< std::string > *namevec, const char *namebase, HistDef... histargs)
Gaudi::Property< double > m_drScale
std::vector< std::string > m_distPlotClasses
virtual const std::string & parNames(unsigned i) const =0

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ resetDataFlowCounters()

void FPGATrackSimLayerStudyTool::resetDataFlowCounters ( )

◆ setBinPlotsActive()

void FPGATrackSimLayerStudyTool::setBinPlotsActive ( const FPGATrackSimBinUtil::IdxSet & idx)
private

Definition at line 376 of file FPGATrackSimLayerStudyTool.cxx.

377{
379
380 // this finds the parameters at all 2^5 corners of the bin and then finds the min and max of those
381 std::vector<FPGATrackSimBinUtil::IdxSet> idxsets = FPGATrackSimBinUtil::makeVariationSet(std::vector<unsigned>({0,1,2,3,4}),idx);
382 const FPGATrackSimBinTool &bintool = m_binnedhits->getBinTool();
383 const IFPGATrackSimBinDesc* bindesc = bintool.binDesc();
384
385 // get window in std parameters for bin
386 FPGATrackSimTrackPars minpars = bindesc->parSetToTrackPars(bintool.lastStep()->binCenter(idx));
387 FPGATrackSimTrackPars maxpars = bindesc->parSetToTrackPars(bintool.lastStep()->binCenter(idx));
388 for (FPGATrackSimBinUtil::IdxSet & idxset : idxsets) {
389 FPGATrackSimTrackPars trackpars = bindesc->parSetToTrackPars(bintool.lastStep()->binLowEdge(idxset));
390 for (unsigned par =0; par < FPGATrackSimTrackPars::NPARS; par++) {
391 minpars[par] = std::min(minpars[par],trackpars[par]);
392 maxpars[par] = std::max(maxpars[par],trackpars[par]);
393 }
394 }
395
396 // check if truth track is in bin within padding
397 FPGATrackSimTrackPars padding;
403 bool inRange = true;
404 for (unsigned par =0; par < FPGATrackSimTrackPars::NPARS; par++) {
405 inRange = inRange && (m_truthpars[par] > minpars[par]-padding[par]);
406 inRange = inRange && (m_truthpars[par] < maxpars[par]+padding[par]);
407 }
408 //m_binPlotsActive |= inRange;
410
411
412}
bool inRange(const double *boundaries, const double value, const double tolerance=0.02)
Gaudi::Property< double > m_z0pad
Gaudi::Property< double > m_d0pad
Gaudi::Property< bool > m_plotAllBins
Gaudi::Property< double > m_qptpad
Gaudi::Property< double > m_phipad
Gaudi::Property< double > m_etapad
virtual const FPGATrackSimTrackPars parSetToTrackPars(const FPGATrackSimBinUtil::ParSet &parset) const =0
std::vector< IdxSet > makeVariationSet(const std::vector< unsigned > &scanpars, const IdxSet &idx)

◆ sliceCheck()

void FPGATrackSimLayerStudyTool::sliceCheck ( )

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ truthBin() [1/2]

std::vector< FPGATrackSimBinUtil::IdxSet > & FPGATrackSimLayerStudyTool::truthBin ( )
inline

Definition at line 63 of file FPGATrackSimLayerStudyTool.h.

63{ return m_truthbin; }

◆ truthBin() [2/2]

FPGATrackSimBinUtil::IdxSet & FPGATrackSimLayerStudyTool::truthBin ( unsigned stepnum)
inline

Definition at line 62 of file FPGATrackSimLayerStudyTool.h.

62{ return m_truthbin[stepnum]; }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_bin_tree

TTree* FPGATrackSimLayerStudyTool::m_bin_tree = nullptr
private

Definition at line 164 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_bin

std::vector<unsigned> FPGATrackSimLayerStudyTool::m_bin_tree_bin
private

Definition at line 166 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_dettype

std::vector<int> FPGATrackSimLayerStudyTool::m_bin_tree_dettype
private

Definition at line 175 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_detzone

std::vector<int> FPGATrackSimLayerStudyTool::m_bin_tree_detzone
private

Definition at line 176 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_etamod

std::vector<int> FPGATrackSimLayerStudyTool::m_bin_tree_etamod
private

Definition at line 173 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_event

int FPGATrackSimLayerStudyTool::m_bin_tree_event {0}
private

Definition at line 165 of file FPGATrackSimLayerStudyTool.h.

165{0};

◆ m_bin_tree_hash

std::vector<int> FPGATrackSimLayerStudyTool::m_bin_tree_hash
private

Definition at line 170 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_id

std::vector<int> FPGATrackSimLayerStudyTool::m_bin_tree_id
private

Definition at line 169 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_layer

std::vector<int> FPGATrackSimLayerStudyTool::m_bin_tree_layer
private

Definition at line 171 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_phimod

std::vector<int> FPGATrackSimLayerStudyTool::m_bin_tree_phimod
private

Definition at line 174 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_r

std::vector<float> FPGATrackSimLayerStudyTool::m_bin_tree_r
private

Definition at line 167 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_side

std::vector<int> FPGATrackSimLayerStudyTool::m_bin_tree_side
private

Definition at line 172 of file FPGATrackSimLayerStudyTool.h.

◆ m_bin_tree_z

std::vector<float> FPGATrackSimLayerStudyTool::m_bin_tree_z
private

Definition at line 168 of file FPGATrackSimLayerStudyTool.h.

◆ m_binnedhits

const FPGATrackSimBinnedHits* FPGATrackSimLayerStudyTool::m_binnedhits {nullptr}
private

Definition at line 95 of file FPGATrackSimLayerStudyTool.h.

95{nullptr};

◆ m_binPlotsActive

bool FPGATrackSimLayerStudyTool::m_binPlotsActive = false
private

Definition at line 111 of file FPGATrackSimLayerStudyTool.h.

◆ m_binsFilled

TH1D* FPGATrackSimLayerStudyTool::m_binsFilled = 0
private

Definition at line 124 of file FPGATrackSimLayerStudyTool.h.

◆ m_binsFilledCnt

int FPGATrackSimLayerStudyTool::m_binsFilledCnt {0}
private

Definition at line 123 of file FPGATrackSimLayerStudyTool.h.

123{0};

◆ m_d0Dist

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_d0Dist
private

Definition at line 153 of file FPGATrackSimLayerStudyTool.h.

◆ m_d0pad

Gaudi::Property<double> FPGATrackSimLayerStudyTool::m_d0pad {this, "D0Pad", 0.0, "Extra phi padding from d0 resolution"}
private

Definition at line 86 of file FPGATrackSimLayerStudyTool.h.

86{this, "D0Pad", 0.0, "Extra phi padding from d0 resolution"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dir

Gaudi::Property<std::string> FPGATrackSimLayerStudyTool::m_dir {this, "dir", {"/GENSCAN/"}, "String name of output directory"}
private

Definition at line 80 of file FPGATrackSimLayerStudyTool.h.

80{this, "dir", {"/GENSCAN/"}, "String name of output directory"};

◆ m_distPlotClasses

std::vector<std::string> FPGATrackSimLayerStudyTool::m_distPlotClasses {"truth","ThrshNlayer","ThrshNlayerm1"}
private

Definition at line 149 of file FPGATrackSimLayerStudyTool.h.

149{"truth","ThrshNlayer","ThrshNlayerm1"}; // 0=truth distribution, 1=passes n-1 binning selection

◆ m_drScale

Gaudi::Property<double> FPGATrackSimLayerStudyTool::m_drScale {this, "drScale", {}, "Scale for radius differences"}
private

Definition at line 83 of file FPGATrackSimLayerStudyTool.h.

83{this, "drScale", {}, "Scale for radius differences"};

◆ m_etaDist

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_etaDist
private

Definition at line 151 of file FPGATrackSimLayerStudyTool.h.

◆ m_etapad

Gaudi::Property<double> FPGATrackSimLayerStudyTool::m_etapad {this, "EtaPad", 0.0, "Extra eta padding from eta resolution"}
private

Definition at line 90 of file FPGATrackSimLayerStudyTool.h.

90{this, "EtaPad", 0.0, "Extra eta padding from eta resolution"};

◆ m_etaResidual

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_etaResidual
private

Definition at line 128 of file FPGATrackSimLayerStudyTool.h.

◆ m_etaResidual_v_r

std::vector<TH2D *> FPGATrackSimLayerStudyTool::m_etaResidual_v_r
private

Definition at line 133 of file FPGATrackSimLayerStudyTool.h.

◆ m_etaScale

Gaudi::Property<double> FPGATrackSimLayerStudyTool::m_etaScale {this, "etaScale", {}, "Scale for Delta Eta variable"}
private

Definition at line 82 of file FPGATrackSimLayerStudyTool.h.

82{this, "etaScale", {}, "Scale for Delta Eta variable"};

◆ m_etaScale_v_r

std::vector<TH2D *> FPGATrackSimLayerStudyTool::m_etaScale_v_r
private

Definition at line 135 of file FPGATrackSimLayerStudyTool.h.

◆ m_etaShift2D_road

TH2D* FPGATrackSimLayerStudyTool::m_etaShift2D_road = 0
private

Definition at line 140 of file FPGATrackSimLayerStudyTool.h.

◆ m_etaShift_road

TH1D* FPGATrackSimLayerStudyTool::m_etaShift_road = 0
private

Definition at line 138 of file FPGATrackSimLayerStudyTool.h.

◆ m_etaTrueBinShift

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_etaTrueBinShift
private

Definition at line 130 of file FPGATrackSimLayerStudyTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_hitsPerLayer

TH1D* FPGATrackSimLayerStudyTool::m_hitsPerLayer = 0
private

Definition at line 144 of file FPGATrackSimLayerStudyTool.h.

◆ m_hitsPerLayer2D

TH2D* FPGATrackSimLayerStudyTool::m_hitsPerLayer2D = 0
private

Definition at line 145 of file FPGATrackSimLayerStudyTool.h.

◆ m_hitsPerLayer_bin

TH2D* FPGATrackSimLayerStudyTool::m_hitsPerLayer_bin = 0
private

Definition at line 146 of file FPGATrackSimLayerStudyTool.h.

◆ m_hitsPerStepBin

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_hitsPerStepBin
private

Definition at line 143 of file FPGATrackSimLayerStudyTool.h.

◆ m_inputHits

TH1D* FPGATrackSimLayerStudyTool::m_inputHits = 0
private

Definition at line 121 of file FPGATrackSimLayerStudyTool.h.

◆ m_isSingleParticle

bool FPGATrackSimLayerStudyTool::m_isSingleParticle = false
private

Definition at line 99 of file FPGATrackSimLayerStudyTool.h.

◆ m_layerStudyTreeName

Gaudi::Property<std::string> FPGATrackSimLayerStudyTool::m_layerStudyTreeName {this, "LayerStudyTreeName", "LayerStudy", "Name of the LayerStudy TTree"}
private

Definition at line 91 of file FPGATrackSimLayerStudyTool.h.

91{this, "LayerStudyTreeName", "LayerStudy", "Name of the LayerStudy TTree"};

◆ m_N_ptplot

int FPGATrackSimLayerStudyTool::m_N_ptplot {5}
private

Definition at line 131 of file FPGATrackSimLayerStudyTool.h.

131{5}; // for 2-d plots in pt slices

◆ m_phiDist

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_phiDist
private

Definition at line 152 of file FPGATrackSimLayerStudyTool.h.

◆ m_phipad

Gaudi::Property<double> FPGATrackSimLayerStudyTool::m_phipad {this, "PhiPad", 0.0, "Extra phi padding from phi resolution"}
private

Definition at line 87 of file FPGATrackSimLayerStudyTool.h.

87{this, "PhiPad", 0.0, "Extra phi padding from phi resolution"};

◆ m_phiResidual

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_phiResidual
private

Definition at line 127 of file FPGATrackSimLayerStudyTool.h.

◆ m_phiResidual_v_r

std::vector<TH2D *> FPGATrackSimLayerStudyTool::m_phiResidual_v_r
private

Definition at line 132 of file FPGATrackSimLayerStudyTool.h.

◆ m_phiScale

Gaudi::Property<double> FPGATrackSimLayerStudyTool::m_phiScale {this, "phiScale", {}, "Scale for Delta Phi variable"}
private

Definition at line 81 of file FPGATrackSimLayerStudyTool.h.

81{this, "phiScale", {}, "Scale for Delta Phi variable"};

◆ m_phiScale_v_r

std::vector<TH2D *> FPGATrackSimLayerStudyTool::m_phiScale_v_r
private

Definition at line 134 of file FPGATrackSimLayerStudyTool.h.

◆ m_phiShift2D_road

TH2D* FPGATrackSimLayerStudyTool::m_phiShift2D_road = 0
private

Definition at line 139 of file FPGATrackSimLayerStudyTool.h.

◆ m_phiShift_road

TH1D* FPGATrackSimLayerStudyTool::m_phiShift_road = 0
private

Definition at line 137 of file FPGATrackSimLayerStudyTool.h.

◆ m_phiTrueBinShift

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_phiTrueBinShift
private

Definition at line 129 of file FPGATrackSimLayerStudyTool.h.

◆ m_plotAllBins

Gaudi::Property<bool> FPGATrackSimLayerStudyTool::m_plotAllBins {this, "plotAllBins", {false}, "Default is to plot only truth bin values, this set to plot all bins"}
private

Definition at line 84 of file FPGATrackSimLayerStudyTool.h.

84{this, "plotAllBins", {false}, "Default is to plot only truth bin values, this set to plot all bins"};

◆ m_ptDist

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_ptDist
private

Definition at line 150 of file FPGATrackSimLayerStudyTool.h.

◆ m_qptpad

Gaudi::Property<double> FPGATrackSimLayerStudyTool::m_qptpad {this, "QPtPad", 0.0, "Extra phi padding from q/pT resolution"}
private

Definition at line 88 of file FPGATrackSimLayerStudyTool.h.

88{this, "QPtPad", 0.0, "Extra phi padding from q/pT resolution"};

◆ m_rZ_allhits

std::vector<TH2D *> FPGATrackSimLayerStudyTool::m_rZ_allhits
private

Definition at line 118 of file FPGATrackSimLayerStudyTool.h.

◆ m_tHistSvc

ServiceHandle<ITHistSvc> FPGATrackSimLayerStudyTool::m_tHistSvc {this, "THistSvc", "THistSvc"}
private

Definition at line 76 of file FPGATrackSimLayerStudyTool.h.

76{this, "THistSvc", "THistSvc"};

◆ m_truth_tree

TTree* FPGATrackSimLayerStudyTool::m_truth_tree = nullptr
private

Definition at line 178 of file FPGATrackSimLayerStudyTool.h.

◆ m_truth_tree_d0

double FPGATrackSimLayerStudyTool::m_truth_tree_d0 {0.0}
private

Definition at line 181 of file FPGATrackSimLayerStudyTool.h.

181{0.0};

◆ m_truth_tree_eta

double FPGATrackSimLayerStudyTool::m_truth_tree_eta {0.0}
private

Definition at line 183 of file FPGATrackSimLayerStudyTool.h.

183{0.0};

◆ m_truth_tree_parset

std::vector<double> FPGATrackSimLayerStudyTool::m_truth_tree_parset
private

Definition at line 184 of file FPGATrackSimLayerStudyTool.h.

◆ m_truth_tree_phi

double FPGATrackSimLayerStudyTool::m_truth_tree_phi {0.0}
private

Definition at line 179 of file FPGATrackSimLayerStudyTool.h.

179{0.0};

◆ m_truth_tree_qOverPt

double FPGATrackSimLayerStudyTool::m_truth_tree_qOverPt {0.0}
private

Definition at line 180 of file FPGATrackSimLayerStudyTool.h.

180{0.0};

◆ m_truth_tree_z0

double FPGATrackSimLayerStudyTool::m_truth_tree_z0 {0.0}
private

Definition at line 182 of file FPGATrackSimLayerStudyTool.h.

182{0.0};

◆ m_truthbin

std::vector<FPGATrackSimBinUtil::IdxSet> FPGATrackSimLayerStudyTool::m_truthbin
private

Definition at line 102 of file FPGATrackSimLayerStudyTool.h.

◆ m_truthIsValid

bool FPGATrackSimLayerStudyTool::m_truthIsValid = false
private

Definition at line 100 of file FPGATrackSimLayerStudyTool.h.

◆ m_truthpars

FPGATrackSimTrackPars FPGATrackSimLayerStudyTool::m_truthpars
private

Definition at line 101 of file FPGATrackSimLayerStudyTool.h.

◆ m_truthpars_hists

TH1D* FPGATrackSimLayerStudyTool::m_truthpars_hists[5] = {0, 0, 0, 0, 0}
private

Definition at line 119 of file FPGATrackSimLayerStudyTool.h.

119{0, 0, 0, 0, 0};

◆ m_truthparset

FPGATrackSimBinUtil::ParSet FPGATrackSimLayerStudyTool::m_truthparset
private

Definition at line 103 of file FPGATrackSimLayerStudyTool.h.

◆ m_truthTreeName

Gaudi::Property<std::string> FPGATrackSimLayerStudyTool::m_truthTreeName {this,"TruthTreeName","TruthTree","Name of the Truth TTree"}
private

Definition at line 92 of file FPGATrackSimLayerStudyTool.h.

92{this,"TruthTreeName","TruthTree","Name of the Truth TTree"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_z0Dist

std::vector<TH1D *> FPGATrackSimLayerStudyTool::m_z0Dist
private

Definition at line 154 of file FPGATrackSimLayerStudyTool.h.

◆ m_z0pad

Gaudi::Property<double> FPGATrackSimLayerStudyTool::m_z0pad {this, "Z0Pad", 0.0, "Extra eta padding from z0 resolution"}
private

Definition at line 89 of file FPGATrackSimLayerStudyTool.h.

89{this, "Z0Pad", 0.0, "Extra eta padding from z0 resolution"};

The documentation for this class was generated from the following files: