Extended JTerm Exercise: Dimuon Analysis in First Collisions


This Twiki page presents one of the long exercises prepared for the EJTERM V, Commissioning and Analysis of Early Data with CMS, taking place at LPC, FNAL, during Jan. 5-9, 2010 (see the full program).

Our exercise deals with the first observation of dimuons in CMS, on the basis of the data collected in December 2009. It is composed of five different sub-exercises:

  1. Prepare the request of two centrally produced Monte Carlo event samples, one of J/psi signal events and one of QCD muon enriched (ppMuX) events
  2. Using the MC files, calculate the opposite-sign dimuon yields in the J/psi mass window (3.0-3.2 GeV) expected for an integrated luminosity of 1 nb-1, for both beam energies, 900 and 2360 GeV, when only global muons are considered and when tracker muons are also used
  3. Process the collected data samples, apply suitable event, track and dimuon selection criteria, and produce dimuon mass distributions, for global-global, global-tracker, and tracker-tracker muon pairs
  4. Produce figures comparing the measured and simulated single muon distributions of suitable variables to see how well the MC simulation reproduces the measurements
  5. Have a deeper look at the few dimuon events observed so far in CMS, including event displays (using Fireworks)

Details on muon reconstruction and identification in CMS can be found in the WorkBook, in the Analysis Note CMS AN-2008/098, in the CRAFT08 paper "Performance of CMS Muon Reconstruction in Cosmic-Ray Events" CFT-09-014 and in a previous talk given during JTERM III. Due to the fact that the first data, collected in December 2009, were taken with minimum bias triggers, this exercise does not make use of any dimuon triggers. However, for completeness, you may find information related to the ongoing design of a new dimuon trigger, aimed at collecting low pT quarkonia, in this page.

  • You can find an introduction to this exercise in this PDF file (or in this PPT file) and a more general "physics motivation" presentation in this PDF file (with emphasis on the foreseeable impact of CMS on the measurement of Upsilon polarization).

Important note for attendees of the EJTERM V school: you should post any problems/questions/comments/feedback on the EJTERM Logbook.

If you would like to do these exercises but do not have a Fermilab account, you can find all the needed root files on CERN castor, in the directory /castor/cern.ch/user/h/hwoehri/FirstData/EJTERM-Jan10.

Exercise 1 - Generation of Monte Carlo Samples

Frist Login to cmslpc.fnal.gov and setup the CMS enviroment:

source /uscmst1/prod/sw/cms/cshrc uaf 
cmscvsroot CMSSW
mkdir DimuonAna
cd DimuonAna
cmsrel CMSSW_3_3_4
cd CMSSW_3_3_4/src

Step 1: MC background sample

Go to the DBS webpage, search the data set "/ppMuXLoose/Summer09-STARTUP3X_V8F_2360GeV-v1/GEN-SIM-RAW" and click on "Conf.files". You can see the configuration file used for generating the "QDC muon enriched" sample (see the following lines). We take this file as a starting point; you should copy and paste its content in a file named ppMuXLoose_2360GeV_Gen_cfg.py and save it in your current directory.

Inspect this configuration file and look at the following lines:

processParameters = cms.vstring('MSEL=1,
            'MSTJ(22)=4       ! Decay unstable particles in a cylinder',
            'PARJ(73)=1500.   ! max. radius for MSTJ(22)=4',
            'PARJ(74)=3000.   ! max. Z for MSTJ(22)=4',
            'MDCY(C130,1)=1   ! decay k0-longs',
            'MDCY(C211,1)=1   ! decay pions',
            'MDCY(C321,1)=1   ! decay kaons'),
parameterSets = cms.vstring('pythiaUESettings', 'processParameters')

process.mugenfilter = cms.EDFilter("MCSmartSingleParticleFilter",
    ParticleID = cms.untracked.vint32(13, -13, 13, -13, 13, 
        -13, 13, -13, 13, -13, 
        13, -13, 13, -13),
    MinDecayZ = cms.untracked.vdouble(-4000.0, -4000.0, -4000.0, -4000.0, -4000.0, 
        -4000.0, -4000.0, -4000.0, -4000.0, -4000.0, 
        -4000.0, -4000.0, -4000.0, -4000.0)
    MaxDecayZ = cms.untracked.vdouble(4000.0, 4000.0, 4000.0, 4000.0, 4000.0, 
        4000.0, 4000.0, 4000.0, 4000.0, 4000.0, 
        4000.0, 4000.0, 4000.0, 4000.0),
    MaxDecayRadius = cms.untracked.vdouble(2000.0, 2000.0, 2000.0, 2000.0, 2000.0, 
        2000.0, 2000.0, 2000.0, 2000.0, 2000.0, 
        2000.0, 2000.0, 2000.0, 2000.0),
    MinEta = cms.untracked.vdouble(1.6, 1.6, -2.5, -2.5, 1.2, 
        1.2, -1.6, -1.6, 0.9, 0.9, 
        -1.2, -1.2, -0.9, -0.9),
    MaxEta = cms.untracked.vdouble(2.5, 2.5, -1.6, -1.6, 1.6, 
        1.6, -1.2, -1.2, 1.2, 1.2, 
        -0.9, -0.9, 0.9, 0.9),
    MinPt = cms.untracked.vdouble(0.5, 0.5, 0.5, 0.5, 1.0, 
        1.0, 1.0, 1.0, 2.0, 2.0, 
        2.0, 2.0, 3.0, 3.0),
You can see that for each eta bin there is a specific minimum pT threshold. These numerical values were determined by looking at a pT vs. eta single muon 2-D distribution produced from a MC generation of signal J/psi dimuons (without any filter) and selecting reconstructed TRACKER muons:

Quiz: What are the factors determining the lower pT threshold for muon detection?

While a tracker muon at midrapidity must have around 3.2 GeV to be detected, CMS can detect calo muons (also at midrapidity, say) down to a pT as low as 1.5 GeV. The available ppMuX samples cannot be used for studies of muon pairs where one of the muons is a calo muon at midrapidity. We need new MC samples with lower pT thresholds.

Quiz: Decide the numerical values of the 4 pT thresholds suitable to study calo muons, based on the pT vs. eta single muon 2-D distribution for reconstructed "calo muons", as seen in the following figure:


The script can then be run by executing

cmsRun ppMuXLoose_2360GeV_Gen_cfg.py

Step 2: MC J/psi signal sample

An alternative way to get a configuration file is to check out a suitable file from the module Configuration/CMS.GenProduction. We will use the file PYTHIA6_JPsiWithFSR_900GeV_cff.py and will prepare it to generate a few events at 2360 GeV, to determine the parameters "crossSection" and "filterEfficiency". In order to do it, we will make use of the "cmsDriver.py" script:

cvs co Configuration/CMS.GenProduction/python/PYTHIA6_JPsiWithFSR_900GeV_cff.py
cp Configuration/CMS.GenProduction/python/PYTHIA6_JPsiWithFSR_900GeV_cff.py Configuration/CMS.GenProduction/python/PYTHIA6_JPsiWithFSR_2360GeV_cff.py
Note: if you get the following error message when checking out:
cvs checkout: No CVSROOT specified!  Please use the `-d' option
cvs [checkout aborted]: or set the CVSROOT environment variable.
then you should first login to cvs, typing cvs login and specify the correct password. --> Ask me for the passwd...

Open the file Configuration/CMS.GenProduction/python/PYTHIA6_JPsiWithFSR_2360GeV_cff.py and change the energy from 900 to 2360 GeV by changing the parameter "comEnergy". Then follow:

cvs co Configuration/CMS.GenProduction/python/HERWIGPP_custom.py
cvs co Configuration/CMS.GenProduction/python/PythiaUESettings_cfi.py
scramv1 b
cmsDriver.py Configuration/CMS.GenProduction/python/PYTHIA6_JPsiWithFSR_2360GeV_cff.py -s GEN:ProductionFilterSequence -n 10000 --customise=Configuration/CMS.GenProduction/HERWIGPP_custom.py --conditions FrontierConditions_CMS.GlobalTag,STARTUP3X_V8E::All --no_exec --eventcontent FEVT --mc
cmsRun PYTHIA6_JPsiWithFSR_2360GeV_cff_py_GEN_STARTUP3X.py
At the end of execution, PYTHIA gives an overview of the cross section of the sub-process(es) involved. Retrieve the total cross section for our process (MSEL = 61) by checking the value of the line "All included subprocesses":
 I Subprocess                       I   Generated          Tried I   Sigma [mb]  I
 I   0 All included subprocesses    I        20000        277360 I    1.004E-01  I
Quiz: Is the cross section value reported in the above line comparable to the value of the parameter "crossSection" mentioned in PYTHIA6_JPsiWithFSR_2360GeV_cff.py? By which factor does the MSEL = 61 cross-section increase when going from 900 GeV to 2.36 TeV?

Upon positive execution you should also have the following root file in your current directory: PYTHIA6_JPsiWithFSR_2360GeV_cff_py_GEN.root. Open it and check the number of events stored, by executing the command

root -l PYTHIA6_JPsiWithFSR_2360GeV_cff_py_GEN.root
Quiz: What is the meaning of the variable "filterEfficiency" in the python script PYTHIA6_JPsiWithFSR_2360GeV_cff.py and how can it be calculated? Once you find the answer, update the PYTHIA6_JPsiWithFSR_2360GeV_cff_py_GEN_STARTUP3X.py file.

Exercise 2 - Dimuon Yields and Mass Distributions from Monte Carlo Samples

In this exercise we will obtain the expected dimuon yields in the J/psi mass window (signal and background), for an integrated luminosity of Lint = 1 nb-1, and we will prepare the corresponding figures showing the dimuon mass distributions.

If you have newly logged in to cmslpc, do not forget to setup the environment in the following way:

source /uscmst1/prod/sw/cms/cshrc uaf 
cmscvsroot CMSSW
cd DimuonAna/CMSSW_3_3_4/src/
(you will need to do this, every time to login newly to cmslpc).

You need to check out and compile the Onia2MuMu package:

cvs co -r V00-04-10 HeavyFlavorAnalysis/Onia2MuMu
scramv1 b
cd HeavyFlavorAnalysis/Onia2MuMu/test

Step 1: Skimming the MC samples

First, you should examine the Onia2MuMu analyzer: HeavyFlavorAnalysis/Onia2MuMu/src/Onia2MuMu.cc

See here for a list of 900 and 2360 GeV signal and background Monte Carlo event samples: https://twiki.cern.ch/twiki//bin/viewauth/CMS/Onia2MuMuSamples

For the purposes of our exercise, as an example, we will use the 900 GeV ppMuXLoose sample, generated in startup conditions.

We need to check out the latest version of the script jpsi_simple_cfg.py:

cd $CMSSW_BASE/src
cvs co -r HEAD HeavyFlavorAnalysis/Onia2MuMu/test/jpsi_simple_cfg.py
cd HeavyFlavorAnalysis/Onia2MuMu/test
Rename the file jpsi_simple_cfg.py to jPsiMuMu_cfg.py.

and execute the following steps:

  • Go to the DBS webpage and find the "/ppMuXLoose/Summer09-STARTUP3X_V8F_2360GeV-v1/GEN-SIM-RECO" data set
  • Replace the source file names in the script with one of the files from the above data set (follow the link LFNs: py)
  • Replace the output file name by "ppMuXLoose_2360_STARTUP.root"
  • Change the maximum number of events to 1000.

then run the script by typing:

cmsRun jPsiMuMu_cfg.py 

Upon positive execution, you will have produced the root file: "ppMuXLoose_2360_STARTUP.root". You can inspect its contents, e.g. using the TBrowser class.

Quiz: How are the muons tagged among the different categories ?

Step 2: Making histograms from the n-tuples

We will use the file produced in the previous step in order to project from the n-tuples relevant information into histograms that we can then look at. In case of problems, you can use the example root n-tuples as listed below. For the J/psi signal samples we followed the procedure in the previous step, using the data sets /JPsiMuMu/Summer09-STARTUP3X_V8F_900GeV-v1/GEN-SIM-RECO and /JPsiMuMu/Summer09-STARTUP3X_V8F_2360GeV-v1/GEN-SIM-RECO. and prepared the n-tuples for you, looping over the full statistics:


We will now use the following macros, which run over the skimmed n-tuples:

cd $CMSSW_BASE/src
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/Macros/ProjectQQ.C
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/Macros/ProjectQQ.h
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/Macros/runProjectQQ.C
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/Macros/commonVar.inc
cd UserCode/hWoehri/FirstData/Macros

Change the input file name to "ppMuXLoose_2360_STARTUP.root" in the macro ProjectQQ.h (including the path where the root file sits). Then, execute the macro runProjectQQ.C, specifying the following output file name, "histos_ppMuXLoose_2360GeV_STARTUP.root" which should be given as the first input. Leave the second and fourth input arguments as they are, but change the third argument to kTRUE. This ensures that we remove all the J/psi's that were also simulated in the minimum bias generation of the ppMuXLoose sample, through decays of B mesons; we want to produce a pure background sample, not containing any dimuons from J/psi decays.

root -l 'runProjectQQ.C+("histos_ppMuXLoose_2360GeV_STARTUP.root", kFALSE, kTRUE, kFALSE)'

Repeat this exercise for the 900 GeV file and for the MC J/psi signal sample. For the latter, we want to match the reconstructed muons to the initially generated J/psi muons. This can be done by activating the second argument (kFALSE --> kTRUE). The third argument in this case must be set back to the default value, kFALSE.

root -l 'runProjectQQ.C+("histos_jPsi_2360GeV_STARTUP.root", kTRUE, kFALSE, kFALSE)'

The n-tuples contain exclusive samples of global-muons, tracker-muons and calo-muons. This means that, in our Onia2MuMu analysis procedure, a muon is only tagged as tracker-muon if it is not tagged as global-muon, and is only tagged as calo-muon if it is not tagged as tracker-muon. For the purposes of our exercises, we will ignore calo-muons. Therefore, we will consider muon pairs of three different "categories", from the high-quality global-global muon pairs to the less good tracker-tracker, passing by the intermediate case when one muon is global and the other is tracker. The root file that we created contains the dimuon mass distributions for six categories, because it also includes pairs with calo muons (even the very poor quality "calo-calo" pairs). Open the file histos_jPsi_2360GeV_STARTUP.root and draw the following histograms:

root -l histos_jPsi_2360GeV_STARTUP.root

For reasons of time, while we processed the full MC sample for the J/psi signal, we only processed a fraction of the (ppMuXLoose) background sample. For the remaining of this exercise, we will work with the following files, previously prepared, which contain the full ppMuXLoose statistics:


Quiz: How many signal and background events do we expect for an integrated luminosity of 1 nb-1 in the gl-gl, gl-tr and tr-tr pair combinations, within the J/psi mass window, 3.0 < M < 3.2 GeV? --> Help 1: rebin the histograms to facilitate the counting. Help 2: consult the CMS.Onia2MuMuSamples webpage for info concerning the integrated luminosity corresponding to the J/psi and ppMuXLoose generated samples.

Step 3: Plot the opposite-sign dimuon mass distribution: J/psi and background

With the help of the macro plotSignalAndBGofMC.C we will now normalise the MC signal and background samples to Lint = 1 nb-1 and plot the dimuon mass distribution for the gl-gl, gl-tr and tr-tr pair combinations. You should check out the necessary macro and create a subdirectory called Figures. The macro will automatically store a series of plots in this directory:

cd $CMSSW_BASE/src
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/Macros/plotSignalAndBGofMC.C
cd UserCode/hWoehri/FirstData/Macros
mkdir Figures
root plotSignalAndBGofMC.C+
This macro has a series of input arguments. Together with the input root file names, you must specify the integrated luminosity of the two MC samples, available in the CMS.Onia2MuMuSamples webpage. Put the value of takeBest as kTRUE. The meaning of that variable will become clearer in the next exercises.

After inspecting the plots, look at the output on the terminal. Do the numbers printed there look familiar to you?

Exercise 3 - Dimuon Mass Distributions from Real Data

In this exercise we process the data collected in December 2009 and prepare a skimmed file containing information relevant for our dimuon analysis. Working with real data, it is important to apply suitable cuts, to reject as many background events as possible while preserving the signal dimuons. We apply certain track, single muon and dimuon selection criteria, and look at the dimuon mass distributions obtained after each cut. More details on the variables used in the selection criteria, and a comparison between their distributions in data and in the MC samples, will be the topic of Exercise 4. At the end of this exercise we will prepare a list of "interesting" events, to be inspected in Exercise 5, using Fireworks.

Step 1: Skim the collected data

This step is similar to the step 1 of Exercise 2, except that we will perform the skimming on the real data. In order to do that we will check out the appropriate script:

cd $CMSSW_BASE/src
cvs update -r V00-05-07 HeavyFlavorAnalysis/Onia2MuMu
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/python/jpsi_data09_900GeV_cfg.py
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/python/jpsi_data09_2360GeV_cfg.py
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/python/goodLumiSectionList_900GeV_cfi.py
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/python/goodLumiSectionList_2360GeV_cfi.py
cp UserCode/hWoehri/FirstData/python/jpsi_data09_900GeV_cfg.py  HeavyFlavorAnalysis/Onia2MuMu/test/
cp UserCode/hWoehri/FirstData/python/jpsi_data09_2360GeV_cfg.py  HeavyFlavorAnalysis/Onia2MuMu/test/
cp UserCode/hWoehri/FirstData/python/goodLumiSectionList_900GeV_cfi.py  HeavyFlavorAnalysis/Onia2MuMu/python/
cp UserCode/hWoehri/FirstData/python/goodLumiSectionList_2360GeV_cfi.py HeavyFlavorAnalysis/Onia2MuMu/python/
scramv1 b
cd HeavyFlavorAnalysis/Onia2MuMu/test
Notice that the flag "StoreGenFlag" is set to false, StoreGenFlag = cms.bool(False), in order not to access MC information...

We will be working with the most recently reconstructed data set, /MinimumBias/BeamCommissioning09-BSCNOBEAMHALO-Dec19thSkim_336p3_v1/RAW-RECO, which contains 522459 minimum bias events, spread over 134 files. All the reconstructions of the data collected in December 2009, i.e. the "prompt reco", the "re-reco" up to the skims, can be found at the CMS.FirstCollisionsAnalysis TWiki page. The CMS.FirstCollisionsCounts TWiki gives an overview of how the number of collected events are distributed among the individual runs.

It is important to understand the "skimming" used to produce this dataset and the best way to do that is to see the configuration file used for its creation. As we did in the step 1 of Exercise 1, you should go to the DBS webpage, search the data set "/MinimumBias/BeamCommissioning09-BSCNOBEAMHALO-Dec19thSkim_336p3_v1/RAW-RECO" and click on "Conf.files". Notice the line "process.L1T1.L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)')". Now you need to understand the meaning of the "L1 technical triggers" from 36 to 41. You should visit the L1 technical trigger bits' TWiki and inspect the table describing the L1 technical trigger bits.

Quiz: What is the reason justifying selecting events with trigger bits (40 OR 41) instead of simply selecting on bit 40? Can you think of a reason making the value of (40 OR 41) different from the value of 40 alone?

Quiz: Do you know the meaning of BSC ? and of BPTX ? [hint: think of consulting the WorkBook Glossary]

This data set only contains events that pass the BSC coincidence "(40 OR 41)" and the beam halo veto, "NOT (36 OR 37 OR 38 OR 39)". We still need to do our own run and lumisection selection, as well as the selection on the “physics declared” HLT bit. This "physics declared bit" is set by the online shifter once the beam is quiet and the detectors (the tracker in particular) are operating.

Note that this file does not contain the events stored in 2 RAW files, see CMS.HyperNews/CMS/get/physics-validation/277.html.

Because of time constraints, we will execute the python script jpsi_data09_2360GeV_cfg.py specifying only one of the 134 root files composing the /MinimumBias/BeamCommissioning09-BSCNOBEAMHALO-Dec19thSkim_336p3_v1/RAW-RECO data set, the file: /store/data/BeamCommissioning09/MinimumBias/RAW-RECO/BSCNOBEAMHALO-Dec19thSkim_336p3_v1/0006/EAC5876C-E6EE-DE11-9FA5-0024E87687CB.root

cmsRun jpsi_data09_2360GeV_cfg.py
This will produce a root file (jpsi_data09_2360GeV.root) with information similar to what we obtained in the Monte Carlo step.

Step 2: Project from n-tuples into histograms

This step is similar to step 2 of Exercise 2. While in the previous step (because of time constraints) we only processed a small fraction of the data sample, we will now use the full statistics, profiting from previously prepared files. For this, edit the file ProjectQQ.h and set the root file name to one of the following files:

This time, you can run the macro runProjectQQ.C with the default settings of its input parameters; just use a meaningful output file name, like histos_data09_900GeV.root (and analogously for the 2.36 TeV case):
cd UserCode/hWoehri/FirstData/Macros/
root -l 'runProjectQQ.C+("histos_data09_900GeV.root", kFALSE, kFALSE, kFALSE)'
Remember, however, to change the name of the input root file in the ProjectQQ.h file. The resulting file will contain the same set of histograms as produced in Exercise 2, step 2.

Step 3: Plot the dimuon mass distributions

In the previous step we produced a set of dimuon mass histograms that were filled after applying certain track, muon and dimuon cuts. As before, there is one histogram for every of the various dimuon categories: gl-gl, gl-tr, tr-tr, gl-calo, tr-calo and calo-calo. We will use now the macro plotDimuonMass.C to draw the mass distributions of the first three categories, after successively applying the individual cuts.

cd $CMSSW_BASE/src
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/Macros/plotDimuonMass.C
cd UserCode/hWoehri/FirstData/Macros
Run the macro for both beam energies. The first input argument of this macro is the name of the input root file.
root -l 'plotDimuonMass.C+("histos_data09_900GeV.root", "900 GeV")'
You will obtain a gif file for every canvas. The mass distributions are drawn before and after applying the selection cuts. It is, therefore, important to know which are the cuts applied at each step. Slide 3 of the presentation given in the December CMS Week summarizes the cuts applied to the global, tracker and calo muons. The order with which they are applied is the following:

Tracker muons:

Cut 1: d0 < 5 cm, dz < 20 cm
Cut 2: TM2DCompatibilityTight OR TMLastStationOptimizedLowPtLoose (both include the "arbitration cut")
Cut 3: number of hits of Silicon track > 12, chi2/ndf (track fit) < 5
Calo muons:
Cut 1: d0 < 5 cm, dz < 20 cm
Cut 2: caloCompatibility > 0.9
Cut 3: number of hits of Silicon track > 12, chi2/ndf (track fit) < 3
Global muons:
Cut 1: d0 < 5 cm, dz < 20 cm
Cut 2: ---
Cut 3: chi2/ndf (global fit) < 20
Cut 4: all muon pairs (independently of the specific category) must have a dimuon vertex with chi2 probability larger than 0.001.

Step 4: Obtaining a list of dimuon events from the data collected in December 2009

The macro runProjectQQ.C has a fourth input parameter that, when activated, prints out (to the screen) the list of events (run, event and lumisection) with global-global, global-tracker and tracker-tracker opposite-sign muon pairs that survive all our quality selection cuts. Together with the dimuon mass and pT, the list includes the dimuon vertexing quality, P(vertex-chi2), and the distance of its vertex to the primary vertex, cTau, as stored in the n-tuple.

Run the macro on the files corresponding to the two beam energies, 900 GeV and 2.36 TeV, after ensuring that you load the correct root n-tuple in ProjectQQ.h:

root -l 'runProjectQQ.C+("histos_data09_900GeV.root", kFALSE, kFALSE, kTRUE)'
root -l 'runProjectQQ.C+("histos_data09_2360GeV.root", kFALSE, kFALSE, kTRUE)'

Store in a text file the list of events with opposite-sign global-global, global-tracker and tracker-tracker muon pairs; we will consult this list in Exercise 5.

Exercise 4 - Compare Data and MC Distributions for Single Muon and Dimuon Variables

In the previous exercise we looked at the dimuon mass distributions obtained after applying certain consecutive cuts, aimed at cleaning the collected data from spurious events, tracks, and muons. In this exercise we look at the distributions of the variables we cut upon. We have prepared a macro that plots all these distributions, in a suitable order.

Please check out the macro plotSingleMuVariables.C:

cd $CMSSW_BASE/src
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/Macros/plotSingleMuVariables.C
cd UserCode/hWoehri/FirstData/Macros

This macro compares the distributions measured from the collected data with the "expected" ones, based on the MC simulations. We plot both the MC J/psi signal and the MC background distributions. Ideally, the comparison should be done selecting dimuons from the J/psi mass window (3.0 < M < 3.2 GeV/c2). However, given the available statistics, we must broaden the mass window and compare the MC with the data in the dimuon mass window M > 2 GeV/c2. Changing between three different mass windows, J/psi mass window, M > 2 GeV/c2 and M < 4 GeV/c2 can be done by selecting the values 0, 1 or 2 of the variable "iSet" in plotSingleMuVariables.C.

As input arguments we need to specify the file name of the MC J/psi signal, of the MC background, of the data and the value of the parameter iSet:

root -l 'plotSingleMuVariables.C+("histos_jPsi_2360GeV_STARTUP.root", "histos_ppMuXLoose_2360GeV_STARTUP.root", "histos_data09_2360GeV.root", 1)'

Quiz: Look at the distributions relevant for global, tracker and calo muons. Which are the variables that can be used to best discriminate between signal and background? Are the measured shapes following the trend of the MC signal or of the MC background?

Quiz: What are the values of the three quality bits TM2DCompatibilityTight, TMLastStationOptimizedLowPtLoose and TrackerMuonArbitrated in the data and how do they compare to the J/psi MC signal? How can you check this information?

In the following we have attached a few figures, showing the comparison of single muons from dimuons with M > 2 GeV/c in the 900 GeV data to the ones of the MC J/psi and the MC background:

  • number of hits of the silicon track of tracker muons:
  • calo compatibility of calo muons:
  • chi2 / ndf of the tracker fit of calo muons:
  • number of hits of the silicon track of calo muons:

Note that there is another interesting tracker muon quality flag, called SegmentAndTrackArbitration. Its value is true (for each station) if for the given muon, it is the best matched segment (judged by checking the variable dR) and of all the muons that have left a segment, it is the best matched by dR to the given muon.

Exercise 5 - Event Display in Fireworks

In this exercise we will display and study, using Fireworks, the events which contain more than one global or tracker muon, previously selected by applying some quality cuts.

Step 1: Identifying the logical root files containing the interesting events

In step 4 of Exercise 3 you should have found "interesting" opposite-sign muon pairs in the following events:

  • run 124020, lumiSec 30 event 10528700 contains a dimuon of type 1 with mass 1.86 GeV, pT 3.82 GeV, prob(vertex-chi2) = 2.926e-01 and a cTau of 3.867e-03
  • run 124022, lumiSec 129 event 29116624 contains a dimuon of type 2 with mass 1.87 GeV, pT 1.04 GeV, prob(vertex-chi2) = 2.657e-01 and a cTau of -5.428e-02
  • run 124022, lumiSec 87 event 13702620 contains a dimuon of type 2 with mass 2.27 GeV, pT 1.94 GeV, prob(vertex-chi2) = 3.187e-01 and a cTau of -4.499e-02
  • run 124023, lumiSec 40 event 3216398 contains a dimuon of type 2 with mass 1.26 GeV, pT 1.63 GeV, prob(vertex-chi2) = 2.316e-01 and a cTau of 1.193e-02
  • run 124030, lumiSec 7 event 2342390 contains a dimuon of type 1 with mass 1.99 GeV, pT 2.83 GeV, prob(vertex-chi2) = 8.426e-02 and a cTau of 1.738e-02
  • run 124230, lumiSec 34 event 11845706 contains a dimuon of type 1 with mass 0.80 GeV, pT 7.32 GeV, prob(vertex-chi2) = 3.272e-01 and a cTau of -6.803e-03
  • run 123970, lumiSec 13 event 3196130 contains a dimuon of type 2 with mass 1.46 GeV, pT 2.17 GeV, prob(vertex-chi2) = 5.134e-01 and a cTau of 7.854e-03
  • run 124020, lumiSec 18 event 6180262 contains a dimuon of type 2 with mass 2.12 GeV, pT 1.42 GeV, prob(vertex-chi2) = 8.844e-01 and a cTau of -2.682e-02
  • run 124022, lumiSec 163 event 41867601 contains a dimuon of type 0 with mass 0.80 GeV, pT 2.56 GeV, prob(vertex-chi2) = 2.087e-01 and a cTau of -2.589e-02
  • run 124120, lumiSec 52 event 15957076 contains a dimuon of type 1 with mass 4.26 GeV, pT 1.84 GeV, prob(vertex-chi2) = 6.942e-02 and a cTau of -5.755e-03
  • run 124120, lumiSec 14 event 4207354 contains a dimuon of type 2 with mass 1.54 GeV, pT 2.02 GeV, prob(vertex-chi2) = 5.283e-01 and a cTau of 2.635e-02
  • run 124120, lumiSec 19 event 5686693 contains a dimuon of type 0 with mass 3.03 GeV, pT 5.35 GeV, prob(vertex-chi2) = 5.815e-01 and a cTau of -6.475e-03

To locate the root files where these events are stored, you can query the DBS database, inserting the following command into the DBS search field:

find file,lumi where run=124020 and lumi in (30) and file.tier=RECO and site=cmssrm.fnal.gov and dataset like *MinimumBias*336*

Step 2: Preparing a skimmed file with interesting events

For easier handling, we will prepare a skimmed file containing only the 12 "interesting" dimuon events. Since the data we are looking at were processed with CMSSW336patch3, we will first set up a new CMSSW environment and then will check out a skimming config file (kindly prepared by Chris Jones):

cmsrel CMSSW_3_3_6_patch3
cd CMSSW_3_3_6_patch3/src
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/python/skimData09_cfg.py
cvs co -r V00-00-01 UserCode/hWoehri/FirstData/python/skimData09_allSignComb_cfg.py
cd UserCode/hWoehri/FirstData/python
cmsRun skimData09_cfg.py
cmsRun skimData09_allSignComb_cfg.py
You should now have a file called dimuon_skim.root containing the selected 12 events. In case of trouble, you can find a previously prepared file on
The latter file also contains the like-sign combinations.

There is an alternative way to produce a skimmed file, composed of individual events by using the Fermilab filemover and clicking on "Request events".

Step 3: Inspecting the interesting events with Fireworks

To learn about Fireworks, you should follow the second set of EJTERM pre-exercises and the exercise Using Fireworks to scan the data. If you have an Intel Mac or a Linux laptop we highly suggest that you install cmsShow on your laptop following the directions from the Fireworks TWiki. Windows user can use the installed version of any CMSSW release.

Start Fireworks with the command:

cmsShow dimuon_skim.root
You should see an event display like this:

Carefully inspect the muons of the 12 events. Learn how to zoom in and out, allowing you to look at the reconstructed tracks in the muon stations or, alternatively, in the silicon tracker. Switch on and off the display of the individual detector elements that were hit by the muons. Display the pT and eta of the muons, as well as certain quality variables, such as the caloCompatibility. Have a closer look to the vertex!

Quiz: Look at the dimuon vertex; can you see the point of closest approach? How far away is the dimuon vertex from the primary interaction vertex? How many hits did the muons leave in the pixel detector?

Quiz: If we had requested that all muons needed to have three hits in the pixel detector, how many events would survive?

Quiz: Can you identify some of our "interesting" muons as fake muons? How would you improve our event selection criteria such that these fake muons would no longer survive?

After thoroughly checking out Firework's display settings, identify the one which you find most suitable for the inspection of dimuons. Save your settings in a xxx.fwc file which upon restart you can load with the command

cmsShow -c mySettings.fwc dimuon_skim.root
Try also to use the following config file.

Links to quarkonium related CMS pages and presentations

  • Many presentations on the "hunt" for dimuons in the first data can be found in the regular "Physics operations" meetings. See, in particular, the slides shown at the "Physics Plenary meeting" of December 16th, in this ppt file.
  • Quarkonium physics in CMS is discussed and organized within the "Quarkonium Task Force", a major activity taking place in the B-Onia Physics Analysis Group. You can find interesting presentations in the meeting agendas, compiled in this indico page.

-- HermineWoehri, YuZheng, CarlosLourenco - created on 17-Dec-2009

Topic attachments
I Attachment History Action Size Date Who Comment
PDFpdf EJTERM-Dimuons.pdf r1 manage 3023.9 K 2010-01-06 - 23:59 HermineWoehri An introduction to this exercise is given in the slides available in this PDF file
PowerPointppt EJTERM-Dimuons.ppt r1 manage 3418.5 K 2010-01-08 - 17:39 CarlosLourenco  
JPEGjpg EJTERMV_20100107_016.JPG r1 manage 1070.5 K 2010-01-09 - 06:31 CarlosLourenco  
JPEGjpg EJTERMV_20100108_036.JPG r1 manage 963.9 K 2010-01-09 - 06:32 CarlosLourenco  
JPEGjpg EJTERMV_20100108_040.JPG r1 manage 804.1 K 2010-01-09 - 06:32 CarlosLourenco  
JPEGjpg EJTERMV_20100109_045.JPG r1 manage 1003.6 K 2010-01-09 - 06:33 CarlosLourenco  
PowerPointppt PhysPlenary16Dec09-final.ppt r1 manage 1512.0 K 2010-01-09 - 16:10 CarlosLourenco  
PDFpdf QuarkoniumProductionEJTERM.pdf r1 manage 4904.3 K 2010-01-07 - 18:19 CarlosLourenco  
PNGpng TM_pt_eta.png r1 manage 55.7 K 2009-12-26 - 05:39 YuZheng trackermuon pt vs eta
PNGpng caloMuons_pt_eta.png r1 manage 22.7 K 2010-01-02 - 00:32 HermineWoehri  
Unknown file formatfwc dimuons.fwc r1 manage 42.9 K 2010-01-07 - 06:18 HermineWoehri  
PNGpng eventdisplay_run123596_tmtm.png r1 manage 132.2 K 2009-12-31 - 07:20 YuZheng  
GIFgif hCaloCompatibility_calo_signalBGAndData.gif r1 manage 10.9 K 2010-01-06 - 05:43 HermineWoehri calo compatibility of calo muons from dimuons with M > 2 GeV, extracted from the 900 GeV data
GIFgif hChi2TrackerFit_calo_signalBGAndData.gif r1 manage 10.3 K 2010-01-06 - 05:45 HermineWoehri  
GIFgif hNHitsSilicon_calo_signalBGAndData.gif r1 manage 9.5 K 2010-01-06 - 05:46 HermineWoehri  
GIFgif hNHitsSilicon_tracker_signalBGAndData.gif r1 manage 11.7 K 2010-01-06 - 05:48 HermineWoehri  
Edit | Attach | Watch | Print version | History: r68 < r67 < r66 < r65 < r64 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r68 - 2010-12-08 - SudhirMalik
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic 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