Basic Introduction to CMSSW MIT
At this point you sould have an cgate account at MIT
- Check the realeases available by
scamv1 list CMSSW
- Check out a version of the CMS SoftWare (CMSSW) by using the command:
scramv1 project CMSSW CMSSW_3_2_5
NOTE: This should be in the directory were you want to keep this version of CMSSW
- Now we need to check out some libaries from the CVS to generate the events
eval `scramv1 runtime -csh`
cd CMSSW_1_6_8/src
cmscvsroot CMSSW
cvs login
Password is : 98passwd
-
Now choose the libary to check out in this case:
cvs co -r CMSSW_1_6_8 FastSimulation
-
We have the libaries we need, now generate some events
Going to :
~/CMSSW_1_6_8/src/FastSimulation/Configuration/test/Example.cfg
Edit this file to make sure that the line that sends the output to a .root file is uncommented
Example.cfg
-
To create the events :
cmsRun Example.cgf &
- At this point you should have a .root file with your generated events, now to analyze the events
Create a directory were you will keep your analyzer
cd
cd CMSSW_1_6_8/src
mkdir myanalyzer
cd myanallyzer
-
Now to get the skeleton code of the analyzer:
mkedanlzr Myanalyzer
cd Myanalyzer/src
- Here should be a the file Myanalyzer.cc, this is just a skeleton libraries need to be added
and the actual analysis code needs to be created as well as the histograms output (.root) files,
follow the example
Myanalyzer.cc
- Now edit the myanalyzer.cfg file, to give it right path to the generated data, should be
under test, follow the example, make sure you give it the complete path
myanalyzer.cfg
- Now add the pertinent libaries to the Build file:
cd ..
ls
Edit the BuildFile, use the following example,
BuildFile
- At this point reset you environment, make sure that when you type ls you can
"see" the BuildFile
eval `scramv1 runtime -csh`
- To Compile use
scramv1 b
- Now run you analysis code
cmsRun test/myanalyzer.cfg >& output.txt&
- Now you should have a .root file with your histograms
root -l
root[0] TFile* file = TFile::Open("******.root")
root[1] .ls
At this point you should see your histograms
NOTE: The ****** is the name you gave to your .root file when editing Myanalyzer.cc