Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <ParticleSelectionAlg.h>
|
| ParticleSelectionAlg (const std::string &name, ISvcLocator *pSvcLocator) |
| Constructor with parameters: More...
|
|
virtual | ~ParticleSelectionAlg () |
| Destructor: More...
|
|
virtual StatusCode | initialize () override |
| Athena algorithm's initalize hook. More...
|
|
virtual StatusCode | start () override |
| Athena algorithm's beginRun hook (called once before running over the events, after initialize) More...
|
|
virtual StatusCode | execute () override |
| Athena algorithm's execute hook. More...
|
|
virtual StatusCode | finalize () override |
| Athena algorithm's finalize hook. More...
|
|
StatusCode | initializeParser (const ExpressionParsing::SelectionArg< 1 > &selection_string) |
|
StatusCode | finalizeParser () |
|
virtual bool | updateDataNeeds (const std::vector< const DataObjID * > &input_data_in, const std::vector< const DataObjID * > &output_data_in, std::vector< Gaudi::DataHandle * > &new_input_handles, std::vector< Gaudi::DataHandle * > &new_output_handles) override |
| Inform a dynamic data consumer about all consumed or produced data. More...
|
|
virtual bool | renounceInput (const DataObjID &output_data_id) override |
|
virtual StatusCode | sysInitialize () override |
| Function initialising the tool in the correct way in Athena. More...
|
|
virtual StatusCode | sysExecute (const EventContext &) override |
| override to do firstEvent method More...
|
|
template<typename T > |
StatusCode | retrieveMetadata (const std::string &folder, const std::string &key, T &out) |
| Helper function to access IOVMetaDataContainer information helped in the MetaDataStore. More...
|
|
template<typename T > |
StatusCode | retrieveMetadata (const std::string &folder, const std::string &key, T &out, const IOVTime &time, int channel=-1) |
| Helper function to access IOVMetaDataContainer information held in InputMetaDataStore, but will check IOVTime. More...
|
|
const ServiceHandle< ITHistSvc > & | histSvc () const |
| The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a pointer to the THistSvc . More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | _initializeParser (const ExpressionParsing::SelectionArg< NUM_PARSER > &selection_string, ExpressionParsing::AppendLoaderFunc pre_xaod_loader=ExpressionParsing::NoLoaderFunc, ExpressionParsing::AppendLoaderFunc post_xaod_loader=ExpressionParsing::NoLoaderFunc) |
|
void | updateEvtStore (Gaudi::Details::PropertyBase &prop) |
|
virtual void | handle (const Incident &inc) override |
| Function receiving incidents from IncidentSvc/TEvent Experts can override but they should ensure they add AthAnalysisAlgorithm::handle(); to the end of their own implementation. More...
|
|
virtual StatusCode | beginInputFile () |
| Function called when a new input file is opened user can read input metadata from inputMetaStore() More...
|
|
virtual StatusCode | endInputFile () |
| Function called as an input file is being closed. More...
|
|
virtual StatusCode | metaDataStop () |
| Function called before finalize user can read output metadata from outputMetaStore() More...
|
|
virtual StatusCode | firstExecute () |
| Function called when first execute is encountered user can read event information with evtStore() More...
|
|
virtual TFile * | currentFile (const char *evtSelName="EventSelector") final |
| Function returning the TFile pointer of the currently open file of the given EventSelector (in athena jobs this defaults to "EventSelector") More...
|
|
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
| remove all handles from I/O resolution More...
|
|
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
|
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
| Add StoreName to extra input/output deps as needed. More...
|
|
StatusCode | configAthHistogramming (const ServiceHandle< ITHistSvc > &histSvc, const std::string &prefix, const std::string &rootDir, const std::string &histNamePrefix, const std::string &histNamePostfix, const std::string &histTitlePrefix, const std::string &histTitlePostfix) |
| To be called by the derived classes to fill the internal configuration. More...
|
|
TH1 * | bookGetPointer (const TH1 &hist, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
TH1 * | bookGetPointer (TH1 *hist, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
TH1 * | bookGetPointer (TH1 &histRef, std::string tDir="", std::string stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
TTree * | bookGetPointer (const TTree &treeRef, std::string tDir="", std::string stream="") |
| Simplify the booking and registering (into THistSvc) of TTrees. More...
|
|
TGraph * | bookGetPointer (const TGraph &graphRef, std::string tDir="", std::string stream="") |
| Simplify the booking and registering (into THistSvc) of TGraphs. More...
|
|
TEfficiency * | bookGetPointer (const TEfficiency &eff, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
TEfficiency * | bookGetPointer (TEfficiency *eff, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
TEfficiency * | bookGetPointer (TEfficiency &effRef, std::string tDir="", std::string stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
StatusCode | book (const TH1 &hist, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
StatusCode | book (TH1 *hist, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
StatusCode | book (TH1 &histRef, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
StatusCode | book (const TTree &treeRef, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TTrees. More...
|
|
StatusCode | book (const TGraph &graphRef, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TGraphs. More...
|
|
StatusCode | book (const TEfficiency &eff, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
StatusCode | book (TEfficiency *eff, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
StatusCode | book (TEfficiency &effRef, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
TH1 * | hist (const std::string &histName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered histograms of any type. More...
|
|
TH2 * | hist2d (const std::string &histName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered 2-d histograms. More...
|
|
TH3 * | hist3d (const std::string &histName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered 3-d histograms. More...
|
|
TTree * | tree (const std::string &treeName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered TTrees. More...
|
|
TGraph * | graph (const std::string &graphName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered TGraphs. More...
|
|
TEfficiency * | efficiency (const std::string &effName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered TEfficiency. More...
|
|
|
template<class CONT , class AUXCONT > |
StatusCode | selectParticles (const xAOD::IParticleContainer *inContainer, const std::vector< int > &resultVec) const |
| Private function to perform the actualy work. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
void | buildBookingString (std::string &bookingString, std::string &histName, std::string &tDir, std::string &stream, bool usePrefixPostfix=false) |
| Method to build individual booking string. More...
|
|
void | myReplace (std::string &str, const std::string &oldStr, const std::string &newStr) |
| Helper method to replace sub-string. More...
|
|
hash_t | hash (const std::string &histName) const |
| Method to calculate a 32-bit hash from a string. More...
|
|
|
enum | contType_t {
UNKNOWN,
PHOTON,
ELECTRON,
MUON,
TAU,
JET,
PARITCLEFLOW,
NEUTRALPARTICLE,
TRACKPARTICLE,
TRUTHPARTICLE,
COMPOSITEPARTICLE,
PARTICLE,
CALOCLUSTER
} |
| An enumaration for the actual container type. More...
|
|
unsigned long | m_nEventsProcessed |
| Internal event counter. More...
|
|
SG::OwnershipPolicy | m_outOwnPolicy |
| The internally used translation for the ownership policy. More...
|
|
contType_t | m_contType |
| The variable that holds the value that we find for the input container. More...
|
|
std::size_t | m_cutBKStartIdx |
| The starting index of where in the CutBookkeeperContainer our new CutBookkeepers start. More...
|
|
std::vector< std::size_t > | m_selToolIdxOffset |
| The list of pairs of the tool index of the AsgSelectionTools and the starting index of the corresponding CutBookKeeper inside the CutBookkeeperContainer. More...
|
|
std::size_t | m_idxSelParster |
| Store the index of the CutBookKeeper in the CutBookkeeperContainer for the selection using the ExpressionParser. More...
|
|
Definition at line 29 of file ParticleSelectionAlg.h.
◆ EffMap_t
◆ GraphMap_t
◆ hash_t
◆ HistMap_t
◆ StoreGateSvc_t
◆ TreeMap_t
◆ contType_t
An enumaration for the actual container type.
Enumerator |
---|
UNKNOWN | |
PHOTON | |
ELECTRON | |
MUON | |
TAU | |
JET | |
PARITCLEFLOW | |
NEUTRALPARTICLE | |
TRACKPARTICLE | |
TRUTHPARTICLE | |
COMPOSITEPARTICLE | |
PARTICLE | |
CALOCLUSTER | |
Definition at line 116 of file ParticleSelectionAlg.h.
◆ ParticleSelectionAlg()
ParticleSelectionAlg::ParticleSelectionAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Constructor with parameters:
Definition at line 58 of file ParticleSelectionAlg.cxx.
81 "The name of the output container with the deep copy of selected xAOD::IParticles");
83 "Decide if we want to write a fully-split AuxContainer such that we can remove any variables");
85 "Defines the ownership policy of the output container (default: 'OWN_ELEMENTS'; also allowed: 'VIEW_ELEMENTS')");
89 "The selection string that defines which xAOD::IParticles to select from the container");
92 "If true (deault: false), do the bookkeeping of how many particles passed which selection cuts");
94 "The name of the resulting xAOD::CutBookkeeperContainer");
◆ ~ParticleSelectionAlg()
ParticleSelectionAlg::~ParticleSelectionAlg |
( |
| ) |
|
|
virtual |
◆ _initializeParser()
◆ beginInputFile()
StatusCode AthAnalysisAlgorithm::beginInputFile |
( |
| ) |
|
|
protectedvirtualinherited |
◆ book() [1/8]
StatusCode AthHistogramming::book |
( |
const TEfficiency & |
eff, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 335 of file AthHistogramming.h.
338 TEfficiency* effClone =
dynamic_cast< TEfficiency*
>(
eff.Clone() );
340 m_msg << MSG::ERROR <<
"Couldn't create a TEfficiency clone" <<
endmsg;
341 return StatusCode::FAILURE;
◆ book() [2/8]
StatusCode AthHistogramming::book |
( |
const TGraph & |
graphRef, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TGraphs.
◆ book() [3/8]
StatusCode AthHistogramming::book |
( |
const TH1 & |
hist, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 303 of file AthHistogramming.h.
306 TH1* histClone =
dynamic_cast< TH1*
>(
hist.Clone() );
308 m_msg << MSG::ERROR <<
"Couldn't create a TH1 clone" <<
endmsg;
309 return StatusCode::FAILURE;
311 return this->
book( *histClone, tDir,
stream );
◆ book() [4/8]
StatusCode AthHistogramming::book |
( |
const TTree & |
treeRef, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TTrees.
Definition at line 403 of file AthHistogramming.h.
409 return StatusCode::SUCCESS;
413 return StatusCode::FAILURE;
◆ book() [5/8]
StatusCode AthHistogramming::book |
( |
TEfficiency & |
effRef, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 356 of file AthHistogramming.h.
361 m_msg << MSG::ERROR <<
"Couldn't book a TEfficiency" <<
endmsg;
362 return StatusCode::FAILURE;
364 return StatusCode::SUCCESS;
◆ book() [6/8]
StatusCode AthHistogramming::book |
( |
TEfficiency * |
eff, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 346 of file AthHistogramming.h.
349 m_msg << MSG::ERROR <<
"Got a zero pointer to a TEfficiency" <<
endmsg;
350 return StatusCode::FAILURE;
◆ book() [7/8]
StatusCode AthHistogramming::book |
( |
TH1 & |
histRef, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 324 of file AthHistogramming.h.
328 if ( !histPointer ) {
329 m_msg << MSG::ERROR <<
"Couldn't book a TH1" <<
endmsg;
330 return StatusCode::FAILURE;
332 return StatusCode::SUCCESS;
◆ book() [8/8]
StatusCode AthHistogramming::book |
( |
TH1 * |
hist, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 314 of file AthHistogramming.h.
317 m_msg << MSG::ERROR <<
"Got a zero pointer to a TH1" <<
endmsg;
318 return StatusCode::FAILURE;
◆ bookGetPointer() [1/8]
TEfficiency * AthHistogramming::bookGetPointer |
( |
const TEfficiency & |
eff, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 281 of file AthHistogramming.h.
284 TEfficiency* histClone =
dynamic_cast< TEfficiency*
>(
hist.Clone() );
286 m_msg << MSG::ERROR <<
"Couldn't create a TEfficiency clone in bookGetPointer" <<
endmsg;
◆ bookGetPointer() [2/8]
TGraph * AthHistogramming::bookGetPointer |
( |
const TGraph & |
graphRef, |
|
|
std::string |
tDir = "" , |
|
|
std::string |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the booking and registering (into THistSvc) of TGraphs.
Definition at line 427 of file AthHistogramming.cxx.
430 const TGraph* graphPointer = &graphRef;
435 m_msg << MSG::WARNING
436 <<
"We got an invalid TGraph pointer in the BookGetPointer(TGraph*) method of the class" <<
m_name
442 std::string graphName = graphPointer->GetName();
443 const std::string graphTitle = graphPointer->GetTitle();
446 const hash_t graphHash = this->
hash(graphName);
447 GraphMap_t::const_iterator
it =
m_graphMap.find( graphHash );
450 m_msg << MSG::WARNING
451 <<
"Detected a hash collision. The hash for the TGraph with name=" << graphName
452 <<
" already exists and points to a TGraph with name=" <<
it->second->GetName()
453 <<
" NOT going to book the new histogram and returning a NULL pointer!" <<
endmsg;
461 m_msg << MSG::WARNING
462 <<
"We couldn't clone the TGraph in the BookGetPointer(TGraph&) method of the class" <<
m_name
469 std::string bookingString(
"");
473 if ( !((
histSvc()->regGraph(bookingString, graphClone)).isSuccess()) )
475 m_msg << MSG::WARNING
476 <<
"Problem registering TGraph with name " << graphName
477 <<
", title " << graphTitle
483 m_graphMap.insert(
m_graphMap.end(), std::pair< const hash_t, TGraph* >( graphHash, graphClone ) );
◆ bookGetPointer() [3/8]
TH1 * AthHistogramming::bookGetPointer |
( |
const TH1 & |
hist, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 260 of file AthHistogramming.h.
263 TH1* histClone =
dynamic_cast< TH1*
>(
hist.Clone() );
265 m_msg << MSG::ERROR <<
"Couldn't create a TH1 clone in bookGetPointer" <<
endmsg;
◆ bookGetPointer() [4/8]
TTree * AthHistogramming::bookGetPointer |
( |
const TTree & |
treeRef, |
|
|
std::string |
tDir = "" , |
|
|
std::string |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the booking and registering (into THistSvc) of TTrees.
Definition at line 312 of file AthHistogramming.cxx.
315 const TTree* treePointer = &treeRef;
320 m_msg << MSG::WARNING
321 <<
"We got an invalid TTree pointer in the BookGetPointer(TTree*) method of the class" <<
m_name
327 std::string
treeName = treePointer->GetName();
328 const std::string treeTitle = treePointer->GetTitle();
332 TreeMap_t::const_iterator
it =
m_treeMap.find( treeHash );
335 m_msg << MSG::WARNING
336 <<
"Detected a hash collision. The hash for the TTree with name=" <<
treeName
337 <<
" already exists and points to a TTree with name=" <<
it->second->GetName()
338 <<
" NOT going to book the new histogram and returning a NULL pointer!" <<
endmsg;
343 TTree* treeClone =
dynamic_cast< TTree*
>( treePointer->Clone(
treeName.c_str()) );
346 m_msg << MSG::WARNING
347 <<
"We couldn't clone the TTree in the BookGetPointer(TTree&) method of the class" <<
m_name
351 treeClone->SetTitle (treeTitle.c_str());
354 std::string bookingString(
"");
358 if ( !((
histSvc()->regTree(bookingString, treeClone)).isSuccess()) )
360 m_msg << MSG::WARNING
361 <<
"Problem registering TTree with name " <<
treeName
362 <<
", title " << treeTitle
368 m_treeMap.insert(
m_treeMap.end(), std::pair< const hash_t, TTree* >( treeHash, treeClone ) );
◆ bookGetPointer() [5/8]
TEfficiency * AthHistogramming::bookGetPointer |
( |
TEfficiency & |
effRef, |
|
|
std::string |
tDir = "" , |
|
|
std::string |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 146 of file AthHistogramming.cxx.
149 std::string effName(effRef.GetName());
150 const std::string effTitle(effRef.GetTitle());
151 std::string bookingString(
"");
155 effRef.SetName(effName.c_str());
159 EffMap_t::const_iterator
it =
m_effMap.find( effHash );
162 m_msg << MSG::WARNING
163 <<
"Detected a hash collision. The hash for the TEfficiency with name=" << effName
164 <<
" already exists and points to a TEfficiency with name=" <<
it->second->GetName()
165 <<
" NOT going to book the new TEfficiency and returning a NULL pointer!" <<
endmsg;
175 if ( !((
histSvc()->regEfficiency(bookingString, &effRef)).isSuccess()) )
177 m_msg << MSG::WARNING
178 <<
"Problem registering TEfficiency with name " << effName
180 <<
", title " << effTitle
188 m_effMap.insert(
m_effMap.end(), std::pair< const hash_t, TEfficiency* >( effHash, &effRef ) );
◆ bookGetPointer() [6/8]
TEfficiency * AthHistogramming::bookGetPointer |
( |
TEfficiency * |
eff, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 293 of file AthHistogramming.h.
296 m_msg << MSG::ERROR <<
"Got a zero pointer to a TEfficiency in bookGetPointer" <<
endmsg;
◆ bookGetPointer() [7/8]
TH1 * AthHistogramming::bookGetPointer |
( |
TH1 & |
histRef, |
|
|
std::string |
tDir = "" , |
|
|
std::string |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 98 of file AthHistogramming.cxx.
101 std::string
histName(histRef.GetName());
102 const std::string histTitle(histRef.GetTitle());
103 std::string bookingString(
"");
111 HistMap_t::const_iterator
it =
m_histMap.find( histHash );
114 m_msg << MSG::WARNING
115 <<
"Detected a hash collision. The hash for the histogram with name=" <<
histName
116 <<
" already exists and points to a histogram with name=" <<
it->second->GetName()
117 <<
" NOT going to book the new histogram and returning a NULL pointer!" <<
endmsg;
127 if ( !((
histSvc()->regHist(bookingString, &histRef)).isSuccess()) )
129 m_msg << MSG::WARNING
130 <<
"Problem registering histogram with name " <<
histName
132 <<
", title " << histTitle
140 m_histMap.insert(
m_histMap.end(), std::pair< const hash_t, TH1* >( histHash, &histRef ) );
◆ bookGetPointer() [8/8]
TH1 * AthHistogramming::bookGetPointer |
( |
TH1 * |
hist, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 272 of file AthHistogramming.h.
275 m_msg << MSG::ERROR <<
"Got a zero pointer to a TH1 in bookGetPointer" <<
endmsg;
◆ buildBookingString()
void AthHistogramming::buildBookingString |
( |
std::string & |
bookingString, |
|
|
std::string & |
histName, |
|
|
std::string & |
tDir, |
|
|
std::string & |
stream, |
|
|
bool |
usePrefixPostfix = false |
|
) |
| |
|
privateinherited |
Method to build individual booking string.
Definition at line 560 of file AthHistogramming.cxx.
569 if(
pos != std::string::npos){
576 if(usePrefixPostfix){
581 while(bookingString.find(
"//") != std::string::npos){
◆ configAthHistogramming()
StatusCode AthHistogramming::configAthHistogramming |
( |
const ServiceHandle< ITHistSvc > & |
histSvc, |
|
|
const std::string & |
prefix, |
|
|
const std::string & |
rootDir, |
|
|
const std::string & |
histNamePrefix, |
|
|
const std::string & |
histNamePostfix, |
|
|
const std::string & |
histTitlePrefix, |
|
|
const std::string & |
histTitlePostfix |
|
) |
| |
|
protectedinherited |
To be called by the derived classes to fill the internal configuration.
Definition at line 66 of file AthHistogramming.cxx.
79 return StatusCode::SUCCESS;
◆ currentFile()
TFile * AthAnalysisAlgorithm::currentFile |
( |
const char * |
evtSelName = "EventSelector" | ) |
|
|
finalprotectedvirtualinherited |
Function returning the TFile pointer of the currently open file of the given EventSelector (in athena jobs this defaults to "EventSelector")
Definition at line 147 of file AthAnalysisAlgorithm.cxx.
153 SmartIF<IProperty> evtSelector{service(evtSelName,
false)};
155 ATH_MSG_ERROR(
"currentFile(): Couldn't find the service: " << evtSelName);
return 0;
160 const StringArrayProperty& inputCollectionsName =
dynamic_cast<const StringArrayProperty&
>(evtSelector->getProperty(
"InputCollections"));
162 ATH_MSG_VERBOSE(
"nOpenFile=" << gROOT->GetListOfFiles()->GetSize() <<
". nFilesInInputCollection=" << inputCollectionsName.value().size());
164 for(
int i=0;
i<gROOT->GetListOfFiles()->GetSize();
i++) {
165 ATH_MSG_VERBOSE(
"Open file: " << gROOT->GetListOfFiles()->At(
i)->GetName());
171 for(
int i=0;
i<gROOT->GetListOfFiles()->GetSize();
i++) {
172 TFile *
g = (TFile*)gROOT->GetListOfFiles()->At(
i);
175 TString
s(
g->GetName());
176 TObjArray*
tokens =
s.Tokenize(
"/");
177 TObjString* lastToken =
dynamic_cast<TObjString*
>(
tokens->Last());
178 TString sToCompare(
"");
179 bool shortComparison(
false);
180 if(
tokens->GetEntries()>1) {
181 TString beforeSlash((
dynamic_cast<TObjString*
>(
tokens->At(
tokens->GetEntries()-2)))->GetString());
182 if(beforeSlash.Length()>0) sToCompare += beforeSlash;
185 shortComparison=
true;
187 sToCompare += lastToken->GetString();
188 TString sToCompare_short(lastToken->GetString());
191 for(
unsigned int j=0;j<inputCollectionsName.value().
size();j++) {
192 TString
t(inputCollectionsName.value()[j].c_str());
195 ATH_MSG_VERBOSE(
"Current File is: " << inputCollectionsName.value()[j]);
199 TObjArray*
tokens =
t.Tokenize(
"/");
200 TObjString* lastToken =
dynamic_cast<TObjString*
>(
tokens->Last());
201 TString tToCompare =
"";
202 bool shortComparison2(
false);
203 if(
tokens->GetEntries()>1) {
204 TString beforeSlash((
dynamic_cast<TObjString*
>(
tokens->At(
tokens->GetEntries()-2)))->GetString());
205 if(beforeSlash.Length()>0) tToCompare += beforeSlash;
208 shortComparison2=
true;
210 tToCompare += lastToken->GetString();
211 TString tToCompare_short(lastToken->GetString());
214 if(shortComparison || shortComparison2) {
215 if(sToCompare_short.EqualTo(tToCompare_short)) {
216 ATH_MSG_VERBOSE(
"Current File is: " << inputCollectionsName.value()[j]);
221 if(sToCompare.EqualTo(tToCompare)) {
222 ATH_MSG_VERBOSE(
"Current File is: " << inputCollectionsName.value()[j]);
230 ATH_MSG_ERROR(
"currentFile(): Couldn't load InputCollections property of " << evtSelName);
return 0;
233 ATH_MSG_ERROR(
"currentFile(): Could not find the current file!");
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ efficiency()
TEfficiency * AthHistogramming::efficiency |
( |
const std::string & |
effName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the retrieval of registered TEfficiency.
Definition at line 250 of file AthHistogramming.cxx.
256 EffMap_t::const_iterator
it =
m_effMap.find( effHash );
261 std::string effNameCopy = effName;
262 std::string tDirCopy = tDir;
263 std::string streamCopy =
stream;
266 std::string bookingString(
"");
269 TEfficiency* effPointer(NULL);
270 if ( !((
histSvc()->getEfficiency(bookingString, effPointer)).isSuccess()) )
273 std::string bookingString(
"");
276 if ( !((
histSvc()->getEfficiency(bookingString, effPointer)).isSuccess()) )
278 m_msg << MSG::WARNING
279 <<
"Problem retrieving the TEfficiency with name (including pre- and post-fixes) "
281 <<
" or with name " << effNameCopy
282 <<
" in " <<
m_name <<
"... it doesn't exist, neither in the cached map nor in the THistSvc!"
283 <<
" Will return an NULL pointer... you have to handle it correctly!" <<
endmsg;
288 m_effMap.insert(
m_effMap.end(), std::pair< const hash_t, TEfficiency* >( effHash, effPointer ) );
293 m_effMap.insert(
m_effMap.end(), std::pair< const hash_t, TEfficiency* >( effHash, effPointer ) );
◆ endInputFile()
StatusCode AthAnalysisAlgorithm::endInputFile |
( |
| ) |
|
|
protectedvirtualinherited |
Function called as an input file is being closed.
Dummy implementation that can be overridden by the derived tool.
Definition at line 122 of file AthAnalysisAlgorithm.cxx.
125 return StatusCode::SUCCESS;
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode ParticleSelectionAlg::execute |
( |
| ) |
|
|
overridevirtual |
Athena algorithm's execute hook.
Definition at line 258 of file ParticleSelectionAlg.cxx.
282 ATH_MSG_FATAL(
"We couldn't determine the type of the container... abort!");
283 return StatusCode::FAILURE;
290 <<
" retrieved from StoreGate which has " << inContainer->
size() <<
" entries." );
295 std::vector<int> resultVec;
296 resultVec.reserve(inContainer->
size());
298 resultVec =
m_parser->evaluateAsVector();
300 if ( inContainer->
size() != resultVec.size() ) {
302 <<
") doesn't match the size of the result vector: " << resultVec.size() );
303 return StatusCode::FAILURE;
306 <<
" and a result vector of size " << resultVec.size() );
314 ATH_CHECK( (this->selectParticles<xAOD::PhotonContainer,xAOD::PhotonAuxContainer>(inContainer,resultVec)) );
317 ATH_CHECK( (this->selectParticles<xAOD::ElectronContainer,xAOD::ElectronAuxContainer>(inContainer,resultVec)) );
320 ATH_CHECK( (this->selectParticles<xAOD::MuonContainer,xAOD::MuonAuxContainer>(inContainer,resultVec)) );
323 ATH_CHECK( (this->selectParticles<xAOD::TauJetContainer,xAOD::TauJetAuxContainer>(inContainer,resultVec)) );
326 ATH_CHECK( (this->selectParticles<xAOD::JetContainer,xAOD::JetAuxContainer>(inContainer,resultVec)) );
329 ATH_CHECK( (this->selectParticles<xAOD::TruthParticleContainer,xAOD::TruthParticleAuxContainer>(inContainer,resultVec)) );
332 ATH_CHECK( (this->selectParticles<xAOD::CompositeParticleContainer,xAOD::CompositeParticleAuxContainer>(inContainer,resultVec)) );
335 ATH_CHECK( (this->selectParticles<xAOD::PFOContainer,xAOD::PFOAuxContainer>(inContainer,resultVec)) );
338 ATH_CHECK( (this->selectParticles<xAOD::NeutralParticleContainer,xAOD::NeutralParticleAuxContainer>(inContainer,resultVec)) );
341 ATH_CHECK( (this->selectParticles<xAOD::TrackParticleContainer,xAOD::TrackParticleAuxContainer>(inContainer,resultVec)) );
344 ATH_CHECK( (this->selectParticles<xAOD::ParticleContainer,xAOD::ParticleAuxContainer>(inContainer,resultVec)) );
347 ATH_CHECK( (this->selectParticles<xAOD::CaloClusterContainer,xAOD::CaloClusterAuxContainer>(inContainer,resultVec)) );
350 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode ParticleSelectionAlg::finalize |
( |
| ) |
|
|
overridevirtual |
◆ finalizeParser()
◆ firstExecute()
StatusCode AthAnalysisAlgorithm::firstExecute |
( |
| ) |
|
|
protectedvirtualinherited |
◆ graph()
TGraph * AthHistogramming::graph |
( |
const std::string & |
graphName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the retrieval of registered TGraphs.
Definition at line 492 of file AthHistogramming.cxx.
495 const hash_t graphHash = this->
hash(graphName);
498 GraphMap_t::const_iterator
it =
m_graphMap.find( graphHash );
503 std::string graphNameCopy = graphName;
504 std::string tDirCopy = tDir;
505 std::string streamCopy =
stream;
508 std::string bookingString(
"");
511 TGraph* graphPointer(NULL);
512 if ( !((
histSvc()->getGraph(bookingString, graphPointer)).isSuccess()) )
515 std::string bookingString(
"");
516 this->
buildBookingString( bookingString, graphNameCopy, tDirCopy, streamCopy,
false );
518 if ( !((
histSvc()->getGraph(bookingString, graphPointer)).isSuccess()) )
520 m_msg << MSG::WARNING
521 <<
"Problem retrieving the TGraph with name (including pre- and post-fixes) "
523 <<
" or with name " << graphNameCopy
524 <<
" in " <<
m_name <<
"... it doesn't exist, neither in the cached map nor in the THistSvc!"
525 <<
" Will return an NULL pointer... you have to handle it correctly!" <<
endmsg;
530 m_graphMap.insert(
m_graphMap.end(), std::pair< const hash_t, TGraph* >( graphHash, graphPointer ) );
535 m_graphMap.insert(
m_graphMap.end(), std::pair< const hash_t, TGraph* >( graphHash, graphPointer ) );
◆ handle()
void AthAnalysisAlgorithm::handle |
( |
const Incident & |
inc | ) |
|
|
overrideprotectedvirtualinherited |
Function receiving incidents from IncidentSvc/TEvent Experts can override but they should ensure they add AthAnalysisAlgorithm::handle(); to the end of their own implementation.
Definition at line 83 of file AthAnalysisAlgorithm.cxx.
89 if( inc.type() == IncidentType::BeginInputFile ) {
93 throw std::runtime_error(
"Couldn't call beginInputFile()" );
95 }
else if(inc.type() == IncidentType::EndInputFile ) {
98 throw std::runtime_error(
"Couldn't call endInputFile()" );
100 }
else if(inc.type() ==
"MetaDataStop" ) {
103 throw std::runtime_error(
"Couldn't call metaDataStop()" );
◆ hash()
◆ hist()
TH1 * AthHistogramming::hist |
( |
const std::string & |
histName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the retrieval of registered histograms of any type.
Definition at line 198 of file AthHistogramming.cxx.
204 HistMap_t::const_iterator
it =
m_histMap.find( histHash );
209 std::string histNameCopy =
histName;
210 std::string tDirCopy = tDir;
211 std::string streamCopy =
stream;
214 std::string bookingString(
"");
217 TH1* histPointer(NULL);
218 if ( !((
histSvc()->
getHist(bookingString, histPointer)).isSuccess()) )
221 std::string bookingString(
"");
224 if ( !((
histSvc()->
getHist(bookingString, histPointer)).isSuccess()) )
226 m_msg << MSG::WARNING
227 <<
"Problem retrieving the histogram with name (including pre- and post-fixes) "
229 <<
" or with name " << histNameCopy
230 <<
" in " <<
m_name <<
"... it doesn't exist, neither in the cached map nor in the THistSvc!"
231 <<
" Will return an NULL pointer... you have to handle it correctly!" <<
endmsg;
236 m_histMap.insert(
m_histMap.end(), std::pair< const hash_t, TH1* >( histHash, histPointer ) );
241 m_histMap.insert(
m_histMap.end(), std::pair< const hash_t, TH1* >( histHash, histPointer ) );
◆ hist2d()
TH2 * AthHistogramming::hist2d |
( |
const std::string & |
histName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the retrieval of registered 2-d histograms.
Definition at line 369 of file AthHistogramming.h.
376 <<
"Cannot get a 2-d histogram with name " <<
histName
377 <<
"... will probably seg-fault!" <<
endmsg;
381 return dynamic_cast<TH2*
>( th1Pointer );
◆ hist3d()
TH3 * AthHistogramming::hist3d |
( |
const std::string & |
histName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the retrieval of registered 3-d histograms.
Definition at line 386 of file AthHistogramming.h.
393 <<
"Cannot get a 3-d histogram with name " <<
histName
394 <<
"... will probably seg-fault!" <<
endmsg;
398 return dynamic_cast<TH3*
>( th1Pointer );
◆ histSvc()
The standard THistSvc
(for writing histograms and TTrees and more to a root file) Returns (kind of) a pointer to the THistSvc
.
Definition at line 113 of file AthHistogramAlgorithm.h.
◆ initialize()
StatusCode ParticleSelectionAlg::initialize |
( |
| ) |
|
|
overridevirtual |
◆ initializeParser()
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ inputMetaStore() [1/2]
◆ inputMetaStore() [2/2]
◆ metaDataStop()
StatusCode AthAnalysisAlgorithm::metaDataStop |
( |
| ) |
|
|
protectedvirtualinherited |
Function called before finalize user can read output metadata from outputMetaStore()
Dummy implementation that can be overridden by the derived tool.
Definition at line 130 of file AthAnalysisAlgorithm.cxx.
133 return StatusCode::SUCCESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ myReplace()
void AthHistogramming::myReplace |
( |
std::string & |
str, |
|
|
const std::string & |
oldStr, |
|
|
const std::string & |
newStr |
|
) |
| |
|
privateinherited |
Helper method to replace sub-string.
Definition at line 590 of file AthHistogramming.cxx.
595 while((
pos =
str.find(oldStr,
pos)) != std::string::npos)
597 str.replace(
pos, oldStr.length(), newStr);
598 pos += newStr.length();
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ outputMetaStore() [1/2]
◆ outputMetaStore() [2/2]
◆ renounce()
◆ renounceArray()
◆ renounceInput()
◆ retrieveMetadata() [1/2]
template<typename T >
StatusCode AthAnalysisAlgorithm::retrieveMetadata |
( |
const std::string & |
folder, |
|
|
const std::string & |
key, |
|
|
T & |
out |
|
) |
| |
|
inlineinherited |
◆ retrieveMetadata() [2/2]
template<typename T >
StatusCode AthAnalysisAlgorithm::retrieveMetadata |
( |
const std::string & |
folder, |
|
|
const std::string & |
key, |
|
|
T & |
out, |
|
|
const IOVTime & |
time, |
|
|
int |
channel = -1 |
|
) |
| |
|
inlineinherited |
◆ selectParticles()
template<class CONT , class AUXCONT >
Private function to perform the actualy work.
◆ start()
StatusCode ParticleSelectionAlg::start |
( |
| ) |
|
|
overridevirtual |
Athena algorithm's beginRun hook (called once before running over the events, after initialize)
Definition at line 167 of file ParticleSelectionAlg.cxx.
175 std::string inputStreamName =
"Stream";
177 std::vector<std::string> streamNameList;
179 if ( streamNameList.size() >=1 ){ inputStreamName = streamNameList[0]; }
181 int maxInputCycle = -1;
186 maxInputCycle = inCutBKCont->
maxCycle();
189 if (maxInputCycle<0){ maxInputCycle = 0; }
190 else { maxInputCycle += 1; }
204 cutBKCont->setStore( cutBKAuxCont );
213 for ( std::size_t toolIdx=0; toolIdx <
m_selTools.size(); ++toolIdx ){
219 const std::string toolName =
tool->name();
221 const unsigned int nCuts = acceptInfo.
getNCuts();
222 for (
unsigned int iCut=0; iCut<nCuts; ++iCut ){
224 const std::string cutName = acceptInfo.
getCutName(iCut);
230 cutBK->
setName(toolName+
"_"+cutName);
232 cutBK->
setCutLogic(xAOD::CutBookkeeper::CutLogic::REQUIRE);
246 cutBK->
setCutLogic(xAOD::CutBookkeeper::CutLogic::REQUIRE);
252 return StatusCode::SUCCESS;
◆ sysExecute()
StatusCode AthAnalysisAlgorithm::sysExecute |
( |
const EventContext & |
ctx | ) |
|
|
overridevirtualinherited |
override to do firstEvent method
Definition at line 72 of file AthAnalysisAlgorithm.cxx.
77 return StatusCode::FAILURE;
80 return AthHistogramAlgorithm::sysExecute(ctx);
◆ sysInitialize()
StatusCode AthAnalysisAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
Function initialising the tool in the correct way in Athena.
Reimplemented from AthHistogramAlgorithm.
Definition at line 50 of file AthAnalysisAlgorithm.cxx.
57 incSvc->removeListener(
this, IncidentType::BeginInputFile );
58 incSvc->addListener(
this, IncidentType::BeginInputFile, 0,
true );
59 incSvc->removeListener(
this, IncidentType::EndInputFile );
60 incSvc->addListener(
this, IncidentType::EndInputFile, 0,
true );
61 incSvc->removeListener(
this,
"MetaDataStop" );
62 incSvc->addListener(
this,
"MetaDataStop", 0,
true );
69 return StatusCode::SUCCESS;
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ tree()
TTree * AthHistogramming::tree |
( |
const std::string & |
treeName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the retrieval of registered TTrees.
Definition at line 378 of file AthHistogramming.cxx.
384 TreeMap_t::const_iterator
it =
m_treeMap.find( treeHash );
389 std::string treeNameCopy =
treeName;
390 std::string tDirCopy = tDir;
391 std::string streamCopy =
stream;
394 std::string bookingString(
"");
397 TTree* treePointer(NULL);
398 if ( !((
histSvc()->
getTree(bookingString, treePointer)).isSuccess()) )
400 m_msg << MSG::WARNING
401 <<
"Problem retrieving the TTree with name " << treeNameCopy
402 <<
" in " <<
m_name <<
"... it doesn't exist, neither in the cached map nor in the THistSvc!"
403 <<
" Will return an NULL pointer... you have to handle it correctly!" <<
endmsg;
408 m_treeMap.insert(
m_treeMap.end(), std::pair< const hash_t, TTree* >( treeHash, treePointer ) );
◆ updateDataNeeds()
virtual bool ExpressionParserUserBase< ::AthAnalysisAlgorithm , NUM_PARSER >::updateDataNeeds |
( |
const std::vector< const DataObjID * > & |
input_data_in, |
|
|
const std::vector< const DataObjID * > & |
output_data_in, |
|
|
std::vector< Gaudi::DataHandle * > & |
new_input_handles, |
|
|
std::vector< Gaudi::DataHandle * > & |
new_output_handles |
|
) |
| |
|
overridevirtualinherited |
Inform a dynamic data consumer about all consumed or produced data.
- Parameters
-
input_data_in | the input data object IDs of all algorithms and tools |
output_data_in | the output data object IDs of all algorithms and tools |
new_input_handles | the new input data handles added by this call |
new_output_handles | the new output data handles added by this call |
- Returns
- true if the consumer did update its handles, false otherwise
Implements IDynamicDataConsumer.
◆ updateEvtStore()
void AthAnalysisAlgorithm::updateEvtStore |
( |
Gaudi::Details::PropertyBase & |
prop | ) |
|
|
protectedinherited |
◆ updateVHKA()
◆ m_contType
The variable that holds the value that we find for the input container.
Definition at line 133 of file ParticleSelectionAlg.h.
◆ m_currentFile
TFile* AthAnalysisAlgorithm::m_currentFile {nullptr} |
|
privateinherited |
◆ m_cutBKCName
StringProperty ParticleSelectionAlg::m_cutBKCName |
|
private |
◆ m_cutBKStartIdx
std::size_t ParticleSelectionAlg::m_cutBKStartIdx |
|
private |
The starting index of where in the CutBookkeeperContainer our new CutBookkeepers start.
Definition at line 136 of file ParticleSelectionAlg.h.
◆ m_detStore
◆ m_doCutFlow
bool ParticleSelectionAlg::m_doCutFlow |
|
private |
If true (deault: false), do the bookkeeping of how many particles passed which selection cuts.
Definition at line 98 of file ParticleSelectionAlg.h.
◆ m_doneFirstEvent
bool AthAnalysisAlgorithm::m_doneFirstEvent {false} |
|
privateinherited |
◆ m_effMap
◆ m_evtInfoName
StringProperty ParticleSelectionAlg::m_evtInfoName |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_graphMap
◆ m_histMap
◆ m_histNamePostfix
std::string AthHistogramAlgorithm::m_histNamePostfix |
|
privateinherited |
◆ m_histNamePrefix
std::string AthHistogramAlgorithm::m_histNamePrefix |
|
privateinherited |
◆ m_histSvc
◆ m_histTitlePostfix
std::string AthHistogramAlgorithm::m_histTitlePostfix |
|
privateinherited |
◆ m_histTitlePrefix
std::string AthHistogramAlgorithm::m_histTitlePrefix |
|
privateinherited |
◆ m_idxSelParster
std::size_t ParticleSelectionAlg::m_idxSelParster |
|
private |
Store the index of the CutBookKeeper in the CutBookkeeperContainer for the selection using the ExpressionParser.
Definition at line 144 of file ParticleSelectionAlg.h.
◆ m_inCollKey
StringProperty ParticleSelectionAlg::m_inCollKey |
|
private |
◆ m_inputMetaStore
◆ m_msg
MsgStream AthHistogramming::m_msg |
|
privateinherited |
◆ m_name
std::string AthHistogramming::m_name |
|
privateinherited |
◆ m_nEventsProcessed
unsigned long ParticleSelectionAlg::m_nEventsProcessed |
|
private |
◆ m_outCollKey
StringProperty ParticleSelectionAlg::m_outCollKey |
|
private |
◆ m_outOwnPolicy
◆ m_outOwnPolicyName
StringProperty ParticleSelectionAlg::m_outOwnPolicyName |
|
private |
◆ m_outputMetaStore
◆ m_parser
◆ m_prefix
std::string AthHistogramAlgorithm::m_prefix |
|
privateinherited |
◆ m_proxyLoaders
◆ m_renounce
◆ m_rootDir
std::string AthHistogramAlgorithm::m_rootDir |
|
privateinherited |
◆ m_selection
StringProperty ParticleSelectionAlg::m_selection |
|
private |
◆ m_selToolIdxOffset
std::vector<std::size_t> ParticleSelectionAlg::m_selToolIdxOffset |
|
private |
The list of pairs of the tool index of the AsgSelectionTools and the starting index of the corresponding CutBookKeeper inside the CutBookkeeperContainer.
Definition at line 140 of file ParticleSelectionAlg.h.
◆ m_selTools
◆ m_streamName
std::string AthHistogramming::m_streamName |
|
privateinherited |
◆ m_treeMap
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeSplitAux
BooleanProperty ParticleSelectionAlg::m_writeSplitAux |
|
private |
Decide if we want to write a fully-split AuxContainer such that we can remove any variables.
Definition at line 84 of file ParticleSelectionAlg.h.
◆ m_xAODProxyLoader
The documentation for this class was generated from the following files:
std::string m_rootDir
Name of the ROOT directory.
def retrieve(aClass, aKey=None)
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
StringProperty m_cutBKCName
The name of the resulting xAOD::CutBookkeeperContainer.
StatusCode finalizeParser()
CutBookkeeperContainer_v1 CutBookkeeperContainer
Define the latest version of the CutBookkeeperContainer class.
Auxiliary container for CutBookkeeper containers.
void myReplace(std::string &str, const std::string &oldStr, const std::string &newStr)
Helper method to replace sub-string.
MsgStream m_msg
Cached Message Stream.
HistMap_t m_histMap
The map of histogram names to their pointers.
virtual StatusCode endInputFile()
Function called as an input file is being closed.
const ServiceHandle< StoreGateSvc > & outputMetaStore() const
Const accessor for the output metadata store.
void setCycle(int cycle)
Set the skimming cycle that this CutBookkeeper is running in.
virtual StatusCode firstExecute()
Function called when first execute is encountered user can read event information with evtStore()
void setName(const std::string &name)
Set the name of this CutBookkeeper.
std::vector< std::size_t > m_selToolIdxOffset
The list of pairs of the tool index of the AsgSelectionTools and the starting index of the correspond...
ServiceHandle< ITHistSvc > m_histSvc
Default constructor: AthHistogramAlgorithm();.
void setDescription(const std::string &description)
Set the description of this CutBookkeeper.
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
unsigned long m_nEventsProcessed
Internal event counter.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Description of the class that is used to keep track of event counts.
std::conditional< NUM_PARSER==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > >::type m_parser
contType_t m_contType
The variable that holds the value that we find for the input container.
ServiceHandle< StoreGateSvc > m_inputMetaStore
Object accessing the input metadata store.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
ToolHandleArray< IAsgSelectionTool > m_selTools
The list of IAsgSelectionTools.
const ServiceHandle< StoreGateSvc > & inputMetaStore() const
Const accessor for the input metadata store.
#define ATH_MSG_VERBOSE(x)
std::string m_histNamePostfix
The postfix for the histogram THx name.
StringProperty m_inCollKey
Input container name.
std::string getTree(const std::string &file_name)
const std::string & getCutName(unsigned int cutPosition) const
Get the name of a cut, based on the cut position (slow, avoid usage)
StringProperty m_outOwnPolicyName
Defines the ownership policy of the output container (default: 'VIEW_ELEMENTS'; also allowed: 'OWN_EL...
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
@ OWN_ELEMENTS
this data object owns its elements
SG::OwnershipPolicy m_outOwnPolicy
The internally used translation for the ownership policy.
unsigned int getNCuts() const
Get the number of cuts defined.
int maxCycle() const
Get the maximum cycle number of any xAOD::CutBookkeepers in the container.
CutBookkeeperAuxContainer_v1 CutBookkeeperAuxContainer
Define the latest version of the CutBookkeeperAuxContainer class.
StringProperty m_outCollKey
Output collection name (deep copies of the original ones)
Container that holds the Container of all CutBookkeepers.
virtual StatusCode metaDataStop()
Function called before finalize user can read output metadata from outputMetaStore()
GraphMap_t m_graphMap
The map of TGraph names to their pointers.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::string m_streamName
Name of the ROOT output stream (file)
size_t index() const
Return the index of this element within its container.
uint32_t hash_t
typedef for the internal hash
uint32_t CLID
The Class ID type.
uint64_t crc64(const CRCTable &table, const char *data, size_t data_len)
Find the CRC-64 of a string,.
bool m_doCutFlow
If true (deault: false), do the bookkeeping of how many particles passed which selection cuts.
std::string m_histTitlePostfix
The postfix for the histogram THx title.
virtual void renounce()=0
StatusCode initializeParser(const ExpressionParsing::SelectionArg< 1 > &selection_string)
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void setInputStream(const std::string &inputstream)
Set the name of the current input-file stream object for this CutBookkeeper.
CutBookkeeper_v1 CutBookkeeper
Define the latest version of the CutBookkeeper class.
hash_t hash(const std::string &histName) const
Method to calculate a 32-bit hash from a string.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
def getHist(name, makehist)
void setCutLogic(CutLogic logic)
Set the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.
virtual StatusCode sysInitialize()
Initialization method invoked by the framework.
std::uint64_t hash64(const void *data, std::size_t size)
Passthrough to XXH3_64bits.
DataObjIDColl m_extendedExtraObjects
virtual StatusCode beginInputFile()
Function called when a new input file is opened user can read input metadata from inputMetaStore()
EffMap_t m_effMap
The map of histogram names to their pointers.
std::string m_histTitlePrefix
The prefix for the histogram THx title.
def time(flags, cells_name, *args, **kw)
#define ATH_MSG_WARNING(x)
StringProperty m_evtInfoName
Name of the EventInfo object.
TreeMap_t m_treeMap
The map of TTree names to their pointers.
std::string m_histNamePrefix
The prefix for the histogram THx name.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
TH1 * hist(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type.
ServiceHandle< ITHistSvc > m_histSvc
Pointer to the THistSvc (event store by default)
std::size_t m_idxSelParster
Store the index of the CutBookKeeper in the CutBookkeeperContainer for the selection using the Expres...
ServiceHandle< StoreGateSvc > m_outputMetaStore
Object accessing the output metadata store.
BooleanProperty m_writeSplitAux
Decide if we want to write a fully-split AuxContainer such that we can remove any variables.
std::string m_name
Instance name.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::size_t m_cutBKStartIdx
The starting index of where in the CutBookkeeperContainer our new CutBookkeepers start.
const std::string & getCutDescription(const std::string &cutName) const
Get the description of a cut, based on the cut name.
static std::string retrieveMetadata(const std::string &folder, const std::string &key, const ServiceHandle< StoreGateSvc > &inputMetaStore)
method that always returns as a string you can use from, e.g, pyROOT with evt = ROOT....
void buildBookingString(std::string &bookingString, std::string &histName, std::string &tDir, std::string &stream, bool usePrefixPostfix=false)
Method to build individual booking string.
TH1 * bookGetPointer(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
StringProperty m_selection
The selection string that will select which xAOD::IParticles to keep from an xAOD::IParticleContainer...