|
| 1 | +---------------------------- |
| 2 | +# 2010-commissioning-dimuon| |
| 3 | + - ------------------------------------------------- |
| 4 | +Validation code for 2010 Commissioning dataset, based on dimuon mass spectrum| |
| 5 | +------------------------------------------------------------------------------ |
| 6 | + |
| 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. |
| 14 | + |
| 15 | + |
| 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. |
| 31 | + |
| 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. |
| 44 | + |
| 45 | + |
| 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. |
| 69 | + |
| 70 | +-------------------------- |
| 71 | +3.) COMMISSIONING DIMUON| |
| 72 | +-------------------------- |
| 73 | + In DemoAnalyzer directory, create datasets directory using this command: mkdir datasets |
| 74 | + |
| 75 | +In the downloaded 2010-commissioning-dimuon repository from github are also index files with names: |
| 76 | + CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0000_file_index.txt |
| 77 | + CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0002_file_index.txt |
| 78 | + CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0003_file_index.txt |
| 79 | + CMS_Run2010B_Commissioning_AOD_Apr21ReReco-v1_0004_file_index.txt |
| 80 | +Store these four files in Demo/DemoAnalyzer/datasets |
| 81 | + |
| 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 |
| 97 | + |
| 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: |
| 120 | + Commissioning00val.root |
| 121 | + Commissioning02val.root |
| 122 | + Commissioning03val.root |
| 123 | + Commissioning04val.root |
| 124 | + |
| 125 | +The last thing what you should do is to merge these four root files into one root file. |
| 126 | +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 |
| 132 | +and navigate to relevant file. |
0 commit comments