ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigMonitoring
TrigIDR4Monitoring
src
TRTPlots.cxx
Go to the documentation of this file.
1
12
13
#include "
TRTPlots.h
"
14
15
IDTPM2::TRTPlots::TRTPlots
(
const
std::string&
name
, ToolHandle<GenericMonitoringTool>* m )
16
:
IPlotBase
(
name
, m ) {
17
}
18
19
23
24
void
IDTPM2::TRTPlots::initialize
() {
26
m_reference
.initialize(
this
,
"reference"
);
27
m_test
.initialize(
this
,
"test"
);
28
29
}
30
31
32
33
void
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
55
void
IDTPM2::TRTPlots::Histograms::fill
(
const
TrackView
* t )
const
{
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
100
void
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
127
void
IDTPM2::TRTPlots::finalize
() { }
128
ref
const std::regex ref(r_ef)
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
TRTPlots.h
IDTPM2::IPlotBase::name
const std::string & name() const
generic utilities, just in case
Definition
IPlotBase.h:68
IDTPM2::IPlotBase::IPlotBase
IPlotBase(const std::string &name, ToolHandle< GenericMonitoringTool > *m=0)
built from dirName and anaTag
Definition
IPlotBase.h:41
IDTPM2::TRTPlots::m_test
Histograms m_test
Definition
TRTPlots.h:158
IDTPM2::TRTPlots::m_reference
Histograms m_reference
actual class histogram sets - this avoid needlessly duplicating all the histograms with _ref,...
Definition
TRTPlots.h:157
IDTPM2::TRTPlots::execute
void execute(const TrackAnalysisStore &collections) const
this can be over ridden if need be
Definition
TRTPlots.cxx:100
IDTPM2::TRTPlots::finalize
void finalize()
Print out final stats on histograms.
Definition
TRTPlots.cxx:127
IDTPM2::TRTPlots::initialize
void initialize()
Definition
TRTPlots.cxx:24
IDTPM2::TRTPlots::TRTPlots
TRTPlots(const std::string &name, ToolHandle< GenericMonitoringTool > *m)
Definition
TRTPlots.cxx:15
IDTPM2::TrackAnalysisStore
Definition
TrackAnalysisStore.h:78
TIDA::Histogram
Definition
TIDAHistogram.h:56
TrackView
forward declaration required for function prototype
Definition
TrackView.h:43
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
IDTPM2::TRTPlots::Histograms::NTRTPars
@ NTRTPars
Definition
TRTPlots.h:87
IDTPM2::TRTPlots::Histograms::m_hits_vs_phi
TIDA::Histogram< float > m_hits_vs_phi[NTRTPars]
Definition
TRTPlots.h:117
IDTPM2::TRTPlots::Histograms::m_hits_vs_d0
TIDA::Histogram< float > m_hits_vs_d0[NTRTPars]
Definition
TRTPlots.h:118
IDTPM2::TRTPlots::Histograms::m_hits_vs_eta
TIDA::Histogram< float > m_hits_vs_eta[NTRTPars]
Definition
TRTPlots.h:116
IDTPM2::TRTPlots::Histograms::initialize
void initialize(TRTPlots *p, const std::string &s="")
Definition
TRTPlots.cxx:33
IDTPM2::TRTPlots::Histograms::parName
const std::string & parName(int i) const
Definition
TRTPlots.h:99
IDTPM2::TRTPlots::Histograms::m_hits_vs_pt
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
IDTPM2::TRTPlots::Histograms::nParNames
size_t nParNames() const
Definition
TRTPlots.h:97
IDTPM2::TRTPlots::Histograms::fill
void fill(const TrackView *t) const
Definition
TRTPlots.cxx:55
IDTPM2::TRTPlots::Histograms::m_hits
TIDA::Histogram< float > m_hits[NTRTPars]
actual stored histograms
Definition
TRTPlots.h:108
Generated on
for ATLAS Offline Software by
1.17.0