CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HiggsValidation::MonitoredDecays Class Reference

Public Member Functions

std::string channel (size_t i)
 
int convert (std::string s)
 
std::string convert (int pid)
 
std::string ConvertIndex (int index)
 
int isDecayParticle (int pid)
 
 MonitoredDecays (const edm::ParameterSet &iConfig)
 
unsigned int NDecayParticles ()
 
size_t position (int pid1, int pid2)
 
size_t size ()
 
size_t stable ()
 
size_t undetermined ()
 
 ~MonitoredDecays ()
 

Private Member Functions

void fill (std::string s)
 
void fillMap ()
 

Private Attributes

std::vector< std::pair< int, int > > channels
 
std::map< std::string, int > namePidMap
 
unsigned int nparticles_
 

Detailed Description

Definition at line 48 of file HiggsValidation.h.

Constructor & Destructor Documentation

◆ MonitoredDecays()

HiggsValidation::MonitoredDecays::MonitoredDecays ( const edm::ParameterSet iConfig)
inline

Definition at line 50 of file HiggsValidation.h.

References fill(), fillMap(), edm::ParameterSet::getParameter(), mps_fire::i, and input.

50  {
51  fillMap();
52  std::vector<std::string> input = iConfig.getParameter<std::vector<std::string> >("monitorDecays");
53  for (std::vector<std::string>::const_iterator i = input.begin(); i != input.end(); ++i) {
54  fill(*i);
55  }
56  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
static std::string const input
Definition: EdmProvDump.cc:50

◆ ~MonitoredDecays()

HiggsValidation::MonitoredDecays::~MonitoredDecays ( )
inline

Definition at line 58 of file HiggsValidation.h.

58 {};

Member Function Documentation

◆ channel()

std::string HiggsValidation::MonitoredDecays::channel ( size_t  i)
inline

Definition at line 76 of file HiggsValidation.h.

References channels, convert(), dqmdumpme::first, mps_fire::i, and edm::second().

Referenced by HiggsValidation::bookHistograms().

76  {
77  if (i == 0)
78  return "?";
79  if (i == channels.size() + 1)
80  return "Stable";
81  return convert(channels[i - 1].first) + convert(channels[i - 1].second);
82  }
std::vector< std::pair< int, int > > channels
U second(std::pair< T, U > const &p)

◆ convert() [1/2]

int HiggsValidation::MonitoredDecays::convert ( std::string  s)
inline

Definition at line 84 of file HiggsValidation.h.

References namePidMap, and alignCSCRings::s.

Referenced by channel(), and fill().

84  {
85  if (namePidMap.count(s)) {
86  return namePidMap[s];
87  }
88  return 0;
89  }
std::map< std::string, int > namePidMap

◆ convert() [2/2]

std::string HiggsValidation::MonitoredDecays::convert ( int  pid)
inline

Definition at line 91 of file HiggsValidation.h.

References funct::abs(), mps_fire::i, and namePidMap.

91  {
92  pid = abs(pid);
93  if (pid == 14 || pid == 16)
94  pid = 12;
95  for (std::map<std::string, int>::const_iterator i = namePidMap.begin(); i != namePidMap.end(); ++i) {
96  if (i->second == pid)
97  return i->first;
98  }
99  return "not found";
100  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::map< std::string, int > namePidMap

◆ ConvertIndex()

std::string HiggsValidation::MonitoredDecays::ConvertIndex ( int  index)
inline

Definition at line 114 of file HiggsValidation.h.

References mps_fire::i, heavyIonCSV_trainingSettings::idx, and namePidMap.

Referenced by HiggsValidation::bookHistograms().

114  {
115  int idx = 0;
116  for (std::map<std::string, int>::const_iterator i = namePidMap.begin(); i != namePidMap.end(); ++i) {
117  if (idx == index)
118  return i->first;
119  idx++;
120  }
121  return "unknown";
122  }
std::map< std::string, int > namePidMap

◆ fill()

void HiggsValidation::MonitoredDecays::fill ( std::string  s)
inlineprivate

Definition at line 125 of file HiggsValidation.h.

References channels, convert(), PA_ZEESkim_cff::decay, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by MonitoredDecays().

125  {
126  size_t pos = s.find('+');
127  std::string particle1 = s.substr(0, pos);
128  std::string particle2 = s.substr(pos + 1, s.length() - pos);
129  std::pair<int, int> decay;
130  decay.first = convert(particle1);
131  decay.second = convert(particle2);
132  channels.push_back(decay);
133  }
std::vector< std::pair< int, int > > channels

◆ fillMap()

void HiggsValidation::MonitoredDecays::fillMap ( )
inlineprivate

Definition at line 135 of file HiggsValidation.h.

References mps_fire::i, namePidMap, and nparticles_.

Referenced by MonitoredDecays().

135  {
136  namePidMap["d"] = 1;
137  namePidMap["u"] = 2;
138  namePidMap["s"] = 3;
139  namePidMap["c"] = 4;
140  namePidMap["b"] = 5;
141  namePidMap["t"] = 6;
142  namePidMap["e"] = 11;
143  namePidMap["nu"] = 12;
144  namePidMap["mu"] = 13;
145  namePidMap["tau"] = 15;
146  namePidMap["gamma"] = 22;
147  namePidMap["Z"] = 23;
148  namePidMap["W"] = 24;
149  nparticles_ = 0;
150  for (std::map<std::string, int>::const_iterator i = namePidMap.begin(); i != namePidMap.end(); ++i) {
151  nparticles_++;
152  }
153  }
std::map< std::string, int > namePidMap

◆ isDecayParticle()

int HiggsValidation::MonitoredDecays::isDecayParticle ( int  pid)
inline

Definition at line 104 of file HiggsValidation.h.

References mps_fire::i, heavyIonCSV_trainingSettings::idx, and namePidMap.

Referenced by HiggsValidation::analyze().

104  {
105  int idx = 0;
106  for (std::map<std::string, int>::const_iterator i = namePidMap.begin(); i != namePidMap.end(); ++i) {
107  if (i->second == pid)
108  return idx;
109  idx++;
110  }
111  return -1;
112  }
std::map< std::string, int > namePidMap

◆ NDecayParticles()

unsigned int HiggsValidation::MonitoredDecays::NDecayParticles ( )
inline

Definition at line 102 of file HiggsValidation.h.

References nparticles_.

Referenced by HiggsValidation::bookHistograms().

102 { return nparticles_; }

◆ position()

size_t HiggsValidation::MonitoredDecays::position ( int  pid1,
int  pid2 
)
inline

Definition at line 60 of file HiggsValidation.h.

References funct::abs(), channels, dqmdumpme::first, mps_fire::i, edm::second(), and undetermined().

Referenced by HiggsValidation::findHiggsDecayChannel().

60  {
61  if (abs(pid1) == 14 || abs(pid1) == 16)
62  pid1 = 12;
63  if (abs(pid2) == 14 || abs(pid2) == 16)
64  pid2 = 12;
65  for (size_t i = 0; i < channels.size(); ++i) {
66  if ((channels[i].first == abs(pid1) && channels[i].second == abs(pid2)) ||
67  (channels[i].first == abs(pid2) && channels[i].second == abs(pid1)))
68  return i + 1;
69  }
70  return undetermined(); //channels.size()+1;
71  }
std::vector< std::pair< int, int > > channels
U second(std::pair< T, U > const &p)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ size()

size_t HiggsValidation::MonitoredDecays::size ( void  )
inline

Definition at line 73 of file HiggsValidation.h.

References channels.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), HiggsValidation::bookHistograms(), and stable().

73 { return channels.size() + 2; }
std::vector< std::pair< int, int > > channels

◆ stable()

size_t HiggsValidation::MonitoredDecays::stable ( )
inline

Definition at line 75 of file HiggsValidation.h.

References size().

Referenced by HiggsValidation::findHiggsDecayChannel().

75 { return size(); }

◆ undetermined()

size_t HiggsValidation::MonitoredDecays::undetermined ( )
inline

Definition at line 74 of file HiggsValidation.h.

Referenced by HiggsValidation::findHiggsDecayChannel(), and position().

74 { return 0; }

Member Data Documentation

◆ channels

std::vector<std::pair<int, int> > HiggsValidation::MonitoredDecays::channels
private

Definition at line 157 of file HiggsValidation.h.

Referenced by channel(), fill(), position(), and size().

◆ namePidMap

std::map<std::string, int> HiggsValidation::MonitoredDecays::namePidMap
private

Definition at line 155 of file HiggsValidation.h.

Referenced by convert(), ConvertIndex(), fillMap(), and isDecayParticle().

◆ nparticles_

unsigned int HiggsValidation::MonitoredDecays::nparticles_
private

Definition at line 158 of file HiggsValidation.h.

Referenced by fillMap(), and NDecayParticles().