22#include "EventInfo/EventInfo.h"
71 std::string mtime = ctime_r(&t, buf);
72 mtime.erase(
std::remove(mtime.begin(), mtime.end(),
'\n'), mtime.end() );
81 if (std::abs(p->pdg_id())==11 || std::abs(p->pdg_id())==13 )
return 0;
82 if ( std::abs(p->pdg_id())==pdg_id )
return p;
84 auto vertex = p->production_vertex();
85 if ( !vertex)
return 0;
88 if ( vertex->particles_in().size() < 1 )
return 0;
96 for (
auto in: vertex->particles_in()) {
97 auto parent =
fromParent( pdg_id, in, printout );
99 if ( parent && std::abs(parent->pdg_id())==pdg_id) {
104 if ( vertex->particles_in_size() < 1 )
return 0;
106 HepMC::GenVertex::particles_in_const_iterator in = vertex->particles_in_const_begin();
107 HepMC::GenVertex::particles_in_const_iterator end = vertex->particles_in_const_end();
109 const HepMC::GenParticle* parent =
fromParent( pdg_id, *in, printout );
112 if ( parent && std::abs(parent->pdg_id())==pdg_id) {
135 std::vector<TrackTrigObject>& objects,
const std::string& key ) {
141 if ( jetfeatures.empty() )
return 0;
143 for (
size_t ifeature=0 ; ifeature<jetfeatures.size() ; ifeature++ ) {
146 if ( jetfeature.
empty() )
continue;
150 if ( jets == 0 )
continue;
154 for (
int j=0 ; jitr!=jets->end() ; ++jitr, j++ ) {
158 long unsigned jetid = (
unsigned long)ajet;
162 objects.push_back(
jet );
167 return objects.size();
177 <<
" compiled " << __DATE__ <<
" " << __TIME__ <<
"\t: " <<
date() <<
"␛[m" <<
endmsg;
204 if(
m_tdt->retrieve().isFailure() ) {
205 m_provider->msg(MSG::FATAL) <<
" Unable to retrieve the TrigDecisionTool: Please check job options file" <<
endmsg;
210 m_provider->msg(MSG::INFO) <<
"␛[91;1m" <<
" Successfully retrieved the TrigDecisionTool" <<
"␛[m" <<
endmsg;
211 m_provider->msg(MSG::INFO) <<
"␛[91;1m" <<
" booking ntuple" <<
"␛[m" <<
endmsg;
212 m_provider->msg(MSG::INFO) <<
"␛[91;1m" <<
" trying to create new ntple file" <<
"␛[m" <<
endmsg;
215 TDirectory* dir = gDirectory;
217 static std::atomic<bool> first_open =
true;
222 static std::atomic<int> file_index = 0;
226 sprintf( file_label,
"-%04d.root", file_index++ );
236 TTree* dataTree =
new TTree(
"dataTree",
"dataTree");
238 dataTree->Branch(
"ReleaseMetaData",
"TString", &
releaseData);
240 dataTree->Write(
"", TObject::kOverwrite);
244 m_Tree =
new TTree(
"tree",
"tree");
245 m_Tree->Branch(
"TIDA::Event",
"TIDA::Event",
m_event, 6400, 1 );
261 m_provider->msg(MSG::DEBUG) <<
"change directory " <<
name() <<
" " << dir->GetName() <<
endmsg;
271 m_provider->msg(MSG::INFO) <<
"AnalysisConfig_Ntuple::book() exiting" <<
endmsg;
286 m_provider->msg(MSG::INFO) <<
"AnalysisConfig_Ntuple::finalise() flagged, not finalising " <<
m_provider->name() <<
"\t" <<
m_Tree->GetEntries() <<
" entries" <<
endmsg;
292 TDirectory* directory = gDirectory;
303 m_Tree->Write(
"", TObject::kOverwrite);
std::string date()
sadly, includes a return at the end
HepMC::ConstGenParticlePtr fromParent(int pdg_id, HepMC::ConstGenParticlePtr p, bool printout=false)
void remove_duplicates(std::vector< T > &vec)
std::vector< size_t > vec
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
generic track filter to filter on eta and PT only
static const std::string outputFileName
std::string m_outputFileName
size_t get_jets(Trig::FeatureContainer::combination_const_iterator citr, std::vector< TrackTrigObject > &objects, const std::string &key="")
retrieve the jets from the Roi
virtual void finalize()
finalise the analysis - take ratios for efficiencies etc
virtual void book()
setup the analysis the analysis, retrieve the tools etc
DataModel_detail::const_iterator< DataVector > const_iterator
const std::string & name() const
std::string m_releaseData
AthReentrantAlgorithm * m_provider
std::string m_analysisInstanceName
ToolHandle< Trig::TrigDecisionTool > * m_tdt
const std::string & releaseData() const
std::vector< Combination >::const_iterator combination_const_iterator
is basic vehicle of object access in TDT
const T * cptr() const
explicit conversion to object
bool empty() const
test method to check if the object is truly there
(HepMC) Monte Carlo particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
virtual double pt() const
The transverse momentum ( ) of the particle.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
std::string date()
sadly, includes a return at the end
const GenParticle * ConstGenParticlePtr
static const unsigned int alsoDeactivateTEs
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
DataModel_detail::iterator< DVL > remove(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, const T &value)
Specialization of remove for DataVector/List.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".