Fork me on GitHub

Changeset fa068d3 in git for examples


Ignore:
Timestamp:
Sep 6, 2016, 11:21:11 AM (8 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
e9971a7
Parents:
b9ae4c3
Message:

added card and number_of_events parameters, and some instructions

Location:
examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • examples/Validation.cpp

    rb9ae4c3 rfa068d3  
    551551
    552552  TF1 *f2 = new TF1("f2", "gaus", f1->GetParameter(1) - 2*f1->GetParameter(2), f1->GetParameter(1) + 2*f1->GetParameter(2));
    553   hist->Fit("f2","RQ"); 
     553  hist->Fit("f2","RQ");
    554554
    555555  Double_t sig = f2->GetParameter(2);
     
    914914  DrawAxis(mg_elFwd, leg_elFwd, 0.2);
    915915
    916   C_el1->Print("delphes_validation.pdf(","pdf");
    917   C_el2->Print("delphes_validation.pdf","pdf");
     916  TString pdfOutput(outputFile);
     917  pdfOutput.ReplaceAll(".root", ".pdf");
     918
     919  C_el1->Print(pdfOutput+"(","pdf");
     920  C_el2->Print(pdfOutput,"pdf");
    918921
    919922  gDirectory->cd(0);
     
    10151018  DrawAxis(mg_muFwd, leg_muFwd, 0.3, 1);
    10161019
    1017   C_mu1->Print("delphes_validation.pdf","pdf");
    1018   C_mu->Print("delphes_validation.pdf","pdf");
     1020  C_mu1->Print(pdfOutput,"pdf");
     1021  C_mu->Print(pdfOutput,"pdf");
    10191022
    10201023  gDirectory->cd(0);
     
    11161119  DrawAxis(mg_phFwd, leg_phFwd, 0.1);
    11171120
    1118   C_ph1->Print("delphes_validation.pdf","pdf");
    1119   C_ph->Print("delphes_validation.pdf","pdf");
     1121  C_ph1->Print(pdfOutput,"pdf");
     1122  C_ph->Print(pdfOutput,"pdf");
    11201123
    11211124  gDirectory->cd(0);
     
    12671270  mg_met->GetYaxis()->SetTitle("#sigma(ME_{x}) [GeV]");
    12681271
    1269   C_jet->Print("delphes_validation.pdf","pdf");
    1270   C_btag1->Print("delphes_validation.pdf","pdf");
    1271   C_tautag1->Print("delphes_validation.pdf","pdf");
    1272   C_met->Print("delphes_validation.pdf)","pdf");
     1272  C_jet->Print(pdfOutput,"pdf");
     1273  C_btag1->Print(pdfOutput,"pdf");
     1274  C_tautag1->Print(pdfOutput,"pdf");
     1275  C_met->Print(pdfOutput+")","pdf");
    12731276
    12741277  TFile *fout = new TFile(outputFile,"recreate");
  • examples/validation.sh

    rb9ae4c3 rfa068d3  
     1##############################################################################################
     2#
     3# This code produces at set of validation plots for a given detector card.
     4#
     5# In order to run this you need to compile Delphes with Pythia8 first, see:
     6#
     7# https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook/Pythia8
     8#
     9# After you (re-)compiled Delphes with Pythia8 you are ready to go, execute from Delphes main dir:
     10#
     11# ./examples/validation.sh [detector_card] [number_of_events]
     12#
     13#  e.g.
     14#
     15# ./examples/validation.sh delphes_card_CMS.tcl 100000
     16#
     17# Note that the more events you specify, the more accurate the controls plots will be ...
     18#
     19############################################################################################
     20
    121#! /bin/sh
     22
     23EXPECTED_ARGS=2
     24E_BADARGS=65
     25
     26if [ $# -ne $EXPECTED_ARGS ]
     27then
     28  echo "Usage: ./examples/validation.sh [detector_card] [number_of_events]"
     29  echo "for instance: ./examples/validation.sh delphes_card_CMS.tcl 10000"
     30  exit $E_BADARGS
     31fi
     32
     33card=$1
     34nEvents=$2
     35validationCard=cards/validation_$card
     36output=validation_${card%.*}.root
     37
     38sed 's/delphes_card_CMS.tcl/'$card'/g' cards/validation_card.tcl  > $validationCard
     39
    240function runParticleGun {
    341  name=$1
     
    543  cmnd="examples/Pythia8/configParticleGun_$name.cmnd"
    644  sed '/Main:spareMode1/s/=[[:space:]]*[0-9]*/= '$pid'/' examples/Pythia8/configParticleGun.cmnd > $cmnd
    7   ./DelphesPythia8 cards/validation_card.tcl $cmnd delphes_ParticleGun_$name.root
     45  sed '/Main:numberOfEvents/s/=[[:space:]]*[0-9]*/= '$nEvents'/' examples/Pythia8/configParticleGun.cmnd  > $cmnd
     46  ./DelphesPythia8 $validationCard $cmnd delphes_ParticleGun_$name.root
    847}
    948
     
    1554runParticleGun taujet 15
    1655
    17 ./Validation delphes_ParticleGun_electron.root delphes_ParticleGun_muon.root delphes_ParticleGun_photon.root delphes_ParticleGun_jet.root delphes_ParticleGun_bjet.root delphes_ParticleGun_taujet.root delphes_validation.root
     56./Validation delphes_ParticleGun_electron.root delphes_ParticleGun_muon.root delphes_ParticleGun_photon.root delphes_ParticleGun_jet.root delphes_ParticleGun_bjet.root delphes_ParticleGun_taujet.root $output
Note: See TracChangeset for help on using the changeset viewer.