ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h
Go to the documentation of this file.
1/* emacs: this is -*- c++ -*- */
10
11
12#ifndef TIDA_TRACK_H
13#define TIDA_TRACK_H
14
15#include <iostream>
16#include <iomanip>
17#include <string>
18#include <vector>
19#include <map>
20
21#include "TObject.h"
22
23namespace TIDA {
24
25
26class Track : public TObject {
27
28public:
29
31 Track(double eta, double phi, double z0, double a0, double pT, double chi2, double dof,
32 double deta, double dphi, double dz0, double da0, double dpT,
33 int bLayerHits=0, int pixelHits=0, int sctHits=0, int siHits=0,
34 int strawHits=0, int trHits=0,
35 unsigned hitPattern=0,
36 unsigned multiPattern=0,
37 int author=0,
38 bool hasTruth=false,
39 int barcode = -1,
40 int match_barcode = -1,
41 bool expectBL=false,
42 unsigned long id=0);
43
44 virtual ~Track();
45
46 double eta() const { return m_eta; }
47 double phi() const { return m_phi; }
48 double z0() const { return m_z0; }
49 double a0() const { return m_a0; }
50 double pT() const { return m_pT; }
51
52 double chi2() const {return m_chi2;}
53 double dof() const {return m_dof;}
54
55 double deta() const {return m_deta;}
56 double dphi() const {return m_dphi;}
57 double dz0() const {return m_dz0;}
58 double da0() const {return m_da0;}
59 double dpT() const {return m_dpT;}
60
61 int pixelHits() const { return m_pixelHits%1000; }
62 bool expectBL() const { return m_expectBL; }
63 int sctHits() const { return m_sctHits%1000; }
64 int siHits() const { return m_siHits%1000; }
65 int bLayerHits() const { return m_bLayerHits%1000; }
66
67 int strawHits() const {return m_strawHits%1000;}
68 int trHits() const {return m_trHits%1000;}
69
70
71 int pixelHoles() const { return m_pixelHits/1000; }
72 int sctHoles() const { return m_sctHits/1000; }
73 int siHoles() const { return m_siHits/1000; }
74 int bLayerHoles() const { return m_bLayerHits/1000; }
75
76 int strawHoles() const {return m_strawHits/1000;}
77 int trHoles() const {return m_trHits/1000;}
78
79
80 unsigned hitPattern() const { return m_hitPattern; }
81 unsigned multiPattern() const { return m_multiPattern; }
82
83 int author() const { return m_author; }
84
85 int barcode() const { return m_barcode;}
86 int match_barcode() const { return m_match_barcode;}
87
88 unsigned long id() const { return m_id; }
89
90 bool hasTruth() const { return m_hasTruth; }
91
92 void rotate();
93
94public:
95
96 bool operator==(const Track& t) {
97
98 if( m_author != t.m_author ) return false;
99
100 if( m_eta != t.m_eta ) return false;
101 if( m_phi != t.m_phi ) return false;
102 if( m_z0 != t.m_z0 ) return false;
103 if( m_a0 != t.m_a0 ) return false;
104 if( m_pT != t.m_pT ) return false;
105
106 if( m_bLayerHits != t.m_bLayerHits ) return false;
107 if( m_expectBL != t.m_expectBL ) return false;
108 if( m_pixelHits != t.m_pixelHits ) return false;
109 if( m_sctHits != t.m_sctHits ) return false;
110 if( m_siHits != t.m_siHits ) return false;
111 if( m_strawHits != t.m_strawHits ) return false;
112 if( m_trHits != t.m_trHits ) return false;
113 if ( m_hitPattern != t.m_hitPattern ) return false;
114 if ( m_multiPattern != t.m_multiPattern ) return false;
115 if ( m_id != t.m_id ) return false;
116
117 return true;
118 }
119
120protected:
121
122 // Track parameters
124 double m_dof;
126
133
134 // hit bit pattern
135 unsigned m_hitPattern;
137
138 //Track author;
140
141 //
145
146 //
148
150 unsigned long m_id;
151
153
154};
155
156}
157
158
159
160inline std::string hextobin(const unsigned& h, int nbits=32) {
161 std::string s;
162 for ( int i=nbits ; i-- ; ) s += ( (h>>i&0x1) ? "1" : "0" );
163 return s;
164}
165
166
167inline std::ostream& operator<<( std::ostream& s, const TIDA::Track& t) {
168 return s<< "[ "
169 << "\teta=" << t.eta()
170 << "\tphi=" << t.phi()
171 << "\tz0=" << t.z0()
172 << "\tpT=" << t.pT()*0.001 << " GeV "
173 // << "\tpT=" << t.pT()
174 << "\td0=" << t.a0()
175 << "\thp=0x" << std::hex << t.hitPattern() << std::dec << " "
176 // << "\thpb=" << hextobin(t.hitPattern(),20)
177 << "\tchi2=" << t.chi2() << "/" << t.dof()
178 << "\talgo=" << t.author()
179 << "\tbl=" << t.bLayerHits()
180 << ":" << ( t.expectBL() ? "t" : "f" )
181 << ":" << ( t.hasTruth() ? "t" : "f" )
182 << "\tid=0x" << std::hex << t.id() << std::dec << ":0x" << std::hex << t.barcode() << std::dec
183 << "\t] ";
184}
185
186
187#endif // TIDA_TRACK_H
std::string hextobin(const unsigned &h, int nbits=32)
std::ostream & operator<<(std::ostream &s, const TIDA::Track &t)
Header file for AthHistogramAlgorithm.
ClassDef(TIDA::Track, 6)
int m_bLayerHits
Track hits and holes - encoded as 1000*nholes + nhits the relevant %1000 or /1000 should be performed...
Test for xAOD.