ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
VtxAnalysis Class Reference

#include <VtxAnalysis.h>

Inheritance diagram for VtxAnalysis:
Collaboration diagram for VtxAnalysis:

Public Member Functions

 VtxAnalysis (const std::string &n)
 
virtual ~VtxAnalysis ()
 
void initialise ()
 
void execute (const std::vector< TIDA::Vertex * > &vtx0, const std::vector< TIDA::Vertex * > &vtx1, const TIDA::Event *te=0)
 
void finalise ()
 
const std::string & name () const
 
void addHistogram (TH1 *h)
 
void addHistogram (TProfile *h)
 
const std::vector< TH1 * > & objects () const
 
const std::vector< TProfile * > & profs () const
 

Protected Attributes

std::vector< TH1 * > m_histos
 
std::vector< TProfile * > m_profs
 

Private Attributes

bool m_initialised
 
TIDDirectorym_dir
 
TH1F * m_hnvtx = nullptr
 
TH1F * m_hzed = nullptr
 
TH1F * m_hntrax = nullptr
 
TH1F * m_hnvtx_rec = nullptr
 
TH1F * m_hzed_rec = nullptr
 
TH1F * m_hntrax_rec = nullptr
 
TH1F * m_hzed_res = nullptr
 
TProfile * m_rdz_vs_zed = nullptr
 
TProfile * m_rdz_vs_ntrax = nullptr
 
TProfile * m_rdz_vs_nvtx = nullptr
 
TProfile * m_eff_zed = nullptr
 
TProfile * m_eff_ntrax = nullptr
 
TProfile * m_eff_nvtx = nullptr
 
TProfile * m_eff_mu = nullptr
 
TProfile * m_eff_lb = nullptr
 
std::string m_name
 

Detailed Description

Definition at line 25 of file VtxAnalysis.h.

Constructor & Destructor Documentation

◆ VtxAnalysis()

VtxAnalysis::VtxAnalysis ( const std::string &  n)

Definition at line 16 of file VtxAnalysis.cxx.

16 : VertexAnalysis( n ), m_initialised(false), m_dir(0) { }

◆ ~VtxAnalysis()

virtual VtxAnalysis::~VtxAnalysis ( )
inlinevirtual

Definition at line 31 of file VtxAnalysis.h.

31 { if ( m_dir ) delete m_dir; }

Member Function Documentation

◆ addHistogram() [1/2]

void VertexAnalysis::addHistogram ( TH1 *  h)
inlineinherited

Definition at line 43 of file VertexAnalysis.h.

43 { m_histos.push_back( h ); }

◆ addHistogram() [2/2]

void VertexAnalysis::addHistogram ( TProfile *  h)
inlineinherited

Definition at line 45 of file VertexAnalysis.h.

45 { m_profs.push_back( h ); }

◆ execute()

void VtxAnalysis::execute ( const std::vector< TIDA::Vertex * > &  vtx0,
const std::vector< TIDA::Vertex * > &  vtx1,
const TIDA::Event te = 0 
)
virtual

ah ha ! can fill some silly old histograms here ...

this isn't really legitimate

Implements VertexAnalysis.

Definition at line 149 of file VtxAnalysis.cxx.

151  {
152 
153  // std::cout << "VtxAnalysis::execute() initialised: " << m_initialised << "\tevent: " << tevt << std::endl;
154 
155  if ( !m_initialised ) return;
156 
157  // if ( vtx1.size()<2 ) return;
158 
159 #if 0
160  std::cout << "VtxAnalysis::execute() " << name()
161  << "\tvtx0.size() " << vtx0.size()
162  << "\tvtx1.size() " << vtx1.size()
163  << std::endl;
164 #endif
165 
166 
167  VertexMatcher m("vtx_matcher", 10 );
168 
169  m.match( vtx0, vtx1 );
170 
171  m_hnvtx->Fill( vtx0.size() );
172  m_hnvtx_rec->Fill( vtx1.size() );
173 
174  // for ( unsigned i=0 ; i<vtx0.size() ; i++ ) {
175  for ( unsigned i=0 ; i<vtx0.size() ; i++ ) {
176 
177  if ( i>0 ) break;
178 
179  // std::cout << i << "\tref z " << vtx0[i]->z();
180 
181  m_hzed->Fill( vtx0[i]->z() );
182  m_hntrax->Fill( vtx0[i]->Ntracks() );
183 
184  const TIDA::Vertex* mv = m.matched( vtx0[i] );
185 
186  if ( mv ) {
187 
188  // std::cout << "\ttest z " << mv->z() << " : delta z " << (mv->z()-vtx0[i]->z()) << std::endl;
189 
192 
193  m_hzed_rec->Fill( mv->z() );
194  m_hntrax_rec->Fill( mv->Ntracks() );
195 
196  m_hzed_res->Fill( mv->z() - vtx0[i]->z() );
197 
198  m_rdz_vs_zed->Fill( vtx0[i]->z(), mv->z() - vtx0[i]->z() );
199  m_rdz_vs_ntrax->Fill( vtx0[i]->Ntracks(), mv->z() - vtx0[i]->z() );
200  m_rdz_vs_nvtx->Fill( vtx0.size(), mv->z() - vtx0[i]->z() );
201 
202  m_eff_zed->Fill( vtx0[i]->z(), 1 );
203  m_eff_ntrax->Fill( vtx0[i]->Ntracks(), 1 );
204  m_eff_nvtx->Fill( vtx0.size(), 1 );
205 
206  m_eff_mu->Fill( tevt->mu(), 1 );
207  m_eff_lb->Fill( tevt->lumi_block(), 1 );
208 
209  }
210  else {
211  // std::cout << "\t" << "------" << std::endl;
212 
213  m_eff_zed->Fill( vtx0[i]->z(), 0 );
214  m_eff_ntrax->Fill( vtx0[i]->Ntracks(), 0 );
215  m_eff_nvtx->Fill( vtx0.size(), 0 );
216 
217  m_eff_mu->Fill( tevt->mu(), 0 );
218  m_eff_lb->Fill( tevt->lumi_block(), 0 );
219  }
220 
221  }
222 
223 }

◆ finalise()

void VtxAnalysis::finalise ( )
virtual

Implements VertexAnalysis.

Definition at line 228 of file VtxAnalysis.cxx.

228  {
229  // std::cout << "VtxAnalysis::finalise() " << name() << std::endl;
230 }

◆ initialise()

void VtxAnalysis::initialise ( )
virtual

Implements VertexAnalysis.

Definition at line 19 of file VtxAnalysis.cxx.

19  {
20 
21  m_initialised = true;
22 
23  // std::cout << "VtxAnalysis::initialise() " << name() << std::endl;
24 
25 
26  m_dir = new TIDDirectory(name());
27  m_dir->push();
28 
29 #if 0
30  double vnbins[81] = {
31  -0.5,
32  0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5,
33  10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5, 17.5, 18.5, 19.5,
34  20.5, 21.5, 22.5, 23.5, 24.5, 25.5, 26.5, 27.5, 28.5, 29.5,
35  31.5, 32.5, 33.5, 34.5, 36.5, 37.5, 39.5,
36  40.5, 42.5, 43.5, 45.5, 47.5, 49.5,
37  50.5, 52.5, 54.5, 57.5, 59.5,
38  61.5, 63.5, 66.5, 69.5,
39  71.5, 74.5, 77.5,
40  80.5, 83.5, 86.5,
41  90.5, 93.5, 97.5,
42  100.5, 104.5, 108.5,
43  113.5, 117.5,
44  122.5, 126.5,
45  131.5, 136.5,
46  142.5, 147.5,
47  153.5, 159.5,
48  165.5,
49  171.5, 178.5,
50  185.5,
51  192.5,
52  200.5 };
53 #endif
54 
55  double vnbins[101] = {
56  -0.5,
57  0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 17.5, 18.5, 19.5, 21.5,
58  23.5, 24.5, 26.5, 28.5, 30.5, 32.5, 35.5, 37.5, 40.5, 43.5, 46.5, 50.5, 53.5, 57.5, 61.5, 66.5, 71.5, 76.5, 81.5, 87.5,
59  93.5, 100.5, 107.5, 114.5, 123.5, 131.5, 141.5, 150.5, 161.5, 172.5, 185.5, 198.5, 211.5, 226.5, 242.5, 259.5, 277.5, 297.5, 317.5, 340.5,
60  363.5, 389.5, 416.5, 445.5, 476.5, 509.5,
61  544.5, 582.5, 623.5, 666.5, 713.5, 762.5, 815.5, 872.5, 933.5, 998.5, 1067.5,
62  1141.5, 1221.5, 1305.5, 1396.5, 1493.5, 1597.5,
63  1708.5, 1827.5, 1953.5, 2089.5,
64  2234.5, 2389.5, 2555.5,
65  2733.5, 2923.5, 3125.5,
66  3342.5, 3574.5,
67  3823.5, 4088.5,
68  4372.5, 4675.5,
69  5000.5
70  };
71 
72  double vnbins_short[78] = {
73  -0.5,
74  0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5,
75  10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 17.5, 18.5, 19.5,
76  21.5, 23.5, 24.5, 26.5, 28.5,
77  30.5, 32.5, 35.5, 37.5,
78  40.5, 43.5, 46.5,
79  50.5, 53.5, 57.5,
80  61.5, 66.5,
81  71.5, 76.5,
82  81.5, 87.5,
83  93.5,
84  100.5, 107.5, 114.5, 123.5, 131.5, 141.5, 150.5, 161.5, 172.5, 185.5, 198.5,
85  211.5, 226.5, 242.5, 259.5, 277.5, 297.5,
86  317.5, 340.5, 363.5, 389.5,
87  416.5, 445.5, 476.5,
88  509.5, 544.5, 582.5,
89  623.5, 666.5,
90  713.5, 762.5,
91  815.5, 872.5,
92  933.5, 998.5,
93  1067.5
94  };
95 
96 
97 
98 
99 
100 
101  m_hnvtx = new TH1F( "vx_nvtx", ";number of vertices", 101, -0.5, 100.5 );
102  m_hzed = new TH1F( "vx_zed", ";vtx z [mm]", 100, -250, 250 );
103  m_hntrax = new TH1F( "vx_ntrax", ";number of tracks", 100, vnbins );
104 
106  addHistogram( m_hzed );
108 
109 
110  m_hnvtx_rec = new TH1F( "vx_nvtx_rec", ";number of vertices", 101, -0.5, 100.5 );
111  m_hzed_rec = new TH1F( "vx_zed_rec", ";vtx z [mm]", 100, -250, 250 );
112  m_hntrax_rec = new TH1F( "vx_ntrax_rec", ";number of tracks", 100, vnbins );
113 
117 
118  m_hzed_res = new TH1F( "vx_zed_res", "Delta z [mm]", 400, -10, 10 );
119 
121 
122  m_rdz_vs_zed = new TProfile( "vx_rdz_vs_zed", "rdz_vs_zed; vtx z [mm];z residual [mm]", 100, -250, 250 );
123  m_rdz_vs_ntrax = new TProfile( "vx_rdz_vs_ntrax", "rdz_vs_ntrax;number of tracks;z residual [mm]", 77, vnbins_short );
124  m_rdz_vs_nvtx = new TProfile( "vx_rdz_vs_nvtx", "rdz_vs_nvtx;number of vertices;z residual [mm]", 51, -0.125, 50.125 );
125 
129 
130  // m_rdz_vs_mu = new TProfile( "rdz_vs_mu", 30, 0, 30, 400, -20, 20 );
131 
132  m_eff_zed = new TProfile( "vx_zed_eff", "zed_eff;efficiency;offline vtx z [mm]", 50, -250, 250 );
133  m_eff_ntrax = new TProfile( "vx_ntrax_eff", "ntrax_eff;number of tracks;efficiency", 100, vnbins );
134  m_eff_nvtx = new TProfile( "vx_nvtx_eff", "nvtx_eff;number of vertices;efficiency", 101, -0.5, 100.5 );
135  m_eff_mu = new TProfile( "vx_mu_eff", "mu_eff;<#mu>;efficiency", 101, -0.5, 100.5 );
136  m_eff_lb = new TProfile( "vx_lb_eff", "lb_eff;lumi block;efficiency", 151, -0.5, 3019.5 );
137 
143 
144  m_dir->pop();
145 
146 }

◆ name()

const std::string& VertexAnalysis::name ( ) const
inlineinherited

Definition at line 33 of file VertexAnalysis.h.

33 { return m_name; }

◆ objects()

const std::vector<TH1*>& VertexAnalysis::objects ( ) const
inlineinherited

Definition at line 47 of file VertexAnalysis.h.

47 { return m_histos; }

◆ profs()

const std::vector<TProfile*>& VertexAnalysis::profs ( ) const
inlineinherited

Definition at line 48 of file VertexAnalysis.h.

48 { return m_profs; }

Member Data Documentation

◆ m_dir

TIDDirectory* VtxAnalysis::m_dir
private

Definition at line 45 of file VtxAnalysis.h.

◆ m_eff_lb

TProfile* VtxAnalysis::m_eff_lb = nullptr
private

Definition at line 68 of file VtxAnalysis.h.

◆ m_eff_mu

TProfile* VtxAnalysis::m_eff_mu = nullptr
private

Definition at line 67 of file VtxAnalysis.h.

◆ m_eff_ntrax

TProfile* VtxAnalysis::m_eff_ntrax = nullptr
private

Definition at line 65 of file VtxAnalysis.h.

◆ m_eff_nvtx

TProfile* VtxAnalysis::m_eff_nvtx = nullptr
private

Definition at line 66 of file VtxAnalysis.h.

◆ m_eff_zed

TProfile* VtxAnalysis::m_eff_zed = nullptr
private

Definition at line 64 of file VtxAnalysis.h.

◆ m_histos

std::vector<TH1*> VertexAnalysis::m_histos
protectedinherited

Definition at line 52 of file VertexAnalysis.h.

◆ m_hntrax

TH1F* VtxAnalysis::m_hntrax = nullptr
private

Definition at line 49 of file VtxAnalysis.h.

◆ m_hntrax_rec

TH1F* VtxAnalysis::m_hntrax_rec = nullptr
private

Definition at line 53 of file VtxAnalysis.h.

◆ m_hnvtx

TH1F* VtxAnalysis::m_hnvtx = nullptr
private

Definition at line 47 of file VtxAnalysis.h.

◆ m_hnvtx_rec

TH1F* VtxAnalysis::m_hnvtx_rec = nullptr
private

Definition at line 51 of file VtxAnalysis.h.

◆ m_hzed

TH1F* VtxAnalysis::m_hzed = nullptr
private

Definition at line 48 of file VtxAnalysis.h.

◆ m_hzed_rec

TH1F* VtxAnalysis::m_hzed_rec = nullptr
private

Definition at line 52 of file VtxAnalysis.h.

◆ m_hzed_res

TH1F* VtxAnalysis::m_hzed_res = nullptr
private

Definition at line 55 of file VtxAnalysis.h.

◆ m_initialised

bool VtxAnalysis::m_initialised
private

Definition at line 43 of file VtxAnalysis.h.

◆ m_name

std::string VertexAnalysis::m_name
privateinherited

Definition at line 57 of file VertexAnalysis.h.

◆ m_profs

std::vector<TProfile*> VertexAnalysis::m_profs
protectedinherited

Definition at line 53 of file VertexAnalysis.h.

◆ m_rdz_vs_ntrax

TProfile* VtxAnalysis::m_rdz_vs_ntrax = nullptr
private

Definition at line 58 of file VtxAnalysis.h.

◆ m_rdz_vs_nvtx

TProfile* VtxAnalysis::m_rdz_vs_nvtx = nullptr
private

Definition at line 59 of file VtxAnalysis.h.

◆ m_rdz_vs_zed

TProfile* VtxAnalysis::m_rdz_vs_zed = nullptr
private

Definition at line 57 of file VtxAnalysis.h.


The documentation for this class was generated from the following files:
VtxAnalysis::m_dir
TIDDirectory * m_dir
Definition: VtxAnalysis.h:45
VtxAnalysis::m_rdz_vs_nvtx
TProfile * m_rdz_vs_nvtx
Definition: VtxAnalysis.h:59
VtxAnalysis::m_eff_ntrax
TProfile * m_eff_ntrax
Definition: VtxAnalysis.h:65
VtxAnalysis::m_hzed
TH1F * m_hzed
Definition: VtxAnalysis.h:48
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
VtxAnalysis::m_hntrax
TH1F * m_hntrax
Definition: VtxAnalysis.h:49
VertexAnalysis::m_profs
std::vector< TProfile * > m_profs
Definition: VertexAnalysis.h:53
TIDDirectory::pop
void pop()
Definition: TIDDirectory.h:79
VertexAnalysis::addHistogram
void addHistogram(TH1 *h)
Definition: VertexAnalysis.h:43
VertexAnalysis::VertexAnalysis
VertexAnalysis(const std::string &n)
Definition: VertexAnalysis.h:29
VtxAnalysis::m_hnvtx_rec
TH1F * m_hnvtx_rec
Definition: VtxAnalysis.h:51
TIDDirectory
Definition: TIDDirectory.h:25
VtxAnalysis::m_eff_zed
TProfile * m_eff_zed
Definition: VtxAnalysis.h:64
VtxAnalysis::m_initialised
bool m_initialised
Definition: VtxAnalysis.h:43
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
beamspotman.n
n
Definition: beamspotman.py:731
VertexAnalysis::m_histos
std::vector< TH1 * > m_histos
Definition: VertexAnalysis.h:52
VtxAnalysis::m_hzed_rec
TH1F * m_hzed_rec
Definition: VtxAnalysis.h:52
VtxAnalysis::m_hntrax_rec
TH1F * m_hntrax_rec
Definition: VtxAnalysis.h:53
VtxAnalysis::m_rdz_vs_zed
TProfile * m_rdz_vs_zed
Definition: VtxAnalysis.h:57
TIDA::Vertex
Definition: TIDAVertex.h:23
VertexAnalysis::name
const std::string & name() const
Definition: VertexAnalysis.h:33
VtxAnalysis::m_rdz_vs_ntrax
TProfile * m_rdz_vs_ntrax
Definition: VtxAnalysis.h:58
TIDDirectory::push
void push()
Definition: TIDDirectory.h:78
VtxAnalysis::m_hzed_res
TH1F * m_hzed_res
Definition: VtxAnalysis.h:55
VertexAnalysis::m_name
std::string m_name
Definition: VertexAnalysis.h:57
TIDA::Vertex::z
double z() const
Definition: TIDAVertex.h:53
TIDA::Vertex::Ntracks
int Ntracks() const
Definition: TIDAVertex.h:62
VtxAnalysis::m_eff_mu
TProfile * m_eff_mu
Definition: VtxAnalysis.h:67
h
VertexMatcher
Definition: VertexMatcher.h:22
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
VtxAnalysis::m_eff_lb
TProfile * m_eff_lb
Definition: VtxAnalysis.h:68
VtxAnalysis::m_hnvtx
TH1F * m_hnvtx
Definition: VtxAnalysis.h:47
VtxAnalysis::m_eff_nvtx
TProfile * m_eff_nvtx
Definition: VtxAnalysis.h:66