Running the SUSY di-photon analysis


The following is an exercise intended to demonstrate the technical aspects of running the RA3b analysis to students unfamiliar with UNIX computing and/or C++ ROOT environments. Of course, full understanding of the analysis process depends on your level of investigation behind-the-scenes of this exercise.

This example is an extension of the vanilla RA3 di-photon analysis aiming at requiring not simply gg+jets but gg+bjets. The analysis is described in great detail in the Analysis Note, AN2012-212. You can find the AN at under the CADI line SUS-12-018.

You should also keep in mind that this code is my personally-written analysis, so there are likely errors and poor coding techniques.

 Code is shown in blue 
 Changes you should make are in red 
 Output you should expect are in green 
 Commands you should execute are in grey 

Early preparation

If you have not already setup login scripts on the various clusters, do so now to save yourself trouble in the future:

In ~/.login you should have (for tcsh shell)
source /uscmst1/prod/sw/cms/cshrc prod
project CMSSW
setenv SCRAM_ARCH slc5_amd64_gcc462

source /uscmst1/prod/grid/gLite_SL5.csh
source /uscmst1/prod/grid/CRAB/crab.csh

In ~/.cshrc you should have (for tcsh shell):
setenv VO_CMS_SW_DIR /home/cmssoft/work
source $VO_CMS_SW_DIR/cmsset_default.csh
setenv SCRAM_ARCH slc5_amd64_gcc462

set LD_LIBRARY_PATH= ( /usr/lib64:$LD_LIBRARY_PATH )
source /root/gLite/gLite-UI/etc/profile.d/grid_env.csh

setenv CVSROOT
Note: on heprocks the grid_env.csh line will give you an error. But if you log into osg-hep you need that line for grid access.

In ~/.cshrc you should have (for tcsh shell):

source /afs/

If you just created these files for the first time, source them using

source ~/.cshrc
or log out and log back in.

Setting up the environment

This recipe below is written assuming you are working on the LPC (fermilab). All data/MC is stored at FNAL, and some of it is copied to UVA. Currently none is stored at CERN, so it's recommended to work on the LPC for now.

If you would like to work on heprocks locally at UVA:

Instead of
setenv CVSROOT
cvs login ## password is '98passwd'

cmsrel CMSSW_5_3_8_patch3
cd CMSSW_5_3_8_patch3/src
kserver_init     ## enter your CERN computing name and password
cvs co -d SusyNtuplizer -r cms538_v0_p1 UserCode/LPCPJM/SusyAnalysis/SusyNtuplizer
cd SusyNtuplizer/macro
cvs co -d test UserCode/bfrancis/SusyAnalysis
rm -r test/CVS/
mv test/* .
rm -r test/
cp /afs/ .

Running the analysis over data

Open the macro ana_condor.C with a text editor to see:




The chain.Add(...) line adds to the TChain all of the root files in that one folder -- this is all of the /Photon/ dataset of Run2012A, about 0.9/fb of data.

The other line tells SusyEventAnalyzer to run over every event in the TChain. This is about 2M events, so let's turn that down for now:


Now let's run!

root -b -q -l ana_condor.C

Which should give:

-------------------Job Summary-----------------
Total_events         : 10000
in_JSON              : 10000

----------------nojet Requirement-------------
gg+nojet events              : 62
eg+nojet events              : 50
ee+nojet events              : 612
ee+nojet events (onMass)     : 564
ff+nojet events              : 23
gf+nojet events              : 82


----------------Continues, info----------------
duplicate events          : 0
fail MET filters          : 49
no good PV                : 0
found a good photon       : 0
pfMet not available       : 0
>=2 good photons          : 0
lead et is good (no dphi) : 0
lead et is good (dphi)    : 0
no passing candidates     : 9122
JEC not available         : 0
bad jet                   : 0

events with no dijetpt    : 0
ee+j events with different e vertices : 0
RealTime : 0.210236 minutes
CPUTime  : 0.151833 minutes

You should now see in your working directory a file named hist_analysis_CSVM.root. This ROOT file stores information about the events that passed the analysis cuts. Have a look!

 root -l hist_analysis_CSVM.root 

If ROOT says something about DISPLAY not being set, you need to log out and log back in with -Y in the ssh flags.

For example we can look at the missing transverse energy (MET) of some background events by plotting pfMET for ee events, without a jet requirement. You can do this interactively with a TBrowser:

new TBrowser

Or alternatively you can use the CINT command line:

TTree * ee = (TTree*)_file0->Get("ee_nojet_EvtTree")

You can re-run ana_condor using more than 10k events to have these distributions fill out, or set it to -1 to get all of the events in Run2012A. Running over A+B+C+D took quite a long time, so we will have to produce a skim in the near future to mitigate the time needed.

Making some plots

The AN for the analysis describes in-depth the reweighting procedure we apply to the background samples. To actually apply this, there is the contents of the directory makePlots/. Once you have run over all of Run2012A (ie, sea->SetProcessNEvents(-1) and should take ~35 minutes), it's time to make a bunch of pretty plots.

Several ROOT files are needed, and normally you would produce them yourself using different modes of For brevity of this tutorial, you can copy these files into your working area and produce the files yourself later.

Assuming you are in the /macro/ directory of your working area, do the following:

cp /uscms_data/d2/bfrancis/test/signal_contamination_qcd30to40.root .
cp /uscms_data/d2/bfrancis/test/signal_contamination_qcd40.root .
cp /uscms_data/d2/bfrancis/test/signal_contamination_ttgjets.root .
cp -r /uscms_data/d2/bfrancis/test/acceptance/ .

Now you have some Monte Carlo backgrounds and some SUSY signal samples, after the full selection. The default macro does alot of things, so to speed things up, open up makePlots/ and make these changes:

Comment out the line: 
for x in nojet j b jj bj bb jjj bjj bbj 4j 4j1b 4j2b 5j 5j1b 5j2b 6j 6j1b 6j2b l lj lb ljj lbj lbb ljjj lbjj lbbj ljjjj lbjjj lbbjj ll llj llb lljj llbj llbb

And uncomment out the line:
#for x in nojet

So it should look now like:
#for x in nojet j b jj bj bb jjj bjj bbj 4j 4j1b 4j2b 5j 5j1b 5j2b 6j 6j1b 6j2b l lj lb ljj lbj lbb ljjj lbjj lbbj ljjjj lbjjj lbbjj ll llj llb lljj llbj llbb
for x in nojet

Now we can run:

cd makePlots/
./ ../hist_analysis_CSVM.root

Once it's done saying alot of things, you are left with a tarball named for the current date, something like Jun17.tgz. SCP this to your local laptop and open it up. Lots of things to look at!

One (cheap, weird) way to SCP this is to go through the HEP cluster:

(On fnal LPC):
scp Jun17.tgz

(On your laptop):
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2013-06-17 - BrianFrancis
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback