20 const std::string& dirName,
21 const std::string& anaTag,
25 bool doTruthMuPlots ) :
26 PlotMgr( dirName, anaTag, pParent ),
39 if(
sc.isFailure() ) {
87 return StatusCode::SUCCESS;
95template<
typename VERTEX,
typename PARTICLE >
98 const std::vector< const PARTICLE* >& associatedTracks,
99 const std::vector< float >& associatedTrackWeights,
105 float vx =
posX( vertex );
106 float vy =
posY( vertex );
107 float vz =
posZ( vertex );
108 float vtime =
time( vertex );
121 float vtimeErr =
timeErr( vertex );
123 float vndof =
ndof( vertex );
124 float vchi2OverNdof = ( vndof > 0 ) ? vchi2 / vndof : -9999.;
137 size_t nvTracks = associatedTracks.size();
138 if( nvTracks != associatedTrackWeights.size() ) {
140 return StatusCode::FAILURE;
145 for(
size_t it=0 ; it<nvTracks ; it++ ) {
148 float tpt =
pT( *associatedTracks[it] ) / Gaudi::Units::GeV;
149 float teta =
eta( *associatedTracks[it] );
150 float tnSiHits =
nSiHits( *associatedTracks[it] );
151 float tnSiHoles =
nSiHoles( *associatedTracks[it] );
152 float td0 =
d0( *associatedTracks[it] );
153 float tz0 =
z0( *associatedTracks[it] ) - vz;
169 return StatusCode::SUCCESS;
174 const std::vector< const xAOD::TrackParticle* >& associatedTracks,
175 const std::vector< float >& associatedTrackWeights,
180 const std::vector< const xAOD::TruthParticle* >& associatedTracks,
181 const std::vector< float >& associatedTrackWeights,
202 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
Utility methods to access track/truth particles parmeters in a consitent way in this package.
StatusCode retrieveAndBook(P *&pHisto, const std::string &identifier, const std::string &folderOverride="", const std::string &nameOverride="")
PlotMgr(const std::string &dirName, const std::string &anaTag, PlotMgr *pParent=nullptr)
Constructor taking parent node and directory name for plots pParent = nullptr by default to book plot...
void finalizePlots()
Print out final stats on histograms.
void initializePlots()
Book the histograms.
TH1 * m_vtx_track_nSiHits
TH2 * m_nVtx_vs_actualMu_2D
TH1 * m_vtx_track_nSiHoles
TH1 * m_vtx_x
vertex parameters plots
TH2 * m_nVtx_vs_truthMu_2D
vertex multiplicity vs pileup plots
VertexParametersPlots(PlotMgr *pParent, const std::string &dirName, const std::string &anaTag, const std::string &vertexType, bool doTrackPlots=false, bool doGlobalPlots=false, bool doTruthMuPlots=false)
Constructor.
TH1 * m_vtx_nTracks
vertex-associated tracks plots
TProfile * m_nVtx_vs_actualMu
TProfile * m_nVtx_vs_truthMu
StatusCode fillPlots(const VERTEX &vertex, const std::vector< const PARTICLE * > &associatedTracks, const std::vector< float > &associatedTrackWeights, float weight)
Dedicated fill method (for reco and/or truth vertices)
const std::string & getDirectory()
float nSiHoles(const U &p)
Accessor utility function for getting the value of nSiHoles.
float pT(const U &p)
Accessor utility function for getting the value of pT.
float posX(const V &v)
Accessor utility function for getting the value of vertex position x.
float posZ(const V &v)
Accessor utility function for getting the value of vertex position z.
float chiSquared(const U &p)
float posY(const V &v)
Accessor utility function for getting the value of vertex position y.
float timeErr(const V &v)
float nSiHits(const U &p)
uint8_t hasValidTime(const U &p)
int vertexType(const V &v)
TruthVertex_v1 TruthVertex
Typedef to implementation.
Vertex_v1 Vertex
Define the latest version of the vertex class.
void fill(H5::Group &out_file, size_t iterations)