Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
************************************************
* Validation/Optimization Tools for HLTOffline *
* by Joshua Berger                             *
************************************************

Instructions for running code:

1. Compile the code as usual using scramv1 b.

2. Find a suitable sample to run on.  The sample should have RAW since the HLT now works from RAW.  
   Insert this in PoolSource.fileNames in test/HLTRecoWithoutFilters.cfg.

3. Change the output file name to something suitable for the input file.  The output of this stage 
   will be a root file containing all the HLT isolation variables and some other quantities of 
   interest for e/gamma.  Then do

		> cmsRun HLTRecoWithoutFilters.cfg

   If you want to run on larger samples, you will probably want to run on a batch or on the grid.
   I have several sample scripts in ../test/HLTStudyData/ for running on the batches at FNAL and CERN as well as using CRAB.
   Getting grid credentials... now that's a different story.

For Validation:
4. Edit ../macros/Get*Eff.C, where * is the name of one of the Egamma HLT paths: SingleElectron, 
   RelaxedSingleElectron, etc.  Change the TFile argument to the file created in 3.  Change the cuts 
   at the beginning of the file to the cuts you would like to test.  These are currently the cuts in 
   the actual HLT code as of 1_6_0.  This should probably be updated to follow the newer format (files
   should be consolidated and user-defined multi-cut functions should be eliminated).

5. Do the following:

                > cd ../macros
		> root.exe
		[] .L CopyTreeMulti.C; // Only if running a Double trigger
		[] .x Get*Eff.C

   The output will be as follows: a text output to stdout of the number of events passing each filter
   and the efficiency of each filter and 3 graphs of efficiency vs. Et, eta, phi to 
   macros/images/EffV(Et/eta/phi)(SE/RSE/etc.).gif.

Bugs:
- Root scripts produce a long series of errors that do no affect the output.  These will probably be eliminated
  if the code is updated using the new SUM$ function described in other files.
- When eff = 1, the errors are calculated using some Bayesian algorithm in this version root.  This is
  changed to the more usual "error = 0 for eff = 1" way of working in newer versions of root (that we are not
  using for some reason).

For Rates, Plots, Optimization, ...:
6. Most of the files for these functions are documented with comments.  They are all located in ../macros with
   self-explanatory (I think) names.  Old Vars refers to files meant to study IHcal, E/p, while New Vars refers to
   files meant to study H/E, |1/E - 1/p|.  Note that I have added H/E and |1/E - 1/p| to the output of the
   CMSSW part of the code.  However, I have not updated the root scripts yet because not all the background samples
   contain this update!  More details in the actual files where relevant.  In order to run any of these scripts, do
   the following in the macros directory:

		> root.exe
		[] .L <Script-Name>.C++
		[] <Script-Name>

  Warning: the output is generally to file names defined in the script file.