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 TrigInDetTrackTruthMap *truthmap, const std::string &key="", unsigned index=0)
 NB: because we want to use this for the L2Star chains, we have to use this method, not the above method without the TruthMap argument - if we don't want/have the TruthMap, just set the pointer to 0 - there should be abetter way to do this, but shan't worry about it now.
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="TauRecContainer")
 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::string m_refChainName
std::string m_refChainKey
std::string m_testChainName
std::string m_testChainKey
std::vector< std::vector< TrackFilter * > > m_filters
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 59 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 69 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 129 of file T_AnalysisConfig.h.

◆ ~T_AnalysisConfig()

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

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

◆ addReferenceFilter()

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

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

◆ addSelectionFilter()

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

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

◆ addTestFilter()

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

Definition at line 211 of file T_AnalysisConfig.h.

◆ analysis()

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

Definition at line 258 of file T_AnalysisConfig.h.

◆ beamX()

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

Definition at line 266 of file T_AnalysisConfig.h.

◆ beamY()

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

Definition at line 267 of file T_AnalysisConfig.h.

◆ beamZ()

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

Definition at line 268 of file T_AnalysisConfig.h.

◆ book()

◆ execute()

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

Definition at line 225 of file T_AnalysisConfig.h.

◆ filterOnRoi()

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

Definition at line 284 of file T_AnalysisConfig.h.

◆ finalize()

◆ genericFlag()

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

Definition at line 270 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 634 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 663 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 299 of file T_AnalysisConfig.h.

304 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
305
310 size_t pos = key_collection.find("/");
311 if ( pos!=std::string::npos ) {
312 key_collection = key.substr( pos+1, key.size()-pos );
313 key_tename = key.substr( 0, pos );
314 }
315
318
320
322 const std::string* keyStr = m_provider->evtStore()->keyToString(roi_link.key(), checkCLID);
323 m_provider->msg(MSG::DEBUG) << "Requesting range over (" << key << ") associated to ROI from " << (keyStr == nullptr ? "UNKNOWN" : *keyStr) << endmsg;
324
325 itrpair = (*m_tdt)->associateToEventView( handle, roi_link );
326
327 return itrpair;
328 }

◆ getUseHighestPT()

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

Definition at line 279 of file T_AnalysisConfig.h.

279{ return m_useHighestPT; }

◆ getVtxIndex()

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

Definition at line 282 of file T_AnalysisConfig.h.

282{ return m_vtxIndex; }

◆ initialize()

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

Definition at line 216 of file T_AnalysisConfig.h.

216 {
217 m_provider = p;
218 m_tdt = tdt;
219 if ( m_tdt==0 ) m_analysis->initialise();
220
221 }

◆ keepAllEvents()

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

Definition at line 276 of file T_AnalysisConfig.h.

276{ m_keepAllEvents = b; }

◆ loop()

template<class Provider>
virtual void T_AnalysisConfig< Provider >::loop ( )
protectedpure virtual

◆ mcTruth()

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

Definition at line 261 of file T_AnalysisConfig.h.

261{ return m_mcTruth; }

◆ name()

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

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

713 {
714
715 m_provider->msg(MSG::DEBUG) << "Fetching offline electrons: " << containerName << endmsg;
716
717 selectorRef.clear();
718
719# ifdef XAODTRACKING_TRACKPARTICLE_H
721# else
723# endif
724
725
726 const Container* container = 0;
727
728 if( ! m_provider->evtStore()->template contains<Container>(containerName) ) {
729 m_provider->msg(MSG::WARNING) << "Error No Electron Container " << containerName << " !" << endmsg;
730 return 0;
731 }
732
734 if( sc.isFailure() || !container ) {
735 m_provider->msg(MSG::WARNING) << "Error retrieving container: " << containerName << " !" << endmsg;
736 return 0;
737 }
738
739 m_provider->msg(MSG::DEBUG) << "Event with " << container->size() << " Electron object(s) " << endmsg;
740
743
744 for( ; elec!=elec_end ; ++elec ){
745 //m_provider->msg(MSG::DEBUG) << " Electron " << (*elec)
746 // << ", eta " << (*elec)->eta()
747 // << ", phi " << (*elec)->phi()
748 // << ", ET " << (*elec)->pt()
749 // << ", author " << (*elec)->author()
750 // << ", trackParticle " << (*elec)->trackParticle()
751 // << ", conversion " << (*elec)->conversion()
752 // << ", mediumPP " << ((*elec)->isem(egammaPID::ElectronMediumPP)==0)
753 // << endmsg;
754
755 bool good_electron = false;
756# ifdef XAODTRACKING_TRACKPARTICLE_H
758# else
760# endif
761
762 if (good_electron) {
763 const xAOD::Electron_v1& eleduff = *(*elec);
764 long unsigned eleid = (unsigned long)(&eleduff) ;
765 TrackTrigObject eleobj = TrackTrigObject( (*elec)->eta(),
766 (*elec)->phi(),
767 (*elec)->pt(),
768 0,
769 (*elec)->type(),
770 eleid );
771
772 bool trk_added ;
774 else trk_added = selectorRef.selectTrack( (*elec)->trackParticle() );
775
776 if (trk_added) eleobj.addChild( selectorRef.tracks().back()->id() );
777 if (elevec) elevec->push_back( eleobj );
778 }
779 }
780
781 return selectorRef.tracks().size();
782 }
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 789 of file T_AnalysisConfig.h.

796 {
797
798# ifdef XAODTRACKING_TRACKPARTICLE_H
800# else
802# endif
803
804 m_provider->msg(MSG::DEBUG) << " Offline muons (" << containerName << ")" << endmsg;
805
806 selectorRef.clear();
807
808 const Container* container = 0;
809
810 if( ! m_provider->evtStore()->template contains<Container>(containerName) ) {
811 m_provider->msg(MSG::WARNING) << "Error No MuonCollection" << containerName << " !" << endmsg;
812 return 0;
813 }
814
816 if( sc.isFailure() || !container ) {
817 m_provider->msg(MSG::WARNING) << "Error retrieving " << containerName << " !" << endmsg;
818 return 0;
819 }
820
821 auto muon = container->begin();
822 auto muon_end = container->end();
823
824 // std::cout << "SUTT Offline muons " << container->size() << "\t threshold " << ETOffline << std::endl;
825
826 for( ; muon!=muon_end ; ++muon ){
827# ifdef XAODTRACKING_TRACKPARTICLE_H
828 if ( TIDA::isGoodOffline(*(*muon), selection, ETOffline ) ) selectorRef.selectTrack(*((*muon)->inDetTrackParticleLink()));
829# else
830 if ( TIDA::isGoodOffline(*(*muon)) ) selectorRef.selectTrack((*muon)->inDetTrackParticle());
831# endif
832 }
833
834
835 // std::cout << "SUTT found " << selectorRef.tracks().size() << " muons for " << containerName << std::endl;
836 m_provider->msg(MSG::DEBUG) << "found " << selectorRef.tracks().size() << " muons for " << containerName << endmsg;
837
838 return selectorRef.tracks().size();
839}

◆ 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 = "TauRecContainer" )
inlineprotected

select offline taus

Definition at line 846 of file T_AnalysisConfig.h.

856 {
857
858# ifdef XAODTRACKING_TRACKPARTICLE_H
860# else
862# endif
863
864 selectorRef.clear();
865
866 const Container* container = 0;
867
868 selectorRef.clear();
869
870 m_provider->msg(MSG::DEBUG) << " Offline taus " << containerName << endmsg;
871
872 if ( !m_provider->evtStore()->template contains<Container>(containerName)) {
873 m_provider->msg(MSG::WARNING) << " Offline taus not found" << endmsg;
874 return 0;
875 }
876
878 if (sc != StatusCode::SUCCESS) {
879 m_provider->msg(MSG::WARNING) << " Offline tau retrieval not successful" << endmsg;
880 return 0;
881 }
882
885
886
887 for ( ; tau!=tau_end ; ++tau ) {
888
889# ifdef XAODTRACKING_TRACKPARTICLE_H
890 // unsigned N = (*tau)->nTracks();
891
892# ifndef XAODTAU_VERSIONS_TAUJET_V3_H
893 int N = (*tau)->nTracks();
894 // std::cout << "SUTT no tau detail " << N << "\t3prong: " << doThreeProng << std::endl;
895# else
896 int N=0;
897 (*tau)->detail( xAOD::TauJetParameters::nChargedTracks, N );
898 // std::cout << "SUTT tau detail: N " << N << "\t3prong: " << doThreeProng << std::endl;
899# endif
900
901# else
902 unsigned N = (*tau)->numTrack();
903# endif
904
905
906 bool good_tau = false;
907# ifdef XAODTRACKING_TRACKPARTICLE_H
909# else
911# endif
912
913 // std::cout << "SUTT tau ntracks: " << N << "\tgoodtau: " << good_tau << "\tpt: " << (*tau)->p4().Et() << "\t3prong: " << doThreeProng << std::endl;
914
915 if (good_tau){
916 const xAOD::TauJet_v3& duff = *(*tau);
917 long unsigned tauid = (unsigned long)(&duff) ;
918 TrackTrigObject tauobj = TrackTrigObject( (*tau)->eta(),
919 (*tau)->phi(),
920 (*tau)->pt(),
921 0,
922 (*tau)->type(),
923 tauid );
924
925 bool trk_added = false;
926
927 for ( unsigned i=N ; i-- ; ) {
928# ifdef XAODTAU_TAUTRACK_H
929
930 std::vector< ElementLink<xAOD::TrackParticleContainer> > alink = (*tau)->track(i)->trackLinks();
931
932 trk_added = false;
933
934 for ( size_t ilink=0 ; ilink<alink.size() ; ilink++ ) {
935 if ( alink[ilink].isValid() ) trk_added = selectorRef.selectTrack((*alink[ilink]));
936 }
938 // trk_added = selectorRef.selectTrack((*tau)->track(i)->track());
940# else
941 trk_added = selectorRef.selectTrack((*tau)->track(i));
942# endif
943 if ( trk_added ) tauobj.addChild( selectorRef.tracks().back()->id() );
944 }
945 if ( tauvec ) tauvec->push_back( tauobj );
946 }
947 }
948
949 return selectorRef.tracks().size();
950
951}
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878

◆ referenceChains()

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

Definition at line 244 of file T_AnalysisConfig.h.

244 {
246 for(unsigned int i=0; i<m_chainNames[1].size(); i++)
247 name += (m_chainNames[1][i]+"::"+m_types[1][i]+"::"+m_keys[1][i]+" ");
248 return name;
249 }
const std::string & name() const

◆ releaseData() [1/2]

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

Definition at line 273 of file T_AnalysisConfig.h.

273{ return m_releaseData; }

◆ releaseData() [2/2]

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

Definition at line 274 of file T_AnalysisConfig.h.

274{ m_releaseData = s; }

◆ requireDecision()

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

Definition at line 288 of file T_AnalysisConfig.h.

288{ 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 573 of file T_AnalysisConfig.h.

573 {
576 if ( m_provider->evtStore()->template contains<Collection>( key ) ) {
578 if ( handle.isValid() ) {
581 collection = handle.cptr();
582 return StatusCode::SUCCESS;
583 }
584 }
585 return StatusCode::FAILURE;
586 }

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

373 {
374
375 m_provider->msg(MSG::VERBOSE) << "\tFetch xAOD::VertexContainer for key: " << key << endmsg;
376
379
380 if ( vtx_itrpair.first == vtx_itrpair.second ) {
381 m_provider->msg(MSG::WARNING) << "\tNo xAOD::Vertex collection for key " << key << endmsg;
382 return false;
383 }
384
385 m_provider->msg(MSG::DEBUG) << "\txAOD::VertexContainer found with size " << (vtx_itrpair.second - vtx_itrpair.first)
386 << "\t:" << key << endmsg;
387
388 return select( vertices, vtx_itrpair.first, vtx_itrpair.second );
389 }
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 394 of file T_AnalysisConfig.h.

394 {
395
396 m_provider->msg(MSG::VERBOSE) << "fetching AOD vertex container" << endmsg;
397
399
401 m_provider->msg(MSG::WARNING) << "xAOD vertex container not found with key " << key << endmsg;
402 return false;
403 }
404
405 if ( xaodVtxCollection!=0 ) {
406
407 m_provider->msg(MSG::VERBOSE) << "xAOD vertex container " << xaodVtxCollection->size() << " entries" << endmsg;
408
409 return select( vertices, xaodVtxCollection->begin(), xaodVtxCollection->end() );
410
411#if 0
412
414
415 for ( ; vtxitr != xaodVtxCollection->end(); vtxitr++ ) {
416 if ( (*vtxitr)->nTrackParticles()>0 && (*vtxitr)->vertexType()!=0 ) {
417 vertices.push_back( TIDA::Vertex( (*vtxitr)->x(),
418 (*vtxitr)->y(),
419 (*vtxitr)->z(),
421 (*vtxitr)->covariancePosition()(Trk::x,Trk::x),
422 (*vtxitr)->covariancePosition()(Trk::y,Trk::y),
423 (*vtxitr)->covariancePosition()(Trk::z,Trk::z),
424 (*vtxitr)->nTrackParticles(),
426 (*vtxitr)->chiSquared(),
427 (*vtxitr)->numberDoF() ) );
428 }
429 }
430
431#endif
432
433 }
434
435 return true;
436 }

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

344 {
345
347
348 for ( ; vtxitr!=vtx_end ; ++vtxitr ) {
349 if ( (*vtxitr)->vertexType()!=0 ) {
350 m_provider->msg(MSG::VERBOSE) << "\tvertex " << (*vtxitr)->z() << endmsg;
351
352 vertices.push_back( TIDA::Vertex( (*vtxitr)->x(),
353 (*vtxitr)->y(),
354 (*vtxitr)->z(),
356 (*vtxitr)->covariancePosition()(Trk::x,Trk::x),
357 (*vtxitr)->covariancePosition()(Trk::y,Trk::y),
358 (*vtxitr)->covariancePosition()(Trk::z,Trk::z),
359 (*vtxitr)->nTrackParticles(),
361 (*vtxitr)->chiSquared(),
362 (*vtxitr)->numberDoF() ) );
363
364 }
365 }
366
367 return true;
368 }

◆ selectionChains()

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

Definition at line 251 of file T_AnalysisConfig.h.

251 {
253 for(unsigned int i=0; i<m_chainNames[2].size(); i++)
254 name += (m_chainNames[2][i]+"::"+m_types[2][i]+"::"+m_keys[2][i]+" ");
255 return name;
256 }

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

444 {
445
446
449 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
450
455 size_t pos = key_collection.find("/");
456 if ( pos!=std::string::npos ) {
457 key_collection = key.substr( pos+1, key.size()-pos );
458 key_tename = key.substr( 0, pos );
459 }
460
463
465
467 const std::string* keyStr = m_provider->evtStore()->keyToString(roi_link.key(), checkCLID);
468 m_provider->msg(MSG::DEBUG) << "Requesting range over (" << key << ") associated to ROI from " << (keyStr == nullptr ? "UNKNOWN" : *keyStr) << endmsg;
469
470 itrpair = (*m_tdt)->associateToEventView( handle, roi_link );
471
472 if ( itrpair.first != itrpair.second ) {
473 selector->selectTracks( itrpair.first, itrpair.second );
474 return true;
475 }
476 else {
477 m_provider->msg(MSG::DEBUG) << "TDT TrackFeature collection (" << key << ") is empty " << endmsg;
478 return false;
479 }
480 }
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 591 of file T_AnalysisConfig.h.

591 {
592 if ( key!="" ) {
594 if ( handle.isValid() ) {
596 // std::cout << "\t\t\t T_AnalysisConfig::selectTracks() - > TrackSelector" << std::endl;
597 selector->selectTracks( handle.cptr() );
598 return true;
599 }
600 }
601 return false;
602 }

◆ 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 = "" )
inlineprotected

lagacy run 2 access

Definition at line 487 of file T_AnalysisConfig.h.

487 {
488
489 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
490
493 size_t pos = key_collection.find("/");
494 if ( pos!=std::string::npos ) {
495 key_collection = key.substr( pos+1, key.size()-pos );
496 key_tename = key.substr( 0, pos );
497 }
498
500 if ( !trackcollections.empty() ) {
501 // NB!! a combination should never have more than one entry for a track collection from a single algorithm, for single object triggers
502 for ( unsigned ifeat=0 ; ifeat<trackcollections.size() ; ifeat++ ) {
504 if ( !trackfeature.empty() ) {
505 // actually select the tracks from this roi at last!!
506 const Collection* trigtracks = trackfeature.cptr();
508 }
509 }
510 return true;
511 }
512 else {
513 m_provider->msg(MSG::DEBUG) << "TDT TrackFeature collection (" << key << ") is empty " << endmsg;
514 return false;
515 }
516 }

◆ selectTracks() [4/4]

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

NB: because we want to use this for the L2Star chains, we have to use this method, not the above method without the TruthMap argument - if we don't want/have the TruthMap, just set the pointer to 0 - there should be abetter way to do this, but shan't worry about it now.

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

523 {
524
525 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
526
528 if ( !trackcollections.empty() ) {
529
530 const HLT::NavigationCore* nc = (*m_tdt)->ExperimentalAndExpertMethods().getNavigation();
531
532 // NB!! a combination should never have more than one entry for a track collection from a single algorithm,
533 // if ( trackcollections.size()>1 ) std::cerr << "SUTT OH NO!!!!!!!!" << endmsg;
534 // maybe a bit dodgy, if we really do have multiple objects returned, but that should only be for
535 // multiple object triggers - then probably none of this would work anyhow
536 for ( unsigned ifeat=0 ; ifeat<trackcollections.size() ; ifeat++ ) {
537 // std::cout << "selectTracks() ifeat=" << ifeat << "\tkey " << key << "\t(truthmap)" << std::endl;
539
541 const HLT::TriggerElement* te = trackfeature.te();
542
545 if ( !const_cast<HLT::NavigationCore *>(nc)->getFeatures( te, collectionVector, key ) ) return false;
546
547 // std::cout << "foundok " << foundok << "\tsize " << collectionVector.size() << std::endl;
548
550
551 for ( unsigned iv=collectionVector.size() ; iv-- ; ) {
555 if ( index!=iv ) continue;
557 // m_provider->msg(MSG::DEBUG) << "TDT TrackFeature->size() " << collectionVector[iv]->size() << " (" << key << ")" << endmsg;
559 break;
560 }
561 }
562 return true;
563 }
564 else {
565 m_provider->msg(MSG::DEBUG) << "TDT TrackFeature collection (" << key << ") is empty" << endmsg;
566 return false;
567 }
568 }

◆ selectTracksNotEmpty()

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

Definition at line 608 of file T_AnalysisConfig.h.

608 {
609 const Collection* collection = nullptr;
610 if ( key.empty() ) return false;
611 if ( !m_provider->evtStore()->template contains<Collection>( key ) ) return false;
612
614
615 if ( !( sc.isSuccess() && collection ) ) return false;
616
617 m_provider->msg(MSG::DEBUG) << "SG Collection->size() " << collection->size() << " (" << key << ")" << endmsg;
618
619 // added to fix muon samples bug
620 if ( collection->size() == 0 ) {
621 m_provider->msg(MSG::WARNING) << "no particles in collection" << endmsg;
622 return false;
623 }
624
626 return true;
627 }

◆ setBeamX()

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

Definition at line 263 of file T_AnalysisConfig.h.

263{ m_beamX=d; }

◆ setBeamY()

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

Definition at line 264 of file T_AnalysisConfig.h.

264{ m_beamY=d; }

◆ setBeamZ()

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

Definition at line 265 of file T_AnalysisConfig.h.

265{ m_beamZ=d; }

◆ setFilterOnRoi()

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

Definition at line 285 of file T_AnalysisConfig.h.

285{ return m_filterOnRoi=b; }

◆ setGenericFlag()

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

Definition at line 271 of file T_AnalysisConfig.h.

271{ m_genericFlag=b; }

◆ setMCTruth()

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

Definition at line 260 of file T_AnalysisConfig.h.

260{ m_mcTruth=b; }

◆ setRequireDecision()

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

Definition at line 287 of file T_AnalysisConfig.h.

◆ setUseHighestPT()

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

Definition at line 278 of file T_AnalysisConfig.h.

278{ m_useHighestPT=b; }

◆ setVtxIndex()

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

Definition at line 281 of file T_AnalysisConfig.h.

281{ m_vtxIndex=i; }

◆ testChains()

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

Definition at line 237 of file T_AnalysisConfig.h.

237 {
239 for(unsigned int i=0; i<m_chainNames[0].size(); i++)
240 name += (m_chainNames[0][i]+"::"+m_types[0][i]+"::"+m_keys[0][i]+" ");
241 return name;
242 }

Member Data Documentation

◆ m_analysis

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

Definition at line 986 of file T_AnalysisConfig.h.

◆ m_analysisInstanceName

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

Definition at line 965 of file T_AnalysisConfig.h.

◆ m_associator

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

Definition at line 985 of file T_AnalysisConfig.h.

◆ m_beamX

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

Definition at line 990 of file T_AnalysisConfig.h.

◆ m_beamY

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

Definition at line 990 of file T_AnalysisConfig.h.

◆ m_beamZ

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

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

◆ m_filterOnRoi

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

Definition at line 1001 of file T_AnalysisConfig.h.

◆ m_filters

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

Definition at line 979 of file T_AnalysisConfig.h.

◆ m_genericFlag

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

Definition at line 992 of file T_AnalysisConfig.h.

◆ m_keepAllEvents

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

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

◆ m_mcTruth

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

Definition at line 988 of file T_AnalysisConfig.h.

◆ m_provider

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

Definition at line 957 of file T_AnalysisConfig.h.

◆ m_refChainKey

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

Definition at line 973 of file T_AnalysisConfig.h.

◆ m_refChainName

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

Definition at line 972 of file T_AnalysisConfig.h.

◆ m_releaseData

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

Definition at line 993 of file T_AnalysisConfig.h.

◆ m_requireDecision

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

Definition at line 1003 of file T_AnalysisConfig.h.

◆ m_selectorRef

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

Definition at line 981 of file T_AnalysisConfig.h.

◆ m_selectorSel

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

Definition at line 983 of file T_AnalysisConfig.h.

◆ m_selectorTest

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

Definition at line 982 of file T_AnalysisConfig.h.

◆ m_tdt

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

Definition at line 959 of file T_AnalysisConfig.h.

◆ m_testChainKey

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

Definition at line 976 of file T_AnalysisConfig.h.

◆ m_testChainName

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

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

◆ m_useHighestPT

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

Definition at line 997 of file T_AnalysisConfig.h.

◆ m_vtxIndex

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

Definition at line 999 of file T_AnalysisConfig.h.


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