/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtDecayTag.cc

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //
00003 // Environment:
00004 //      This software is part of models developed at BES collaboration
00005 //      based on the EvtGen framework.  If you use all or part
00006 //      of it, please give an appropriate acknowledgement.
00007 //
00008 // Copyright Information: See EvtGen/BesCopyright
00009 //      Copyright (A) 2006      Ping Rong-Gang @IHEP
00010 //
00011 // Module:  EvtDecayTag.cc
00012 //
00013 // Description:  Class to deal with the decay tag, e.g. the decay mode and multiplicity
00014 //
00015 // Modification history:
00016 //
00017 //    Ping R.-G.       December, 2011-Jan       Module created
00018 //
00019 //------------------------------------------------------------------------
00020 //
00021 
00022 
00023 #include <iostream>
00024 #include "EvtGenBase/EvtDecayTag.hh"
00025 
00026 using std::endl;
00027 using std::fstream;
00028 
00029 void EvtDecayTag::makeTag(EvtParticle* par){
00030 
00031   int ndaug = par->getNDaug();
00032   if(ndaug < 2){
00033     EvtId id = par->getId();
00034     int theTag = TagIndex(id);
00035     _multiplicity[theTag]++;
00036   } else {
00037   //--
00038     if(par == root_par) {
00039      int theMode = root_par->getChannel();
00040      _nmode.push_back(theMode);
00041     }
00042   //--
00043     int ND=0;
00044     EvtParticle *theD;
00045     for(int i=0;i<ndaug;i++){
00046       EvtParticle *theDaug = par->getDaug(i);
00047       if(par == root_par && theDaug->getNDaug()!=0){
00048         int theMode = theDaug->getChannel();
00049         _nmode.push_back(theMode);
00050         ND++;
00051         theD = theDaug;
00052       }
00053 
00054       int id = EvtPDL::getStdHep(theDaug->getId());
00055       if (id == 310) _multiplicity[6]++; //Ks
00056       if (id ==3122) _multiplicity[7]++; // Lambda or Lambdabar 
00057       makeTag(theDaug);    
00058     }
00059     //-- for root particle decays into only one unstable particle, the flag1 further tag the third decay
00060       if(ND ==1){
00061         int NDD= theD->getNDaug();
00062         for(int i=0;i<NDD;i++){
00063           EvtParticle *theDD=theD->getDaug(i);
00064           if(theDD->getNDaug() !=0 ){
00065             int ndd = theDD->getChannel();
00066             _nmode.push_back(ndd);
00067             break;
00068           }
00069         }
00070       }
00071       //-------------------
00072   }
00073 
00074 }
00075 
00076 int EvtDecayTag::TagIndex(EvtId pid){
00089  int id = EvtPDL::getStdHep(pid);
00090  int absid=fabs(id);
00091  if( absid == 22 )     {return 0;}  //photon
00092  else if(absid == 11 ) {return 1;} // electron
00093  else if(absid ==  13) {return 2;} // muon
00094  else if(absid == 211) {return 3;} // pion
00095  else if(absid == 321) {return 4;} // Kaon
00096  else if(absid ==2212) {return 5;} // pronton / anti-proton
00097  else if(absid == 310) {return 6;} // Ks
00098  else if(absid ==3122) {return 7;} // Lambda / Lambdabar
00099  else                  {return 8;}
00100 }
00101 
00102 int EvtDecayTag::getModeTag(){
00103   //get ConExc 74110 mode selected index
00104   std::vector<int> intFlag = root_par->getIntFlag();
00105   if(intFlag.size()>0){
00106     if(intFlag[0]==74110) return intFlag[1];
00107   }
00108 
00112   double seg0,seg1,seg2;
00113 
00114   int three   = 1000;
00115   int six     = 1000000;
00116   int themode = 1000000000;
00117   //---debugging
00118   // for(int im=0;im<_nmode.size();im++){std::cout<<"_nmode["<<im<<"]"<<_nmode[im]<<endl;;}
00119 
00120   if(_nmode.size()==1) {themode += _nmode[0]*six; return themode;}
00121   else if(_nmode.size() == 2){
00122     seg0 = _nmode[0]*six;
00123     seg1 = _nmode[1]*three;
00124     themode += seg0 + seg1;
00125     return themode;
00126   }
00127   else if(_nmode.size() >= 3){
00128     seg0 = _nmode[0]*six;
00129     seg1 = _nmode[1]*three;
00130     seg2 = _nmode[2];
00131     themode += seg0 + seg1 + seg2;
00132     return themode;
00133   }
00134 }
00135 
00136 int EvtDecayTag::getMultTag(){
00141   int thetag = 0;
00142   for(int i=1; i<9; i++){
00143     if (_multiplicity[i] >9) return 0; 
00144   }
00145   for(int i=0; i<9; i++){
00146     int ndx = 8-i;
00147     int dig = pow(10,ndx);
00148     thetag += dig*_multiplicity[i];
00149   }
00150   return thetag;
00151 }
00152 
00153 int EvtDecayTag::getHdrdBase(int index){
00154   int ten = 10;
00155   int base;
00156   if( index ==0 || index>=100 && index <1000) { return index;}
00157   else {
00158     base = index*ten;
00159     getHdrdBase(base);
00160   }
00161 }

Generated on Tue Nov 29 23:12:12 2016 for BOSS_7.0.2 by  doxygen 1.4.7