ATLAS Offline Software
Loading...
Searching...
No Matches
T_AnalysisConfig< Provider > Class Template Referenceabstract

#include <T_AnalysisConfig.h>

Collaboration diagram for T_AnalysisConfig< Provider >:

Public Member Functions

 T_AnalysisConfig (const std::string &analysisInstanceName, const std::string &testChainName, const std::string &testType, const std::string &testKey, const std::string &referenceChainName, const std::string &referenceType, const std::string &referenceKey, const std::string &selectionChainName, const std::string &selectionType, const std::string &selectionKey, TrackFilter *testFilter, TrackFilter *referenceFilter, TrackFilter *selectionFilter, TrackAssociator *associator, TrackAnalysis *analysis)
 T_AnalysisConfig (const std::string &analysisInstanceName, const std::string &testChainName, const std::string &testType, const std::string &testKey, const std::string &referenceChainName, const std::string &referenceType, const std::string &referenceKey, TrackFilter *testFilter, TrackFilter *referenceFilter, TrackAssociator *associator, TrackAnalysis *analysis)
virtual ~T_AnalysisConfig ()
void addTestChain (const std::string &chainName, const std::string &type, const std::string &key)
void addReferenceChain (const std::string &chainName, const std::string &type, const std::string &key)
void addSelectionChain (const std::string &chainName, const std::string &type, const std::string &key)
void addTestFilter (TrackFilter *filter)
void addReferenceFilter (TrackFilter *filter)
void addSelectionFilter (TrackFilter *filter)
virtual void initialize (Provider *p, ToolHandle< Trig::TrigDecisionTool > *tdt)
virtual void execute ()
virtual void finalize ()
virtual void book ()
const std::string & name () const
const std::string testChains () const
const std::string referenceChains () const
const std::string selectionChains () const
const TrackAnalysis * analysis () const
void setMCTruth (bool b=true)
bool mcTruth () const
void setBeamX (double d)
void setBeamY (double d)
void setBeamZ (double d)
double beamX () const
double beamY () const
double beamZ () const
bool genericFlag () const
void setGenericFlag (bool b)
const std::string & releaseData () const
void releaseData (const std::string &s)
void keepAllEvents (bool b)
void setUseHighestPT (bool b)
bool getUseHighestPT () const
void setVtxIndex (int i)
int getVtxIndex () const
bool filterOnRoi () const
bool setFilterOnRoi (bool b)
void setRequireDecision (bool b)
bool requireDecision () const

Protected Member Functions

virtual void loop ()=0
template<class Collection>
std::pair< typename Collection::const_iterator, typename Collection::const_iterator > getCollection (const ElementLink< TrigRoiDescriptorCollection > &roi_link, const std::string &key="")
 new MT feature access
bool select (std::vector< TIDA::Vertex > &vertices, xAOD::VertexContainer::const_iterator vtx_start, xAOD::VertexContainer::const_iterator vtx_end)
bool select (std::vector< TIDA::Vertex > &vertices, const ElementLink< TrigRoiDescriptorCollection > &roi_link, const std::string &key="")
bool select (std::vector< TIDA::Vertex > &vertices, const std::string &key="")
template<class Collection>
bool selectTracks (TrigTrackSelector *selector, const ElementLink< TrigRoiDescriptorCollection > &roi_link, const std::string &key="")
template<class Collection>
bool selectTracks (TrigTrackSelector *selector, Trig::FeatureContainer::combination_const_iterator citr, const std::string &key="")
 lagacy run 2 access
template<class Collection>
bool selectTracks (TrigTrackSelector *selector, Trig::FeatureContainer::combination_const_iterator citr, const std::string &key, unsigned index)
 NB: because we want to use this for the L2Star chains, we have to use this method, not the above.
template<class Collection>
StatusCode retrieve (Collection const *&collection, const std::string &key="")
template<class Collection>
bool selectTracks (TrigTrackSelector *selector, const std::string &key)
template<class Collection>
bool selectTracksNotEmpty (TrigTrackSelector *selector, const std::string &key)
template<class Collection>
std::vector< double > getBeamspot (const std::string &key)
template<class Collection>
std::vector< double > getBeamspot (Trig::FeatureContainer::combination_const_iterator citr, const std::string &key="")
unsigned processElectrons (TrigTrackSelector &selectorRef, std::vector< TrackTrigObject > *elevec=0, const unsigned int selection=0, bool raw_track=false, double ETOffline=0, const std::string &containerName="Electrons")
 select offline electrons
unsigned processMuons (TrigTrackSelector &selectorRef, const unsigned int selection=0, double ETOffline=0, const std::string &containerName="Muons")
 select offlinqe muons
unsigned processTaus (TrigTrackSelector &selectorRef, std::vector< TrackTrigObject > *tauvec=0, const unsigned selection=0, int requireNtracks=0, double EtCutOffline=0, const std::string &containerName="TauJets")
 select offline taus

Protected Attributes

Provider * m_provider
ToolHandle< Trig::TrigDecisionTool > * m_tdt
std::string m_analysisInstanceName
std::vector< std::vector< std::string > > m_chainNames
std::vector< std::vector< std::string > > m_types
std::vector< std::vector< std::string > > m_keys
std::vector< std::vector< TrackFilter * > > m_filters
std::string m_refChainName
std::string m_refChainKey
std::string m_testChainName
std::string m_testChainKey
TrigTrackSelector * m_selectorRef
TrigTrackSelector * m_selectorTest
TrigTrackSelector * m_selectorSel
TrackAssociator * m_associator
TrackAnalysis * m_analysis
bool m_mcTruth
double m_beamX
double m_beamY
double m_beamZ
int m_genericFlag
std::string m_releaseData
bool m_keepAllEvents
bool m_useHighestPT
int m_vtxIndex
bool m_filterOnRoi
bool m_requireDecision

Detailed Description

template<class Provider>
class T_AnalysisConfig< Provider >

Definition at line 48 of file T_AnalysisConfig.h.

Constructor & Destructor Documentation

◆ T_AnalysisConfig() [1/2]

template<class Provider>
T_AnalysisConfig< Provider >::T_AnalysisConfig ( const std::string & analysisInstanceName,
const std::string & testChainName,
const std::string & testType,
const std::string & testKey,
const std::string & referenceChainName,
const std::string & referenceType,
const std::string & referenceKey,
const std::string & selectionChainName,
const std::string & selectionType,
const std::string & selectionKey,
TrackFilter * testFilter,
TrackFilter * referenceFilter,
TrackFilter * selectionFilter,
TrackAssociator * associator,
TrackAnalysis * analysis )
inline

Definition at line 58 of file T_AnalysisConfig.h.

◆ T_AnalysisConfig() [2/2]

template<class Provider>
T_AnalysisConfig< Provider >::T_AnalysisConfig ( const std::string & analysisInstanceName,
const std::string & testChainName,
const std::string & testType,
const std::string & testKey,
const std::string & referenceChainName,
const std::string & referenceType,
const std::string & referenceKey,
TrackFilter * testFilter,
TrackFilter * referenceFilter,
TrackAssociator * associator,
TrackAnalysis * analysis )
inline

Definition at line 102 of file T_AnalysisConfig.h.

◆ ~T_AnalysisConfig()

template<class Provider>
virtual T_AnalysisConfig< Provider >::~T_AnalysisConfig ( )
inlinevirtual

Definition at line 143 of file T_AnalysisConfig.h.

Member Function Documentation

◆ addReferenceChain()

template<class Provider>
void T_AnalysisConfig< Provider >::addReferenceChain ( const std::string & chainName,
const std::string & type,
const std::string & key )
inline

Definition at line 157 of file T_AnalysisConfig.h.

◆ addReferenceFilter()

template<class Provider>
void T_AnalysisConfig< Provider >::addReferenceFilter ( TrackFilter * filter)
inline

Definition at line 166 of file T_AnalysisConfig.h.

◆ addSelectionChain()

template<class Provider>
void T_AnalysisConfig< Provider >::addSelectionChain ( const std::string & chainName,
const std::string & type,
const std::string & key )
inline

Definition at line 161 of file T_AnalysisConfig.h.

◆ addSelectionFilter()

template<class Provider>
void T_AnalysisConfig< Provider >::addSelectionFilter ( TrackFilter * filter)
inline

Definition at line 167 of file T_AnalysisConfig.h.

◆ addTestChain()

template<class Provider>
void T_AnalysisConfig< Provider >::addTestChain ( const std::string & chainName,
const std::string & type,
const std::string & key )
inline

Definition at line 153 of file T_AnalysisConfig.h.

◆ addTestFilter()

template<class Provider>
void T_AnalysisConfig< Provider >::addTestFilter ( TrackFilter * filter)
inline

Definition at line 165 of file T_AnalysisConfig.h.

◆ analysis()

template<class Provider>
const TrackAnalysis * T_AnalysisConfig< Provider >::analysis ( ) const
inline

Definition at line 212 of file T_AnalysisConfig.h.

◆ beamX()

template<class Provider>
double T_AnalysisConfig< Provider >::beamX ( ) const
inline

Definition at line 220 of file T_AnalysisConfig.h.

◆ beamY()

template<class Provider>
double T_AnalysisConfig< Provider >::beamY ( ) const
inline

Definition at line 221 of file T_AnalysisConfig.h.

◆ beamZ()

template<class Provider>
double T_AnalysisConfig< Provider >::beamZ ( ) const
inline

Definition at line 222 of file T_AnalysisConfig.h.

◆ book()

◆ execute()

template<class Provider>
virtual void T_AnalysisConfig< Provider >::execute ( )
inlinevirtual

Definition at line 179 of file T_AnalysisConfig.h.

◆ filterOnRoi()

template<class Provider>
bool T_AnalysisConfig< Provider >::filterOnRoi ( ) const
inline

Definition at line 238 of file T_AnalysisConfig.h.

◆ finalize()

◆ genericFlag()

template<class Provider>
bool T_AnalysisConfig< Provider >::genericFlag ( ) const
inline

Definition at line 224 of file T_AnalysisConfig.h.

◆ getBeamspot() [1/2]

template<class Provider>
template<class Collection>
std::vector< double > T_AnalysisConfig< Provider >::getBeamspot ( const std::string & key)
inlineprotected

Definition at line 585 of file T_AnalysisConfig.h.

◆ getBeamspot() [2/2]

template<class Provider>
template<class Collection>
std::vector< double > T_AnalysisConfig< Provider >::getBeamspot ( Trig::FeatureContainer::combination_const_iterator citr,
const std::string & key = "" )
inlineprotected

Definition at line 614 of file T_AnalysisConfig.h.

◆ getCollection()

template<class Provider>
template<class Collection>
std::pair< typename Collection::const_iterator, typename Collection::const_iterator > T_AnalysisConfig< Provider >::getCollection ( const ElementLink< TrigRoiDescriptorCollection > & roi_link,
const std::string & key = "" )
inlineprotected

new MT feature access

will need this printout for debugging the feature access, so leave this commented until it has been properly debugged, then it can be removed

will not use the te name here, but keep it on just the same for the time being, for subsequent development

Definition at line 253 of file T_AnalysisConfig.h.

258 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
259
264 size_t pos = key_collection.find("/");
265 if ( pos!=std::string::npos ) {
266 key_collection = key.substr( pos+1, key.size()-pos );
267 key_tename = key.substr( 0, pos );
268 }
269
272
274
276 const std::string* keyStr = m_provider->evtStore()->keyToString(roi_link.key(), checkCLID);
277 m_provider->msg(MSG::DEBUG) << "Requesting range over (" << key << ") associated to ROI from " << (keyStr == nullptr ? "UNKNOWN" : *keyStr) << endmsg;
278
279 itrpair = (*m_tdt)->associateToEventView( handle, roi_link );
280
281 return itrpair;
282 }

◆ getUseHighestPT()

template<class Provider>
bool T_AnalysisConfig< Provider >::getUseHighestPT ( ) const
inline

Definition at line 233 of file T_AnalysisConfig.h.

233{ return m_useHighestPT; }

◆ getVtxIndex()

template<class Provider>
int T_AnalysisConfig< Provider >::getVtxIndex ( ) const
inline

Definition at line 236 of file T_AnalysisConfig.h.

236{ return m_vtxIndex; }

◆ initialize()

template<class Provider>
virtual void T_AnalysisConfig< Provider >::initialize ( Provider * p,
ToolHandle< Trig::TrigDecisionTool > * tdt )
inlinevirtual

Definition at line 170 of file T_AnalysisConfig.h.

170 {
171 m_provider = p;
172 m_tdt = tdt;
173 if ( m_tdt==0 ) m_analysis->initialise();
174
175 }

◆ keepAllEvents()

template<class Provider>
void T_AnalysisConfig< Provider >::keepAllEvents ( bool b)
inline

Definition at line 230 of file T_AnalysisConfig.h.

230{ m_keepAllEvents = b; }

◆ loop()

◆ mcTruth()

template<class Provider>
bool T_AnalysisConfig< Provider >::mcTruth ( ) const
inline

Definition at line 215 of file T_AnalysisConfig.h.

215{ return m_mcTruth; }

◆ name()

template<class Provider>
const std::string & T_AnalysisConfig< Provider >::name ( ) const
inline

Definition at line 189 of file T_AnalysisConfig.h.

◆ processElectrons()

template<class Provider>
unsigned T_AnalysisConfig< Provider >::processElectrons ( TrigTrackSelector & selectorRef,
std::vector< TrackTrigObject > * elevec = 0,
const unsigned int selection = 0,
bool raw_track = false,
double ETOffline = 0,
const std::string & containerName = "Electrons" )
inlineprotected

select offline electrons

Definition at line 654 of file T_AnalysisConfig.h.

660 {
661
662 m_provider->msg(MSG::DEBUG) << "Fetching offline electrons: " << containerName << endmsg;
663
664 selectorRef.clear();
665
667
668 const Container* container = 0;
669
670 if( ! m_provider->evtStore()->template contains<Container>(containerName) ) {
671 m_provider->msg(MSG::WARNING) << "Error No Electron Container " << containerName << " !" << endmsg;
672 return 0;
673 }
674
676 if( sc.isFailure() || !container ) {
677 m_provider->msg(MSG::WARNING) << "Error retrieving container: " << containerName << " !" << endmsg;
678 return 0;
679 }
680
681 m_provider->msg(MSG::DEBUG) << "Event with " << container->size() << " Electron object(s) " << endmsg;
682
685
686 for( ; elec!=elec_end ; ++elec ){
687 //m_provider->msg(MSG::DEBUG) << " Electron " << (*elec)
688 // << ", eta " << (*elec)->eta()
689 // << ", phi " << (*elec)->phi()
690 // << ", ET " << (*elec)->pt()
691 // << ", author " << (*elec)->author()
692 // << ", trackParticle " << (*elec)->trackParticle()
693 // << ", conversion " << (*elec)->conversion()
694 // << ", mediumPP " << ((*elec)->isem(egammaPID::ElectronMediumPP)==0)
695 // << endmsg;
696
697 bool good_electron = false;
699
700 if (good_electron) {
701 const xAOD::Electron_v1& eleduff = *(*elec);
702 long unsigned eleid = (unsigned long)(&eleduff) ;
703 TrackTrigObject eleobj = TrackTrigObject( (*elec)->eta(),
704 (*elec)->phi(),
705 (*elec)->pt(),
706 0,
707 (*elec)->type(),
708 eleid );
709
710 bool trk_added ;
712 else trk_added = selectorRef.selectTrack( (*elec)->trackParticle() );
713
714 if (trk_added) eleobj.addChild( selectorRef.tracks().back()->id() );
715 if (elevec) elevec->push_back( eleobj );
716 }
717 }
718
719 return selectorRef.tracks().size();
720 }
bool isGoodOffline(const xAOD::Electron &elec, const unsigned int selection=0, double ETOffline=0)

◆ processMuons()

template<class Provider>
unsigned T_AnalysisConfig< Provider >::processMuons ( TrigTrackSelector & selectorRef,
const unsigned int selection = 0,
double ETOffline = 0,
const std::string & containerName = "Muons" )
inlineprotected

select offlinqe muons

Definition at line 727 of file T_AnalysisConfig.h.

730 {
731
733
734 m_provider->msg(MSG::DEBUG) << " Offline muons (" << containerName << ")" << endmsg;
735
736 selectorRef.clear();
737
738 const Container* container = 0;
739
740 if( ! m_provider->evtStore()->template contains<Container>(containerName) ) {
741 m_provider->msg(MSG::WARNING) << "Error No MuonCollection" << containerName << " !" << endmsg;
742 return 0;
743 }
744
746 if( sc.isFailure() || !container ) {
747 m_provider->msg(MSG::WARNING) << "Error retrieving " << containerName << " !" << endmsg;
748 return 0;
749 }
750
751 auto muon = container->begin();
752 auto muon_end = container->end();
753
754 // std::cout << "SUTT Offline muons " << container->size() << "\t threshold " << ETOffline << std::endl;
755
756 for( ; muon!=muon_end ; ++muon ){
758 }
759
760
761 // std::cout << "SUTT found " << selectorRef.tracks().size() << " muons for " << containerName << std::endl;
762 m_provider->msg(MSG::DEBUG) << "found " << selectorRef.tracks().size() << " muons for " << containerName << endmsg;
763
764 return selectorRef.tracks().size();
765}

◆ processTaus()

template<class Provider>
unsigned T_AnalysisConfig< Provider >::processTaus ( TrigTrackSelector & selectorRef,
std::vector< TrackTrigObject > * tauvec = 0,
const unsigned selection = 0,
int requireNtracks = 0,
double EtCutOffline = 0,
const std::string & containerName = "TauJets" )
inlineprotected

select offline taus

the previous version of the code ...

used the link to the Trk::Track

Definition at line 772 of file T_AnalysisConfig.h.

778 {
779
781
782 selectorRef.clear();
783
784 const Container* container = 0;
785
786 selectorRef.clear();
787
788 m_provider->msg(MSG::DEBUG) << " Offline taus " << containerName << endmsg;
789
790 if ( !m_provider->evtStore()->template contains<Container>(containerName)) {
791 m_provider->msg(MSG::WARNING) << " Offline taus not found" << endmsg;
792 return 0;
793 }
794
796 if (sc != StatusCode::SUCCESS) {
797 m_provider->msg(MSG::WARNING) << " Offline tau retrieval not successful" << endmsg;
798 return 0;
799 }
800
803
804
805 for ( ; tau!=tau_end ; ++tau ) {
806
807# ifndef XAODTAU_VERSIONS_TAUJET_V3_H
808 int N = (*tau)->nTracks();
809 // std::cout << "SUTT no tau detail " << N << "\t3prong: " << doThreeProng << std::endl;
810# else
811 int N=0;
812 (*tau)->detail( xAOD::TauJetParameters::nChargedTracks, N );
813 // std::cout << "SUTT tau detail: N " << N << "\t3prong: " << doThreeProng << std::endl;
814# endif
815
816 bool good_tau = false;
818
819 // std::cout << "SUTT tau ntracks: " << N << "\tgoodtau: " << good_tau << "\tpt: " << (*tau)->p4().Et() << "\t3prong: " << doThreeProng << std::endl;
820
821 if (good_tau){
822 const xAOD::TauJet_v3& duff = *(*tau);
823 long unsigned tauid = (unsigned long)(&duff) ;
824 TrackTrigObject tauobj = TrackTrigObject( (*tau)->eta(),
825 (*tau)->phi(),
826 (*tau)->pt(),
827 0,
828 (*tau)->type(),
829 tauid );
830
831 bool trk_added = false;
832
833 for ( unsigned i=N ; i-- ; ) {
834
835 std::vector< ElementLink<xAOD::TrackParticleContainer> > alink = (*tau)->track(i)->trackLinks();
836
837 trk_added = false;
838
839 for ( size_t ilink=0 ; ilink<alink.size() ; ilink++ ) {
840 if ( alink[ilink].isValid() ) trk_added = selectorRef.selectTrack((*alink[ilink]));
841 }
843 // trk_added = selectorRef.selectTrack((*tau)->track(i)->track());
845 if ( trk_added ) tauobj.addChild( selectorRef.tracks().back()->id() );
846 }
847 if ( tauvec ) tauvec->push_back( tauobj );
848 }
849 }
850
851 return selectorRef.tracks().size();
852
853}

◆ referenceChains()

template<class Provider>
const std::string T_AnalysisConfig< Provider >::referenceChains ( ) const
inline

Definition at line 198 of file T_AnalysisConfig.h.

198 {
200 for(unsigned int i=0; i<m_chainNames[1].size(); i++)
201 name += (m_chainNames[1][i]+"::"+m_types[1][i]+"::"+m_keys[1][i]+" ");
202 return name;
203 }
const std::string & name() const

◆ releaseData() [1/2]

template<class Provider>
const std::string & T_AnalysisConfig< Provider >::releaseData ( ) const
inline

Definition at line 227 of file T_AnalysisConfig.h.

227{ return m_releaseData; }

◆ releaseData() [2/2]

template<class Provider>
void T_AnalysisConfig< Provider >::releaseData ( const std::string & s)
inline

Definition at line 228 of file T_AnalysisConfig.h.

228{ m_releaseData = s; }

◆ requireDecision()

template<class Provider>
bool T_AnalysisConfig< Provider >::requireDecision ( ) const
inline

Definition at line 242 of file T_AnalysisConfig.h.

242{ return m_requireDecision; }

◆ retrieve()

template<class Provider>
template<class Collection>
StatusCode T_AnalysisConfig< Provider >::retrieve ( Collection const *& collection,
const std::string & key = "" )
inlineprotected

old implementation - leave in place until after the full validation ... return m_provider->evtStore()->retrieve( container, containerName);

commented code intentionally left for development purposes ... std::cout << "\t\t\t T_AnalysisConfig::selectTracks() - > TrackSelector" << std::endl;

Definition at line 524 of file T_AnalysisConfig.h.

524 {
527 if ( m_provider->evtStore()->template contains<Collection>( key ) ) {
529 if ( handle.isValid() ) {
532 collection = handle.cptr();
533 return StatusCode::SUCCESS;
534 }
535 }
536 return StatusCode::FAILURE;
537 }

◆ select() [1/3]

template<class Provider>
bool T_AnalysisConfig< Provider >::select ( std::vector< TIDA::Vertex > & vertices,
const ElementLink< TrigRoiDescriptorCollection > & roi_link,
const std::string & key = "" )
inlineprotected

Definition at line 325 of file T_AnalysisConfig.h.

327 {
328
329 m_provider->msg(MSG::VERBOSE) << "\tFetch xAOD::VertexContainer for key: " << key << endmsg;
330
333
334 if ( vtx_itrpair.first == vtx_itrpair.second ) {
335 m_provider->msg(MSG::WARNING) << "\tNo xAOD::Vertex collection for key " << key << endmsg;
336 return false;
337 }
338
339 m_provider->msg(MSG::DEBUG) << "\txAOD::VertexContainer found with size " << (vtx_itrpair.second - vtx_itrpair.first)
340 << "\t:" << key << endmsg;
341
342 return select( vertices, vtx_itrpair.first, vtx_itrpair.second );
343 }
std::pair< typename Collection::const_iterator, typename Collection::const_iterator > getCollection(const ElementLink< TrigRoiDescriptorCollection > &roi_link, const std::string &key="")
new MT feature access
bool select(std::vector< TIDA::Vertex > &vertices, xAOD::VertexContainer::const_iterator vtx_start, xAOD::VertexContainer::const_iterator vtx_end)

◆ select() [2/3]

template<class Provider>
bool T_AnalysisConfig< Provider >::select ( std::vector< TIDA::Vertex > & vertices,
const std::string & key = "" )
inlineprotected

Definition at line 348 of file T_AnalysisConfig.h.

348 {
349
350 m_provider->msg(MSG::VERBOSE) << "fetching AOD vertex container" << endmsg;
351
353
355 m_provider->msg(MSG::WARNING) << "xAOD vertex container not found with key " << key << endmsg;
356 return false;
357 }
358
359 if ( xaodVtxCollection!=0 ) {
360
361 m_provider->msg(MSG::VERBOSE) << "xAOD vertex container " << xaodVtxCollection->size() << " entries" << endmsg;
362
363 return select( vertices, xaodVtxCollection->begin(), xaodVtxCollection->end() );
364
365#if 0
366
368
369 for ( ; vtxitr != xaodVtxCollection->end(); vtxitr++ ) {
370 if ( (*vtxitr)->nTrackParticles()>0 && (*vtxitr)->vertexType()!=0 ) {
371 vertices.push_back( TIDA::Vertex( (*vtxitr)->x(),
372 (*vtxitr)->y(),
373 (*vtxitr)->z(),
375 (*vtxitr)->covariancePosition()(Trk::x,Trk::x),
376 (*vtxitr)->covariancePosition()(Trk::y,Trk::y),
377 (*vtxitr)->covariancePosition()(Trk::z,Trk::z),
378 (*vtxitr)->nTrackParticles(),
380 (*vtxitr)->chiSquared(),
381 (*vtxitr)->numberDoF() ) );
382 }
383 }
384
385#endif
386
387 }
388
389 return true;
390 }

◆ select() [3/3]

template<class Provider>
bool T_AnalysisConfig< Provider >::select ( std::vector< TIDA::Vertex > & vertices,
xAOD::VertexContainer::const_iterator vtx_start,
xAOD::VertexContainer::const_iterator vtx_end )
inlineprotected

variances

quality

Definition at line 296 of file T_AnalysisConfig.h.

298 {
299
301
302 for ( ; vtxitr!=vtx_end ; ++vtxitr ) {
303 if ( (*vtxitr)->vertexType()!=0 ) {
304 m_provider->msg(MSG::VERBOSE) << "\tvertex " << (*vtxitr)->z() << endmsg;
305
306 vertices.push_back( TIDA::Vertex( (*vtxitr)->x(),
307 (*vtxitr)->y(),
308 (*vtxitr)->z(),
310 (*vtxitr)->covariancePosition()(Trk::x,Trk::x),
311 (*vtxitr)->covariancePosition()(Trk::y,Trk::y),
312 (*vtxitr)->covariancePosition()(Trk::z,Trk::z),
313 (*vtxitr)->nTrackParticles(),
315 (*vtxitr)->chiSquared(),
316 (*vtxitr)->numberDoF() ) );
317
318 }
319 }
320
321 return true;
322 }

◆ selectionChains()

template<class Provider>
const std::string T_AnalysisConfig< Provider >::selectionChains ( ) const
inline

Definition at line 205 of file T_AnalysisConfig.h.

205 {
207 for(unsigned int i=0; i<m_chainNames[2].size(); i++)
208 name += (m_chainNames[2][i]+"::"+m_types[2][i]+"::"+m_keys[2][i]+" ");
209 return name;
210 }

◆ selectTracks() [1/4]

template<class Provider>
template<class Collection>
bool T_AnalysisConfig< Provider >::selectTracks ( TrigTrackSelector * selector,
const ElementLink< TrigRoiDescriptorCollection > & roi_link,
const std::string & key = "" )
inlineprotected

will need this printout for debugging the feature access, so leave this commented until it has been properly debugged, then it can be removed

will not use the te name here, but keep it on just the same for the time being, for subsequent development

Definition at line 395 of file T_AnalysisConfig.h.

398 {
399
400
403 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
404
409 size_t pos = key_collection.find("/");
410 if ( pos!=std::string::npos ) {
411 key_collection = key.substr( pos+1, key.size()-pos );
412 key_tename = key.substr( 0, pos );
413 }
414
417
419
421 const std::string* keyStr = m_provider->evtStore()->keyToString(roi_link.key(), checkCLID);
422 m_provider->msg(MSG::DEBUG) << "Requesting range over (" << key << ") associated to ROI from " << (keyStr == nullptr ? "UNKNOWN" : *keyStr) << endmsg;
423
424 itrpair = (*m_tdt)->associateToEventView( handle, roi_link );
425
426 if ( itrpair.first != itrpair.second ) {
427 selector->selectTracks( itrpair.first, itrpair.second );
428 return true;
429 }
430 else {
431 m_provider->msg(MSG::DEBUG) << "TDT TrackFeature collection (" << key << ") is empty " << endmsg;
432 return false;
433 }
434 }
bool selectTracks(TrigTrackSelector *selector, const ElementLink< TrigRoiDescriptorCollection > &roi_link, const std::string &key="")

◆ selectTracks() [2/4]

template<class Provider>
template<class Collection>
bool T_AnalysisConfig< Provider >::selectTracks ( TrigTrackSelector * selector,
const std::string & key )
inlineprotected

commented code intentionally left for development purposes ...

Definition at line 542 of file T_AnalysisConfig.h.

542 {
543 if ( key!="" ) {
545 if ( handle.isValid() ) {
547 // std::cout << "\t\t\t T_AnalysisConfig::selectTracks() - > TrackSelector" << std::endl;
548 selector->selectTracks( handle.cptr() );
549 return true;
550 }
551 }
552 return false;
553 }

◆ selectTracks() [3/4]

template<class Provider>
template<class Collection>
bool T_AnalysisConfig< Provider >::selectTracks ( TrigTrackSelector * selector,
Trig::FeatureContainer::combination_const_iterator citr,
const std::string & key,
unsigned index )
inlineprotected

NB: because we want to use this for the L2Star chains, we have to use this method, not the above.

get the correspondiong TE

get all the named collections attached to the TE

now got the collectionVector, can navigate through this

NB: this is safer than using index as an index, ie collectionVector[index] since it will do nothing if index is out of range, although it will be a little slower

useful for debug

Definition at line 474 of file T_AnalysisConfig.h.

474 {
475
476 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
477
479 if ( !trackcollections.empty() ) {
480
481 const HLT::NavigationCore* nc = (*m_tdt)->ExperimentalAndExpertMethods().getNavigation();
482
483 // NB!! a combination should never have more than one entry for a track collection from a single algorithm,
484 // if ( trackcollections.size()>1 ) std::cerr << "SUTT OH NO!!!!!!!!" << endmsg;
485 // maybe a bit dodgy, if we really do have multiple objects returned, but that should only be for
486 // multiple object triggers - then probably none of this would work anyhow
487 for ( unsigned ifeat=0 ; ifeat<trackcollections.size() ; ifeat++ ) {
488
490
492 const HLT::TriggerElement* te = trackfeature.te();
493
496 if ( !const_cast<HLT::NavigationCore *>(nc)->getFeatures( te, collectionVector, key ) ) return false;
497
498 // std::cout << "foundok " << foundok << "\tsize " << collectionVector.size() << std::endl;
499
501
502 for ( unsigned iv=collectionVector.size() ; iv-- ; ) {
506 if ( index!=iv ) continue;
508 // m_provider->msg(MSG::DEBUG) << "TDT TrackFeature->size() " << collectionVector[iv]->size() << " (" << key << ")" << endmsg;
510 break;
511 }
512 }
513 return true;
514 }
515 else {
516 m_provider->msg(MSG::DEBUG) << "TDT TrackFeature collection (" << key << ") is empty" << endmsg;
517 return false;
518 }
519 }

◆ selectTracks() [4/4]

template<class Provider>
template<class Collection>
bool T_AnalysisConfig< Provider >::selectTracks ( TrigTrackSelector * selector,
Trig::FeatureContainer::combination_const_iterator citr,
const std::string & key = "" )
inlineprotected

lagacy run 2 access

Definition at line 441 of file T_AnalysisConfig.h.

441 {
442 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
443
446 size_t pos = key_collection.find("/");
447 if ( pos!=std::string::npos ) {
448 key_collection = key.substr( pos+1, key.size()-pos );
449 key_tename = key.substr( 0, pos );
450 }
451
453 if ( !trackcollections.empty() ) {
454 // NB!! a combination should never have more than one entry for a track collection from a single algorithm, for single object triggers
455 for ( unsigned ifeat=0 ; ifeat<trackcollections.size() ; ifeat++ ) {
457 if ( !trackfeature.empty() ) {
458 // actually select the tracks from this roi at last!!
459 const Collection* trigtracks = trackfeature.cptr();
461 }
462 }
463 return true;
464 }
465 else {
466 m_provider->msg(MSG::DEBUG) << "TDT TrackFeature collection (" << key << ") is empty " << endmsg;
467 return false;
468 }
469 }

◆ selectTracksNotEmpty()

template<class Provider>
template<class Collection>
bool T_AnalysisConfig< Provider >::selectTracksNotEmpty ( TrigTrackSelector * selector,
const std::string & key )
inlineprotected

Definition at line 559 of file T_AnalysisConfig.h.

559 {
560 const Collection* collection = nullptr;
561 if ( key.empty() ) return false;
562 if ( !m_provider->evtStore()->template contains<Collection>( key ) ) return false;
563
565
566 if ( !( sc.isSuccess() && collection ) ) return false;
567
568 m_provider->msg(MSG::DEBUG) << "SG Collection->size() " << collection->size() << " (" << key << ")" << endmsg;
569
570 // added to fix muon samples bug
571 if ( collection->size() == 0 ) {
572 m_provider->msg(MSG::WARNING) << "no particles in collection" << endmsg;
573 return false;
574 }
575
577 return true;
578 }

◆ setBeamX()

template<class Provider>
void T_AnalysisConfig< Provider >::setBeamX ( double d)
inline

Definition at line 217 of file T_AnalysisConfig.h.

217{ m_beamX=d; }

◆ setBeamY()

template<class Provider>
void T_AnalysisConfig< Provider >::setBeamY ( double d)
inline

Definition at line 218 of file T_AnalysisConfig.h.

218{ m_beamY=d; }

◆ setBeamZ()

template<class Provider>
void T_AnalysisConfig< Provider >::setBeamZ ( double d)
inline

Definition at line 219 of file T_AnalysisConfig.h.

219{ m_beamZ=d; }

◆ setFilterOnRoi()

template<class Provider>
bool T_AnalysisConfig< Provider >::setFilterOnRoi ( bool b)
inline

Definition at line 239 of file T_AnalysisConfig.h.

239{ return m_filterOnRoi=b; }

◆ setGenericFlag()

template<class Provider>
void T_AnalysisConfig< Provider >::setGenericFlag ( bool b)
inline

Definition at line 225 of file T_AnalysisConfig.h.

225{ m_genericFlag=b; }

◆ setMCTruth()

template<class Provider>
void T_AnalysisConfig< Provider >::setMCTruth ( bool b = true)
inline

Definition at line 214 of file T_AnalysisConfig.h.

214{ m_mcTruth=b; }

◆ setRequireDecision()

template<class Provider>
void T_AnalysisConfig< Provider >::setRequireDecision ( bool b)
inline

Definition at line 241 of file T_AnalysisConfig.h.

◆ setUseHighestPT()

template<class Provider>
void T_AnalysisConfig< Provider >::setUseHighestPT ( bool b)
inline

Definition at line 232 of file T_AnalysisConfig.h.

232{ m_useHighestPT=b; }

◆ setVtxIndex()

template<class Provider>
void T_AnalysisConfig< Provider >::setVtxIndex ( int i)
inline

Definition at line 235 of file T_AnalysisConfig.h.

235{ m_vtxIndex=i; }

◆ testChains()

template<class Provider>
const std::string T_AnalysisConfig< Provider >::testChains ( ) const
inline

Definition at line 191 of file T_AnalysisConfig.h.

191 {
193 for(unsigned int i=0; i<m_chainNames[0].size(); i++)
194 name += (m_chainNames[0][i]+"::"+m_types[0][i]+"::"+m_keys[0][i]+" ");
195 return name;
196 }

Member Data Documentation

◆ m_analysis

template<class Provider>
TrackAnalysis* T_AnalysisConfig< Provider >::m_analysis
protected

Definition at line 887 of file T_AnalysisConfig.h.

◆ m_analysisInstanceName

template<class Provider>
std::string T_AnalysisConfig< Provider >::m_analysisInstanceName
protected

Definition at line 867 of file T_AnalysisConfig.h.

◆ m_associator

template<class Provider>
TrackAssociator* T_AnalysisConfig< Provider >::m_associator
protected

Definition at line 886 of file T_AnalysisConfig.h.

◆ m_beamX

template<class Provider>
double T_AnalysisConfig< Provider >::m_beamX
protected

Definition at line 891 of file T_AnalysisConfig.h.

◆ m_beamY

template<class Provider>
double T_AnalysisConfig< Provider >::m_beamY
protected

Definition at line 891 of file T_AnalysisConfig.h.

◆ m_beamZ

template<class Provider>
double T_AnalysisConfig< Provider >::m_beamZ
protected

Definition at line 891 of file T_AnalysisConfig.h.

◆ m_chainNames

template<class Provider>
std::vector< std::vector<std::string> > T_AnalysisConfig< Provider >::m_chainNames
protected

Definition at line 870 of file T_AnalysisConfig.h.

◆ m_filterOnRoi

template<class Provider>
bool T_AnalysisConfig< Provider >::m_filterOnRoi
protected

Definition at line 902 of file T_AnalysisConfig.h.

◆ m_filters

template<class Provider>
std::vector< std::vector<TrackFilter*> > T_AnalysisConfig< Provider >::m_filters
protected

Definition at line 874 of file T_AnalysisConfig.h.

◆ m_genericFlag

template<class Provider>
int T_AnalysisConfig< Provider >::m_genericFlag
protected

Definition at line 893 of file T_AnalysisConfig.h.

◆ m_keepAllEvents

template<class Provider>
bool T_AnalysisConfig< Provider >::m_keepAllEvents
protected

Definition at line 896 of file T_AnalysisConfig.h.

◆ m_keys

template<class Provider>
std::vector< std::vector<std::string> > T_AnalysisConfig< Provider >::m_keys
protected

Definition at line 872 of file T_AnalysisConfig.h.

◆ m_mcTruth

template<class Provider>
bool T_AnalysisConfig< Provider >::m_mcTruth
protected

Definition at line 889 of file T_AnalysisConfig.h.

◆ m_provider

template<class Provider>
Provider* T_AnalysisConfig< Provider >::m_provider
protected

Definition at line 859 of file T_AnalysisConfig.h.

◆ m_refChainKey

template<class Provider>
std::string T_AnalysisConfig< Provider >::m_refChainKey
protected

Definition at line 877 of file T_AnalysisConfig.h.

◆ m_refChainName

template<class Provider>
std::string T_AnalysisConfig< Provider >::m_refChainName
protected

Definition at line 876 of file T_AnalysisConfig.h.

◆ m_releaseData

template<class Provider>
std::string T_AnalysisConfig< Provider >::m_releaseData
protected

Definition at line 894 of file T_AnalysisConfig.h.

◆ m_requireDecision

template<class Provider>
bool T_AnalysisConfig< Provider >::m_requireDecision
protected

Definition at line 904 of file T_AnalysisConfig.h.

◆ m_selectorRef

template<class Provider>
TrigTrackSelector* T_AnalysisConfig< Provider >::m_selectorRef
protected

Definition at line 882 of file T_AnalysisConfig.h.

◆ m_selectorSel

template<class Provider>
TrigTrackSelector* T_AnalysisConfig< Provider >::m_selectorSel
protected

Definition at line 884 of file T_AnalysisConfig.h.

◆ m_selectorTest

template<class Provider>
TrigTrackSelector* T_AnalysisConfig< Provider >::m_selectorTest
protected

Definition at line 883 of file T_AnalysisConfig.h.

◆ m_tdt

template<class Provider>
ToolHandle<Trig::TrigDecisionTool>* T_AnalysisConfig< Provider >::m_tdt
protected

Definition at line 861 of file T_AnalysisConfig.h.

◆ m_testChainKey

template<class Provider>
std::string T_AnalysisConfig< Provider >::m_testChainKey
protected

Definition at line 880 of file T_AnalysisConfig.h.

◆ m_testChainName

template<class Provider>
std::string T_AnalysisConfig< Provider >::m_testChainName
protected

Definition at line 879 of file T_AnalysisConfig.h.

◆ m_types

template<class Provider>
std::vector< std::vector<std::string> > T_AnalysisConfig< Provider >::m_types
protected

Definition at line 871 of file T_AnalysisConfig.h.

◆ m_useHighestPT

template<class Provider>
bool T_AnalysisConfig< Provider >::m_useHighestPT
protected

Definition at line 898 of file T_AnalysisConfig.h.

◆ m_vtxIndex

template<class Provider>
int T_AnalysisConfig< Provider >::m_vtxIndex
protected

Definition at line 900 of file T_AnalysisConfig.h.


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