39#include "GaudiKernel/SystemOfUnits.h"
69 for(
unsigned int i=1; i<
NPARAMS; i++ ) {
112 while ( dphi<-
M_PI ) dphi += 2*
M_PI;
136 std::array<float,NPARAMS> refP = {};
137 std::array<float,NPARAMS> refErrorP = {};
139 std::array<float,NPARAMS> testP = {};
140 std::array<float,NPARAMS> testErrorP = {};
150 TIDA::Associator<const TrackView>::map_type::const_iterator itr = matches.begin();
152 for ( ; itr!=matches.end() ; itr++ ) {
175 for(
unsigned i=1 ; i<
NPARAMS ; i++ ) {
177 float residual = testP[i] - refP[i];
179 if( i==
PHI ) residual =
deltaPhi( testP[i] - refP[i] );
185 if ( testErrorP[i]!=0 ) {
187 float pull = residual/testErrorP[i];
189 float sigma_test = testErrorP[i];
191 float significance_test = testP[i]/testErrorP[i];
205 residual = testP[i]/refP[i] - 1;
206 sigma_test *= 1/std::fabs( testP[i] );
215 m_res[i].Fill( residual );
217 m_corr[i].Fill( refP[i], testP[i] );
248 std::string realpath =
realPath(
"/Resolutions/" );
250 std::string names[3] = {
"pt",
"eta",
"z0" };
252 for(
unsigned i=1 ; i<
NPARAMS ; i++ ) {
253 for (
int j=0 ; j<3 ; j++ ) {
265 for(
unsigned int i=1; i<
NPARAMS; i++ ) {
268 std::cout <<
"\t" <<
m_resHelper[i][j].name() << std::endl;
269 std::cout <<
"\t" <<
m_reswidth[i][j].name() << std::endl;
270 std::cout <<
"\t" <<
m_resmean[i][j].name() << std::endl;
272 std::cout <<
"\t" <<
m_pullHelper[i][j].name() << std::endl;
273 std::cout <<
"\t" <<
m_pullwidth[i][j].name() << std::endl;
274 std::cout <<
"\t" <<
m_pullmean[i][j].name() << std::endl;
289 std::array<float,NPARAMS>& params,
290 std::array<float,NPARAMS>& errors )
const
296 params[
D0 ] = p.d0();
297 params[
Z0 ] = p.z0();
298 params[
QOVERP ] = p.qOverP() * Gaudi::Units::GeV;
299 params[
QOVERPT ] = p.qOverP()*std::sin(p.theta()) * Gaudi::Units::GeV;
300 params[
THETA ] = p.theta();
301 params[
PHI ] = p.phi();
302 params[
PT ] = p.pt() / Gaudi::Units::GeV;
306 params[
Z0SIN ] = p.z0()*std::sin(p.theta());
307 params[
ETA ] = p.eta();
315 errors[
D0 ] = p.dd0();
316 errors[
Z0 ] = p.dz0();
317 errors[
QOVERP ] = p.dqOverP();
322 errors[
THETA ] = p.dtheta();
323 errors[
PHI ] = p.dphi();
324 errors[
PT ] = p.dpt();
327 errors[
ETA ] = p.deta();
const std::regex ref(r_ef)
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
emacs: this is -*- c++ -*-
emacs: this is -*- c++ -*-
methods
methods acc to which mean&RMS can be evaluated
void processResolution(const std::string &path, bool writeflag=false)
ToolHandle< GenericMonitoringTool > * monTool()
mon tool
std::string realPath(const std::string &tag="")
This is a horrific function, has to get ALL the histograms, just to be able to work out how to get th...
const std::string & name() const
generic utilities, just in case
IPlotBase(const std::string &name, ToolHandle< GenericMonitoringTool > *m=0)
built from dirName and anaTag
TIDA::Histogram< float > m_sigma[NPARAMS]
TIDA::Histogram< float > m_pull[NPARAMS]
TIDA::Histogram2D< float > m_corr[NPARAMS]
void method(unsigned m=0)
Resolutions(const std::string &name, ToolHandle< GenericMonitoringTool > *m=0)
Constructor this method should be an enum of "allowed" methods.
TIDA::Histogram< float > m_res[NPARAMS]
TIDA::Histogram< float > m_resmean[NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_pullmean[NPARAMS][NPARAMSOUT]
std::string m_paramName[NPARAMS]
TIDA::Histogram2D< float > m_resolution_vs_pt[NPARAMS]
like the res{Helper,width,mean} plots above but actually make some sense
TIDA::Histogram< float > m_reswidth[NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_pullwidth[NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_resHelper[NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_significance[NPARAMS]
void finalize()
Finalize resolution and bias histograms should be called from the calling montools stop() method.
void initialize()
Book the histograms.
void getTrackParameters(const TrackView &p, std::array< float, NPARAMS > ¶ms, std::array< float, NPARAMS > &errors) const
get the track parameters
TIDA::Histogram< float > m_pullHelper[NPARAMS][NPARAMSOUT]
void execute(const TrackAnalysisStore &collections) const
this can be over ridden if need be
unsigned int m_method
probably will eventually no longer need these
TIDA::Histogram2D< float > m_resolution_vs_eta[NPARAMS]
TIDA::Histogram2D< float > m_resolution_vs_z0[NPARAMS]
std::map< const T *, const S * > map_type
forward declaration required for function prototype
TrackParticle_v1 TrackParticle
Reference the current persistent version: