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 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 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="ElectronAODCollection")
 select offline electrons
unsigned processMuons (TrigTrackSelector &selectorRef, const unsigned int selection=0, double ETOffline=0, const std::string &containerName="StacoMuonCollection")
 select offlinqe muons
unsigned processTaus (TrigTrackSelector &selectorRef, std::vector< TrackTrigObject > *tauvec=0, const unsigned selection=0, int requireNtracks=0, double EtCutOffline=0, const std::string &containerName="TauJets")
 select offline taus

Protected Attributes

bool m_useBeamCondSvc
TIDA::Eventm_event
TFile * m_File
TTree * m_Tree
TDirectory * m_Dir
std::vector< ChainStringm_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
AthReentrantAlgorithmm_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::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

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

201 {
202 m_chainNames[1].push_back(chainName); m_types[1].push_back(type); m_keys[1].push_back(key);
203 }
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 210 of file T_AnalysisConfig.h.

210{ 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 205 of file T_AnalysisConfig.h.

205 {
206 m_chainNames[2].push_back(chainName); m_types[2].push_back(type); m_keys[2].push_back(key);
207 }

◆ addSelectionFilter()

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

Definition at line 211 of file T_AnalysisConfig.h.

211{ 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 197 of file T_AnalysisConfig.h.

197 {
198 m_chainNames[0].push_back(chainName); m_types[0].push_back(type); m_keys[0].push_back(key);
199 }

◆ addTestFilter()

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

Definition at line 209 of file T_AnalysisConfig.h.

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

◆ analysis()

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

Definition at line 256 of file T_AnalysisConfig.h.

◆ beamX()

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

Definition at line 264 of file T_AnalysisConfig.h.

◆ beamY()

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

Definition at line 265 of file T_AnalysisConfig.h.

◆ beamZ()

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

Definition at line 266 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 168 of file AnalysisConfig_Ntuple.cxx.

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

◆ execute()

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

Definition at line 223 of file T_AnalysisConfig.h.

223 {
224 if ( !m_provider ) std::cerr << "ERROR T_AnalysisConfig::execute() called without initialising" << std::endl;
225 loop();
226 }

◆ filterOnRoi()

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

Definition at line 282 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 259 of file AnalysisConfig_Ntuple.cxx.

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

◆ genericFlag()

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

Definition at line 268 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 114 of file AnalysisConfig_Ntuple.cxx.

115 {
116
117 objects.clear();
118
119 const std::vector< Trig::Feature<xAOD::JetContainer> > jetfeatures = citr->get<xAOD::JetContainer>( key, TrigDefs::alsoDeactivateTEs );
120
121 if ( jetfeatures.empty() ) return 0;
122
123 for ( size_t ifeature=0 ; ifeature<jetfeatures.size() ; ifeature++ ) {
124 Trig::Feature<xAOD::JetContainer> jetfeature = jetfeatures.at(ifeature);
125
126 if ( jetfeature.empty() ) continue;
127
128 const xAOD::JetContainer* jets = jetfeature.cptr();
129
130 if ( jets == 0 ) continue;
131
133
134 for ( ; jitr!=jets->end() ; ++jitr ) {
135
136 const xAOD::Jet* ajet = (*jitr);
137
138 long unsigned jetid = (unsigned long)ajet;
139
140 TrackTrigObject jet = TrackTrigObject( ajet->eta(), ajet->phi(), ajet->pt(), 0, ajet->type(), jetid );
141
142 objects.push_back( jet );
143
144 }
145 }
146
147 return objects.size();
148
149}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
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 629 of file T_AnalysisConfig.h.

629 {
630 const Collection* collection = 0;
632
633 if ( key!="" ) {
634 if ( m_provider->evtStore()->template contains<Collection>( key ) ) {
636 if( sc.isSuccess() && collection ) {
637 m_provider->msg(MSG::DEBUG) << "SG Collection->size() " << collection->size() << " (" << key << ")" << endmsg;
638
641 if ( trackitr!=trackend ) {
642 v.resize(3);
643 v[0] = (*trackitr)->vx();
644 v[1] = (*trackitr)->vy();
645 v[2] = (*trackitr)->vz();
646 return v;
647 } // only need to look at the first track
648 }
649 }
650 }
651 return v;
652 }
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 297 of file T_AnalysisConfig.h.

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

◆ getUseHighestPT()

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

Definition at line 277 of file T_AnalysisConfig.h.

◆ getVtxIndex()

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

Definition at line 280 of file T_AnalysisConfig.h.

◆ initialize()

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

Definition at line 214 of file T_AnalysisConfig.h.

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

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

259{ return m_mcTruth; }

◆ name()

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

Definition at line 233 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 = "ElectronAODCollection" )
inlineprotectedinherited

select offline electrons

Definition at line 698 of file T_AnalysisConfig.h.

708 {
709
710 m_provider->msg(MSG::DEBUG) << "Fetching offline electrons: " << containerName << endmsg;
711
712 selectorRef.clear();
713
714# ifdef XAODTRACKING_TRACKPARTICLE_H
716# else
718# endif
719
720
721 const Container* container = 0;
722
723 if( ! m_provider->evtStore()->template contains<Container>(containerName) ) {
724 m_provider->msg(MSG::WARNING) << "Error No Electron Container " << containerName << " !" << endmsg;
725 return 0;
726 }
727
729 if( sc.isFailure() || !container ) {
730 m_provider->msg(MSG::WARNING) << "Error retrieving container: " << containerName << " !" << endmsg;
731 return 0;
732 }
733
734 m_provider->msg(MSG::DEBUG) << "Event with " << container->size() << " Electron object(s) " << endmsg;
735
738
739 for( ; elec!=elec_end ; ++elec ){
740 //m_provider->msg(MSG::DEBUG) << " Electron " << (*elec)
741 // << ", eta " << (*elec)->eta()
742 // << ", phi " << (*elec)->phi()
743 // << ", ET " << (*elec)->pt()
744 // << ", author " << (*elec)->author()
745 // << ", trackParticle " << (*elec)->trackParticle()
746 // << ", conversion " << (*elec)->conversion()
747 // << ", mediumPP " << ((*elec)->isem(egammaPID::ElectronMediumPP)==0)
748 // << endmsg;
749
750 bool good_electron = false;
751# ifdef XAODTRACKING_TRACKPARTICLE_H
753# else
755# endif
756
757 if (good_electron) {
758 const xAOD::Electron_v1& eleduff = *(*elec);
759 long unsigned eleid = (unsigned long)(&eleduff) ;
760 TrackTrigObject eleobj = TrackTrigObject( (*elec)->eta(),
761 (*elec)->phi(),
762 (*elec)->pt(),
763 0,
764 (*elec)->type(),
765 eleid );
766
767 bool trk_added ;
769 else trk_added = selectorRef.selectTrack( (*elec)->trackParticle() );
770
771 if (trk_added) eleobj.addChild( selectorRef.tracks().back()->id() );
772 if (elevec) elevec->push_back( eleobj );
773 }
774 }
775
776 return selectorRef.tracks().size();
777 }
bool isGoodOffline(const Analysis::Electron &elec)

◆ processMuons()

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

select offlinqe muons

Definition at line 784 of file T_AnalysisConfig.h.

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

◆ 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

Definition at line 841 of file T_AnalysisConfig.h.

847 {
848
850
851 selectorRef.clear();
852
853 const Container* container = 0;
854
855 selectorRef.clear();
856
857 m_provider->msg(MSG::DEBUG) << " Offline taus " << containerName << endmsg;
858
859 if ( !m_provider->evtStore()->template contains<Container>(containerName)) {
860 m_provider->msg(MSG::WARNING) << " Offline taus not found" << endmsg;
861 return 0;
862 }
863
865 if (sc != StatusCode::SUCCESS) {
866 m_provider->msg(MSG::WARNING) << " Offline tau retrieval not successful" << endmsg;
867 return 0;
868 }
869
872
873
874 for ( ; tau!=tau_end ; ++tau ) {
875
876# ifndef XAODTAU_VERSIONS_TAUJET_V3_H
877 int N = (*tau)->nTracks();
878 // std::cout << "SUTT no tau detail " << N << "\t3prong: " << doThreeProng << std::endl;
879# else
880 int N=0;
881 (*tau)->detail( xAOD::TauJetParameters::nChargedTracks, N );
882 // std::cout << "SUTT tau detail: N " << N << "\t3prong: " << doThreeProng << std::endl;
883# endif
884
885 bool good_tau = false;
887
888 // std::cout << "SUTT tau ntracks: " << N << "\tgoodtau: " << good_tau << "\tpt: " << (*tau)->p4().Et() << "\t3prong: " << doThreeProng << std::endl;
889
890 if (good_tau){
891 const xAOD::TauJet_v3& duff = *(*tau);
892 long unsigned tauid = (unsigned long)(&duff) ;
893 TrackTrigObject tauobj = TrackTrigObject( (*tau)->eta(),
894 (*tau)->phi(),
895 (*tau)->pt(),
896 0,
897 (*tau)->type(),
898 tauid );
899
900 bool trk_added = false;
901
902 for ( unsigned i=N ; i-- ; ) {
903# ifdef XAODTAU_TAUTRACK_H
904
905 std::vector< ElementLink<xAOD::TrackParticleContainer> > alink = (*tau)->track(i)->trackLinks();
906
907 trk_added = false;
908
909 for ( size_t ilink=0 ; ilink<alink.size() ; ilink++ ) {
910 if ( alink[ilink].isValid() ) trk_added = selectorRef.selectTrack((*alink[ilink]));
911 }
913 // trk_added = selectorRef.selectTrack((*tau)->track(i)->track());
915# else
916 trk_added = selectorRef.selectTrack((*tau)->track(i));
917# endif
918 if ( trk_added ) tauobj.addChild( selectorRef.tracks().back()->id() );
919 }
920 if ( tauvec ) tauvec->push_back( tauobj );
921 }
922 }
923
924 return selectorRef.tracks().size();
925
926}

◆ referenceChains()

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

Definition at line 242 of file T_AnalysisConfig.h.

242 {
244 for(unsigned int i=0; i<m_chainNames[1].size(); i++)
245 name += (m_chainNames[1][i]+"::"+m_types[1][i]+"::"+m_keys[1][i]+" ");
246 return name;
247 }

◆ releaseData()

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

Definition at line 271 of file T_AnalysisConfig.h.

271{ return m_releaseData; }

◆ requireDecision()

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

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

568 {
571 if ( m_provider->evtStore()->template contains<Collection>( key ) ) {
573 if ( handle.isValid() ) {
576 collection = handle.cptr();
577 return StatusCode::SUCCESS;
578 }
579 }
580 return StatusCode::FAILURE;
581 }

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

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

◆ selectionChains()

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

Definition at line 249 of file T_AnalysisConfig.h.

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

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

442 {
443
444
447 // std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
448
453 size_t pos = key_collection.find("/");
454 if ( pos!=std::string::npos ) {
455 key_collection = key.substr( pos+1, key.size()-pos );
456 key_tename = key.substr( 0, pos );
457 }
458
461
463
465 const std::string* keyStr = m_provider->evtStore()->keyToString(roi_link.key(), checkCLID);
466 m_provider->msg(MSG::DEBUG) << "Requesting range over (" << key << ") associated to ROI from " << (keyStr == nullptr ? "UNKNOWN" : *keyStr) << endmsg;
467
468 itrpair = (*m_tdt)->associateToEventView( handle, roi_link );
469
470 if ( itrpair.first != itrpair.second ) {
471 selector->selectTracks( itrpair.first, itrpair.second );
472 return true;
473 }
474 else {
475 m_provider->msg(MSG::DEBUG) << "TDT TrackFeature collection (" << key << ") is empty " << endmsg;
476 return false;
477 }
478 }

◆ selectTracksNotEmpty()

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

Definition at line 603 of file T_AnalysisConfig.h.

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

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

261{ m_beamX=d; }

◆ setBeamY()

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

Definition at line 262 of file T_AnalysisConfig.h.

262{ m_beamY=d; }

◆ setBeamZ()

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

Definition at line 263 of file T_AnalysisConfig.h.

263{ m_beamZ=d; }

◆ setFilterOnRoi()

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

Definition at line 283 of file T_AnalysisConfig.h.

283{ return m_filterOnRoi=b; }

◆ setGenericFlag()

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

Definition at line 269 of file T_AnalysisConfig.h.

269{ m_genericFlag=b; }

◆ setMCTruth()

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

Definition at line 258 of file T_AnalysisConfig.h.

258{ m_mcTruth=b; }

◆ setRequireDecision()

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

Definition at line 285 of file T_AnalysisConfig.h.

◆ setUseHighestPT()

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

Definition at line 276 of file T_AnalysisConfig.h.

276{ m_useHighestPT=b; }

◆ setVtxIndex()

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

Definition at line 279 of file T_AnalysisConfig.h.

279{ m_vtxIndex=i; }

◆ testChains()

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

Definition at line 235 of file T_AnalysisConfig.h.

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

Member Data Documentation

◆ m_analysis

TrackAnalysis* T_AnalysisConfig< AthReentrantAlgorithm >::m_analysis
protectedinherited

Definition at line 961 of file T_AnalysisConfig.h.

◆ m_analysisInstanceName

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

Definition at line 940 of file T_AnalysisConfig.h.

◆ m_associator

TrackAssociator* T_AnalysisConfig< AthReentrantAlgorithm >::m_associator
protectedinherited

Definition at line 960 of file T_AnalysisConfig.h.

◆ m_beamX

double T_AnalysisConfig< AthReentrantAlgorithm >::m_beamX
protectedinherited

Definition at line 965 of file T_AnalysisConfig.h.

◆ m_beamY

double T_AnalysisConfig< AthReentrantAlgorithm >::m_beamY
protectedinherited

Definition at line 965 of file T_AnalysisConfig.h.

◆ m_beamZ

double T_AnalysisConfig< AthReentrantAlgorithm >::m_beamZ
protectedinherited

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

◆ m_filters

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

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

◆ m_keys

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

Definition at line 945 of file T_AnalysisConfig.h.

◆ m_mcTruth

bool T_AnalysisConfig< AthReentrantAlgorithm >::m_mcTruth
protectedinherited

Definition at line 963 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 932 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 948 of file T_AnalysisConfig.h.

◆ m_refChainName

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

Definition at line 947 of file T_AnalysisConfig.h.

◆ m_releaseData

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

Definition at line 968 of file T_AnalysisConfig.h.

◆ m_requireDecision

bool T_AnalysisConfig< AthReentrantAlgorithm >::m_requireDecision
protectedinherited

Definition at line 978 of file T_AnalysisConfig.h.

◆ m_selectorRef

TrigTrackSelector* T_AnalysisConfig< AthReentrantAlgorithm >::m_selectorRef
protectedinherited

Definition at line 956 of file T_AnalysisConfig.h.

◆ m_selectorSel

TrigTrackSelector* T_AnalysisConfig< AthReentrantAlgorithm >::m_selectorSel
protectedinherited

Definition at line 958 of file T_AnalysisConfig.h.

◆ m_selectorTest

TrigTrackSelector* T_AnalysisConfig< AthReentrantAlgorithm >::m_selectorTest
protectedinherited

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

◆ m_testChainKey

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

Definition at line 951 of file T_AnalysisConfig.h.

◆ m_testChainName

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

Definition at line 950 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 944 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 972 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 974 of file T_AnalysisConfig.h.


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