Fork me on GitHub

Changeset dd514ae in git


Ignore:
Timestamp:
Jun 10, 2015, 4:04:47 PM (10 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
8707eeb
Parents:
6ec8d18 (diff), 9c491e1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

resolve conflict in DelphesClasses.h

Files:
21 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r6ec8d18 rdd514ae  
    2929OPT_LIBS += -L$(subst include,lib,$(subst :, -L,$(LD_LIBRARY_PATH)))
    3030endif
    31 OPT_LIBS += -lGenVector -lFWCoreFWLite -lDataFormatsFWLite -lDataFormatsPatCandidates -lDataFormatsLuminosity -lSimDataFormatsGeneratorProducts -lCommonToolsUtils -lDataFormatsCommon
     31OPT_LIBS += -lGenVector -lFWCoreFWLite -lDataFormatsFWLite -lDataFormatsCommon -lDataFormatsPatCandidates -lDataFormatsLuminosity -lSimDataFormatsGeneratorProducts -lCommonToolsUtils -lDataFormatsCommon
    3232endif
    3333
  • cards/delphes_card_FCC_basic.tcl

    r6ec8d18 rdd514ae  
    226226  set EFlowTowerOutputArray eflowPhotons
    227227
     228  set IsEcal true
     229 
    228230  set EnergyMin 0.5
    229231  set EnergySignificanceMin 1.0
     
    290292  set EFlowTowerOutputArray eflowNeutralHadrons
    291293
     294  set IsEcal false
     295 
    292296  set EnergyMin 1.0
    293297  set EnergySignificanceMin 1.0
     
    431435
    432436module FastJetFinder FastJetFinder {
    433 #  set InputArray Calorimeter/towers
     437#  set InputArray TowerMerger/towers
    434438  set InputArray EFlowMerger/eflow
    435439
  • cards/delphes_card_LHCb.tcl

    r6ec8d18 rdd514ae  
    223223  set TowerOutputArray ecalTowers
    224224  set EFlowTowerOutputArray eflowPhotons
     225
     226  set IsEcal true
    225227
    226228  set EnergyMin 0.0
     
    303305  set TowerOutputArray hcalTowers
    304306  set EFlowTowerOutputArray eflowNeutralHadrons
     307
     308  set IsEcal false
    305309
    306310  set EnergyMin 0.0
  • classes/DelphesClasses.cc

    r6ec8d18 rdd514ae  
    4545//------------------------------------------------------------------------------
    4646
    47 TLorentzVector GenParticle::P4()
     47TLorentzVector GenParticle::P4() const
    4848{
    4949  TLorentzVector vec;
     
    5454//------------------------------------------------------------------------------
    5555
    56 TLorentzVector MissingET::P4()
     56TLorentzVector MissingET::P4() const
    5757{
    5858  TLorentzVector vec;
     
    6363//------------------------------------------------------------------------------
    6464
    65 TLorentzVector Photon::P4()
     65TLorentzVector Photon::P4() const
    6666{
    6767  TLorentzVector vec;
     
    7272//------------------------------------------------------------------------------
    7373
    74 TLorentzVector Electron::P4()
     74TLorentzVector Electron::P4() const
    7575{
    7676  TLorentzVector vec;
     
    8181//------------------------------------------------------------------------------
    8282
    83 TLorentzVector Muon::P4()
     83TLorentzVector Muon::P4() const
    8484{
    8585  TLorentzVector vec;
     
    9090//------------------------------------------------------------------------------
    9191
    92 TLorentzVector Jet::P4()
     92TLorentzVector Jet::P4() const
    9393{
    9494  TLorentzVector vec;
     
    9999//------------------------------------------------------------------------------
    100100
    101 TLorentzVector Track::P4()
     101TLorentzVector Track::P4() const
    102102{
    103103  TLorentzVector vec;
     
    108108//------------------------------------------------------------------------------
    109109
    110 TLorentzVector Tower::P4()
     110TLorentzVector Tower::P4() const
    111111{
    112112  TLorentzVector vec;
  • classes/DelphesClasses.h

    r6ec8d18 rdd514ae  
    161161  const CompBase *GetCompare() const { return fgCompare; }
    162162
    163   TLorentzVector P4();
     163  TLorentzVector P4() const;
    164164
    165165  ClassDef(GenParticle, 1)
     
    188188  Float_t Phi; // mising energy azimuthal angle
    189189
    190   TLorentzVector P4();
     190  TLorentzVector P4() const;
    191191
    192192  ClassDef(MissingET, 1)
     
    254254  const CompBase *GetCompare() const { return fgCompare; }
    255255
    256   TLorentzVector P4();
     256  TLorentzVector P4() const;
    257257
    258258  ClassDef(Photon, 2)
     
    289289  const CompBase *GetCompare() const { return fgCompare; }
    290290
    291   TLorentzVector P4();
     291  TLorentzVector P4() const;
    292292
    293293  ClassDef(Electron, 2)
     
    322322  const CompBase *GetCompare() const { return fgCompare; }
    323323
    324   TLorentzVector P4();
     324  TLorentzVector P4() const;
    325325
    326326  ClassDef(Muon, 2)
     
    419419  const CompBase *GetCompare() const { return fgCompare; }
    420420
    421   TLorentzVector P4();
     421  TLorentzVector P4() const;
    422422
    423423  ClassDef(Track, 2)
     
    448448  const CompBase *GetCompare() const { return fgCompare; }
    449449
    450   TLorentzVector P4();
     450  TLorentzVector P4() const;
    451451
    452452  ClassDef(Tower, 1)
  • display/Delphes3DGeometry.cc

    r6ec8d18 rdd514ae  
    2020#include <set>
    2121#include <map>
     22#include <string>
    2223#include <utility>
    2324#include <vector>
     
    3738#include "classes/DelphesClasses.h"
    3839#include "TF2.h"
     40#include "TFormula.h"
    3941#include "TH1F.h"
    4042#include "TMath.h"
     
    9092   tk_length_ = confReader->GetDouble(Form("%s::HalfLength",ParticlePropagator), 3.0)*100.;     // tk_length
    9193   tk_Bz_     = confReader->GetDouble("ParticlePropagator::Bz", 0.0);                           // tk_Bz
    92 
     94   
     95   string buffer;
     96   const char *it;
     97 
     98   
    9399   {
    94100   TString tkEffFormula = confReader->GetString(Form("%s::EfficiencyFormula",TrackingEfficiency),"abs(eta)<3.0");
     
    96102   tkEffFormula.ReplaceAll("eta","y");
    97103   tkEffFormula.ReplaceAll("phi","0.");
    98    TF2* tkEffFunction = new TF2("tkEff",tkEffFormula,0,1000,-10,10);
     104 
     105   for(it = tkEffFormula.Data(); *it; ++it)
     106   {
     107     if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue;
     108     buffer.push_back(*it);
     109   }
     110
     111   TF2* tkEffFunction = new TF2("tkEff",buffer.c_str(),0,1000,-10,10);
    99112   TH1F etaHisto("eta","eta",100,5.,-5.);
    100113   Double_t pt,eta;
     
    118131   muonEffFormula.ReplaceAll("eta","y");
    119132   muonEffFormula.ReplaceAll("phi","0.");
    120    TF2* muEffFunction = new TF2("muEff",muonEffFormula,0,1000,-10,10);
     133   
     134   buffer.clear();
     135   for(it = muonEffFormula.Data(); *it; ++it)
     136   {
     137     if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue;
     138     buffer.push_back(*it);
     139   }
     140
     141   TF2* muEffFunction = new TF2("muEff",buffer.c_str(),0,1000,-10,10);
    121142   TH1F etaHisto("eta2","eta2",100,5.,-5.);
    122143   Double_t pt,eta;
  • display/DelphesBranchElement.cc

    r6ec8d18 rdd514ae  
    155155  trkProp->SetMaxR(tkRadius_);
    156156  trkProp->SetMaxZ(tkHalfLength_);
     157  GenParticle *particle;
    157158  if(type=="Track") { // CASE 1: TRACKS
    158159    Track *track;
     
    161162                   track->P4().Px(), track->P4().Py(),
    162163                   track->P4().Pz(), track->P4().E(),
    163                    track->X, track->Y, track->Z, 0.0);
     164                   track->X/10.0, track->Y/10.0, track->Z/10.0, track->T/10.0);
    164165      eveTrack = new TEveTrack(&pb, counter, trkProp);
    165166      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
     
    173174    Electron *electron;
    174175    while((electron = (Electron *) itTrack.Next())) {
     176      particle = (GenParticle*) electron->Particle.GetObject();
    175177      TParticle pb(electron->Charge<0?11:-11, 1, 0, 0, 0, 0,
    176178                   electron->P4().Px(), electron->P4().Py(),
    177179                   electron->P4().Pz(), electron->P4().E(),
    178                    0., 0., 0., 0.);
     180                   particle->X/10.0, particle->Y/10.0, particle->Z/10.0, particle->T/10.0);
    179181      eveTrack = new TEveTrack(&pb, counter, trkProp);
    180182      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
     
    188190    Muon *muon;
    189191    while((muon = (Muon *) itTrack.Next())) {
     192      particle = (GenParticle*) muon->Particle.GetObject();
    190193      TParticle pb(muon->Charge<0?13:-13, 1, 0, 0, 0, 0,
    191194                   muon->P4().Px(), muon->P4().Py(),
    192195                   muon->P4().Pz(), muon->P4().E(),
    193                    0., 0., 0., 0.);
     196                   particle->X/10.0, particle->Y/10.0, particle->Z/10.0, particle->T/10.0);
    194197      eveTrack = new TEveTrack(&pb, counter, trkProp);
    195198      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
     
    206209                   photon->P4().Px(), photon->P4().Py(),
    207210                   photon->P4().Pz(), photon->P4().E(),
    208                    0., 0., 0., 0.);
     211                   0.0, 0.0, 0.0, 0.0);
    209212      eveTrack = new TEveTrack(&pb, counter, trkProp);
    210213      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
     
    223226                   particle->P4().Px(), particle->P4().Py(),
    224227                   particle->P4().Pz(), particle->P4().E(),
    225                    particle->X, particle->Y, particle->Z, particle->T);
     228                   particle->X/10.0, particle->Y/10.0, particle->Z/10.0, particle->T/10.0);
    226229      eveTrack = new TEveTrack(&pb, counter, trkProp);
    227230      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
  • doc/genMakefile.tcl

    r6ec8d18 rdd514ae  
    219219OPT_LIBS += -L$(subst include,lib,$(subst :, -L,$(LD_LIBRARY_PATH)))
    220220endif
    221 OPT_LIBS += -lGenVector -lFWCoreFWLite -lDataFormatsFWLite -lDataFormatsPatCandidates -lDataFormatsLuminosity -lSimDataFormatsGeneratorProducts -lCommonToolsUtils -lDataFormatsCommon
     221OPT_LIBS += -lGenVector -lFWCoreFWLite -lDataFormatsFWLite -lDataFormatsCommon -lDataFormatsPatCandidates -lDataFormatsLuminosity -lSimDataFormatsGeneratorProducts -lCommonToolsUtils -lDataFormatsCommon
    222222endif
    223223
  • modules/AngularSmearing.cc

    r6ec8d18 rdd514ae  
    100100{
    101101  Candidate *candidate, *mother;
    102   Double_t pt, eta, phi;
     102  Double_t pt, eta, phi, e;
    103103
    104104  fItInputArray->Reset();
     
    110110    phi = candidatePosition.Phi();
    111111    pt = candidateMomentum.Pt();
     112    e = candidateMomentum.E();
    112113
    113114    // apply smearing formula for eta,phi
    114115
    115     eta = gRandom->Gaus(eta, fFormulaEta->Eval(pt, eta));
    116     phi = gRandom->Gaus(phi, fFormulaPhi->Eval(pt, eta));
     116    eta = gRandom->Gaus(eta, fFormulaEta->Eval(pt, eta, phi, e));
     117    phi = gRandom->Gaus(phi, fFormulaPhi->Eval(pt, eta, phi, e));
    117118   
    118119    if(pt <= 0.0) continue;
  • modules/BTagging.cc

    r6ec8d18 rdd514ae  
    171171{
    172172  Candidate *jet, *parton;
    173   Double_t pt, eta, phi;
     173  Double_t pt, eta, phi, e;
    174174  TObjArray *partonArray;
    175175  map< Int_t, DelphesFormula * >::iterator itEfficiencyMap;
     
    194194    phi = jetMomentum.Phi();
    195195    pt = jetMomentum.Pt();
    196 
     196    e = jetMomentum.E();
     197   
    197198    // loop over all input partons
    198199    itPartonArray.Reset();
     
    218219
    219220    // apply an efficency formula
    220     jet->BTag |= (gRandom->Uniform() <= formula->Eval(pt, eta)) << fBitNumber;
    221   }
    222 }
    223 
    224 //------------------------------------------------------------------------------
     221    jet->BTag |= (gRandom->Uniform() <= formula->Eval(pt, eta, phi, e)) << fBitNumber;
     222  }
     223}
     224
     225//------------------------------------------------------------------------------
  • modules/Efficiency.cc

    r6ec8d18 rdd514ae  
    9696{
    9797  Candidate *candidate;
    98   Double_t pt, eta, phi;
     98  Double_t pt, eta, phi, e;
    9999
    100100  fItInputArray->Reset();
     
    106106    phi = candidatePosition.Phi();
    107107    pt = candidateMomentum.Pt();
     108    e = candidateMomentum.E();
    108109
    109110    // apply an efficency formula
    110     if(gRandom->Uniform() > fFormula->Eval(pt, eta)) continue;
     111    if(gRandom->Uniform() > fFormula->Eval(pt, eta, phi, e)) continue;
    111112   
    112113    fOutputArray->Add(candidate);
  • modules/EnergyScale.cc

    r6ec8d18 rdd514ae  
    104104    momentum = candidate->Momentum;
    105105
    106     scale = fFormula->Eval(momentum.Pt(), momentum.Eta());
     106    scale = fFormula->Eval(momentum.Pt(), momentum.Eta(), momentum.Phi(), momentum.E());
    107107
    108108    if(scale > 0.0) momentum *= scale;
  • modules/EnergySmearing.cc

    r6ec8d18 rdd514ae  
    9696{
    9797  Candidate *candidate, *mother;
    98   Double_t energy, eta, phi;
     98  Double_t pt, energy, eta, phi;
    9999
    100100  fItInputArray->Reset();
     
    103103    const TLorentzVector &candidatePosition = candidate->Position;
    104104    const TLorentzVector &candidateMomentum = candidate->Momentum;
     105   
     106    pt = candidatePosition.Pt();
    105107    eta = candidatePosition.Eta();
    106108    phi = candidatePosition.Phi();
     
    108110 
    109111    // apply smearing formula
    110     energy = gRandom->Gaus(energy, fFormula->Eval(0.0, eta, 0.0, energy));
     112    energy = gRandom->Gaus(energy, fFormula->Eval(pt, eta, phi, energy));
    111113     
    112114    if(energy <= 0.0) continue;
  • modules/IdentificationMap.cc

    r6ec8d18 rdd514ae  
    127127{
    128128  Candidate *candidate;
    129   Double_t pt, eta, phi;
     129  Double_t pt, eta, phi, e;
    130130  TMisIDMap::iterator itEfficiencyMap;
    131131  pair <TMisIDMap::iterator, TMisIDMap::iterator> range;
     
    143143    phi = candidatePosition.Phi();
    144144    pt = candidateMomentum.Pt();
     145    e = candidateMomentum.E();
     146   
    145147    pdgCodeIn = candidate->PID;
    146148    charge = candidate->Charge;
     
    164166      pdgCodeOut = (it->second).first;
    165167
    166       p = formula->Eval(pt, eta);
     168      p = formula->Eval(pt, eta, phi, e);
    167169
    168170      if(total <= r && r < total + p)
  • modules/ImpactParameterSmearing.cc

    r6ec8d18 rdd514ae  
    9797  Candidate *candidate, *particle, *mother;
    9898  Double_t xd, yd, zd, dxy, sx, sy, sz, ddxy;
    99   Double_t pt, eta, px, py;
     99  Double_t pt, eta, px, py, phi, e;
    100100
    101101  fItInputArray->Reset();
     
    110110    eta = candidateMomentum.Eta();
    111111    pt = candidateMomentum.Pt();
     112    phi = candidateMomentum.Phi();
     113    e = candidateMomentum.E();
     114   
    112115    px = candidateMomentum.Px();
    113116    py = candidateMomentum.Py();
     
    119122
    120123    // calculate smeared values
    121     sx = gRandom->Gaus(0.0, fFormula->Eval(pt, eta));
    122     sy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta));
    123     sz = gRandom->Gaus(0.0, fFormula->Eval(pt, eta));
     124    sx = gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e));
     125    sy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e));
     126    sz = gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e));
    124127
    125128    xd += sx;
     
    130133    dxy = (xd*py - yd*px)/pt;
    131134
    132     ddxy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta));
     135    ddxy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e));
    133136
    134137    // fill smeared values in candidate
  • modules/MomentumSmearing.cc

    r6ec8d18 rdd514ae  
    9696{
    9797  Candidate *candidate, *mother;
    98   Double_t pt, eta, phi;
     98  Double_t pt, eta, phi, e;
    9999
    100100  fItInputArray->Reset();
     
    106106    phi = candidatePosition.Phi();
    107107    pt = candidateMomentum.Pt();
     108    e = candidateMomentum.E();
    108109
    109110    // apply smearing formula
    110     pt = gRandom->Gaus(pt, fFormula->Eval(pt, eta) * pt);
     111    pt = gRandom->Gaus(pt, fFormula->Eval(pt, eta, phi, e) * pt);
    111112   
    112113    if(pt <= 0.0) continue;
  • modules/SimpleCalorimeter.cc

    r6ec8d18 rdd514ae  
    149149
    150150  fEnergySignificanceMin = GetDouble("EnergySignificanceMin", 0.0);
     151
     152  // flag that says if current calo is Ecal of Hcal (will then fill correct values of Eem and Ehad)
     153  fIsEcal = GetBool("IsEcal", false);
    151154
    152155  // switch on or off the dithering of the center of calorimeter towers
     
    425428  fTower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy);
    426429
     430  fTower->Eem = (!fIsEcal) ? 0 : energy;
     431  fTower->Ehad = (fIsEcal) ? 0 : energy;
     432
    427433  fTower->Edges[0] = fTowerEdges[0];
    428434  fTower->Edges[1] = fTowerEdges[1];
     
    447453    pt = energy / TMath::CosH(eta);
    448454
     455    tower->Eem = (!fIsEcal) ? 0 : energy;
     456    tower->Ehad = (fIsEcal) ? 0 : energy;
     457
    449458    tower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy);
    450459    fEFlowTowerOutputArray->Add(tower);
  • modules/SimpleCalorimeter.h

    r6ec8d18 rdd514ae  
     1
    12/*
    23 *  Delphes: a framework for fast simulation of a generic collider experiment
     
    7475  Bool_t fSmearTowerCenter;
    7576
     77  Bool_t fIsEcal; //!
     78
    7679  TFractionMap fFractionMap; //!
    7780  TBinMap fBinMap; //!
  • modules/TaggingParticlesSkimmer.cc

    r6ec8d18 rdd514ae  
    162162   
    163163    eta = TMath::Abs(candidate->Momentum.Eta());
    164     if(eta < fEtaMax) continue;
     164    if(eta > fEtaMax) continue;
    165165       
    166166    fOutputArray->Add(candidate);
  • modules/TauTagging.cc

    r6ec8d18 rdd514ae  
    7373
    7474  if(tau->D1 < 0) return -1;
     75
     76  if(tau->D2 < tau->D1) return -1;
    7577
    7678  if(tau->D1 >= fParticleInputArray->GetEntriesFast() ||
     
    201203  tauArray = fFilter->GetSubArray(fClassifier, 0);
    202204
    203   if(tauArray == 0) return;
    204 
    205   TIter itTauArray(tauArray);
    206 
    207205  // loop over all input jets
    208206  fItJetInputArray->Reset();
     
    217215
    218216    // loop over all input taus
    219     itTauArray.Reset();
    220     while((tau = static_cast<Candidate *>(itTauArray.Next())))
    221     {
    222       if(tau->D1 < 0) continue;
    223 
    224       if(tau->D1 >= fParticleInputArray->GetEntriesFast() ||
    225          tau->D2 >= fParticleInputArray->GetEntriesFast())
     217    if(tauArray){
     218      TIter itTauArray(tauArray);
     219      while((tau = static_cast<Candidate *>(itTauArray.Next())))
    226220      {
    227         throw runtime_error("tau's daughter index is greater than the ParticleInputArray size");
    228       }
    229 
    230       tauMomentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
    231 
    232       for(i = tau->D1; i <= tau->D2; ++i)
    233       {
    234         daughter = static_cast<Candidate *>(fParticleInputArray->At(i));
    235         if(TMath::Abs(daughter->PID) == 16) continue;
    236         tauMomentum += daughter->Momentum;
    237       }
    238 
    239       if(jetMomentum.DeltaR(tauMomentum) <= fDeltaR)
    240       {
    241         pdgCode = 15;
    242         charge = tau->Charge;
     221        if(tau->D1 < 0) continue;
     222
     223        if(tau->D1 >= fParticleInputArray->GetEntriesFast() ||
     224           tau->D2 >= fParticleInputArray->GetEntriesFast())
     225        {
     226          throw runtime_error("tau's daughter index is greater than the ParticleInputArray size");
     227        }
     228
     229        tauMomentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
     230
     231        for(i = tau->D1; i <= tau->D2; ++i)
     232        {
     233          daughter = static_cast<Candidate *>(fParticleInputArray->At(i));
     234          if(TMath::Abs(daughter->PID) == 16) continue;
     235          tauMomentum += daughter->Momentum;
     236        }
     237
     238        if(jetMomentum.DeltaR(tauMomentum) <= fDeltaR)
     239        {
     240          pdgCode = 15;
     241          charge = tau->Charge;
     242        }
    243243      }
    244244    }
  • readers/DelphesCMSFWLite.cpp

    r6ec8d18 rdd514ae  
    5656#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
    5757#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
     58#include "SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h"
     59#include "SimDataFormats/GeneratorProducts/interface/WeightsInfo.h"
    5860
    5961using namespace std;
     
    6264
    6365void ConvertInput(fwlite::Event &event, Long64_t eventCounter,
    64   ExRootTreeBranch *branchEvent, DelphesFactory *factory,
    65   TObjArray *allParticleOutputArray, TObjArray *stableParticleOutputArray,
    66   TObjArray *partonOutputArray)
     66  ExRootTreeBranch *branchEvent, ExRootTreeBranch *branchRwgt,
     67  DelphesFactory *factory, TObjArray *allParticleOutputArray,
     68  TObjArray *stableParticleOutputArray, TObjArray *partonOutputArray)
    6769{
    6870  fwlite::Handle< GenEventInfoProduct > handleGenEventInfo;
    6971
     72  fwlite::Handle< LHEEventProduct > handleLHEEvent;
     73
    7074  fwlite::Handle< vector< reco::GenParticle > > handleParticle;
    7175  vector< reco::GenParticle >::const_iterator itParticle;
     
    7579
    7680  handleGenEventInfo.getByLabel(event, "generator");
     81  handleLHEEvent.getByLabel(event, "source");
    7782  handleParticle.getByLabel(event, "genParticles");
    7883
    7984  HepMCEvent *element;
     85  Weight *weight;
    8086  Candidate *candidate;
    8187  TDatabasePDG *pdg;
     
    8692  Double_t px, py, pz, e, mass;
    8793  Double_t x, y, z;
     94
     95  const vector< gen::WeightsInfo > &vectorWeightsInfo = handleLHEEvent->weights();
     96  vector< gen::WeightsInfo >::const_iterator itWeightsInfo;
    8897
    8998  element = static_cast<HepMCEvent *>(branchEvent->NewEntry());
     
    108117  element->ReadTime = 0.0;
    109118  element->ProcTime = 0.0;
     119
     120  for(itWeightsInfo = vectorWeightsInfo.begin(); itWeightsInfo != vectorWeightsInfo.end(); ++itWeightsInfo)
     121  {
     122    weight = static_cast<Weight *>(branchRwgt->NewEntry());
     123    weight->Weight = itWeightsInfo->wgt;
     124  }
    110125
    111126  pdg = TDatabasePDG::Instance();
     
    186201  TStopwatch eventStopWatch;
    187202  ExRootTreeWriter *treeWriter = 0;
    188   ExRootTreeBranch *branchEvent = 0;
     203  ExRootTreeBranch *branchEvent = 0, *branchRwgt = 0;
    189204  ExRootConfReader *confReader = 0;
    190205  Delphes *modularDelphes = 0;
     
    226241
    227242    branchEvent = treeWriter->NewBranch("Event", HepMCEvent::Class());
     243    branchRwgt = treeWriter->NewBranch("Rwgt", Weight::Class());
    228244
    229245    confReader = new ExRootConfReader;
     
    268284      for(event.toBegin(); !event.atEnd() && !interrupted; ++event)
    269285      {
    270         ConvertInput(event, eventCounter, branchEvent, factory,
     286        ConvertInput(event, eventCounter, branchEvent, branchRwgt, factory,
    271287          allParticleOutputArray, stableParticleOutputArray, partonOutputArray);
    272288        modularDelphes->ProcessTask();
Note: See TracChangeset for help on using the changeset viewer.