Skip to content

Commit cfbb5de

Browse files
authored
Merge pull request #3 from Lukas9318/master
creating Validation/Commissioning_dimuon_2010 directory
2 parents 85d8edd + b2416b4 commit cfbb5de

File tree

5 files changed

+76
-216
lines changed

5 files changed

+76
-216
lines changed

.gitignore

Lines changed: 0 additions & 29 deletions
This file was deleted.

README.md

Lines changed: 46 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,68 @@
1-
----------------------------
2-
# 2010-commissioning-dimuon|
3-
- -------------------------------------------------
4-
Validation code for 2010 Commissioning dataset, based on dimuon mass spectrum|
5-
------------------------------------------------------------------------------
1+
# 2010-commissioning-dimuon
2+
3+
Validation code for 2010 Commissioning dataset, based on dimuon mass spectrum.
4+
You need to work in a Virtual Machine properly contextualized for CMS.
65

7-
How to install and run the validation benchmark of the Commissioning data set?
8-
This code for validation and benchmarking of the Commissioning data set, based on
9-
the dimuon mass spectrum, does NOT apply JSON preselection. It therefore includes
10-
benchmarking of non-JSON selected runs.
11-
It is set up at Research level what means, that it requires university student
12-
level programming experience. Minimal acquaintance with Linux, the ROOT analysis
13-
peckage (http://root.cern.ch/) and basic text editor is assumed in the following.
6+
In order to run the demoanalyzer_cfg.py to create the Commissioning ROOT files,
7+
you need to create a working area and set up a proper CMS environment.
148

9+
## Creating the Working Area
1510

16-
----------------------------------------------
17-
1.) HOW TO INSTALL a CERN VIRTUAL MACHINE(VM)|
18-
----------------------------------------------
19-
NOTES: (it is better to read them before you start)
20-
-----
21-
NOTE_1:You will need administrative("root") privileges on every platform to
22-
perform the installation of VirtualBox.
23-
NOTE_2:The latest tested version of VirtualBox working with CMS-CERN VM
24-
image is 4.3.14. If you have troubles with the latest version of VirtualBox,
25-
pick that one. The full history of VirtualBox version is available on different
26-
page: (https://www.virtualbox.org/wiki/Downloads).
27-
NOTE_3:Before you download the CERN VM, note that the imported settings may
28-
not always work on your host machine. Please see Issues and Limitations on this
29-
page: (http://opendata.cern.ch/VM/CMS/2010#issues) if you encounter any problems
30-
with booting the CERN VM.
11+
This step is only needed the first time.
12+
```
13+
cmsrel CMSSW_4_2_8
14+
cd CMSSW_4_2_8/src
3115
32-
STEPS:
33-
-----
34-
You need to work in the CERN VM properly contextualized for CMS, this VM is
35-
available on the CERN Open Data Portal (http://opendata.cern.ch/record/250).
36-
Download the CMS CERN VM image as (.ova) file.
37-
For CERN VM you need to have VirtualBox. In case that you do not have it, you
38-
can download it from the Downloads page (https://www.virtualbox.org/wiki/Downloads).
39-
When VirtualBox is installed saccessfully you can go on. By double clicking the
40-
downloaded file, VirtualBox imports the image with ready to run settings. In case
41-
of any problem with booting with these default settings, see ISSUES AND LIMITATIONS:
42-
(http://opendata.cern.ch/VM/CMS/2010#issues). Then, you launch the CMS CERN VM, which
43-
boots into the graphical user interface and sets up the CMS enviroment.
16+
```
4417

18+
## Cloning the 2010-commissioning-dimuon repository from Github
19+
```
20+
git clone https://github.com/cms-opendata-validation/2010-commissioning-dimuon Validation/Commissioning_dimuon_2010
4521
46-
-------------------------------------------------------
47-
2.) SET UP THE CMS ENVIRONMENT AND RUN A DEMO ANALYZER|
48-
-------------------------------------------------------
49-
a.) Open a terminal with the X terminal emulator(an icon bottom-left of the VM screen)
50-
and ecexute the following command: cmsrel CMSSW_4_2_8
51-
this command builds the local release are for CMSSW, and only needs to be run once.
52-
b.) Then, change directory to the CMSSW_4_2_8/src/ with command: cd CMSSW_4_2_8/src/
53-
c.) Then, run the following command to create the CMS runtime variable: cmsenv
54-
d.) Create a working directory for the demo analyzer: mkdir Demo
55-
e.) Then, change directory: cd Demo
56-
f.) Create a "skeleton" for the analyzer: mkedanlzr DemoAnalyzer
57-
g.) Change directory: cd DemoAnalyzer
58-
h.) Compile: scram b
59-
i.) For testing, change the file name in the configuration file (demoanalyzer_cfg.py)
60-
in DemoAnalyzer directory:i.e. replace (file:myfile.root) with following file,
61-
(root://eospublic.cern.ch//eos/opendata/cms/Run2010B/Mu/AOD/Apr21ReReco-v1/0000/00459D48-EB70-E011-AF09-90E6BA19A252.root)
62-
and also change the max number of evetns to 10:i.e. change -1 to 10 in
63-
(process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1)).
64-
This point (i) is not necessary, just to be sure.
65-
j.) Then, move two directories back using: cd ../..
66-
k.) And then run: cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
67-
Your output should end with: System 3 3
68-
If everything works you can go on.
22+
```
6923

70-
--------------------------
71-
3.) COMMISSIONING DIMUON|
72-
--------------------------
73-
In DemoAnalyzer directory, create datasets directory using this command: mkdir datasets
24+
## Setting up the CMS environment
25+
```
26+
cd Validation/Commissioning_dimuon_2010
27+
cmsenv
7428
75-
In the downloaded 2010-commissioning-dimuon repository from github are also index files with names:
29+
```
30+
31+
## Compiling and Running
32+
```
33+
scram b
34+
cmsRun demoanalyzer_cfg.py
35+
36+
```
37+
38+
After analysis, Commissioning00val.root file should be created.
39+
Then, is necessary to change input and also output files in demoanalyzer_cfg.py, to save these changes and to rerun program.
40+
In the repository from github are index files with names:
7641
CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0000_file_index.txt
7742
CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0002_file_index.txt
7843
CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0003_file_index.txt
7944
CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0004_file_index.txt
80-
Store these four files in Demo/DemoAnalyzer/datasets
8145

82-
In this repository are also these files:
83-
demoanalyzer_cfg.py
84-
DemoAnalyzer.cc
85-
BuildFile.xml
86-
In DemoAnalyzer directory are files with the same names. DemoAnalyzer.cc is in /DemoAnalyzer/src/DemoAnalyzer.cc directory.
87-
Replace these three files from DemoAnalyzer directory by the ones from github repository.
88-
For opening BuildFile.xml file is better to use terminal with command: vim BuildFile.xml
89-
When you open it with double clicking with mouse, this problem appers: (XML Parsing Error:syntax error)
90-
and you will not be able to read text in this file. The way how to solve this problem is not complicated.
91-
Just press (ctrl+u) when you are on this page. After that, a new window will be opened with text that you need.
92-
93-
When you replace files, it is necessary to recompile. In you terminal you should be in DemoAnalyze directory,
94-
if not go there. Execute command: scram b
95-
Than, move two directories back with command: cd ../..
96-
Rerun with command: cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
9746

98-
You should get an output file Commissioning00.root which contains histograms for all the
99-
files/events in the CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0000_file_index.txt index file.
100-
These can be looked at using a ROOT Browser. Just type in terminal command: root
101-
Then, type in this same window: new TBrowser
102-
A new window appears. In this window you can find your created root file.
103-
When you want to leave from ROOT, just type command: .q
104-
105-
This is the validation of a Commissioning sample, not dedicated to muon final states,
106-
so the number of events entering the mass plot is relatively small. To run over the full
107-
statistics, edit the relevant parts of the Python file demoanalyzer_cfg.py .
108-
These relevant parts of this code are located in section where we define the input data
109-
and where we define output file.
110-
This part where we define input data starts with this:
111-
# ****************************************************************************
112-
# define the input data set here by inserting the appropriate .txt file list *
113-
# ****************************************************************************
114-
There you must find the line where you define the file what will be loaded. This line seems like this:
115-
files2010data = FileUtils.loadListFromFile ('/home/cms-opendata/CMSSW_4_2_8/src/Demo/DemoAnalyzer/datasets/CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0000_file_index.txt')
116-
There you just replace part 0000 by 0002 .
117-
Similar thigs you must do with output file. At the end of this file is a part for this.
118-
Just replace Commissioning00val.root by Commissioning02val.root and save these changes.
119-
After that, just rerun. Do this for all index file. When you do this you should have four root files with names:
47+
When you rerun for all four index files you should have four root files with names:
12048
Commissioning00val.root
12149
Commissioning02val.root
12250
Commissioning03val.root
12351
Commissioning04val.root
12452

12553
The last thing what you should do is to merge these four root files into one root file.
12654
You do this as follow. In the downloaded repository is also file with name mergeCommissioning.C .
127-
Copy this file into the directory where these four root files are located. Then, press command: root
128-
for entering into ROOT programme. In this programe just type command: .x mergeCommissioning.C .
129-
This merging create a root file called CommissioningAllval.root.
130-
131-
Look at this output with command: new TBrowser
55+
Press command for opening ROOT program:
56+
```
57+
root
58+
```
59+
In this programe just type command:
60+
```
61+
.x mergeCommissioning.C .
62+
```
63+
This merging create a root file called CommissioningAllval.root .
64+
To look at this output, write down command in ROOT program:
65+
```
66+
new TBrowser
67+
```
13268
and navigate to relevant file.

demoanalyzer_cfg.py

Lines changed: 8 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
import PhysicsTools.PythonAnalysis.LumiList as LumiList
44
import FWCore.ParameterSet.Types as CfgTypes
55
#import FWCore.PythonUtilities.LumiList as LumiList
6-
process = cms.Process("Demo")
7-
6+
process = cms.Process("Validation")
87

98
# intialize MessageLogger and output report
109
process.load("FWCore.MessageLogger.MessageLogger_cfi")
1110
process.MessageLogger.cerr.threshold = 'INFO'
12-
process.MessageLogger.categories.append('Demo')
13-
process.MessageLogger.cerr.INFO = cms.untracked.PSet(
14-
limit = cms.untracked.int32(-1)
15-
)
11+
process.MessageLogger.categories.append('Validation')
12+
process.MessageLogger.cerr.INFO = cms.untracked.PSet(limit = cms.untracked.int32(-1))
1613
process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
1714
# **********************************************************************
1815
# set the maximum number of events to be processed *
@@ -22,15 +19,6 @@
2219
# **********************************************************************
2320
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(20000000) )
2421

25-
# set the number of events to be skipped (if any) at end of file below
26-
27-
# *** do not use JSON for Commissioning data set (only few muon candidates
28-
# left if one does) ***
29-
## define JSON file
30-
#goodJSON = '/home/cms-opendata/CMSSW_4_2_8/src/Demo/DemoAnalyzer/datasets/Cert_136033-149442_7TeV_Apr21ReReco_Collisions10_JSON_v2.txt'
31-
#
32-
#myLumis = LumiList.LumiList(filename = goodJSON).getCMSSWString().split(',')
33-
3422
# ****************************************************************************
3523
# define the input data set here by inserting the appropriate .txt file list *
3624
# ****************************************************************************
@@ -44,58 +32,19 @@
4432
# consecutively (make sure you save the output before rerunning) *
4533
# and add up the histograms using root tools. *
4634
# ****************************************************************
47-
#
48-
# *** MinimumBias data set ***
49-
#files2010data = FileUtils.loadListFromFile ('/home/cms-opendata/CMSSW_4_2_8/src/Demo/DemoAnalyzer/datasets/CMS_Run2010B_MinimumBias_AOD_Apr21ReReco-v1_0000_file_index.txt')
50-
# *** Mu data set ***
51-
#files2010data = FileUtils.loadListFromFile ('/home/cms-opendata/CMSSW_4_2_8/src/Demo/DemoAnalyzer/datasets/CMS_Run2010B_Mu_AOD_Apr21ReReco-v1_0000_file_index.txt')
52-
# *** MuOnia data set ***
53-
#files2010data = FileUtils.loadListFromFile ('/home/cms-opendata/CMSSW_4_2_8/src/Demo/DemoAnalyzer/datasets/CMS_Run2010B_MuOnia_AOD_Apr21ReReco-v1_0000_file_index.txt')
54-
# *** MuMonitor data set ***
55-
#files2010data = FileUtils.loadListFromFile ('/home/cms-opendata/CMSSW_4_2_8/src/Demo/DemoAnalyzer/datasets/CMS_Run2010B_MuMonitor_AOD_Apr21ReReco-v1_0000_file_index.txt')
56-
# *** Commissioning data set ***
57-
files2010data = FileUtils.loadListFromFile ('/home/cms-opendata/CMSSW_4_2_8/src/Demo/DemoAnalyzer/datasets/CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0000_file_index.txt')
58-
process.source = cms.Source("PoolSource",
59-
fileNames = cms.untracked.vstring(*files2010data
60-
)
61-
)
6235

63-
# alternatively (e.g. for tests), directly use input file (commented)
64-
'''process.source = cms.Source("PoolSource",
65-
# replace 'myfile.root' with the source file you want to use
66-
fileNames = cms.untracked.vstring('root://eospublic.cern.ch//eos/opendata/cms/Run2010B/MuOnia/AOD/Apr21ReReco-v1/0000/0029E804-C77C-E011-BA94-00215E22239A.root'
67-
68-
)
69-
)'''
70-
71-
# *** do NOT ***
72-
## apply JSON file
73-
## (needs to be placed *after* the process.source input file definition!)
74-
#process.source.lumisToProcess = CfgTypes.untracked(CfgTypes.VLuminosityBlockRange())
75-
#process.source.lumisToProcess.extend(myLumis)
36+
# *** Commissioning data set ***
37+
files2010data = FileUtils.loadListFromFile ('/home/cms-opendata/CMSSW_4_2_8/src/Validation/Commissioning_dimuon_2010/datasets/CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0000_file_index.txt')
38+
process.source = cms.Source("PoolSource",fileNames = cms.untracked.vstring(*files2010data))
7639

7740
# *************************************************
7841
# number of events to be skipped (0 by default) *
7942
# *************************************************
8043
process.source.skipEvents = cms.untracked.uint32(0)
81-
82-
83-
process.demo = cms.EDAnalyzer('DemoAnalyzer'
84-
)
44+
process.demo = cms.EDAnalyzer('Commissioning_dimuon_2010')
8545
# ***********************************************************
8646
# output file name *
8747
# change this according to input file, or according to wish *
8848
# ***********************************************************
89-
process.TFileService = cms.Service("TFileService",
90-
# *********************************************************
91-
# exactly only one of the following should be uncommented *
92-
# *********************************************************
93-
# fileName = cms.string('ZeroBias.root')
94-
# fileName = cms.string('MinBias.root')
95-
# fileName = cms.string('Mu.root')
96-
# fileName = cms.string('MuOnia.root')
97-
# fileName = cms.string('MuMonitor.root')
98-
fileName = cms.string('Commissioning00val.root')
99-
)
100-
49+
process.TFileService = cms.Service("TFileService",fileName = cms.string('Commissioning00val.root'))
10150
process.p = cms.Path(process.demo)

python/demoanalyzer_cfi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import FWCore.ParameterSet.Config as cms
2+
3+
demo = cms.EDAnalyzer('Commissioning_dimuon_2010'
4+
)

0 commit comments

Comments
 (0)