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)
 
std::string convert (int pid)
 
int convert (std::string s)
 
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.

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  }

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

◆ ~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.

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  }

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

Referenced by HiggsValidation::bookHistograms().

◆ convert() [1/2]

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

Definition at line 91 of file HiggsValidation.h.

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  }

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

◆ convert() [2/2]

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

Definition at line 84 of file HiggsValidation.h.

84  {
85  if (namePidMap.count(s)) {
86  return namePidMap[s];
87  }
88  return 0;
89  }

References namePidMap, and alignCSCRings::s.

Referenced by channel(), and fill().

◆ ConvertIndex()

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

Definition at line 114 of file HiggsValidation.h.

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  }

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

Referenced by HiggsValidation::bookHistograms().

◆ fill()

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

Definition at line 125 of file HiggsValidation.h.

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  }

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

Referenced by MonitoredDecays().

◆ fillMap()

void HiggsValidation::MonitoredDecays::fillMap ( )
inlineprivate

Definition at line 135 of file HiggsValidation.h.

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  }

References mps_fire::i, namePidMap, and nparticles_.

Referenced by MonitoredDecays().

◆ isDecayParticle()

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

Definition at line 104 of file HiggsValidation.h.

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  }

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

Referenced by HiggsValidation::analyze().

◆ NDecayParticles()

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

Definition at line 102 of file HiggsValidation.h.

102 { return nparticles_; }

References nparticles_.

Referenced by HiggsValidation::bookHistograms().

◆ position()

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

Definition at line 60 of file HiggsValidation.h.

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  }

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

Referenced by HiggsValidation::findHiggsDecayChannel().

◆ size()

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

◆ stable()

size_t HiggsValidation::MonitoredDecays::stable ( )
inline

Definition at line 75 of file HiggsValidation.h.

75 { return size(); }

References size().

Referenced by HiggsValidation::findHiggsDecayChannel().

◆ undetermined()

size_t HiggsValidation::MonitoredDecays::undetermined ( )
inline

Definition at line 74 of file HiggsValidation.h.

74 { return 0; }

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

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().

mps_fire.i
i
Definition: mps_fire.py:428
input
static const std::string input
Definition: EdmProvDump.cc:48
HiggsValidation::MonitoredDecays::nparticles_
unsigned int nparticles_
Definition: HiggsValidation.h:158
pos
Definition: PixelAliasList.h:18
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
dqmdumpme.first
first
Definition: dqmdumpme.py:55
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
HiggsValidation::MonitoredDecays::namePidMap
std::map< std::string, int > namePidMap
Definition: HiggsValidation.h:155
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HiggsValidation::MonitoredDecays::undetermined
size_t undetermined()
Definition: HiggsValidation.h:74
HiggsValidation::MonitoredDecays::size
size_t size()
Definition: HiggsValidation.h:73
HiggsValidation::MonitoredDecays::convert
int convert(std::string s)
Definition: HiggsValidation.h:84
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HiggsValidation::MonitoredDecays::fill
void fill(std::string s)
Definition: HiggsValidation.h:125
PA_ZEESkim_cff.decay
decay
Definition: PA_ZEESkim_cff.py:26
HiggsValidation::MonitoredDecays::fillMap
void fillMap()
Definition: HiggsValidation.h:135
HiggsValidation::MonitoredDecays::channels
std::vector< std::pair< int, int > > channels
Definition: HiggsValidation.h:157
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22