ATLAS Offline Software
Loading...
Searching...
No Matches
TRTPlots.cxx
Go to the documentation of this file.
1
12
13#include "TRTPlots.h"
14
15IDTPM2::TRTPlots::TRTPlots( const std::string& name, ToolHandle<GenericMonitoringTool>* m )
16 : IPlotBase( name, m ) {
17}
18
19
23
26 m_reference.initialize( this, "reference");
27 m_test.initialize( this, "test");
28
29}
30
31
32
33void IDTPM2::TRTPlots::Histograms::initialize( TRTPlots* p, const std::string& s ) {
34
35 static const std::array<bool,NTRTPars> proc = { true, false, false, true };
36
37 for ( size_t i=0 ; i<nParNames() ; i++ ) {
38
39 if ( !proc[i] ) continue;
40
41 m_hits[i] = TIDA::Histogram<float>( p->monTool(), parName(i), s );
42
44
45 m_hits_vs_pt[i] = TIDA::Histogram<float>( p->monTool(), parName(i)+"_vs_pt", s );
46 m_hits_vs_eta[i] = TIDA::Histogram<float>( p->monTool(), parName(i)+"_vs_eta", s );
47 m_hits_vs_phi[i] = TIDA::Histogram<float>( p->monTool(), parName(i)+"_vs_phi", s );
48 m_hits_vs_d0[i] = TIDA::Histogram<float>( p->monTool(), parName(i)+"_vs_d0", s );
49
50 }
51
52}
53
54
56
57
59 std::array<float,NTRTPars> hitP = {};
60
61 hitP[NTRTHits] = t->nTRT();
62 // hitP[NTRTHitsXe]
63 // hitP[ NTRTHitsAr]
64 hitP[NTRTHighThresholdHits] = t->nTRTHi();
65 // hitP[NTRTHighThresholdHitsXe]
66 // hitP[NTRTHighThresholdHitsAr]
67
68 // hitP[NTRTOutliers]
69 // hitP[NTRTHighThresholdOutliers]
70
71
72 float pt = std::fabs(t->pt())*0.001;
73 float eta = t->eta();
74 float phi = t->phi();
75 float d0 = t->d0();
76
77
78 // std::cout << "TRTs: track: " << *t << std::endl;
79
80 static const std::array<bool,NTRTPars> proc = { true, false, false, true };
81
82 for ( int i=0 ; i<NTRTPars ; i++ ) {
83
84 if ( !proc[i] ) continue;
85
86 // std::cout << "\tfill par; " << hitParName(i) << "\t: " << hitP[i] << std::endl;
87
88 m_hits[i].Fill( hitP[i] );
89
90 m_hits_vs_pt[i].Fill( pt, hitP[i] );
91 m_hits_vs_eta[i].Fill( eta, hitP[i] );
92 m_hits_vs_phi[i].Fill( phi, hitP[i] );
93 m_hits_vs_d0[i].Fill( d0, hitP[i] );
94 }
95
96}
97
98
99
100void IDTPM2::TRTPlots::execute( const TrackAnalysisStore& collections ) const {
101
102#if 0
104
105 double mu = 0;
106
107 const xAOD::EventInfo* eventinfo = collections.eventInfo();
108
109 if (eventinfo) {
111 mu = collections.eventInfo()->averageInteractionsPerCrossing();
112 }
113#endif
114
115 const std::vector<const TrackView*>& ref = collections.reference_tracks();
116 const std::vector<const TrackView*>& test = collections.test_tracks();
117
118 for ( size_t i=0 ; i<ref.size() ; i++ ) { m_reference.fill( ref[i] ); }
119 for ( size_t i=0 ; i<test.size() ; i++ ) { m_test.fill( test[i] ); }
120
122
123}
124
125
128
const std::regex ref(r_ef)
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
const std::string & name() const
generic utilities, just in case
Definition IPlotBase.h:68
IPlotBase(const std::string &name, ToolHandle< GenericMonitoringTool > *m=0)
built from dirName and anaTag
Definition IPlotBase.h:41
Histograms m_test
Definition TRTPlots.h:158
Histograms m_reference
actual class histogram sets - this avoid needlessly duplicating all the histograms with _ref,...
Definition TRTPlots.h:157
void execute(const TrackAnalysisStore &collections) const
this can be over ridden if need be
Definition TRTPlots.cxx:100
void finalize()
Print out final stats on histograms.
Definition TRTPlots.cxx:127
TRTPlots(const std::string &name, ToolHandle< GenericMonitoringTool > *m)
Definition TRTPlots.cxx:15
forward declaration required for function prototype
Definition TrackView.h:43
EventInfo_v1 EventInfo
Definition of the latest event info version.
TIDA::Histogram< float > m_hits_vs_phi[NTRTPars]
Definition TRTPlots.h:117
TIDA::Histogram< float > m_hits_vs_d0[NTRTPars]
Definition TRTPlots.h:118
TIDA::Histogram< float > m_hits_vs_eta[NTRTPars]
Definition TRTPlots.h:116
void initialize(TRTPlots *p, const std::string &s="")
Definition TRTPlots.cxx:33
const std::string & parName(int i) const
Definition TRTPlots.h:99
TIDA::Histogram< float > m_hits_vs_pt[NTRTPars]
for these "2D" histograms, could use yet another enum, and some parname vector, but prefer to keep it...
Definition TRTPlots.h:115
size_t nParNames() const
Definition TRTPlots.h:97
void fill(const TrackView *t) const
Definition TRTPlots.cxx:55
TIDA::Histogram< float > m_hits[NTRTPars]
actual stored histograms
Definition TRTPlots.h:108