Single Event
Setting Up Your Computing Environment
The first thing you'll need to do is to set up your CMSSW environment. This code was tested using CMSSW_8_3_0 and should not be used with any earlier version. From your working directory on lxplus, you'll need to do the following:
cmsrel CMSSW_8_3_0
cd CMSSW_8_3_0/src
cmsenv
After you have set up your CMSSW environment, you'll need to add the
JetMETCorrections/MCJets
and
PhysicsTools
packages.
git-cms-addpkg JetMETCorrections/MCJet
git-cms-addpkg PhysicsTools/Utilities
The next step is to get the repository for the code you'll use to check the events in question.
cd JetMETCorrections/MCJet
git clone ssh://git@gitlab.cern.ch:7999/mjoyce/EventCheck.git
How To Use The Code
When there is a question about an event we should get the following information from the MET group:
- An ntuple containing the events that we need to check
- A txt file with global tag, location, etc
- The run number, lumi, and event number we need to check.
If we are given the ntuple and the txt file from the MET group then we'll just need to run
test/datacheck_cfg.py
to create a new ntuple in the form that will be read by
macros/checkplot.C
. First we'll have to modify
datacheck_cfg.py
to load the ntuple provided by the MET group. Open
test/datacheck_cfg.py
with your favorite text editor and look for this section of code:
############# Set the number of events #############
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(-1)
)
############# Define the source file ###############
process.source = cms.Source("PoolSource",
fileNames=cms.untracked.vstring(
# Data
#'file:/afs/cern.ch/user/m/mquittna/public/exo/EXOMoriond16_v6_0T/pickeventsrunC.root'
#'file:/afs/cern.ch/work/p/pbarria/public/SingleEvent/CMSSW_8_3_0/src/JetMETCorrections/MCJet/pick1eventRUN274244.root'
'file:/afs/cern.ch/user/m/mjoyce/WorkingArea/Ecal/CMSSW_8_3_0/src/JetMETCorrections/MCJet/pickevents_ECAL_cell_RECO.root'
))
Simple put the path to the ntuple received from the MET group into the
# Data
section as
'file:/path/to/the/ntuple.root'
and comment all of the preexisting paths. Then you can run the script to produce the new ntuple.
python test/datacheck_cfg.py
This should create a new ntuple that we can read with ROOT macro
macros/checkplot.C
. The name of the created ntuple, if unchanged in the
datacheck_cfg.py
script, is
exomgg_0t_runC.root
.
The
checkplot.C
macro will produce plots that will zoom in on the phi and eta coordinates of the hits that are questionable. Those questionable hits are currently identified by global variable kGood=0. We will need to tell
checkplot.C
where to zoom. The txt file provided by the MET group contains the rechits tags like kGood, so we'll need to parse through that to find the coordinates of hits with kGood=0. The script
EventFinder.py
will do this for you.
./EventFinder.py name_of_text_file.txt &> output.txt
This will output a txt file
output.txt
that contains the coordinates, ADC values, gain, etc for each hit having kGood=0. The format should look something like this
Found bad event!
ieta,iphi=48 340 energy=2071.64 eta,phi=0.838368 -0.533877 et=1509.39 time=-1.47517
DIGI found
sample=1 adc=201 gainid=1
sample=2 adc=201 gainid=1
sample=3 adc=201 gainid=1
sample=4 adc=1736 gainid=1
sample=5 adc=3933 gainid=3
sample=6 adc=3968 gainid=0
sample=7 adc=3968 gainid=0
sample=8 adc=3968 gainid=0
sample=9 adc=3968 gainid=0
sample=10 adc=3968 gainid=0
Found bad event!
ieta,iphi=61 22 energy=6.64088 eta,phi=1.06109 0.202739 et=4.10489 time=0.793776
No DIGI found