|
ATLAS Offline Software
|
#include <SUSYToolsAlg.h>
|
| SUSYToolsAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
| ~SUSYToolsAlg () |
|
StatusCode | initialize () |
|
StatusCode | execute () |
|
StatusCode | finalize () |
|
::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...
|
|
virtual ::StatusCode | beginInputFile () |
| perform the action for the beginning of an input file More...
|
|
virtual ::StatusCode | endInputFile () |
| perform the action for the end of an input file 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...
|
|
|
| SUSYToolsAlg () |
|
void | groupSysts (void) |
|
StatusCode | bookHistograms (void) |
|
void | stdHistsForObj (xAOD::IParticle *obj, const std::string &objtype, const std::string &objlevel, std::map< std::string, std::string > config=std::map< std::string, std::string >()) |
|
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 51 of file SUSYToolsAlg.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
◆ SUSYToolsAlg() [1/2]
SUSYToolsAlg::SUSYToolsAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~SUSYToolsAlg()
SUSYToolsAlg::~SUSYToolsAlg |
( |
| ) |
|
◆ SUSYToolsAlg() [2/2]
SUSYToolsAlg::SUSYToolsAlg |
( |
| ) |
|
|
private |
◆ beginInputFile()
StatusCode EL::AnaAlgorithm::beginInputFile |
( |
| ) |
|
|
protectedinherited |
perform the action for the beginning of an input file
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 requestBeginInputFile to use this.
\warn If a file is split across multiple jobs this will be called more than once. This only happens for specific batch drivers and/or if it is explicitly configured by the user. With PROOF it could even happen multiple times within the same job, and while PROOF is no longer supported that behavior may come back if support for a similar framework is added in the future. As such, this method should not be used for accounting that relies to be called exactly once per file, take a look at fileExecute if you want something that is guaranteed to be executed exactly once per input file.
\warn The execution order of beginInputFile and fileExecute is currently unspecified.
Definition at line 350 of file AnaAlgorithm.cxx.
353 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;
◆ bookHistograms()
StatusCode SUSYToolsAlg::bookHistograms |
( |
void |
| ) |
|
|
private |
Definition at line 1320 of file SUSYToolsAlg.cxx.
1322 ATH_CHECK(
book(TH1D(
"EventInfo/info_runNo",
";RunNumber;N", 1500, 250000, 400000)) );
1323 ATH_CHECK(
book(TH1D(
"EventInfo/info_evtNo",
";EventNumber;N", 600, 100000000, 400000000)) );
1324 ATH_CHECK(
book(TH1D(
"EventInfo/info_lumiBlock",
";LumiBlock;N", 1000, 0, 1000)) );
1327 m_objects = {
"el",
"ph",
"mu",
"tau",
"jet",
"bjet",
"fatjet",
"trkjet"};
1329 m_vars = {
"pt",
"eta",
"phi",
"e",
"mass",
"d0",
"z0",
"isolCalo",
"isolTrack",
"truthType",
"truthOrigin",
"N",
"bweight",
"bweightpb",
"bweightpc",
"bweightpu",
"pid",
"parentpid",
"wtagged",
"ztagged",
"toptagged",
"toptaggedscore",
"nTracks",
"nTracksCharged",
"nTracksIsolation",
"RNNJetScoreSigTrans"};
1330 std::map<std::string,std::vector<std::string>> cfg_hist_labels = {
1331 {
"pt",{
"p_{T} [GeV]",
"N"}}, {
"eta",{
"#eta",
"N"}}, {
"phi",{
"#phi",
"N"}}, {
"e",{
"energy",
"N"}}, {
"mass",{
"mass",
"N"}},
1332 {
"d0",{
"d0 significance",
"N"}}, {
"z0",{
"z0 * sin(#theta)",
"N"}}, {
"isolCalo",{
"isolation (calo) / pT",
"N"}}, {
"isolTrack",{
"isolation (track) / pT",
"N"}},
1333 {
"truthType",{
"truth type",
"N"}}, {
"truthOrigin",{
"truth origin",
"N"}}, {
"N",{
"count",
"N"}},
1334 {
"bweight",{
"b-weight",
"N"}}, {
"bweightpb",{
"b-weight (pb)",
"N"}}, {
"bweightpc",{
"b-weight (pc)",
"N"}}, {
"bweightpu",{
"b-weight (pu)",
"N"}},
1335 {
"pid", {
"pdg ID",
"N"}}, {
"parentpid", {
"parent pdg ID",
"N"}},
1336 {
"wtagged", {
"W tagged",
"N"}}, {
"ztagged", {
"Z tagged",
"N"}}, {
"toptagged", {
"Top tagged",
"N"}}, {
"toptaggedscore", {
"Top tagger score",
"N"}},
1337 {
"nTracks", {
"N tracks",
"N"}}, {
"nTracksCharged", {
"N tracks charged",
"N"}}, {
"nTracksIsolation", {
"N tracks isolation",
"N"}}, {
"RNNJetScoreSigTrans", {
"RNNJetScoreSigTrans",
"N"}} };
1338 std::map<std::string,int> cfg_hist_nbins = {
1339 {
"pt",100}, {
"eta",40}, {
"phi",64}, {
"e",100}, {
"mass",100},
1340 {
"d0",50}, {
"z0",60}, {
"isolCalo",70}, {
"isolTrack",70},
1341 {
"truthType",50}, {
"truthOrigin",50}, {
"N",16},
1342 {
"bweight",200}, {
"bweightpb",200}, {
"bweightpc",200}, {
"bweightpu",200},
1343 {
"pid",61}, {
"parentpid",61},
1344 {
"wtagged",3}, {
"ztagged",3}, {
"toptagged",3}, {
"toptaggedscore",50},
1345 {
"nTracks",20}, {
"nTracksCharged",20}, {
"nTracksIsolation",5}, {
"RNNJetScoreSigTrans",50} };
1346 std::map<std::string,std::vector<float>> cfg_hist_minmax = {
1347 {
"pt",{0,200}}, {
"eta",{-4,4}}, {
"phi",{-3.2,3.2}}, {
"e",{0,200}}, {
"mass",{0,200}},
1348 {
"d0",{-10,10}}, {
"z0",{-1.5,1.5}}, {
"isolCalo",{-0.2,0.5}}, {
"isolTrack",{-0.2,0.5}},
1349 {
"truthType",{0,50}}, {
"truthOrigin",{0,50}}, {
"N",{0,16}},
1350 {
"bweight",{-10,10}}, {
"bweightpb",{-0.5,1.5}}, {
"bweightpc",{-0.5,1.5}}, {
"bweightpu",{-0.5,1.5}},
1351 {
"pid",{-30.5,30.5}}, {
"parentpid",{-30.5,30.5}},
1352 {
"wtagged", {-1,2}}, {
"ztagged", {-1,2}}, {
"toptagged", {-1,2}}, {
"toptaggedscore", {0,1}},
1353 {
"nTracks", {0,20}}, {
"nTracksCharged", {0,20}}, {
"nTracksIsolation", {0,5}}, {
"RNNJetScoreSigTrans", {0,1}} };
1354 std::map<std::string,std::string> labels_objects = { {
"el",
"Electron"}, {
"ph",
"Photon"}, {
"mu",
"Muon"}, {
"jet",
"Jet"}, {
"bjet",
"b-Jet"}, {
"tau",
"Tau"}, {
"fatjet",
"Large-R jet"}, {
"trkjet",
"Track jet"} };
1355 std::map<std::string,std::string> labels_levels = { {
"nom",
"Nominal"}, {
"bsl",
"Baseline"}, {
"sig",
"Signal"} };
1356 std::map<std::string,std::string> labels_dir = { {
"el",
"Electron"}, {
"ph",
"Photon"}, {
"mu",
"Muon"}, {
"jet",
"Jet"}, {
"bjet",
"bJet"}, {
"tau",
"Tau"}, {
"fatjet",
"LargeRJet"}, {
"trkjet",
"TrackJet"} };
1368 if (
var.find(
"bweight")!=std::string::npos &&
obj.compare(
"bjet")!=0)
continue;
1369 if (
var.find(
"tagged")!=std::string::npos &&
obj.compare(
"fatjet")!=0)
continue;
1370 if ((
var.find(
"nTracks")!=std::string::npos||
var.find(
"RNNJetScore")!=std::string::npos) &&
obj.compare(
"tau")!=0)
continue;
1371 if (
var.find(
"isol")!=std::string::npos && !(
obj.compare(
"el")==0||
obj.compare(
"mu")==0||
obj.compare(
"ph")==0))
continue;
1372 std::string
key = labels_dir[
obj] +
"/" +
obj +
"_" + lev +
"_" +
var;
1373 std::string
labels =
";"+labels_levels[lev]+
" "+labels_objects[
obj]+
" "+cfg_hist_labels[
var][0]+
";"+cfg_hist_labels[
var][1];
1381 #ifdef XAOD_STANDALONE
1382 for (std::string
obj : {
"el",
"mu",
"ph"}) {
1385 for (std::string
var : {
"pt",
"eta",
"phi"} ) {
1386 std::string
key =
"Trigger/"+
obj+
"_"+
var+
"_"+trg;
1387 std::string
labels =
";"+labels_objects[
obj]+
" "+cfg_hist_labels[
var][0]+
";Efficiency "+trg;
1406 ATH_CHECK(
book(TH1D(
"Cutflow/fatjet_n_flow_nominal",
"Large R. Jet Cutflow (Nominal);Large R. Jet Cutflow (Nominal);N",
Cut::NSel, 0,
Cut::NSel) ) );
1410 ATH_CHECK(
book(TH1D(
"MET/met_et",
"MET (Nominal);MET (Nominal) [GeV];N / [10 GeV]", 50, 0, 500) ) );
1411 ATH_CHECK(
book(TH1D(
"MET/met_phi",
"MET_phi (Nominal);MET_phi (Nominal);N", 50, -5, 5) ) );
1412 ATH_CHECK(
book(TH1D(
"MET/met_sumet",
"MET_sumet (Nominal);MET_sumet (Nominal) [GeV];N / [10 GeV]", 50, 0, 500) ) );
1413 ATH_CHECK(
book(TH1D(
"MET/met_et_tst",
"MET [PVSoftTrk] (Nominal);MET [PVSoftTrk] (Nominal) [GeV];N / [10 GeV]", 50, 0, 500) ) );
1414 ATH_CHECK(
book(TH1D(
"MET/met_et_el",
"MET [RefEle] (Nominal);MET [RefEle] (Nominal) [GeV];N / [10 GeV]", 50, 0, 500) ) );
1415 ATH_CHECK(
book(TH1D(
"MET/met_et_ph",
"MET [RefGamma] (Nominal);MET [RefGamma] (Nominal) [GeV];N / [10 GeV]", 50, 0, 500) ) );
1416 ATH_CHECK(
book(TH1D(
"MET/met_et_mu",
"MET [Muons] (Nominal);MET [Muons] (Nominal) [GeV];N / [10 GeV]", 50, 0, 500) ) );
1417 ATH_CHECK(
book(TH1D(
"MET/met_et_jet",
"MET [RefJet] (Nominal);MET [RefJet] (Nominal) [GeV];N / [10 GeV]", 50, 0, 500) ) );
1419 ATH_CHECK(
book(TH1D(
"MET/met_significance",
"MET Significance;MET Significance;N / [0.5]", 60, 0, 30) ) );
1439 return StatusCode::SUCCESS;
◆ 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);
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 EL::AnaAlgorithm::endInputFile |
( |
| ) |
|
|
protectedinherited |
perform the action for the end of an input file
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 requestEndInputFile to use this.
\warn If a file is split across multiple jobs this will be called more than once. This only happens for specific batch drivers and/or if it is explicitly configured by the user. With PROOF it could even happen multiple times within the same job, and while PROOF is no longer supported that behavior may come back if support for a similar framework is added in the future. As such, this method should not be used for accounting that relies to be called exactly once per file, take a look at fileExecute if you want something that is guaranteed to be executed exactly once per input file.
\warn The execution order of endInputFile and fileExecute is currently unspecified.
Definition at line 358 of file AnaAlgorithm.cxx.
361 return StatusCode::SUCCESS;
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode SUSYToolsAlg::execute |
( |
| ) |
|
Definition at line 303 of file SUSYToolsAlg.cxx.
320 return StatusCode::SUCCESS;
332 if (
m_maxEvts>=-1 && (evtInfo->lumiBlock() != (
unsigned int)
m_lbfilter))
return StatusCode::SUCCESS;
340 if (!
evtStore()->
event()->retrieveMetaInput(completeCBC,
"CutBookkeepers").isSuccess()) {
341 ATH_MSG_ERROR(
"Failed to retrieve CutBookkeepers from MetaData! Exiting.");
344 for (
const auto *cbk : *completeCBC ) {
345 cbkname = cbk->name();
346 stream = cbk->inputStream();
348 if (cbkname.find(
"PHYSVAL")!=std::string::npos)
m_kernel=
"PHYSVAL";
349 else if (cbkname.find(
"PHYSLITE")!=std::string::npos)
m_kernel=
"PHYSLITE";
350 else if (cbkname.find(
"PHYS")!=std::string::npos)
m_kernel=
"PHYS";
359 if (
stream.find(
"PHYSVAL")!=std::string::npos)
m_kernel=
"PHYSVAL";
360 else if (
stream.find(
"PHYSLITE")!=std::string::npos)
m_kernel=
"PHYSLITE";
370 if (
m_Nevts==0 || (
m_Nevts %
period == 99))
ATH_MSG_INFO(
"===>>> start processing event #" << evtInfo->eventNumber() <<
", run #" << evtInfo->runNumber() <<
" | " <<
m_Nevts <<
" events processed so far <<<===");
374 TH1* info_runNo =
hist(
"EventInfo/info_runNo");
375 TH1* info_evtNo =
hist(
"EventInfo/info_evtNo");
376 TH1* info_lumiBlock =
hist(
"EventInfo/info_lumiBlock");
377 info_runNo->Fill(evtInfo->runNumber());
378 info_evtNo->Fill(evtInfo->eventNumber());
379 info_lumiBlock->Fill(evtInfo->lumiBlock());
389 ATH_MSG_DEBUG(
"Number of electrons: " << electrons_nominal->size() );
396 ATH_MSG_DEBUG(
"Number of photons: " << photons_nominal->size() );
403 ATH_MSG_DEBUG(
"Number of muons: " << muons_nominal->size() );
413 static std::atomic<bool> doFatJets =
true;
421 return StatusCode::FAILURE;
424 ATH_MSG_DEBUG(
"Number of Large Radius jets: " << fatjets_nominal->size() );
426 }
else if(
m_slices[
"jet"] && doFatJets) {
431 static std::atomic<bool> doTrkJets =
true;
439 return StatusCode::FAILURE;
442 ATH_MSG_DEBUG(
"Number of track jets: " << trkjets_nominal->size() );
444 }
else if(
m_slices[
"jet"] && doTrkJets) {
484 for(
const auto& tau : *taus_gettruth) {
501 double metsig_cst(0.);
502 double metsig_tst(0.);
531 hist(
"MET/met_significance")->Fill( metsig_tst );
538 bool isRun3Trig =
false;
539 if (
m_mcCampaign.find(
"mc21") != std::string::npos ||
m_mcCampaign.find(
"mc23") != std::string::npos) isRun3Trig =
true;
546 TH1* el_n_flow_nominal =
hist(
"Cutflow/el_n_flow_nominal");
547 TH1* el_trigmatch_eff_nominal =
hist(
"Trigger/el_trigmatch_eff_nominal");
551 m_obj_count[
"el"][
"nom"] = electrons_nominal->size();
552 for(
auto el : *electrons_nominal) {
554 if ( ST::acc_baseline(*
el) == 1 ){
559 if ( ST::acc_passOR(*
el) == 1 ){
561 if ( ST::acc_signal(*
el) == 1 ){
572 if(passit) el_trigmatch_eff_nominal->SetBinContent(
idx, el_trigmatch_eff_nominal->GetBinContent(
idx)+1);
573 #ifdef XAOD_STANDALONE
574 m_heffs[
"Trigger/el_pt_"+
t]->Fill(passit,
el->pt()/1000.);
575 m_heffs[
"Trigger/el_eta_"+
t]->Fill(passit,
el->eta());
576 m_heffs[
"Trigger/el_phi_"+
t]->Fill(passit,
el->phi());
593 TH1* ph_n_flow_nominal =
hist(
"Cutflow/ph_n_flow_nominal");
594 TH1* ph_trigmatch_eff_nominal =
hist(
"Trigger/ph_trigmatch_eff_nominal");
598 m_obj_count[
"ph"][
"nom"] = photons_nominal->size();
599 for(
auto ph : *photons_nominal) {
601 if ( ST::acc_baseline(*ph) == 1 ){
605 if ( ST::acc_passOR(*ph) == 1 ){
607 if ( ST::acc_signal(*ph) == 1 ){
617 if(passit) ph_trigmatch_eff_nominal->SetBinContent(
idx, ph_trigmatch_eff_nominal->GetBinContent(
idx)+1);
618 #ifdef XAOD_STANDALONE
619 m_heffs[
"Trigger/ph_pt_"+
t]->Fill(passit,ph->pt()/1000.);
620 m_heffs[
"Trigger/ph_eta_"+
t]->Fill(passit,ph->eta());
621 m_heffs[
"Trigger/ph_phi_"+
t]->Fill(passit,ph->phi());
638 TH1* mu_n_flow_nominal =
hist(
"Cutflow/mu_n_flow_nominal");
639 TH1* mu_trigmatch_eff_nominal =
hist(
"Trigger/mu_trigmatch_eff_nominal");
644 for(
auto mu : *muons_nominal) {
646 if ( ST::acc_baseline(*
mu) == 1 ){
650 if ( ST::acc_passOR(*
mu) == 1 ){
652 if ( ST::acc_signal(*
mu) == 1 ){
662 if(passit) mu_trigmatch_eff_nominal->SetBinContent(
idx, mu_trigmatch_eff_nominal->GetBinContent(
idx)+1);
663 #ifdef XAOD_STANDALONE
664 m_heffs[
"Trigger/mu_pt_"+
t]->Fill(passit,
mu->pt()/1000.);
665 m_heffs[
"Trigger/mu_eta_"+
t]->Fill(passit,
mu->eta());
666 m_heffs[
"Trigger/mu_phi_"+
t]->Fill(passit,
mu->phi());
683 TH1* jet_n_flow_nominal =
hist(
"Cutflow/jet_n_flow_nominal");
684 TH1* bjet_n_flow_nominal =
hist(
"Cutflow/bjet_n_flow_nominal");
689 for(
auto jet : *jets_nominal) {
693 if ( ST::acc_bjet(*
jet) == 1 )
bjet =
true;
696 if ( ST::acc_baseline(*
jet) == 1 ){
706 if ( ST::acc_passOR(*
jet) == 1 ){
709 if ( ST::acc_signal(*
jet) == 1 ){
735 TH1* fatjet_n_flow_nominal =
hist(
"Cutflow/fatjet_n_flow_nominal");
737 if(
m_slices[
"fjet"] && doFatJets ) {
741 std::string taggerKey;
742 taggerKey =
findInReg(reg, (*fatjets_nominal)[0],
"(SmoothW.*?)_.*");
743 if (!taggerKey.empty()) {
m_configDict[
"WtaggerKey"] = taggerKey; }
747 std::string taggerKey;
748 taggerKey =
findInReg(reg, (*fatjets_nominal)[0],
"(SmoothZ.*?)_.*");
749 if (!taggerKey.empty()) {
m_configDict[
"ZtaggerKey"] = taggerKey; }
753 std::string taggerKey;
754 taggerKey =
findInReg(reg, (*fatjets_nominal)[0],
"(.*Tag.*Top.*?)_.*");
755 if (!taggerKey.empty()) {
m_configDict[
"ToptaggerKey"] = taggerKey; }
762 m_obj_count[
"fatjet"][
"nom"] = fatjets_nominal->size();
763 for(
auto fatjet : *fatjets_nominal) {
764 fatjet_n_flow_nominal->Fill(
Cut::all);
765 if ( ST::acc_baseline(*
fatjet) == 1 ){
769 if ( ST::acc_passOR(*
fatjet) == 1 ){
771 if ( ST::acc_signal(*
fatjet) == 1 ){
788 TH1* trkjet_n_flow_nominal =
hist(
"Cutflow/trkjet_n_flow_nominal");
790 if(
m_slices[
"tjet"] && doTrkJets ) {
791 m_obj_count[
"trkjet"][
"nom"] = trkjets_nominal->size();
792 for(
auto trkjet : *trkjets_nominal) {
793 trkjet_n_flow_nominal->Fill(
Cut::all);
794 if ( ST::acc_baseline(*trkjet) == 1 ){
798 if ( ST::acc_passOR(*trkjet) == 1 ){
800 if ( ST::acc_signal(*trkjet) == 1 ){
817 TH1* tau_n_flow_nominal =
hist(
"Cutflow/tau_n_flow_nominal");
821 for(
auto tau : *taus_nominal) {
823 if ( ST::acc_baseline(*tau) == 1 ){
827 if ( ST::acc_passOR(*tau) == 1 ){
830 if ( ST::acc_signal(*tau) == 1 ){
847 double base_event_weight(1.);
849 base_event_weight *= evtInfo->mcEventWeight();
855 ATH_MSG_DEBUG(
"Truth MET etx=" << (*met_truth)[
"NonInt"]->mpx()
856 <<
", ety=" << (*met_truth)[
"NonInt"]->mpy()
857 <<
", et=" << (*met_truth)[
"NonInt"]->
met()
858 <<
", sumet=" << (*met_truth)[
"NonInt"]->sumet());
860 <<
", dety=" << (*
m_metcst_nominal)[
"Final"]->mpy() - (*met_truth)[
"NonInt"]->mpy());
862 <<
", dety=" << (*
m_mettst_nominal)[
"Final"]->mpy() - (*met_truth)[
"NonInt"]->mpy());
868 double electrons_weight_nominal(1.);
869 double photons_weight_nominal(1.);
870 double muons_weight_nominal(1.);
871 double jets_weight_nominal(1.);
874 double btag_weight_nominal(1.);
875 double taus_weight_nominal(1.);
876 double event_weight_nominal(1.);
877 double prw_weight_nominal(1.);
880 TH1* weight_event =
hist(
"Syst/weight_event");
881 TH1* weight_electrons =
hist(
"Syst/weight_electrons");
882 TH1* weight_muons =
hist(
"Syst/weight_muons");
883 TH1* weight_photons =
hist(
"Syst/weight_photons");
884 TH1* weight_taus =
hist(
"Syst/weight_taus");
885 TH1* weight_jets =
hist(
"Syst/weight_jets");
886 TH1* weight_btags =
hist(
"Syst/weight_btags");
888 bool isNominal(
true);
892 ATH_MSG_ERROR(
"Cannot configure SUSYTools for systematic var. %s" <<
sys.name() );
896 if (isNominal && (sysInfo.affectsKinematics || sysInfo.affectsWeights)) {
898 return StatusCode::FAILURE;
900 if (sysInfo.affectsKinematics || sysInfo.affectsWeights) isNominal =
false;
902 double event_weight = base_event_weight;
907 double prw_weight=1.;
910 event_weight *= prw_weight_nominal;
911 weight_event->SetBinContent(1, weight_event->GetBinContent(1)+event_weight);
913 else if (!syst_affectsEventWeight) {
914 event_weight *= prw_weight_nominal;
921 event_weight *= prw_weight;
923 if(iwbin <
m_syst_weights[
"EventWeight"].
size()) { weight_event->SetBinContent(iwbin+1, weight_event->GetBinContent(iwbin+1)+event_weight); }
939 bool syst_affectsMuons = ST::testAffectsObject(
xAOD::Type::Muon, sysInfo.affectsType);
940 bool syst_affectsPhotons = ST::testAffectsObject(
xAOD::Type::Photon, sysInfo.affectsType);
941 bool syst_affectsTaus = ST::testAffectsObject(
xAOD::Type::Tau, sysInfo.affectsType);
942 bool syst_affectsJets = ST::testAffectsObject(
xAOD::Type::Jet, sysInfo.affectsType);
943 bool syst_affectsBTag = ST::testAffectsObject(
xAOD::Type::BTag, sysInfo.affectsType);
944 bool syst_affectsLRT = ST::testAffectsObject(sysInfo.affectsType) ==
"LRT_Objects";
955 if (sysInfo.affectsKinematics) {
956 if (
m_slices[
"el"] && syst_affectsElectrons) {
964 if (
m_slices[
"pho"] && syst_affectsPhotons) {
969 photons = photons_syst;
972 if (
m_slices[
"mu"] && syst_affectsMuons) {
980 if (syst_affectsJets) {
993 fatjets = fatjets_syst;
1000 trkjets = trkjets_syst;
1004 if (
m_slices[
"tau"] && syst_affectsTaus) {
1039 float electrons_weight(1.);
1042 if (isNominal || syst_affectsElectrons) {
1043 if ((ST::acc_signal(*
el) == 1) && (isNominal || sysInfo.affectsWeights)) {
1049 ATH_MSG_VERBOSE(
" Electron passing baseline selection? " <<
static_cast<int>( ST::acc_baseline(*
el)));
1050 ATH_MSG_VERBOSE(
" Electron passing signal selection? " <<
static_cast<int>( ST::acc_signal(*
el)));
1051 if (ST::acc_signal(*
el) == 1)
1056 electrons_weight_nominal = electrons_weight;
1057 weight_electrons->SetBinContent(1, weight_electrons->GetBinContent(1)+electrons_weight);
1059 else if (!syst_affectsElectrons) {
1060 electrons_weight = electrons_weight_nominal;
1062 else if ( sysInfo.affectsWeights ){
1064 if(iwbin <
m_syst_weights[
"Electron"].
size()) { weight_electrons->SetBinContent(iwbin+1, weight_electrons->GetBinContent(iwbin+1)+electrons_weight); }
1067 event_weight *= electrons_weight;
1068 ATH_MSG_DEBUG(
"Combined electron scale factor: " << electrons_weight);
1074 float photons_weight(1.);
1075 for (
const auto& ph : *photons ) {
1077 if (isNominal || syst_affectsPhotons) {
1078 if ((ST::acc_signal(*ph) == 1) && (isNominal || sysInfo.affectsWeights)) {
1083 ATH_MSG_VERBOSE(
" Photon passing baseline selection? " <<
static_cast<int>(ST::acc_baseline(*ph)));
1084 ATH_MSG_VERBOSE(
" Photon passing signal selection? " <<
static_cast<int>(ST::acc_signal(*ph)));
1085 if (ST::acc_signal(*ph) == 1)
1089 photons_weight_nominal = photons_weight;
1090 weight_photons->SetBinContent(1, weight_photons->GetBinContent(1)+photons_weight);
1092 else if (!syst_affectsPhotons) {
1093 photons_weight = photons_weight_nominal;
1095 else if ( sysInfo.affectsWeights ){
1097 if(iwbin <
m_syst_weights[
"Photon"].
size()) { weight_photons->SetBinContent(iwbin+1, weight_photons->GetBinContent(iwbin+1)+photons_weight); }
1100 event_weight *= photons_weight;
1101 ATH_MSG_DEBUG(
"Combined photon scale factor: " << photons_weight);
1107 float muons_weight(1.);
1108 for (
const auto&
mu : *muons ) {
1110 if (isNominal || syst_affectsMuons) {
1111 if ((ST::acc_signal(*
mu) == 1) && (isNominal || sysInfo.affectsWeights)) {
1116 ATH_MSG_VERBOSE(
" Muon passing baseline selection? " <<
static_cast<int>(ST::acc_baseline(*
mu)));
1117 ATH_MSG_VERBOSE(
" Muon passing signal selection? " <<
static_cast<int>(ST::acc_signal(*
mu)));
1118 ATH_MSG_VERBOSE(
" Muon is a cosmic ray? " <<
static_cast<int>(ST::acc_cosmic(*
mu)));
1119 if (ST::acc_signal(*
mu) == 1)
1123 muons_weight_nominal = muons_weight;
1124 weight_muons->SetBinContent(1, weight_muons->GetBinContent(1)+muons_weight);
1126 else if (!syst_affectsMuons) {
1127 muons_weight = muons_weight_nominal;
1129 else if ( sysInfo.affectsWeights ){
1131 if(iwbin <
m_syst_weights[
"Muon"].
size()) { weight_muons->SetBinContent(iwbin+1, weight_muons->GetBinContent(iwbin+1)+muons_weight); }
1134 event_weight *= muons_weight;
1135 ATH_MSG_DEBUG(
"Combined muon scale factor: " << muons_weight);
1141 for (
const auto&
jet : *
jets ) {
1145 if (ST::acc_passOR(*
jet)) {
1146 if (
m_slices[
"bjet"] && (isNominal || syst_affectsJets || syst_affectsBTag)) {
1153 float jet_weight(1.);
1154 float btag_weight(1.);
1158 weight_btags->SetBinContent(1, weight_btags->GetBinContent(1)+btag_weight);
1160 else if (!syst_affectsBTag){
1161 btag_weight = btag_weight_nominal;
1166 if(iwbin <
m_syst_weights[
"BTag"].
size()) { weight_btags->SetBinContent(iwbin+1, weight_btags->GetBinContent(iwbin+1)+btag_weight); }
1172 jets_weight_nominal = jet_weight;
1174 weight_jets->SetBinContent(1, weight_jets->GetBinContent(1)+jet_weight);
1176 else if (!syst_affectsJets || (syst_affectsJets && !sysInfo.affectsWeights)){
1177 jet_weight = jets_weight_nominal;
1179 else if ( syst_affectsJets && sysInfo.affectsWeights ){
1183 if(iwbin <
m_syst_weights[
"Jet"].
size()) { weight_jets->SetBinContent(iwbin+1, weight_jets->GetBinContent(iwbin+1)+jet_weight); }
1187 weight_jets->SetBinContent(1, 1.);
1188 weight_btags->SetBinContent(1, 1.);
1190 event_weight *= jet_weight;
1191 event_weight *= btag_weight;
1192 ATH_MSG_DEBUG(
"Combined b-tagging scale factor: " << btag_weight);
1198 if(
m_slices[
"fjet"] && doFatJets ) {
1200 for (
const auto&
fatjet : *fatjets ) {
1206 float fatjet_weight(1.);
1222 ATH_MSG_DEBUG(
"Combined large radius jet scale factor: " << fatjet_weight);
1227 if(
m_slices[
"tjet"] && doTrkJets ) {
1229 for (
const auto& trkjet : *trkjets ) {
1230 ATH_MSG_VERBOSE(
" Jet is bad? " <<
static_cast<int>(ST::acc_bad(*trkjet)));
1231 ATH_MSG_VERBOSE(
" Jet is baseline ? " <<
static_cast<int>(ST::acc_baseline(*trkjet)));
1232 ATH_MSG_VERBOSE(
" Jet passes OR ? " <<
static_cast<int>(ST::acc_passOR(*trkjet)));
1235 float trkjet_weight(1.);
1251 ATH_MSG_DEBUG(
"Combined track jet scale factor: " << trkjet_weight);
1257 float taus_weight(1.);
1258 for (
const auto& ta : *taus ) {
1260 if (isNominal || syst_affectsTaus) {
1261 if ((ST::acc_signal(*ta) == 1) && (isNominal || sysInfo.affectsWeights)) {
1266 ATH_MSG_VERBOSE(
" Tau passing baseline selection? " <<
static_cast<int>(ST::acc_baseline(*ta)));
1267 ATH_MSG_VERBOSE(
" Tau passing signal selection? " <<
static_cast<int>(ST::acc_signal(*ta)));
1268 if (ST::acc_signal(*ta) == 1)
1273 taus_weight_nominal = taus_weight;
1274 weight_taus->SetBinContent(1, weight_taus->GetBinContent(1)+taus_weight);
1276 else if (!syst_affectsTaus) {
1277 taus_weight = taus_weight_nominal;
1279 else if ( sysInfo.affectsWeights ){
1281 if(iwbin <
m_syst_weights[
"Tau"].
size()) { weight_taus->SetBinContent(iwbin+1, weight_taus->GetBinContent(iwbin+1)+taus_weight); }
1284 event_weight *= taus_weight;
1289 if (isNominal) {event_weight_nominal = event_weight;}
1290 else if (sysInfo.affectsWeights)
ATH_MSG_DEBUG(
"Difference with nominal weight: " << event_weight - event_weight_nominal);
1293 if (sysInfo.affectsKinematics) {
1315 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 SUSYToolsAlg::finalize |
( |
| ) |
|
Definition at line 257 of file SUSYToolsAlg.cxx.
267 for (std::string
hname : {
"el_n_flow_nominal",
"ph_n_flow_nominal",
"mu_n_flow_nominal",
"jet_n_flow_nominal",
"bjet_n_flow_nominal",
"fatjet_n_flow_nominal",
"trkjet_n_flow_nominal",
"tau_n_flow_nominal"} ) {
269 for (
unsigned int i=1;
i <
Cut::NSel+1;
i++){
h->GetXaxis()->SetBinLabel(
i, Cut::SCut[
i-1].
Data()); }
270 h->GetXaxis()->SetLabelSize(0.05);
274 for (std::string
hname : {
"el_trigmatch_eff_nominal",
"ph_trigmatch_eff_nominal",
"mu_trigmatch_eff_nominal"}) {
275 std::string
obj =
hname.substr(0,2);
278 h->GetXaxis()->SetLabelSize(0.05);
283 std::map<std::string,std::string> mapweights = {{
"event",
"EventWeight"},{
"electrons",
"Electron"},{
"photons",
"Photon"},{
"muons",
"Muon"},{
"taus",
"Tau"},{
"jets",
"Jet"},{
"btags",
"BTag"}};
284 for (
const auto&
weight : mapweights) {
287 for (
unsigned int i=1;
i < syslist.size()+1;
i++) {
h->GetXaxis()->SetBinLabel(
i, syslist.at(
i-1).c_str()); }
288 h->GetXaxis()->SetLabelSize(0.05);
290 h->Scale(1./
static_cast<float>(
h->GetBinContent(1)));
294 for (
unsigned int i=1;
i < syslist.size()+1;
i++) { h2->GetYaxis()->SetBinLabel(syslist.size()-
i+1, syslist.at(
i-1).c_str()); h2->Fill(0.5,syslist.size()-
i,1.); }
295 h2->GetYaxis()->SetLabelSize(0.05);
298 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 ) );
◆ groupSysts()
void SUSYToolsAlg::groupSysts |
( |
void |
| ) |
|
|
private |
Definition at line 1444 of file SUSYToolsAlg.cxx.
1447 const std::vector<std::string>
Nominal{
"Nominal"};
1449 std::string sys_name = sysInfo.systset.name();
1450 std::string sys_affects = ST::testAffectsObject(sysInfo.affectsType);
1451 ATH_MSG_DEBUG(
"Syst " << sys_name <<
" affects " << sys_affects);
1453 bool sys_affects_weights = sysInfo.affectsWeights;
1457 const auto & [pairPtr, inserted] =
m_syst_all.try_emplace(sys_affects,
Nominal);
1458 pairPtr->second.push_back(sys_name);
1461 if (sys_affects_weights) {
1463 pairPtr_w->second.push_back(sys_name);
◆ 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 SUSYToolsAlg::initialize |
( |
| ) |
|
Definition at line 104 of file SUSYToolsAlg.cxx.
128 std::vector<std::string> myGRLs;
158 m_triggers[
"el"].push_back(
"HLT_e24_lhtight_nod0_ivarloose");
159 m_triggers[
"el"].push_back(
"HLT_e60_lhmedium_nod0");
160 m_triggers[
"el"].push_back(
"HLT_e26_lhtight_nod0_ivarloose");
161 m_triggers[
"el"].push_back(
"HLT_e140_lhloose_nod0");
162 m_triggers[
"el"].push_back(
"HLT_e24_lhtight_ivarloose_L1EM22VHI");
163 m_triggers[
"el"].push_back(
"HLT_e24_lhtight_ivarloose_L1eEM26M");
164 m_triggers[
"el"].push_back(
"HLT_e26_lhtight_ivarloose_L1EM22VHI");
165 m_triggers[
"el"].push_back(
"HLT_e26_lhtight_ivarloose_L1eEM26M");
166 m_triggers[
"el"].push_back(
"HLT_e60_lhvloose_L1eEM26M");
167 m_triggers[
"el"].push_back(
"HLT_e60_lhvloose_L1EM22VHI");
172 m_triggers[
"ph"].push_back(
"HLT_g120_loose_L1eEM26M");
173 m_triggers[
"ph"].push_back(
"HLT_g120_loose_L1EM22VHI");
174 m_triggers[
"ph"].push_back(
"HLT_g140_loose_L1eEM26M");
175 m_triggers[
"ph"].push_back(
"HLT_g140_loose_L1EM22VHI");
178 m_triggers[
"mu"].push_back(
"HLT_mu24_ivarmedium");
179 m_triggers[
"mu"].push_back(
"HLT_mu26_ivarmedium");
181 m_triggers[
"mu"].push_back(
"HLT_mu24_ivarmedium_L1MU14FCH");
182 m_triggers[
"mu"].push_back(
"HLT_mu24_ivarmedium_L1MU18VFCH");
183 m_triggers[
"mu"].push_back(
"HLT_mu26_ivarmedium_L1MU14FCH");
184 m_triggers[
"mu"].push_back(
"HLT_mu26_ivarmedium_L1MU18VFCH");
189 m_triggers[
"el"].push_back(
"HLT_e26_lhtight_ivarloose_L1EM22VHI");
190 m_triggers[
"el"].push_back(
"HLT_e60_lhmedium_L1EM22VHI");
191 m_triggers[
"el"].push_back(
"HLT_e140_lhloose_L1EM22VHI");
194 m_triggers[
"ph"].push_back(
"HLT_g140_loose_L1EM22VHI");
195 m_triggers[
"ph"].push_back(
"HLT_g300_L1EM22VHI");
198 m_triggers[
"mu"].push_back(
"HLT_mu24_ivarmedium_L1MU14FCH");
199 m_triggers[
"mu"].push_back(
"HLT_mu50_L1MU14FCH");
200 m_triggers[
"mu"].push_back(
"HLT_mu60_0eta105_msonly_L1MU14FCH");
201 m_triggers[
"mu"].push_back(
"HLT_mu60_L1MU14FCH");
202 m_triggers[
"mu"].push_back(
"HLT_mu80_msonly_3layersEC_L1MU14FCH");
217 return StatusCode::FAILURE;
222 m_configDict[
"Jet.LargeRcollection"] = rEnv.GetValue(
"Jet.LargeRcollection",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets" );
223 m_configDict[
"TrackJet.Collection"] = rEnv.GetValue(
"TrackJet.Collection",
"AntiKtVR30Rmax4Rmin02TrackJets" );
224 m_configDict[
"Jet.WtaggerConfig"] = rEnv.GetValue(
"Jet.WtaggerConfig",
"None");
225 m_configDict[
"Jet.ZtaggerConfig"] = rEnv.GetValue(
"Jet.ZtaggerConfig",
"None");
226 m_configDict[
"Jet.ToptaggerConfig"] = rEnv.GetValue(
"Jet.ToptaggerConfig",
"None");
241 m_slices[
"ele"] =
bool(rEnv.GetValue(
"Slices.Ele",
true));
242 m_slices[
"pho"] =
bool(rEnv.GetValue(
"Slices.Pho",
true));
243 m_slices[
"mu"] =
bool(rEnv.GetValue(
"Slices.Mu",
true));
244 m_slices[
"tau"] =
bool(rEnv.GetValue(
"Slices.Tau",
true));
245 m_slices[
"jet"] =
bool(rEnv.GetValue(
"Slices.Jet",
true));
246 m_slices[
"bjet"] =
bool(rEnv.GetValue(
"Slices.BJet",
true));
247 m_slices[
"fjet"] =
bool(rEnv.GetValue(
"Slices.FJet",
true));
248 m_slices[
"tjet"] =
bool(rEnv.GetValue(
"Slices.TJet",
true));
249 m_slices[
"met"] =
bool(rEnv.GetValue(
"Slices.MET",
true));
252 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;
◆ stdHistsForObj()
void SUSYToolsAlg::stdHistsForObj |
( |
xAOD::IParticle * |
obj, |
|
|
const std::string & |
objtype, |
|
|
const std::string & |
objlevel, |
|
|
std::map< std::string, std::string > |
config = std::map<std::string,std::string>() |
|
) |
| |
|
private |
Definition at line 1470 of file SUSYToolsAlg.cxx.
1471 std::map<std::string,std::string> labels_dir = { {
"el",
"Electron"}, {
"ph",
"Photon"}, {
"mu",
"Muon"}, {
"jet",
"Jet"}, {
"bjet",
"bJet"}, {
"tau",
"Tau"}, {
"fatjet",
"LargeRJet"}, {
"trkjet",
"TrackJet"} };
1472 std::string
dir = labels_dir[objtype]+
"/";
1475 hist(
dir+objtype+
"_"+objlevel+
"_pt")->Fill(
obj->pt()/1000. );
1476 hist(
dir+objtype+
"_"+objlevel+
"_eta")->Fill(
obj->eta() );
1477 hist(
dir+objtype+
"_"+objlevel+
"_phi")->Fill(
obj->phi() );
1478 hist(
dir+objtype+
"_"+objlevel+
"_e")->Fill(
obj->e()/1000. );
1479 hist(
dir+objtype+
"_"+objlevel+
"_mass")->Fill(
obj->m()/1000. );
1481 if (objtype==
"el" || objtype==
"mu" || objtype==
"ph") {
1482 if (objtype==
"el") {
1484 hist(
dir+objtype+
"_"+objlevel+
"_z0")->Fill( ST::acc_z0sinTheta(*
obj) );
1486 hist(
dir+objtype+
"_"+objlevel+
"_d0")->Fill( ST::acc_d0sig(*
obj) );
1487 hist(
dir+objtype+
"_"+objlevel+
"_isolCalo")->Fill( STAlg::acc_topoetcone20(*
obj)/
obj->pt() );
1488 hist(
dir+objtype+
"_"+objlevel+
"_isolTrack")->Fill( STAlg::acc_ptvarcone30_TTVA_LooseCone(*
obj)/
obj->pt() );
1489 }
else if (objtype==
"mu") {
1491 hist(
dir+objtype+
"_"+objlevel+
"_z0")->Fill( ST::acc_z0sinTheta(*
obj) );
1493 hist(
dir+objtype+
"_"+objlevel+
"_d0")->Fill( ST::acc_d0sig(*
obj) );
1494 hist(
dir+objtype+
"_"+objlevel+
"_isolCalo")->Fill( STAlg::acc_topoetcone20(*
obj)/
obj->pt() );
1495 hist(
dir+objtype+
"_"+objlevel+
"_isolTrack")->Fill( STAlg::acc_ptvarcone30_TTVA(*
obj)/
obj->pt() );
1496 }
else if (objtype==
"ph") {
1497 hist(
dir+objtype+
"_"+objlevel+
"_isolCalo")->Fill( (STAlg::acc_topoetcone40(*
obj)-2450)/
obj->pt() );
1498 hist(
dir+objtype+
"_"+objlevel+
"_isolTrack")->Fill( STAlg::acc_ptcone20(*
obj)/
obj->pt() );
1502 if (objtype==
"el" || objtype==
"mu" || objtype==
"ph" || objtype==
"tau") {
1503 if ( objtype!=
"tau" ) {
1505 ATH_MSG_DEBUG(objtype <<
", " << objlevel <<
": " << ST::acc_truthType(*
obj) <<
", " << ST::acc_truthOrigin(*
obj));
1506 hist(
dir+objtype+
"_"+objlevel+
"_truthType")->Fill( ST::acc_truthType(*
obj) );
1507 hist(
dir+objtype+
"_"+objlevel+
"_truthOrigin")->Fill( ST::acc_truthOrigin(*
obj) );
1511 bool istruthmatched = STAlg::acc_IsTruthMatched.isAvailable(*
obj) ? (
bool)STAlg::acc_IsTruthMatched(*
obj) :
false;
1513 if (istruthmatched && STAlg::acc_truthParticleLink.
isAvailable(*
obj)) {
1514 const auto *
tp = *(STAlg::acc_truthParticleLink(*
obj));
1517 ppid = (
tp->nParents()>0)?
tp->parent(0)->pdgId():0;
1520 hist(
dir+objtype+
"_"+objlevel+
"_pid")->Fill(
pid );
1521 hist(
dir+objtype+
"_"+objlevel+
"_parentpid")->Fill( ppid );
1526 if (objtype==
"tau") {
1528 hist(
dir+objtype+
"_"+objlevel+
"_nTracksCharged")->Fill(
dynamic_cast<xAOD::TauJet*
>(
obj)->nTracksCharged() );
1529 hist(
dir+objtype+
"_"+objlevel+
"_nTracksIsolation")->Fill(
dynamic_cast<xAOD::TauJet*
>(
obj)->nTracksIsolation() );
1530 hist(
dir+objtype+
"_"+objlevel+
"_RNNJetScoreSigTrans")->Fill( STAlg::acc_RNNJetScoreSigTrans(*
obj) );
1534 if (objtype==
"bjet") {
1535 hist(
dir+objtype+
"_"+objlevel+
"_bweight")->Fill( ST::acc_btag_weight(*
obj) );
1536 hist(
dir+objtype+
"_"+objlevel+
"_bweightpb")->Fill( ST::acc_btag_dl1pb(*
obj) );
1537 hist(
dir+objtype+
"_"+objlevel+
"_bweightpc")->Fill( ST::acc_btag_dl1pc(*
obj) );
1538 hist(
dir+objtype+
"_"+objlevel+
"_bweightpu")->Fill( ST::acc_btag_dl1pu(*
obj) );
1550 if (objtype==
"fatjet" && acc_topValidPtRangeLow.isAvailable(*
obj) && acc_topValidPtRangeHigh.isAvailable(*
obj) && acc_topValidEtaRange.isAvailable(*
obj)) {
1551 bool kin = acc_topValidPtRangeLow(*
obj) && acc_topValidPtRangeHigh(*
obj) && acc_topValidEtaRange(*
obj);
1552 if (
config.find(
"WtaggerKey")!=
config.end())
hist(
dir+objtype+
"_"+objlevel+
"_wtagged") ->Fill( acc_wtagged.isAvailable(*
obj) ? kin && acc_wtagged(*
obj) : -1);
1553 if (
config.find(
"ZtaggerKey")!=
config.end())
hist(
dir+objtype+
"_"+objlevel+
"_ztagged") ->Fill( acc_ztagged.isAvailable(*
obj) ? kin && acc_ztagged(*
obj) : -1);
1554 if (
config.find(
"ToptaggerKey")!=
config.end())
hist(
dir+objtype+
"_"+objlevel+
"_toptagged")->Fill( acc_toptagged.isAvailable(*
obj) ? kin && acc_toptagged(*
obj) : -1);
1555 if (
config.find(
"ToptaggerKey")!=
config.end())
hist(
dir+objtype+
"_"+objlevel+
"_toptaggedscore")->Fill( acc_topscore.isAvailable(*
obj) ? acc_topscore(*
obj) : -1);
◆ 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_clock0
TStopwatch SUSYToolsAlg::m_clock0 |
|
private |
◆ m_clock1
TStopwatch SUSYToolsAlg::m_clock1 |
|
private |
◆ m_clock2
TStopwatch SUSYToolsAlg::m_clock2 |
|
private |
◆ m_configDict
std::map<std::string,std::string> SUSYToolsAlg::m_configDict |
|
private |
◆ m_configFile
std::string SUSYToolsAlg::m_configFile |
|
private |
◆ m_detStore
◆ m_doSyst
bool SUSYToolsAlg::m_doSyst |
|
private |
◆ m_effMap
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_FatJetCollection
std::string SUSYToolsAlg::m_FatJetCollection |
|
private |
◆ m_graphMap
◆ m_grl
◆ m_GRLFiles
std::vector<std::string> SUSYToolsAlg::m_GRLFiles |
|
private |
◆ 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_heffs
std::map<std::string,TEfficiency*> SUSYToolsAlg::m_heffs |
|
private |
◆ m_histMap
◆ m_histNamePostfix
std::string AthHistogramAlgorithm::m_histNamePostfix |
|
privateinherited |
◆ m_histNamePrefix
std::string AthHistogramAlgorithm::m_histNamePrefix |
|
privateinherited |
◆ m_hists
std::map<std::string,TH1*> SUSYToolsAlg::m_hists |
|
private |
◆ 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_isPHYSLITE
bool SUSYToolsAlg::m_isPHYSLITE |
|
private |
◆ m_kernel
std::string SUSYToolsAlg::m_kernel |
|
private |
◆ m_lbfilter
int SUSYToolsAlg::m_lbfilter |
|
private |
◆ m_levels
std::vector<std::string> SUSYToolsAlg::m_levels |
|
private |
◆ m_maxEvts
int SUSYToolsAlg::m_maxEvts |
|
private |
◆ m_mcCampaign
std::string SUSYToolsAlg::m_mcCampaign |
|
private |
◆ m_metcst_nominal
◆ m_metcst_nominal_aux
◆ m_metcst_syst
◆ m_metcst_syst_aux
◆ m_mettst_nominal
◆ m_mettst_nominal_aux
◆ m_mettst_syst
◆ m_mettst_syst_aux
◆ m_msg
MsgStream AthHistogramming::m_msg |
|
privateinherited |
◆ m_name
std::string AthHistogramming::m_name |
|
privateinherited |
◆ m_Nevts
unsigned int SUSYToolsAlg::m_Nevts |
|
private |
◆ m_obj_count
std::map<std::string,std::map<std::string,int> > SUSYToolsAlg::m_obj_count |
|
private |
◆ m_objects
std::vector<std::string> SUSYToolsAlg::m_objects |
|
private |
◆ m_outputMetaStore
Object accessing the output metadata store.
Definition at line 555 of file AnaAlgorithm.h.
◆ m_prefix
std::string AthHistogramAlgorithm::m_prefix |
|
privateinherited |
◆ m_rootDir
std::string AthHistogramAlgorithm::m_rootDir |
|
privateinherited |
◆ m_slices
std::map<std::string,bool> SUSYToolsAlg::m_slices |
|
private |
◆ m_streamName
std::string AthHistogramming::m_streamName |
|
privateinherited |
◆ m_SUSYTools
◆ m_sysInfoList
◆ m_syst_all
std::map<std::string,std::vector<std::string> > SUSYToolsAlg::m_syst_all |
|
private |
◆ m_syst_weights
std::map<std::string,std::vector<std::string> > SUSYToolsAlg::m_syst_weights |
|
private |
◆ m_tauTruthMatchingTool
◆ m_treeMap
◆ m_triggers
std::map<std::string,std::vector<std::string> > SUSYToolsAlg::m_triggers |
|
private |
◆ m_TrkJetCollection
std::string SUSYToolsAlg::m_TrkJetCollection |
|
private |
◆ m_TrkJetTimeStamp
std::string SUSYToolsAlg::m_TrkJetTimeStamp |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vars
std::vector<std::string> SUSYToolsAlg::m_vars |
|
private |
◆ m_vhka
The documentation for this class was generated from the following files:
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
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...
bool m_hasBeginInputFile
the value of hasBeginInputFile
AthConfigFlags bjet(AthConfigFlags flags, str instanceName, str recoMode)
TH2 * hist2d(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered 2-d histograms.
virtual ::StatusCode endInputFile()
perform the action for the end of an input file
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.
Electron_v1 Electron
Definition of the current "egamma version".
MissingETAuxContainer_v1 MissingETAuxContainer
Scalar phi() const
phi method
ServiceHandle< ITHistSvc > m_histSvc
Default constructor: AthHistogramAlgorithm();.
std::string find(const std::string &s)
return a remapped string
static AuxTypeRegistry & instance()
Return the singleton registry instance.
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::set< std::string > & getProcessingTags() const
MetaStore_t m_inputMetaStore
Object accessing the input metadata store.
MetaStore_t m_outputMetaStore
Object accessing the output metadata store.
ConstMetaStorePtr_t inputMetaStore() const
Class creating a shallow copy of an existing auxiliary container.
std::string m_prefix
Name of the ROOT output stream (file)
Class to wrap a set of SystematicVariations.
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::string m_histNamePrefix
The prefix for the histogram THx name.
std::string m_histTitlePrefix
The prefix for the histogram THx title.
MissingETContainer_v1 MissingETContainer
Helper class to provide constant type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
std::string m_histNamePostfix
The postfix for the histogram THx name.
virtual ::StatusCode fileExecute()
perform the action exactly once for each file in the dataset
std::string getTree(const std::string &file_name)
virtual void setOwner(IDataHandleHolder *o)=0
bool isAvailable(const T_Aux &cont, SG::auxid_t auxid)
Handle mappings between names and auxid_t.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
the (new) base class for EventLoop algorithms
virtual StatusCode sysInitialize() override
Override sysInitialize.
POOL::TEvent event(POOL::TEvent::kClassAccess)
Class describing a tau jet.
Auxiliary data store for xAOD::MissingETContainer.
#define CHECK(...)
Evaluate an expression and check for errors.
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.
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.
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.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Container for xAOD::MissingET_v1 objects.
hash_t hash(const std::string &histName) const
Method to calculate a 32-bit hash from a string.
def getHist(name, makehist)
Class describing the basic event information.
Photon_v1 Photon
Definition of the current "egamma version".
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
struct TBPatternUnitContext Muon
std::uint64_t hash64(const void *data, std::size_t size)
Passthrough to XXH3_64bits.
DataObjIDColl m_extendedExtraObjects
EffMap_t m_effMap
The map of histogram names to their pointers.
std::string m_histTitlePrefix
The prefix for the histogram THx title.
This class provides the summary information stored for data written as a Event Stream.
#define ATH_MSG_WARNING(x)
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_histNamePrefix
The prefix for the histogram THx name.
bool m_hasEndInputFile
the value of hasEndInputFile
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::string m_histTitlePostfix
The postfix for the histogram THx title.
@ Tau
The object is a tau (jet)
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)
@ BTag
The object is a b-tagging object.
std::string m_name
Instance name.
setBGCode setTAP setLVL2ErrorBits bool
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>
Jet_v1 Jet
Definition of the current "jet version".
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.