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 49 of file HiggsValidation.h.

Constructor & Destructor Documentation

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

Definition at line 52 of file HiggsValidation.h.

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

52  {
53  fillMap();
54  std::vector<std::string> input = iConfig.getParameter<std::vector<std::string> >("monitorDecays");
55  for(std::vector<std::string>::const_iterator i = input.begin(); i!= input.end(); ++i){
56  fill(*i);
57  }
58  }
T getParameter(std::string const &) const
static std::string const input
Definition: EdmProvDump.cc:45
HiggsValidation::MonitoredDecays::~MonitoredDecays ( )
inline

Definition at line 60 of file HiggsValidation.h.

60 {};

Member Function Documentation

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

Definition at line 75 of file HiggsValidation.h.

References channels, convert(), plotBeamSpotDB::first, and edm::second().

Referenced by HiggsValidation::bookHistograms().

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

Definition at line 81 of file HiggsValidation.h.

References namePidMap, and alignCSCRings::s.

Referenced by channel(), and fill().

81  {
82  if( namePidMap.count(s)){
83  return namePidMap[s];
84  }
85  return 0;
86  }
std::map< std::string, int > namePidMap
std::string HiggsValidation::MonitoredDecays::convert ( int  pid)
inline

Definition at line 88 of file HiggsValidation.h.

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

88  {
89  pid = abs(pid);
90  if(pid == 14 || pid == 16) pid = 12;
91  for(std::map<std::string,int>::const_iterator i = namePidMap.begin(); i!= namePidMap.end(); ++i) {
92  if(i->second == pid) return i->first;
93  }
94  return "not found";
95  }
std::map< std::string, int > namePidMap
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string HiggsValidation::MonitoredDecays::ConvertIndex ( int  index)
inline

Definition at line 108 of file HiggsValidation.h.

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

Referenced by HiggsValidation::bookHistograms().

108  {
109  int idx=0;
110  for(std::map<std::string,int>::const_iterator i = namePidMap.begin(); i!= namePidMap.end(); ++i) {
111  if(idx==index) return i->first;
112  idx++;
113  }
114  return "unknown";
115  }
std::map< std::string, int > namePidMap
void HiggsValidation::MonitoredDecays::fill ( std::string  s)
inlineprivate

Definition at line 118 of file HiggsValidation.h.

References channels, convert(), SelectingProcedure_cff::decay, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by MonitoredDecays().

118  {
119  size_t pos = s.find("+");
120  std::string particle1 = s.substr(0,pos);
121  std::string particle2 = s.substr(pos+1,s.length()-pos);
122  std::pair<int,int> decay;
123  decay.first = convert(particle1);
124  decay.second = convert(particle2);
125  channels.push_back(decay);
126  }
std::vector< std::pair< int, int > > channels
void HiggsValidation::MonitoredDecays::fillMap ( )
inlineprivate

Definition at line 128 of file HiggsValidation.h.

References mps_fire::i, namePidMap, and nparticles_.

Referenced by MonitoredDecays().

128  {
129  namePidMap["d"] = 1;
130  namePidMap["u"] = 2;
131  namePidMap["s"] = 3;
132  namePidMap["c"] = 4;
133  namePidMap["b"] = 5;
134  namePidMap["t"] = 6;
135  namePidMap["e"] = 11;
136  namePidMap["nu"] = 12;
137  namePidMap["mu"] = 13;
138  namePidMap["tau"] = 15;
139  namePidMap["gamma"] = 22;
140  namePidMap["Z"] = 23;
141  namePidMap["W"] = 24;
142  nparticles_=0;
143  for(std::map<std::string,int>::const_iterator i = namePidMap.begin(); i!= namePidMap.end(); ++i){
144  nparticles_++;
145  }
146  }
std::map< std::string, int > namePidMap
int HiggsValidation::MonitoredDecays::isDecayParticle ( int  pid)
inline

Definition at line 99 of file HiggsValidation.h.

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

Referenced by HiggsValidation::analyze().

99  {
100  int idx=0;
101  for(std::map<std::string,int>::const_iterator i = namePidMap.begin(); i!= namePidMap.end(); ++i) {
102  if(i->second == pid) return idx;
103  idx++;
104  }
105  return -1;
106  }
std::map< std::string, int > namePidMap
unsigned int HiggsValidation::MonitoredDecays::NDecayParticles ( )
inline

Definition at line 97 of file HiggsValidation.h.

References nparticles_.

Referenced by HiggsValidation::bookHistograms().

97 {return nparticles_;}
size_t HiggsValidation::MonitoredDecays::position ( int  pid1,
int  pid2 
)
inline

Definition at line 62 of file HiggsValidation.h.

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

Referenced by HiggsValidation::findHiggsDecayChannel().

62  {
63  if(abs(pid1) == 14 || abs(pid1) == 16) pid1 = 12;
64  if(abs(pid2) == 14 || abs(pid2) == 16) 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))) return i+1;
68  }
69  return undetermined();//channels.size()+1;
70  }
U second(std::pair< T, U > const &p)
std::vector< std::pair< int, int > > channels
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
size_t HiggsValidation::MonitoredDecays::size ( void  )
inline

Definition at line 72 of file HiggsValidation.h.

References channels.

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

72 {return channels.size() + 2;}
std::vector< std::pair< int, int > > channels
size_t HiggsValidation::MonitoredDecays::stable ( )
inline

Definition at line 74 of file HiggsValidation.h.

References size().

Referenced by HiggsValidation::findHiggsDecayChannel().

74 {return size();}
size_t HiggsValidation::MonitoredDecays::undetermined ( )
inline

Definition at line 73 of file HiggsValidation.h.

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

73 {return 0;}

Member Data Documentation

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

Definition at line 150 of file HiggsValidation.h.

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

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

Definition at line 148 of file HiggsValidation.h.

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

unsigned int HiggsValidation::MonitoredDecays::nparticles_
private

Definition at line 151 of file HiggsValidation.h.

Referenced by fillMap(), and NDecayParticles().