CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HiggsValidation::MonitoredDecays Class Reference

List of all members.

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


Constructor & Destructor Documentation

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

Definition at line 54 of file HiggsValidation.h.

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

                                                   {
      fillMap();
      std::vector<std::string> input = iConfig.getParameter<std::vector<std::string> >("monitorDecays");
      for(std::vector<std::string>::const_iterator i = input.begin(); i!= input.end(); ++i){
        fill(*i);
      }
    }
HiggsValidation::MonitoredDecays::~MonitoredDecays ( ) [inline]

Definition at line 62 of file HiggsValidation.h.

{};

Member Function Documentation

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

Definition at line 77 of file HiggsValidation.h.

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

Referenced by HiggsValidation::beginJob().

                               {
      if(i == 0) return "?";
      if(i == channels.size()+1) return "Stable";
      return convert(channels[i-1].first)+convert(channels[i-1].second);
    }
int HiggsValidation::MonitoredDecays::convert ( std::string  s) [inline]

Definition at line 83 of file HiggsValidation.h.

References namePidMap, and alignCSCRings::s.

Referenced by channel(), and fill().

                            {
      if( namePidMap.count(s)){
        return namePidMap[s];
      }
      return 0;
    }
std::string HiggsValidation::MonitoredDecays::convert ( int  pid) [inline]

Definition at line 90 of file HiggsValidation.h.

References abs, i, and namePidMap.

                              {
      pid = abs(pid);
      if(pid == 14 || pid == 16) pid = 12;
      for(std::map<std::string,int>::const_iterator i = namePidMap.begin(); i!= namePidMap.end(); ++i) {
        if(i->second == pid) return i->first;
      }
      return "not found";
    }
std::string HiggsValidation::MonitoredDecays::ConvertIndex ( int  index) [inline]

Definition at line 110 of file HiggsValidation.h.

References i, UserOptions_cff::idx, and namePidMap.

Referenced by HiggsValidation::beginJob().

                                     {
      int idx=0;
      for(std::map<std::string,int>::const_iterator i = namePidMap.begin(); i!= namePidMap.end(); ++i) {
        if(idx==index) return i->first;
        idx++;
      }
      return "unknown";
    }
void HiggsValidation::MonitoredDecays::fill ( std::string  s) [inline, private]

Definition at line 120 of file HiggsValidation.h.

References channels, convert(), and pos.

Referenced by MonitoredDecays().

                          {
      size_t pos = s.find("+");
      std::string particle1 = s.substr(0,pos);
      std::string particle2 = s.substr(pos+1,s.length()-pos);
      std::pair<int,int> decay;
      decay.first  = convert(particle1);
      decay.second = convert(particle2);
      channels.push_back(decay);
    }
void HiggsValidation::MonitoredDecays::fillMap ( ) [inline, private]

Definition at line 130 of file HiggsValidation.h.

References i, namePidMap, and nparticles_.

Referenced by MonitoredDecays().

                  {
      namePidMap["d"]     = 1;
      namePidMap["u"]     = 2;
      namePidMap["s"]     = 3;
      namePidMap["c"]     = 4;
      namePidMap["b"]     = 5;
      namePidMap["t"]     = 6;
      namePidMap["e"]     = 11;
      namePidMap["nu"]    = 12;
      namePidMap["mu"]    = 13;
      namePidMap["tau"]   = 15;
      namePidMap["gamma"] = 22;
      namePidMap["Z"]     = 23;
      namePidMap["W"]     = 24;
      nparticles_=0;
      for(std::map<std::string,int>::const_iterator i = namePidMap.begin(); i!= namePidMap.end(); ++i){
        nparticles_++;
      }
    }
int HiggsValidation::MonitoredDecays::isDecayParticle ( int  pid) [inline]

Definition at line 101 of file HiggsValidation.h.

References i, UserOptions_cff::idx, and namePidMap.

Referenced by HiggsValidation::analyze().

                                {
      int idx=0;
      for(std::map<std::string,int>::const_iterator i = namePidMap.begin(); i!= namePidMap.end(); ++i) {
        if(i->second == pid) return idx;
        idx++;
      }
      return -1;
    }
unsigned int HiggsValidation::MonitoredDecays::NDecayParticles ( ) [inline]

Definition at line 99 of file HiggsValidation.h.

References nparticles_.

Referenced by HiggsValidation::beginJob().

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

Definition at line 64 of file HiggsValidation.h.

References abs, channels, first, i, and edm::second().

Referenced by HiggsValidation::findHiggsDecayChannel().

                                      {
      if(abs(pid1) == 14 || abs(pid1) == 16) pid1 = 12;
      if(abs(pid2) == 14 || abs(pid2) == 16) pid2 = 12;
      for(size_t i = 0; i < channels.size(); ++i){
        if((channels[i].first == abs(pid1) && channels[i].second == abs(pid2)) || 
           (channels[i].first == abs(pid2) && channels[i].second == abs(pid1))) return i+1;
      }
      return channels.size()+1;
    }
size_t HiggsValidation::MonitoredDecays::size ( void  ) [inline]

Definition at line 74 of file HiggsValidation.h.

References channels.

Referenced by HiggsValidation::beginJob(), and stable().

{return channels.size() + 2;}
size_t HiggsValidation::MonitoredDecays::stable ( ) [inline]

Definition at line 76 of file HiggsValidation.h.

References size().

Referenced by HiggsValidation::findHiggsDecayChannel().

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

Definition at line 75 of file HiggsValidation.h.

Referenced by HiggsValidation::findHiggsDecayChannel().

{return 0;}

Member Data Documentation

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

Definition at line 152 of file HiggsValidation.h.

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

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

Definition at line 150 of file HiggsValidation.h.

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

Definition at line 153 of file HiggsValidation.h.

Referenced by fillMap(), and NDecayParticles().