Fork me on GitHub

Changes in / [6bc0fd3:1d9c62a] in git


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • readers/DelphesProIO.cpp

    r6bc0fd3 r1d9c62a  
    5757
    5858//---------------------------------------------------------------------------
    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
     60void ConvertInput(proio::Event *event,
    6261  ExRootTreeBranch *branch, DelphesFactory *factory,
    6362  TObjArray *allParticleOutputArray, TObjArray *stableParticleOutputArray,
     
    7776  pdg = TDatabasePDG::Instance();
    7877
     78
    7979  // event information
    8080  element = static_cast<HepMCEvent *>(branch->NewEntry());
     81
    8182
    8283 int nID=0;
     
    9899/*
    99100  // Pythia8 specific
     101  element->Number = mutableEvent->number();
     102  element->ProcessID = mutableEvent->process_id();
    100103  element->MPI = mutableEvent->mpi();
     104  element->Weight = mutableEvent->weight();
    101105  element->Scale = mutableEvent->scale();
    102106  element->AlphaQED = mutableEvent->alpha_qed();
     
    113117  element->ReadTime = readStopWatch->RealTime();
    114118  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 {
    170119
    171120
     
    249198  }
    250199
    251 
    252   } // end particle type
    253200
    254201}
     
    352299
    353300    auto event = new proio::Event();
    354 
    355 
    356    double varint_energy=0;
    357    double varint_length=0;
    358 
    359 
    360301    auto max_n_events = std::numeric_limits<uint64_t>::max();
    361302    auto nn = inputFile->Skip(max_n_events);
     
    379320        if(event == 0) continue;
    380321
    381        // get metadata
    382        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 
    395322        readStopWatch.Stop();
    396323
    397324        procStopWatch.Start();
    398325
    399         ConvertInput(event, varint_energy, varint_length,
     326        ConvertInput(event,
    400327          branchEvent, factory,
    401328          allParticleOutputArray, stableParticleOutputArray,
Note: See TracChangeset for help on using the changeset viewer.