ATLAS Offline Software
Loading...
Searching...
No Matches
Analysis_Distribution.cxx
Go to the documentation of this file.
1
9
10
11
12#include <cmath>
13
16
17
18
20
21 // Create track parameter histograms
22 m_h_eta = new TH1D(std::string(m_name+"-eta").c_str(), std::string(m_name+" eta distribution").c_str(), 100, -3, 3);
23 m_h_phi = new TH1D(std::string(m_name+"-phi").c_str(), std::string(m_name+" phi distribution").c_str(), 100, -3.15, 3.15);
24 m_h_z0 = new TH1D(std::string(m_name+"-z0").c_str(), std::string(m_name+" z0 distribution").c_str(), 100, -200.0, 200.0);
25 m_h_d0 = new TH1D(std::string(m_name+"-d0").c_str(), std::string(m_name+" d0 distribution").c_str(), 100, -5.0, 5.0);
26 m_h_pT = new TH1D(std::string(m_name+"-pT").c_str(), std::string(m_name+" pT distribution").c_str(), 100, -10000, 10000);
32
33 // Create track hit histograms
34 m_h_blay = new TH1D(std::string(m_name+"-blay").c_str(), std::string(m_name+" blayer").c_str(), 2, -0.5, 1.5);
35 m_h_pixel = new TH1D(std::string(m_name+"-pixel").c_str(), std::string(m_name+" pixel").c_str(), 10, -0.5, 9.5);
36 m_h_sct = new TH1D(std::string(m_name+"-sct").c_str(), std::string(m_name+" sct").c_str(), 12, -0.5, 11.5);
37 m_h_silicon = new TH1D(std::string(m_name+"-silicon").c_str(), std::string(m_name+" silicon").c_str(), 20, -0.5, 19.5);
38 m_h_silicon_match = new TH1D(std::string(m_name+"-silicon_match").c_str(), std::string(m_name+" silicon_match").c_str(), 20, -0.5, 19.5);
39 m_h_straw = new TH1D(std::string(m_name+"-straw").c_str(), std::string(m_name+" straw").c_str(), 40, -0.5, 39.5);
40 m_h_tr = new TH1D(std::string(m_name+"-tr").c_str(), std::string(m_name+" tr").c_str(), 40, -0.5, 39.5);
48
49}
50
51
52
56
57
58
59void Analysis_Distribution::execute(const std::vector<TIDA::Track*>& /*referenceTracks*/,
60 const std::vector<TIDA::Track*>& testTracks,
61 TrackAssociator* /*associator*/) {
62
63
64
65 // Loop over test tracks
66 std::vector<TIDA::Track*>::const_iterator test=testTracks.begin();
67 std::vector<TIDA::Track*>::const_iterator testEnd=testTracks.end();
68
69 for ( ; test!=testEnd ; ++test ) {
70
71 // Get test parameters
72 double testEta = (*test)->eta();
73 double testPhi = phi((*test)->phi());
74 double testZ0 = (*test)->z0();
75 double testD0 = (*test)->a0();
76 double testPT = (*test)->pT();
77
78 if (fabs(testPT)<1000) continue;
79
80 // Get test hits
81 double testBlay = (*test)->bLayerHits();
82 double testPixel = (*test)->pixelHits();
83 double testSct = (*test)->sctHits();
84 double testSilicon = (*test)->siHits();
85 double testStraw = (*test)->strawHits();
86 double testTr = (*test)->trHits();
87
88 // Fill parameter distribution plots
89 m_h_eta->Fill(testEta);
90 m_h_phi->Fill(testPhi);
91 m_h_z0->Fill(testZ0);
92 m_h_d0->Fill(testD0);
93 m_h_pT->Fill(testPT);
94
95 // Fill hit distribution plots
96 m_h_blay->Fill(testBlay);
97 m_h_pixel->Fill(testPixel);
98 m_h_sct->Fill(testSct);
99 m_h_silicon->Fill(testSilicon);
100 m_h_straw->Fill(testStraw);
101 m_h_tr->Fill(testTr);
102
103 }
104
105}
106
107
108
112
113
114
116 if(p < -M_PI) p += 2*M_PI;
117 if(p > M_PI) p -= 2*M_PI;
118 return p;
119}
120
121double Analysis_Distribution::deltaR(double eta1, double eta2, double phi1, double phi2){
122 return sqrt((eta1-eta2)*(eta1-eta2) + (phi1-phi2)*(phi1-phi2));
123}
#define M_PI
Scalar phi() const
phi method
TIDA::Associator< TIDA::Track > TrackAssociator
double deltaR(double eta1, double eta2, double phi1, double phi2)
virtual void execute(const std::vector< TIDA::Track * > &referenceTracks, const std::vector< TIDA::Track * > &testTracks, TrackAssociator *associator)
Analysis_Distribution(const std::string &name)
virtual void initialise()
standard operation interface
void addHistogram(TH1 *h)
std::string m_name
identifier of the of the analysis - also used for the root directory into which the histograms are pu...
const std::string & name() const
return identifier
TrackAnalysis(const std::string &name)
the beam test parts are not really usable in a multithreaded environment