Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • readers/DelphesProMC.cpp

    r1fa50c2 r341014c  
    1717 */
    1818
     19#include <iostream>
     20#include <memory>
     21#include <sstream>
    1922#include <stdexcept>
    20 #include <iostream>
    21 #include <sstream>
    22 #include <memory>
    2323
    2424#include <map>
    2525
    26 #include <stdlib.h>
    2726#include <signal.h>
    2827#include <stdio.h>
    29 
     28#include <stdlib.h>
     29
     30#include "TApplication.h"
    3031#include "TROOT.h"
    31 #include "TApplication.h"
    32 
     32
     33#include "TDatabasePDG.h"
    3334#include "TFile.h"
     35#include "TLorentzVector.h"
    3436#include "TObjArray.h"
     37#include "TParticlePDG.h"
    3538#include "TStopwatch.h"
    36 #include "TDatabasePDG.h"
    37 #include "TParticlePDG.h"
    38 #include "TLorentzVector.h"
    39 
    40 #include "modules/Delphes.h"
    41 #include "classes/DelphesStream.h"
     39
    4240#include "classes/DelphesClasses.h"
    4341#include "classes/DelphesFactory.h"
    44 
     42#include "classes/DelphesStream.h"
     43#include "modules/Delphes.h"
     44
     45#include "ExRootAnalysis/ExRootProgressBar.h"
     46#include "ExRootAnalysis/ExRootTreeBranch.h"
    4547#include "ExRootAnalysis/ExRootTreeWriter.h"
    46 #include "ExRootAnalysis/ExRootTreeBranch.h"
    47 #include "ExRootAnalysis/ExRootProgressBar.h"
    4848
    4949#include "ProMC.pb.h"
     
    109109    status = mutableParticles->status(i);
    110110
    111     px = mutableParticles->px(i)/momentumUnit;
    112     py = mutableParticles->py(i)/momentumUnit;
    113     pz = mutableParticles->pz(i)/momentumUnit;
    114     mass = mutableParticles->mass(i)/momentumUnit;
    115     x = mutableParticles->x(i)/positionUnit;
    116     y = mutableParticles->y(i)/positionUnit;
    117     z = mutableParticles->z(i)/positionUnit;
    118     t = mutableParticles->t(i)/positionUnit;
     111    px = mutableParticles->px(i) / momentumUnit;
     112    py = mutableParticles->py(i) / momentumUnit;
     113    pz = mutableParticles->pz(i) / momentumUnit;
     114    mass = mutableParticles->mass(i) / momentumUnit;
     115    x = mutableParticles->x(i) / positionUnit;
     116    y = mutableParticles->y(i) / positionUnit;
     117    z = mutableParticles->z(i) / positionUnit;
     118    t = mutableParticles->t(i) / positionUnit;
    119119
    120120    candidate = factory->NewCandidate();
     
    125125    candidate->Status = status;
    126126
     127    candidate->IsPU = 0;
     128    if(mutableParticles->barcode(i) > 0) candidate->IsPU = 1; // pileup particle
     129
    127130    candidate->M1 = mutableParticles->mother1(i);
    128131    candidate->M2 = mutableParticles->mother2(i);
     
    132135
    133136    pdgParticle = pdg->GetParticle(pid);
    134     candidate->Charge = pdgParticle ? Int_t(pdgParticle->Charge()/3.0) : -999;
     137    candidate->Charge = pdgParticle ? Int_t(pdgParticle->Charge() / 3.0) : -999;
    135138    candidate->Mass = mass;
    136139
     
    184187  if(argc < 4)
    185188  {
    186     cout << " Usage: " << appName << " config_file" << " output_file" << " input_file(s)" << endl;
     189    cout << " Usage: " << appName << " config_file"
     190         << " output_file"
     191         << " input_file(s)" << endl;
    187192    cout << " config_file - configuration file in Tcl format," << endl;
    188193    cout << " output_file - output file in ROOT format," << endl;
     
    231236      cout << "** Reading " << argv[i] << endl;
    232237
     238      // use 64 bit
     239      //inputFile = new ProMCBook(argv[i], "r", true);
     240
     241      //use 32 bit zip (faster but limitted to 64k events)
    233242      inputFile = new ProMCBook(argv[i], "r");
    234243
     
    237246      momentumUnit = static_cast<double>(header.momentumunit());
    238247      positionUnit = static_cast<double>(header.lengthunit());
    239 
    240 
    241248
    242249      if(inputFile == NULL)
Note: See TracChangeset for help on using the changeset viewer.