ATLAS Offline Software
Loading...
Searching...
No Matches
AnalysisConfigMT_Ntuple Class Reference

#include <AnalysisConfigMT_Ntuple.h>

Inheritance diagram for AnalysisConfigMT_Ntuple:
Collaboration diagram for AnalysisConfigMT_Ntuple:

Public Member Functions

 AnalysisConfigMT_Ntuple (const std::vector< std::string > &chainNames, const std::string &outputFileName="TrkNtuple.root", double tauEtCutOffline=0.0, int TruthPdgId=0, bool keepAllEvents_=false, int parentTruthId=0)
virtual ~AnalysisConfigMT_Ntuple ()
void set_fiducial_radius (double d)
void set_ptmin (double d)
size_t get_jets (Trig::FeatureContainer::combination_const_iterator citr, std::vector< TrackTrigObject > &objects, const std::string &key="")
 retrieve the jets from the Roi
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 (AthReentrantAlgorithm *p, ToolHandle< Trig::TrigDecisionTool > *tdt)
virtual void execute ()
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 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 ()
virtual void book ()
 setup the analysis the analysis, retrieve the tools etc
virtual void finalize ()
 finalise the analysis - take ratios for efficiencies etc
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 selectTracks (TrigTrackSelector *selector, const ElementLink< TrigRoiDescriptorCollection > &roi_link, const std::string &key="")
StatusCode retrieve (Collection const *&collection, const std::string &key="")
bool selectTracksNotEmpty (TrigTrackSelector *selector, const std::string &key)
std::vector< double > getBeamspot (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

bool m_useBeamCondSvc
TIDA::Event * m_event
TFile * m_File
TTree * m_Tree
TDirectory * m_Dir
std::vector< ChainString > m_chainNames
bool m_doOffline
bool m_doVertices
bool m_doMuons
bool m_doMuonsSP
std::vector< std::string > m_muonType
std::vector< bool > m_muonIsLRT
std::vector< std::string > m_electronType
std::vector< std::string > m_rawElectrons
std::vector< bool > m_electronIsLRT
std::vector< std::string > m_tauType
std::vector< std::string > m_tauProngs
std::vector< std::string > m_vertexType
bool m_doBjets
bool m_hasTruthMap
bool m_tauEtCutOffline
std::string m_outputFileName
int m_TruthPdgId
bool m_finalised
bool m_printInfo
int m_parentTruthPdgId
AthReentrantAlgorithm * m_provider
ToolHandle< Trig::TrigDecisionTool > * m_tdt
std::string m_analysisInstanceName
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

Private Member Functions

std::set< std::string > get_configured_chains ()

Private Attributes

double m_fiducial_radius
double m_ptmin

Detailed Description

Definition at line 24 of file AnalysisConfigMT_Ntuple.h.

Constructor & Destructor Documentation

◆ AnalysisConfigMT_Ntuple()

AnalysisConfigMT_Ntuple::AnalysisConfigMT_Ntuple ( const std::vector< std::string > & chainNames,
const std::string & outputFileName = "TrkNtuple.root",
double tauEtCutOffline = 0.0,
int TruthPdgId = 0,
bool keepAllEvents_ = false,
int parentTruthId = 0 )
inline

Definition at line 35 of file AnalysisConfigMT_Ntuple.h.

36 :
37 AnalysisConfig_Ntuple( chainNames, outputFileName, tauEtCutOffline, TruthPdgId, keepAllEvents_ , parentTruthId),
39 m_ptmin(1000)
40 { }
static const std::string outputFileName
AnalysisConfig_Ntuple(const std::vector< std::string > &chainNames, const std::string &outputFileName="TrkNtuple.root", double tauEtCutOffline=0.0, int TruthPdgId=0, bool keepAllEvents=false, int parentTruthPdgId=0)

◆ ~AnalysisConfigMT_Ntuple()

virtual AnalysisConfigMT_Ntuple::~AnalysisConfigMT_Ntuple ( )
inlinevirtual

Definition at line 42 of file AnalysisConfigMT_Ntuple.h.

42{ }

Member Function Documentation

◆ addReferenceChain()

void T_AnalysisConfig< AthReentrantAlgorithm >::addReferenceChain ( const std::string & chainName,
const std::string & type,
const std::string & key )
inlineinherited

Definition at line 157 of file T_AnalysisConfig.h.

157 {
158 m_chainNames[1].push_back(chainName); m_types[1].push_back(type); m_keys[1].push_back(key);
159 }
std::vector< std::vector< std::string > > m_chainNames
std::vector< std::vector< std::string > > m_types
std::vector< std::vector< std::string > > m_keys

◆ addReferenceFilter()

void T_AnalysisConfig< AthReentrantAlgorithm >::addReferenceFilter ( TrackFilter * filter)
inlineinherited

Definition at line 166 of file T_AnalysisConfig.h.

166{ m_filters[1].push_back(filter); }
std::vector< std::vector< TrackFilter * > > m_filters

◆ addSelectionChain()

void T_AnalysisConfig< AthReentrantAlgorithm >::addSelectionChain ( const std::string & chainName,
const std::string & type,
const std::string & key )
inlineinherited

Definition at line 161 of file T_AnalysisConfig.h.

161 {
162 m_chainNames[2].push_back(chainName); m_types[2].push_back(type); m_keys[2].push_back(key);
163 }

◆ addSelectionFilter()

void T_AnalysisConfig< AthReentrantAlgorithm >::addSelectionFilter ( TrackFilter * filter)
inlineinherited

Definition at line 167 of file T_AnalysisConfig.h.

167{ m_filters[2].push_back(filter); }

◆ addTestChain()

void T_AnalysisConfig< AthReentrantAlgorithm >::addTestChain ( const std::string & chainName,
const std::string & type,
const std::string & key )
inlineinherited

Definition at line 153 of file T_AnalysisConfig.h.

153 {
154 m_chainNames[0].push_back(chainName); m_types[0].push_back(type); m_keys[0].push_back(key);
155 }

◆ addTestFilter()

void T_AnalysisConfig< AthReentrantAlgorithm >::addTestFilter ( TrackFilter * filter)
inlineinherited

Definition at line 165 of file T_AnalysisConfig.h.

165{ m_filters[0].push_back(filter); }

◆ analysis()

const TrackAnalysis * T_AnalysisConfig< AthReentrantAlgorithm >::analysis ( ) const
inlineinherited

Definition at line 212 of file T_AnalysisConfig.h.

◆ beamX()

double T_AnalysisConfig< AthReentrantAlgorithm >::beamX ( ) const
inlineinherited

Definition at line 220 of file T_AnalysisConfig.h.

◆ beamY()

double T_AnalysisConfig< AthReentrantAlgorithm >::beamY ( ) const
inlineinherited

Definition at line 221 of file T_AnalysisConfig.h.

◆ beamZ()

double T_AnalysisConfig< AthReentrantAlgorithm >::beamZ ( ) const
inlineinherited

Definition at line 222 of file T_AnalysisConfig.h.

◆ book()

void AnalysisConfig_Ntuple::book ( )
protectedvirtualinherited

setup the analysis the analysis, retrieve the tools etc

flag should be called m_fileIsNotOpen really, so is if m_fileIsNotOpen open file, if !m_fileIsNotOpen, then close file etc

save the current directory so we can return there after

create a brand new ntple

update the ntple from the file

go back to original directory

Reimplemented from T_AnalysisConfig< AthReentrantAlgorithm >.

Definition at line 161 of file AnalysisConfig_Ntuple.cxx.

161 {
162
163 m_provider->msg(MSG::INFO) << "AnalysisConfig_Ntuple::book() name " << name() << endmsg;
164
168 if ( !m_finalised ) {
169 m_provider->msg(MSG::INFO) << "AnalysisConfig_Ntuple::book() not booking " << name() << endmsg;
170 return;
171 }
172
173
174
175 // get the TriggerDecisionTool
176
177 if( m_tdt->retrieve().isFailure() ) {
178 m_provider->msg(MSG::FATAL) << " Unable to retrieve the TrigDecisionTool: Please check job options file" << endmsg;
179 // return StatusCode::FAILURE;
180 return;
181 }
182
183 m_provider->msg(MSG::INFO) << "␛[91;1m" << " Successfully retrieved the TrigDecisionTool" << "␛[m" << endmsg;
184 m_provider->msg(MSG::INFO) << "␛[91;1m" << " booking ntuple" << "␛[m" << endmsg;
185 m_provider->msg(MSG::INFO) << "␛[91;1m" << " trying to create new ntple file" << "␛[m" << endmsg;
186
188 TDirectory* dir = gDirectory;
189
190 static std::atomic<bool> first_open = true;
191
192 std::string outputFileName = m_outputFileName;
193
194 if ( genericFlag() ) {
195 static std::atomic<int> file_index = 0;
196 std::string::size_type pos = outputFileName.find(".root");
197 if ( pos != std::string::npos ) outputFileName.erase(pos, outputFileName.size());
198 char file_label[64];
199 sprintf( file_label, "-%04d.root", file_index++ );
200 outputFileName += file_label;
201 }
202
203 m_provider->msg(MSG::INFO) << "book() Writing to file " << outputFileName << endmsg;
204
205 if ( first_open || genericFlag() ) {
207 m_File = new TFile( outputFileName.c_str(), "recreate");
208
209 TTree* dataTree = new TTree("dataTree", "dataTree");
210 TString releaseData(m_releaseData.c_str());
211 dataTree->Branch( "ReleaseMetaData", "TString", &releaseData);
212 dataTree->Fill();
213 dataTree->Write("", TObject::kOverwrite);
214 delete dataTree;
215
216
217 m_Tree = new TTree("tree", "tree");
218 m_Tree->Branch( "TIDA::Event", "TIDA::Event", m_event, 6400, 1 );
219
220
221 }
222 else {
224 m_File = new TFile( outputFileName.c_str(), "update");
225 m_Tree = (TTree *)m_File->Get("tree");
226 m_Tree->SetBranchAddress( "TIDA::Event", &m_event );
227 }
228
230
231 first_open = false;
232
233
234 m_provider->msg(MSG::DEBUG) << "change directory " << name() << " " << dir->GetName() << endmsg;
235
236 // std::cout << "change directory " << name() << " " << dir->GetName() << std::endl;
238 dir->cd();
239
240 // gDirectory->pwd();
241
242 m_finalised = false; // flag we have an open file that is not yet finalised
243
244 m_provider->msg(MSG::INFO) << "AnalysisConfig_Ntuple::book() exiting" << endmsg;
245
246}
#define endmsg
ToolHandle< Trig::TrigDecisionTool > * m_tdt

◆ execute()

virtual void T_AnalysisConfig< AthReentrantAlgorithm >::execute ( )
inlinevirtualinherited

Definition at line 179 of file T_AnalysisConfig.h.

179 {
180 if ( !m_provider ) std::cerr << "ERROR T_AnalysisConfig::execute() called without initialising" << std::endl;
181 loop();
182 }

◆ filterOnRoi()

bool T_AnalysisConfig< AthReentrantAlgorithm >::filterOnRoi ( ) const
inlineinherited

Definition at line 238 of file T_AnalysisConfig.h.

◆ finalize()

void AnalysisConfig_Ntuple::finalize ( )
protectedvirtualinherited

finalise the analysis - take ratios for efficiencies etc

NB: flag this round the other way for multiple files

flag that we have finalised and closed this file

Reimplemented from T_AnalysisConfig< AthReentrantAlgorithm >.

Definition at line 252 of file AnalysisConfig_Ntuple.cxx.

252 {
253
254 // gDirectory->pwd();
255
256
258 if ( m_finalised ) {
259 m_provider->msg(MSG::INFO) << "AnalysisConfig_Ntuple::finalise() flagged, not finalising " << m_provider->name() << "\t" << m_Tree->GetEntries() << " entries" << endmsg;
260 return;
261 }
262
263 m_provider->msg(MSG::INFO) << "AnalysisConfig_Ntuple::finalise() writing " << m_provider->name() << "\t" << m_Tree->GetEntries() << " entries" << endmsg;
264
265 TDirectory* directory = gDirectory;
266
267 // std::cout << "change directory " << name() << " " << m_Dir->GetName() << std::endl;
268
269 m_provider->msg(MSG::DEBUG) << "change directory " << name() << " " << m_Dir->GetName() << endmsg;
270
271
272 m_Dir->cd();
273
274 // gDirectory->pwd();
275
276 m_Tree->Write("", TObject::kOverwrite);
277
278 // m_File->Write();
279 if ( m_File ) m_File->Close();
280
281
282 m_finalised = true;
283
284 // m_Tree "belongs" to the m_File so was (possibly) deleted on the m_File->Close();
285 // so don't delete it !
286 // delete m_Tree;
287 delete m_File;
288
289 m_Tree = 0;
290 m_File = 0;
291
292 // f.Write();
293 // f.Close();
294
295 // std::cout << "change directory " << name() << " " << directory->GetName() << std::endl;
296
297 directory->cd();
298
299 // gDirectory->pwd();
300
301}
str directory
Definition DeMoScan.py:78

◆ genericFlag()

bool T_AnalysisConfig< AthReentrantAlgorithm >::genericFlag ( ) const
inlineinherited

Definition at line 224 of file T_AnalysisConfig.h.

◆ get_configured_chains()

std::set< std::string > AnalysisConfigMT_Ntuple::get_configured_chains ( )
private

handle wildcard chain selection - but only the first time

get chain

get matching chains

replace wildcard with actual matching chains ...

if this has a cosmic chain, set the fiducial radius to be very large to allow the production vertex of the cosmic to be included

Definition at line 43 of file AnalysisConfigMT_Ntuple.cxx.

43 {
44 std::set<std::string> chains;
45 const std::vector<std::string> configuredChains = (*m_tdt)->getListOfTriggers("L2_.*, EF_.*, HLT_.*");
46
47 if (m_provider->msg().level() <= MSG::VERBOSE) {
48 m_provider->msg(MSG::VERBOSE) << "␛[91;1m" << configuredChains.size() << " Configured Chains" << "␛[m" << endmsg;
49 }
50
51 for ( unsigned i=0 ; i<configuredChains.size() ; i++ ) {
52 if (m_provider->msg().level() <= MSG::VERBOSE) {
53 m_provider->msg(MSG::VERBOSE) << "␛[91;1m" << "Chain " << configuredChains[i] << " (ACN)␛[m" << endmsg;
54 }
55 chains.insert( configuredChains[i] );
56 }
57
58 std::vector<ChainString> chainNames;
59 std::vector<ChainString>::iterator chainitr = m_chainNames.begin();
60
62 while ( chainitr!=m_chainNames.end() ) {
63
65 ChainString& chainName = (*chainitr);
66
68
69 std::vector<std::string> selectChains;
70 selectChains.clear();
71 if ( chainitr->head()=="" ) selectChains.push_back("");
72 else selectChains = (*m_tdt)->getListOfTriggers( chainName.head() );
73
74 for ( unsigned iselected=0 ; iselected<selectChains.size() ; iselected++ ) {
75
76 selectChains[iselected] = chainName.subs( selectChains[iselected] );
77
79 chainNames.push_back( ChainString(selectChains[iselected]) );
80
81 m_provider->msg(MSG::INFO) << "␛[91;1m" << "Matching chain " << selectChains[iselected] << "␛[m" << endmsg;
82
85 if ( selectChains[iselected].find("cosmic")!=std::string::npos ) m_fiducial_radius = 1e10;
86
87 }
88
89 ++chainitr;
90 }
91
92 m_chainNames = chainNames;
93 return chains;
94}
#define endmsg
std::vector< ChainString > m_chainNames
std::string subs(std::string s) const
const std::string & head() const
Definition ChainString.h:33
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:140

◆ get_jets()

size_t AnalysisConfig_Ntuple::get_jets ( Trig::FeatureContainer::combination_const_iterator citr,
std::vector< TrackTrigObject > & objects,
const std::string & key = "" )
inherited

retrieve the jets from the Roi

Definition at line 107 of file AnalysisConfig_Ntuple.cxx.

108 {
109
110 objects.clear();
111
112 const std::vector< Trig::Feature<xAOD::JetContainer> > jetfeatures = citr->get<xAOD::JetContainer>( key, TrigDefs::alsoDeactivateTEs );
113
114 if ( jetfeatures.empty() ) return 0;
115
116 for ( size_t ifeature=0 ; ifeature<jetfeatures.size() ; ifeature++ ) {
117 Trig::Feature<xAOD::JetContainer> jetfeature = jetfeatures.at(ifeature);
118
119 if ( jetfeature.empty() ) continue;
120
121 const xAOD::JetContainer* jets = jetfeature.cptr();
122
123 if ( jets == 0 ) continue;
124
126
127 for ( ; jitr!=jets->end() ; ++jitr ) {
128
129 const xAOD::Jet* ajet = (*jitr);
130
131 long unsigned jetid = (unsigned long)ajet;
132
133 TrackTrigObject jet = TrackTrigObject( ajet->eta(), ajet->phi(), ajet->pt(), 0, ajet->type(), jetid );
134
135 objects.push_back( jet );
136
137 }
138 }
139
140 return objects.size();
141
142}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:861
const T * cptr() const
explicit conversion to object
Definition Feature.h:171
bool empty() const
test method to check if the object is truly there
Definition Feature.h:197
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition Jet_v1.cxx:54
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
Definition Jet_v1.cxx:85
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".

◆ getBeamspot()

std::vector< double > T_AnalysisConfig< AthReentrantAlgorithm >::getBeamspot ( const std::string & key)
inlineprotectedinherited

Definition at line 585 of file T_AnalysisConfig.h.

585 {
586 const Collection* collection = 0;
588
589 if ( key!="" ) {
590 if ( m_provider->evtStore()->template contains<Collection>( key ) ) {
592 if( sc.isSuccess() && collection ) {
593 m_provider->msg(MSG::DEBUG) << "SG Collection->size() " << collection->size() << " (" << key << ")" << endmsg;
594
597 if ( trackitr!=trackend ) {
598 v.resize(3);
599 v[0] = (*trackitr)->vx();
600 v[1] = (*trackitr)->vy();
601 v[2] = (*trackitr)->vz();
602 return v;
603 } // only need to look at the first track
604 }
605 }
606 }
607 return v;
608 }
StatusCode retrieve(Collection const *&collection, const std::string &key="")

◆ getCollection()

std::pair< typename Collection::const_iterator, typename Collection::const_iterator > T_AnalysisConfig< AthReentrantAlgorithm >::getCollection ( const ElementLink< TrigRoiDescriptorCollection > & roi_link,
const std::string & key = "" )
inlineprotectedinherited

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.

254 {
255
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()

bool T_AnalysisConfig< AthReentrantAlgorithm >::getUseHighestPT ( ) const
inlineinherited

Definition at line 233 of file T_AnalysisConfig.h.

◆ getVtxIndex()

int T_AnalysisConfig< AthReentrantAlgorithm >::getVtxIndex ( ) const
inlineinherited

Definition at line 236 of file T_AnalysisConfig.h.

◆ initialize()

virtual void T_AnalysisConfig< AthReentrantAlgorithm >::initialize ( AthReentrantAlgorithm * p,
ToolHandle< Trig::TrigDecisionTool > * tdt )
inlinevirtualinherited

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()

void T_AnalysisConfig< AthReentrantAlgorithm >::keepAllEvents ( bool b)
inlineinherited

◆ loop()

void AnalysisConfigMT_Ntuple::loop ( )
protectedvirtual

list the configured chains once

FIXME: should really have hardcoded limits encoded as const variables

use wide |eta|<5 range to allow for ITk studies also

check whether the chains have actually run, otherwise there's no point doing anything

bomb out if no chains passed and not told to keep all events

finished loop over chains

bomb out if no chains passed and not told to keep all events and found no offline objects

for Monte Carlo get the truth particles if requested to do so

AOD

anything else?

anything else?

anything else?

get (offline) reference tracks

get offline tracks

get the offline vertices into our structure

add offline Vertices to the Offline chain

add the truth particles if needed

offline object counters // std::vector<TrackTrigObject> tidaVertexTracks;

now add the offline tracks

navigate through the requested storegate TEST chains

keep this printout here, but commented for usefull debug purposes ...

get the chain, collection and TE names and track index

here we only want collections with no specified chain name, then we look in storegate for the collections directly

now retrieve any verttices for the analysis

MT Vertex access

new electron selection

hmm, if we stored the types as a map it would be more straightforward than having to stick all this in a loop

get muons

get muons

new tau selection

hmm, if we stored the types as a map it would be more straightforward than having to stick all this in a loop

use same threshold for 1 and 3 prong ??

only add a tau collection if there are actually the relevant tausCH

get the chain name

and the name of the collection (if any)

now decide whether we want all the TEs for this chain, or just those that are still active

if the chain did not pass, skip this chain completely

new MT TDT feature access

a hack to fetch back the Rois with "_probe" in the name if the standard named RoiDescriptors are not actually present for this chain ...

count of how many rois processed so far

if no rois for this chain then move along

create the analysis chain

I really, really hate range based loops ...

don't extract any additional rois if a superRoi is requested: In this case, the superRoi would be shared between the different chains

check this is not a spurious TDT match

get the tracks

useful diagnostic - leave in place ... m_provider->msg(MSG::INFO) << "TIDARoi " << *roi_tmp << "\tcollectionName: " << collectionName << endmsg;

this should never be the case, and we should only run this bit of code once the first time round the loop anyhow

fetch vertices if available ...

MT Vertex access

Reimplemented from AnalysisConfig_Ntuple.

Definition at line 97 of file AnalysisConfigMT_Ntuple.cxx.

97 {
98
99#ifdef USE_DATE_TIME_STAMP
100 m_provider->msg(MSG::DEBUG) << "␛[91;1m" << "AnalysisConfigMT_Ntuple::loop() for " << m_analysisInstanceName
101 << " compiled " << __DATE__ << " " << __TIME__ << "\t: " << date() << "␛[m" << endmsg;
102#endif
103
104 bool foundOffline = false;
105
106 // get (offline) beam position
107 double xbeam = 0;
108 double ybeam = 0;
109 double zbeam = 0;
110 std::vector<double> beamline;
111
112
113 // get (online) beam position
114 double xbeam_online = 0;
115 double ybeam_online = 0;
116 double zbeam_online = 0;
117
118 std::vector<double> beamline_online;
119
120 // m_provider->msg(MSG::INFO) << " offline beam position\tx=" << xbeam << "\ty=" << ybeam << "\tz=" << zbeam << endmsg;
121 // m_provider->msg(MSG::INFO) << " online beam position\tx=" << xbeam_online << "\ty=" << ybeam_online << "\tz=" << zbeam_online << endmsg;
122
124 static const std::set<std::string> configuredHLTChains = get_configured_chains();
125
126 Filter_AcceptAll filter;
129 Filter_etaPT filterRef(5,500);
131 Filter_etaPT filter_etaPT(5.0,m_ptmin);
132 Filter_pdgIdpTeta filter_pdgIdpTeta(m_TruthPdgId,5.0,m_ptmin); // |eta|<5, pt>m_ptmin
133
134 TrackFilter* truthFilter = &filter_etaPT;
135
136 TrigTrackSelector selectorTruth( truthFilter, m_fiducial_radius, m_TruthPdgId, m_parentTruthPdgId);
137
138 TrigTrackSelector selectorRef( &filter_etaPT );
139 TrigTrackSelector selectorTest( &filter );
140
141 TIDAVertexBuilder vertexBuilder;
142
143 if ( xbeam!=0 || ybeam!=0 ) {
144 selectorTruth.setBeamline( xbeam, ybeam, zbeam );
145 selectorRef.setBeamline( xbeam, ybeam, zbeam );
146 }
147
148 if ( xbeam_online!=0 || ybeam_online!=0 ) {
149 selectorTest.setBeamline( xbeam_online, ybeam_online, zbeam_online );
150 }
151
152 selectorTruth.correctTracks( true );
153 selectorRef.correctTracks( true );
154 selectorTest.correctTracks( true );
155
156
157 // clear the ntuple TIDA::Event class
158 m_event->clear();
159
160 const xAOD::EventInfo* pEventInfo = 0;
161
162 unsigned run_number = 0;
163 unsigned long long event_number = 0;
164 unsigned lumi_block = 0;
165 unsigned bunch_crossing_id = 0;
166 unsigned time_stamp = 0;
167 double mu_val = 0;
168
169 if ( retrieve(pEventInfo, "EventInfo").isFailure() ) {
170 m_provider->msg(MSG::DEBUG) << "Failed to get EventInfo " << endmsg;
171 }
172 else {
173 run_number = pEventInfo->runNumber();
174 event_number = pEventInfo->eventNumber();
175 lumi_block = pEventInfo->lumiBlock();
176 time_stamp = pEventInfo->timeStamp();
177 bunch_crossing_id = pEventInfo->bcid();
178 mu_val = pEventInfo->averageInteractionsPerCrossing();
179 }
180
181 m_provider->msg(MSG::DEBUG) << "run " << run_number
182 << "\tevent " << event_number
183 << "\tlb " << lumi_block << endmsg;
184
185 m_event->run_number(run_number);
186 m_event->event_number(event_number);
187 m_event->lumi_block(lumi_block);
188 m_event->time_stamp(time_stamp);
189 m_event->bunch_crossing_id(bunch_crossing_id);
190 m_event->mu(mu_val);
191
192 // build a chain group on the fly and use the reference
193 const Trig::ChainGroup* L2chain=(*m_tdt)->getChainGroup("L2_.*");
194 const Trig::ChainGroup* EFchain=(*m_tdt)->getChainGroup("EF_.*");
195 const Trig::ChainGroup* HLTchain=(*m_tdt)->getChainGroup("HLT_.*");
196
197 m_provider->msg(MSG::DEBUG) << "␛[91;1m"
198 << "L2 pass " << L2chain->isPassed() << "\t"
199 << "EF pass " << EFchain->isPassed() << "\t"
200 << "HLT pass " << HLTchain->isPassed() << "␛[m"
201 << endmsg;
202
205
206 bool analyse = false;
207
208 unsigned decisiontype = TrigDefs::Physics;
209
211
212 int passed_chains = 0;
213
214 m_provider->msg(MSG::DEBUG) << "Checking " << m_chainNames.size() << " chains" << endmsg;
215
216 if ( m_chainNames.empty() ) {
217 m_provider->msg(MSG::WARNING) << "No chains to check" << endmsg;
218 return;
219 }
220
221 for ( unsigned ichain=0 ; ichain<m_chainNames.size() ; ichain++ ) {
222
223 std::string chainName = m_chainNames[ichain].head();
224
225 // Only for trigger chains
226
227 if (chainName.find("L2") == std::string::npos &&
228 chainName.find("EF") == std::string::npos &&
229 chainName.find("HLT") == std::string::npos ) continue;
230
231 if ( configuredHLTChains.find(chainName)==configuredHLTChains.end() ) {
232 m_provider->msg(MSG::WARNING) << "␛[91;1m" << "Chain " << chainName
233 << " is not configured for this event" << "␛[m"
234 << endmsg;
235 continue;
236 }
237
238 if ( m_chainNames[ichain].passed() ) decisiontype = TrigDefs::Physics;
239 else decisiontype = TrigDefs::includeFailedDecisions;
240
241 std::string roistring = "";
242 if ( m_chainNames[ichain].roi()!="" ) roistring += "\troi " + m_chainNames[ichain].roi();
243
244 bool passPhysics = (*m_tdt)->isPassed(chainName);
245
246 m_provider->msg(MSG::DEBUG) << "Chain " << chainName << "\troi " << roistring
247 << "\tpres " << (*m_tdt)->getPrescale(chainName)
248 << ( passPhysics ? "␛[91;1m" : "" ) << "\tpass physics " << passPhysics << ( passPhysics ? "␛[m" : "" )
249 << "\t: ( pass " << (*m_tdt)->isPassed(chainName, decisiontype ) << "\tdec type " << decisiontype << " ) " << endmsg;
250
251 if ( (*m_tdt)->isPassed(chainName, decisiontype ) || !m_chainNames[ichain].passed() ) {
252 analyse = true;
253 passed_chains++;
254 }
255
256 }
257
258
259
262 if ( !analyse && !m_keepAllEvents && !foundOffline ) {
263 m_provider->msg(MSG::DEBUG) << "No chains passed unprescaled - not processing this event: " << run_number << " " << event_number << " " << lumi_block << endmsg;
264 return;
265 }
266
267
268 m_provider->msg(MSG::DEBUG) << "Chains passed " << passed_chains << endmsg;
269
270
272
273 // const TruthParticleContainer* mcpartTES = 0;
274
275 selectorTruth.clear();
276
277 m_provider->msg(MSG::DEBUG) << "MC Truth flag " << m_mcTruth << endmsg;
278
279 if ( m_mcTruth) {
280 m_provider->msg(MSG::DEBUG) << "getting Truth" << endmsg;
281
282 if (m_provider->evtStore()->contains<TruthParticleContainer>("INav4MomTruthEvent")) {
283 //ESD
284 selectTracks<TruthParticleContainer>( &selectorTruth, "INav4MomTruthEvent" );
285 }
286 else if (m_provider->evtStore()->contains<TruthParticleContainer>("SpclMC")) {
288 selectTracks<TruthParticleContainer>( &selectorTruth, "SpclMC");
289 }
290 else if (m_provider->evtStore()->contains<TruthParticleContainer>("")) {
292 selectTracks<TruthParticleContainer>( &selectorTruth, "");
293 }
294 else if (m_provider->evtStore()->contains<xAOD::TruthParticleContainer>("TruthParticles")) {
296 selectTracks<xAOD::TruthParticleContainer>( &selectorTruth, "TruthParticles" );
297 }
298 else if (m_provider->evtStore()->contains<xAOD::TruthParticleContainer>("")) {
300 selectTracks<xAOD::TruthParticleContainer>( &selectorTruth, "" );
301 }
302 else {
303 m_provider->msg(MSG::WARNING) << "Truth not found - none whatsoever!" << endmsg;
304 }
305 }
306
307
308 // clear the ntuple TIDA::Event class
309 m_event->clear();
310
312
314
315 m_provider->msg(MSG::DEBUG) << " Offline tracks " << endmsg;
316
317 selectorRef.clear();
318
319 if (m_provider->evtStore()->contains<xAOD::TrackParticleContainer>("InDetTrackParticles")) {
320 selectTracks<xAOD::TrackParticleContainer>( &selectorRef, "InDetTrackParticles" );
321 }
322 else {
323 m_provider->msg(MSG::WARNING) << " Offline tracks not found " << endmsg;
324 }
325
326
328 for ( size_t iv=0; iv<m_vertexType.size(); iv++ ) {
329
330 std::vector<TIDA::Vertex> vertices;
331
332 std::string vertexType = "PrimaryVertices";
333 std::string vertexChainname = "Vertex";
334 if ( m_vertexType[iv]!="" ) {
336 vertexChainname += ":" + vertexType;
337 }
338
339 m_provider->msg(MSG::VERBOSE) << "fetching offline AOD vertex container with key " << vertexType << endmsg;
340
341 const xAOD::VertexContainer* xaodVtxCollection = 0;
342
343 if ( retrieve( xaodVtxCollection, vertexType ).isFailure()) {
344 if (m_provider->msg().level() <= MSG::WARNING) m_provider->msg(MSG::WARNING) << "xAOD vertex container not found with key " << vertexType << endmsg;
345 }
346
347 if ( xaodVtxCollection!=0 ) {
348
349 m_provider->msg(MSG::DEBUG) << "xAOD vertex container " << vertexType << " found with " << xaodVtxCollection->size() << " entries" << endmsg;
350
351 // Vertex types in some secondary vertex collections are not properly set and are all 0,
352 // allow these vertices if primary vertices are not used
353 if ( vertexType.find("SecVtx") != std::string::npos ) {
354 vertices = vertexBuilder.select( xaodVtxCollection, &selectorRef.tracks(), true );
355 }
356 else {
357 vertices = vertexBuilder.select( xaodVtxCollection, &selectorRef.tracks() );
358 }
359 }
360
361 // now add the offline vertices
362 if ( m_doOffline || m_doVertices ) {
363 m_event->addChain( vertexChainname );
364 m_event->back().addRoi(TIDARoiDescriptor(true));
365 m_event->back().back().addVertices( vertices );
366 }
367 }
368
370
372
373 if ( m_mcTruth ) {
374 m_event->addChain( "Truth" );
375 m_event->back().addRoi(TIDARoiDescriptor(true));
376 m_event->back().back().addTracks(selectorTruth.tracks());
377 }
378
379#if 0
381 for ( unsigned i=0 ; i<vertices.size() ; i++ ) {
382 m_provider->msg(MSG::DEBUG) << "vertex " << i << " " << vertices[i] << endmsg;
383 m_event->addVertex(vertices[i]);
384 }
385#endif
386
388
389 int Noff = 0;
390 int Nmu = 0;
391 int Nel = 0;
392 int Ntau = 0;
393
395
396 if ( m_doOffline ) {
397
398 m_event->addChain( "Offline" );
399 m_event->back().addRoi(TIDARoiDescriptor(true));
400 m_event->back().back().addTracks(selectorRef.tracks());
401
402 if ( selectorRef.getBeamX()!=0 || selectorRef.getBeamY()!=0 || selectorRef.getBeamZ()!=0 ) {
403 std::vector<double> beamline_;
404 beamline_.push_back( selectorRef.getBeamX() );
405 beamline_.push_back( selectorRef.getBeamY() );
406 beamline_.push_back( selectorRef.getBeamZ() );
407 m_event->back().back().addUserData(beamline_);
408 }
409
410
411 Noff = selectorRef.tracks().size();
412
413 m_provider->msg(MSG::DEBUG) << "ref tracks.size() " << selectorRef.tracks().size() << endmsg;
414 for ( int ii=selectorRef.tracks().size() ; ii-- ; ) m_provider->msg(MSG::DEBUG) << " ref track " << ii << " " << *selectorRef.tracks()[ii] << endmsg;
415
416 }
417
419 for ( unsigned ichain=0 ; ichain<m_chainNames.size() ; ichain++ ) {
420
422 // m_provider->msg(MSG::INFO)<< "chain:\t" << m_chainNames[ichain] << endmsg;
423
425 std::string chainname = m_chainNames[ichain].head();
426 std::string collectionname = m_chainNames[ichain].tail();
427 std::string vtx_name = m_chainNames[ichain].vtx();
428
429
430 if ( chainname!="" ) continue;
431 if ( collectionname=="" ) continue;
432
433 chainname = collectionname;
434 if ( vtx_name!="" ) chainname += ":" + vtx_name;
435
436 // useful debug information - leave this here
437
440
441 selectorTest.clear();
442
443 bool found = false;
444
445 std::string collection_test = collectionname;
446 size_t pos = collectionname.find("/");
447 if ( pos!=std::string::npos ) collection_test = collectionname.substr( pos+1, collectionname.size()-pos );
448
449 if (m_provider->evtStore()->contains<xAOD::TrackParticleContainer>(collection_test)) {
450 found = selectTracks<xAOD::TrackParticleContainer>( &selectorTest, collectionname );
451 }
452 else if (m_provider->evtStore()->contains<TrackCollection>(collection_test)) {
453 found = selectTracks<TrackCollection>( &selectorTest, collectionname );
454 }
455 else {
456 m_provider->msg(MSG::WARNING) << "\tcollection " << collectionname << " not found" << endmsg;
457 }
458
459
461
462 std::vector<TIDA::Vertex> tidavertices;
463
464 m_provider->msg(MSG::DEBUG) << "\tFetch xAOD::VertexContainer with key " << vtx_name << endmsg;
465
466 if ( vtx_name!="" ) {
467
468 m_provider->msg(MSG::DEBUG) << "\tFetch xAOD::VertexContainer with key " << vtx_name << endmsg;
469
471
472 const xAOD::VertexContainer* xaodVtxCollection = 0;
473
474 if ( retrieve( xaodVtxCollection, vtx_name ).isFailure() ) {
475 if (m_provider->msg().level() <= MSG::WARNING) m_provider->msg(MSG::WARNING) << "xAOD vertex container not found with key " << vtx_name << endmsg;
476 }
477
478 if ( xaodVtxCollection!=0 ) {
479
480 m_provider->msg(MSG::DEBUG) << "\txAOD::VertexContainer found with size " << xaodVtxCollection->size()
481 << "\t" << vtx_name << endmsg;
482
483 // Vertex types in some secondary vertex collections are not properly set and are all 0,
484 // allow these vertices if primary vertices are not used
485 if ( vtx_name.find("SecVtx") != std::string::npos ) {
486 tidavertices = vertexBuilder.select( xaodVtxCollection, 0, true );
487 }
488 else {
489 tidavertices = vertexBuilder.select( xaodVtxCollection );
490 }
491 }
492
493 }
494
495
496 if ( found ) {
497
498 m_event->addChain( chainname );
499 m_event->back().addRoi(TIDARoiDescriptor(true));
500 if ( vtx_name!="" ) m_event->back().back().addVertices( tidavertices );
501 m_event->back().back().addTracks(selectorTest.tracks());
502
503 if ( selectorTest.getBeamX()!=0 || selectorTest.getBeamY()!=0 || selectorTest.getBeamZ()!=0 ) {
504 std::vector<double> beamline_;
505 beamline_.push_back( selectorTest.getBeamX() );
506 beamline_.push_back( selectorTest.getBeamY() );
507 beamline_.push_back( selectorTest.getBeamZ() );
508 m_event->back().back().addUserData(beamline_);
509 }
510
511 int Ntest = selectorTest.tracks().size();
512
513 m_provider->msg(MSG::DEBUG) << "collection " << collectionname << "\ttest tracks.size() " << Ntest << endmsg;
514 for ( int ii=Ntest ; ii-- ; ) m_provider->msg(MSG::DEBUG) << " test track " << ii << " " << *selectorTest.tracks()[ii] << endmsg;
515 }
516 }
517
518
519 std::string ElectronRef[7] = {
520 "",
521 "TightCB", "MediumCB", "LooseCB",
522 "TightLH", "MediumLH", "LooseLH" };
523
524
526
527 for ( size_t ielec=0 ; ielec<m_electronType.size() ; ielec++ ) {
530
531 int itype = -1;
532 for ( int it=0 ; it<7 ; it++ ) if ( m_electronType[ielec]==ElectronRef[it] ) itype = it;
533 if ( itype<0 ) continue;
534
535 std::vector<TrackTrigObject> elevec;
536
537 std::string echain = std::string("Electrons");
538 if (m_electronIsLRT[ielec]) echain = std::string("LRTElectrons");
539
540 int Nel_ = processElectrons( selectorRef, &elevec, itype, ( m_rawElectrons[ielec]=="raw" ? true : false ), 0.0, echain );
541
542 if ( Nel_ < 1 ) continue;
543
544 Nel += Nel_;
545
546 if ( m_electronType[ielec]!="" ) echain += "_" + m_electronType[ielec];
547 if ( m_rawElectrons[ielec]=="raw" ) echain += "_raw";
548
549 m_event->addChain( echain );
550 m_event->back().addRoi(TIDARoiDescriptor(true));
551 m_event->back().back().addTracks(selectorRef.tracks());
552 m_event->back().back().addObjects( elevec );
553
554 if ( selectorRef.getBeamX()!=0 || selectorRef.getBeamY()!=0 || selectorRef.getBeamZ()!=0 ) {
555 std::vector<double> beamline_;
556 beamline_.push_back( selectorRef.getBeamX() );
557 beamline_.push_back( selectorRef.getBeamY() );
558 beamline_.push_back( selectorRef.getBeamZ() );
559 m_event->back().back().addUserData(beamline_);
560 }
561
562 }
563
564
565 std::string MuonRef[5] = { "", "Tight", "Medium", "Loose", "VeryLoose" };
566
568 for ( size_t imuon=0 ; imuon<m_muonType.size() ; imuon++ ) {
569
570 m_provider->msg(MSG::DEBUG) << "fetching offline muons " << endmsg;
571
572 int muonType = -1;
573 for ( int it=0 ; it<5 ; it++ ) if ( m_muonType[imuon] == MuonRef[it] ) muonType=it;
574 if ( muonType<0 ) continue;
575
576 std::string mchain = "Muons";
577 if (m_muonIsLRT[imuon]) mchain = "MuonsLRT";
578
579 int Nmu_ = processMuons( selectorRef, muonType, 0, mchain );
580
581 if ( Nmu_ < 1 ) continue;
582
583 Nmu += Nmu_;
584
585 m_provider->msg(MSG::DEBUG) << "found " << Nmu << " offline muons " << endmsg;
586
587 if ( m_muonType[imuon]!="" ) mchain += "_" + m_muonType[imuon];
588
589 m_event->addChain(mchain);
590 m_event->back().addRoi(TIDARoiDescriptor(true));
591 m_event->back().back().addTracks(selectorRef.tracks());
592
593 if ( selectorRef.getBeamX()!=0 || selectorRef.getBeamY()!=0 || selectorRef.getBeamZ()!=0 ) {
594 std::vector<double> beamline_;
595 beamline_.push_back( selectorRef.getBeamX() );
596 beamline_.push_back( selectorRef.getBeamY() );
597 beamline_.push_back( selectorRef.getBeamZ() );
598 m_event->back().back().addUserData(beamline_);
599 }
600
601 m_provider->msg(MSG::DEBUG) << "ref muon tracks.size() " << selectorRef.tracks().size() << endmsg;
602 for ( int ii=selectorRef.tracks().size() ; ii-- ; ) m_provider->msg(MSG::DEBUG) << " ref muon track " << ii << " " << *selectorRef.tracks()[ii] << endmsg;
603 }
604
605
607 if ( m_doMuonsSP ) {
608
609 m_provider->msg(MSG::DEBUG) << "fetching offline muons " << endmsg;
610
611 int muonType = 0;
612
613 Nmu += processMuons( selectorRef, muonType );
614
615 m_provider->msg(MSG::DEBUG) << "found " << Nmu << " offline muons " << endmsg;
616
617 m_event->addChain("MuonsSP");
618 m_event->back().addRoi(TIDARoiDescriptor(true));
619 m_event->back().back().addTracks(selectorRef.tracks());
620
621 m_provider->msg(MSG::DEBUG) << "ref muon tracks.size() " << selectorRef.tracks().size() << endmsg;
622 for ( int ii=selectorRef.tracks().size() ; ii-- ; ) m_provider->msg(MSG::DEBUG) << " ref muon track " << ii << " " << *selectorRef.tracks()[ii] << endmsg;
623 }
624
625
626
628 std::string TauRef[4] = { "", "Tight", "Medium", "Loose" };
629
630
631 for ( size_t itau=0 ; itau<m_tauType.size() ; itau++ ) {
634
635 int itype = -1;
636 for ( int it=0 ; it<4 ; it++ ) if ( m_tauType[itau]==TauRef[it] ) itype = it;
637 if ( itype<0 ) continue;
638
640 int requireNtracks = 0;
641 if ( m_tauProngs[itau]=="3Prong" ) requireNtracks = 3;
642 if ( m_tauProngs[itau]=="1Prong" ) requireNtracks = 1;
643
644 std::vector<TrackTrigObject> tauvec;
645
646 int Ntau_ = processTaus( selectorRef, &tauvec, itype, requireNtracks, 20000 );
647
648 Ntau += Ntau_;
649
650 if ( Ntau_ > 0 ) {
653
654 std::string tchain = std::string("Taus");
655 if ( m_tauType[itau] != "" ) tchain += "_" + m_tauType[itau];
656 if ( m_tauProngs[itau] != "" ) tchain += "_" + m_tauProngs[itau];
657
658 m_event->addChain( tchain );
659 m_event->back().addRoi(TIDARoiDescriptor(true));
660 m_event->back().back().addTracks(selectorRef.tracks());
661 m_event->back().back().addObjects( tauvec ) ;
662
663 if ( selectorRef.getBeamX()!=0 || selectorRef.getBeamY()!=0 || selectorRef.getBeamZ()!=0 ) {
664 std::vector<double> beamline_;
665 beamline_.push_back( selectorRef.getBeamX() );
666 beamline_.push_back( selectorRef.getBeamY() );
667 beamline_.push_back( selectorRef.getBeamZ() );
668 m_event->back().back().addUserData(beamline_);
669 }
670
671 }
672 }
673
674 if ( Nmu==0 && Noff==0 && Nel==0 && Ntau==0 ) m_provider->msg(MSG::DEBUG) << "No offline objects found " << endmsg;
675 else foundOffline = true;
676
677
678 // now loop over all relevant chains to get the trigger tracks...
679
680 for ( unsigned ichain=0 ; ichain<m_chainNames.size() ; ichain++ ) {
681
682 // create chains for ntpl
683
685 const std::string& chainName = m_chainNames[ichain].head();
686
688 const std::string& collectionName = m_chainNames[ichain].tail();
689
690 if( chainName.find("L2_")==std::string::npos &&
691 chainName.find("EF_")==std::string::npos &&
692 chainName.find("HLT_")==std::string::npos ) continue;
693
694 if ( m_chainNames[ichain].passed() ) decisiontype = TrigDefs::Physics;
695 else decisiontype = TrigDefs::includeFailedDecisions;
696
697
698 m_provider->msg(MSG::DEBUG) << "chain " << chainName
699 << "\tprescale " << (*m_tdt)->getPrescale(chainName)
700 << "\tpass " << (*m_tdt)->isPassed(chainName) << " physics "
701 << " (req dec " << (*m_tdt)->isPassed(chainName, decisiontype ) << " dec type " << decisiontype << ")"
702 << endmsg;
703
706
708 if ( !(*m_tdt)->isPassed( chainName, decisiontype ) ) continue;
709
711
712
713 std::string roi_key = m_chainNames[ichain].roi();
714 std::string vtx_name = m_chainNames[ichain].vtx();
715
716
717#if 0
722
723
724 if ( roi_name!="" ) {
725
726 std::string roi_name_tmp = roi_name;
727 std::string roi_tename = "";
728
729 if ( roi_name.find("/")!=std::string::npos ) {
730 roi_name_tmp = roi_name.substr( roi_name.find("/")+1, roi_name.size()-roi_name.find("/") );
731 roi_tename = roi_name.substr( 0, roi_name.find("/") );
732 }
733
734 roist = comb->get<TrigRoiDescriptor>( roi_name_tmp, decisiontype, roi_tename );
735
736 if ( roist.size()>0 ) {
737 for ( unsigned ir=0 ; ir<roist.size() ; ir++ ) m_provider->msg(MSG::DEBUG) << "\t\tRetrieved roi " << roi_name << "\t" << *roist[ir].cptr() << endmsg;
738 }
739 else {
740 m_provider->msg(MSG::WARNING) << "\t\tRequested roi " << roi_name << " not found" << endmsg;
741 }
742
743 }
744 else {
745 roist = comb->get<TrigRoiDescriptor>("forID1");
746 if ( roist.empty() ) roist = comb->get<TrigRoiDescriptor>("forID");
747 if ( roist.empty() ) roist = comb->get<TrigRoiDescriptor>("");
748 if ( roist.empty() ) roist = comb->get<TrigRoiDescriptor>("initialRoI");
749 }
750#endif
751
752
753 unsigned feature_type = TrigDefs::lastFeatureOfType;
754
755 if ( roi_key!="" ) feature_type = TrigDefs::allFeaturesOfType;
756
757 int leg = -1;
758
759 if ( m_chainNames[ichain].element()!="" ) {
760 leg = std::atoi(m_chainNames[ichain].element().c_str());
761 }
762
763
764 std::string rgex = roi_key;
765
766 std::vector< TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection> > rois =
767 (*m_tdt)->template features<TrigRoiDescriptorCollection>( Trig::FeatureRequestDescriptor( chainName,
768 decisiontype,
769 rgex,
770 feature_type,
771 "roi",
772 leg ) );
773
776 if ( rois.empty() ) {
777 if ( !rgex.empty() ) {
778 rgex += "_probe";
779 rois = (*m_tdt)->template features<TrigRoiDescriptorCollection>( Trig::FeatureRequestDescriptor( chainName,
780 decisiontype,
781 rgex,
782 feature_type,
783 "roi",
784 leg ) );
785 }
786 }
787
788 int iroi = 0;
789
791
792 if ( rois.size()==0 ) continue;
793
795
796 m_event->addChain( m_chainNames[ichain] );
797
798 TIDA::Chain& chain = m_event->back();
799
801 for ( const TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection>& roi_info : rois ) {
802
803 iroi++;
804
808
809 if ( roi_key=="SuperRoi" && iroi>1 ) continue;
810
811 if ( roi_key.find("JetSuper")!=std::string::npos && iroi>1 ) continue;
812
813 const ElementLink<TrigRoiDescriptorCollection> roi_link = roi_info.link;
814
816 if ( roi_key!="" && roi_link.dataID()!=rgex ) continue;
817
818 const TrigRoiDescriptor* const* roiptr = roi_link.cptr();
819
820 if ( roiptr == 0 ) {
821 // std::cerr << "\treadback link is null DAMMIT !!!" << std::endl;
822 continue;
823 }
824
825 if (m_provider->msg().level() <= MSG::VERBOSE) {
826 m_provider->msg(MSG::VERBOSE) << " RoI descriptor for seeded chain " << chainName << " " << **roiptr << endmsg;
827 }
828
829 TIDARoiDescriptor* roi_tmp = new TIDARoiDescriptor( TIDARoiDescriptorBuilder(**roiptr) );
830
832
835
838
839 selectorTest.clear();
840
841
842 if ( chainName.find("HLT_")!=std::string::npos || chainName.find("EF_")!=std::string::npos ) {
843 if ( selectTracks<xAOD::TrackParticleContainer>( &selectorTest, roi_link, collectionName ) );
844 else {
845 if (m_provider->msg().level() <= MSG::DEBUG) {
846 m_provider->msg(MSG::WARNING) << "\tNo track collection " << collectionName << " found" << endmsg;
847 }
848 }
849 }
850
852
853 std::vector<TIDA::Vertex> tidavertices;
854
855 if ( vtx_name!="" ) {
856
857 m_provider->msg(MSG::DEBUG) << "\tFetch xAOD::VertexContainer for chain " << chainName << " with key " << vtx_name << endmsg;
858
860
863
864 if ( vtx_itrpair.first == vtx_itrpair.second ) {
865 if ( m_provider->msg().level() <= MSG::DEBUG ) {
866 m_provider->msg(MSG::WARNING) << "\tNo xAOD::Vertex for chain " << chainName << " for key " << vtx_name << endmsg;
867 }
868 }
869 else {
870
871 m_provider->msg(MSG::DEBUG) << "\txAOD::VertexContainer found with size " << (vtx_itrpair.second - vtx_itrpair.first)
872 << "\t" << vtx_name << endmsg;
873
874 // Vertex types in some secondary vertex collections are not properly set and are all 0,
875 // allow these vertices if primary vertices are not used
876 if ( vtx_name.find("SecVtx") != std::string::npos ) {
877 tidavertices = vertexBuilder.select( vtx_itrpair.first, vtx_itrpair.second, &selectorRef.tracks(), true );
878 }
879 else {
880 tidavertices = vertexBuilder.select( vtx_itrpair.first, vtx_itrpair.second, &selectorTest.tracks() );
881 }
882 }
883 }
884
885#if 0
887 // now get the jets if they are present
888 std::vector<TrackTrigObject> jets;
889 if ( chainName.find("HLT_j")!=std::string::npos || chainName.find("EF_j")!=std::string::npos ) {
890 if ( get_jets( comb, jets ) == 0 ) m_provider->msg(MSG::WARNING) << "\tjets could not be retrieved " << endmsg;
891 }
892#endif
893
894 const std::vector<TIDA::Track*>& testTracks = selectorTest.tracks();
895 m_provider->msg(MSG::DEBUG) << "\ttest tracks.size() " << testTracks.size() << endmsg;
896 for (unsigned int ii=0; ii < testTracks.size(); ii++) {
897 m_provider->msg(MSG::DEBUG) << " test track " << ii << "for chain " << chainName + ":" + collectionName << " " << *testTracks[ii] << endmsg;
898 }
899
900
901 // only add chain if there are any rois - also add beamline position for postprocessing
902
903
904 if ( roi_tmp == 0 ) {
905 if ( testTracks.size()>0 ) m_provider->msg(MSG::WARNING) << "\ttest tracks.size() " << testTracks.size() << "found but no roi!!!" << endmsg;
906 roi_tmp = new TIDARoiDescriptor(true);
907 }
908
909 chain.addRoi( *roi_tmp );
910
911 chain.back().addTracks(testTracks);
912 chain.back().addVertices(tidavertices);
913
914#if 0
916 if ( chainName.find("HLT_j")!=std::string::npos ) chain.back().addObjects( jets );
917#endif
918
919 if ( selectorTest.getBeamX()!=0 || selectorTest.getBeamY()!=0 || selectorTest.getBeamZ()!=0 ) {
920 std::vector<double> beamline_;
921 beamline_.push_back( selectorTest.getBeamX() );
922 beamline_.push_back( selectorTest.getBeamY() );
923 beamline_.push_back( selectorTest.getBeamZ() );
924 chain.back().addUserData(beamline_);
925 }
926
927 delete roi_tmp;
928 roi_tmp = 0;
929
930 }
931
932 }
933
934#if 0
936
937 {
939
940 if ( filterOnRoi() || m_ptmin>0 ) {
941
942 TIDA::Chain* offline = 0;
943
944 std::vector<std::string> chainnames = m_event->chainnames();
945
947
948 for ( size_t ic=chainnames.size() ; ic-- ; ) {
949 if ( chainnames[ic] == "Offline" ) {
950 offline = &(m_event->chains()[ic]);
951 break;
952 }
953 }
954
955 if ( offline ) {
956
957 std::vector<TIDA::Chain>& chains = m_event->chains();
958 std::vector<TIDA::Chain>::iterator citr = chains.begin();
959
960 std::vector<std::pair<double,double> > philims;
961
962 for ( ; citr!=chains.end() ; ++citr ) {
963 if ( citr->name().find("HLT_")!=std::string::npos || citr->name().find("EF_")!=std::string::npos ) {
964 for ( size_t ir=0 ; ir<citr->size() ; ir++ ) {
965 TIDARoiDescriptor& roi = citr->rois()[ir].roi();
966 if ( roi.composite() ) {
967 for ( size_t isub=0 ; isub<roi.size() ; isub++ ) {
968 philims.push_back( std::pair<double,double>( roi[isub]->phiMinus(), roi[isub]->phiPlus() ) );
969 }
970 }
971 else philims.push_back( std::pair<double,double>( roi.phiMinus(), roi.phiPlus() ) );
972 }
973 }
974 }
975
976 remove_duplicates( philims );
977
978 for ( size_t iroi=0 ; iroi<offline->size() ; iroi++ ) {
979
980 std::vector<TIDA::Track>& tracks = offline->rois()[iroi].tracks();
981
984 // size_t Noffline = tracks.size();
985
986 for ( std::vector<TIDA::Track>::iterator it=tracks.begin() ; it<tracks.end() ; ) {
987 bool inc = true;
988 if ( m_ptmin>0 ) {
989 if ( std::fabs(it->pT())<m_ptmin ) { inc=false; tracks.erase( it ); }
990 }
991 if ( inc && filterOnRoi() ) {
992 bool remove_track = true;
993 for ( size_t isub=0 ; isub<philims.size() ; isub++ ) {
994
995 if ( philims[isub].first < philims[isub].second ) {
996 if ( it->phi()>=philims[isub].first && it->phi()<=philims[isub].second ) {
997 remove_track = false;
998 break;
999 }
1000 }
1001 else {
1002 if ( it->phi()>=philims[isub].first || it->phi()<=philims[isub].second ) {
1003 remove_track = false;
1004 break;
1005 }
1006 }
1007 }
1008 if ( remove_track ) { inc=false; tracks.erase( it ); }
1009 }
1010 if ( inc ) ++it;
1011 }
1012
1015 // m_provider->msg(MSG::DEBUG) << "TIDA::Roi offline track reduction: " << Noffline << " -> " << tracks.size() << endmsg;
1016
1017 }
1018
1019 }
1020
1021 }
1022 }
1023
1024#endif
1025
1026 if ( m_Tree ) m_Tree->Fill();
1027
1028}
void remove_duplicates(std::vector< T > &vec)
bool passed(DecisionID id, const DecisionIDContainer &)
checks if required decision ID is in the set of IDs in the container
Athena::TPCnvVers::Current TruthParticleContainer
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Athena::TPCnvVers::Current TrigRoiDescriptor
std::set< std::string > get_configured_chains()
std::vector< std::string > m_tauType
std::vector< std::string > m_muonType
size_t get_jets(Trig::FeatureContainer::combination_const_iterator citr, std::vector< TrackTrigObject > &objects, const std::string &key="")
retrieve the jets from the Roi
std::vector< std::string > m_tauProngs
std::vector< std::string > m_electronType
std::vector< std::string > m_rawElectrons
std::vector< bool > m_electronIsLRT
std::vector< bool > m_muonIsLRT
std::vector< std::string > m_vertexType
size_type size() const noexcept
Returns the number of elements in the collection.
double phiPlus() const
double phiMinus() const
bool composite() const
composite RoI methods
static std::vector< TIDA::Vertex > select(const xAOD::VertexContainer *xAODVertices, const std::vector< TIDA::Track * > *trackCollection=0, bool useType0=false, bool require_tracks=true)
unsigned processMuons(TrigTrackSelector &selectorRef, const unsigned int selection=0, double ETOffline=0, const std::string &containerName="Muons")
std::pair< typename Collection::const_iterator, typename Collection::const_iterator > getCollection(const ElementLink< TrigRoiDescriptorCollection > &roi_link, 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")
bool selectTracks(TrigTrackSelector *selector, const ElementLink< TrigRoiDescriptorCollection > &roi_link, const std::string &key="")
unsigned processTaus(TrigTrackSelector &selectorRef, std::vector< TrackTrigObject > *tauvec=0, const unsigned selection=0, int requireNtracks=0, double EtCutOffline=0, const std::string &containerName="TauJets")
bool isPassed(unsigned int condition=TrigDefs::Physics) const
tells if chain group passed
uint32_t lumiBlock() const
The current event's luminosity block number.
uint32_t bcid() const
The bunch crossing ID of the event.
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
int ir
counter of the current depth
Definition fastadd.cxx:49
std::string date()
sadly, includes a return at the end
Definition hcg.cxx:60
static const unsigned int includeFailedDecisions
Run3 synonym of alsoDeactivateTEs.
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
static const unsigned int allFeaturesOfType
Run 3 "enum". Return all features along legs (still with type and container checks).
EventInfo_v1 EventInfo
Definition of the latest event info version.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.

◆ mcTruth()

bool T_AnalysisConfig< AthReentrantAlgorithm >::mcTruth ( ) const
inlineinherited

Definition at line 215 of file T_AnalysisConfig.h.

215{ return m_mcTruth; }

◆ name()

const std::string & T_AnalysisConfig< AthReentrantAlgorithm >::name ( ) const
inlineinherited

Definition at line 189 of file T_AnalysisConfig.h.

◆ processElectrons()

unsigned T_AnalysisConfig< AthReentrantAlgorithm >::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" )
inlineprotectedinherited

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()

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

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()

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

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()

const std::string T_AnalysisConfig< AthReentrantAlgorithm >::referenceChains ( ) const
inlineinherited

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 }

◆ releaseData()

const std::string & T_AnalysisConfig< AthReentrantAlgorithm >::releaseData ( ) const
inlineinherited

Definition at line 227 of file T_AnalysisConfig.h.

227{ return m_releaseData; }

◆ requireDecision()

bool T_AnalysisConfig< AthReentrantAlgorithm >::requireDecision ( ) const
inlineinherited

Definition at line 242 of file T_AnalysisConfig.h.

◆ retrieve()

StatusCode T_AnalysisConfig< AthReentrantAlgorithm >::retrieve ( Collection const *& collection,
const std::string & key = "" )
inlineprotectedinherited

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()

bool T_AnalysisConfig< AthReentrantAlgorithm >::select ( std::vector< TIDA::Vertex > & vertices,
xAOD::VertexContainer::const_iterator vtx_start,
xAOD::VertexContainer::const_iterator vtx_end )
inlineprotectedinherited

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()

const std::string T_AnalysisConfig< AthReentrantAlgorithm >::selectionChains ( ) const
inlineinherited

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()

bool T_AnalysisConfig< AthReentrantAlgorithm >::selectTracks ( TrigTrackSelector * selector,
const ElementLink< TrigRoiDescriptorCollection > & roi_link,
const std::string & key = "" )
inlineprotectedinherited

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 }

◆ selectTracksNotEmpty()

bool T_AnalysisConfig< AthReentrantAlgorithm >::selectTracksNotEmpty ( TrigTrackSelector * selector,
const std::string & key )
inlineprotectedinherited

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 }

◆ set_fiducial_radius()

void AnalysisConfigMT_Ntuple::set_fiducial_radius ( double d)
inline

Definition at line 44 of file AnalysisConfigMT_Ntuple.h.

◆ set_ptmin()

void AnalysisConfigMT_Ntuple::set_ptmin ( double d)
inline

Definition at line 45 of file AnalysisConfigMT_Ntuple.h.

45{ m_ptmin = d; }

◆ setBeamX()

void T_AnalysisConfig< AthReentrantAlgorithm >::setBeamX ( double d)
inlineinherited

Definition at line 217 of file T_AnalysisConfig.h.

217{ m_beamX=d; }

◆ setBeamY()

void T_AnalysisConfig< AthReentrantAlgorithm >::setBeamY ( double d)
inlineinherited

Definition at line 218 of file T_AnalysisConfig.h.

218{ m_beamY=d; }

◆ setBeamZ()

void T_AnalysisConfig< AthReentrantAlgorithm >::setBeamZ ( double d)
inlineinherited

Definition at line 219 of file T_AnalysisConfig.h.

219{ m_beamZ=d; }

◆ setFilterOnRoi()

bool T_AnalysisConfig< AthReentrantAlgorithm >::setFilterOnRoi ( bool b)
inlineinherited

Definition at line 239 of file T_AnalysisConfig.h.

239{ return m_filterOnRoi=b; }

◆ setGenericFlag()

void T_AnalysisConfig< AthReentrantAlgorithm >::setGenericFlag ( bool b)
inlineinherited

Definition at line 225 of file T_AnalysisConfig.h.

225{ m_genericFlag=b; }

◆ setMCTruth()

void T_AnalysisConfig< AthReentrantAlgorithm >::setMCTruth ( bool b = true)
inlineinherited

Definition at line 214 of file T_AnalysisConfig.h.

214{ m_mcTruth=b; }

◆ setRequireDecision()

void T_AnalysisConfig< AthReentrantAlgorithm >::setRequireDecision ( bool b)
inlineinherited

Definition at line 241 of file T_AnalysisConfig.h.

◆ setUseHighestPT()

void T_AnalysisConfig< AthReentrantAlgorithm >::setUseHighestPT ( bool b)
inlineinherited

Definition at line 232 of file T_AnalysisConfig.h.

232{ m_useHighestPT=b; }

◆ setVtxIndex()

void T_AnalysisConfig< AthReentrantAlgorithm >::setVtxIndex ( int i)
inlineinherited

Definition at line 235 of file T_AnalysisConfig.h.

235{ m_vtxIndex=i; }

◆ testChains()

const std::string T_AnalysisConfig< AthReentrantAlgorithm >::testChains ( ) const
inlineinherited

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

TrackAnalysis* T_AnalysisConfig< AthReentrantAlgorithm >::m_analysis
protectedinherited

Definition at line 887 of file T_AnalysisConfig.h.

◆ m_analysisInstanceName

std::string T_AnalysisConfig< AthReentrantAlgorithm >::m_analysisInstanceName
protectedinherited

Definition at line 867 of file T_AnalysisConfig.h.

◆ m_associator

TrackAssociator* T_AnalysisConfig< AthReentrantAlgorithm >::m_associator
protectedinherited

Definition at line 886 of file T_AnalysisConfig.h.

◆ m_beamX

double T_AnalysisConfig< AthReentrantAlgorithm >::m_beamX
protectedinherited

Definition at line 891 of file T_AnalysisConfig.h.

◆ m_beamY

double T_AnalysisConfig< AthReentrantAlgorithm >::m_beamY
protectedinherited

Definition at line 891 of file T_AnalysisConfig.h.

◆ m_beamZ

double T_AnalysisConfig< AthReentrantAlgorithm >::m_beamZ
protectedinherited

Definition at line 891 of file T_AnalysisConfig.h.

◆ m_chainNames

std::vector<ChainString> AnalysisConfig_Ntuple::m_chainNames
protectedinherited

Definition at line 166 of file AnalysisConfig_Ntuple.h.

◆ m_Dir

TDirectory* AnalysisConfig_Ntuple::m_Dir
protectedinherited

Definition at line 164 of file AnalysisConfig_Ntuple.h.

◆ m_doBjets

bool AnalysisConfig_Ntuple::m_doBjets
protectedinherited

Definition at line 185 of file AnalysisConfig_Ntuple.h.

◆ m_doMuons

bool AnalysisConfig_Ntuple::m_doMuons
protectedinherited

Definition at line 170 of file AnalysisConfig_Ntuple.h.

◆ m_doMuonsSP

bool AnalysisConfig_Ntuple::m_doMuonsSP
protectedinherited

Definition at line 171 of file AnalysisConfig_Ntuple.h.

◆ m_doOffline

bool AnalysisConfig_Ntuple::m_doOffline
protectedinherited

Definition at line 168 of file AnalysisConfig_Ntuple.h.

◆ m_doVertices

bool AnalysisConfig_Ntuple::m_doVertices
protectedinherited

Definition at line 169 of file AnalysisConfig_Ntuple.h.

◆ m_electronIsLRT

std::vector<bool> AnalysisConfig_Ntuple::m_electronIsLRT
protectedinherited

Definition at line 178 of file AnalysisConfig_Ntuple.h.

◆ m_electronType

std::vector<std::string> AnalysisConfig_Ntuple::m_electronType
protectedinherited

Definition at line 176 of file AnalysisConfig_Ntuple.h.

◆ m_event

TIDA::Event* AnalysisConfig_Ntuple::m_event
protectedinherited

Definition at line 160 of file AnalysisConfig_Ntuple.h.

◆ m_fiducial_radius

double AnalysisConfigMT_Ntuple::m_fiducial_radius
private

Definition at line 55 of file AnalysisConfigMT_Ntuple.h.

◆ m_File

TFile* AnalysisConfig_Ntuple::m_File
protectedinherited

Definition at line 162 of file AnalysisConfig_Ntuple.h.

◆ m_filterOnRoi

bool T_AnalysisConfig< AthReentrantAlgorithm >::m_filterOnRoi
protectedinherited

Definition at line 902 of file T_AnalysisConfig.h.

◆ m_filters

std::vector< std::vector<TrackFilter*> > T_AnalysisConfig< AthReentrantAlgorithm >::m_filters
protectedinherited

Definition at line 874 of file T_AnalysisConfig.h.

◆ m_finalised

bool AnalysisConfig_Ntuple::m_finalised
protectedinherited

Definition at line 193 of file AnalysisConfig_Ntuple.h.

◆ m_genericFlag

int T_AnalysisConfig< AthReentrantAlgorithm >::m_genericFlag
protectedinherited

Definition at line 893 of file T_AnalysisConfig.h.

◆ m_hasTruthMap

bool AnalysisConfig_Ntuple::m_hasTruthMap
protectedinherited

Definition at line 186 of file AnalysisConfig_Ntuple.h.

◆ m_keepAllEvents

bool T_AnalysisConfig< AthReentrantAlgorithm >::m_keepAllEvents
protectedinherited

Definition at line 896 of file T_AnalysisConfig.h.

◆ m_keys

std::vector< std::vector<std::string> > T_AnalysisConfig< AthReentrantAlgorithm >::m_keys
protectedinherited

Definition at line 872 of file T_AnalysisConfig.h.

◆ m_mcTruth

bool T_AnalysisConfig< AthReentrantAlgorithm >::m_mcTruth
protectedinherited

Definition at line 889 of file T_AnalysisConfig.h.

◆ m_muonIsLRT

std::vector<bool> AnalysisConfig_Ntuple::m_muonIsLRT
protectedinherited

Definition at line 174 of file AnalysisConfig_Ntuple.h.

◆ m_muonType

std::vector<std::string> AnalysisConfig_Ntuple::m_muonType
protectedinherited

Definition at line 173 of file AnalysisConfig_Ntuple.h.

◆ m_outputFileName

std::string AnalysisConfig_Ntuple::m_outputFileName
protectedinherited

Definition at line 189 of file AnalysisConfig_Ntuple.h.

◆ m_parentTruthPdgId

int AnalysisConfig_Ntuple::m_parentTruthPdgId
protectedinherited

Definition at line 201 of file AnalysisConfig_Ntuple.h.

◆ m_printInfo

bool AnalysisConfig_Ntuple::m_printInfo
protectedinherited

Definition at line 197 of file AnalysisConfig_Ntuple.h.

◆ m_provider

AthReentrantAlgorithm* T_AnalysisConfig< AthReentrantAlgorithm >::m_provider
protectedinherited

Definition at line 859 of file T_AnalysisConfig.h.

◆ m_ptmin

double AnalysisConfigMT_Ntuple::m_ptmin
private

Definition at line 56 of file AnalysisConfigMT_Ntuple.h.

◆ m_rawElectrons

std::vector<std::string> AnalysisConfig_Ntuple::m_rawElectrons
protectedinherited

Definition at line 177 of file AnalysisConfig_Ntuple.h.

◆ m_refChainKey

std::string T_AnalysisConfig< AthReentrantAlgorithm >::m_refChainKey
protectedinherited

Definition at line 877 of file T_AnalysisConfig.h.

◆ m_refChainName

std::string T_AnalysisConfig< AthReentrantAlgorithm >::m_refChainName
protectedinherited

Definition at line 876 of file T_AnalysisConfig.h.

◆ m_releaseData

std::string T_AnalysisConfig< AthReentrantAlgorithm >::m_releaseData
protectedinherited

Definition at line 894 of file T_AnalysisConfig.h.

◆ m_requireDecision

bool T_AnalysisConfig< AthReentrantAlgorithm >::m_requireDecision
protectedinherited

Definition at line 904 of file T_AnalysisConfig.h.

◆ m_selectorRef

TrigTrackSelector* T_AnalysisConfig< AthReentrantAlgorithm >::m_selectorRef
protectedinherited

Definition at line 882 of file T_AnalysisConfig.h.

◆ m_selectorSel

TrigTrackSelector* T_AnalysisConfig< AthReentrantAlgorithm >::m_selectorSel
protectedinherited

Definition at line 884 of file T_AnalysisConfig.h.

◆ m_selectorTest

TrigTrackSelector* T_AnalysisConfig< AthReentrantAlgorithm >::m_selectorTest
protectedinherited

Definition at line 883 of file T_AnalysisConfig.h.

◆ m_tauEtCutOffline

bool AnalysisConfig_Ntuple::m_tauEtCutOffline
protectedinherited

Definition at line 187 of file AnalysisConfig_Ntuple.h.

◆ m_tauProngs

std::vector<std::string> AnalysisConfig_Ntuple::m_tauProngs
protectedinherited

Definition at line 181 of file AnalysisConfig_Ntuple.h.

◆ m_tauType

std::vector<std::string> AnalysisConfig_Ntuple::m_tauType
protectedinherited

Definition at line 180 of file AnalysisConfig_Ntuple.h.

◆ m_tdt

ToolHandle<Trig::TrigDecisionTool>* T_AnalysisConfig< AthReentrantAlgorithm >::m_tdt
protectedinherited

Definition at line 861 of file T_AnalysisConfig.h.

◆ m_testChainKey

std::string T_AnalysisConfig< AthReentrantAlgorithm >::m_testChainKey
protectedinherited

Definition at line 880 of file T_AnalysisConfig.h.

◆ m_testChainName

std::string T_AnalysisConfig< AthReentrantAlgorithm >::m_testChainName
protectedinherited

Definition at line 879 of file T_AnalysisConfig.h.

◆ m_Tree

TTree* AnalysisConfig_Ntuple::m_Tree
protectedinherited

Definition at line 163 of file AnalysisConfig_Ntuple.h.

◆ m_TruthPdgId

int AnalysisConfig_Ntuple::m_TruthPdgId
protectedinherited

Definition at line 191 of file AnalysisConfig_Ntuple.h.

◆ m_types

std::vector< std::vector<std::string> > T_AnalysisConfig< AthReentrantAlgorithm >::m_types
protectedinherited

Definition at line 871 of file T_AnalysisConfig.h.

◆ m_useBeamCondSvc

bool AnalysisConfig_Ntuple::m_useBeamCondSvc
protectedinherited

Definition at line 158 of file AnalysisConfig_Ntuple.h.

◆ m_useHighestPT

bool T_AnalysisConfig< AthReentrantAlgorithm >::m_useHighestPT
protectedinherited

Definition at line 898 of file T_AnalysisConfig.h.

◆ m_vertexType

std::vector<std::string> AnalysisConfig_Ntuple::m_vertexType
protectedinherited

Definition at line 183 of file AnalysisConfig_Ntuple.h.

◆ m_vtxIndex

int T_AnalysisConfig< AthReentrantAlgorithm >::m_vtxIndex
protectedinherited

Definition at line 900 of file T_AnalysisConfig.h.


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