|  | ATLAS Offline Software
    | 
 
 
 
Go to the documentation of this file.
   37       return StatusCode::FAILURE;
 
   46     float flt_channel_number{};
 
   53       ANA_MSG_WARNING (
"MC channel number could not be read from the FileMetaData.");
 
   57       if (
inputMetaStore()->contains<xAOD::TruthMetaDataContainer>(
"TruthMetaData"))
 
   63         if (tmd->size() == 1) {
 
   75     return StatusCode::SUCCESS;
 
   91       float flt_channel_number{};
 
  106       ANA_MSG_DEBUG (
"Complete cbk name: " << cbk->name() << 
" - stream: " << cbk->inputStream());
 
  108       if (cbk->cycle() > maxCycle && cbk->name() == 
"AllExecutedEvents"  
  112         maxCycle = cbk->cycle();
 
  116     if (allEvents == 
nullptr)
 
  118       ANA_MSG_ERROR (
"Could not find AllExecutedEvents CutBookkeeper information.");
 
  119       return StatusCode::FAILURE;
 
  125       if (cbk->cycle() == maxCycle && cbk->name().find(
"AllExecutedEvents") == 0 
 
  128         static const std::regex re (
"AllExecutedEvents.*_([0-9]+)");
 
  132         if (std::regex_match(cbk->name(), 
match, 
re))
 
  147       if (!
inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(cbkName))
 
  156         if (cbk->cycle() == maxCycle && cbk->name().find(
"AllExecutedEvents") == 0 
 
  167       ANA_MSG_WARNING (
"This sample does not support CutBookkeeper systematics. Disabling...");
 
  173     return StatusCode::SUCCESS;
 
  190     ANA_MSG_VERBOSE (
"Initial sum of weights squared = " << sumOfWeightsSquared);
 
  193     it->second.nEventsProcessed    += nEventsProcessed;
 
  194     it->second.sumOfWeights        += sumOfWeights;
 
  195     it->second.sumOfWeightsSquared += sumOfWeightsSquared;
 
  222       assert(
h != 
nullptr);
 
  224       h->GetXaxis()->SetBinLabel (1, 
"Initial events");
 
  225       h->GetXaxis()->SetBinLabel (2, 
"Initial sum of weights");
 
  226       h->GetXaxis()->SetBinLabel (3, 
"Initial sum of weights squared");
 
  235         ANA_MSG_ERROR (
"No weight is available for CutBookkeeper histogram. \nDid you set skip-n-events > 0? This is a known issue in EventLoop.");
 
  240       h->SetBinContent (1, 
weights.nEventsProcessed);
 
  241       h->SetBinContent (2, 
weights.sumOfWeights);
 
  242       h->SetBinContent (3, 
weights.sumOfWeightsSquared);
 
  245     return StatusCode::SUCCESS;
 
  
def retrieve(aClass, aKey=None)
::StatusCode requestFileExecute()
register this algorithm to have an implementation of fileexecute
std::string find(const std::string &s)
return a remapped string
uint32_t m_mcChannelNumber
MC channel number we are processing.
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
Description of the class that is used to keep track of event counts.
ConstMetaStorePtr_t inputMetaStore() const
Class to wrap a set of SystematicVariations.
std::unordered_map< size_t, WeightsGroup > m_weights
weights map
double sumOfEventWeightsSquared() const
Get the sum-of-(event-weights-squared) that this CutBookkeeper has seen.
ServiceHandle< ISystematicsSvc > m_systematics
the systematics service
void processCutBookkeeper(const xAOD::CutBookkeeper *cbk, size_t index)
process a CutBookkeeper
std::string to_string(const SectorProjector proj)
Select isolated Photons, Electrons and Muons.
Gaudi::Property< uint32_t > m_runNumber
run number we are processing
ToolHandle< PMGTools::IPMGTruthWeightTool > m_truthWeightTool
the truth weight tool
Gaudi::Property< bool > m_enableSystematics
flag to enable systematics
std::vector< std::string > m_allowed_streams
input streams that we can run the CutBookkeepers against
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode finalize() override
finalize
Gaudi::Property< std::string > m_histPattern
the pattern for histogram names
Container that holds the Container of all CutBookkeepers.
uint64_t nAcceptedEvents() const
Get the number of accepted events that this CutBookkeeper has seen.
StatusCode initialize() override
initialize
double sumOfEventWeights() const
Get the sum-of-event-weights that this CutBookkeeper has seen.
StatusCode fileExecute() override
run once on each file
std::string substitute(const std::string &str, const std::string &pattern, const std::string &with)
effects: substitute all occurences of "pattern" with "with" in the string "str" returns: the substitu...
#define ATH_MSG_WARNING(x)
const boost::regex re(r_e)
TH1 * hist(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
bool match(std::string s1, std::string s2)
match the individual directories of two strings