Fork me on GitHub

Changeset 5076b1b in git


Ignore:
Timestamp:
Aug 26, 2016, 12:02:18 PM (8 years ago)
Author:
GitHub <noreply@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
360d17e
Parents:
298734e (diff), 7b61e66 (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.
git-author:
Pavel Demin <pavel-demin@…> (08/26/16 12:02:18)
git-committer:
GitHub <noreply@…> (08/26/16 12:02:18)
Message:

Merge pull request #29 from AlexandreMertens/ValidationWorkWithPavel

Validation work with pavel

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r298734e r5076b1b  
    148148tmp/examples/Validation.$(ObjSuf): \
    149149        examples/Validation.cpp \
     150        classes/DelphesClasses.h \
     151        external/ExRootAnalysis/ExRootTreeReader.h \
     152        external/ExRootAnalysis/ExRootTreeWriter.h \
     153        external/ExRootAnalysis/ExRootTreeBranch.h \
     154        external/ExRootAnalysis/ExRootResult.h \
     155        external/ExRootAnalysis/ExRootUtilities.h
     156Validation_electron$(ExeSuf): \
     157        tmp/examples/Validation_electron.$(ObjSuf)
     158
     159tmp/examples/Validation_electron.$(ObjSuf): \
     160        examples/Validation_electron.cpp \
     161        classes/DelphesClasses.h \
     162        external/ExRootAnalysis/ExRootTreeReader.h \
     163        external/ExRootAnalysis/ExRootTreeWriter.h \
     164        external/ExRootAnalysis/ExRootTreeBranch.h \
     165        external/ExRootAnalysis/ExRootResult.h \
     166        external/ExRootAnalysis/ExRootUtilities.h
     167Validation_jet$(ExeSuf): \
     168        tmp/examples/Validation_jet.$(ObjSuf)
     169
     170tmp/examples/Validation_jet.$(ObjSuf): \
     171        examples/Validation_jet.cpp \
     172        classes/DelphesClasses.h \
     173        external/ExRootAnalysis/ExRootTreeReader.h \
     174        external/ExRootAnalysis/ExRootTreeWriter.h \
     175        external/ExRootAnalysis/ExRootTreeBranch.h \
     176        external/ExRootAnalysis/ExRootResult.h \
     177        external/ExRootAnalysis/ExRootUtilities.h
     178Validation_muon$(ExeSuf): \
     179        tmp/examples/Validation_muon.$(ObjSuf)
     180
     181tmp/examples/Validation_muon.$(ObjSuf): \
     182        examples/Validation_muon.cpp \
     183        classes/DelphesClasses.h \
     184        external/ExRootAnalysis/ExRootTreeReader.h \
     185        external/ExRootAnalysis/ExRootTreeWriter.h \
     186        external/ExRootAnalysis/ExRootTreeBranch.h \
     187        external/ExRootAnalysis/ExRootResult.h \
     188        external/ExRootAnalysis/ExRootUtilities.h
     189Validation_photon$(ExeSuf): \
     190        tmp/examples/Validation_photon.$(ObjSuf)
     191
     192tmp/examples/Validation_photon.$(ObjSuf): \
     193        examples/Validation_photon.cpp \
    150194        classes/DelphesClasses.h \
    151195        external/ExRootAnalysis/ExRootTreeReader.h \
     
    162206        stdhep2pileup$(ExeSuf) \
    163207        Example1$(ExeSuf) \
    164         Validation$(ExeSuf)
     208        Validation$(ExeSuf) \
     209        Validation_electron$(ExeSuf) \
     210        Validation_jet$(ExeSuf) \
     211        Validation_muon$(ExeSuf) \
     212        Validation_photon$(ExeSuf)
    165213
    166214EXECUTABLE_OBJ +=  \
     
    172220        tmp/converters/stdhep2pileup.$(ObjSuf) \
    173221        tmp/examples/Example1.$(ObjSuf) \
    174         tmp/examples/Validation.$(ObjSuf)
     222        tmp/examples/Validation.$(ObjSuf) \
     223        tmp/examples/Validation_electron.$(ObjSuf) \
     224        tmp/examples/Validation_jet.$(ObjSuf) \
     225        tmp/examples/Validation_muon.$(ObjSuf) \
     226        tmp/examples/Validation_photon.$(ObjSuf)
    175227
    176228DelphesHepMC$(ExeSuf): \
  • examples/Validation.cpp

    r298734e r5076b1b  
    188188  TH1D *histRecoPtfwd = new TH1D(name+" reco spectra Eta",name+" reco spectra fwd", Nbins, TMath::Log10(ptrangemin), TMath::Log10(ptrangemax));
    189189
     190  histGenPtcen->SetDirectory(0);
     191  histRecoPtcen->SetDirectory(0);
     192  histGenPtfwd->SetDirectory(0);
     193  histRecoPtfwd->SetDirectory(0);
    190194
    191195  BinLogX(histGenPtcen);
     
    324328      if(deltaR < 0.3)
    325329      {
    326         pt  = bestGenMomentum.Pt();
     330        pt  = bestGenMomentum.E();
    327331        eta = TMath::Abs(bestGenMomentum.Eta());
    328332
    329333        for (bin = 0; bin < Nbins; bin++)
    330334        {
    331           if(pt > histos->at(bin).ptmin && pt < histos->at(bin).ptmax && eta > 0.0 && eta < 2.5)
     335          if(pt > histos->at(bin).ptmin && pt < histos->at(bin).ptmax && eta < 2.5)
    332336          {
    333             if (eta < 1.5) {histos->at(bin).cenResolHist->Fill(recoMomentum.Pt()/bestGenMomentum.Pt());}
    334             else if (eta < 2.5) {histos->at(bin).fwdResolHist->Fill(recoMomentum.Pt()/bestGenMomentum.Pt());}
     337            if (eta < 1.5) {histos->at(bin).cenResolHist->Fill(recoMomentum.E()/bestGenMomentum.E());}
     338            else if (eta < 2.5) {histos->at(bin).fwdResolHist->Fill(recoMomentum.E()/bestGenMomentum.E());}
    335339          }
    336340        }
     
    731735  std::pair<TH1D*,TH1D*> histos_el = GetEff<Electron>(branchElectron, branchParticleElectron, "Electron", elID, treeReaderElectron);
    732736
     737  histos_el.second->SaveAs("test1.pdf");
     738
    733739  // tracking reconstruction efficiency
    734740  std::pair <TH1D*,TH1D*> histos_eltrack = GetEff<Track>(branchTrackElectron, branchParticleElectron, "electronTrack", elID, treeReaderElectron);
     
    795801  DrawAxis(histos_eltrack.second, leg_el2, 0);
    796802  leg_el2->Draw();
    797 
    798   C_el1->cd(0);
    799803
    800804  TString elRes = "electronERes";
     
    12761280  char *appName = "Validation";
    12771281
    1278   if(argc != 3)
     1282  if(argc != 8)
    12791283  {
    12801284    cout << " Usage: " << appName << " input_file_electron input_file_muon input_file_photon input_file_jet input_file_bjet input_file_taujet output_file" << endl;
  • readers/DelphesPythia8.cpp

    r298734e r5076b1b  
    153153// from pythia8 example 21
    154154
    155 void fillParticle(int id, double ee_max, double thetaIn, double phiIn,
    156   Pythia8::Event& event, Pythia8::ParticleData& pdt, Pythia8::Rndm& rndm, bool atRest = false) {
    157 
     155void fillParticle(int id, double pt_max, double eta_max,
     156  Pythia8::Event &event, Pythia8::ParticleData &pdt, Pythia8::Rndm &rndm)
     157{
    158158  // Reset event record to allow for new event.
    159159  event.reset();
    160160
    161   // Angles uniform in solid angle.
    162   double cThe, sThe, phi, ee;
    163   cThe = 2. * rndm.flat() - 1.;
    164   sThe = Pythia8::sqrtpos(1. - cThe * cThe);
    165   phi = 2. * M_PI * rndm.flat();
    166   ee = pow(10,1+(log10(ee_max)-1)*rndm.flat());
    167   double mm = pdt.mSel(id);
    168   double pp = Pythia8::sqrtpos(ee*ee - mm*mm);
     161  // Generate uniform pt and eta.
     162  double pt, eta, phi, pp, ee, mm;
     163  pt = pow(10, 1.0 + (log10(pt_max) - 1.0) * rndm.flat());
     164  eta = (2.0 * rndm.flat() - 1.0) * eta_max;
     165  phi = 2.0 * M_PI * rndm.flat();
     166  pp = pt * cosh(eta);
     167  mm = pdt.mSel(id);
     168  ee = Pythia8::sqrtpos(pp*pp + mm*mm);
    169169
    170170  // Store the particle in the event record.
    171   event.append( id, 1, 0, 0, pp * sThe * cos(phi), pp * sThe * sin(phi), pp * cThe, ee, mm);
    172 
     171  event.append(id, 1, 0, 0, pt * cos(phi), pt * sin(phi), pt * sinh(eta), ee, mm);
    173172}
    174173
    175 void fillPartons(int type, double ee_max, Pythia8::Event& event, Pythia8::ParticleData& pdt,
    176   Pythia8::Rndm& rndm) {
     174void fillPartons(int id, double pt_max, double eta_max,
     175  Pythia8::Event &event, Pythia8::ParticleData &pdt, Pythia8::Rndm &rndm)
     176{
    177177
    178178  // Reset event record to allow for new event.
    179179  event.reset();
    180180
    181   // Angles uniform in solid angle.
    182   double cThe, sThe, phi, ee;
    183 
    184181  // Information on a q qbar system, to be hadronized.
    185182
    186   cThe = 2. * rndm.flat() - 1.;
    187   sThe = Pythia8::sqrtpos(1. - cThe * cThe);
    188   phi = 2. * M_PI * rndm.flat();
    189   ee = pow(10,1+(log10(ee_max)-1)*rndm.flat());
    190   double mm = pdt.m0(type);
    191   double pp = Pythia8::sqrtpos(ee*ee - mm*mm);
    192   if (type == 21)
    193   {
    194     event.append( 21, 23, 101, 102, pp * sThe * cos(phi), pp * sThe * sin(phi), pp * cThe, ee);
    195     event.append( 21, 23, 102, 101, -pp * sThe * cos(phi), -pp * sThe * sin(phi), -pp * cThe, ee);
     183  // Generate uniform pt and eta.
     184  double pt, eta, phi, pp, ee, mm;
     185  pt = pow(10, 1.0 + (log10(pt_max) - 1.0) * rndm.flat());
     186  eta = (2.0 * rndm.flat() - 1.0) * eta_max;
     187  phi = 2.0 * M_PI * rndm.flat();
     188  pp = pt * cosh(eta);
     189  mm = pdt.m0(id);
     190  ee = Pythia8::sqrtpos(pp*pp + mm*mm);
     191
     192  if(id == 21)
     193  {
     194    event.append(21, 23, 101, 102, pt * cos(phi), pt * sin(phi), pt * sinh(eta), ee);
     195    event.append(21, 23, 102, 101, -pt * cos(phi), -pt * sin(phi), -pt * sinh(eta), ee);
    196196  }
    197197  else
    198198  {
    199     event.append(  type, 23, 101,   0, pp * sThe * cos(phi), pp * sThe * sin(phi), pp * cThe, ee, mm);
    200     event.append( -type, 23,   0, 101, -pp * sThe * cos(phi), -pp * sThe * sin(phi), -pp * cThe, ee, mm);
     199    event.append(id, 23, 101, 0, pt * cos(phi), pt * sin(phi), pt * sinh(eta), ee, mm);
     200    event.append(-id, 23, 0, 101, -pt * cos(phi), -pt * sin(phi), -pt * sinh(eta), ee, mm);
    201201  }
    202202}
     
    338338      if (pythia->flag("Main:spareFlag1"))
    339339      {
    340         if (pythia->mode("Main:spareMode1") == 11 || pythia->mode("Main:spareMode1") == 13 || pythia->mode("Main:spareMode1") == 22)
     340        if (pythia->mode("Main:spareMode1") == 11 || pythia->mode("Main:spareMode1") == 13 || pythia->mode("Main:spareMode1") == 15 || pythia->mode("Main:spareMode1") == 22)
    341341        {
    342           fillParticle( pythia->mode("Main:spareMode1"), pythia->parm("Main:spareParm1"), -1., 0.,pythia->event, pythia->particleData, pythia->rndm, 0);
     342          fillParticle(pythia->mode("Main:spareMode1"), pythia->parm("Main:spareParm1"), pythia->parm("Main:spareParm2"), pythia->event, pythia->particleData, pythia->rndm);
    343343        }
    344         else fillPartons( pythia->mode("Main:spareMode1"), pythia->parm("Main:spareParm1"), pythia->event, pythia->particleData, pythia->rndm);
     344        else
     345        {
     346          fillPartons(pythia->mode("Main:spareMode1"), pythia->parm("Main:spareParm1"), pythia->parm("Main:spareParm2"), pythia->event, pythia->particleData, pythia->rndm);
     347        }
    345348      }
    346349
Note: See TracChangeset for help on using the changeset viewer.