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 }
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
MessageLogger.h
edm::LogInfo
Definition: MessageLogger.h:254
TtEvent::printParticle
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
TtEvent::jetLeptonCombination
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
TtEvent::numberOfAvailableHypos
unsigned int numberOfAvailableHypos(const std::string &key) const
return number of available hypotheses within a given hypothesis class
Definition: TtEvent.h:92
TtEvent::hypoClassKeyFromString
HypoClassKey hypoClassKeyFromString(const std::string &label) const
return the corresponding enum value from a string
Definition: TtEvent.cc:16
StringToEnumValue.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TtEvent::HypoClassKey
HypoClassKey
supported classes of event hypotheses
Definition: TtEvent.h:30
cand
Definition: decayParser.h:34
reco::Candidate
Definition: Candidate.h:27
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
TtEvent::correspondingHypo
int correspondingHypo(const std::string &key1, const unsigned &hyp1, const std::string &key2) const
return the hypothesis in hypothesis class 'key2', which corresponds to hypothesis 'hyp1' in hypothesi...
Definition: TtEvent.h:140
TtEvent.h
label
const char * label
Definition: PFTauDecayModeTools.cc:11