ATLAS Offline Software
Loading...
Searching...
No Matches
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
9using CLHEP::GeV;
10
11namespace PhysVal{
12
13TrkAndVtxPlots::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}
TrkAndVtxPlots(PlotBase *pParent, const std::string &sDir)
virtual void initializePlots()
void fill(const xAOD::TrackParticle *trk, const xAOD::EventInfo *evt)
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
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
float z() const
Returns the z position.
float y() const
Returns the y position.
float x() const
Returns the x position.
EventInfo_v1 EventInfo
Definition of the latest event info version.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.