Changes in / [6bc0fd3:1d9c62a] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
readers/DelphesProIO.cpp
r6bc0fd3 r1d9c62a 57 57 58 58 //--------------------------------------------------------------------------- 59 // This method dynamically checks the message type (varint or not) depending on 60 // non-zero value of units momentumUnit and positionUnit. 61 void ConvertInput(proio::Event *event, double momentumUnit, double positionUnit, 59 60 void ConvertInput(proio::Event *event, 62 61 ExRootTreeBranch *branch, DelphesFactory *factory, 63 62 TObjArray *allParticleOutputArray, TObjArray *stableParticleOutputArray, … … 77 76 pdg = TDatabasePDG::Instance(); 78 77 78 79 79 // event information 80 80 element = static_cast<HepMCEvent *>(branch->NewEntry()); 81 81 82 82 83 int nID=0; … … 98 99 /* 99 100 // Pythia8 specific 101 element->Number = mutableEvent->number(); 102 element->ProcessID = mutableEvent->process_id(); 100 103 element->MPI = mutableEvent->mpi(); 104 element->Weight = mutableEvent->weight(); 101 105 element->Scale = mutableEvent->scale(); 102 106 element->AlphaQED = mutableEvent->alpha_qed(); … … 113 117 element->ReadTime = readStopWatch->RealTime(); 114 118 element->ProcTime = procStopWatch->RealTime(); 115 116 117 118 if ( momentumUnit >0 && positionUnit>0) {119 120 121 auto entries = event->TaggedEntries("VarintPackedParticles");122 123 for (uint64_t entryID : entries) {124 125 auto mutableParticles = dynamic_cast<model::VarintPackedParticles *>(event->GetEntry(entryID));126 127 for(int i = 0; i < mutableParticles->pdg_size(); ++i)128 {129 pid = mutableParticles->pdg(i);130 status = mutableParticles->status(i);131 px = mutableParticles->px(i)/momentumUnit;132 py = mutableParticles->py(i)/momentumUnit;133 pz = mutableParticles->pz(i)/momentumUnit;134 mass = mutableParticles->mass(i)/momentumUnit;135 x = mutableParticles->x(i)/positionUnit;136 y = mutableParticles->y(i)/positionUnit;137 z = mutableParticles->z(i)/positionUnit;138 t = mutableParticles->t(i)/positionUnit;139 140 candidate = factory->NewCandidate();141 candidate->PID = pid;142 pdgCode = TMath::Abs(candidate->PID);143 candidate->Status = status;144 candidate->M1 = mutableParticles->parent1(i);145 candidate->M2 = mutableParticles->parent2(i);146 candidate->D1 = mutableParticles->child1(i);147 candidate->D2 = mutableParticles->child2(i);148 pdgParticle = pdg->GetParticle(pid);149 candidate->Charge = mutableParticles->charge(i)/3.0;150 //candidate->Charge = pdgParticle ? Int_t(pdgParticle->Charge()/3.0) : -999;151 candidate->Mass = mass;152 candidate->Momentum.SetXYZM(px, py, pz, mass);153 candidate->Position.SetXYZT(x, y, z, t);154 allParticleOutputArray->Add(candidate);155 if(!pdgParticle) continue;156 157 if(status == 1)158 {159 stableParticleOutputArray->Add(candidate);160 }161 else if(pdgCode <= 5 || pdgCode == 21 || pdgCode == 15)162 {163 partonOutputArray->Add(candidate);164 }165 }166 167 }168 169 } else {170 119 171 120 … … 249 198 } 250 199 251 252 } // end particle type253 200 254 201 } … … 352 299 353 300 auto event = new proio::Event(); 354 355 356 double varint_energy=0;357 double varint_length=0;358 359 360 301 auto max_n_events = std::numeric_limits<uint64_t>::max(); 361 302 auto nn = inputFile->Skip(max_n_events); … … 379 320 if(event == 0) continue; 380 321 381 // get metadata382 if (eventCounter == 0) {383 auto metadata = event->Metadata();384 std::cout << "** INFO: ProIO file metadata:" << std::endl;385 for (auto element : metadata) {386 string key=(string)element.first;387 string value=(string)(*element.second);388 std::cout << "** INFO: " << key << " = " << value << std::endl;389 if (key=="info:varint_energy") varint_energy=std::stod(value);390 if (key=="info:varint_length") varint_length=std::stod(value);391 }392 }393 394 395 322 readStopWatch.Stop(); 396 323 397 324 procStopWatch.Start(); 398 325 399 ConvertInput(event, varint_energy, varint_length,326 ConvertInput(event, 400 327 branchEvent, factory, 401 328 allParticleOutputArray, stableParticleOutputArray,
Note:
See TracChangeset
for help on using the changeset viewer.