Fork me on GitHub

Changeset 469 in svn for trunk/src


Ignore:
Timestamp:
Jul 13, 2009, 9:40:57 AM (15 years ago)
Author:
Xavier Rouby
Message:

property 'invisible()' added to PdgParticle

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PdgParticle.cc

    r443 r469  
    4343//PdgParticle::PdgParticle() : _pid(1), _mass(-1), _charge(-999), _gamma_tot(-1), _ctau(-1), _name("") {}
    4444
    45 PdgParticle::PdgParticle(const int pid, const std::string& name, const float m, const float q, const float gamma, const float ctau) :
    46   _pid(pid), _mass(m), _charge(q), _gamma_tot(gamma), _ctau(ctau), _name(name) {}
     45PdgParticle::PdgParticle(const long int pid, const std::string& name, const float m, const float q, const float gamma, const float ctau) :
     46  _pid(pid), _mass(m), _charge(q), _gamma_tot(gamma), _ctau(ctau), _name(name) {
     47  if( (abs(pid) == 12)       || (abs(pid) == 14)       || (abs(pid) == 16)      ||
     48      (abs(pid) == 1000022 ) || (abs(pid) == 1000023 ) || (abs(pid) == 1000025) ||
     49      (abs(pid) == 1000035 ) || (abs(pid) == 1000045 ) ) { /*std::cout << "invisible : " << pid << std::endl;*/ _isInvisible = true; }
     50  else _isInvisible = false;
     51}
    4752
    4853
    4954PdgParticle::PdgParticle(const PdgParticle& p) :
    50   _pid(p._pid), _mass(p._mass), _charge(p._charge), _gamma_tot(p._gamma_tot), _ctau(p._ctau), _name(p._name) {}
     55  _pid(p._pid), _mass(p._mass), _charge(p._charge), _gamma_tot(p._gamma_tot), _ctau(p._ctau), _name(p._name), _isInvisible(p._isInvisible) {}
    5156
    5257PdgParticle& PdgParticle::operator=(const PdgParticle& p) {
     
    5459    _pid = p._pid;      _name= p._name;                 _mass=p._mass;
    5560    _charge=p._charge;  _gamma_tot=p._gamma_tot;        _ctau = p._ctau;
     61    _isInvisible = p._isInvisible;
    5662   return *this;
    5763}
     
    7177}
    7278
    73 void PdgTable::insert(const int pid, const PdgParticle &p) {
     79void PdgTable::insert(const long int pid, const PdgParticle &p) {
    7480   _table.insert(std::map<int,PdgParticle>::value_type(pid,p));
    7581}
     
    7783void PdgTable::print() const {
    7884   std::map<int, PdgParticle>::const_iterator i;
    79    for(i = _table.begin(); i != _table.end(); i++)
     85   for(i = _table.begin(); i != _table.end(); i++) {
    8086         std::cout << "name = " << std::setw(20) << std::left << i->second.name()
    8187                   << "pid = "  << std::setw(10) << i->first
    8288                   << "\t M="   << std::setw(10) << i->second.mass() << "GeV/c^2"
    8389                   << "\t Q="   << std::setw(6)  << i->second.charge() << "e+"
    84                    << "\t ctau=" << i->second.ctau() << " m" << std::endl;
     90                   << "\t ctau=" << i->second.ctau() << " m";
     91         if(i->second.invisible()) std::cout << "\t invisible";
     92         std::cout << std::endl;
     93   }
    8594}
    8695
  • trunk/src/SmearUtil.cc

    r465 r469  
    14671467    curstring.clear(); // needed when using several times istringstream::str(string)
    14681468    curstring.str(temp_string);
    1469     int ID; string name; int charge; float mass; float width; float lifetime;
     1469    long int ID; std::string name; int charge; float mass; float width; float lifetime;
    14701470    // ID name   chg       mass    total width   lifetime
    14711471    //  1 d      -1      0.33000     0.00000   0.00000E+00
Note: See TracChangeset for help on using the changeset viewer.