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 TrackAnalysisanalysis () 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="ElectronAODCollection")
 select offline electrons
unsigned processMuons (TrigTrackSelector &selectorRef, const unsigned int selection=0, double ETOffline=0, const std::string &containerName="StacoMuonCollection")
 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
TrigTrackSelectorm_selectorRef
TrigTrackSelectorm_selectorTest
TrigTrackSelectorm_selectorSel
TrackAssociatorm_associator
TrackAnalysism_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 53 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 63 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 107 of file T_AnalysisConfig.h.

◆ ~T_AnalysisConfig()

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

Definition at line 148 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 162 of file T_AnalysisConfig.h.

◆ addReferenceFilter()

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

Definition at line 171 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 166 of file T_AnalysisConfig.h.

◆ addSelectionFilter()

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

Definition at line 172 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 158 of file T_AnalysisConfig.h.

◆ addTestFilter()

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

Definition at line 170 of file T_AnalysisConfig.h.

◆ analysis()

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

Definition at line 217 of file T_AnalysisConfig.h.

◆ beamX()

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

Definition at line 225 of file T_AnalysisConfig.h.

◆ beamY()

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

Definition at line 226 of file T_AnalysisConfig.h.

◆ beamZ()

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

Definition at line 227 of file T_AnalysisConfig.h.

◆ book()

◆ execute()

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

Definition at line 184 of file T_AnalysisConfig.h.

◆ filterOnRoi()

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

Definition at line 243 of file T_AnalysisConfig.h.

◆ finalize()

◆ genericFlag()

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

Definition at line 229 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 590 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 619 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 258 of file T_AnalysisConfig.h.

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

◆ getUseHighestPT()

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

Definition at line 238 of file T_AnalysisConfig.h.

238{ return m_useHighestPT; }

◆ getVtxIndex()

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

Definition at line 241 of file T_AnalysisConfig.h.

241{ return m_vtxIndex; }

◆ initialize()

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

Definition at line 175 of file T_AnalysisConfig.h.

175 {
176 m_provider = p;
177 m_tdt = tdt;
178 if ( m_tdt==0 ) m_analysis->initialise();
179
180 }

◆ keepAllEvents()

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

Definition at line 235 of file T_AnalysisConfig.h.

235{ m_keepAllEvents = b; }

◆ loop()

◆ mcTruth()

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

Definition at line 220 of file T_AnalysisConfig.h.

220{ return m_mcTruth; }

◆ name()

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

Definition at line 194 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 = "ElectronAODCollection" )
inlineprotected

select offline electrons

Definition at line 659 of file T_AnalysisConfig.h.

669 {
670
671 m_provider->msg(MSG::DEBUG) << "Fetching offline electrons: " << containerName << endmsg;
672
673 selectorRef.clear();
674
675# ifdef XAODTRACKING_TRACKPARTICLE_H
677# else
679# endif
680
681
682 const Container* container = 0;
683
684 if( ! m_provider->evtStore()->template contains<Container>(containerName) ) {
685 m_provider->msg(MSG::WARNING) << "Error No Electron Container " << containerName << " !" << endmsg;
686 return 0;
687 }
688
690 if( sc.isFailure() || !container ) {
691 m_provider->msg(MSG::WARNING) << "Error retrieving container: " << containerName << " !" << endmsg;
692 return 0;
693 }
694
695 m_provider->msg(MSG::DEBUG) << "Event with " << container->size() << " Electron object(s) " << endmsg;
696
699
700 for( ; elec!=elec_end ; ++elec ){
701 //m_provider->msg(MSG::DEBUG) << " Electron " << (*elec)
702 // << ", eta " << (*elec)->eta()
703 // << ", phi " << (*elec)->phi()
704 // << ", ET " << (*elec)->pt()
705 // << ", author " << (*elec)->author()
706 // << ", trackParticle " << (*elec)->trackParticle()
707 // << ", conversion " << (*elec)->conversion()
708 // << ", mediumPP " << ((*elec)->isem(egammaPID::ElectronMediumPP)==0)
709 // << endmsg;
710
711 bool good_electron = false;
712# ifdef XAODTRACKING_TRACKPARTICLE_H
714# else
716# endif
717
718 if (good_electron) {
719 const xAOD::Electron_v1& eleduff = *(*elec);
720 long unsigned eleid = (unsigned long)(&eleduff) ;
721 TrackTrigObject eleobj = TrackTrigObject( (*elec)->eta(),
722 (*elec)->phi(),
723 (*elec)->pt(),
724 0,
725 (*elec)->type(),
726 eleid );
727
728 bool trk_added ;
730 else trk_added = selectorRef.selectTrack( (*elec)->trackParticle() );
731
732 if (trk_added) eleobj.addChild( selectorRef.tracks().back()->id() );
733 if (elevec) elevec->push_back( eleobj );
734 }
735 }
736
737 return selectorRef.tracks().size();
738 }
bool isGoodOffline(const Analysis::Electron &elec)

◆ processMuons()

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

select offlinqe muons

Definition at line 745 of file T_AnalysisConfig.h.

752 {
753
754# ifdef XAODTRACKING_TRACKPARTICLE_H
756# else
758# endif
759
760 m_provider->msg(MSG::DEBUG) << " Offline muons (" << containerName << ")" << endmsg;
761
762 selectorRef.clear();
763
764 const Container* container = 0;
765
766 if( ! m_provider->evtStore()->template contains<Container>(containerName) ) {
767 m_provider->msg(MSG::WARNING) << "Error No MuonCollection" << containerName << " !" << endmsg;
768 return 0;
769 }
770
772 if( sc.isFailure() || !container ) {
773 m_provider->msg(MSG::WARNING) << "Error retrieving " << containerName << " !" << endmsg;
774 return 0;
775 }
776
777 auto muon = container->begin();
778 auto muon_end = container->end();
779
780 // std::cout << "SUTT Offline muons " << container->size() << "\t threshold " << ETOffline << std::endl;
781
782 for( ; muon!=muon_end ; ++muon ){
783# ifdef XAODTRACKING_TRACKPARTICLE_H
785# else
786 if ( TIDA::isGoodOffline(*(*muon)) ) selectorRef.selectTrack((*muon)->inDetTrackParticle());
787# endif
788 }
789
790
791 // std::cout << "SUTT found " << selectorRef.tracks().size() << " muons for " << containerName << std::endl;
792 m_provider->msg(MSG::DEBUG) << "found " << selectorRef.tracks().size() << " muons for " << containerName << endmsg;
793
794 return selectorRef.tracks().size();
795}

◆ 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

Definition at line 802 of file T_AnalysisConfig.h.

808 {
809
811
812 selectorRef.clear();
813
814 const Container* container = 0;
815
816 selectorRef.clear();
817
818 m_provider->msg(MSG::DEBUG) << " Offline taus " << containerName << endmsg;
819
820 if ( !m_provider->evtStore()->template contains<Container>(containerName)) {
821 m_provider->msg(MSG::WARNING) << " Offline taus not found" << endmsg;
822 return 0;
823 }
824
826 if (sc != StatusCode::SUCCESS) {
827 m_provider->msg(MSG::WARNING) << " Offline tau retrieval not successful" << endmsg;
828 return 0;
829 }
830
833
834
835 for ( ; tau!=tau_end ; ++tau ) {
836
837# ifndef XAODTAU_VERSIONS_TAUJET_V3_H
838 int N = (*tau)->nTracks();
839 // std::cout << "SUTT no tau detail " << N << "\t3prong: " << doThreeProng << std::endl;
840# else
841 int N=0;
842 (*tau)->detail( xAOD::TauJetParameters::nChargedTracks, N );
843 // std::cout << "SUTT tau detail: N " << N << "\t3prong: " << doThreeProng << std::endl;
844# endif
845
846 bool good_tau = false;
848
849 // std::cout << "SUTT tau ntracks: " << N << "\tgoodtau: " << good_tau << "\tpt: " << (*tau)->p4().Et() << "\t3prong: " << doThreeProng << std::endl;
850
851 if (good_tau){
852 const xAOD::TauJet_v3& duff = *(*tau);
853 long unsigned tauid = (unsigned long)(&duff) ;
854 TrackTrigObject tauobj = TrackTrigObject( (*tau)->eta(),
855 (*tau)->phi(),
856 (*tau)->pt(),
857 0,
858 (*tau)->type(),
859 tauid );
860
861 bool trk_added = false;
862
863 for ( unsigned i=N ; i-- ; ) {
864# ifdef XAODTAU_TAUTRACK_H
865
866 std::vector< ElementLink<xAOD::TrackParticleContainer> > alink = (*tau)->track(i)->trackLinks();
867
868 trk_added = false;
869
870 for ( size_t ilink=0 ; ilink<alink.size() ; ilink++ ) {
871 if ( alink[ilink].isValid() ) trk_added = selectorRef.selectTrack((*alink[ilink]));
872 }
874 // trk_added = selectorRef.selectTrack((*tau)->track(i)->track());
876# else
877 trk_added = selectorRef.selectTrack((*tau)->track(i));
878# endif
879 if ( trk_added ) tauobj.addChild( selectorRef.tracks().back()->id() );
880 }
881 if ( tauvec ) tauvec->push_back( tauobj );
882 }
883 }
884
885 return selectorRef.tracks().size();
886
887}

◆ referenceChains()

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

Definition at line 203 of file T_AnalysisConfig.h.

203 {
205 for(unsigned int i=0; i<m_chainNames[1].size(); i++)
206 name += (m_chainNames[1][i]+"::"+m_types[1][i]+"::"+m_keys[1][i]+" ");
207 return name;
208 }
const std::string & name() const

◆ releaseData() [1/2]

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

Definition at line 232 of file T_AnalysisConfig.h.

232{ return m_releaseData; }

◆ releaseData() [2/2]

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

Definition at line 233 of file T_AnalysisConfig.h.

233{ m_releaseData = s; }

◆ requireDecision()

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

Definition at line 247 of file T_AnalysisConfig.h.

247{ 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 529 of file T_AnalysisConfig.h.

529 {
532 if ( m_provider->evtStore()->template contains<Collection>( key ) ) {
534 if ( handle.isValid() ) {
537 collection = handle.cptr();
538 return StatusCode::SUCCESS;
539 }
540 }
541 return StatusCode::FAILURE;
542 }

◆ 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 330 of file T_AnalysisConfig.h.

332 {
333
334 m_provider->msg(MSG::VERBOSE) << "\tFetch xAOD::VertexContainer for key: " << key << endmsg;
335
338
339 if ( vtx_itrpair.first == vtx_itrpair.second ) {
340 m_provider->msg(MSG::WARNING) << "\tNo xAOD::Vertex collection for key " << key << endmsg;
341 return false;
342 }
343
344 m_provider->msg(MSG::DEBUG) << "\txAOD::VertexContainer found with size " << (vtx_itrpair.second - vtx_itrpair.first)
345 << "\t:" << key << endmsg;
346
347 return select( vertices, vtx_itrpair.first, vtx_itrpair.second );
348 }
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 353 of file T_AnalysisConfig.h.

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

◆ 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 301 of file T_AnalysisConfig.h.

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

◆ selectionChains()

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

Definition at line 210 of file T_AnalysisConfig.h.

210 {
212 for(unsigned int i=0; i<m_chainNames[2].size(); i++)
213 name += (m_chainNames[2][i]+"::"+m_types[2][i]+"::"+m_keys[2][i]+" ");
214 return name;
215 }

◆ 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 400 of file T_AnalysisConfig.h.

403 {
404
405
408 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
409
414 size_t pos = key_collection.find("/");
415 if ( pos!=std::string::npos ) {
416 key_collection = key.substr( pos+1, key.size()-pos );
417 key_tename = key.substr( 0, pos );
418 }
419
422
424
426 const std::string* keyStr = m_provider->evtStore()->keyToString(roi_link.key(), checkCLID);
427 m_provider->msg(MSG::DEBUG) << "Requesting range over (" << key << ") associated to ROI from " << (keyStr == nullptr ? "UNKNOWN" : *keyStr) << endmsg;
428
429 itrpair = (*m_tdt)->associateToEventView( handle, roi_link );
430
431 if ( itrpair.first != itrpair.second ) {
432 selector->selectTracks( itrpair.first, itrpair.second );
433 return true;
434 }
435 else {
436 m_provider->msg(MSG::DEBUG) << "TDT TrackFeature collection (" << key << ") is empty " << endmsg;
437 return false;
438 }
439 }
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 547 of file T_AnalysisConfig.h.

547 {
548 if ( key!="" ) {
550 if ( handle.isValid() ) {
552 // std::cout << "\t\t\t T_AnalysisConfig::selectTracks() - > TrackSelector" << std::endl;
553 selector->selectTracks( handle.cptr() );
554 return true;
555 }
556 }
557 return false;
558 }

◆ 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 479 of file T_AnalysisConfig.h.

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

◆ 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 446 of file T_AnalysisConfig.h.

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

◆ selectTracksNotEmpty()

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

Definition at line 564 of file T_AnalysisConfig.h.

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

◆ setBeamX()

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

Definition at line 222 of file T_AnalysisConfig.h.

222{ m_beamX=d; }

◆ setBeamY()

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

Definition at line 223 of file T_AnalysisConfig.h.

223{ m_beamY=d; }

◆ setBeamZ()

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

Definition at line 224 of file T_AnalysisConfig.h.

224{ m_beamZ=d; }

◆ setFilterOnRoi()

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

Definition at line 244 of file T_AnalysisConfig.h.

244{ return m_filterOnRoi=b; }

◆ setGenericFlag()

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

Definition at line 230 of file T_AnalysisConfig.h.

230{ m_genericFlag=b; }

◆ setMCTruth()

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

Definition at line 219 of file T_AnalysisConfig.h.

219{ m_mcTruth=b; }

◆ setRequireDecision()

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

Definition at line 246 of file T_AnalysisConfig.h.

◆ setUseHighestPT()

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

Definition at line 237 of file T_AnalysisConfig.h.

237{ m_useHighestPT=b; }

◆ setVtxIndex()

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

Definition at line 240 of file T_AnalysisConfig.h.

240{ m_vtxIndex=i; }

◆ testChains()

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

Definition at line 196 of file T_AnalysisConfig.h.

196 {
198 for(unsigned int i=0; i<m_chainNames[0].size(); i++)
199 name += (m_chainNames[0][i]+"::"+m_types[0][i]+"::"+m_keys[0][i]+" ");
200 return name;
201 }

Member Data Documentation

◆ m_analysis

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

Definition at line 921 of file T_AnalysisConfig.h.

◆ m_analysisInstanceName

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

Definition at line 901 of file T_AnalysisConfig.h.

◆ m_associator

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

Definition at line 920 of file T_AnalysisConfig.h.

◆ m_beamX

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

Definition at line 925 of file T_AnalysisConfig.h.

◆ m_beamY

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

Definition at line 925 of file T_AnalysisConfig.h.

◆ m_beamZ

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

Definition at line 925 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 904 of file T_AnalysisConfig.h.

◆ m_filterOnRoi

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

Definition at line 936 of file T_AnalysisConfig.h.

◆ m_filters

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

Definition at line 908 of file T_AnalysisConfig.h.

◆ m_genericFlag

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

Definition at line 927 of file T_AnalysisConfig.h.

◆ m_keepAllEvents

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

Definition at line 930 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 906 of file T_AnalysisConfig.h.

◆ m_mcTruth

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

Definition at line 923 of file T_AnalysisConfig.h.

◆ m_provider

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

Definition at line 893 of file T_AnalysisConfig.h.

◆ m_refChainKey

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

Definition at line 911 of file T_AnalysisConfig.h.

◆ m_refChainName

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

Definition at line 910 of file T_AnalysisConfig.h.

◆ m_releaseData

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

Definition at line 928 of file T_AnalysisConfig.h.

◆ m_requireDecision

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

Definition at line 938 of file T_AnalysisConfig.h.

◆ m_selectorRef

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

Definition at line 916 of file T_AnalysisConfig.h.

◆ m_selectorSel

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

Definition at line 918 of file T_AnalysisConfig.h.

◆ m_selectorTest

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

Definition at line 917 of file T_AnalysisConfig.h.

◆ m_tdt

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

Definition at line 895 of file T_AnalysisConfig.h.

◆ m_testChainKey

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

Definition at line 914 of file T_AnalysisConfig.h.

◆ m_testChainName

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

Definition at line 913 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 905 of file T_AnalysisConfig.h.

◆ m_useHighestPT

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

Definition at line 932 of file T_AnalysisConfig.h.

◆ m_vtxIndex

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

Definition at line 934 of file T_AnalysisConfig.h.


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