Matrix Element Implementation in CMS2
Relax and have patience :)
The ME code is set up so that it takes flat root ntuples (babies) with event kinematics as an input, performs all event probability calculations and then outputs new file which is a clone of the original + an extra branch containing ME values. These babies are created from CMS2 ntuples using a piece of code which also applies event selection. Right now the amount of information stored in the babies is limited to what is needed for ME calculations. One could in principle expand.
Prepare root ntuples as the input to the ME calculations
- Getting the code from CVS (here I assume that you have already set up your favorite CMSSW release)
- Current tested working tag is wwVsHww_diLep2020_v3
cvs co -d CMS2/NtupleMacros/CORE UserCode/JRibnik/CMS2/NtupleMacros/CORE
cd CMS2/NtupleMacros/CORE
cvs up -r WW2010 CMS2.h CMS2.cc
cd ../../../
cvs co -r wwVsHww_diLep2020_v3 -d CMS2/NtupleMacros/HWWME UserCode/JRibnik/CMS2/NtupleMacros/HWWME
cvs co -d CMS2/NtupleMacros/Tools UserCode/JRibnik/CMS2/NtupleMacros/Tools
* Run script doAll.C to produce the input files for the ME calculations,
root -l doAll.C
- This looper creates one input file for later ME calculation for each process specified to run in the script, like WW_skimmednTuple.root
- It also creates one utility root file called Util.root, which contains the lepton efficiency and boost histograms as well as a dil mass distributions which are later used to read the event yields in ME.
Preparation of MCFM libraries (or building libmcfm.so)
You can copy this file from
/afs/cern.ch/user/y/yygao/public/libmcfm.so.
The following instructions are for generating this library by yourself,
- I suggest that you do this part on cmslpc-sl5. The code requires 32-bit libgfortran.so library. Unfortunately, I could not find 32 bit version of this library on UCSD cluster. Transferring from cmslpc does not work either b/c ucsd has gcc 4.3.4 compiler while cmslpc has 4.1.2. (gcc -v).
- now you need to modify compiler flags a bit (needed for 32 bit objects, not for 64), open makefile and make sure that the flags are: FFLAGS = -fno-automatic -fno-f2c -O0 -g -fPIC -m32 -march=i686 -I$(INCPATH)
- Compile:
make
cd obj
- Create shared library by running
g++ -Wl,-soname,libmcfm.so -m32 -march=i686 -shared -o libmcfm.so *.o -L /home/cdfsoft/products/cern/2004/Linux+2.4-2.3.2/lib (replace with your path)
g++ -Wl,-soname,libmcfm.so -m32 -march=i686 -shared -o libmcfm.so *.o -L /uscmst1/prod/sw/cms/external/cern/2006b/i686-slc5-gcc34-opt/lib/ (at cmslpc-sl5 -YY)
g++ -Wl,-soname,libmcfm.so -m32 -march=i686 -shared -o libmcfm.so *.o -L /code/osgcode/cdfsoft/products/cern/2004/Linux+2.4/lib (at ucsd -KB)
- You must end up with a library libmcfm.so, which contains all mcfm functions. You can transfer it from cmslpc to ucsd now, I tried it and it worked.
Run ME Calculations to produce cross-sections and LR
We now change the working directory to the HWWME/ME.
- Copy the mcfm library libmcfm.so here
- Compile by running gmake, this will create libME.so.
- Ok, you are pretty much done, now do:
root -l
.x runME_WWHWW.C+("../WW_skimmednTuple.root",10,1,100000,1.0,0, 10)
- The arguments are:
1 - input file
2 - random seed
3 - smearing level, not used now due to the absence of the resolution functions. In other words, P_reco=P_gen is assumed.
4 - number of steps in the integration, 50k has proven to be enough for stable results.
5 - error threshold
6 - Mass, if 0 - calculate for all processes and Higgs mass hypothesis
- A few notes on the ME code
- Output file should contain ME tree and will be called Wjets_skimmednTuple_ME.root
- TEvtProb .cc - main class, generates random numbers, calls PhaseSpace .
- See TUtil.cc line 539 on how pdf and mcfm ME functions are called.
Planned improvements
- The yields are currently read off manually in constructing the LR, this should be avoided
- The babyNtuple format should be changed to the Smurf format
--
SergoJindariani - 04 Jan 2011
Topic revision: r11 - 23 Mar 2011 - 06:15:02 -
YanyanGao