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

#include <TrackAnalysis.h>

Inheritance diagram for IDTPM2::TrackAnalysis:
Collaboration diagram for IDTPM2::TrackAnalysis:

Public Member Functions

 TrackAnalysis (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor with parameters.
 TrackAnalysis ()=delete
virtual ~TrackAnalysis ()
 Destructor.
virtual StatusCode initialize ()
virtual StatusCode bookHistograms ()
virtual StatusCode fillHistograms (const EventContext &context) const
virtual StatusCode procHistograms ()
virtual StatusCode proc ()
 finalise histograms in stop()
virtual StatusCode finalize ()
bool execute (const EventContext &context) const
 finalise histograms in stop()
virtual StatusCode start () override
virtual StatusCode stop () override
void setTDT (ToolHandle< Trig::TrigDecisionTool > &tdt)
 assign the TrigDecisionTool - we get this passed in from the top level algorithm so don't need to mess about retrieving it ourselves
const ToolHandle< Trig::TrigDecisionTool > & getTDT () const
ToolHandle< GenericMonitoringTool > & monTool ()
const ToolHandle< GenericMonitoringTool > & monTool () const
bool hasTagNProbe () const
bool isInitialized () const
const std::string & refTracks () const
const std::string & refTracks_tag () const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

ToolHandle< Trig::TrigDecisionTool > m_tdt
ToolHandle< GenericMonitoringTool > m_tool { this, "montool", "", "histogram montool" }
 histogram montool - books the histograms in the python
std::unique_ptr< AnalysisR4 > m_analysis
 and the lightweight tool to actually fill them - could join this with the above montool, but as usual with athena code, that would make things a lot more complicated, whilst simultaneously being a lot less flexible
Gaudi::Property< std::vector< std::string > > m_fillers { this, "Fillers", {}, "List of histogram filler tools" }
ToolHandle< IDTPM2::ITrackSelector > m_refSelector { this, "ReferenceSelector", "", "" }
 tools
ToolHandle< IDTPM2::ITrackSelector > m_testSelector { this, "TestSelector", "", "" }
ToolHandle< TrackViewMatchingTool > m_trackMatchingTool
 need to define a proper interface class
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoName { this, "EventInfo", "EventInfo", "EventInfo name" }
 read handles, but ...
Gaudi::Property< std::string > m_reference { this, "Reference", "InDetTrackParticles", "reference collection" }
 properties
Gaudi::Property< std::string > m_referenceVertices { this, "ReferenceVertices", "PrimaryVertices", "reference vertex collection" }
Gaudi::Property< std::string > m_tagChain { this, "TagChain", "", "tag leg for tag n probe analysis" }
Gaudi::Property< std::string > m_reference_tag { this, "ReferenceTag", "", "reference tag collection for Tag and Probe" }
Gaudi::Property< ConfiguredValue< int > > m_refPdgId { this, "ReferencePdgId", {}, "reference PDG ID (for truth particle tag and probe)" }
Gaudi::Property< ConfiguredValue< int > > m_refPdgId_tag { this, "ReferencePdgIdTag", {}, "reference PDG ID (for truth particle tag and probe)" }
Gaudi::Property< float > m_minTagMass { this, "MinTagMass", 70, "Minimum invariant mass for Tag and Probe" }
Gaudi::Property< float > m_maxTagMass { this, "MaxTagMass", 110, "Maximum invariant mass for Tag and Probe" }
Gaudi::Property< float > m_minTagPT { this, "MinTagPT", 15, "Minimum tag PT for Tag and Probe" }
bool m_initialized = false
 and sensible internal variables we can set from the configuration ...
std::string m_triggerchain
std::string m_refTracks
std::string m_testTracks
std::string m_rois
std::string m_vertices
int m_leg = -1
std::string m_extra
std::string m_refVertices
std::string m_triggerchain_tag
std::string m_refTracks_tag
std::string m_roi_tag
int m_leg_tag = -1
std::string m_extra_tag
std::unique_ptr< TagNProbe > m_tnp = 0
Gaudi::Property< bool > m_useDecorations { this, "useDecorations", false, "Use athena decorations or not" }
SG::ReadDecorHandleKeyArray< xAOD::EventInfo > m_beamKeys {this, "BeamSpotDecoKeys", {"EventInfo.beamPosX", "EventInfo.beamPosY", "EventInfo.beamPosZ"}, "Beamspot positions"}
std::unique_ptr< IPredicate< TrackView > > m_tnpPredicate = 0

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrackAnalysis() [1/2]

TrackAnalysis::TrackAnalysis ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructor with parameters.


----— Parametrized constructor ----—

Definition at line 41 of file TrackAnalysis.cxx.

41 :
42 AthAlgTool( type, name, parent ),
43 m_tdt("Trig::TrigDecisionTool/TrigDecisionTool"),
44 m_analysis(std::make_unique<AnalysisR4>(name))
45{ }
AthAlgTool()
Default constructor:
std::unique_ptr< AnalysisR4 > m_analysis
and the lightweight tool to actually fill them - could join this with the above montool,...

◆ TrackAnalysis() [2/2]

IDTPM2::TrackAnalysis::TrackAnalysis ( )
delete

◆ ~TrackAnalysis()

TrackAnalysis::~TrackAnalysis ( )
virtualdefault

Destructor.


----— Default destructor ----—

Member Function Documentation

◆ bookHistograms()

StatusCode TrackAnalysis::bookHistograms ( )
virtual

----— bookHistograms ----—

Definition at line 190 of file TrackAnalysis.cxx.

191{
192 return StatusCode::SUCCESS;
193}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

bool TrackAnalysis::execute ( const EventContext & context) const

finalise histograms in stop()

actaully, the offline store does not need the tdt

only retrieve the global collection if not a trigger analysis ...


---— RoI getter/selector ----—

would likely never be set = proably be best localising all TagNProbe information into the TagNProbe class

this isn't the way to do it. If you want to use a dummy Roi then add the dummy Roi to the Roi vector !!!

actually, we shouldn't need to bother with testing for the "Trigger Navigation" we should only need to check whether we are requesting a trigger collection / chain

doesn't need any configuration - could for instance, get this to be a track or vertex filter, rather than just for tracks

need to make this mass range, and the pt range, configurable parameters add to the chain string ? or as normal job properties ?? if normal then would have to run different types - Z, J/psi etc as different instances, properties, maybe allow both ?

why check if the Navigation is required when you can just check the trigger chain if ( m_trkAnaDef->doTrigNavigation() ) { actually, the logic is the other way round - if it is a trigger collection then we will need tha navigation

at this point, we have the reference objects, so for a tag and probe analysis with the same reference type - eg electron, mu etc all we need now, if to filter these to the relevant Rois and store for later use in the selection

make this a unique_ptr so that we only need to actually construct the store if we are doing a tag n probe analysis with different references

get the tag objects for the tag aqnd probe analysis ...

this is needed in case the tag and probe types are not the same in each leg ...

yep, different legs here ...

note we can do some basic selection of the tags with the predicate

So we are using three TrackAnalysisCollections objets ...

  • the "Raw" object for the "full" collections,
  • the roiStore for the Roiselected collections, and
  • the selectedStore for the tracks in the rois, after selection
  • since it is the selectedStore which is passed into the histogram filling, it is that one where we store the EventInfo NB: we should set a flag for the "first" Roi in that store so we can count events etc

don't actually need these to be named

no point doin a vertex analysis, if no test, or reefernce vertex has been specified

this stuff is still being developed and tested, so we need all this left in here ...

at the moment - for the sake of argument, just assume that the vertices always live in the Roi - need to fix that for the tau vertices, but for the FS tracking that will be ok

get the Event info for this event ... NB: only get the EventInfo fir the selectedStore, since that is the one which is run over by the analyses

store the roi index number for the analysis ...

Getting RoI ElementLink

skip non-valid RoI link

get the test tracks for this Roi

FIXME: this is a bit of a hack - it just adds the vertices to the selected store and really we need to add them to the Roi store, and then implement a vertex selector

again, being used for vertex analysis development ...

dbg ...

NB: in principle, it may be more efficient to use an interface such as roiFilter.getTracks( const vector<TrackView*>& in, RoiDesciptor* roi, vector<TrackView*>& out ); and then directly clear, and fill the output collection inside the selector the current implementation has the advantage that the internal collection is local so can be better optimised, but passing in the collection would mean that we can make use of the prior space allocated for the collection

printtracks( roiStore.reference_tracks(), " filtered reference tracks" );

maybe we can do something here to avoid having to copy the container

select the trigger tracks ...

store this mastcher access in the tool,

for Harry's matcher tool

vertex

do we want to transfer this using unique_ptr ??

rather than passing this in, perhaps better to simply use the collections themselves

Definition at line 223 of file TrackAnalysis.cxx.

223 {
224
225 feclearexcept(FE_ALL_EXCEPT);
226 fedisableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
227
228 MY_MSG_DEBUG << "Filling hists " << name() << "\ttrigger: " << m_triggerchain << " ..." << endmsg;
229
230 unsigned decisionType = TrigDefs::Physics; // TrigDefs::includeFailedDecisions;
231
232 if( !m_triggerchain.empty() && !m_tdt->isPassed( m_triggerchain, decisionType ) ) return true;
233
234 MY_MSG_DEBUG << "␛[91;1m PROCESSING ------------------------------------------------------------------------------------␛[m" << endmsg;
235
236 MY_MSG_DEBUG << "TrackAnalysis::execute() " << name()
237 << " refTracks: " << m_refTracks
238 << "\t testTracks: " << m_testTracks
239 << "\ttriggerchain: " << m_triggerchain << endmsg;
240
241
242#if 0
243 if ( m_testTracks.find("HLT_")==std::string::npos && m_testTracks.find("EF_")==std::string::npos ) {
244
245 const std::vector<std::string> configuredChains = m_tdt->getListOfTriggers("HLT_.*, EF_.*");
246
247 for ( unsigned i=0 ; i<configuredChains.size() ; i++ ) {
248 if( m_tdt->isPassed( configuredChains[i], decisionType ) ) std::cout << i << "\t" << "␛[91;1m" << "Chain " << configuredChains[i] << " pass (ACN)␛[m" << std::endl;
249 if ( configuredChains[i] == m_triggerchain ) std::cout << "Mutha ..." << configuredChains[i] << " " << m_triggerchain << "\n\n" << std::endl;
250 }
251
252 MY_MSG_INFO << "␛[91;1m" << configuredChains.size() << " Configured Chains" << "␛[m"
253 <<"\ttrigger chain: " << m_triggerchain << " :: "
254 << m_tdt->isPassed( m_triggerchain, decisionType ) << endmsg;
255 }
256#endif
257
258 IDTPM2::TrackAnalysisStore trackAnaStore( "_duff", context );
259
260 if ( !m_useDecorations ) trackAnaStore.setBeamKeys( &m_beamKeys );
261
263 // trackAnaStore.setTDT( &m_tdt );
264
265 RoiSelector roiSelector(&m_tdt);
266
267 trackAnaStore.fillViewRef( m_refTracks );
268
269 // printtracks( trackAnaStore.reference_tracks(), "\ttrackAnaStore: reference" );
270
272
273 bool isTrigger = m_testTracks.find("HLT_")!=std::string::npos || m_testTracks.find("EF_")!=std::string::npos;
274
275 if ( !isTrigger ) trackAnaStore.fillViewTest( m_testTracks );
276
280 std::vector<TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection> > selectedRois;
281
284 std::vector<TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection> > tagRois;
285
288 size_t selectedRoisSize = 1; // by default only one "dummy" RoI, i.e. for offline analysis
289
292
295 TrackRoiSelector roiFilter;
296
297 std::unique_ptr<TagNProbe> tnp = 0;
298
303
304 if ( !m_tagChain.empty() ) tnp = std::make_unique<TagNProbe>( m_minTagMass, m_maxTagMass );
305
310 if ( !m_triggerchain.empty() ) {
311 selectedRois = roiSelector.retrieveRois( m_triggerchain, m_rois );
312 selectedRoisSize = selectedRois.size();
313 }
314
318
321 std::unique_ptr<TrackAnalysisStore> tagStore = 0;
322
323 if ( tnp ) {
324
326
328 const std::vector<const TrackView*>* vref_ptr;
329
330 MY_MSG_DEBUG << "reftracks: " << m_refTracks << "\t:" << m_refTracks_tag << endmsg;
331
334 tagStore = std::make_unique<TrackAnalysisStore>( "tagstore", context );
335 tagStore->fillViewRef( m_refTracks_tag );
336 vref_ptr = &tagStore->reference_tracks();
337 }
338 else {
339 vref_ptr = &trackAnaStore.reference_tracks();
340 }
341
342 const std::vector<const TrackView*>& vref = *vref_ptr;
343
344 tagRois = roiSelector.retrieveRois( m_triggerchain_tag, m_roi_tag, m_leg_tag );
345
346 for ( auto roi : tagRois ) {
347 ElementLink<TrigRoiDescriptorCollection> roi_link = roi.link;
348 if( ! roi_link.isValid() ) continue;
349 std::vector<const TrackView*> v = roiFilter.getTracks( vref, *roi_link.cptr() );
351 tnp->append_tags( v.begin(), v.end(), *m_tnpPredicate.get() );
352 }
353
354 MY_MSG_DEBUG << "tnp size() : " << tnp->size() << "\t" << vref.size() << endmsg;
355
356#if 0
358 const std::vector<const TrackView*>& v = trackAnaStore.reference_tracks();
359 for ( size_t i=0 ; i<v.size() ; i++ ) {
360 bool ok = tnp->select( v[i] );
361 std::vector<double> m = tnp->masses( v[i] );
362 std::cout << "\ttnp: " << ok << "\tm: " << m.size() << m << "\t " << *v[i] << std::endl;
363 }
364#endif
365
366 }
367
377
378 TrackAnalysisStore roiStore( "roi", &m_tdt, context );
379 TrackAnalysisStore selectedStore( "selected", &m_tdt, context );
380
382 if ( !m_vertices.empty() && !m_refVertices.empty() ) selectedStore.fillVertexViewRef( m_refVertices );
383
385
386 // std::cout << "TrackAnalysis: ref vtx size: " << selectedStore.refvertices().size() << std::endl;
387
388 // const std::vector<const VertexView*> vtx = selectedStore.refvertices();
389
390 // for ( int iv=vtx.size() ; iv-- ; ) {
391 // if ( vtx[iv]->vertexType()!=0 ) std::cout << "\t" << iv << "\tvtx[" << iv << "]: " << *vtx[iv] << std::endl;
392 // }
393
397
398
402 if ( selectedStore.fillEventInfo( m_eventInfoName.key() ).isFailure() ) return false;
403
404 MY_MSG_DEBUG << "Processing event = " << selectedStore.eventInfo()->eventNumber() << endmsg;
405
406 for( size_t ir=selectedRoisSize ; ir-- ; ) {
407
408 MY_MSG_DEBUG << "\tRoi: " << ir << endmsg;
409
410 if( !m_triggerchain.empty() ) {
411
413 selectedStore.roiIndex(ir);
414
416 ElementLink<TrigRoiDescriptorCollection> roi_link = selectedRois[ir].link;
417
419 if( ! roi_link.isValid() ) {
420 MY_MSG_WARNING << "Found non-valid RoI ElementLink" << endmsg;
421 continue;
422 }
423
424 const TrigRoiDescriptor* const* roiptr = roi_link.cptr();
425
426 if ( !roiptr ) {
427 MY_MSG_WARNING << "could not fetch RoiDescriptor: " << m_rois << endmsg;
428 continue;
429 }
430
432 if ( isTrigger ) {
433
434 roiStore.fillViewTest( m_testTracks, roi_link );
435
439 if ( !m_vertices.empty() ) selectedStore.fillVertexViewTest( m_vertices, roi_link );
440
442 // const std::vector<const VertexView*> vtx = selectedStore.testvertices();
443
444 // for ( int iv=vtx.size() ; iv-- ; ) {
445 // std::cout << "\t\t" << iv << "\tvtx[" << iv << "]: " << *vtx[iv] << std::endl;
446 // }
447
448 // printtracks( roiStore.test_tracks(), "\nroiStore: test tracks" );
449 // if ( !m_vertices.empty() ) fillroivertices( roi_link, m_vertices );
450
451 // selectedStore.fill<VertexView,xAOD::VertexContainer>( selectedStore.testvertices(),
452 // roi_link, m_vertices );
453
454 }
455
457 // printtracks( trackAnaStore.test_tracks(), "test (should be ok - roi retrieve II)" );
458
465
466 roiStore.reference_tracks() = roiFilter.getTracks( trackAnaStore.reference_tracks(), *roiptr );
467
469
470 }
471 else {
473 roiStore.reference_tracks() = trackAnaStore.reference_tracks();
474 roiStore.test_tracks() = trackAnaStore.test_tracks();
475 }
476
477 // printtracks( roiStore.reference_tracks(), "\troiStore: reference" );
478 // printtracks( roiStore.test_tracks(), "\troiStore: test" );
479
480 MY_MSG_DEBUG << "SUTT: TrackSelection ..." << endmsg;
481
482 selectedStore.reference_tracks() = m_refSelector->selectTracks( roiStore.reference_tracks(), tnp.get() );
483
484 // printtracks( selectedStore.reference_tracks(), "\tselectedStore: reference" );
485
487 selectedStore.test_tracks() = m_testSelector->selectTracks( roiStore.test_tracks() );
488
489 // printtracks( selectedStore.test_tracks(), "\tselectedStore: test" );
490
492 // TDeltaRMatcher<const TrackView> matcher( "DeltaRMatcher", 0.1 ); /// FIXME: turn this hard coded parameter in to a job Property
493
494 std::unique_ptr<TIDA::Associator<const TrackView> > matcher = m_trackMatchingTool->uclone();
495
496 // MY_MSG_DEBUG << "n matched: " << matcher->size() << endmsg;
497
499 // matchertype mt = matcher.uclone();
500 matcher->match( selectedStore.reference_tracks(), selectedStore.test_tracks() );
501
502 // matcher.match( tref, ttest );
503
504 // MY_MSG_DEBUG << "SUTT: n matched: " << matcher->size() << endmsg;
505
506 selectedStore.set_matcher( matcher.get() );
507
508 TDeltaZMatcher<const VertexView> vertex_matcher( "DeltaZMatcher", 1.0 );
509
510 if ( !m_vertices.empty() ) {
511 vertex_matcher.match( selectedStore.refvertices(), selectedStore.testvertices() );
512 selectedStore.set_vertex_matcher( &vertex_matcher );
513 }
514
515 if ( tnp ) selectedStore.addTagNProbe( tnp.get() );
516
518 // selectedStore.refMap( trackAnaStore );
519
522
523 m_analysis->execute( selectedStore );
524
525 }
526
527 return true;
528
529}
#define endmsg
#define MY_MSG_DEBUG
Definition MsgMacros.h:25
#define MY_MSG_INFO
Definition MsgMacros.h:24
#define MY_MSG_WARNING
Definition MsgMacros.h:23
Athena::TPCnvVers::Current TrigRoiDescriptor
ToolHandle< TrackViewMatchingTool > m_trackMatchingTool
need to define a proper interface class
SG::ReadDecorHandleKeyArray< xAOD::EventInfo > m_beamKeys
std::unique_ptr< IPredicate< TrackView > > m_tnpPredicate
ToolHandle< IDTPM2::ITrackSelector > m_refSelector
tools
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoName
read handles, but ...
int ir
counter of the current depth
Definition fastadd.cxx:49
const Matcher_t & matcher() const
Return the matcher object.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillHistograms()

StatusCode TrackAnalysis::fillHistograms ( const EventContext & context) const
virtual

----— fillHistograms ----—

Definition at line 199 of file TrackAnalysis.cxx.

199 {
200 if ( execute( context ) ) return StatusCode::SUCCESS;
201 return StatusCode::FAILURE;
202}
bool execute(const EventContext &context) const
finalise histograms in stop()

◆ finalize()

virtual StatusCode IDTPM2::TrackAnalysis::finalize ( )
inlinevirtual

◆ getTDT()

const ToolHandle< Trig::TrigDecisionTool > & IDTPM2::TrackAnalysis::getTDT ( ) const
inline

Definition at line 89 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

89{ return m_tdt; }

◆ hasTagNProbe()

bool IDTPM2::TrackAnalysis::hasTagNProbe ( ) const
inline

◆ initialize()

StatusCode TrackAnalysis::initialize ( )
virtual

----— Initialize ----—

do we need these tests ?? if the variable is empty, then the flag would just be set to empty anyhow

we want to set these in the initialise rather than set them for every event

check tag n probe information ...

Definition at line 60 of file TrackAnalysis.cxx.

60 {
61
62 MY_MSG_INFO << "TrackAnalysis::initialize() name: " << name() << endmsg;
63
64 std::string selectChain = name().substr(name().find(".")+1,name().size());
65
66 if ( selectChain.find(":")==std::string::npos ) selectChain = ":"+selectChain;
67
68 ChainString chainName = selectChain; //chainName.head();
69
72 if ( chainName.head()!="" ) m_triggerchain = chainName.head();
73 if ( chainName.tail()!="" ) m_testTracks = chainName.tail();
74 if ( chainName.roi()!="" ) m_rois = chainName.roi();
75 if ( chainName.vtx()!="" ) m_vertices = chainName.vtx();
76 if ( chainName.element()!="" ) m_leg = std::atoi(chainName.element().c_str());
77 if ( chainName.extra()!="" ) m_extra = chainName.extra();
78
82
84
86
87 MY_MSG_INFO << "analysis: " << name() << endmsg;
88 MY_MSG_INFO << "trigger: " << m_triggerchain << endmsg;
89 MY_MSG_INFO << "reference: " << m_refTracks << ( m_refTracks_tag.empty() ? "" : "\t"+ m_refTracks_tag ) << endmsg;
90 MY_MSG_INFO << "test: " << m_testTracks << endmsg;
91 if ( !m_vertices.empty() ) { MY_MSG_INFO << "vtx: " << name() << endmsg; }
93
94 if ( !m_tagChain.empty() ) {
95
96 ChainString tagchain = m_tagChain.value();
97
100
101 MY_MSG_INFO << "Tag and probe: " << tagchain << endmsg;
102
103 MY_MSG_INFO << "Tag chain: " << tagchain.head()
104 << "\t" << tagchain.roi()
105 << "\t" << tagchain.element()
106 << "\t" << tagchain.extra()
107 << "\treferences: " << m_reference << "\t" << m_reference_tag
108 << endmsg;
109
110 m_triggerchain_tag = tagchain.head();
111 m_roi_tag = tagchain.roi();
112 m_extra_tag = tagchain.extra();
113 if ( !tagchain.element().empty() ) m_leg_tag = std::atoi(tagchain.element().c_str());
114
115 using PtPdgHelper = PtPdgIdHelper<TrackView,xAOD::TruthParticle>;
116
117 if ( m_refPdgId_tag.value() ) m_tnpPredicate = std::make_unique<PtPdgHelper>( m_minTagPT.value(), m_refPdgId_tag.value() );
118 else m_tnpPredicate = std::make_unique<PtHelper<TrackView>>( m_minTagPT.value() );
119
120 MY_MSG_INFO << "TagNProbe: " << m_triggerchain << " -> " << m_triggerchain_tag << endmsg;
121
122 }
123
124
125 MY_MSG_DEBUG << "TrackAnalysis::initialize()"
126 << " trigger=" << m_triggerchain
127 << " testTracks=" << m_testTracks
128 << " refTracks=" << m_refTracks
129 << " rois=" << m_rois << endmsg;
130
131 ATH_CHECK( m_eventInfoName.initialize() );
132
133 ATH_CHECK( m_beamKeys.initialize() );
134
135 ATH_CHECK( m_refSelector.retrieve() );
136 ATH_CHECK( m_testSelector.retrieve() );
137
138 // ATH_CHECK( m_vertexQualitySelectionTool.retrieve() );
139
140 ATH_CHECK( m_trackMatchingTool.retrieve() );
141
142#if 0
144 std::unique_ptr<TrackAnalysisDefinition> config = std::make_unique<TrackAnalysisDefinition>();
145
146 config->setTestCollection( m_testTracks );
147 config->setReferenceCollection( m_refTracks );
148
149 config->setTestType( "Trigger" );
150 config->setReferenceType( "Offline" );
151
157 config->setUseTrigger( true );
158 config->setUseOffline( true );
159 config->setDoTrigNavigation( true );
160
165 m_trkAnaDef = std::move( config );
166
167#endif
168
169 // m_trackQualitySelectionTool->setAnaDef(m_trkAnaDef.get());
170
171 MY_MSG_DEBUG << "TrackAnalysis::initialize() exitting" << endmsg;
172
173 m_analysis->set_monTool( &m_tool );
174
175 for ( size_t i=m_fillers.size() ; i-- ; ) m_analysis->addFillTool( m_fillers[i] );
176
177 m_analysis->initialise();
178
179 m_initialized = true;
180
181 return StatusCode::SUCCESS;
182
183}
#define ATH_CHECK
Evaluate an expression and check for errors.
size_t size() const
Number of registered mappings.
const std::string & extra() const
Definition ChainString.h:38
const std::string & roi() const
Definition ChainString.h:35
const std::string & head() const
Definition ChainString.h:33
const std::string & tail() const
Definition ChainString.h:34
const std::string & vtx() const
Definition ChainString.h:36
const std::string & element() const
Definition ChainString.h:37
Gaudi::Property< ConfiguredValue< int > > m_refPdgId_tag
Gaudi::Property< std::string > m_reference
properties
bool m_initialized
and sensible internal variables we can set from the configuration ...
Gaudi::Property< std::vector< std::string > > m_fillers
ToolHandle< GenericMonitoringTool > m_tool
histogram montool - books the histograms in the python
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:140

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isInitialized()

bool IDTPM2::TrackAnalysis::isInitialized ( ) const
inline

Definition at line 96 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

96{ return m_initialized; }

◆ monTool() [1/2]

ToolHandle< GenericMonitoringTool > & IDTPM2::TrackAnalysis::monTool ( )
inline

Definition at line 91 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

91{ return m_tool; }

◆ monTool() [2/2]

const ToolHandle< GenericMonitoringTool > & IDTPM2::TrackAnalysis::monTool ( ) const
inline

Definition at line 92 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

92{ return m_tool; }

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ proc()

StatusCode TrackAnalysis::proc ( )
virtual

finalise histograms in stop()


----— procHistograms ----—

do we need the end of run protection ??

Definition at line 535 of file TrackAnalysis.cxx.

535 {
536
537 MY_MSG_DEBUG << "Finalising plots" << endmsg;
538
540 // if( endOfRunFlag() ) m_analysis->finalize()
541
542 m_analysis->finalize();
543
544 MY_MSG_DEBUG << "Successfully finalized hists" << endmsg;
545
546 return StatusCode::SUCCESS;
547}

◆ procHistograms()

virtual StatusCode IDTPM2::TrackAnalysis::procHistograms ( )
inlinevirtual

Definition at line 70 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

70{ return StatusCode::SUCCESS; }

◆ refTracks()

const std::string & IDTPM2::TrackAnalysis::refTracks ( ) const
inline

Definition at line 98 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

98{ return m_refTracks; }

◆ refTracks_tag()

const std::string & IDTPM2::TrackAnalysis::refTracks_tag ( ) const
inline

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setTDT()

void IDTPM2::TrackAnalysis::setTDT ( ToolHandle< Trig::TrigDecisionTool > & tdt)
inline

assign the TrigDecisionTool - we get this passed in from the top level algorithm so don't need to mess about retrieving it ourselves

Definition at line 87 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

◆ start()

virtual StatusCode IDTPM2::TrackAnalysis::start ( )
inlineoverridevirtual

Definition at line 79 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

79{ return StatusCode::SUCCESS; }

◆ stop()

virtual StatusCode IDTPM2::TrackAnalysis::stop ( )
inlineoverridevirtual

Definition at line 81 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

81{ return proc(); }
virtual StatusCode proc()
finalise histograms in stop()

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_analysis

std::unique_ptr<AnalysisR4> IDTPM2::TrackAnalysis::m_analysis
protected

and the lightweight tool to actually fill them - could join this with the above montool, but as usual with athena code, that would make things a lot more complicated, whilst simultaneously being a lot less flexible

Definition at line 112 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

◆ m_beamKeys

SG::ReadDecorHandleKeyArray<xAOD::EventInfo> IDTPM2::TrackAnalysis::m_beamKeys {this, "BeamSpotDecoKeys", {"EventInfo.beamPosX", "EventInfo.beamPosY", "EventInfo.beamPosZ"}, "Beamspot positions"}
protected

Definition at line 175 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

176{this, "BeamSpotDecoKeys", {"EventInfo.beamPosX", "EventInfo.beamPosY", "EventInfo.beamPosZ"}, "Beamspot positions"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_eventInfoName

SG::ReadHandleKey<xAOD::EventInfo> IDTPM2::TrackAnalysis::m_eventInfoName { this, "EventInfo", "EventInfo", "EventInfo name" }
protected

read handles, but ...

EventInfo Container name

Definition at line 128 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

128{ this, "EventInfo", "EventInfo", "EventInfo name" };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extra

std::string IDTPM2::TrackAnalysis::m_extra
protected

◆ m_extra_tag

std::string IDTPM2::TrackAnalysis::m_extra_tag
protected

◆ m_fillers

Gaudi::Property<std::vector<std::string> > IDTPM2::TrackAnalysis::m_fillers { this, "Fillers", {}, "List of histogram filler tools" }
protected

Definition at line 114 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

114{ this, "Fillers", {}, "List of histogram filler tools" };

◆ m_initialized

bool IDTPM2::TrackAnalysis::m_initialized = false
protected

and sensible internal variables we can set from the configuration ...

Definition at line 151 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

◆ m_leg

int IDTPM2::TrackAnalysis::m_leg = -1
protected

◆ m_leg_tag

int IDTPM2::TrackAnalysis::m_leg_tag = -1
protected

◆ m_maxTagMass

Gaudi::Property<float> IDTPM2::TrackAnalysis::m_maxTagMass { this, "MaxTagMass", 110, "Maximum invariant mass for Tag and Probe" }
protected

Definition at line 145 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

145{ this, "MaxTagMass", 110, "Maximum invariant mass for Tag and Probe" };

◆ m_minTagMass

Gaudi::Property<float> IDTPM2::TrackAnalysis::m_minTagMass { this, "MinTagMass", 70, "Minimum invariant mass for Tag and Probe" }
protected

Definition at line 144 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

144{ this, "MinTagMass", 70, "Minimum invariant mass for Tag and Probe" };

◆ m_minTagPT

Gaudi::Property<float> IDTPM2::TrackAnalysis::m_minTagPT { this, "MinTagPT", 15, "Minimum tag PT for Tag and Probe" }
protected

Definition at line 146 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

146{ this, "MinTagPT", 15, "Minimum tag PT for Tag and Probe" };

◆ m_reference

Gaudi::Property<std::string> IDTPM2::TrackAnalysis::m_reference { this, "Reference", "InDetTrackParticles", "reference collection" }
protected

properties

Definition at line 132 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

132{ this, "Reference", "InDetTrackParticles", "reference collection" };

◆ m_reference_tag

Gaudi::Property<std::string> IDTPM2::TrackAnalysis::m_reference_tag { this, "ReferenceTag", "", "reference tag collection for Tag and Probe" }
protected

Definition at line 138 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

138{ this, "ReferenceTag", "", "reference tag collection for Tag and Probe" };

◆ m_referenceVertices

Gaudi::Property<std::string> IDTPM2::TrackAnalysis::m_referenceVertices { this, "ReferenceVertices", "PrimaryVertices", "reference vertex collection" }
protected

Definition at line 134 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

134{ this, "ReferenceVertices", "PrimaryVertices", "reference vertex collection" };

◆ m_refPdgId

Gaudi::Property<ConfiguredValue<int> > IDTPM2::TrackAnalysis::m_refPdgId { this, "ReferencePdgId", {}, "reference PDG ID (for truth particle tag and probe)" }
protected

Definition at line 140 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

140{ this, "ReferencePdgId", {}, "reference PDG ID (for truth particle tag and probe)" };

◆ m_refPdgId_tag

Gaudi::Property<ConfiguredValue<int> > IDTPM2::TrackAnalysis::m_refPdgId_tag { this, "ReferencePdgIdTag", {}, "reference PDG ID (for truth particle tag and probe)" }
protected

Definition at line 141 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

141{ this, "ReferencePdgIdTag", {}, "reference PDG ID (for truth particle tag and probe)" };

◆ m_refSelector

ToolHandle<IDTPM2::ITrackSelector> IDTPM2::TrackAnalysis::m_refSelector { this, "ReferenceSelector", "", "" }
protected

tools

Definition at line 118 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

118{ this, "ReferenceSelector", "", "" };

◆ m_refTracks

std::string IDTPM2::TrackAnalysis::m_refTracks
protected

◆ m_refTracks_tag

std::string IDTPM2::TrackAnalysis::m_refTracks_tag
protected

◆ m_refVertices

std::string IDTPM2::TrackAnalysis::m_refVertices
protected

◆ m_roi_tag

std::string IDTPM2::TrackAnalysis::m_roi_tag
protected

◆ m_rois

std::string IDTPM2::TrackAnalysis::m_rois
protected

◆ m_tagChain

Gaudi::Property<std::string> IDTPM2::TrackAnalysis::m_tagChain { this, "TagChain", "", "tag leg for tag n probe analysis" }
protected

Definition at line 136 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

136{ this, "TagChain", "", "tag leg for tag n probe analysis" };

◆ m_tdt

ToolHandle<Trig::TrigDecisionTool> IDTPM2::TrackAnalysis::m_tdt
protected

◆ m_testSelector

ToolHandle<IDTPM2::ITrackSelector> IDTPM2::TrackAnalysis::m_testSelector { this, "TestSelector", "", "" }
protected

Definition at line 119 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

119{ this, "TestSelector", "", "" };

◆ m_testTracks

std::string IDTPM2::TrackAnalysis::m_testTracks
protected

◆ m_tnp

std::unique_ptr<TagNProbe> IDTPM2::TrackAnalysis::m_tnp = 0
protected

◆ m_tnpPredicate

std::unique_ptr<IPredicate<TrackView> > IDTPM2::TrackAnalysis::m_tnpPredicate = 0
protected

◆ m_tool

ToolHandle<GenericMonitoringTool> IDTPM2::TrackAnalysis::m_tool { this, "montool", "", "histogram montool" }
protected

histogram montool - books the histograms in the python

Definition at line 107 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

107{ this, "montool", "", "histogram montool" };

◆ m_trackMatchingTool

ToolHandle<TrackViewMatchingTool> IDTPM2::TrackAnalysis::m_trackMatchingTool
protected
Initial value:
{
this, "TrackMatchingTool", "IDTPM2::TrackViewMatchingTool", "Tool to match test to reference tracks and viceversa" }

need to define a proper interface class

Definition at line 122 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

122 {
123 this, "TrackMatchingTool", "IDTPM2::TrackViewMatchingTool", "Tool to match test to reference tracks and viceversa" };

◆ m_triggerchain

std::string IDTPM2::TrackAnalysis::m_triggerchain
protected

◆ m_triggerchain_tag

std::string IDTPM2::TrackAnalysis::m_triggerchain_tag
protected

◆ m_useDecorations

Gaudi::Property<bool> IDTPM2::TrackAnalysis::m_useDecorations { this, "useDecorations", false, "Use athena decorations or not" }
protected

Definition at line 173 of file TrigMonitoring/TrigIDR4Monitoring/src/TrackAnalysis.h.

173{ this, "useDecorations", false, "Use athena decorations or not" };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vertices

std::string IDTPM2::TrackAnalysis::m_vertices
protected

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


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