CMS 3D CMS Logo

MCParticleInfo Class Reference

class to retrieve particle info from Lund Code More...

#include <RecoBTag/MCTools/interface/MCParticleInfo.h>

List of all members.

Public Member Functions

bool hasStrangeness () const
bool isB () const
bool isBaryon () const
bool isBottomHadron () const
bool isC () const
bool isCharmHadron () const
bool isD () const
bool isGluon () const
bool isHadron () const
bool isLepton () const
bool isParton () const
bool isQuark () const
bool isS () const
bool isStrangeHadron () const
bool isU () const
int lundCode () const
int lundCodeOfHeaviestQuark () const
 MCParticleInfo (int)
 MCParticleInfo ()
void print () const
 print info
void reset ()
void setCode (int)
 fill Info
 ~MCParticleInfo ()

Private Attributes

bool hasStrangeness_
bool isB_
bool isBaryon_
bool isBottomHadron_
bool isC_
bool isCharmHadron_
bool isD_
bool isGluon_
bool isHadron_
bool isInitialised
bool isLepton_
bool isParton_
bool isQuark_
bool isS_
bool isStrangeHadron_
bool isU_
int lundCode_
int lundCodeOfHeaviestQuark_


Detailed Description

class to retrieve particle info from Lund Code

Definition at line 9 of file MCParticleInfo.h.


Constructor & Destructor Documentation

MCParticleInfo::MCParticleInfo (  )  [inline]

Definition at line 12 of file MCParticleInfo.h.

00012 {}

MCParticleInfo::MCParticleInfo ( int  LC  ) 

Definition at line 6 of file MCParticleInfo.cc.

References reset(), and setCode().

00006                                        {
00007   reset();
00008   setCode( LC );
00009 }

MCParticleInfo::~MCParticleInfo (  ) 

Definition at line 11 of file MCParticleInfo.cc.

00011                                 {
00012 }


Member Function Documentation

bool MCParticleInfo::hasStrangeness (  )  const [inline]

Definition at line 37 of file MCParticleInfo.h.

References hasStrangeness_.

00037 { return hasStrangeness_ ; }

bool MCParticleInfo::isB (  )  const [inline]

Definition at line 45 of file MCParticleInfo.h.

References isB_.

00045 { return isB_      ; }

bool MCParticleInfo::isBaryon (  )  const [inline]

Definition at line 38 of file MCParticleInfo.h.

References isBaryon_.

00038 { return isBaryon_ ; }

bool MCParticleInfo::isBottomHadron (  )  const [inline]

Definition at line 34 of file MCParticleInfo.h.

References isBottomHadron_.

00034 { return isBottomHadron_ ; }

bool MCParticleInfo::isC (  )  const [inline]

Definition at line 44 of file MCParticleInfo.h.

References isC_.

00044 { return isC_      ; }

bool MCParticleInfo::isCharmHadron (  )  const [inline]

Definition at line 35 of file MCParticleInfo.h.

References isCharmHadron_.

00035 { return isCharmHadron_ ; }

bool MCParticleInfo::isD (  )  const [inline]

Definition at line 41 of file MCParticleInfo.h.

References isD_.

Referenced by MCParton::setParticleProperties().

00041 { return isD_      ; }

bool MCParticleInfo::isGluon (  )  const [inline]

Definition at line 46 of file MCParticleInfo.h.

References isGluon_.

Referenced by MCParton::setParticleProperties().

00046 { return isGluon_  ; }

bool MCParticleInfo::isHadron (  )  const [inline]

Definition at line 33 of file MCParticleInfo.h.

References isHadron_.

00033 { return isHadron_ ; }

bool MCParticleInfo::isLepton (  )  const [inline]

Definition at line 48 of file MCParticleInfo.h.

References isLepton_.

00048 { return isLepton_ ; }

bool MCParticleInfo::isParton (  )  const [inline]

Definition at line 40 of file MCParticleInfo.h.

References isParton_.

Referenced by MCParton::setParticleProperties().

00040 { return isParton_ ; }

bool MCParticleInfo::isQuark (  )  const [inline]

Definition at line 47 of file MCParticleInfo.h.

References isQuark_.

00047 { return isQuark_  ; }

bool MCParticleInfo::isS (  )  const [inline]

Definition at line 43 of file MCParticleInfo.h.

References isS_.

Referenced by MCParton::setParticleProperties().

00043 { return isS_      ; }

bool MCParticleInfo::isStrangeHadron (  )  const [inline]

Definition at line 36 of file MCParticleInfo.h.

References isStrangeHadron_.

00036 { return isStrangeHadron_ ; }

bool MCParticleInfo::isU (  )  const [inline]

Definition at line 42 of file MCParticleInfo.h.

References isU_.

Referenced by MCParton::setParticleProperties().

00042 { return isU_      ; }

int MCParticleInfo::lundCode (  )  const [inline]

Definition at line 30 of file MCParticleInfo.h.

References lundCode_.

Referenced by MCParton::print(), and MCParton::setParticleProperties().

00030 { return lundCode_ ; }

int MCParticleInfo::lundCodeOfHeaviestQuark (  )  const [inline]

Definition at line 31 of file MCParticleInfo.h.

References lundCodeOfHeaviestQuark_.

00031 { return lundCodeOfHeaviestQuark_ ; }

void MCParticleInfo::print ( void   )  const

print info

Definition at line 121 of file MCParticleInfo.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), hasStrangeness_, isB_, isBaryon_, isBottomHadron_, isC_, isCharmHadron_, isD_, isGluon_, isLepton_, isParton_, isQuark_, isS_, isStrangeHadron_, isU_, lundCode_, and lundCodeOfHeaviestQuark_.

00121                                  {
00122   // print all particle Info
00123   cout << "--> MCParticleInfo:" << endl;
00124   cout << "--> LundCode               :" << lundCode_                << endl;
00125   cout << "--> LundCodeOfHeaviestQuark:" << lundCodeOfHeaviestQuark_ << endl;
00126   cout << "--> BottomHadron           :" << isBottomHadron_          << endl;
00127   cout << "--> CharmHadron            :" << isCharmHadron_           << endl;
00128   cout << "--> StrangeHadron          :" << isStrangeHadron_         << endl;
00129   cout << "--> strange                :" << hasStrangeness_          << endl;
00130   cout << "--> baryon                 :" << isBaryon_                << endl;
00131   cout << "--> Parton                 :" << isParton_                << endl;
00132   cout << "--> D                      :" << isD_                     << endl;
00133   cout << "--> U                      :" << isU_                     << endl;
00134   cout << "--> S                      :" << isS_                     << endl;
00135   cout << "--> C                      :" << isC_                     << endl;
00136   cout << "--> B                      :" << isB_                     << endl;
00137   cout << "--> Gluon                  :" << isGluon_                 << endl;
00138   cout << "--> Quark                  :" << isQuark_                 << endl;
00139   cout << "--> Lepton                 :" << isLepton_                << endl;
00140 }

void MCParticleInfo::reset ( void   ) 

Definition at line 14 of file MCParticleInfo.cc.

References hasStrangeness_, isB_, isBaryon_, isBottomHadron_, isC_, isCharmHadron_, isD_, isGluon_, isHadron_, isInitialised, isLepton_, isParton_, isQuark_, isS_, isStrangeHadron_, isU_, lundCode_, and lundCodeOfHeaviestQuark_.

Referenced by MCParticleInfo().

00014                             {
00015   isInitialised = false;
00016   // particle info
00017   lundCode_                = 0;
00018   lundCodeOfHeaviestQuark_ = 0;
00019   // for hadrons
00020   isHadron_        = false;
00021   isBottomHadron_  = false;
00022   isCharmHadron_   = false;
00023   isStrangeHadron_ = false;
00024   hasStrangeness_  = false;
00025   isBaryon_        = false;
00026   // for partons
00027   isParton_  = false;
00028   isD_       = false;
00029   isU_       = false;
00030   isS_       = false;
00031   isC_       = false;
00032   isB_       = false;
00033   isGluon_   = false;
00034   isQuark_   = false;
00035   // for light charged leptons
00036   isLepton_  = false;
00037 }

void MCParticleInfo::setCode ( int  LC  ) 

fill Info

Definition at line 39 of file MCParticleInfo.cc.

References funct::abs(), hasStrangeness_, isB_, isBaryon_, isBottomHadron_, isC_, isCharmHadron_, isD_, isGluon_, isHadron_, isInitialised, isLepton_, isParton_, isQuark_, isS_, isStrangeHadron_, isU_, lundCode_, lundCodeOfHeaviestQuark_, and true.

Referenced by MCParticleInfo(), MCParton::setParticleProperties(), and MCBaseParticle::setPDGid().

00039                                      {
00040   lundCode_ = LC;
00041   // decode this code and set data members accordingly
00042   // decompose in digits
00043   int kfa = abs(lundCode_);
00044   int kf2 = kfa;
00045   int n4  = kf2 / 10000;
00046   kf2 = kf2 - n4*10000; 
00047   int n3  = kf2 / 1000;
00048   kf2 = kf2 - n3*1000 ;
00049   int n2  = kf2 / 100;
00050   kf2 = kf2 - n2*100;
00051   int n1  = kf2 / 10;
00052   kf2 = kf2 - n1*10; 
00053 
00054   int isign;
00055   if ( lundCode_ >= 0 ) {
00056     isign = 1;
00057   }
00058   else {
00059     isign = -1;
00060   }
00061 
00062   //hadron?
00063   isHadron_ = false;
00064   if ( n3 != 0 || n2 != 0 ) isHadron_ = true;
00065   
00066   //baryon?
00067   isBaryon_ = false;
00068   if ( n3 != 0 ) isBaryon_ = true;
00069 
00070 // imax:      if baryon: n3
00071 //            meson : n2 * (-1)**max(...)
00072 // def.: imax > 0 for quark; < 0 for antiquark      
00073 // strange: if baryon: n3 or n2 or n1
00074 //          meson :    n2 or n1
00075   
00076   int iqmax; // flavour of heaviest quark
00077   hasStrangeness_ = false;
00078       
00079   if ( isBaryon_ ) {
00080     iqmax = n3;
00081     iqmax = iqmax * isign;
00082     if ( n3==3 || n2==3 || n1==3 ) hasStrangeness_ = true;
00083   }
00084   else {
00085     iqmax = n2;
00086     // adjust sign
00087     iqmax = iqmax * isign;
00088     for ( int ii=1; ii<=n2; ii++ ) iqmax = iqmax * -1; 
00089     if (n2==3 || n1==3) hasStrangeness_ = true;
00090   }
00091 
00092   // hadron type
00093   isBottomHadron_  = false;
00094   isCharmHadron_   = false;
00095   isStrangeHadron_ = false;
00096   if ( abs(iqmax) == 5 ) isBottomHadron_  = true;
00097   if ( abs(iqmax) == 4 ) isCharmHadron_   = true;
00098   if ( abs(iqmax) == 3 ) isStrangeHadron_ = true;
00099 
00100   
00101   // partons
00102   if ( abs ( lundCode_ ) ==  1 ) isD_     = true ; 
00103   if ( abs ( lundCode_ ) ==  2 ) isU_     = true ; 
00104   if ( abs ( lundCode_ ) ==  3 ) isS_     = true ; 
00105   if ( abs ( lundCode_ ) ==  4 ) isC_     = true ; 
00106   if ( abs ( lundCode_ ) ==  5 ) isB_     = true ; 
00107   if ( abs ( lundCode_ ) == 21 ) isGluon_ = true ; 
00108   isParton_ = isD_ || isU_ || isS_ || isC_ || isB_ || isGluon_ ;
00109   isQuark_  = isD_ || isU_ || isS_ || isC_ || isB_ ;
00110 
00111   lundCodeOfHeaviestQuark_ = iqmax ;
00112   
00113   // light charged leptons
00114   if (( abs ( lundCode_ ) == 11 ) ||
00115       ( abs ( lundCode_ ) == 13 )) isLepton_ = true;
00116   
00117   // now it's initialised properly
00118   isInitialised = true;
00119 }


Member Data Documentation

bool MCParticleInfo::hasStrangeness_ [private]

Definition at line 60 of file MCParticleInfo.h.

Referenced by hasStrangeness(), print(), reset(), and setCode().

bool MCParticleInfo::isB_ [private]

Definition at line 68 of file MCParticleInfo.h.

Referenced by isB(), print(), reset(), and setCode().

bool MCParticleInfo::isBaryon_ [private]

Definition at line 61 of file MCParticleInfo.h.

Referenced by isBaryon(), print(), reset(), and setCode().

bool MCParticleInfo::isBottomHadron_ [private]

Definition at line 57 of file MCParticleInfo.h.

Referenced by isBottomHadron(), print(), reset(), and setCode().

bool MCParticleInfo::isC_ [private]

Definition at line 67 of file MCParticleInfo.h.

Referenced by isC(), print(), reset(), and setCode().

bool MCParticleInfo::isCharmHadron_ [private]

Definition at line 58 of file MCParticleInfo.h.

Referenced by isCharmHadron(), print(), reset(), and setCode().

bool MCParticleInfo::isD_ [private]

Definition at line 64 of file MCParticleInfo.h.

Referenced by isD(), print(), reset(), and setCode().

bool MCParticleInfo::isGluon_ [private]

Definition at line 69 of file MCParticleInfo.h.

Referenced by isGluon(), print(), reset(), and setCode().

bool MCParticleInfo::isHadron_ [private]

Definition at line 56 of file MCParticleInfo.h.

Referenced by isHadron(), reset(), and setCode().

bool MCParticleInfo::isInitialised [private]

Definition at line 51 of file MCParticleInfo.h.

Referenced by reset(), and setCode().

bool MCParticleInfo::isLepton_ [private]

Definition at line 72 of file MCParticleInfo.h.

Referenced by isLepton(), print(), reset(), and setCode().

bool MCParticleInfo::isParton_ [private]

Definition at line 63 of file MCParticleInfo.h.

Referenced by isParton(), print(), reset(), and setCode().

bool MCParticleInfo::isQuark_ [private]

Definition at line 70 of file MCParticleInfo.h.

Referenced by isQuark(), print(), reset(), and setCode().

bool MCParticleInfo::isS_ [private]

Definition at line 66 of file MCParticleInfo.h.

Referenced by isS(), print(), reset(), and setCode().

bool MCParticleInfo::isStrangeHadron_ [private]

Definition at line 59 of file MCParticleInfo.h.

Referenced by isStrangeHadron(), print(), reset(), and setCode().

bool MCParticleInfo::isU_ [private]

Definition at line 65 of file MCParticleInfo.h.

Referenced by isU(), print(), reset(), and setCode().

int MCParticleInfo::lundCode_ [private]

Definition at line 53 of file MCParticleInfo.h.

Referenced by lundCode(), print(), reset(), and setCode().

int MCParticleInfo::lundCodeOfHeaviestQuark_ [private]

Definition at line 54 of file MCParticleInfo.h.

Referenced by lundCodeOfHeaviestQuark(), print(), reset(), and setCode().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:09 2009 for CMSSW by  doxygen 1.5.4