24 StatusCode KinematicHistAlg ::
30 return StatusCode::SUCCESS;
35 StatusCode KinematicHistAlg ::
43 auto histIter =
m_hist.find (sys);
44 if (histIter ==
m_hist.end())
54 m_hist.insert (std::make_pair (sys, group));
55 histIter =
m_hist.find (sys);
56 assert (histIter !=
m_hist.end());
59 std::size_t
count = 0;
60 for (std::size_t iter = 0; iter != input->size(); ++ iter)
65 while (histIter->second.perObject.size() <=
count)
85 histIter->second.perObject.push_back (group);
90 group.pt->Fill (particle->pt());
91 group.eta->Fill (particle->eta());
92 group.phi->Fill (particle->phi());
97 histIter->second.multiplicity->Fill (
count);
99 return StatusCode::SUCCESS;
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
TH1 * hist(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type.
SysListHandle m_systematicsList
the systematics list we run
Gaudi::Property< std::string > m_histPattern
the pattern for histogram names
std::unordered_map< CP::SystematicSet, HistGroup > m_hist
the created histograms
SysReadHandle< xAOD::IParticleContainer > m_inputHandle
the jet collection we run on
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Class providing the definition of the 4-vector interface.
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Select isolated Photons, Electrons and Muons.
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...
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
the histograms we fill per systematic
the histograms we fill per systematic and object