ATLAS Offline Software
Analysis_Fake.cxx
Go to the documentation of this file.
1 
11 #include <cmath>
12 
15 
16 
17 
18 Analysis_Fake::Analysis_Fake(const std::string& name, double pTCut, double etaCut, double d0Cut, double z0Cut) :
19  TrackAnalysis(name), m_pTCut(pTCut), m_etaCut(etaCut), m_d0Cut(d0Cut), m_z0Cut(z0Cut) {
20 
21  // Create integral efficiency histograms
22  m_h_integralD = new TH1D(std::string(m_name+"-denominator-integral").c_str(), std::string(m_name+" integral fake denominator").c_str(), 1, 0.0, 1.0);
23  m_h_integralN = new TH1D(std::string(m_name+"-numerator-integral").c_str(), std::string(m_name+" integral fake numerator").c_str(), 1, 0.0, 1.0);
24  m_h_integral = new TH1D(std::string(m_name+"-integral").c_str(), std::string(m_name+" integral fake").c_str(), 1, 0.0, 1.0);
28 
29  // Create differential efficiency histograms
30  m_h_etaD = new TH1D(std::string(m_name+"-denominator-eta").c_str(), std::string(m_name+" eta fake denominator").c_str(), 100, -2.5, 2.5);
31  m_h_phiD = new TH1D(std::string(m_name+"-denominator-phi").c_str(), std::string(m_name+" phi fake denominator").c_str(), 100, -3.142, 3.142);
32  m_h_z0D = new TH1D(std::string(m_name+"-denominator-z0").c_str(), std::string( m_name+" z0 fake denominator").c_str(), 100, -200, 200);
33  m_h_d0D = new TH1D(std::string(m_name+"-denominator-d0").c_str(), std::string( m_name+" d0 fake denominator").c_str(), 100, -20, 20);
34  m_h_pTD = new TH1D(std::string(m_name+"-denominator-pT").c_str(), std::string( m_name+" pT fake denominator").c_str(), 100, -10000, 10000);
40 
41  m_h_etaN = new TH1D(std::string(m_name+"-numerator-eta").c_str(), std::string(m_name+" eta fake numerator").c_str(), 100, -2.5, 2.5);
42  m_h_phiN = new TH1D(std::string(m_name+"-numerator-phi").c_str(), std::string(m_name+" phi fake numerator").c_str(), 100, -3.142, 3.142);
43  m_h_z0N = new TH1D(std::string(m_name+"-numerator-z0").c_str(), std::string(m_name +" z0 fake numerator").c_str(), 100, -200, 200);
44  m_h_d0N = new TH1D(std::string(m_name+"-numerator-d0").c_str(), std::string(m_name +" d0 fake numerator").c_str(), 100, -20, 20);
45  m_h_pTN = new TH1D(std::string(m_name+"-numerator-pT").c_str(), std::string(m_name +" pT fake numerator").c_str(), 100, -10000, 10000);
51 
52  m_h_eta = new TH1D(std::string(m_name+"-eta").c_str(), std::string(m_name+" eta efficiency").c_str(), 100, -2.5, 2.5);
53  m_h_phi = new TH1D(std::string(m_name+"-phi").c_str(), std::string(m_name+" phi efficiency").c_str(), 100, -3.142, 3.142);
54  m_h_z0 = new TH1D(std::string(m_name+"-z0").c_str(), std::string(m_name+" z0 efficiency").c_str(), 100, -200, 200);
55  m_h_d0 = new TH1D(std::string(m_name+"-d0").c_str(), std::string(m_name+" d0 efficiency").c_str(), 100, -20, 20);
56  m_h_pT = new TH1D(std::string(m_name+"-pT").c_str(), std::string(m_name+" pT efficiency").c_str(), 100, -10000, 10000);
62 
63 }
64 
65 
66 
68 
69 }
70 
71 
72 
73 void Analysis_Fake::execute(const std::vector<TIDA::Track*>& ,
74  const std::vector<TIDA::Track*>& testTracks,
75  TrackAssociator* associator) {
76 
77  // Loop over reference tracks
78  // std::vector<TIDA::Track*>::const_iterator reference, referenceEnd=referenceTracks.end();
79  std::vector<TIDA::Track*>::const_iterator test, testEnd=testTracks.end();
80  for(test=testTracks.begin(); test!=testEnd; ++test) {
81 
82 
83  // Get test parameters
84  double testEta = (*test)->eta();
85  double testPhi = phi((*test)->phi());
86  double testZ0 = (*test)->z0();
87  double testD0 = (*test)->a0();
88  double testPT = (*test)->pT();
89 
90  // Fill denominator
91  bool passesEta = (fabs(testEta)<m_etaCut);
92  bool passesPT = (fabs(testPT)>m_pTCut);
93  bool passesD0 = (fabs(testD0)<m_d0Cut);
94  bool passesZ0 = (fabs(testZ0)<m_z0Cut);
95  if(passesPT&&passesD0&&passesZ0) m_h_etaD->Fill(testEta);
96  if(passesPT&&passesD0&&passesZ0&&passesEta) m_h_phiD->Fill(testPhi);
97  if(passesPT&&passesD0&&passesEta) m_h_z0D->Fill(testZ0);
98  if(passesPT&&passesZ0&&passesEta) m_h_d0D->Fill(testD0);
99  if(passesD0&&passesZ0&&passesEta) m_h_pTD->Fill(fabs(testPT));
100  if(passesPT&&passesD0&&passesZ0&&passesEta) m_h_integralD->Fill(0.5);
101 
102  // Find matched tracks
103  const TIDA::Track* ref = associator->revmatched(*test);
104 
105  // Fill histograms
106  if(!ref) {
107 
108  // Fill numerator
109  if(passesPT&&passesD0&&passesZ0) m_h_etaN->Fill(testEta);
110  if(passesPT&&passesD0&&passesZ0&&passesEta) m_h_phiN->Fill(testPhi);
111  if(passesPT&&passesD0&&passesEta) m_h_z0N->Fill(testZ0);
112  if(passesPT&&passesZ0&&passesEta) m_h_d0N->Fill(testD0);
113  if(passesD0&&passesZ0&&passesEta) m_h_pTN->Fill(fabs(testPT));
114  if(passesPT&&passesD0&&passesZ0&&passesEta) m_h_integralN->Fill(0.5);
115 
116  }
117  }
118 }
119 
120 
121 
123 
124  m_h_phiD->Sumw2(); m_h_phiN->Sumw2(); m_h_phi->Sumw2(); m_h_phi->Divide(m_h_phiN, m_h_phiD, 1.0, 1.0, "B");
125  m_h_etaD->Sumw2(); m_h_etaN->Sumw2(); m_h_eta->Sumw2(); m_h_eta->Divide(m_h_etaN, m_h_etaD, 1.0, 1.0, "B");
126  m_h_z0D->Sumw2(); m_h_z0N->Sumw2(); m_h_z0->Sumw2(); m_h_z0->Divide(m_h_z0N, m_h_z0D, 1.0, 1.0, "B");
127  m_h_d0D->Sumw2(); m_h_d0N->Sumw2(); m_h_d0->Sumw2(); m_h_d0->Divide(m_h_d0N, m_h_d0D, 1.0, 1.0, "B");
128  m_h_pTD->Sumw2(); m_h_pTN->Sumw2(); m_h_pT->Sumw2(); m_h_pT->Divide(m_h_pTN, m_h_pTD, 1.0, 1.0, "B");
129  m_h_integralD->Sumw2(); m_h_integralN->Sumw2(); m_h_integral->Sumw2(); m_h_integral->Divide(m_h_integralN, m_h_integralD, 1.0, 1.0, "B");
130 
131 }
132 
133 
134 
135 double Analysis_Fake::phi(double p) {
136  if(p < -M_PI) p += 2*M_PI;
137  if(p > M_PI) p -= 2*M_PI;
138  return p;
139 }
140 
141 
Analysis_Fake::m_h_pTN
TH1 * m_h_pTN
Definition: Analysis_Fake.h:63
TIDA::Associator
Definition: TIDAAssociator.h:24
Track.h
Analysis_Fake::m_h_z0D
TH1 * m_h_z0D
Definition: Analysis_Fake.h:56
Analysis_Fake::execute
virtual void execute(const std::vector< TIDA::Track * > &referenceTracks, const std::vector< TIDA::Track * > &testTracks, TrackAssociator *associator)
Definition: Analysis_Fake.cxx:73
Analysis_Fake::m_h_phiN
TH1 * m_h_phiN
Definition: Analysis_Fake.h:60
Analysis_Fake::m_pTCut
double m_pTCut
Definition: Analysis_Fake.h:71
Analysis_Fake::initialise
virtual void initialise()
standard operation interface
Definition: Analysis_Fake.cxx:67
Analysis_Fake::m_h_phiD
TH1 * m_h_phiD
Definition: Analysis_Fake.h:55
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:147
Analysis_Fake::m_h_etaD
TH1 * m_h_etaD
Definition: Analysis_Fake.h:54
Analysis_Fake::m_h_z0
TH1 * m_h_z0
Definition: Analysis_Fake.h:66
Analysis_Fake::m_h_d0N
TH1 * m_h_d0N
Definition: Analysis_Fake.h:62
Analysis_Fake::Analysis_Fake
Analysis_Fake(const std::string &name, double pTCut, double etaCut, double d0Cut, double z0Cut)
Definition: Analysis_Fake.cxx:18
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Analysis_Fake.h
Analysis_Fake::m_h_eta
TH1 * m_h_eta
Definition: Analysis_Fake.h:64
TrackAnalysis
Definition: TrackAnalysis.h:32
TIDA::Associator::revmatched
virtual const T * revmatched(S *t)
Definition: TIDAAssociator.h:52
Analysis_Fake::m_z0Cut
double m_z0Cut
Definition: Analysis_Fake.h:74
Analysis_Fake::m_h_integral
TH1 * m_h_integral
Definition: Analysis_Fake.h:51
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Analysis_Fake::m_etaCut
double m_etaCut
Definition: Analysis_Fake.h:72
Analysis_Fake::phi
double phi(double p)
Definition: Analysis_Fake.cxx:135
Analysis_Fake::m_h_phi
TH1 * m_h_phi
Definition: Analysis_Fake.h:65
TrackAnalysis::addHistogram
void addHistogram(TH1 *h)
Definition: TrackAnalysis.h:97
ref
const boost::regex ref(r_ef)
Analysis_Fake::m_h_d0D
TH1 * m_h_d0D
Definition: Analysis_Fake.h:57
TIDA::Track
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26
Analysis_Fake::m_d0Cut
double m_d0Cut
Definition: Analysis_Fake.h:73
Analysis_Fake::m_h_integralD
TH1 * m_h_integralD
Definition: Analysis_Fake.h:49
Analysis_Fake::finalise
virtual void finalise()
Definition: Analysis_Fake.cxx:122
Analysis_Fake::m_h_z0N
TH1 * m_h_z0N
Definition: Analysis_Fake.h:61
Analysis_Fake::m_h_etaN
TH1 * m_h_etaN
Definition: Analysis_Fake.h:59
TrackAnalysis::m_name
std::string m_name
identifier of the of the analysis - also used for the root directory into which the histograms are pu...
Definition: TrackAnalysis.h:145
Analysis_Fake::m_h_pT
TH1 * m_h_pT
Definition: Analysis_Fake.h:68
Analysis_Fake::m_h_integralN
TH1 * m_h_integralN
Definition: Analysis_Fake.h:50
Analysis_Fake::m_h_d0
TH1 * m_h_d0
Definition: Analysis_Fake.h:67
Analysis_Fake::m_h_pTD
TH1 * m_h_pTD
Definition: Analysis_Fake.h:58