ATLAS Offline Software
Loading...
Searching...
No Matches
IDTPM2::Resolutions Class Reference

#include <Resolutions.h>

Inheritance diagram for IDTPM2::Resolutions:
Collaboration diagram for IDTPM2::Resolutions:

Public Member Functions

 Resolutions (const std::string &name, ToolHandle< GenericMonitoringTool > *m=0)
 Constructor this method should be an enum of "allowed" methods.
virtual ~Resolutions ()=default
 Destructor.
void initialize ()
 Book the histograms.
void finalize ()
 Finalize resolution and bias histograms should be called from the calling montools stop() method.
void execute (const TrackAnalysisStore &collections) const
 this can be over ridden if need be
void method (unsigned m=0)
unsigned method () const
const std::string & name () const
 generic utilities, just in case
ToolHandle< GenericMonitoringTool > * monTool ()
 mon tool
const ToolHandle< GenericMonitoringTool > * monTool () const
void set_monTool (ToolHandle< GenericMonitoringTool > *m)
 do we need / should we have this specific setter ??
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 the actual path to the histograms for this tool - there simply MUST be a better way ...
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Static Public Member Functions

template<typename Derived>
static std::unique_ptr< IPlotBase > create (const std::string &name, ToolHandle< GenericMonitoringTool > *m)
 factory creation mathod

Protected Member Functions

void copyHist (TH1 *hsrc, TH1 *hdest, bool copyoverflow=true) const
 resolution porocessing stuff these don't really even need to be class functions, they could be simply utility functions
void getHist (const std::string &hname, TH1 *hsrc)
void getHist (ServiceHandle< ITHistSvc > &histsvc, const std::string &hname, TH1 *hsrc) const
void processResolution (const std::string &path, bool writeflag=false)
void processResolution (ServiceHandle< ITHistSvc > &histsvc, const std::string &path, bool writeflag=false) const
virtual ServiceHandle< ITHistSvc > & histSvc ()
 we may well need these at some point ...

Protected Attributes

const std::string & m_name
ToolHandle< GenericMonitoringTool > * m_monTool

Private Types

enum  Param {
  INCLUSIVE , PT , ETA , D0 ,
  Z0 , QOVERP , QOVERPT , THETA ,
  PHI , Z0SIN , NPARAMS , NPARAMSOUT = 3
}

Private Member Functions

void getTrackParameters (const TrackView &p, std::array< float, NPARAMS > &params, std::array< float, NPARAMS > &errors) const
 get the track parameters
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

std::string m_paramName [NPARAMS]
unsigned int m_method
 probably will eventually no longer need these
TIDA::Histogram< float > m_pull [NPARAMS]
TIDA::Histogram< float > m_res [NPARAMS]
TIDA::Histogram< float > m_sigma [NPARAMS]
TIDA::Histogram< float > m_significance [NPARAMS]
TIDA::Histogram2D< float > m_corr [NPARAMS]
TIDA::Histogram< float > m_resHelper [NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_reswidth [NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_resmean [NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_pullHelper [NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_pullwidth [NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_pullmean [NPARAMS][NPARAMSOUT]
TIDA::Histogram2D< float > m_resolution_vs_pt [NPARAMS]
 like the res{Helper,width,mean} plots above but actually make some sense
TIDA::Histogram2D< float > m_resolution_vs_eta [NPARAMS]
TIDA::Histogram2D< float > m_resolution_vs_z0 [NPARAMS]
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels).
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging).

Detailed Description

Definition at line 32 of file Resolutions.h.

Member Enumeration Documentation

◆ Param

Enumerator
INCLUSIVE 
PT 
ETA 
D0 
Z0 
QOVERP 
QOVERPT 
THETA 
PHI 
Z0SIN 
NPARAMS 
NPARAMSOUT 

Definition at line 61 of file Resolutions.h.

Constructor & Destructor Documentation

◆ Resolutions()

IDTPM2::Resolutions::Resolutions ( const std::string & name,
ToolHandle< GenericMonitoringTool > * m = 0 )

Constructor this method should be an enum of "allowed" methods.

NB: no point making this an actual athena configurable class - better to make it an internal class of some global histogram class - although independent, then class HistogramDriver { ... } can containe any number of IHistogramFiller* and call them itself.

then the python for the HistogramDriver can have separate functions to book the relevant histograms, so we can do function HistogramDriver_build: ... histogramFiller.filler = { filler1, filler2 }

and so on, and these become functions that create histograms and for the c++ code it can loop over the fillers, and call their histogram bookers itself. The only issue, is in the use of histogram creating functions from the GenericMonTool: maybe we pass in the HistogramDriver so that they can used the histogram creators from there, or else they would need to begime GenericMonTools themselves. That would actually be more complicted, since to add a new tool, you would need to implement an entire new generic MonTool, but to add a helper class for the HistogramDriver, all you would need to do would be to add a basic python class which creates the histograms with a provided function, so less boiler plate, with simpler, and more flexible code. local include(s)


--— Constructor --—

Definition at line 56 of file Resolutions.cxx.

57 : IPlotBase( name, m ), m_method(0)
58{ }
const std::string & name() const
generic utilities, just in case
Definition IPlotBase.h:68
IPlotBase(const std::string &name, ToolHandle< GenericMonitoringTool > *m=0)
built from dirName and anaTag
Definition IPlotBase.h:41
unsigned int m_method
probably will eventually no longer need these
Definition Resolutions.h:93

◆ ~Resolutions()

virtual IDTPM2::Resolutions::~Resolutions ( )
virtualdefault

Destructor.

Member Function Documentation

◆ copyHist()

void IDTPM2::IPlotBase::copyHist ( TH1 * hsrc,
TH1 * hdest,
bool copyoverflow = true ) const
protectedinherited

resolution porocessing stuff these don't really even need to be class functions, they could be simply utility functions

Definition at line 20 of file IPlotBase.cxx.

20 {
21
22 if ( hsrc->GetNbinsX()!=hdest->GetNbinsX() ) return; // do we want to give an error message ?? throw and exception ??
23
24 int imin = 0;
25 int imax = hsrc->GetNbinsX()+1;
26
27 if ( !copyoverflow ) {
28 imin = 1;
29 imax = hsrc->GetNbinsX();
30 }
31
32 for ( int i=imin ; i<=imax ; i++ ) {
33 hdest->SetBinContent( i, hsrc->GetBinContent(i) );
34 hdest->SetBinError( i, hsrc->GetBinError(i) );
35 }
36
37 hdest->SetEntries( hsrc->GetEntries() );
38}
int imax(int i, int j)

◆ create()

template<typename Derived>
std::unique_ptr< IPlotBase > IDTPM2::IPlotBase::create ( const std::string & name,
ToolHandle< GenericMonitoringTool > * m )
inlinestaticinherited

factory creation mathod

Definition at line 50 of file IPlotBase.h.

51 {
52 return std::make_unique<Derived>( name, m );
53 }

◆ execute()

void IDTPM2::Resolutions::execute ( const TrackAnalysisStore & collections) const
virtual

this can be over ridden if need be

all the IDTPM fillers take a "weight". Where does this "weight" come from ? do we even need it ? double weight = 1;

— reference and test tracks —
don't actually need these here, as we are explicitly iterating over the matched pairs to avoid all the lookups

track matcher just loop over the matched tracks from here ...

we can get all the matches pairs directly ...

then can just iterate over the match pairs rather than look anything up ...

this "fill a vector, then for the tools from the vector" approach is quite nasty would it be better to define the array once outside the loop and over write ? More denagerous, but faster, better still to just use a vector<float> anyway then we can clear() for each track

this is why I don't like this NPARAMS enum appraoch - now you have to start indexing from 1, rather than 0, so you need to know about the enum stucture, really the loop should be for ( unsigned i=PT ; i<NPARAMS ; i++ )

nope, should test is testError!=0 and only fill the pulls etc if the error is set to a non-zero value, than can also be used for truth particles, jets, clusers etc

do we really want the significance for eg phi ? ie phi/dphi ? clealy we only want the significance for valiables that might have a resolution comparable to the actual values

this isn't the residual, we really need 1/testP[i] - 1/refP[i]; but is testP[i] = 1/qpt, then just testP[i]-refP[i] is what we should be using, this

why do we only have the residuals and pulls vs "inclusive", "eta" and "pt" ?? surely we ALSO want these vs, z0, d0 and (for confirmation) vs phi but then we would ALSO want them versus the number of tracks, number of vertices, and also versus <mu>

Implements IDTPM2::IPlotBase.

Definition at line 118 of file Resolutions.cxx.

118 {
119
123
124
128
129 // const std::vector<const TrackView*>& refTracks = collections.reference_tracks();
130 // const std::vector<const TrackView*>& testTracks = collections.test_tracks();
131
134 const TIDA::Associator<const TrackView>* matcher = collections.matcher();
135
136 std::array<float,NPARAMS> refP = {};
137 std::array<float,NPARAMS> refErrorP = {};
138
139 std::array<float,NPARAMS> testP = {};
140 std::array<float,NPARAMS> testErrorP = {};
141
142
144
145 const TIDA::Associator<const TrackView>::map_type& matches = matcher->matched();
146
149
150 TIDA::Associator<const TrackView>::map_type::const_iterator itr = matches.begin();
151
152 for ( ; itr!=matches.end() ; itr++ ) { //cppcheck-suppress postfixOperator
153
154 const TrackView* ref = itr->first;
155 const TrackView* test = itr->second;
156
157 // for ( size_t i=0 ; i<refTracks.size() ; i++ ) {
158
165
166 getTrackParameters( *ref, refP, refErrorP );
167 getTrackParameters( *test, testP, testErrorP );
168
174
175 for( unsigned i=1 ; i<NPARAMS ; i++ ) {
176
177 float residual = testP[i] - refP[i];
178
179 if( i==PHI ) residual = deltaPhi( testP[i] - refP[i] ); // angular difference
180
184
185 if ( testErrorP[i]!=0 ) {
186
187 float pull = residual/testErrorP[i];
188
189 float sigma_test = testErrorP[i];
190
191 float significance_test = testP[i]/testErrorP[i];
192
193 m_pull[i].Fill( pull ); // , weight );
194
199 m_significance[i].Fill( significance_test ); // , weight );
200
201 if ( i==QOVERPT ) {
205 residual = testP[i]/refP[i] - 1; // Relative q/pt resolution
206 sigma_test *= 1/std::fabs( testP[i] ); // relative q/pt error
207 }
208
209 m_sigma[i].Fill( sigma_test ); //, weight );
210
211 }
212
213 // m_corr[i].Fill( refP[i], testP[i], weight ); /// !!! 2D histograms not implemented yet - next thing to do
214
215 m_res[i].Fill( residual ); //, weight );
216
217 m_corr[i].Fill( refP[i], testP[i] );
218
219 m_resolution_vs_pt[i].Fill( ref->pt()*0.001, residual );
220 m_resolution_vs_eta[i].Fill( ref->eta(), residual );
221 m_resolution_vs_z0[i].Fill( ref->z0(), residual );
222
227 // for( unsigned int j=0; j<NPARAMSOUT; j++ ) {
228 // m_resHelper[i][j],Fill( refP[j], residual ); //, weight );
229 // m_pullHelper[i][j].Fill( refP[j], pull ); //, weight );
230 // }
231 }
232 }
233}
const std::regex ref(r_ef)
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
TIDA::Histogram< float > m_sigma[NPARAMS]
Definition Resolutions.h:99
TIDA::Histogram< float > m_pull[NPARAMS]
Definition Resolutions.h:97
TIDA::Histogram2D< float > m_corr[NPARAMS]
TIDA::Histogram< float > m_res[NPARAMS]
Definition Resolutions.h:98
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_significance[NPARAMS]
void getTrackParameters(const TrackView &p, std::array< float, NPARAMS > &params, std::array< float, NPARAMS > &errors) const
get the track parameters
TIDA::Histogram2D< float > m_resolution_vs_eta[NPARAMS]
TIDA::Histogram2D< float > m_resolution_vs_z0[NPARAMS]
std::map< const T *, const S * > map_type
const Matcher_t & matcher() const
Return the matcher object.

◆ finalize()

void IDTPM2::Resolutions::finalize ( )
virtual

Finalize resolution and bias histograms should be called from the calling montools stop() method.

finalize NB: actually this CAN'T be called from finalize, since if we create and histograms in the finalize() and register them with the HistSvc for some reason athena crashes in the clean up, even if we setDirectory(0) on the histograms, so all the finalisation processing much take place in the stop() method so this has to be called indirectly by the algoritm stop()

Implements IDTPM2::IPlotBase.

Definition at line 244 of file Resolutions.cxx.

244 {
245
246 MY_MSG_DEBUG << "Finalising resolution plots: " << name() << endmsg;
247
248 std::string realpath = realPath( "/Resolutions/" );
249
250 std::string names[3] = { "pt", "eta", "z0" };
251
252 for( unsigned i=1 ; i<NPARAMS ; i++ ) {
253 for ( int j=0 ; j<3 ; j++ ) {
254 processResolution( realpath+"resolution_"+m_paramName[i]+"_vs_"+names[j]+"/" );
255 }
256 }
257
258#if 0
259 IDPVM::ResolutionHelper resolutionHelper;
261
265 for( unsigned int i=1; i<NPARAMS; i++ ) {
266 for( unsigned int j=0; j<NPARAMSOUT; j++ ) {
267
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;
271
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;
275
276 // resolutionHelper.makeResolutions( m_resHelper[i][j], m_reswidth[i][j], m_resmean[i][j], method );
277 // resolutionHelper.makeResolutions( m_pullHelper[i][j], m_pullwidth[i][j, m_pullmean[i][j], method );
278 }
279 }
280#endif
281
282}
#define endmsg
#define MY_MSG_DEBUG
Definition MsgMacros.h:25
void processResolution(const std::string &path, bool writeflag=false)
Definition IPlotBase.h:89
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...
Definition IPlotBase.cxx:86
void method(unsigned m=0)
Definition Resolutions.h:54
TIDA::Histogram< float > m_resmean[NPARAMS][NPARAMSOUT]
TIDA::Histogram< float > m_pullmean[NPARAMS][NPARAMSOUT]
std::string m_paramName[NPARAMS]
Definition Resolutions.h:82
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_pullHelper[NPARAMS][NPARAMSOUT]
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ getHist() [1/2]

void IDTPM2::IPlotBase::getHist ( const std::string & hname,
TH1 * hsrc )
inlineprotectedinherited

Definition at line 88 of file IPlotBase.h.

88{ return getHist( histSvc(), hname, hsrc ); }
void getHist(const std::string &hname, TH1 *hsrc)
Definition IPlotBase.h:88
virtual ServiceHandle< ITHistSvc > & histSvc()
we may well need these at some point ...
Definition IPlotBase.h:105

◆ getHist() [2/2]

void IDTPM2::IPlotBase::getHist ( ServiceHandle< ITHistSvc > & histsvc,
const std::string & hname,
TH1 * hsrc ) const
protectedinherited

Definition at line 42 of file IPlotBase.cxx.

42 {
43 TH1* h = 0;
44 if ( histsvc->getHist( hname, h ).isFailure() ) MY_MSG_WARNING << "Could not retieve histogram: " << hname << endmsg;
45 else copyHist( hsrc, h );
46}
#define MY_MSG_WARNING
Definition MsgMacros.h:23
void copyHist(TH1 *hsrc, TH1 *hdest, bool copyoverflow=true) const
resolution porocessing stuff these don't really even need to be class functions, they could be simply...
Definition IPlotBase.cxx:20
histsvc
TrigInDetMonitoring part ################################.

◆ getTrackParameters()

void IDTPM2::Resolutions::getTrackParameters ( const TrackView & p,
std::array< float, NPARAMS > & params,
std::array< float, NPARAMS > & errors ) const
private

get the track parameters


— getTrackParameters —

parameters

do we really want to store such a value ? in the wrapper, we will likely calculate it inside the function so it is no less helpfull to calculate it explicitly

no point testing for all these if it is not a track particle uncertainties

for the time being ...

Definition at line 288 of file Resolutions.cxx.

291{
293
294 params.fill(0);
295
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();
308 params[ INCLUSIVE ] = 1;
309
310 errors.fill(0);
311
312 if ( p.is<xAOD::TrackParticle>() ) {
315 errors[ D0 ] = p.dd0(); //error( p, Trk::d0 );
316 errors[ Z0 ] = p.dz0(); //, Trk::z0 );
317 errors[ QOVERP ] = p.dqOverP(); // p, Trk::qOverP ) * Gaudi::Units::GeV;
318
319 // errors[ QOVERPT ] = qOverPTError( p ) * Gaudi::Units::GeV;
320 errors[ QOVERPT ] = 0; // for the time being
321
322 errors[ THETA ] = p.dtheta(); // error( p, Trk::theta );
323 errors[ PHI ] = p.dphi(); // error( p, Trk::phi );
324 errors[ PT ] = p.dpt(); // pTError( p ) / Gaudi::Units::GeV;
325 // errors[ Z0SIN ] = z0SinThetaError( p ); ///
326 errors[ Z0SIN ] = 0;
327 errors[ ETA ] = p.deta(); // etaError( p );
328 errors[ INCLUSIVE ] = 0;
329 }
330}
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ histSvc()

virtual ServiceHandle< ITHistSvc > & IDTPM2::IPlotBase::histSvc ( )
inlineprotectedvirtualinherited

we may well need these at some point ...

this method is dangerous - should not be used anywhere except finalise or stop

Definition at line 105 of file IPlotBase.h.

105 {
106 if ( monTool()==0 ) throw std::runtime_error("IPlotBase: monTool not set");
107 return (*monTool())->histogramService();
108 }
ToolHandle< GenericMonitoringTool > * monTool()
mon tool
Definition IPlotBase.h:71

◆ initialize()

void IDTPM2::Resolutions::initialize ( )
virtual

Book the histograms.


— Book the histograms —

!!!! ARGH !! NO WAY !!!

corr ? correlation ???

loop all vs variables

not even sure what these histograms are for ... resolutions

pulls

pull helper ???

Implements IDTPM2::IPlotBase.

Definition at line 65 of file Resolutions.cxx.

66{
67 MY_MSG_DEBUG << "Booking resolutions: " << name() << endmsg;
68
69 for( unsigned int i=1; i<NPARAMS; i++ ) {
70
71 m_pull[i] = TIDA::Histogram<float>( monTool(), "pull_"+m_paramName[i] );
72
73 m_pull[i] = TIDA::Histogram<float>( monTool(), "pull_"+m_paramName[i] );
74 m_res[i] = TIDA::Histogram<float>( monTool(), "res_"+m_paramName[i] );
75 m_sigma[i] = TIDA::Histogram<float>( monTool(), "sigma_"+m_paramName[i] );
76 m_significance[i] = TIDA::Histogram<float>( monTool(), "significance_"+m_paramName[i] );
77 m_corr[i] = TIDA::Histogram2D<float>( monTool(), "corr_test_vs_ref_"+m_paramName[i] );
78
79 m_resolution_vs_pt[i] = TIDA::Histogram2D<float>( monTool(), "2D", "resolution_"+m_paramName[i]+"_vs_pt" );
80 m_resolution_vs_eta[i] = TIDA::Histogram2D<float>( monTool(), "2D", "resolution_"+m_paramName[i]+"_vs_eta" );
81 m_resolution_vs_z0[i] = TIDA::Histogram2D<float>( monTool(), "@D", "resolution_"+m_paramName[i]+"_vs_z0" );
82
84 for( unsigned int j=0; j<NPARAMSOUT; j++ ) {
85
88 m_resHelper[i][j] = TIDA::Histogram<float>( monTool(), "resHelper_"+m_paramName[i]+"_vs_"+m_paramName[j] );
89 m_reswidth[i][j] = TIDA::Histogram<float>( monTool(), "resolution_"+m_paramName[i]+"_vs_"+m_paramName[j] );
90 m_resmean[i][j] = TIDA::Histogram<float>( monTool(), "resmean_"+m_paramName[i]+"_vs_"+m_paramName[j] );
91
93 m_pullHelper[i][j] = TIDA::Histogram<float>( monTool(), "pullHelper_"+m_paramName[i]+"_vs_"+m_paramName[j] );
94 m_pullmean[i][j] = TIDA::Histogram<float>( monTool(), "pullmean_"+m_paramName[i]+"_vs_"+m_paramName[j] );
95 m_pullwidth[i][j] = TIDA::Histogram<float>( monTool(), "pullwidth_"+m_paramName[i]+"_vs_"+m_paramName[j] );
96
97 } // close NPARAMSOUT loop
98 } // close NPARAMS loop
99
100}

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)
int outputLevel(const IMessageSvc *ims, const std::string &source)

◆ method() [1/2]

unsigned IDTPM2::Resolutions::method ( ) const
inline

Definition at line 56 of file Resolutions.h.

56{ return m_method; }

◆ method() [2/2]

void IDTPM2::Resolutions::method ( unsigned m = 0)
inline

Definition at line 54 of file Resolutions.h.

◆ monTool() [1/2]

ToolHandle< GenericMonitoringTool > * IDTPM2::IPlotBase::monTool ( )
inlineinherited

mon tool

Definition at line 71 of file IPlotBase.h.

71{ return m_monTool; }
ToolHandle< GenericMonitoringTool > * m_monTool
Definition IPlotBase.h:116

◆ monTool() [2/2]

const ToolHandle< GenericMonitoringTool > * IDTPM2::IPlotBase::monTool ( ) const
inlineinherited

Definition at line 73 of file IPlotBase.h.

73{ return m_monTool; }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 167 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels).
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 182 of file AthMessaging.h.

183{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 // If user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ name()

const std::string & IDTPM2::IPlotBase::name ( ) const
inlineinherited

generic utilities, just in case

Definition at line 68 of file IPlotBase.h.

68{ return m_name; }
const std::string & m_name
Definition IPlotBase.h:114

◆ processResolution() [1/2]

void IDTPM2::IPlotBase::processResolution ( const std::string & path,
bool writeflag = false )
inlineprotectedinherited

Definition at line 89 of file IPlotBase.h.

89{ return processResolution( histSvc(), path, writeflag ); }

◆ processResolution() [2/2]

void IDTPM2::IPlotBase::processResolution ( ServiceHandle< ITHistSvc > & histsvc,
const std::string & path,
bool writeflag = false ) const
protectedinherited

process the histogramss NB: might be better if instead of adding the 2D histogram and then copying the 1D hjistograms back, we passed in the 1D histogram pointers and filled them directly in the Resplot

use the provides 1D, maan, sigme histograms etc would like to do this ...

use the provides 1D, maan, sigme histograms etc

Definition at line 49 of file IPlotBase.cxx.

49 {
50
51 TH2* hist2d = 0;
52
53 if ( histsvc->getHist( path+"2D", hist2d ).isFailure() ) MY_MSG_WARNING << "Could not retieve 2D: " << (path+"2D") << endmsg;
54 else {
55
60
61 Resplot::Resplot rp( path, hist2d );
62
63 rp.Finalise( Resplot::FitNull95 );
64
65 if ( !writeflag ) {
68 // if ( histsvc->regHist( path+"1D", rp.H1D() ).isFailure() ) MY_MSG_WARNING << "Unable to register histogram: 1D: " << name() << endmsg;
69 // if ( histsvc->regHist( path+"mean", rp.Mean() ).isFailure() ) MY_MSG_WARNING << "Unable to register histogram: mean: " << name() << endmsg;
70 // if ( histsvc->regHist( path+"sigma", rp.Sigma() ).isFailure() ) MY_MSG_WARNING << "Unable to register histogram: sigma: " << name() << endmsg;
71 // }
72 // else {
74 getHist( histsvc, path+"1D", rp.H1D() );
75 getHist( histsvc, path+"mean", rp.Mean() );
76 getHist( histsvc, path+"sigma", rp.Sigma() );
77 }
78 }
79
80}
ReadCards * rp
TF1 * FitNull95(TH1D *s, double a=0, double b=0)
Definition Resplot.cxx:1472
path
python interpreter configuration --------------------------------------—
Definition athena.py:130

◆ realPath()

std::string IDTPM2::IPlotBase::realPath ( const std::string & tag = "")
inherited

This is a horrific function, has to get ALL the histograms, just to be able to work out how to get the actual path to the histograms for this tool - there simply MUST be a better way ...

can add on our "fixed" histogram "Vertex" domain

Definition at line 86 of file IPlotBase.cxx.

86 {
87
88 std::string dir = (*monTool())->getPath();
89
91 std::string stub = dir.substr( dir.find('/', 1) + 1 ) + tag;
92
93 const std::vector<std::string>& allhists = histSvc()->getHists();
94
95 std::string basestr = "";
96
97 for ( size_t i=0 ; i<allhists.size() ; i++ ) {
98 if ( allhists[i].find(stub)!=std::string::npos ) {
99 std::string s = allhists[i];
100 basestr = s.substr(0,s.find("/"+stub)+1);
101 break;
102 }
103 }
104
105 return basestr + stub;
106
107}
bool allhists
Definition hcg.cxx:81
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:140

◆ set_monTool()

void IDTPM2::IPlotBase::set_monTool ( ToolHandle< GenericMonitoringTool > * m)
inlineinherited

do we need / should we have this specific setter ??

Definition at line 76 of file IPlotBase.h.

76{ m_monTool=m; }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging).

Definition at line 141 of file AthMessaging.h.

◆ m_corr

TIDA::Histogram2D<float> IDTPM2::Resolutions::m_corr[NPARAMS]
private

Definition at line 101 of file Resolutions.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_method

unsigned int IDTPM2::Resolutions::m_method
private

probably will eventually no longer need these

Definition at line 93 of file Resolutions.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool>* IDTPM2::IPlotBase::m_monTool
protectedinherited

Definition at line 116 of file IPlotBase.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels).

Definition at line 132 of file AthMessaging.h.

◆ m_name

const std::string& IDTPM2::IPlotBase::m_name
protectedinherited

Definition at line 114 of file IPlotBase.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_paramName

std::string IDTPM2::Resolutions::m_paramName[NPARAMS]
private
Initial value:
= {
"inclusive", "pt", "eta", "d0", "z0", "qoverp", "ptqopt", "theta", "phi", "z0sin"
}

Definition at line 82 of file Resolutions.h.

82 {
83 "inclusive", "pt", "eta", "d0", "z0", "qoverp", "ptqopt", "theta", "phi", "z0sin"
84 };

◆ m_pull

TIDA::Histogram<float> IDTPM2::Resolutions::m_pull[NPARAMS]
private

Definition at line 97 of file Resolutions.h.

◆ m_pullHelper

TIDA::Histogram<float> IDTPM2::Resolutions::m_pullHelper[NPARAMS][NPARAMSOUT]
private

Definition at line 107 of file Resolutions.h.

◆ m_pullmean

TIDA::Histogram<float> IDTPM2::Resolutions::m_pullmean[NPARAMS][NPARAMSOUT]
private

Definition at line 109 of file Resolutions.h.

◆ m_pullwidth

TIDA::Histogram<float> IDTPM2::Resolutions::m_pullwidth[NPARAMS][NPARAMSOUT]
private

Definition at line 108 of file Resolutions.h.

◆ m_res

TIDA::Histogram<float> IDTPM2::Resolutions::m_res[NPARAMS]
private

Definition at line 98 of file Resolutions.h.

◆ m_resHelper

TIDA::Histogram<float> IDTPM2::Resolutions::m_resHelper[NPARAMS][NPARAMSOUT]
private

Definition at line 103 of file Resolutions.h.

◆ m_resmean

TIDA::Histogram<float> IDTPM2::Resolutions::m_resmean[NPARAMS][NPARAMSOUT]
private

Definition at line 105 of file Resolutions.h.

◆ m_resolution_vs_eta

TIDA::Histogram2D<float> IDTPM2::Resolutions::m_resolution_vs_eta[NPARAMS]
private

Definition at line 114 of file Resolutions.h.

◆ m_resolution_vs_pt

TIDA::Histogram2D<float> IDTPM2::Resolutions::m_resolution_vs_pt[NPARAMS]
private

like the res{Helper,width,mean} plots above but actually make some sense

Definition at line 113 of file Resolutions.h.

◆ m_resolution_vs_z0

TIDA::Histogram2D<float> IDTPM2::Resolutions::m_resolution_vs_z0[NPARAMS]
private

Definition at line 115 of file Resolutions.h.

◆ m_reswidth

TIDA::Histogram<float> IDTPM2::Resolutions::m_reswidth[NPARAMS][NPARAMSOUT]
private

Definition at line 104 of file Resolutions.h.

◆ m_sigma

TIDA::Histogram<float> IDTPM2::Resolutions::m_sigma[NPARAMS]
private

Definition at line 99 of file Resolutions.h.

◆ m_significance

TIDA::Histogram<float> IDTPM2::Resolutions::m_significance[NPARAMS]
private

Definition at line 100 of file Resolutions.h.


The documentation for this class was generated from the following files: