![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <TopxAODAlg.h>
|
| TopxAODAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
StatusCode | initialize () override |
|
StatusCode | beginInputFile () override |
|
StatusCode | execute () override |
|
StatusCode | endInputFile () override |
|
StatusCode | finalize () override |
|
::StatusCode | requestFileExecute () |
| register this algorithm to have an implementation of fileexecute More...
|
|
::StatusCode | requestBeginInputFile () |
| register this algorithm to have an implementation of beginInputFile More...
|
|
::StatusCode | requestEndInputFile () |
| register this algorithm to have an implementation of endInputFile More...
|
|
void | handle (const Incident &inc) |
| receive the given incident More...
|
|
virtual StatusCode | sysInitialize () |
| Initialization method invoked by the framework. 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 |
|
|
virtual void | print () const |
| print the state of the algorithm More...
|
|
virtual ::StatusCode | fileExecute () |
| perform the action exactly once for each file in the dataset 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...
|
|
|
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...
|
|
Definition at line 39 of file TopxAODAlg.h.
◆ ConstMetaStorePtr_t
◆ EffMap_t
◆ GraphMap_t
◆ hash_t
◆ HistMap_t
◆ MetaStore_t
◆ MetaStorePtr_t
Type of the metadata store pointer in standalone mode.
Definition at line 110 of file AnaAlgorithm.h.
◆ StoreGateSvc_t
◆ TreeMap_t
◆ TopxAODAlg()
top::TopxAODAlg::TopxAODAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Definition at line 22 of file TopxAODAlg.cxx.
28 "Crash if metadata reading failed");
31 "Index of the showering algorithm for FTAG MC/MC SFs");
33 "Name of the showering algorithm for FTAG MC/MC SFs");
35 "Year of data taking (primarily for trigger configuration)");
◆ beginInputFile()
StatusCode top::TopxAODAlg::beginInputFile |
( |
| ) |
|
|
override |
Definition at line 232 of file TopxAODAlg.cxx.
234 double sumW_file = 0;
235 ULong64_t initialEvents = 0;
238 std::vector<float> LHE3_sumW_file;
239 std::vector<std::string> LHE3_names_file;
243 ATH_MSG_INFO(
"Bookkeepers are not read for TRUTH derivations");
246 "Cannot retrieve CutBookkeepers");
250 const std::vector<std::string> &weight_names =
m_pmg_weightTool->getWeightNames();
264 const size_t nominalWeightIndex =
m_config->nominalWeightIndex();
265 sumW_file = LHE3_sumW_file.at(nominalWeightIndex);
268 sumW_file = initialEvents;
281 ATH_MSG_ERROR(
"Strange inconsistency of vector sizes in sum of LHE3 weights calculation.");
282 return StatusCode::FAILURE;
284 for (
unsigned int i_genweights = 0; i_genweights < LHE3_names_file.size(); i_genweights++) {
285 if (
m_names_LHE3.at(i_genweights) != LHE3_names_file.at(i_genweights)) {
286 ATH_MSG_ERROR(
"Strange inconsistency in the vector of weight names in sum of LHE3 "
287 "weights calculation.");
288 return StatusCode::FAILURE;
295 for (
unsigned int i_genweights = 0; i_genweights < LHE3_names_file.size(); i_genweights++) {
296 m_names_LHE3.push_back(LHE3_names_file.at(i_genweights));
302 "The sum of weights for the following LHE3 weights were retrieved from the input file:");
306 msgInfo << std::endl;
310 "No sum of LHE3 weights could be found in meta-data. Will try to recompute these sums.\n"
311 "This only works on un-skimmed derivations, and the names of these weights may be "
312 "unknown (but we'll try to read them from the PMG tool");
320 if (
m_config->printCDIpathWarning()) {
322 "\n*************************************************************************\n"
323 <<
"YOU ARE USING A CUSTOM PATH TO THE CDI FILE WHICH IS NOT THE DEFAULT PATH\n"
324 <<
" YOU MANY NOT BE USING THE LATEST BTAGGING RECOMMENDATIONS \n"
325 <<
"*************************************************************************\n\n");
327 if (
m_config->printEgammaCalibModelWarning()) {
329 "\n*************************************************************************\n"
330 <<
" YOU HAVE CHANGED DEFAULT EGAMMA CALIBRATION MODEL \n"
331 <<
" TO USE DEFAULT MODEL, REMOVE 'EGammaCalibrationModel' FROM CONFIG FILE \n"
332 <<
"*************************************************************************\n\n");
335 if (
m_config->printEIDFileWarning()) {
337 "\n*************************************************************************\n"
338 <<
" YOU ARE USING THIS CUSTOM PATH TO THE ELECTRON ID SF FILE: \n\n"
339 <<
m_config->electronIDSFFilePath() <<
"(Tight) \n\n"
340 <<
m_config->electronIDSFFileLoosePath() <<
"(Loose) \n\n"
341 <<
" INSTEAD OF THE MOST RECENT RECOMMENDED MAP \n"
342 <<
" YOU MANY NOT BE USING THE LATEST ELECTRON ID RECOMMENDATIONS \n"
343 <<
"*************************************************************************\n\n");
346 return StatusCode::SUCCESS;
◆ 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;
◆ 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);
◆ 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.
◆ 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.
◆ 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 top::TopxAODAlg::endInputFile |
( |
| ) |
|
|
override |
Definition at line 656 of file TopxAODAlg.cxx.
666 bool pdfInCBK =
false;
671 std::string
p = pdf_set +
"_0";
673 std::string
pdfName = cbk->name();
695 std::string pdf_set = pdfentry.first;
698 bool foundPdf =
false;
700 std::string
pdfName = cbk->name();
710 ATH_MSG_ERROR(
"The force is not strong with us, young Padawan ...\n"
711 "You want to save weights to do PDF reweighting using '"
712 << pdf_set <<
"', which I figure has "
715 "There is metadata information for the sum of MC*PDF weights in "
717 "but none seem to refer to '"
719 <<
"' therefore I do not know how to estimate "
720 "the sum of weights before acceptance for this configuration.\n"
721 "May the force be with you in your next attempt.");
722 return StatusCode::FAILURE;
730 return StatusCode::SUCCESS;
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode top::TopxAODAlg::execute |
( |
| ) |
|
|
override |
– Truth events –///
– End of Truth events – start of reconstruction level events –///
– We veto events that do not pass the GRL, trigger or have bad calorimeters –/// – No point calibrating and cutting on events that fail these cuts –/// – We only apply a veto if ALL selectors request a cut –/// – And if the user selects "OutputEvents SelectedEvents" –///
– Count initial events –///
– Does event pass the GRL? (always true for MC) –/// – Only veto events when ALL user selectors request GRL –///
– Are the Tile and LAr calorimeters in a good state? (always true for MC) –/// – Only veto events when ALL user selectors request GOODCALO –///
– Do we have a Primary Vertex? –/// – Only veto events when ALL user selectors request PRIVTX – ///
– Wondering which triggers are available ??? –/// – Uncomment this line and get ready for a LOT of output –///
– Does event pass any trigger ? –/// – Only veto events when ALL user selectors request TRIGDEC –/// – And all trigger fail –///
– Nominal objects – /// – Calibrate objects and make all required systematic copies –///
– Object selection (e.g. good electrons, muons, jets etc.). Event selection cuts comes later –///
– Recalculate MissingET based on object selection –///
– Systematic objects – /// – Calibrate objects and make all required systematic copies –///
– Object selection (e.g. good electrons, muons, jets etc.). Event selection cuts comes later –///
– Recalculate MissingET based on object selection –///
– Scale Factor calculation –///
– Loop over all systematics and make a "top::Event" for each –///
– Make a top::Event –///
– Apply event selection –///
– Save event - we defer to eventSaver the decision to write or not –///
– For printout at the end of job, only count nominal events –///
– End loop over all calibration systematics –///
– End of tight events –///
– Loop over all Loose systematics and make a "top::Event" for each –///
– Make a top::Event –///
– Apply event selection –///
– weights for matrix-method fakes estimate from IFF tools, only for nominal –///
– Save event - we defer to eventSaver the decision to write or not –///
– For printout at the end of job, only count nominal events –///
– End loop over all loose calibration systematics –///
– End of loose events –///
– Needed for xAOD output, all systematics go into the same TTree –///
Definition at line 349 of file TopxAODAlg.cxx.
354 float mcEventWeight(1.), pileupWeight(1.);
396 const bool saveEventInOutputFile =
399 if (saveEventInOutputFile) {
400 m_eventSaver->saveParticleLevelEvent(particleLevelEvent);
408 "Failed to retrieve TruthEvent container for LHAPDF");
410 "TruthEvent container size != 1, not sure what to do with PDF reweighting");
411 for (
const auto *tePtr : *truthEvent) {
413 if (tePtr->isAvailable<std::vector<float>>(
"AnalysisTop_" +
pdf.first +
"_Weights")) {
415 tePtr->auxdata<std::vector<float>>(
"AnalysisTop_" +
pdf.first +
"_Weights").size());
426 "Failed to retrieve LHE3 weights from EventInfo");
430 ATH_MSG_INFO(
"Trying to recalculate nominal weights sum for TRUTH derivation");
431 const size_t nominalWeightIndex =
m_config->nominalWeightIndex();
436 if (
m_config->doMCGeneratorWeights()) {
437 unsigned int weightsSize = ei->mcEventWeights().size();
441 for (
unsigned int i_LHE3 = 0; i_LHE3 < weightsSize; i_LHE3++) {
446 const std::vector<std::string> &weight_names =
m_pmg_weightTool->getWeightNames();
447 if (weight_names.size() != weightsSize) {
449 "In top-xaod, while calculating mc weights sums on the fly, names from PMG tools "
450 "have different size wrt weight vector, we'll not retrieve weight names");
453 for (
unsigned int i_wgt = 0; i_wgt < weight_names.size(); i_wgt++)
457 for (
unsigned int i_LHE3 = 0; i_LHE3 < weightsSize; i_LHE3++) {
464 ATH_MSG_ERROR(
"Strange size inconsistency in the AllExecutedEvents* "
465 "sum of weights bookkeepers from the meta-data and the vector of "
466 "LHE3 weights in the EventInfo container.");
467 return StatusCode::FAILURE;
473 return StatusCode::SUCCESS;
487 setFilterPassed(
false);
488 return StatusCode::SUCCESS;
496 setFilterPassed(
false);
497 return StatusCode::SUCCESS;
505 setFilterPassed(
false);
506 return StatusCode::SUCCESS;
518 if (!passAnyTriggerVeto) {
519 setFilterPassed(
false);
520 return StatusCode::SUCCESS;
553 for (
const auto *currentSystematic : *allSystematics) {
554 if (!(currentSystematic->hashValue() ==
m_config->nominalHashValue() ||
561 const bool passAnyEventSelection =
570 "\n********************************************************************************"
571 "*******\nYou are running over MC campaigns which support actual mu rewighting, but you are not using it!"
572 "\nYou are strongly adviced to use it.\nCheck "
573 "https://twiki.cern.ch/twiki/bin/view/AtlasProtected/"
574 "TopxAODStartGuideR21#PRW_and_Lumicalc_files\n*************************************"
575 "**************************************************\n");
579 currentSystematic->auxdecor<
char>(
m_config->passEventSelectionDecoration()) =
580 passAnyEventSelection ? 1 : 0;
586 if (passAnyEventSelection && currentSystematic->hashValue() ==
m_config->nominalHashValue())
597 for (
const auto *currentSystematic : *allSystematicsLoose) {
598 if (!(currentSystematic->hashValue() ==
m_config->nominalHashValue() ||
605 const bool passAnyEventSelection =
615 "\n********************************************************************************"
616 "*******\nYou are running over mc16d or mc16e sample but you are not using actual "
617 "mu reweighting!\nYou are strongly adviced to use it.\nCheck "
618 "https://twiki.cern.ch/twiki/bin/view/AtlasProtected/"
619 "TopxAODStartGuideR21#PRW_and_Lumicalc_files\n*************************************"
620 "**************************************************\n");
624 currentSystematic->auxdecor<
char>(
m_config->passEventSelectionDecoration()) =
625 passAnyEventSelection ? 1 : 0;
629 currentSystematic->hashValue() ==
m_config->nominalHashValue()) {
642 if (passAnyEventSelection && currentSystematic->hashValue() ==
m_config->nominalHashValue())
653 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();
◆ fileExecute()
StatusCode EL::AnaAlgorithm::fileExecute |
( |
| ) |
|
|
protectedinherited |
perform the action exactly once for each file in the dataset
Ideally you don't use this, but instead rely on meta-data tools instead. However, there are enough people asking for it that I decided to implement it anyways.
\warn To use this you have to call requestFileExecute to use this.
\warn The user should not expect this to be called at any particular point in execution. If a file is split between multiple jobs this will be called in only one of these jobs, and not the others. It usually gets called before the first event in a file, but that is not guaranteed and relying on this is a bug.
\warn The execution order of beginInputFile and fileExecute is currently unspecified.
\warn fileExecute does not work with sub-file splitting in Athena, i.e. processing half the events of a file in one job the other half in another job. this should not normally happen, unless you do crazy things like run AthenaMP or explicitly select sub-file splitting in panda. in that case you are on your own.
Definition at line 342 of file AnaAlgorithm.cxx.
345 return StatusCode::SUCCESS;
◆ finalize()
StatusCode top::TopxAODAlg::finalize |
( |
| ) |
|
|
override |
Definition at line 733 of file TopxAODAlg.cxx.
761 ATH_MSG_ERROR(
"These are not the droids you are looking for.\n"
762 "You are running over skimmed derivations. We cannot determine "
763 "the sum of MC*PDF weights before skimming "
764 "because no PDF metadata is available in the file!");
765 return StatusCode::FAILURE;
769 for (
auto &pdf_result :
m_config->getLHAPDFResults())
780 m_tracker->writeTree(
"AnalysisTracking");
786 ATH_MSG_INFO(
"Events saved to output file nominal loose reconstruction tree: "
803 return StatusCode::SUCCESS;
◆ 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 EL::AnaAlgorithm::handle |
( |
const Incident & |
inc | ) |
|
|
inherited |
receive the given incident
- Guarantee
- basic
- Failures
- incident handling errors
Definition at line 520 of file AnaAlgorithm.cxx.
523 if (inc.type() == IncidentType::BeginInputFile)
529 }
else if (inc.type() == IncidentType::EndInputFile)
◆ 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 top::TopxAODAlg::initialize |
( |
| ) |
|
|
override |
Definition at line 39 of file TopxAODAlg.cxx.
49 if (
inputMetaStore()->contains<xAOD::FileMetaData>(
"FileMetaData")) {
53 ATH_MSG_ERROR(
"Could not retrieve FileMetadata. We thus cannot reliably pre-determine DSID, "
54 "whether this is MC, and simulation type.");
56 return StatusCode::FAILURE;
76 bool useTracking =
true;
77 m_settings->retrieve(
"WriteTrackingData", useTracking);
86 if (
m_settings->value(
"PerfStats") ==
"Summary")
99 return StatusCode::FAILURE;
111 "Failed to setProperty of triggerGRLSelection");
118 "Failed to setProperty of systObjMaker");
151 if (
m_settings->value(
"TopPartonHistory") ==
"ttbar") {
154 "Failed to setProperty of top::CalcTtbarPartonHistory");
156 ATH_MSG_ERROR(
"Only ttbar TopPartonHistory is supported for the moment!");
157 return StatusCode::FAILURE;
164 "Failed to set config for PDF SF Calculator");
171 "Failed to setProperty of top::TopEventMaker");
178 "Failed to setProperty of top::ScaleFactorCalculator");
184 std::vector<std::string> extraBranches;
201 if (
m_config->doMCGeneratorWeights()) {
212 unsigned int dsidPdf =
m_config->getDSID();
216 for (
const auto &pdf_set :
m_config->LHAPDFSets()) {
229 return StatusCode::SUCCESS;
◆ 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]
AnaAlgorithm::MetaStorePtr_t EL::AnaAlgorithm::inputMetaStore |
( |
| ) |
|
|
inherited |
Definition at line 81 of file AnaAlgorithm.cxx.
83 #ifdef XAOD_STANDALONE
87 #endif // XAOD_STANDALONE
◆ inputMetaStore() [2/2]
AnaAlgorithm::ConstMetaStorePtr_t EL::AnaAlgorithm::inputMetaStore |
( |
| ) |
const |
|
inherited |
Accessor for the input metadata store
Definition at line 72 of file AnaAlgorithm.cxx.
74 #ifdef XAOD_STANDALONE
78 #endif // XAOD_STANDALONE
◆ 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]
AnaAlgorithm::MetaStorePtr_t EL::AnaAlgorithm::outputMetaStore |
( |
| ) |
|
|
inherited |
Definition at line 101 of file AnaAlgorithm.cxx.
103 #ifdef XAOD_STANDALONE
107 #endif // XAOD_STANDALONE
◆ outputMetaStore() [2/2]
AnaAlgorithm::ConstMetaStorePtr_t EL::AnaAlgorithm::outputMetaStore |
( |
| ) |
const |
|
inherited |
Accessor for the output metadata store
Definition at line 92 of file AnaAlgorithm.cxx.
94 #ifdef XAOD_STANDALONE
98 #endif // XAOD_STANDALONE
◆ print()
void EL::AnaAlgorithm::print |
( |
| ) |
const |
|
protectedvirtualinherited |
print the state of the algorithm
This is mostly to allow algorithms to add a little debugging information if they feel like it.
Definition at line 336 of file AnaAlgorithm.cxx.
◆ renounce()
◆ renounceArray()
◆ requestBeginInputFile()
StatusCode EL::AnaAlgorithm::requestBeginInputFile |
( |
| ) |
|
|
inherited |
register this algorithm to have an implementation of beginInputFile
- Guarantee
- strong
- Failures
- beginInputFile not supported
Definition at line 270 of file AnaAlgorithm.cxx.
275 #ifndef XAOD_STANDALONE
282 incSvc->removeListener(
this, IncidentType::BeginInputFile );
283 incSvc->addListener(
this, IncidentType::BeginInputFile, 0,
true );
286 return StatusCode::SUCCESS;
◆ requestEndInputFile()
StatusCode EL::AnaAlgorithm::requestEndInputFile |
( |
| ) |
|
|
inherited |
register this algorithm to have an implementation of endInputFile
- Guarantee
- strong
- Failures
- endInputFile not supported
Definition at line 291 of file AnaAlgorithm.cxx.
296 #ifndef XAOD_STANDALONE
303 incSvc->removeListener(
this, IncidentType::EndInputFile );
304 incSvc->addListener(
this, IncidentType::EndInputFile, 0,
true );
307 return StatusCode::SUCCESS;
◆ requestFileExecute()
StatusCode EL::AnaAlgorithm::requestFileExecute |
( |
| ) |
|
|
inherited |
register this algorithm to have an implementation of fileexecute
- Guarantee
- strong
- Failures
- fileExecute not supported
Definition at line 249 of file AnaAlgorithm.cxx.
254 #ifndef XAOD_STANDALONE
261 incSvc->removeListener(
this, IncidentType::BeginInputFile );
262 incSvc->addListener(
this, IncidentType::BeginInputFile, 0,
true );
265 return StatusCode::SUCCESS;
◆ sysInitialize()
StatusCode AthHistogramAlgorithm::sysInitialize |
( |
| ) |
|
|
virtualinherited |
Initialization method invoked by the framework.
This method is responsible for any bookkeeping of initialization required by the framework itself. It will in turn invoke the initialize() method of the derived algorithm, and of any sub-algorithms which it creates.
Reimplemented from AthAlgorithm.
Reimplemented in AthAnalysisAlgorithm.
Definition at line 75 of file AthHistogramAlgorithm.cxx.
80 if ( Gaudi::StateMachine::INITIALIZED <= FSMState() )
return StatusCode::SUCCESS;
83 bindPropertiesTo( serviceLocator()->getOptsSvc() );
87 if ( !isEnabled( ) )
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 ) );
◆ updateVHKA()
◆ m_boostedTaggersSFSysNames
std::unordered_map<std::string, std::vector<std::string> > top::TopxAODAlg::m_boostedTaggersSFSysNames |
|
private |
◆ m_config
std::shared_ptr<TopConfig> top::TopxAODAlg::m_config {nullptr} |
|
private |
◆ m_configPath
std::string top::TopxAODAlg::m_configPath {""} |
|
private |
◆ m_crashOnMetaDataFail
bool top::TopxAODAlg::m_crashOnMetaDataFail {true} |
|
private |
◆ m_derivationStream
std::string top::TopxAODAlg::m_derivationStream {""} |
|
private |
◆ m_detStore
◆ m_doPerfStats
unsigned int top::TopxAODAlg::m_doPerfStats = 0u |
|
private |
◆ m_DSID
unsigned int top::TopxAODAlg::m_DSID |
|
private |
◆ m_effMap
◆ m_entry
unsigned int top::TopxAODAlg::m_entry = 0u |
|
private |
◆ m_eventCleaning
◆ m_eventSavedParticle
unsigned int top::TopxAODAlg::m_eventSavedParticle = 0u |
|
private |
◆ m_eventSavedReco
unsigned int top::TopxAODAlg::m_eventSavedReco = 0u |
|
private |
◆ m_eventSavedRecoLoose
unsigned int top::TopxAODAlg::m_eventSavedRecoLoose = 0u |
|
private |
◆ m_eventSavedTruth
unsigned int top::TopxAODAlg::m_eventSavedTruth = 0u |
|
private |
◆ m_eventSaver
◆ m_eventSelectionManager
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_firstEvent
unsigned int top::TopxAODAlg::m_firstEvent = 0u |
|
private |
◆ m_FTAGMapIndex
unsigned int top::TopxAODAlg::m_FTAGMapIndex |
|
private |
◆ m_graphMap
◆ m_hasBeginInputFile
bool EL::AnaAlgorithm::m_hasBeginInputFile {false} |
|
privateinherited |
◆ m_hasEndInputFile
bool EL::AnaAlgorithm::m_hasEndInputFile {false} |
|
privateinherited |
◆ m_hasFileExecute
bool EL::AnaAlgorithm::m_hasFileExecute {false} |
|
privateinherited |
◆ 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_inputMetaStore
Object accessing the input metadata store.
Definition at line 551 of file AnaAlgorithm.h.
◆ m_isAFII
int top::TopxAODAlg::m_isAFII |
|
private |
◆ m_isFirst
bool top::TopxAODAlg::m_isFirst = true |
|
private |
◆ m_libraryNames
std::string top::TopxAODAlg::m_libraryNames {""} |
|
private |
◆ m_msg
MsgStream AthHistogramming::m_msg |
|
privateinherited |
◆ m_name
std::string AthHistogramming::m_name |
|
privateinherited |
◆ m_names_LHE3
std::vector<std::string> top::TopxAODAlg::m_names_LHE3 |
|
private |
◆ m_objectSelection
◆ m_outputFile
TFile* top::TopxAODAlg::m_outputFile = nullptr |
|
private |
◆ m_outputMetaStore
Object accessing the output metadata store.
Definition at line 555 of file AnaAlgorithm.h.
◆ m_particleLevelLoader
◆ m_PDF_SF
◆ m_pdfMetadataExists
bool top::TopxAODAlg::m_pdfMetadataExists = false |
|
private |
◆ m_pmg_weightTool
◆ m_prefix
std::string AthHistogramAlgorithm::m_prefix |
|
privateinherited |
◆ m_recalc_LHE3
bool top::TopxAODAlg::m_recalc_LHE3 = false |
|
private |
◆ m_recalculateNominalWeightSum
bool top::TopxAODAlg::m_recalculateNominalWeightSum = false |
|
private |
◆ m_rootDir
std::string AthHistogramAlgorithm::m_rootDir |
|
privateinherited |
◆ m_settings
◆ m_showeringAlgo
◆ m_streamName
std::string top::TopxAODAlg::m_streamName {"output"} |
|
private |
◆ m_sumPdfWeights
TTree* top::TopxAODAlg::m_sumPdfWeights = nullptr |
|
private |
◆ m_sumWeights
TTree* top::TopxAODAlg::m_sumWeights = nullptr |
|
private |
◆ m_systObjMaker
◆ m_topEventMaker
◆ m_topPartonHistory
◆ m_topScaleFactors
◆ m_topTools
◆ m_totalEvents
ULong64_t top::TopxAODAlg::m_totalEvents = 0 |
|
private |
◆ m_totalEventsInFiles
ULong64_t top::TopxAODAlg::m_totalEventsInFiles = 0 |
|
private |
◆ m_totalEventsPdfWeighted
std::unordered_map<std::string, std::unique_ptr<std::vector<float> > > top::TopxAODAlg::m_totalEventsPdfWeighted |
|
private |
◆ m_totalEventsWeighted
double top::TopxAODAlg::m_totalEventsWeighted = 0 |
|
private |
◆ m_totalEventsWeighted_LHE3
std::vector<double> top::TopxAODAlg::m_totalEventsWeighted_LHE3 |
|
private |
◆ m_totalEventsWeighted_LHE3_temp
std::vector<double> top::TopxAODAlg::m_totalEventsWeighted_LHE3_temp |
|
private |
◆ m_totalEventsWeighted_temp
double top::TopxAODAlg::m_totalEventsWeighted_temp = 0 |
|
private |
◆ m_totalYieldSoFar
unsigned int top::TopxAODAlg::m_totalYieldSoFar = 0u |
|
private |
◆ m_tracker
◆ m_treeMap
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_year
std::string top::TopxAODAlg::m_year |
|
private |
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...
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
unsigned int m_eventSavedRecoLoose
bool m_hasBeginInputFile
the value of hasBeginInputFile
virtual ::StatusCode endInputFile()
perform the action for the end of an input file
const xAOD::EventInfo * m_info
Pointer to the event info - nullptr if not loaded, but that's probably a bad idea.
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.
ToolHandle< top::ParticleLevelLoader > m_particleLevelLoader
ServiceHandle< ITHistSvc > m_histSvc
Default constructor: AthHistogramAlgorithm();.
bool m_recalculateNominalWeightSum
ReadStats & stats()
Access the object belonging to the current thread.
void start(bool clear=true)
Start the statistics collection.
unsigned int m_eventSavedParticle
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
Maybe you want to run multiple selections (e+jets, mu+jets) on the same input files at the same time.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
ToolHandle< top::ScaleFactorCalculator > m_topScaleFactors
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
ToolHandle< top::ObjectCollectionMaker > m_systObjMaker
std::unordered_map< std::string, std::vector< std::string > > m_boostedTaggersSFSysNames
MetaStore_t m_inputMetaStore
Object accessing the input metadata store.
Description of the class that is used to keep track of event counts.
unsigned int m_totalYieldSoFar
MetaStore_t m_outputMetaStore
Object accessing the output metadata store.
ConstMetaStorePtr_t inputMetaStore() const
void Print(::Option_t *option="") const
Print information about the collected statistics.
std::unique_ptr< top::AnalysisTrackingHelper > m_tracker
SampleXsection::showering m_showeringAlgo
std::unordered_map< std::string, std::unique_ptr< std::vector< float > > > m_totalEventsPdfWeighted
unsigned int m_eventSavedReco
std::string m_prefix
Name of the ROOT output stream (file)
virtual ::StatusCode beginInputFile()
perform the action for the beginning of an input file
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
std::vector< double > m_totalEventsWeighted_LHE3
std::string m_histNamePrefix
The prefix for the histogram THx name.
std::shared_ptr< ConfigurationSettings > m_settings
top::TopObjectSelection * loadObjectSelection(const std::shared_ptr< top::TopConfig > &config)
Users may want to define (and load!) their own object selection.
std::string m_histTitlePrefix
The prefix for the histogram THx title.
ToolHandle< top::EventCleaningSelection > m_eventCleaning
bool readMetaData(TFile *inputFile, const std::shared_ptr< top::TopConfig > &config)
This function will be used to load the metadata object and pull information from it.
std::string m_histNamePostfix
The postfix for the histogram THx name.
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
virtual ::StatusCode fileExecute()
perform the action exactly once for each file in the dataset
std::string getTree(const std::string &file_name)
uint32_t runNumber() const
The current event's run number.
ToolHandle< top::TopToolStore > m_topTools
Loading tool which creates a particle level event object.
virtual void setOwner(IDataHandleHolder *o)=0
TopEventMaker produce top::Event objects from xAOD::SystematicEvent objects.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
std::vector< double > m_totalEventsWeighted_LHE3_temp
xAOD::MuonContainer m_muons
Container of muons (can be sorted)
virtual StatusCode sysInitialize() override
Override sysInitialize.
POOL::TEvent event(POOL::TEvent::kClassAccess)
xAOD::ElectronContainer m_electrons
Container of electrons (can be sorted)
unsigned int m_FTAGMapIndex
static ConfigurationSettings * get(bool reset=false)
Design patterns 101.
::StatusCode requestBeginInputFile()
register this algorithm to have an implementation of beginInputFile
Helper for collecting data for analysis tracking.
unsigned int m_firstEvent
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
void parseCutBookkeepers(xAOD::TEvent &xaodEvent, const std::size_t size, std::vector< std::string > &names, std::vector< float > &sumW)
Search bookkeepers for ones matching AllExecutedEvents, and which originate from AOD before skimming.
Container that holds the Container of all CutBookkeepers.
bool m_hasFileExecute
the value of hasFileExecute
GraphMap_t m_graphMap
The map of TGraph names to their pointers.
ToolHandle< top::PDFScaleFactorCalculator > m_PDF_SF
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::string m_streamName
Name of the ROOT output stream (file)
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.
static IOStats & instance()
Singleton object accessor.
uint32_t hash_t
typedef for the internal hash
uint64_t crc64(const CRCTable &table, const char *data, size_t data_len)
Find the CRC-64 of a string,.
std::string m_histTitlePostfix
The postfix for the histogram THx title.
unsigned int m_doPerfStats
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::vector< std::string > m_names_LHE3
ULong64_t getRawEventsBookkeeper(const xAOD::CutBookkeeperContainer *cutBookKeepers)
Get raw number of events before skimming from "AllExecutedEvents" bookkeeper.
ToolHandle< top::TopObjectSelection > m_objectSelection
std::string to_string(const DetectorType &type)
bool m_crashOnMetaDataFail
::StatusCode requestEndInputFile()
register this algorithm to have an implementation of endInputFile
hash_t hash(const std::string &histName) const
Method to calculate a 32-bit hash from a string.
ULong64_t m_totalEventsInFiles
def getHist(name, makehist)
static PerfStats & instance()
Function accessing the singleton instance.
double m_totalEventsWeighted_temp
unsigned int m_eventSavedTruth
Class describing the basic event information.
std::unique_ptr< top::EventSelectionManager > m_eventSelectionManager
std::uint64_t hash64(const void *data, std::size_t size)
Passthrough to XXH3_64bits.
DataObjIDColl m_extendedExtraObjects
std::unique_ptr< top::EventSaverBase > m_eventSaver
EffMap_t m_effMap
The map of histogram names to their pointers.
std::string m_histTitlePrefix
The prefix for the histogram THx title.
#define ATH_MSG_WARNING(x)
double m_totalEventsWeighted
std::string m_histNamePostfix
The postfix for the histogram THx name.
TreeMap_t m_treeMap
The map of TTree names to their pointers.
std::string m_derivationStream
std::string m_histNamePrefix
The prefix for the histogram THx name.
bool m_hasEndInputFile
the value of hasEndInputFile
ToolHandle< PMGTools::IPMGTruthWeightTool > m_pmg_weightTool
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::string m_histTitlePostfix
The postfix for the histogram THx title.
void renameCutBookkeepers(std::vector< std::string > &bookkeeper_names, const std::vector< std::string > &pmg_weight_names)
Rename CutBookkeeper names according to MC generator weight names reported by PMGTruthWeightTool.
TH1 * hist(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type.
void stop()
Stop the statistics collection.
ToolHandle< top::TopEventMaker > m_topEventMaker
ServiceHandle< ITHistSvc > m_histSvc
Pointer to the THistSvc (event store by default)
Very simple class to hold event data after reading from a file.
ToolHandle< top::CalcTtbarPartonHistory > m_topPartonHistory
std::string m_libraryNames
std::string m_name
Instance name.
std::string m_rootDir
Name of the ROOT directory.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
top::EventSaverBase * loadEventSaver(const std::shared_ptr< top::TopConfig > &config)
Users may also want to write out custom ntuples / xAODs.
For testing PDF reweighting with LHAPDF6.
std::string m_configPath
properties
std::shared_ptr< TopConfig > m_config
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.
bool m_saveEvent
save the event?