CMS 3D CMS Logo

TtEvent.cc
Go to the documentation of this file.
4 #include <cstring>
5 
6 // find corresponding hypotheses based on JetLepComb
7 int TtEvent::correspondingHypo(const HypoClassKey& key1, const unsigned& hyp1, const HypoClassKey& key2) const {
8  for (unsigned hyp2 = 0; hyp2 < this->numberOfAvailableHypos(key2); ++hyp2) {
9  if (this->jetLeptonCombination(key1, hyp1) == this->jetLeptonCombination(key2, hyp2))
10  return hyp2;
11  }
12  return -1; // if no corresponding hypothesis was found
13 }
14 
15 // return the corresponding enum value from a string
17  return (HypoClassKey)StringToEnumValue<HypoClassKey>(label);
18 }
19 
20 // print pt, eta, phi, mass of a given candidate into an existing LogInfo
21 void TtEvent::printParticle(edm::LogInfo& log, const char* name, const reco::Candidate* cand) const {
22  if (!cand) {
23  log << std::setw(15) << name << ": not available!\n";
24  return;
25  }
26  log << std::setprecision(3) << setiosflags(std::ios::fixed | std::ios::showpoint);
27  log << std::setw(15) << name << ": " << std::setw(7) << cand->pt() << "; " << std::setw(7) << cand->eta() << "; "
28  << std::setw(7) << cand->phi() << "; " << resetiosflags(std::ios::fixed | std::ios::showpoint)
29  << setiosflags(std::ios::scientific) << std::setw(10) << cand->mass() << "\n";
30  log << resetiosflags(std::ios::scientific);
31 }
HypoClassKey
supported classes of event hypotheses
Definition: TtEvent.h:30
unsigned int numberOfAvailableHypos(const std::string &key) const
return number of available hypotheses within a given hypothesis class
Definition: TtEvent.h:92
void printParticle(edm::LogInfo &log, const char *name, const reco::Candidate *cand) const
print pt, eta, phi, mass of a given candidate into an existing LogInfo
Definition: TtEvent.cc:21
char const * label
HypoClassKey hypoClassKeyFromString(const std::string &label) const
return the corresponding enum value from a string
Definition: TtEvent.cc:16
virtual double eta() const =0
momentum pseudorapidity
virtual double pt() const =0
transverse momentum
virtual double mass() const =0
mass
int correspondingHypo(const std::string &key1, const unsigned &hyp1, const std::string &key2) const
return the hypothesis in hypothesis class &#39;key2&#39;, which corresponds to hypothesis &#39;hyp1&#39; in hypothesi...
Definition: TtEvent.h:140
std::vector< int > jetLeptonCombination(const std::string &key, const unsigned &cmb=0) const
return the vector of jet lepton combinatorics for a given hypothesis and class
Definition: TtEvent.h:108
virtual double phi() const =0
momentum azimuthal angle