- Timestamp:
- May 12, 2009, 9:47:12 AM (16 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/BFieldProp.cc
r294 r380 31 31 32 32 #include "BFieldProp.h" 33 #include "PdgParticle.h" 33 34 #include "SystemOfUnits.h" 34 35 #include "PhysicalConstants.h" … … 131 132 if (!DET->FLAG_bfield ) return; 132 133 133 q = ChargeVal(Part->PID) *eplus; // in units of 'e' 134 double M; 135 //int q1 = ChargeVal(Part->PID) *eplus; // in units of 'e' 136 if(Part->M < -999) { // unitialised! 137 PdgParticle pdg_part = DET->PDGtable[Part->PID]; 138 q = pdg_part.charge() *eplus; // in units of 'e' 139 M = pdg_part.mass(); // GeV 140 } else { q = Part->Charge; M = Part->M; } 141 134 142 if(q==0) return; 135 143 if(R_max==0) { cout << "ERROR: magnetic field has no lateral extention\n"; return;} … … 165 173 double PT = Part->PT; 166 174 double E = Part->E; // [GeV] 167 double M = Part->M; // [GeV]/c²175 //double M = Part->M; // [GeV]/c² 168 176 double Phi = UNDEFINED; 169 177 … … 477 485 double p = sqrt(pz*pz + pt*pt); //sqrt(px*px+py*py+pz*pz); 478 486 479 double M = Part->M;487 //double M = Part->M; // see above 480 488 double vx = px/M; 481 489 double vy = py/M; -
trunk/src/HEPEVTConverter.cc
r352 r380 169 169 170 170 171 HEPEVTConverter::HEPEVTConverter(const string& inputFileList, const string& outputFileName, const int& Nevents) : DataConverter(Nevents)171 HEPEVTConverter::HEPEVTConverter(const string& inputFileList, const string& outputFileName, const PdgTable& pdg, const int& Nevents) : DataConverter(pdg,Nevents) 172 172 { 173 173 string buffer; -
trunk/src/HepMCConverter.cc
r376 r380 36 36 #include "BlockClasses.h" 37 37 38 #include " SmearUtil.h"38 #include "PdgParticle.h" 39 39 #include "ExRootTreeWriter.h" 40 40 #include "ExRootTreeBranch.h" … … 197 197 element->D1 = da1; 198 198 element->D2 = da2; 199 element->Charge = ChargeVal(pid);200 199 201 200 element->E = index_to_particle[n]->momentum().e(); … … 203 202 element->Py = index_to_particle[n]->momentum().py(); 204 203 element->Pz = index_to_particle[n]->momentum().pz(); 205 element->M = index_to_particle[n]->momentum().m(); 206 207 float PT = sqrt(pow(element->Px,2)+pow(element->Py,2)); 208 element->PT = PT; 204 205 206 //cout << "element->PID = " << pid << "\t"; 207 //PdgParticle pdg_part(PdgID[pid]); 208 //element->M = index_to_particle[n]->momentum().m(); // this is the particle virtuality, not its rest mass 209 //element->M = pdg_part.mass(); 210 //element->Charge = pdg_part.charge(); 211 //cout << "element->M = " << element->M << " \t element->Charge = " << element->Charge << endl; 212 213 element->PT = sqrt(pow(element->Px,2)+pow(element->Py,2)); 209 214 210 215 momentum.SetPxPyPzE(element->Px, element->Py, element->Pz, element->E); … … 256 261 //------------------------------------------------------------------------------ 257 262 258 HepMCConverter::HepMCConverter(const string& inputFileList, const string& outputFileName, const int& Nevents) : DataConverter(Nevents)263 HepMCConverter::HepMCConverter(const string& inputFileList, const string& outputFileName, const PdgTable& pdg, const int& Nevents) : DataConverter(pdg,Nevents) 259 264 { 260 265 -
trunk/src/LHEFConverter.cc
r369 r380 39 39 #include "BlockClasses.h" 40 40 #include "LHEFConverter.h" 41 #include "SmearUtil.h" 42 #include "PdgParticle.h" 41 43 42 44 using namespace std; … … 85 87 element->Pz = hepeup.PUP[particle][2]; 86 88 element->E = hepeup.PUP[particle][3]; 87 element->M = hepeup.PUP[particle][4]; 88 89 //element->M = hepeup.PUP[particle][4]; 90 //element->Charge = ChargeVal(element->PID); 91 92 PdgParticle pdg_part = pdg_table[element->PID]; 93 element->Charge = pdg_part.charge(); 94 element->M = pdg_part.mass(); 95 89 96 momentum.SetPxPyPzE(element->Px, element->Py, element->Pz, element->E); 90 97 element->PT = momentum.Perp(); … … 105 112 //------------------------------------------------------------------------------ 106 113 //Nevents not yet implemented! 08.03.2009 107 LHEFConverter::LHEFConverter(const string& inputFileList, const string& outputFileName, const int& Nevents) :108 DataConverter( Nevents) {114 LHEFConverter::LHEFConverter(const string& inputFileList, const string& outputFileName, const PdgTable& pdg, const int& Nevents) : 115 DataConverter(pdg,Nevents) { 109 116 110 117 ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputFileName, "GEN"); -
trunk/src/STDHEPConverter.cc
r376 r380 41 41 #include "stdhep_declarations.h" 42 42 #include "STDHEPConverter.h" 43 #include "PdgParticle.h" 43 44 44 45 using namespace std; … … 79 80 element->D1 = myhepevt.jdahep[number][0] - 1; 80 81 element->D2 = myhepevt.jdahep[number][1] - 1; 81 // element->Charge = myhepevt.hepchg(element->PID); 82 element->Charge = ChargeVal(element->PID); 82 PdgParticle pdg_part = pdg_table[element->PID]; 83 element->Charge = pdg_part.charge(); 84 element->M = pdg_part.mass(); 83 85 84 86 element->E = myhepevt.phep[number][3]; … … 86 88 element->Py = myhepevt.phep[number][1]; 87 89 element->Pz = myhepevt.phep[number][2]; 88 element->M = myhepevt.phep[number][4];90 //element->M = myhepevt.phep[number][4]; 89 91 90 92 momentum.SetPxPyPzE(element->Px, element->Py, element->Pz, element->E); … … 111 113 //------------------------------------------------------------------------------ 112 114 113 STDHEPConverter::STDHEPConverter(const string& inputFileList, const string& outputFileName, const int& Nevents) : DataConverter(Nevents)115 STDHEPConverter::STDHEPConverter(const string& inputFileList, const string& outputFileName, const PdgTable& pdg, const int& Nevents) : DataConverter(pdg, Nevents) 114 116 { 115 117 int ierr, entryType; -
trunk/src/SmearUtil.cc
r376 r380 42 42 #include <sstream> 43 43 #include <iomanip> 44 #include <map> 44 45 using namespace std; 45 46 … … 195 196 RP_cross_y = 0.0; 196 197 RP_cross_ang = 142.5; 198 199 PdgTableFilename = "data/particle.tbl"; 197 200 198 201 } … … 332 335 333 336 PT_QUARKS_MIN = DET.PT_QUARKS_MIN; 337 PdgTableFilename = DET.PdgTableFilename; 338 PDGtable = DET.PDGtable; 334 339 } 335 340 … … 468 473 469 474 PT_QUARKS_MIN = DET.PT_QUARKS_MIN; 475 476 PdgTableFilename = DET.PdgTableFilename; 477 PDGtable = DET.PDGtable; 470 478 return *this; 471 479 } … … 577 585 else if(strstr(temp_string.c_str(),"FLAG_lhco")) {curstring >> varname >> ivalue; FLAG_lhco = ivalue;} 578 586 else if(strstr(temp_string.c_str(),"NEvents_Frog")) {curstring >> varname >> ivalue; NEvents_Frog = ivalue;} 587 588 else if(strstr(temp_string.c_str(),"PdgTableFilename")) {curstring >> varname >> svalue; PdgTableFilename = svalue;} 579 589 } 580 590 … … 657 667 f_out <<"**********************************************************************"<< endl; 658 668 f_out <<"** **"<< endl; 659 f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n"; 669 f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n"; 670 f_out<<"# Input PDG table : " << PdgTableFilename << " *"<<"\n"; 671 f_out<<"* *"<<"\n"; 660 672 f_out<<"* *"<<"\n"; 661 673 f_out<<"#******************************** *"<<"\n"; … … 1280 1292 int ChargeVal(const int pid) 1281 1293 { 1294 cout << "ChargeVal :: deprecated function, do not use it anymore" << endl; 1282 1295 int charge; 1283 1296 if( … … 1295 1308 1296 1309 } 1310 1311 //------------------------------------------------------------------------------ 1312 void RESOLution::ReadParticleDataGroupTable() { 1313 1314 string temp_string; 1315 istringstream curstring; 1316 1317 ifstream fichier_a_lire(PdgTableFilename.c_str()); 1318 if(!fichier_a_lire.good()) { 1319 cout <<"** ERROR: PDG Table ("<< PdgTableFilename 1320 << ") not found! exit. **" << endl; 1321 exit(1); 1322 return; 1323 } 1324 // first three lines of the file are useless 1325 getline(fichier_a_lire,temp_string); 1326 getline(fichier_a_lire,temp_string); 1327 getline(fichier_a_lire,temp_string); 1328 1329 1330 while (getline(fichier_a_lire,temp_string)) { 1331 curstring.clear(); // needed when using several times istringstream::str(string) 1332 curstring.str(temp_string); 1333 int ID; string name; int charge; float mass; float width; float lifetime; 1334 // ID name chg mass total width lifetime 1335 // 1 d -1 0.33000 0.00000 0.00000E+00 1336 curstring >> ID >> name >> charge >> mass >> width >> lifetime; 1337 PdgParticle particle(ID,name,mass,charge/3.,width,lifetime); 1338 PDGtable.insert(ID,particle); 1339 //PdgTable.insert(pair<int,PdgParticle>(ID,particle)); 1340 //cout << PDGtable[ID].name() << "\t" << PDGtable[ID].mass() << "\t" << PDGtable[ID].charge() << endl; 1341 } 1342 1343 } // ReadParticleDataGroupTable
Note:
See TracChangeset
for help on using the changeset viewer.