ATLAS Offline Software
TrkAndVtxPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TrkAndVtxPlots.h"
6 
7 
8 
9 using CLHEP::GeV;
10 
11 namespace PhysVal{
12 
13 TrkAndVtxPlots::TrkAndVtxPlots(PlotBase* pParent, const std::string& sDir):PlotBase(pParent, sDir)
14 {}
15 
17  ntrk = Book1D("ntrk", "Number of tracks; n ;Events", 3000, 0., 3000);
18  nvtx = Book1D("nvtx", "Number of vertices; n ;Events", 150, 0., 150);
19 
20  vtx_x = Book1D("x", "Vertex x; x ;Events", 200, -1., 1);
21  vtx_y = Book1D("y", "Vertex y; y ;Events", 300, -1.5, 1.5);
22  vtx_z = Book1D("z", "Vertex z; z ;Events", 200, -250., 250);
23 }
24 
26 
27  vtx_x->Fill(vtx->x(),evt->beamSpotWeight());
28  vtx_y->Fill(vtx->y(),evt->beamSpotWeight());
29  vtx_z->Fill(vtx->z(),evt->beamSpotWeight());
30 
31 }
32 
34  std::cout << "filling TrackAndVertex plots with BS weight: " << evt->beamSpotWeight();
35 }
36 
37  void TrkAndVtxPlots::fill(unsigned int ntrack, unsigned int nvertex, const xAOD::EventInfo* evt) {
38 
39  ntrk->Fill(ntrack,evt->beamSpotWeight());
40  nvtx->Fill(nvertex,evt->beamSpotWeight());
41 }
42 
43 }
xAOD::Vertex_v1::x
float x() const
Returns the x position.
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
PlotBase
Definition: PlotBase.h:34
PhysVal::TrkAndVtxPlots::TrkAndVtxPlots
TrkAndVtxPlots(PlotBase *pParent, const std::string &sDir)
Definition: TrkAndVtxPlots.cxx:13
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
PhysVal::TrkAndVtxPlots::ntrk
TH1 * ntrk
Definition: TrkAndVtxPlots.h:24
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
TrkAndVtxPlots.h
PlotBase::Book1D
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition: PlotBase.cxx:94
PhysVal::TrkAndVtxPlots::vtx_z
TH1 * vtx_z
Definition: TrkAndVtxPlots.h:29
PhysVal::TrkAndVtxPlots::fill
void fill(const xAOD::TrackParticle *trk, const xAOD::EventInfo *evt)
Definition: TrkAndVtxPlots.cxx:33
xAOD::Vertex_v1::z
float z() const
Returns the z position.
PhysVal::TrkAndVtxPlots::nvtx
TH1 * nvtx
Definition: TrkAndVtxPlots.h:26
PhysVal
Definition: BTagPlots.cxx:13
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::Vertex_v1::y
float y() const
Returns the y position.
PhysVal::TrkAndVtxPlots::initializePlots
virtual void initializePlots()
Definition: TrkAndVtxPlots.cxx:16
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
PhysVal::TrkAndVtxPlots::vtx_x
TH1 * vtx_x
Definition: TrkAndVtxPlots.h:27
PhysVal::TrkAndVtxPlots::vtx_y
TH1 * vtx_y
Definition: TrkAndVtxPlots.h:28