Fork me on GitHub

Changeset 9666d3b in git


Ignore:
Timestamp:
Apr 11, 2018, 4:19:18 PM (7 years ago)
Author:
Ulrike Schnoor <ulrike.schnoor@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
6ba7847
Parents:
6f96f62 (diff), a670493 (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:

merged the upstream/master

Files:
9 added
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r6f96f62 r9666d3b  
    12571257        external/fastjet/Voronoi.$(SrcSuf) \
    12581258        external/fastjet/internal/Voronoi.hh
    1259 tmp/external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.$(ObjSuf): \
    1260         external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.$(ObjSuf)
    12611259tmp/external/fastjet/contribs/Nsubjettiness/AxesDefinition.$(ObjSuf): \
    12621260        external/fastjet/contribs/Nsubjettiness/AxesDefinition.$(SrcSuf)
     
    12891287tmp/external/fastjet/contribs/SoftKiller/SoftKiller.$(ObjSuf): \
    12901288        external/fastjet/contribs/SoftKiller/SoftKiller.$(SrcSuf)
     1289tmp/external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.$(ObjSuf): \
     1290        external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.$(SrcSuf) \
     1291        external/fastjet/NNH.hh
    12911292tmp/external/fastjet/plugins/ATLASCone/ATLASConePlugin.$(ObjSuf): \
    12921293        external/fastjet/plugins/ATLASCone/ATLASConePlugin.$(SrcSuf) \
     
    14191420        external/fastjet/plugins/CDFCones/fastjet/CDFMidPointPlugin.hh \
    14201421        external/fastjet/plugins/CDFCones/fastjet/CDFJetCluPlugin.hh \
    1421         external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.hh \
    14221422        external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh \
    14231423        external/fastjet/contribs/Nsubjettiness/Njettiness.hh \
    14241424        external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh \
    14251425        external/fastjet/contribs/Nsubjettiness/ExtraRecombiners.hh \
     1426        external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.hh \
    14261427        external/fastjet/tools/Filter.hh \
    14271428        external/fastjet/tools/Pruner.hh \
     
    14471448        external/fastjet/plugins/CDFCones/fastjet/CDFMidPointPlugin.hh \
    14481449        external/fastjet/plugins/CDFCones/fastjet/CDFJetCluPlugin.hh \
    1449         external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.hh \
    14501450        external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh \
    14511451        external/fastjet/contribs/Nsubjettiness/Njettiness.hh \
     
    15051505        tmp/external/fastjet/TilingExtent.$(ObjSuf) \
    15061506        tmp/external/fastjet/Voronoi.$(ObjSuf) \
    1507         tmp/external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.$(ObjSuf) \
    15081507        tmp/external/fastjet/contribs/Nsubjettiness/AxesDefinition.$(ObjSuf) \
    15091508        tmp/external/fastjet/contribs/Nsubjettiness/ExtraRecombiners.$(ObjSuf) \
     
    15191518        tmp/external/fastjet/contribs/RecursiveTools/SoftDrop.$(ObjSuf) \
    15201519        tmp/external/fastjet/contribs/SoftKiller/SoftKiller.$(ObjSuf) \
     1520        tmp/external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.$(ObjSuf) \
    15211521        tmp/external/fastjet/plugins/ATLASCone/ATLASConePlugin.$(ObjSuf) \
    15221522        tmp/external/fastjet/plugins/ATLASCone/Jet.$(ObjSuf) \
     
    18801880        @touch $@
    18811881
     1882external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.hh: \
     1883        external/fastjet/JetDefinition.hh \
     1884        external/fastjet/ClusterSequence.hh
     1885        @touch $@
     1886
    18821887external/fastjet/RectangularGrid.hh: \
    18831888        external/fastjet/PseudoJet.hh \
     
    18981903        @touch $@
    18991904
     1905<<<<<<< HEAD
    19001906
    19011907external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.hh: \
     
    19041910        @touch $@
    19051911
     1912=======
     1913>>>>>>> upstream/master
    19061914external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh: \
    19071915        external/fastjet/ClusterSequence.hh \
  • README.md

    r6f96f62 r9666d3b  
    55
    66More details can be found on the Delphes website http://cp3.irmp.ucl.ac.be/projects/delphes
     7
     8Quick start with Delphes
     9========================
     10
     11Commands to get the code:
     12
     13```
     14   wget http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.4.1.tar.gz
     15
     16   tar -zxf Delphes-3.4.1.tar.gz
     17```
     18
     19Commands to compile the code:
     20
     21```
     22   cd Delphes-3.4.1
     23
     24   make
     25```
     26
     27Finally, we can run Delphes:
     28
     29```
     30   ./DelphesHepMC
     31```
     32
     33Command line parameters:
     34
     35```
     36   ./DelphesHepMC config_file output_file [input_file(s)]
     37     config_file - configuration file in Tcl format
     38     output_file - output file in ROOT format,
     39     input_file(s) - input file(s) in HepMC format,
     40     with no input_file, or when input_file is -, read standard input.
     41```
     42
     43Let's simulate some Z->ee events:
     44
     45```
     46   wget http://cp3.irmp.ucl.ac.be/downloads/z_ee.hep.gz
     47   gunzip z_ee.hep.gz
     48   ./DelphesSTDHEP cards/delphes_card_CMS.tcl delphes_output.root z_ee.hep
     49```
     50
     51or
     52
     53```
     54   curl -s http://cp3.irmp.ucl.ac.be/downloads/z_ee.hep.gz | gunzip | ./DelphesSTDHEP cards/delphes_card_CMS.tcl delphes_output.root
     55```
     56
     57For more detailed documentation, please visit https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook
     58
     59Configure Delphes on lxplus.cern.ch
     60====================================
     61
     62```
     63git clone git://github.com/delphes/delphes.git Delphes
     64
     65cd Delphes
     66
     67source  /afs/cern.ch/sw/lcg/external/gcc/4.9.3/x86_64-slc6/setup.sh
     68
     69source /afs/cern.ch/sw/lcg/app/releases/ROOT/6.06.00/x86_64-slc6-gcc49-opt/root/bin/thisroot.sh
     70
     71make
     72```
     73
     74Simple analysis using TTree::Draw
     75=================================
     76
     77Now we can start [ROOT](root.cern) and look at the data stored in the output ROOT file.
     78
     79Start ROOT and load Delphes shared library:
     80
     81```
     82   root -l
     83   gSystem->Load("libDelphes");
     84```
     85
     86Open ROOT file and do some basic analysis using Draw or TBrowser:
     87
     88```
     89   TFile::Open("delphes_output.root");
     90   Delphes->Draw("Electron.PT");
     91   TBrowser browser;
     92```
     93
     94Notes:
     95* ```Delphes``` is the tree name. It can be learned e.g. from TBrowser.
     96* ```Electron```is the branch name; ```PT``` is a variable (leaf) of this branch.
     97
     98Complete description of all branches can be found in [doc/RootTreeDescription.html](doc/RootTreeDescription.html).
     99This information is also available [in the workbook](https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook/RootTreeDescription).
     100
     101Macro-based analysis
     102====================
     103
     104Analysis macro consists of histogram booking, event loop (histogram filling),
     105histogram display.
     106
     107Start ROOT and load Delphes shared library:
     108
     109```
     110   root -l
     111   gSystem->Load("libDelphes");
     112```
     113
     114Basic analysis macro:
     115
     116```
     117{
     118  // Create chain of root trees
     119  TChain chain("Delphes");
     120  chain.Add("delphes_output.root");
     121 
     122  // Create object of class ExRootTreeReader
     123  ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
     124  Long64_t numberOfEntries = treeReader->GetEntries();
     125 
     126  // Get pointers to branches used in this analysis
     127  TClonesArray *branchElectron = treeReader->UseBranch("Electron");
     128
     129  // Book histograms
     130  TH1 *histElectronPT = new TH1F("electron pt", "electron P_{T}", 50, 0.0, 100.0);
     131
     132  // Loop over all events
     133  for(Int_t entry = 0; entry < numberOfEntries; ++entry)
     134  {
     135
     136    // Load selected branches with data from specified event
     137    treeReader->ReadEntry(entry);
     138 
     139    // If event contains at least 1 electron
     140    if(branchElectron->GetEntries() > 0)
     141    {
     142      // Take first electron
     143      Electron *electron = (Electron*) branchElectron->At(0);
     144     
     145      // Plot electron transverse momentum
     146      histElectronPT->Fill(electron->PT);
     147     
     148      // Print electron transverse momentum
     149      cout << electron->PT << endl;
     150    }
     151
     152  }
     153
     154  // Show resulting histograms
     155  histElectronPT->Draw();
     156}
     157```
     158
     159More advanced macro-based analysis
     160==================================
     161
     162The 'examples' directory contains ROOT macros [Example1.C](examples/Example1.C), [Example2.C](examples/Example2.C) and [Example3.C](examples/Example3.C).
     163
     164Here are the commands to run these ROOT macros:
     165
     166```
     167   root -l
     168   .X examples/Example1.C("delphes_output.root");
     169```
     170
     171or
     172
     173```
     174   root -l examples/Example1.C'("delphes_output.root")'
     175```
  • cards/CMS_PhaseII/CMS_PhaseII_200PU_v03.tcl

    r6f96f62 r9666d3b  
    603603
    604604  set PhiBins {}
    605   for {set i -180} {$i <= 180} {incr i} {
    606     add PhiBins [expr {$i * $pi/180.0}]
     605  for {set i -45} {$i <= 45} {incr i} {
     606    add PhiBins [expr {$i * $pi/45.0}]
    607607  }
    608608
    609609  # 0.02 unit in eta up to eta = 3
    610   for {set i 1} {$i <= 84} {incr i} {
    611     set eta [expr { -2.958 + $i * 0.0174}]
     610  for {set i 1} {$i <= 21} {incr i} {
     611    set eta [expr { -2.958 + $i * 0.0696}]
    612612    add EtaPhiBins $eta $PhiBins
    613613  }
    614614
    615   for {set i 1} {$i <= 84} {incr i} {
    616     set eta [expr { 1.4964 + $i * 0.0174}]
     615  for {set i 1} {$i <= 21} {incr i} {
     616    set eta [expr { 1.4964 + $i * 0.0696}]
    617617    add EtaPhiBins $eta $PhiBins
    618618  }
     
    13301330  # efficiency formula for electrons
    13311331  # efficiency for low pT leptons is set artifically to 100%. Analyzers should rescale according to proper lepton Id       
    1332   set EfficiencyFormula {
    1333                                       (pt <= 4.0)  * (1.00) + \
    1334                          (abs(eta) <= 1.45 ) * (pt >  4.0 && pt <= 6.0)   * (0.50) + \
    1335                          (abs(eta) <= 1.45 ) * (pt >  6.0 && pt <= 8.0)   * (0.70) + \
    1336                          (abs(eta) <= 1.45 ) * (pt >  8.0 && pt <= 10.0)  * (0.85) + \
    1337                          (abs(eta) <= 1.45 ) * (pt > 10.0 && pt <= 30.0)  * (0.94) + \
    1338                          (abs(eta) <= 1.45 ) * (pt > 30.0 && pt <= 50.0)  * (0.97) + \
    1339                          (abs(eta) <= 1.45 ) * (pt > 50.0 && pt <= 70.0)  * (0.98) + \
    1340                          (abs(eta) <= 1.45 ) * (pt > 70.0 )  * (1.0) + \
    1341                          (abs(eta) > 1.45  && abs(eta) <= 1.55) * (pt >  4.0 && pt <= 10.0)   * (0.35) + \
    1342                          (abs(eta) > 1.45  && abs(eta) <= 1.55) * (pt > 10.0 && pt <= 30.0)   * (0.40) + \
    1343                          (abs(eta) > 1.45  && abs(eta) <= 1.55) * (pt > 30.0 && pt <= 70.0)   * (0.45) + \
    1344                          (abs(eta) > 1.45  && abs(eta) <= 1.55) * (pt > 70.0 )  * (0.55) + \
    1345                          (abs(eta) >= 1.55 && abs(eta) <= 2.0 ) * (pt >  4.0 && pt <= 10.0)  * (0.75) + \
    1346                          (abs(eta) >= 1.55 && abs(eta) <= 2.0 ) * (pt > 10.0 && pt <= 30.0)  * (0.85) + \
    1347                          (abs(eta) >= 1.55 && abs(eta) <= 2.0 ) * (pt > 30.0 && pt <= 50.0)  * (0.95) + \
    1348                          (abs(eta) >= 1.55 && abs(eta) <= 2.0 ) * (pt > 50.0 && pt <= 70.0)  * (0.95) + \
    1349                          (abs(eta) >= 1.55 && abs(eta) <= 2.0 ) * (pt > 70.0 )  * (1.0) + \
    1350                          (abs(eta) >= 2.0 && abs(eta) <= 2.5 ) * (pt >  4.0 && pt <= 10.0)  * (0.65) + \
    1351                          (abs(eta) >= 2.0 && abs(eta) <= 2.5 ) * (pt > 10.0 && pt <= 30.0)  * (0.75) + \
    1352                          (abs(eta) >= 2.0 && abs(eta) <= 2.5 ) * (pt > 30.0 && pt <= 50.0)  * (0.90) + \
    1353                          (abs(eta) >= 2.0 && abs(eta) <= 2.5 ) * (pt > 50.0 && pt <= 70.0)  * (0.90) + \
    1354                          (abs(eta) >= 2.0 && abs(eta) <= 2.5 ) * (pt > 70.0 )  * (0.90) + \
    1355                          (abs(eta) > 2.5 && abs(eta) <= 4.0 ) * (pt > 4.0 && pt <= 10.0) * (0.65) + \
    1356                                           (abs(eta) > 2.5 && abs(eta) <= 4.0 ) * (pt > 10.0 && pt <= 30.0) * (0.75) + \
    1357                                           (abs(eta) > 2.5 && abs(eta) <= 4.0 ) * (pt > 30.0 && pt <= 50.0) * (0.90) + \
    1358                                           (abs(eta) > 2.5 && abs(eta) <= 4.0 ) * (pt > 50.0 && pt <= 70.0) * (0.90) + \
    1359                                           (abs(eta) > 2.5 && abs(eta) <= 4.0 ) * (pt > 70.0 ) * (0.90) + \
    1360                                           (abs(eta) > 4.0) * (0.00)
    1361 
    1362   }
     1332    set EfficiencyFormula {
     1333                          (pt <= 4.0) * (0.00) +
     1334                          (abs(eta) > 0.0 && abs(eta) <= 0.5) * (pt > 4.0 && pt <= 6.0) * (0.018) +
     1335                          (abs(eta) > 0.0 && abs(eta) <= 0.5) * (pt > 6.0 && pt <= 8.0) * (0.252) +
     1336                          (abs(eta) > 0.0 && abs(eta) <= 0.5) * (pt > 8.0 && pt <= 10.0) * (0.480) +
     1337                          (abs(eta) > 0.0 && abs(eta) <= 0.5) * (pt > 10.0 && pt <= 20.0) * (0.681) +
     1338                          (abs(eta) > 0.0 && abs(eta) <= 0.5) * (pt > 20.0 && pt <= 35.0) * (0.792) +
     1339                          (abs(eta) > 0.0 && abs(eta) <= 0.5) * (pt > 35.0 && pt <= 50.0) * (0.862) +
     1340                          (abs(eta) > 0.0 && abs(eta) <= 0.5) * (pt > 50.0 && pt <= 14000.0) * (0.859) +
     1341                          (abs(eta) > 0.5 && abs(eta) <= 1.0) * (pt > 4.0 && pt <= 6.0) * (0.016) +
     1342                          (abs(eta) > 0.5 && abs(eta) <= 1.0) * (pt > 6.0 && pt <= 8.0) * (0.198) +
     1343                          (abs(eta) > 0.5 && abs(eta) <= 1.0) * (pt > 8.0 && pt <= 10.0) * (0.446) +
     1344                          (abs(eta) > 0.5 && abs(eta) <= 1.0) * (pt > 10.0 && pt <= 20.0) * (0.598) +
     1345                          (abs(eta) > 0.5 && abs(eta) <= 1.0) * (pt > 20.0 && pt <= 35.0) * (0.759) +
     1346                          (abs(eta) > 0.5 && abs(eta) <= 1.0) * (pt > 35.0 && pt <= 50.0) * (0.847) +
     1347                          (abs(eta) > 0.5 && abs(eta) <= 1.0) * (pt > 50.0 && pt <= 14000.0) * (0.872) +
     1348                          (abs(eta) > 1.0 && abs(eta) <= 1.45) * (pt > 4.0 && pt <= 6.0) * (0.005) +
     1349                          (abs(eta) > 1.0 && abs(eta) <= 1.45) * (pt > 6.0 && pt <= 8.0) * (0.029) +
     1350                          (abs(eta) > 1.0 && abs(eta) <= 1.45) * (pt > 8.0 && pt <= 10.0) * (0.108) +
     1351                          (abs(eta) > 1.0 && abs(eta) <= 1.45) * (pt > 10.0 && pt <= 20.0) * (0.289) +
     1352                          (abs(eta) > 1.0 && abs(eta) <= 1.45) * (pt > 20.0 && pt <= 35.0) * (0.570) +
     1353                          (abs(eta) > 1.0 && abs(eta) <= 1.45) * (pt > 35.0 && pt <= 50.0) * (0.743) +
     1354                          (abs(eta) > 1.0 && abs(eta) <= 1.45) * (pt > 50.0 && pt <= 14000.0) * (0.828) +
     1355                          (abs(eta) > 1.45 && abs(eta) <= 1.55) * (pt > 4.0 && pt <= 6.0) * (0.026) +
     1356                          (abs(eta) > 1.45 && abs(eta) <= 1.55) * (pt > 6.0 && pt <= 8.0) * (0.045) +
     1357                          (abs(eta) > 1.45 && abs(eta) <= 1.55) * (pt > 8.0 && pt <= 10.0) * (0.133) +
     1358                          (abs(eta) > 1.45 && abs(eta) <= 1.55) * (pt > 10.0 && pt <= 20.0) * (0.411) +
     1359                          (abs(eta) > 1.45 && abs(eta) <= 1.55) * (pt > 20.0 && pt <= 35.0) * (0.629) +
     1360                          (abs(eta) > 1.45 && abs(eta) <= 1.55) * (pt > 35.0 && pt <= 50.0) * (0.761) +
     1361                          (abs(eta) > 1.45 && abs(eta) <= 1.55) * (pt > 50.0 && pt <= 14000.0) * (0.752) +
     1362                          (abs(eta) > 1.55 && abs(eta) <= 2.0) * (pt > 4.0 && pt <= 6.0) * (0.061) +
     1363                          (abs(eta) > 1.55 && abs(eta) <= 2.0) * (pt > 6.0 && pt <= 8.0) * (0.191) +
     1364                          (abs(eta) > 1.55 && abs(eta) <= 2.0) * (pt > 8.0 && pt <= 10.0) * (0.337) +
     1365                          (abs(eta) > 1.55 && abs(eta) <= 2.0) * (pt > 10.0 && pt <= 20.0) * (0.475) +
     1366                          (abs(eta) > 1.55 && abs(eta) <= 2.0) * (pt > 20.0 && pt <= 35.0) * (0.605) +
     1367                          (abs(eta) > 1.55 && abs(eta) <= 2.0) * (pt > 35.0 && pt <= 50.0) * (0.713) +
     1368                          (abs(eta) > 1.55 && abs(eta) <= 2.0) * (pt > 50.0 && pt <= 14000.0) * (0.794) +
     1369                          (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 4.0 && pt <= 6.0) * (0.100) +
     1370                          (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 6.0 && pt <= 8.0) * (0.223) +
     1371                          (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 8.0 && pt <= 10.0) * (0.427) +
     1372                          (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 10.0 && pt <= 20.0) * (0.590) +
     1373                          (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 20.0 && pt <= 35.0) * (0.720) +
     1374                          (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 35.0 && pt <= 50.0) * (0.800) +
     1375                          (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 50.0 && pt <= 14000.0) * (0.840) +
     1376                          (abs(eta) > 2.5 && abs(eta) <= 3.0) * (pt > 4.0 && pt <= 6.0) * (0.049) +
     1377                          (abs(eta) > 2.5 && abs(eta) <= 3.0) * (pt > 6.0 && pt <= 8.0) * (0.152) +
     1378                          (abs(eta) > 2.5 && abs(eta) <= 3.0) * (pt > 8.0 && pt <= 10.0) * (0.436) +
     1379                          (abs(eta) > 2.5 && abs(eta) <= 3.0) * (pt > 10.0 && pt <= 20.0) * (0.679) +
     1380                          (abs(eta) > 2.5 && abs(eta) <= 3.0) * (pt > 20.0 && pt <= 35.0) * (0.778) +
     1381                          (abs(eta) > 2.5 && abs(eta) <= 3.0) * (pt > 35.0 && pt <= 50.0) * (0.830) +
     1382                          (abs(eta) > 2.5 && abs(eta) <= 3.0) * (pt > 50.0 && pt <= 14000.0) * (0.919) +
     1383                          (abs(eta) > 3.0) * (0.00)
     1384      }
    13631385}
    13641386
  • cards/delphes_card_ATLAS_PileUp.tcl

    r6f96f62 r9666d3b  
    360360}
    361361
    362 
    363362####################
    364363# Energy flow merger
     
    378377
    379378module PdgCodeFilter EFlowFilter {
    380   set InputArray EFlowMergerAllTracks/eflow
     379  set InputArray EFlowMerger/eflow
    381380  set OutputArray eflow
    382381 
  • modules/Delphes.cc

    r6f96f62 r9666d3b  
    7878Delphes::~Delphes()
    7979{
    80   if(fFactory) delete fFactory;
    8180  TFolder *folder = GetFolder();
    8281  if(folder)
     
    8584    delete folder;
    8685  }
     86  if(fFactory) delete fFactory;
    8787}
    8888
  • modules/StatusPidFilter.cc

    r6f96f62 r9666d3b  
    5151using namespace std;
    5252
     53namespace {
     54  // integer power (faster than TMath::Pow() + cast to integer)
     55  int ipow(int base, int exp)
     56  {
     57      int result = 1;
     58      while (exp)
     59      {
     60          if (exp & 1)
     61              result *= base;
     62          exp >>= 1;
     63          base *= base;
     64      }
     65
     66      return result;
     67  }
     68
     69  // standalone function to extract the i-th digit from a number (counting from 0 = rightmost, etc..)
     70  int digit(int val, int i)
     71  {
     72      int y    = ipow(10,i);
     73      int z    = val/y;
     74      int val2 = val / (y * 10);
     75      return (z - val2*10);
     76  }
     77
     78  //  return the first two digits if this is a "fundamental" particle
     79  //  ID = 100 is a special case (internal generator ID's are 81-100)
     80  //  also, 101 and 102 are now used (by HepPID) for geantinos
     81  int fundamentalID(int pdgCode)
     82  {
     83      pdgCode = abs(pdgCode);
     84      if( ( digit(pdgCode, 9) == 1 ) && ( digit(pdgCode, 8) == 0 ) ) { return 0; }
     85      if( digit(pdgCode, 2) == 0 && digit(pdgCode, 3) == 0) {
     86          return pdgCode%10000;
     87      } else if( pdgCode <= 102 ) {
     88          return pdgCode;
     89      } else {
     90          return 0;
     91      }
     92  }
     93
     94  bool hasBottom(int pdgCode)
     95  {
     96      if ( (pdgCode/10000000) > 0)
     97        return false;
     98      if (pdgCode <= 100)
     99        return false;
     100      if (fundamentalID(pdgCode) <= 100 && fundamentalID(pdgCode) > 0)
     101        return false;
     102      if( digit(pdgCode, 3) == 5 || digit(pdgCode, 2) == 5 || digit(pdgCode, 1) == 5 )
     103        return true;     
     104      return false;
     105  }
     106
     107  bool isTauDaughter(int pdgCode, int M1, const TObjArray *fInputArray){
     108    //not needed, just to speed up the code - can be further refined but gives only negligible improvement:
     109    if ( pdgCode==15 || pdgCode<11 || (pdgCode > 22 && pdgCode < 100) || pdgCode>1000 )
     110      return false;
     111
     112    if ( M1 < 0 )
     113      return false;
     114
     115    Candidate *mother;
     116    mother = static_cast<Candidate*>(fInputArray->At( M1 ));
     117    if ( TMath::Abs(mother->PID) == 15 )
     118      return true;
     119
     120    return false;
     121  }
     122
     123}
     124
     125
    53126//------------------------------------------------------------------------------
    54127
     
    117190    if(pdgCode > 22 && pdgCode < 43) pass = kTRUE;
    118191
    119     if(!pass || candidate->Momentum.Pt() < fPTMin) continue;
     192    //Stable photons
     193    if(pdgCode == 22 && status==1) pass = kTRUE;
     194
     195    // logic ported from HepPDF: http://lcgapp.cern.ch/project/simu/HepPDT/HepPDT.2.05.02/html/ParticleID_8cc-source.html#l00081
     196    bool is_b_hadron = hasBottom(pdgCode);
     197    bool is_b_quark  = (pdgCode == 5);
     198
     199    bool is_tau_daughter = isTauDaughter(pdgCode, candidate->M1, fInputArray);
     200
     201    if (is_b_hadron)
     202      pass = kTRUE;
     203
     204    if (is_tau_daughter)
     205      pass = kTRUE;
     206
     207    // fPTMin not applied to b_hadrons / b_quarks to allow for b-enriched sample stitching
     208    // fPTMin not applied to tau decay products to allow visible-tau four momentum determination
     209    if(!pass || (candidate->Momentum.Pt() < fPTMin && !(is_b_hadron || is_b_quark || is_tau_daughter)) ) continue;
    120210
    121211    fOutputArray->Add(candidate);
  • modules/TreeWriter.cc

    r6f96f62 r9666d3b  
    376376    rapidity = (cosTheta == 1.0 ? signz*999.9 : momentum.Rapidity());
    377377
     378    entry->P = p;
    378379    entry->PT  = pt;
    379380    entry->Eta = eta;
  • readers/DelphesROOT.cpp

    r6f96f62 r9666d3b  
    126126    confReader = new ExRootConfReader;
    127127    confReader->ReadFile(argv[1]);
    128    
    129     maxEvents = confReader->GetInt("::MaxEvents", 0);
    130128
    131129    if(maxEvents < 0)
     
    178176      {
    179177   
    180         if(entry >= maxEvents) break;
    181178        treeReader->ReadEntry(entry);
    182        
     179
    183180        // -- TBC need also to include event weights -- 
    184181       
Note: See TracChangeset for help on using the changeset viewer.