12 #include "../TrackParametersHelper.h"
20 const std::string& dirName,
21 const std::string& anaTag,
25 bool doTruthMuPlots ) :
26 PlotMgr( dirName, anaTag, pParent ),
28 m_doTrackPlots( doTrackPlots ),
29 m_doGlobalPlots( doGlobalPlots ),
30 m_doTruthMuPlots( doTruthMuPlots ) { }
39 if(
sc.isFailure() ) {
47 ATH_MSG_DEBUG(
"Booking vertex parameters plots in " << getDirectory() );
49 if( not m_doGlobalPlots ) {
51 ATH_CHECK( retrieveAndBook( m_vtx_x, m_vertexType+
"_vtx_x" ) );
52 ATH_CHECK( retrieveAndBook( m_vtx_y, m_vertexType+
"_vtx_y" ) );
53 ATH_CHECK( retrieveAndBook( m_vtx_z, m_vertexType+
"_vtx_z" ) );
54 ATH_CHECK( retrieveAndBook( m_vtx_time, m_vertexType+
"_vtx_time" ) );
55 if( m_vertexType !=
"truth" ) {
57 ATH_CHECK( retrieveAndBook( m_vtx_x_err, m_vertexType+
"_vtx_x_err" ) );
58 ATH_CHECK( retrieveAndBook( m_vtx_y_err, m_vertexType+
"_vtx_y_err" ) );
59 ATH_CHECK( retrieveAndBook( m_vtx_z_err, m_vertexType+
"_vtx_z_err" ) );
60 ATH_CHECK( retrieveAndBook( m_vtx_time_err, m_vertexType+
"_vtx_time_err" ) );
61 ATH_CHECK( retrieveAndBook( m_vtx_chi2OverNdof, m_vertexType+
"_vtx_chi2OverNdof" ) );
62 ATH_CHECK( retrieveAndBook( m_vtx_type, m_vertexType+
"_vtx_type" ) );
64 if( m_doTrackPlots ) {
66 ATH_CHECK( retrieveAndBook( m_vtx_nTracks, m_vertexType+
"_vtx_nTracks" ) );
67 ATH_CHECK( retrieveAndBook( m_vtx_track_weight, m_vertexType+
"_vtx_track_weight" ) );
68 ATH_CHECK( retrieveAndBook( m_vtx_track_pt, m_vertexType+
"_vtx_track_pt" ) );
69 ATH_CHECK( retrieveAndBook( m_vtx_track_eta, m_vertexType+
"_vtx_track_eta" ) );
70 ATH_CHECK( retrieveAndBook( m_vtx_track_nSiHits, m_vertexType+
"_vtx_track_nSiHits" ) );
71 ATH_CHECK( retrieveAndBook( m_vtx_track_nSiHoles, m_vertexType+
"_vtx_track_nSiHoles" ) );
72 ATH_CHECK( retrieveAndBook( m_vtx_track_d0, m_vertexType+
"_vtx_track_d0" ) );
73 ATH_CHECK( retrieveAndBook( m_vtx_track_z0, m_vertexType+
"_vtx_track_z0" ) );
74 ATH_CHECK( retrieveAndBook( m_vtx_track_d0_err, m_vertexType+
"_vtx_track_d0_err" ) );
75 ATH_CHECK( retrieveAndBook( m_vtx_track_z0_err, m_vertexType+
"_vtx_track_z0_err" ) );
79 ATH_CHECK( retrieveAndBook( m_nVtx_vs_actualMu_2D, m_vertexType+
"_nVtx_vs_actualMu_2D" ) );
80 ATH_CHECK( retrieveAndBook( m_nVtx_vs_actualMu, m_vertexType+
"_nVtx_vs_actualMu" ) );
81 if( m_doTruthMuPlots ) {
82 ATH_CHECK( retrieveAndBook( m_nVtx_vs_truthMu_2D, m_vertexType+
"_nVtx_vs_truthMu_2D" ) );
83 ATH_CHECK( retrieveAndBook( m_nVtx_vs_truthMu, m_vertexType+
"_nVtx_vs_truthMu" ) );
87 return StatusCode::SUCCESS;
95 template<
typename VERTEX,
typename PARTICLE >
98 const std::vector< const PARTICLE* >& associatedTracks,
99 const std::vector< float >& associatedTrackWeights,
102 if( m_doGlobalPlots )
return StatusCode::SUCCESS;
116 if( m_vertexType !=
"truth" ) {
124 float vchi2OverNdof = ( vndof > 0 ) ? vchi2 / vndof : -9999.;
136 if( m_doTrackPlots ) {
137 size_t nvTracks = associatedTracks.size();
138 if( nvTracks != associatedTrackWeights.size() ) {
140 return StatusCode::FAILURE;
145 for(
size_t it=0 ;
it<nvTracks ;
it++ ) {
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,
192 if( not m_doGlobalPlots )
return StatusCode::SUCCESS;
197 if( m_doTruthMuPlots ) {
202 return StatusCode::SUCCESS;