Difference: WorkBookWriteFrameworkModule (1 vs. 12)

Revision 122016-01-12 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Line: 1787 to 1787
 
META FILEATTACHMENT attachment="demoanalyzer_cfg_CMSSW_5_3_5.py.txt" attr="" comment="" date="1452030686" name="demoanalyzer_cfg_CMSSW_5_3_5.py.txt" path="demoanalyzer_cfg_CMSSW_5_3_5.py.txt" size="1218" user="eduardo" version="1"
META FILEATTACHMENT attachment="tracks_CMSSW_5_3_5.png" attr="" comment="" date="1452031436" name="tracks_CMSSW_5_3_5.png" path="tracks_CMSSW_5_3_5.png" size="7249" user="eduardo" version="1"
META FILEATTACHMENT attachment="charge_CMSSW5_3_5.png" attr="" comment="" date="1452139263" name="charge_CMSSW5_3_5.png" path="charge_CMSSW5_3_5.png" size="5844" user="eduardo" version="1"
Added:
>
>
META PREFERENCE name="USERSTYLEURL" title="USERSTYLEURL" type="Set" value="%25ATTACHURL%25/tutorial.css"

Revision 112016-01-12 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5

Revision 102016-01-07 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Line: 71 to 71
 
  • Local LOCALHISTOEX = example_
  • Local LOCALDEMODIR = Demo/DemoAnalyzer/plugins
  • Local LOCALBUILDDIR = Demo/DemoAnalyzer/plugins
Added:
>
>
 -->
Line: 107 to 108
 

Set up your Environment

If you are working at Fermilab's cmslpc cluster you need to execute the following command before you start
Deleted:
<
<
#tcsh users

>
>
<--   source /uscms/home/malik/cshrc prod-->
#tcsh users
 source /cvmfs/cms.cern.ch/cmsset_default.csh At CERN, you can login directly to lxplus.cern.ch
Line: 261 to 257
 

Line: 290 to 286
 On lxplus, use the eos ls command and the LFN to verify that a file exists in mass storage:


Changed:
<
<
[lxplus402 @ ~/workbook/MYDEMOANALYZER/7_4_15/src/Demo/DemoAnalyzer]$ eos ls -l /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root
>
>
[lxplus402 @ ~/workbook/MYDEMOANALYZER/7_4_15/src/Demo/DemoAnalyzer]$ eos ls -l /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root
 -rw-r--r-- 2 phedex zh 418309738 Oct 16 15:52 6CA1C627-246C-E511-8A6A-02163E014147.root
Line: 325 to 321
 Flags: 16 (IsReadable)

Added:
>
>
 Sometimes one may want to copy the entire file in the local Demo/DemoAnalyzer/ directory. Remember these files are big so this is not recommended. But, just as a reminder, before you copy the file make sure that data file exists. If the data file is absent try another one by searching in DAS. To copy a datafile on lxplus and cmslpc to your local working directory, in both cases the PFN is used. On lxplus, use the xrdcp command:
Deleted:
<
<
>
>
 In case you copy the file you will have to change in the configuration file fileNames parameter to point to the local copy. Since the data files are big, you may want to copy only a few events from the file, as explained in WorkBookDataSamples. If you DO NOT copy the data file to your working area, you can read it directly from mass storage. </>
<--/twistyPlugin-->
Line: 1672 to 1671
 I will not go into detail about how you should add histograms. Below are the three files that you have to change to plot a histogram. Compare it to what you already have and make changes by seeing what is missing. If you do not want to make changes, just copy and paste them as is. Here are the steps. The order in which you do them does not matter.

1. Make changes in your demo analyzer DemoAnalyzer.cc and it should like this

Changed:
<
<
DemoAnalyzer.cc.
>
>
DemoAnalyzer.cc.
  2. Make changes in the BuildFile.xml and it should look like this: BuildFile.xml

Revision 92016-01-07 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Line: 56 to 56
 
  1. Create your configuration file.
  2. Run your job -->
Added:
>
>
#Customize

Customize this document

<-- conventions used in this document 
  • Local LOCALSHELL = tcsh
  • Local LOCALCSH = c
  • Local LOCALWBRELEASE = 7_4_15
  • Local LOCALCONFFILE = ConfFile_cfg.py
  • Local LOCALCFIFILE = CfiFile_cfi
  • Local LOCALCONFFILEDIR = DemoAnalyzer/python
  • Local LOCALCONFHISTO = ConfFile_cfg.py
  • Local LOCALHISTODIR = HistoAnalyzer/python/
  • Local LOCALHISTOCMD = HistoAnalyzer example_track example_histo
  • Local LOCALHISTOEX = example_
  • Local LOCALDEMODIR = Demo/DemoAnalyzer/plugins
  • Local LOCALBUILDDIR = Demo/DemoAnalyzer/plugins
-->
SHELL
CMSSW RELEASE
 
 

Set up your Environment

If you are working at Fermilab's cmslpc cluster you need to execute the following command before you start
Line: 65 to 113
  -->

Changed:
<
<
#bash users source /cvmfs/cms.cern.ch/cmsset_default.sh #or #tcsh users: source /cvmfs/cms.cern.ch/cmsset_default.csh
>
>
#tcsh users source /cvmfs/cms.cern.ch/cmsset_default.csh
  At CERN, you can login directly to lxplus.cern.ch
<--STARTWORKBOOK-->
Line: 79 to 124
  cd MYDEMOANALYZER

# create a new project area

Changed:
<
<
cmsrel CMSSW_7_4_15 cd CMSSW_7_4_15/src/
>
>
cmsrel CMSSW_7_4_15 cd CMSSW_7_4_15/src/
  cmsenv
Line: 119 to 164
 

We'll use a ROOT file as the data source when we run with this module.

Changed:
<
<
The data source is defined in the configuration file. For your convenience, there is already a data file processed in CMSSW_5_3_4, which is fully compatible with CMSSW_7_4_15 release, containing 100 events. It is located at /afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root.
>
>
The data source is defined in the configuration file. For your convenience, there is already a data file processed in CMSSW_5_3_4, which is fully compatible with CMSSW_7_4_15 release, containing 100 events. It is located at /afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root.
 
Changed:
<
<
The mkedanlzr script has generated an example python configuration file ConfFile_cfg.py in the DemoAnalyzer/python directory. Open the file using your favorite text editor and change the data source file to as shown below.
>
>
The mkedanlzr script has generated an example python configuration file ConfFile_cfg.py in the DemoAnalyzer/python directory. Open the file using your favorite text editor and change the data source file to as shown below.
  And now the configuration file should read like this:
Line: 154 to 199
 Full documentation about the configuration language is in SWGuideAboutPythonConfigFile.

Run the job

Changed:
<
<
  cmsRun python/ConfFile_cfg.py
or
>
>

  cd ../..
Changed:
<
<
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
  You should see something like this (click on Show result below):
Line: 314 to 355
 

Get tracks from the Event

Changed:
<
<
Demo/DemoAnalyzer/plugins/DemoAnalyzer.cc is the place to put your analysis code. In this example, we only add
>
>
Demo/DemoAnalyzer/plugins/DemoAnalyzer.cc is the place to put your analysis code. In this example, we only add
 very simple statement printing the number of tracks.
Changed:
<
<
Edit Demo/DemoAnalyzer/plugins/BuildFile.xml: so that it looks like this
>
>
Edit Demo/DemoAnalyzer/plugins/BuildFile.xml: so that it looks like this
 %SYNTAX{ syntax="python"}%
Line: 329 to 370
  More on information on the structure of a typical BuildFile.xml can be found on WorkBookBuildFilesIntro.
Changed:
<
<
Edit Demo/DemoAnalyzer/plugins/DemoAnalyzer.cc:
>
>
Edit Demo/DemoAnalyzer/plugins/DemoAnalyzer.cc:
 
  • Add the following include statements (together with the other include statements):
Line: 377 to 418
 </>
<--/twistyPlugin-->
</>
<--/twistyPlugin-->
Changed:
<
<
To print out the information that we added in the analyzer, we need to replace the line process.load("FWCore.MessageService.MessageLogger_cfi")) in file ConfFile_cfg.py with the segment below
>
>
To print out the information that we added in the analyzer, we need to replace the line process.load("FWCore.MessageService.MessageLogger_cfi")) in file ConfFile_cfg.py with the segment below
  %SYNTAX{ syntax="python"}% # initialize MessageLogger and output report
Line: 395 to 436
  Now, compile the code and run the job again:
Changed:
<
<
 
>
>

 scram b
Changed:
<
<
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
  The output should look something like this:
Line: 523 to 564
  In this section, we determine the minimum number of tracks for an event to be displayed, and make it so we can change this number in the config and not need to recompile.
Changed:
<
<
  • Edit the Demo/DemoAnalyzer/plugins/DemoAnalyzer.cc file. Add a new member data line to the DemoAnalyzer class:
>
>
  • Edit the Demo/DemoAnalyzer/plugins/DemoAnalyzer.cc file. Add a new member data line to the DemoAnalyzer class:
  %SYNTAX{ syntax="cpp"}% private:
Line: 592 to 633
 %ENDSYNTAX%

Also to see if actually minTracks_ gets used, replace the line process.demo = cms.EDAnalyzer('DemoAnalyzer'

Changed:
<
<
) in ConfFile_cfg.py by the segment below to use a value of say minTracks_ = 1000 .
>
>
) in ConfFile_cfg.py by the segment below to use a value of say minTracks_ = 1000 .
  %SYNTAX{ syntax="python"}% process.demo = cms.EDAnalyzer('DemoAnalyzer',
Line: 605 to 646
  NOTE: whenever you make changes in the code of your analyzer you have to do scram b
Changed:
<
<
  • Run the job.
    cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
    
>
>
  • Run the job.
    cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
    
  The output should be something like this (Only events with tracks greater than 1000 get printed). Click here:
Line: 658 to 699
 </>
<--/twistyPlugin-->

Changed:
<
<

A look at CfiFile_cfi.py file

There is file named CfiFile_cfi.py in the Demo/DemoAnalyzer/python directory. A _cfi.py file contains default values of all the required parameters of a package. Rather than setting all the analyzer (we also call it module) parameters in your ConfFile_cfg.py file, one can define all of them in the CfiFile_cfi.py file. These parameters can then be reset (or overridden) by giving them a value you want in ConfFile_cfg.py. However, you will have to include CfiFile_cfi.py in ConfFile_cfg.py.
>
>

A look at demoanalyzer_cfi.py file

There is file named CfiFile_cfi.py in the Demo/DemoAnalyzer/python directory. A _cfi.py file contains default values of all the required parameters of a package. Rather than setting all the analyzer (we also call it module) parameters in your ConfFile_cfg.py file, one can define all of them in the CfiFile_cfi.py file. These parameters can then be reset (or overridden) by giving them a value you want in ConfFile_cfg.py. However, you will have to include CfiFile_cfi.py in ConfFile_cfg.py.
 
Changed:
<
<
To explain it more clearly, I can put the default value of minTracks=0 in CfiFile_cfi.py and override it to say minTracks=50 in ConfFile_cfg.py. Thus if there are, say 10 parameters defined with their default values in CfiFile_cfi.py and I want to change two of those to some other value, I can do that in ConfFile_cfg.py WITHOUT changing the file CfiFile_cfi.py that has default values.
>
>
To explain it more clearly, I can put the default value of minTracks=0 in CfiFile_cfi.py and override it to say minTracks=50 in ConfFile_cfg.py. Thus if there are, say 10 parameters defined with their default values in CfiFile_cfi.py and I want to change two of those to some other value, I can do that in ConfFile_cfg.py WITHOUT changing the file CfiFile_cfi.py that has default values.
 
Changed:
<
<
The mkedanlzr script has created a CfiFile_cfi.py file in the python directory as mentioned above.
>
>
The mkedanlzr script has created a CfiFile_cfi.py file in the python directory as mentioned above.
 
Changed:
<
<
  • Add the newly created parameter minTracks and its default value to this CfiFile_cfi.py file so that it its content looks like this:
>
>
  • Add the newly created parameter minTracks and its default value to this CfiFile_cfi.py file so that it its content looks like this:
  %SYNTAX{ syntax="python"}% import ParameterSet.Config as cms
Line: 675 to 716
 ) %ENDSYNTAX%
Changed:
<
<
  • Edit the ConfFile_cfg.py file and REPLACE
>
>
  • Edit the ConfFile_cfg.py file and REPLACE
  %SYNTAX{ syntax="python"}% process.demo = cms.EDAnalyzer('DemoAnalyzer',
Line: 686 to 727
 WITH (these are 2 different lines, so should be on seperate lines each

%SYNTAX{ syntax="python"}%

Changed:
<
<
process.load("Demo.DemoAnalyzer.CfiFile_cfi")
>
>
process.load("Demo.DemoAnalyzer.CfiFile_cfi")
 process.demo.minTracks=1000 %ENDSYNTAX%

Here we use the default parameter values, and reset only the minTracks parameter to a different value.

  • Rerun the job:
Changed:
<
<
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
 
Changed:
<
<
You will see the same output as before EXCEPT that now you are overriding the default value of minTracks=0 defined in CfiFile_cfi.py with a value you choose (in this case minTracks=1000) in ConfFile_cfg.py. In this case the file with default parameters CfiFile_cfi.py remains untouched.
>
>
You will see the same output as before EXCEPT that now you are overriding the default value of minTracks=0 defined in CfiFile_cfi.py with a value you choose (in this case minTracks=1000) in ConfFile_cfg.py. In this case the file with default parameters CfiFile_cfi.py remains untouched.
 

See what is available in the Event

Changed:
<
<
1. Edit the configuration file, ConfFile_cfg.py and add the EventContentAnalyzer module. The module EventContentAnalyzer dumps all products stored in an event to the screen. One can add it to the path as follows:
>
>
1. Edit the configuration file, ConfFile_cfg.py and add the EventContentAnalyzer module. The module EventContentAnalyzer dumps all products stored in an event to the screen. One can add it to the path as follows:
  %SYNTAX{ syntax="python"}% process.dump=cms.EDAnalyzer('EventContentAnalyzer')
Line: 728 to 769
 

2. Run the job.

Changed:
<
<
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
 The output should be something like this:

%TWISTY{mode="div" showlink="Show result..." hidelink="Hide result..." remember="on"

Line: 1187 to 1228
 

Watch the processing of a job

Changed:
<
<
1. Edit the configuration file, ConfFile_cfg.py, and add the Tracer service ( just above the line process.p = cms.Path(process.demo*process.dump)) in ConfFile_cfg.py. This service identifies what module is called and when.
>
>
1. Edit the configuration file, ConfFile_cfg.py, and add the Tracer service ( just above the line process.p = cms.Path(process.demo*process.dump)) in ConfFile_cfg.py. This service identifies what module is called and when.
  %SYNTAX{ syntax="python"}% process.Tracer = cms.Service("Tracer")
Line: 1196 to 1237
 You can remove the module dump if you added it as explained above, and set maxEvents to -1 (run over all events in the file).

2. Run the job

Changed:
<
<
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
  The output should be something like this:
Line: 1637 to 1678
 BuildFile.xml
<-- NO NEED TO MAKE CHANGES IN CMSSW_3_6_1.py and tracks_CMSSW_3_6_1.png as they work and are same for 382  -->
Changed:
<
<
3. Make changes in the config file ConfFile_cfg.py and it should like this ConfFile_cfg.py
>
>
3. Make changes in the config file ConfFile_cfg.py and it should like this ConfFile_cfg.py
 
Changed:
<
<
Then do scram b and run it by doing cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
>
>
Then do scram b and run it by doing cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
  You will see that now you have a root file called histodemo.root. Open this root file and you will see a histogram showing number of tracks in 200 events over which you ran. The plot looks like this:
Line: 1653 to 1694
 

Histo Analyzer

This package is similar to the DemoAnalyzer package. The point in having it here is that, having understood how to create, change and run your own demo analyzer (or module), you can also have look at this package that tells you how to add histograms to your analyzer which I already briefly showed you above. This has been historically here and I did not want to remove it. After all it does not hurt to tell how to include a histogram in your analyzer again.
Changed:
<
<
Eventually, you may want your analyzer to record something rather than just print out track numbers. The mkedanlzr script has an option example_histo to generate an analyzer code which writes a histogram in a root file. If you use it together with the option example_track, it will access the tracks, find their charge and fill a histogram. To use this option, go to the CMSSW_7_4_15/src directory and create a new subdirectory
>
>
Eventually, you may want your analyzer to record something rather than just print out track numbers. The mkedanlzr script has an option example_histo to generate an analyzer code which writes a histogram in a root file. If you use it together with the option example_track, it will access the tracks, find their charge and fill a histogram. To use this option, go to the CMSSW_7_4_15/src directory and create a new subdirectory
 mkdir Histo cd Histo
Changed:
<
<
Create a new analyzer module
mkedanlzr HistoAnalyzer example_track example_histo
>
>
Create a new analyzer module
mkedanlzr HistoAnalyzer example_track example_histo
 Go to the HistoAnalyzer directory and compile the code
cd HistoAnalyzer
scram b
Changed:
<
<
Change the data file to 'file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root' in HistoAnalyzer/python/ConfFile_cfg.py that we were already using in ConfFile_cfg.py and change 'ctfWithMaterialTracks' to 'generalTracks' by commenting out as follows
>
>
Change the data file to 'file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root' in HistoAnalyzer/python/ConfFile_cfg.py that we were already using in ConfFile_cfg.py and change 'ctfWithMaterialTracks' to 'generalTracks' by commenting out as follows
  %SYNTAX{ syntax="python"}% process.demo = cms.EDAnalyzer('HistoAnalyzer'
Line: 1674 to 1715
 ) %ENDSYNTAX%
Changed:
<
<
Run the analyzer
cmsRun HistoAnalyzer/python/ConfFile_cfg.py
>
>
Run the analyzer
cmsRun HistoAnalyzer/python/ConfFile_cfg.py
 A root file histo.root has been created and you can find the histogram in root
root histo.root
new TBrowser
Line: 1695 to 1736
 

Add data to the output file

Finally, you may want to store your new data together with the input data in the root file. You can use the mkedprod script producing a template
Changed:
<
<
EDProducer module. Go to your work area in =CMSSW_7_4_15 and create a subdirectory
>
>
EDProducer module. Go to your work area in =CMSSW_7_4_15 and create a subdirectory
 
mkdir Prod

Revision 82016-01-07 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Line: 1665 to 1665
 cd HistoAnalyzer scram b
Changed:
<
<
Change the data file to 'file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_RECO_5_3_4.root' in HistoAnalyzer/python/ConfFile_cfg.py that we were already using in ConfFile_cfg.py and change 'ctfWithMaterialTracks' to 'generalTracks' by commenting out as follows
>
>
Change the data file to 'file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root' in HistoAnalyzer/python/ConfFile_cfg.py that we were already using in ConfFile_cfg.py and change 'ctfWithMaterialTracks' to 'generalTracks' by commenting out as follows
  %SYNTAX{ syntax="python"}% process.demo = cms.EDAnalyzer('HistoAnalyzer'
Line: 1746 to 1746
 
META FILEATTACHMENT attachment="DemoAnalyzer_7415.cc" attr="" comment="" date="1452030397" name="DemoAnalyzer_7415.cc" path="DemoAnalyzer_7415.cc" size="4651" user="eduardo" version="1"
META FILEATTACHMENT attachment="demoanalyzer_cfg_CMSSW_5_3_5.py.txt" attr="" comment="" date="1452030686" name="demoanalyzer_cfg_CMSSW_5_3_5.py.txt" path="demoanalyzer_cfg_CMSSW_5_3_5.py.txt" size="1218" user="eduardo" version="1"
META FILEATTACHMENT attachment="tracks_CMSSW_5_3_5.png" attr="" comment="" date="1452031436" name="tracks_CMSSW_5_3_5.png" path="tracks_CMSSW_5_3_5.png" size="7249" user="eduardo" version="1"
Added:
>
>
META FILEATTACHMENT attachment="charge_CMSSW5_3_5.png" attr="" comment="" date="1452139263" name="charge_CMSSW5_3_5.png" path="charge_CMSSW5_3_5.png" size="5844" user="eduardo" version="1"

Revision 72016-01-05 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Line: 1631 to 1631
 I will not go into detail about how you should add histograms. Below are the three files that you have to change to plot a histogram. Compare it to what you already have and make changes by seeing what is missing. If you do not want to make changes, just copy and paste them as is. Here are the steps. The order in which you do them does not matter.

1. Make changes in your demo analyzer DemoAnalyzer.cc and it should like this

Changed:
<
<
DemoAnalyzer.cc.
>
>
DemoAnalyzer.cc.
  2. Make changes in the BuildFile.xml and it should look like this: BuildFile.xml
<-- NO NEED TO MAKE CHANGES IN CMSSW_3_6_1.py and tracks_CMSSW_3_6_1.png as they work and are same for 382  -->
Changed:
<
<
3. Make changes in the config file demoanalyzer_cfg.py and it should like this demoanalyzer_cfg.py
>
>
3. Make changes in the config file ConfFile_cfg.py and it should like this ConfFile_cfg.py
  Then do scram b and run it by doing cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
Line: 1653 to 1653
 

Histo Analyzer

This package is similar to the DemoAnalyzer package. The point in having it here is that, having understood how to create, change and run your own demo analyzer (or module), you can also have look at this package that tells you how to add histograms to your analyzer which I already briefly showed you above. This has been historically here and I did not want to remove it. After all it does not hurt to tell how to include a histogram in your analyzer again.
Changed:
<
<
Eventually, you may want your analyzer to record something rather than just print out track numbers. The mkedanlzr script has an option histo to generate an analyzer code which writes a histogram in a root file. If you use it together with the option track, it will access the tracks, find their charge and fill a histogram.
>
>
Eventually, you may want your analyzer to record something rather than just print out track numbers. The mkedanlzr script has an option example_histo to generate an analyzer code which writes a histogram in a root file. If you use it together with the option example_track, it will access the tracks, find their charge and fill a histogram.
 To use this option, go to the CMSSW_7_4_15/src directory and create a new subdirectory
mkdir Histo
cd Histo
Create a new analyzer module
Changed:
<
<
mkedanlzr -track -histo HistoAnalyzer
>
>
mkedanlzr HistoAnalyzer example_track example_histo
  Go to the HistoAnalyzer directory and compile the code
cd HistoAnalyzer
scram b
Changed:
<
<
Change the data file to 'file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root' in histoanalyzer_cfg.py that we were already using in ConfFile_cfg.py and change 'ctfWithMaterialTracks' to 'generalTracks' by commenting out as follows
>
>
Change the data file to 'file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_RECO_5_3_4.root' in HistoAnalyzer/python/ConfFile_cfg.py that we were already using in ConfFile_cfg.py and change 'ctfWithMaterialTracks' to 'generalTracks' by commenting out as follows
  %SYNTAX{ syntax="python"}% process.demo = cms.EDAnalyzer('HistoAnalyzer'
Line: 1676 to 1675
 %ENDSYNTAX%

Run the analyzer

Changed:
<
<
cmsRun histoanalyzer_cfg.py
>
>
cmsRun HistoAnalyzer/python/ConfFile_cfg.py
  A root file histo.root has been created and you can find the histogram in root
root histo.root
Line: 1742 to 1741
 

META FILEATTACHMENT attachment="tutorial.css" attr="" comment="" date="1451402887" name="tutorial.css" path="tutorial.css" size="258" user="eduardo" version="1"
Added:
>
>
META FILEATTACHMENT attachment="DemoAnalyzer_535.cc" attr="" comment="" date="1452028498" name="DemoAnalyzer_535.cc" path="DemoAnalyzer_535.cc" size="3051" user="eduardo" version="1"
META FILEATTACHMENT attachment="BuildFile535.xml.txt" attr="" comment="" date="1452030330" name="BuildFile535.xml.txt" path="BuildFile535.xml.txt" size="233" user="eduardo" version="1"
META FILEATTACHMENT attachment="DemoAnalyzer_7415.cc" attr="" comment="" date="1452030397" name="DemoAnalyzer_7415.cc" path="DemoAnalyzer_7415.cc" size="4651" user="eduardo" version="1"
META FILEATTACHMENT attachment="demoanalyzer_cfg_CMSSW_5_3_5.py.txt" attr="" comment="" date="1452030686" name="demoanalyzer_cfg_CMSSW_5_3_5.py.txt" path="demoanalyzer_cfg_CMSSW_5_3_5.py.txt" size="1218" user="eduardo" version="1"
META FILEATTACHMENT attachment="tracks_CMSSW_5_3_5.png" attr="" comment="" date="1452031436" name="tracks_CMSSW_5_3_5.png" path="tracks_CMSSW_5_3_5.png" size="7249" user="eduardo" version="1"

Revision 62015-12-31 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Line: 170 to 170
  hideimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleclose-small.gif"}%
Changed:
<
<
[lxplus402 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$ cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
>
>
[lxplus402 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$ cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
 11-Mar-2013 02:11:38 CET Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root 11-Mar-2013 02:11:45 CET Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 11-Mar-2013 02:11:46.878 CET
Line: 314 to 314
 

Get tracks from the Event

Changed:
<
<
Demo/DemoAnalyzer/src/DemoAnalyzer.cc is the place to put your analysis code. In this example, we only add
>
>
Demo/DemoAnalyzer/plugins/DemoAnalyzer.cc is the place to put your analysis code. In this example, we only add
 very simple statement printing the number of tracks.
Changed:
<
<
Edit Demo/DemoAnalyzer/BuildFile.xml: so that it looks like this
>
>
Edit Demo/DemoAnalyzer/plugins/BuildFile.xml: so that it looks like this
 %SYNTAX{ syntax="python"}%
Line: 329 to 329
  More on information on the structure of a typical BuildFile.xml can be found on WorkBookBuildFilesIntro.
Changed:
<
<
Edit Demo/DemoAnalyzer/src/DemoAnalyzer.cc:
>
>
Edit Demo/DemoAnalyzer/plugins/DemoAnalyzer.cc:
 
  • Add the following include statements (together with the other include statements):
Line: 377 to 377
 </>
<--/twistyPlugin-->
</>
<--/twistyPlugin-->
Changed:
<
<
To print out the information that we added in the analyzer, we need to replace the line process.load("FWCore.MessageService.MessageLogger_cfi")) in file demoanalyzer_cfg.py with the segment below
>
>
To print out the information that we added in the analyzer, we need to replace the line process.load("FWCore.MessageService.MessageLogger_cfi")) in file ConfFile_cfg.py with the segment below
  %SYNTAX{ syntax="python"}% # initialize MessageLogger and output report
Line: 397 to 397
 
 
scram b
Changed:
<
<
cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
 

The output should look something like this:

Line: 407 to 407
  showimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleopen-small.gif" hideimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleclose-small.gif"}%
Changed:
<
<
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$ cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py 12-Mar-2013 18:59:31 CET Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root 12-Mar-2013 18:59:36 CET Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 18:59:36 CET pre-events no dictionary for class pair<edm::IndexIntoFile::IndexRunKey,Long64_t> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 18:59:36 CET pre-events no dictionary for class pair<edm::IndexIntoFile::IndexRunLumiKey,Long64_t> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 18:59:36 CET pre-events no dictionary for class pair<edm::BranchKey,edm::ConstBranchDescription> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 18:59:36 CET pre-events no dictionary for class pair<edm::BranchID,unsigned int> is available %MSG Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 12-Mar-2013 18:59:37.193 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 18:59:37 CET Run: 1 Event: 261746003 number of tracks 1211 %MSG Begin processing the 2nd record. Run 1, Event 261746009, LumiSection 872662 at 12-Mar-2013 18:59:37.203 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 18:59:37 CET Run: 1 Event: 261746009 number of tracks 781 %MSG Begin processing the 3rd record. Run 1, Event 261746010, LumiSection 872662 at 12-Mar-2013 18:59:37.206 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 18:59:37 CET Run: 1 Event: 261746010 number of tracks 1535
>
>
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_7_4_15/src]$ cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py 31-Dec-2015 00:09:29 CET Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root %MSG-i Root_Information: file_open TClass::Init() 31-Dec-2015 00:09:39 CET pre-events no dictionary for class reco::LeafRefCandidateT<edm::Ref<vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track> > > is available %MSG 31-Dec-2015 00:09:39 CET Successfully opened file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root Begin processing the 1st record. Run 1, Event 19279309, LumiSection 64278 at 31-Dec-2015 00:09:46.481 CET %MSG-i GetByLabelWithoutRegistration: DemoAnalyzer:demo 31-Dec-2015 00:09:46 CET Run: 1 Event: 19279309 ::getByLabel without corresponding call to consumes or mayConsumes for this module. type: std::vector<reco::Track> module label: generalTracks product instance name: '' process name: ''

%MSG %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 00:09:46 CET Run: 1 Event: 19279309 number of tracks 1051 %MSG Begin processing the 2nd record. Run 1, Event 19279311, LumiSection 64278 at 31-Dec-2015 00:09:46.535 CET %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 00:09:46 CET Run: 1 Event: 19279311 number of tracks 919 %MSG Begin processing the 3rd record. Run 1, Event 19279312, LumiSection 64278 at 31-Dec-2015 00:09:46.549 CET %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 00:09:46 CET Run: 1 Event: 19279312 number of tracks 402

  ...
Deleted:
<
<
%MSG Begin processing the 48th record. Run 1, Event 261746140, LumiSection 872662 at 12-Mar-2013 18:59:38.129 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 18:59:38 CET Run: 1 Event: 261746140 number of tracks 544
 %MSG
Changed:
<
<
Begin processing the 49th record. Run 1, Event 261746141, LumiSection 872662 at 12-Mar-2013 18:59:38.134 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 18:59:38 CET Run: 1 Event: 261746141 number of tracks 662
>
>
Begin processing the 98th record. Run 1, Event 19280566, LumiSection 64282 at 31-Dec-2015 00:09:47.098 CET %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 00:09:47 CET Run: 1 Event: 19280566 number of tracks 297 %MSG Begin processing the 99th record. Run 1, Event 19280570, LumiSection 64282 at 31-Dec-2015 00:09:47.099 CET %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 00:09:47 CET Run: 1 Event: 19280570 number of tracks 533 %MSG Begin processing the 100th record. Run 1, Event 19280577, LumiSection 64282 at 31-Dec-2015 00:09:47.100 CET %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 00:09:47 CET Run: 1 Event: 19280577 number of tracks 321
 %MSG
Changed:
<
<
Begin processing the 50th record. Run 1, Event 261746142, LumiSection 872662 at 12-Mar-2013 18:59:38.135 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 18:59:38 CET Run: 1 Event: 261746142 number of tracks 947 %MSG 12-Mar-2013 18:59:38 CET Closed file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
>
>
31-Dec-2015 00:09:47 CET Closed file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root
  TrigReport ---------- Event Summary ------------
Changed:
<
<
TrigReport Events total = 50 passed = 50 failed = 0
>
>
TrigReport Events total = 100 passed = 100 failed = 0
  TrigReport ---------- Path Summary ------------
Changed:
<
<
TrigReport Trig Bit# Run Passed Failed Error Name TrigReport 1 0 50 50 0 0 p
>
>
TrigReport Trig Bit# Executed Passed Failed Error Name TrigReport 1 0 100 100 0 0 p
  TrigReport -------End-Path Summary ------------
Changed:
<
<
TrigReport Trig Bit# Run Passed Failed Error Name
>
>
TrigReport Trig Bit# Executed Passed Failed Error Name
  TrigReport ---------- Modules in Path: p ------------ TrigReport Trig Bit# Visited Passed Failed Error Name
Changed:
<
<
TrigReport 1 0 50 50 0 0 demo
>
>
TrigReport 1 0 100 100 0 0 demo
  TrigReport ---------- Module Summary ------------
Changed:
<
<
TrigReport Visited Run Passed Failed Error Name TrigReport 50 50 50 0 0 demo TrigReport 50 50 50 0 0 TriggerResults
>
>
TrigReport Visited Executed Passed Failed Error Name TrigReport 100 100 100 0 0 demo TrigReport 100 100 100 0 0 TriggerResults
  TimeReport ---------- Event Summary ---[sec]----
Changed:
<
<
TimeReport CPU/event = 0.002820 Real/event = 0.002912

TimeReport ---------- Path Summary ---[sec]---- TimeReport per event per path-run TimeReport CPU Real CPU Real Name TimeReport 0.002800 0.002883 0.002800 0.002883 p TimeReport CPU Real CPU Real Name TimeReport per event per path-run

TimeReport -------End-Path Summary ---[sec]---- TimeReport per event per endpath-run TimeReport CPU Real CPU Real Name TimeReport CPU Real CPU Real Name TimeReport per event per endpath-run

TimeReport ---------- Modules in Path: p ---[sec]---- TimeReport per event per module-visit TimeReport CPU Real CPU Real Name TimeReport 0.002800 0.002881 0.002800 0.002881 demo TimeReport CPU Real CPU Real Name TimeReport per event per module-visit TimeReport CPU Real CPU Real Name TimeReport per event per module-visit

TimeReport ---------- Module Summary ---[sec]---- TimeReport per event per module-run per module-visit TimeReport CPU Real CPU Real CPU Real Name TimeReport 0.002800 0.002881 0.002800 0.002881 0.002800 0.002881 demo TimeReport 0.000020 0.000025 0.000020 0.000025 0.000020 0.000025 TriggerResults TimeReport CPU Real CPU Real CPU Real Name TimeReport per event per module-run per module-visit

>
>
TimeReport event loop CPU/event = 0.004178 TimeReport event loop Real/event = 0.007112 TimeReport sum Streams Real/event = 0.006155 TimeReport efficiency CPU/Real/thread = 0.587531

TimeReport ---------- Path Summary ---[Real sec]---- TimeReport per event per exec Name TimeReport 0.005370 0.005370 p TimeReport per event per exec Name

TimeReport -------End-Path Summary ---[Real sec]---- TimeReport per event per exec Name TimeReport per event per exec Name

TimeReport ---------- Modules in Path: p ---[Real sec]---- TimeReport per event per visit Name TimeReport 0.000226 0.000226 demo TimeReport per event per visit Name

TimeReport ---------- Module Summary ---[Real sec]---- TimeReport per event per exec per visit Name TimeReport 0.000021 0.000021 0.000021 TriggerResults TimeReport 0.000226 0.000226 0.000226 demo TimeReport per event per exec per visit Name

  T---Report end!
Line: 532 to 523
  In this section, we determine the minimum number of tracks for an event to be displayed, and make it so we can change this number in the config and not need to recompile.
Changed:
<
<
  • Edit the Demo/DemoAnalyzer/src/DemoAnalyzer.cc file. Add a new member data line to the DemoAnalyzer class:
>
>
  • Edit the Demo/DemoAnalyzer/plugins/DemoAnalyzer.cc file. Add a new member data line to the DemoAnalyzer class:
  %SYNTAX{ syntax="cpp"}% private:
Line: 601 to 592
 %ENDSYNTAX%

Also to see if actually minTracks_ gets used, replace the line process.demo = cms.EDAnalyzer('DemoAnalyzer'

Changed:
<
<
) in demoanalyzer_cfg.py by the segment below to use a value of say minTracks_ = 1000 .
>
>
) in ConfFile_cfg.py by the segment below to use a value of say minTracks_ = 1000 .
  %SYNTAX{ syntax="python"}% process.demo = cms.EDAnalyzer('DemoAnalyzer',
Line: 615 to 606
 NOTE: whenever you make changes in the code of your analyzer you have to do scram b

  • Run the job.
Changed:
<
<
cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
 

The output should be something like this (Only events with tracks greater than 1000 get printed). Click here:

Line: 624 to 615
  showimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleopen-small.gif" hideimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleclose-small.gif"}%
Changed:
<
<
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$ cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py 12-Mar-2013 19:12:58 CET Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root 12-Mar-2013 19:13:03 CET Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:13:03 CET pre-events no dictionary for class pair<edm::IndexIntoFile::IndexRunKey,Long64_t> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:13:03 CET pre-events no dictionary for class pair<edm::IndexIntoFile::IndexRunLumiKey,Long64_t> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:13:03 CET pre-events no dictionary for class pair<edm::BranchKey,edm::ConstBranchDescription> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:13:03 CET pre-events no dictionary for class pair<edm::BranchID,unsigned int> is available %MSG Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 12-Mar-2013 19:13:05.970 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 19:13:05 CET Run: 1 Event: 261746003 number of tracks 1211 %MSG Begin processing the 2nd record. Run 1, Event 261746009, LumiSection 872662 at 12-Mar-2013 19:13:05.982 CET Begin processing the 3rd record. Run 1, Event 261746010, LumiSection 872662 at 12-Mar-2013 19:13:05.985 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 19:13:05 CET Run: 1 Event: 261746010 number of tracks 1535 %MSG Begin processing the 4th record. Run 1, Event 261746019, LumiSection 872662 at 12-Mar-2013 19:13:05.990 CET Begin processing the 5th record. Run 1, Event 261746021, LumiSection 872662 at 12-Mar-2013 19:13:05.993 CET Begin processing the 6th record. Run 1, Event 261746029, LumiSection 872662 at 12-Mar-2013 19:13:05.996 CET Begin processing the 7th record. Run 1, Event 261746030, LumiSection 872662 at 12-Mar-2013 19:13:05.998 CET Begin processing the 8th record. Run 1, Event 261746031, LumiSection 872662 at 12-Mar-2013 19:13:06.001 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 19:13:06 CET Run: 1 Event: 261746031 number of tracks 1350
>
>
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_7_4_15/src]$ cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py 31-Dec-2015 00:36:47 CET Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root %MSG-i Root_Information: file_open TClass::Init() 31-Dec-2015 00:36:53 CET pre-events no dictionary for class reco::LeafRefCandidateT<edm::Ref<vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track> > > is available %MSG 31-Dec-2015 00:36:53 CET Successfully opened file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root Begin processing the 1st record. Run 1, Event 19279309, LumiSection 64278 at 31-Dec-2015 00:36:56.202 CET %MSG-i GetByLabelWithoutRegistration: DemoAnalyzer:demo 31-Dec-2015 00:36:56 CET Run: 1 Event: 19279309 ::getByLabel without corresponding call to consumes or mayConsumes for this module. type: std::vector<reco::Track> module label: generalTracks product instance name: '' process name: ''

%MSG %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 00:36:56 CET Run: 1 Event: 19279309 number of tracks 1051 %MSG Begin processing the 2nd record. Run 1, Event 19279311, LumiSection 64278 at 31-Dec-2015 00:36:56.212 CET Begin processing the 3rd record. Run 1, Event 19279312, LumiSection 64278 at 31-Dec-2015 00:36:56.215 CET Begin processing the 4th record. Run 1, Event 19279316, LumiSection 64278 at 31-Dec-2015 00:36:56.216 CET Begin processing the 5th record. Run 1, Event 19279318, LumiSection 64278 at 31-Dec-2015 00:36:56.218 CET Begin processing the 6th record. Run 1, Event 19279319, LumiSection 64278 at 31-Dec-2015 00:36:56.220 CET Begin processing the 7th record. Run 1, Event 19279324, LumiSection 64278 at 31-Dec-2015 00:36:56.223 CET Begin processing the 8th record. Run 1, Event 19279326, LumiSection 64278 at 31-Dec-2015 00:36:56.224 CET Begin processing the 9th record. Run 1, Event 19279341, LumiSection 64278 at 31-Dec-2015 00:36:56.226 CET Begin processing the 10th record. Run 1, Event 19279353, LumiSection 64278 at 31-Dec-2015 00:36:56.228 CET Begin processing the 11th record. Run 1, Event 19279354, LumiSection 64278 at 31-Dec-2015 00:36:56.230 CET %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 00:36:56 CET Run: 1 Event: 19279354 number of tracks 1166 %MSG Begin processing the 12th record. Run 1, Event 19279358, LumiSection 64278 at 31-Dec-2015 00:36:56.233 CET Begin processing the 13th record. Run 1, Event 19279360, LumiSection 64278 at 31-Dec-2015 00:36:56.235 CET Begin processing the 14th record. Run 1, Event 19279362, LumiSection 64278 at 31-Dec-2015 00:36:56.237 CET %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 00:36:56 CET Run: 1 Event: 19279362 number of tracks 1314

  ...
Line: 662 to 658
 </>
<--/twistyPlugin-->

Changed:
<
<

A look at demoanalyzer_cfi.py file

There is file named demoanalyzer_cfi.py in the Demo/DemoAnalyzer/python directory. A _cfi.py file contains default values of all the required parameters of a package. Rather than setting all the analyzer (we also call it module) parameters in your demoanalyzer_cfg.py file, one can define all of them in the demoanalyzer_cfi.py file. These parameters can then be reset (or overridden) by giving them a value you want in demoanalyzer_cfg.py. However, you will have to include demoanalyzer_cfi.py in demoanalyzer_cfg.py.
>
>

A look at CfiFile_cfi.py file

There is file named CfiFile_cfi.py in the Demo/DemoAnalyzer/python directory. A _cfi.py file contains default values of all the required parameters of a package. Rather than setting all the analyzer (we also call it module) parameters in your ConfFile_cfg.py file, one can define all of them in the CfiFile_cfi.py file. These parameters can then be reset (or overridden) by giving them a value you want in ConfFile_cfg.py. However, you will have to include CfiFile_cfi.py in ConfFile_cfg.py.
 
Changed:
<
<
To explain it more clearly, I can put the default value of minTracks=0 in demoanalyzer_cfi.py and override it to say minTracks=50 in demoanalyzer_cfg.py. Thus if there are, say 10 parameters defined with their default values in demoanalyzer_cfi.py and I want to change two of those to some other value, I can do that in demoanalyzer_cfg.py WITHOUT changing the file demoanalyzer_cfi.py that has default values.
>
>
To explain it more clearly, I can put the default value of minTracks=0 in CfiFile_cfi.py and override it to say minTracks=50 in ConfFile_cfg.py. Thus if there are, say 10 parameters defined with their default values in CfiFile_cfi.py and I want to change two of those to some other value, I can do that in ConfFile_cfg.py WITHOUT changing the file CfiFile_cfi.py that has default values.
 
Changed:
<
<
The mkedanlzr script has created a demoanalyzer_cfi.py file in the python directory as mentioned above.
>
>
The mkedanlzr script has created a CfiFile_cfi.py file in the python directory as mentioned above.
 
Changed:
<
<
  • Add the newly created parameter minTracks and its default value to this demoanalyzer_cfi.py file so that it its content looks like this:
>
>
  • Add the newly created parameter minTracks and its default value to this CfiFile_cfi.py file so that it its content looks like this:
  %SYNTAX{ syntax="python"}% import ParameterSet.Config as cms
Line: 679 to 675
 ) %ENDSYNTAX%
Changed:
<
<
  • Edit the demoanalyzer_cfg.py file and REPLACE
>
>
  • Edit the ConfFile_cfg.py file and REPLACE
  %SYNTAX{ syntax="python"}% process.demo = cms.EDAnalyzer('DemoAnalyzer',
Line: 690 to 686
 WITH (these are 2 different lines, so should be on seperate lines each

%SYNTAX{ syntax="python"}%

Changed:
<
<
process.load("Demo.DemoAnalyzer.demoanalyzer_cfi")
>
>
process.load("Demo.DemoAnalyzer.CfiFile_cfi")
 process.demo.minTracks=1000 %ENDSYNTAX%
Line: 698 to 694
 
  • Rerun the job:
Changed:
<
<
cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
 
Changed:
<
<
You will see the same output as before EXCEPT that now you are overriding the default value of minTracks=0 defined in demoanalyzer_cfi.py with a value you choose (in this case minTracks=1000) in demoanalyzer_cfg.py. In this case the file with default parameters demoanalyzer_cfi.py remains untouched.
>
>
You will see the same output as before EXCEPT that now you are overriding the default value of minTracks=0 defined in CfiFile_cfi.py with a value you choose (in this case minTracks=1000) in ConfFile_cfg.py. In this case the file with default parameters CfiFile_cfi.py remains untouched.
 

See what is available in the Event

Changed:
<
<
1. Edit the configuration file, demoanalyzer_cfg.py and add the EventContentAnalyzer module. The module EventContentAnalyzer dumps all products stored in an event to the screen. One can add it to the path as follows:
>
>
1. Edit the configuration file, ConfFile_cfg.py and add the EventContentAnalyzer module. The module EventContentAnalyzer dumps all products stored in an event to the screen. One can add it to the path as follows:
  %SYNTAX{ syntax="python"}% process.dump=cms.EDAnalyzer('EventContentAnalyzer')
Line: 733 to 729
  2. Run the job.
Changed:
<
<
cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
  The output should be something like this:
Line: 741 to 737
  showimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleopen-small.gif" hideimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleclose-small.gif"}%
Changed:
<
<
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$ cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py 12-Mar-2013 19:40:13 CET Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root 12-Mar-2013 19:40:18 CET Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:40:18 CET pre-events no dictionary for class pair<edm::IndexIntoFile::IndexRunKey,Long64_t> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:40:18 CET pre-events no dictionary for class pair<edm::IndexIntoFile::IndexRunLumiKey,Long64_t> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:40:18 CET pre-events no dictionary for class pair<edm::BranchKey,edm::ConstBranchDescription> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:40:18 CET pre-events no dictionary for class pair<edm::BranchID,unsigned int> is available
>
>
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_7_4_15/src]$ cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py 31-Dec-2015 01:00:58 CET Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root %MSG-i Root_Information: file_open TClass::Init() 31-Dec-2015 01:01:04 CET pre-events no dictionary for class reco::LeafRefCandidateT<edm::Ref<vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track> > > is available %MSG 31-Dec-2015 01:01:04 CET Successfully opened file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root Begin processing the 1st record. Run 1, Event 19279309, LumiSection 64278 at 31-Dec-2015 01:01:06.967 CET %MSG-i GetByLabelWithoutRegistration: DemoAnalyzer:demo 31-Dec-2015 01:01:06 CET Run: 1 Event: 19279309 ::getByLabel without corresponding call to consumes or mayConsumes for this module. type: std::vector<reco::Track> module label: generalTracks product instance name: '' process name: ''
 %MSG
Changed:
<
<
Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 12-Mar-2013 19:40:19.560 CET %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 19:40:19 CET Run: 1 Event: 261746003 number of tracks 1211
>
>
%MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 01:01:06 CET Run: 1 Event: 19279309 number of tracks 1051
 %MSG
Changed:
<
<
++Event 1 contains 695 products with friendlyClassName, moduleLabel, productInstanceName and processName:
>
>
++Event 1 contains 383 products with friendlyClassName, moduleLabel, productInstanceName and processName:
 ++BeamSpotOnlines "scalersRawToDigi" "" "RECO" (productId = 4:1)
Changed:
<
<
++CSCDetIdCSCALCTDigiMuonDigiCollection "hltMuonCSCDigis" "MuonCSCALCTDigi" "HLT" (productId = 3:2) ++CSCDetIdCSCCLCTDigiMuonDigiCollection "hltMuonCSCDigis" "MuonCSCCLCTDigi" "HLT" (productId = 3:4)
>
>
++CaloTowersSorted "towerMaker" "" "RECO" (productId = 4:15)
  ...
Changed:
<
<
++triggerTriggerFilterObjectWithRefs "hltPFTau35Track" "" "HLT" (productId = 3:2722) ++triggerTriggerFilterObjectWithRefs "hltPFTau35TrackPt20" "" "HLT" (productId = 3:2723) ++triggerTriggerFilterObjectWithRefs "hltPFTau35TrackPt20LooseIso" "" "HLT" (productId = 3:2724) ++uintedmValueMap "muons" "cosmicsVeto" "RECO" (productId = 4:1021) 12-Mar-2013 19:40:19 CET Closed file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
>
>
++recoVertexs "offlinePrimaryVertices" "" "RECO" (productId = 4:1026) ++recoVertexs "offlinePrimaryVerticesWithBS" "" "RECO" (productId = 4:1028) ++triggerTriggerEvent "hltTriggerSummaryAOD" "" "HLT" (productId = 3:1414) ++uintedmValueMap "muons" "cosmicsVeto" "RECO" (productId = 4:1032) 31-Dec-2015 01:01:07 CET Closed file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root
  Summary for key being the concatenation of friendlyClassName, moduleLabel, productInstanceName and processName 1 occurrences of key BeamSpotOnlines + "scalersRawToDigi" + "" "RECO"
Changed:
<
<
1 occurrences of key CSCDetIdCSCALCTDigiMuonDigiCollection + "hltMuonCSCDigis" + "MuonCSCALCTDigi" "HLT" 1 occurrences of key CSCDetIdCSCCLCTDigiMuonDigiCollection + "hltMuonCSCDigis" + "MuonCSCCLCTDigi" "HLT"
>
>
1 occurrences of key CaloTowersSorted + "towerMaker" + "" "RECO" 1 occurrences of key CastorRecHitsSorted + "castorreco" + "" "RECO"
  ...
Changed:
<
<
1 occurrences of key triggerTriggerFilterObjectWithRefs + "hltPFTau35TrackPt20" + "" "HLT" 1 occurrences of key triggerTriggerFilterObjectWithRefs + "hltPFTau35TrackPt20LooseIso" + "" "HLT"
>
>
1 occurrences of key recoVertexs + "offlinePrimaryVerticesWithBS" + "" "RECO" 1 occurrences of key triggerTriggerEvent + "hltTriggerSummaryAOD" + "" "HLT"
  1 occurrences of key uintedmValueMap + "muons" + "cosmicsVeto" "RECO"

TrigReport ---------- Event Summary ------------ TrigReport Events total = 1 passed = 1 failed = 0

TrigReport ---------- Path Summary ------------

Changed:
<
<
TrigReport Trig Bit# Run Passed Failed Error Name
>
>
TrigReport Trig Bit# Executed Passed Failed Error Name
 TrigReport 1 0 1 1 0 0 p

TrigReport -------End-Path Summary ------------

Changed:
<
<
TrigReport Trig Bit# Run Passed Failed Error Name
>
>
TrigReport Trig Bit# Executed Passed Failed Error Name
  TrigReport ---------- Modules in Path: p ------------ TrigReport Trig Bit# Visited Passed Failed Error Name TrigReport 1 0 1 1 0 0 demo
Changed:
<
<
TrigReport 1 0 1 1 0 0 dump
>
>
TrigReport 1 1 1 1 0 0 dump
  TrigReport ---------- Module Summary ------------
Changed:
<
<
TrigReport Visited Run Passed Failed Error Name
>
>
TrigReport Visited Executed Passed Failed Error Name
 TrigReport 1 1 1 0 0 demo TrigReport 1 1 1 0 0 dump TrigReport 1 1 1 0 0 TriggerResults

TimeReport ---------- Event Summary ---[sec]----

Changed:
<
<
TimeReport CPU/event = 0.044994 Real/event = 0.048325

TimeReport ---------- Path Summary ---[sec]---- TimeReport per event per path-run TimeReport CPU Real CPU Real Name TimeReport 0.044994 0.048223 0.044994 0.048223 p TimeReport CPU Real CPU Real Name TimeReport per event per path-run

TimeReport -------End-Path Summary ---[sec]---- TimeReport per event per endpath-run TimeReport CPU Real CPU Real Name TimeReport CPU Real CPU Real Name TimeReport per event per endpath-run

TimeReport ---------- Modules in Path: p ---[sec]---- TimeReport per event per module-visit TimeReport CPU Real CPU Real Name TimeReport 0.008999 0.009337 0.008999 0.009337 demo TimeReport 0.035995 0.038878 0.035995 0.038878 dump TimeReport CPU Real CPU Real Name TimeReport per event per module-visit TimeReport CPU Real CPU Real Name TimeReport per event per module-visit

TimeReport ---------- Module Summary ---[sec]---- TimeReport per event per module-run per module-visit TimeReport CPU Real CPU Real CPU Real Name TimeReport 0.008999 0.009337 0.008999 0.009337 0.008999 0.009337 demo TimeReport 0.035995 0.038878 0.035995 0.038878 0.035995 0.038878 dump TimeReport 0.000000 0.000093 0.000000 0.000093 0.000000 0.000093 TriggerResults TimeReport CPU Real CPU Real CPU Real Name TimeReport per event per module-run per module-visit

>
>
TimeReport event loop CPU/event = 0.123668 TimeReport event loop Real/event = 0.124931 TimeReport sum Streams Real/event = 0.052483 TimeReport efficiency CPU/Real/thread = 0.989889

TimeReport ---------- Path Summary ---[Real sec]---- TimeReport per event per exec Name TimeReport 0.048820 0.048820 p TimeReport per event per exec Name

TimeReport -------End-Path Summary ---[Real sec]---- TimeReport per event per exec Name TimeReport per event per exec Name

TimeReport ---------- Modules in Path: p ---[Real sec]---- TimeReport per event per visit Name TimeReport 0.000309 0.000309 demo TimeReport 0.038008 0.038008 dump TimeReport per event per visit Name

TimeReport ---------- Module Summary ---[Real sec]---- TimeReport per event per exec per visit Name TimeReport 0.000080 0.000080 0.000080 TriggerResults TimeReport 0.000309 0.000309 0.000309 demo TimeReport 0.038008 0.038008 0.038008 dump TimeReport per event per exec per visit Name

  T---Report end!
Line: 850 to 837
  type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- -----
Changed:
<
<
1 EventContent -s EventContentAnal 696 696 2 EventContent -s EventContentAnal 696 696
>
>
1 EventContent -s EventContentAnal 384 384 2 EventContent -s EventContentAnal 384 384
  3 fileAction -s file_close 1 1 4 fileAction -s file_open 2 2

type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ----------------

Changed:
<
<
1 EventContent 1/261746003 1/261746003 1/261746003
>
>
1 EventContent 1/19279309 1/19279309 1/19279309
  2 EventContent PostEndRun PostEndRun PostEndRun 3 fileAction PostEndRun 4 fileAction pre-events pre-events

Severity # Occurrences Total Occurrences


------------- -----------------
Changed:
<
<
System 1395 1395
>
>
System 771 771
  </>
<--/twistyPlugin-->
Line: 1200 to 1187
 

Watch the processing of a job

Changed:
<
<
1. Edit the configuration file, demoanalyzer_cfg.py, and add the Tracer service ( just above the line process.p = cms.Path(process.demo*process.dump)) in demoanalyzer_cfg.py. This service identifies what module is called and when.
>
>
1. Edit the configuration file, ConfFile_cfg.py, and add the Tracer service ( just above the line process.p = cms.Path(process.demo*process.dump)) in ConfFile_cfg.py. This service identifies what module is called and when.
  %SYNTAX{ syntax="python"}% process.Tracer = cms.Service("Tracer")
Line: 1210 to 1197
  2. Run the job
Changed:
<
<
cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
>
>
cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
 

The output should be something like this:

Line: 1219 to 1206
  showimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleopen-small.gif" hideimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleclose-small.gif"}%
Changed:
<
<
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$ cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py ++ constructing source:PoolSource ++++open input file 12-Mar-2013 19:52:44 CET Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root 12-Mar-2013 19:52:49 CET Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root ++++finished: open input file %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:52:49 CET pre-events no dictionary for class pair<edm::IndexIntoFile::IndexRunKey,Long64_t> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:52:49 CET pre-events no dictionary for class pair<edm::IndexIntoFile::IndexRunLumiKey,Long64_t> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:52:49 CET pre-events no dictionary for class pair<edm::BranchKey,edm::ConstBranchDescription> is available %MSG %MSG-i Root_Information: AfterFile TClass::TClass() 12-Mar-2013 19:52:49 CET pre-events no dictionary for class pair<edm::BranchID,unsigned int> is available %MSG ++ construction finished:PoolSource ++ constructing module:demo ++ construction finished:demo ++ constructing module:TriggerResults ++ construction finished:TriggerResults %MSG-i path: AfterModConstruction 12-Mar-2013 19:52:49 CET pre-events The following module labels are not assigned to any path: 'dump'

%MSG ++ beginJob module:demo ++ beginJob finished:demo ++ beginJob module:TriggerResults ++ beginJob finished:TriggerResults ++ Job started ++++source run

>
>
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_7_4_15/src]$ cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py ++ starting: constructing source: PoolSource ++++ starting: open input file: lfn = file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root 31-Dec-2015 01:22:37 CET Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root %MSG-i Root_Information: file_open TClass::Init() 31-Dec-2015 01:22:42 CET pre-events no dictionary for class reco::LeafRefCandidateT<edm::Ref<vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track> > > is availa ble %MSG 31-Dec-2015 01:22:42 CET Successfully opened file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root ++++ finished: open input file: lfn = file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root ++ finished: constructing source: PoolSource ++++ starting: constructing module with label 'TriggerResults' id = 1 ++++ finished: constructing module with label 'TriggerResults' id = 1 ++++ starting: constructing module with label 'demo' id = 2 ++++ finished: constructing module with label 'demo' id = 2 ++ preallocate: 1 concurrent runs, 1 concurrent luminosity sections, 1 streams ++ starting: begin job ++++ starting: begin job for module with label 'demo' id = 2 ++++ finished: begin job for module with label 'demo' id = 2 ++++ starting: begin job for module with label 'TriggerResults' id = 1 ++++ finished: begin job for module with label 'TriggerResults' id = 1 ++ finished: begin job ++++ starting: begin stream for module: stream = 0 label = 'demo' id = 2 ++++ finished: begin stream for module: stream = 0 label = 'demo' id = 2 ++++ starting: begin stream for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: begin stream for module: stream = 0 label = 'TriggerResults' id = 1 ++++ starting: source run
 ++++finished: source run
Changed:
<
<
++++ processing begin run:run: 1 time:1 ++++++ processing path for begin run:p ++++++++ module for begin run:demo ++++++++ finished for begin run:demo ++++++ finished path for begin run:p ++++++++ module for begin run:TriggerResults ++++++++ finished for begin run:TriggerResults ++++ finished begin run: ++++source lumi
>
>
++++ starting: global begin run 1 : time = 1 ++++++ starting: global begin run for module: label = 'demo' id = 2 ++++++ finished: global begin run for module: label = 'demo' id = 2 ++++++ starting: global begin run for module: label = 'TriggerResults' id = 1 ++++++ finished: global begin run for module: label = 'TriggerResults' id = 1 ++++ finished: global begin run 1 : time = 1 ++++ starting: begin run: stream = 0 run = 1 time = 1 ++++++ starting: begin run for module: stream = 0 label = 'demo' id = 2 ++++++ finished: begin run for module: stream = 0 label = 'demo' id = 2 ++++ finished: begin run: stream = 0 run = 1 time = 1 ++++ starting: source lumi
 ++++finished: source lumi
Changed:
<
<
++++ processing begin lumi:run: 1 luminosityBlock: 872662 time:1230005000001 ++++++ processing path for begin lumi:p ++++++++ module for begin lumi:demo ++++++++ finished for begin lumi:demo ++++++ finished path for begin lumi:p ++++++++ module for begin lumi:TriggerResults ++++++++ finished for begin lumi:TriggerResults ++++ finished begin lumi: ++++source event
>
>
++++ starting: global begin lumi: run = 1 lumi = 64278 time = 1396505000001 ++++++ starting: global begin lumi for module: label = 'demo' id = 2 ++++++ finished: global begin lumi for module: label = 'demo' id = 2 ++++++ starting: global begin lumi for module: label = 'TriggerResults' id = 1 ++++++ finished: global begin lumi for module: label = 'TriggerResults' id = 1 ++++ finished: global begin lumi: run = 1 lumi = 64278 time = 1396505000001 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 64278 time = 1396505000001 ++++++ starting: begin lumi for module: stream = 0 label = 'demo' id = 2 ++++++ finished: begin lumi for module: stream = 0 label = 'demo' id = 2 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 64278 time = 1396505000001 ++++ starting: source event
 ++++finished: source event
Changed:
<
<
Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 12-Mar-2013 19:52:50.041 CET ++++ processing event:run: 1 lumi: 872662 event: 261746003 time:1230015000001 ++++++ processing path for event:p ++++++++ module for event:demo %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 19:52:50 CET Run: 1 Event: 261746003 number of tracks 1211 %MSG ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 1st record. Run 1, Event 19279309, LumiSection 64278 at 31-Dec-2015 01:22:45.085 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279309 time = 1396545000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 %MSG-i GetByLabelWithoutRegistration: DemoAnalyzer:demo 31-Dec-2015 01:22:45 CET Run: 1 Event: 19279309 ::getByLabel without corresponding call to consumes or mayConsumes for this module. type: std::vector<reco::Track> module label: generalTracks product instance name: '' process name: ''

%MSG ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 01:22:45 CET Run: 1 Event: 19279309 number of tracks 1051 %MSG ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279309 time = 1396545000001 ++++ starting: source event

 ++++finished: source event
Changed:
<
<
Begin processing the 2nd record. Run 1, Event 261746009, LumiSection 872662 at 12-Mar-2013 19:52:50.052 CET ++++ processing event:run: 1 lumi: 872662 event: 261746009 time:1230045000001 ++++++ processing path for event:p ++++++++ module for event:demo ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 2nd record. Run 1, Event 19279311, LumiSection 64278 at 31-Dec-2015 01:22:45.098 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279311 time = 1396555000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279311 time = 1396555000001 ++++ starting: source event
 ++++finished: source event
Changed:
<
<
Begin processing the 3rd record. Run 1, Event 261746010, LumiSection 872662 at 12-Mar-2013 19:52:50.055 CET ++++ processing event:run: 1 lumi: 872662 event: 261746010 time:1230050000001 ++++++ processing path for event:p ++++++++ module for event:demo %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 19:52:50 CET Run: 1 Event: 261746010 number of tracks 1535 %MSG ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 3rd record. Run 1, Event 19279312, LumiSection 64278 at 31-Dec-2015 01:22:45.106 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279312 time = 1396560000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279312 time = 1396560000001 ++++ starting: source event
 ++++finished: source event
Changed:
<
<
Begin processing the 4th record. Run 1, Event 261746019, LumiSection 872662 at 12-Mar-2013 19:52:50.060 CET ++++ processing event:run: 1 lumi: 872662 event: 261746019 time:1230095000001 ++++++ processing path for event:p ++++++++ module for event:demo ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 4th record. Run 1, Event 19279316, LumiSection 64278 at 31-Dec-2015 01:22:45.108 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279316 time = 1396580000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279316 time = 1396580000001 ++++ starting: source event
 ++++finished: source event
Changed:
<
<
Begin processing the 5th record. Run 1, Event 261746021, LumiSection 872662 at 12-Mar-2013 19:52:50.063 CET ++++ processing event:run: 1 lumi: 872662 event: 261746021 time:1230105000001 ++++++ processing path for event:p ++++++++ module for event:demo ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 5th record. Run 1, Event 19279318, LumiSection 64278 at 31-Dec-2015 01:22:45.111 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279318 time = 1396590000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279318 time = 1396590000001 ++++ starting: source event
 ++++finished: source event
Changed:
<
<
Begin processing the 6th record. Run 1, Event 261746029, LumiSection 872662 at 12-Mar-2013 19:52:50.066 CET ++++ processing event:run: 1 lumi: 872662 event: 261746029 time:1230145000001 ++++++ processing path for event:p ++++++++ module for event:demo ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 6th record. Run 1, Event 19279319, LumiSection 64278 at 31-Dec-2015 01:22:45.113 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279319 time = 1396595000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279319 time = 1396595000001 ++++ starting: source event
 ++++finished: source event
Changed:
<
<
Begin processing the 7th record. Run 1, Event 261746030, LumiSection 872662 at 12-Mar-2013 19:52:50.068 CET ++++ processing event:run: 1 lumi: 872662 event: 261746030 time:1230150000001 ++++++ processing path for event:p ++++++++ module for event:demo ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 7th record. Run 1, Event 19279324, LumiSection 64278 at 31-Dec-2015 01:22:45.117 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279324 time = 1396620000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279324 time = 1396620000001 ++++ starting: source event
 ++++finished: source event
Changed:
<
<
Begin processing the 8th record. Run 1, Event 261746031, LumiSection 872662 at 12-Mar-2013 19:52:50.071 CET ++++ processing event:run: 1 lumi: 872662 event: 261746031 time:1230155000001 ++++++ processing path for event:p ++++++++ module for event:demo %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 19:52:50 CET Run: 1 Event: 261746031 number of tracks 1350 %MSG ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 8th record. Run 1, Event 19279326, LumiSection 64278 at 31-Dec-2015 01:22:45.118 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279326 time = 1396630000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279326 time = 1396630000001 ++++ starting: source event
 ++++finished: source event
Changed:
<
<
Begin processing the 9th record. Run 1, Event 261746034, LumiSection 872662 at 12-Mar-2013 19:52:50.075 CET ++++ processing event:run: 1 lumi: 872662 event: 261746034 time:1230170000001 ++++++ processing path for event:p ++++++++ module for event:demo %MSG-i Demo: DemoAnalyzer:demo 12-Mar-2013 19:52:50 CET Run: 1 Event: 261746034 number of tracks 1084 %MSG ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 9th record. Run 1, Event 19279341, LumiSection 64278 at 31-Dec-2015 01:22:45.121 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279341 time = 1396705000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279341 time = 1396705000001 ++++ starting: source event
 ++++finished: source event
Changed:
<
<
Begin processing the 10th record. Run 1, Event 261746035, LumiSection 872662 at 12-Mar-2013 19:52:50.079 CET ++++ processing event:run: 1 lumi: 872662 event: 261746035 time:1230175000001 ++++++ processing path for event:p ++++++++ module for event:demo ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++source event
>
>
Begin processing the 10th record. Run 1, Event 19279353, LumiSection 64278 at 31-Dec-2015 01:22:45.123 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279353 time = 1396765000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279353 time = 1396765000001 ++++ starting: source event ++++ finished: source event Begin processing the 11th record. Run 1, Event 19279354, LumiSection 64278 at 31-Dec-2015 01:22:45.126 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64278 event = 19279354 time = 1396770000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 %MSG-i Demo: DemoAnalyzer:demo 31-Dec-2015 01:22:45 CET Run: 1 Event: 19279354 number of tracks 1166 %MSG ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64278 event = 19279354 time = 1396770000001 ++++ starting: source event
 ++++finished: source event
Deleted:
<
<
Begin processing the 11th record. Run 1, Event 261746036, LumiSection 872662 at 12-Mar-2013 19:52:50.082 CET ++++ processing event:run: 1 lumi: 872662 event: 261746036 time:1230180000001 ++++++ processing path for event:p ++++++++ module for event:demo ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event:
  ...
Changed:
<
<
++++source event ++++finished: source event Begin processing the 50th record. Run 1, Event 261746142, LumiSection 872662 at 12-Mar-2013 19:52:50.251 CET ++++ processing event:run: 1 lumi: 872662 event: 261746142 time:1230710000001 ++++++ processing path for event:p ++++++++ module for event:demo ++++++++ finished for event:demo ++++++ finished path for event:p ++++++++ module for event:TriggerResults ++++++++ finished for event:TriggerResults ++++ finished event: ++++ processing end lumi:run: 1 luminosityBlock: 872662 time:1230005000001 ++++++ processing path for end lumi:p ++++++++ module for end lumi:demo ++++++++ finished for end lumi:demo ++++++ finished path for end lumi:p ++++++++ module for end lumi:TriggerResults ++++++++ finished for end lumi:TriggerResults ++++ finished end lumi: ++++ processing end run:run: 1 time:2500000000001 ++++++ processing path for end run:p ++++++++ module for end run:demo ++++++++ finished for end run:demo ++++++ finished path for end run:p ++++++++ module for end run:TriggerResults ++++++++ finished for end run:TriggerResults ++++ finished end run: ++++close input file 12-Mar-2013 19:52:50 CET Closed file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root ++++finished: close input file ++ endJob module:demo ++ endJob finished:demo ++ endJob module:TriggerResults ++ endJob finished:TriggerResults
>
>
Begin processing the 100th record. Run 1, Event 19280577, LumiSection 64282 at 31-Dec-2015 01:22:45.384 CET ++++ starting: processing event : stream = 0 run = 1 lumi = 64282 event = 19280577 time = 1402885000001 ++++++ starting: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ starting: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: delayed processing event for module: stream = 0 label = 'demo' id = 2 ++++++++ finished: processing event for module: stream = 0 label = 'demo' id = 2 ++++++ finished: processing path 'p' : stream = 0 ++++++++ starting: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++++++ finished: processing event for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: processing event : stream = 0 run = 1 lumi = 64282 event = 19280577 time = 1402885000001 ++++ starting: end lumi: stream = 0 run = 1 lumi = 64282 time = 1404000000001 ++++++ starting: end lumi for module: stream = 0 label = 'demo' id = 2 ++++++ finished: end lumi for module: stream = 0 label = 'demo' id = 2 ++++ finished: end lumi: stream = 0 run = 1 lumi = 64282 time = 1404000000001 ++++ starting: global end lumi: run = 1 lumi = 64282 time = 1402505000001 ++++++ starting: global end lumi for module: label = 'demo' id = 2 ++++++ finished: global end lumi for module: label = 'demo' id = 2 ++++++ starting: global end lumi for module: label = 'TriggerResults' id = 1 ++++++ finished: global end lumi for module: label = 'TriggerResults' id = 1 ++++ finished: global end lumi: run = 1 lumi = 64282 time = 1402505000001 ++++ starting: end run: stream = 0 run = 1 time = 2500000000001 ++++++ starting: end run for module: stream = 0 label = 'demo' id = 2 ++++++ finished: end run for module: stream = 0 label = 'demo' id = 2 ++++ finished: end run: stream = 0 run = 1 time = 2500000000001 ++++ starting: global end run 1 : time = 2500000000001 ++++++ starting: global end run for module: label = 'demo' id = 2 ++++++ finished: global end run for module: label = 'demo' id = 2 ++++++ starting: global end run for module: label = 'TriggerResults' id = 1 ++++++ finished: global end run for module: label = 'TriggerResults' id = 1 ++++ finished: global end run 1 : time = 2500000000001 ++++ starting: close input file: lfn = file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root 31-Dec-2015 01:22:45 CET Closed file file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root ++++ finished: close input file: lfn = file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root ++++ starting: end stream for module: stream = 0 label = 'demo' id = 2 ++++ finished: end stream for module: stream = 0 label = 'demo' id = 2 ++++ starting: end stream for module: stream = 0 label = 'TriggerResults' id = 1 ++++ finished: end stream for module: stream = 0 label = 'TriggerResults' id = 1 ++++ starting: end job for module with label 'demo' id = 2 ++++ finished: end job for module with label 'demo' id = 2 ++++ starting: end job for module with label 'TriggerResults' id = 1 ++++ finished: end job for module with label 'TriggerResults' id = 1
  TrigReport ---------- Event Summary ------------
Changed:
<
<
TrigReport Events total = 50 passed = 50 failed = 0
>
>
TrigReport Events total = 100 passed = 100 failed = 0
  TrigReport ---------- Path Summary ------------
Changed:
<
<
TrigReport Trig Bit# Run Passed Failed Error Name TrigReport 1 0 50 50 0 0 p
>
>
TrigReport Trig Bit# Executed Passed Failed Error Name TrigReport 1 0 100 100 0 0 p
  TrigReport -------End-Path Summary ------------
Changed:
<
<
TrigReport Trig Bit# Run Passed Failed Error Name
>
>
TrigReport Trig Bit# Executed Passed Failed Error Name
  TrigReport ---------- Modules in Path: p ------------ TrigReport Trig Bit# Visited Passed Failed Error Name
Changed:
<
<
TrigReport 1 0 50 50 0 0 demo
>
>
TrigReport 1 0 100 100 0 0 demo
  TrigReport ---------- Module Summary ------------
Changed:
<
<
TrigReport Visited Run Passed Failed Error Name TrigReport 50 50 50 0 0 demo TrigReport 50 50 50 0 0 TriggerResults
>
>
TrigReport Visited Executed Passed Failed Error Name TrigReport 100 100 100 0 0 demo TrigReport 100 100 100 0 0 TriggerResults
  TimeReport ---------- Event Summary ---[sec]----
Changed:
<
<
TimeReport CPU/event = 0.003100 Real/event = 0.003062

TimeReport ---------- Path Summary ---[sec]---- TimeReport per event per path-run TimeReport CPU Real CPU Real Name TimeReport 0.003040 0.003005 0.003040 0.003005 p TimeReport CPU Real CPU Real Name TimeReport per event per path-run

TimeReport -------End-Path Summary ---[sec]---- TimeReport per event per endpath-run TimeReport CPU Real CPU Real Name TimeReport CPU Real CPU Real Name TimeReport per event per endpath-run

TimeReport ---------- Modules in Path: p ---[sec]---- TimeReport per event per module-visit TimeReport CPU Real CPU Real Name TimeReport 0.003040 0.003002 0.003040 0.003002 demo TimeReport CPU Real CPU Real Name TimeReport per event per module-visit TimeReport CPU Real CPU Real Name TimeReport per event per module-visit

TimeReport ---------- Module Summary ---[sec]---- TimeReport per event per module-run per module-visit TimeReport CPU Real CPU Real CPU Real Name TimeReport 0.003040 0.003002 0.003040 0.003002 0.003040 0.003002 demo TimeReport 0.000060 0.000044 0.000060 0.000044 0.000060 0.000044 TriggerResults TimeReport CPU Real CPU Real CPU Real Name TimeReport per event per module-run per module-visit

>
>
TimeReport event loop CPU/event = 0.003727 TimeReport event loop Real/event = 0.003764 TimeReport sum Streams Real/event = 0.002747 TimeReport efficiency CPU/Real/thread = 0.990191

TimeReport ---------- Path Summary ---[Real sec]---- TimeReport per event per exec Name TimeReport 0.002073 0.002073 p TimeReport per event per exec Name

TimeReport -------End-Path Summary ---[Real sec]---- TimeReport per event per exec Name TimeReport per event per exec Name

TimeReport ---------- Modules in Path: p ---[Real sec]---- TimeReport per event per visit Name TimeReport 0.000135 0.000135 demo TimeReport per event per visit Name

TimeReport ---------- Module Summary ---[Real sec]---- TimeReport per event per exec per visit Name TimeReport 0.000020 0.000020 0.000020 TriggerResults TimeReport 0.000135 0.000135 0.000135 demo TimeReport per event per exec per visit Name

  T---Report end!
Changed:
<
<
++ Job ended
>
>
++ finished: end job
  =========================================
Line: 1505 to 1516
  type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- -----
Changed:
<
<
1 fileAction -s file_close 1 1 2 fileAction -s file_open 2 2
>
>
1 Tracer -s AfterBeginJob 1 1 2 Tracer -s AfterFile 1 1 3 Tracer -s AfterModConstruc 2 2 4 Tracer -s AfterModEndJob 1 1 5 Tracer -s AfterModGlobalBe 2 2 6 Tracer -s AfterModGlobalBe 1 1 7 Tracer -s AfterModGlobalEn 2 2 8 Tracer -s AfterModGlobalEn 1 1 9 Tracer -s AfterModStreamBe 2 2
  1. Tracer -s AfterModStreamBe 1 1
  2. Tracer -s AfterModStreamEn 2 2
  3. Tracer -s AfterModStreamEn 1 1
  4. Tracer -s DemoAnalyzer:dem 400 400
  5. Tracer -s DemoAnalyzer:dem 2 2
  6. Tracer -s DemoAnalyzer:dem 4 4
  7. Tracer -s DemoAnalyzer:dem 2 2
  8. Tracer -s DemoAnalyzer:dem 2 2
  9. Tracer -s DemoAnalyzer:dem 2 2
  10. Tracer -s DemoAnalyzer:dem 2 2
  11. Tracer -s DemoAnalyzer:dem 4 4
  12. Tracer -s DemoAnalyzer:dem 2 2
  13. Tracer -s DemoAnalyzer:dem 2 2
  14. Tracer -s DemoAnalyzer:dem 4 4
  15. Tracer -s DemoAnalyzer:dem 2 2
  16. Tracer -s DemoAnalyzer:dem 4 4
  17. Tracer -s DemoAnalyzer:dem 2 2
  18. Tracer -s PoolSource:sourc 1 1
  19. Tracer -s PostModuleEvent 200 200
  20. Tracer -s PreBeginLumi 4 4
  21. Tracer -s PreBeginRun 2 2
  22. Tracer -s PreEndLumi 4 4
  23. Tracer -s PreEndRun 2 2
  24. Tracer -s PreEventProcessi 100 100
  25. Tracer -s PreProcPath p 100 100
  26. Tracer -s TriggerResultIns 200 200
  27. Tracer -s TriggerResultIns 2 2
  28. Tracer -s TriggerResultIns 4 4
  29. Tracer -s TriggerResultIns 2 2
  30. Tracer -s TriggerResultIns 2 2
  31. Tracer -s TriggerResultIns 2 2
  32. Tracer -s TriggerResultIns 2 2
  33. Tracer -s TriggerResultIns 4 4
  34. Tracer -s TriggerResultIns 2 2
  35. Tracer -s TriggerResultIns 2 2
  36. Tracer -s file_close 2 2
  37. Tracer -s file_open 2 2
  38. Tracer -s source 206 206
  39. fileAction -s file_close 1 1
  40. fileAction -s file_open 2 2
  type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ----------------
Changed:
<
<
1 fileAction PostEndRun 2 fileAction pre-events pre-events
>
>
1 Tracer BeforeEvents 2 Tracer pre-events 3 Tracer pre-events pre-events 4 Tracer PostEndRun 5 Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 6 Tracer Run: 1 7 Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 8 Tracer End Run: 1 9 Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642
  1. Tracer Run: 1
  2. Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642
  3. Tracer End Run: 1
  4. Tracer 1/19279309 1/19279309 1/19280577
  5. Tracer pre-events pre-events
  6. Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 Run: 1 Lumi: 642
  7. Tracer Run: 1 Run: 1
  8. Tracer BeforeEvents BeforeEvents
  9. Tracer pre-events pre-events
  10. Tracer PostEndRun PostEndRun
  11. Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 Run: 1 Lumi: 642
  12. Tracer End Run: 1 End Run: 1
  13. Tracer PostEndRun PostEndRun
  14. Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 Run: 1 Lumi: 642
  15. Tracer Run: 1 Run: 1
  16. Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 Run: 1 Lumi: 642
  17. Tracer End Run: 1 End Run: 1
  18. Tracer pre-events
  19. Tracer 1/19279309 1/19279309 1/19280577
  20. Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 Run: 1 Lumi: 642
  21. Tracer Run: 1 Run: 1
  22. Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 Run: 1 Lumi: 642
  23. Tracer End Run: 1 End Run: 1
  24. Tracer 1/19279309 1/19279311 1/19280577
  25. Tracer 1/19279309 1/19279311 1/19280577
  26. Tracer 1/19279309 1/19279309 1/19280577
  27. Tracer pre-events pre-events
  28. Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 Run: 1 Lumi: 642
  29. Tracer Run: 1 Run: 1
  30. Tracer BeforeEvents BeforeEvents
  31. Tracer pre-events pre-events
  32. Tracer PostEndRun PostEndRun
  33. Tracer Run: 1 Lumi: 642 Run: 1 Lumi: 642 Run: 1 Lumi: 642
  34. Tracer End Run: 1 End Run: 1
  35. Tracer PostEndRun PostEndRun
  36. Tracer PostEndRun PostEndRun
  37. Tracer pre-events pre-events
  38. Tracer BeforeEvents BeforeEvents PostProcessEvent
  39. fileAction PostEndRun
  40. fileAction pre-events pre-events
  Severity # Occurrences Total Occurrences
------------- -----------------
Changed:
<
<
System 3 3
>
>
System 1299 1299
  </>
<--/twistyPlugin-->
Line: 1535 to 1640
 3. Make changes in the config file demoanalyzer_cfg.py and it should like this demoanalyzer_cfg.py
Changed:
<
<
Then do scram b and run it by doing cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
>
>
Then do scram b and run it by doing cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
  You will see that now you have a root file called histodemo.root. Open this root file and you will see a histogram showing number of tracks in 200 events over which you ran. The plot looks like this:
Line: 1560 to 1665
 cd HistoAnalyzer scram b
Changed:
<
<
Change the data file to 'file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root' in histoanalyzer_cfg.py that we were already using in demoanalyzer_cfg.py
>
>
Change the data file to 'file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root' in histoanalyzer_cfg.py that we were already using in ConfFile_cfg.py
 and change 'ctfWithMaterialTracks' to 'generalTracks' by commenting out as follows

%SYNTAX{ syntax="python"}%

Revision 52015-12-30 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Line: 59 to 59
 

Set up your Environment

If you are working at Fermilab's cmslpc cluster you need to execute the following command before you start
Added:
>
>
#bash users
source /cvmfs/cms.cern.ch/cmsset_default.sh
#or
#tcsh users:
source /cvmfs/cms.cern.ch/cmsset_default.csh
 At CERN, you can login directly to lxplus.cern.ch
<--STARTWORKBOOK-->

Line: 146 to 155
  Run the job
Changed:
<
<
cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
>
>
cmsRun python/ConfFile_cfg.py or
  cd ../..
  cmsRun Demo/DemoAnalyzer/python/ConfFile_cfg.py
 

You should see something like this (click on Show result below):

Line: 200 to 214
 
<--/twistyPlugin twikiMakeVisibleInline-->
Changed:
<
<
If you are using CMSSW version X and you are using the data file that is processed with CMSSW version Y, make sure that Y < X. For more info on how to look for data in DAS look at WorkBookLocatingDataSamples. Also BEFORE you run, make sure the data file you want to read actually exists. Every file in mass storage has a unique Logical File Name (LFN). The list of LFNs for all files in a specified dataset can be obtained from DAS. An example would be /store/data/Run2012B/SingleMu/AOD/PromptReco-v1/000/195/913/F2FCA13F-C0B3-E111-B906-001D09F25479.root. There is a mapping between the LFN of a file and its Physical File Name (PFN). The PFN of a file differs from site to site, unlike the LFN. To obtain the PFN of a file from its LFN, use the edmFileUtil command.
>
>
If you are using CMSSW version X and you are using the data file that is processed with CMSSW version Y, make sure that Y < X. For more info on how to look for data in DAS look at WorkBookLocatingDataSamples. Also BEFORE you run, make sure the data file you want to read actually exists. Every file in mass storage has a unique Logical File Name (LFN). The list of LFNs for all files in a specified dataset can be obtained from DAS. An example would be /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root. There is a mapping between the LFN of a file and its Physical File Name (PFN). The PFN of a file differs from site to site, unlike the LFN. To obtain the PFN of a file from its LFN, use the edmFileUtil command.
  On lxplus:
Added:
>
>
[lxplus402 @ ~/workbook/MYDEMOANALYZER/7_4_15/src/Demo/DemoAnalyzer]$  edmFileUtil -d  /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root
root://eoscms.cern.ch//eos/cms/store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root

 

On cmslpc:


Added:
>
>
[jstupak@cmslpc35 DemoAnalyzer]$ edmFileUtil -d /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root root://cmsxrootd-site.fnal.gov//store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root On lxplus, use the eos ls command and the LFN to verify that a file exists in mass storage:
 
Added:
>
>
[lxplus402 @ ~/workbook/MYDEMOANALYZER/7_4_15/src/Demo/DemoAnalyzer]$  eos ls -l /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root
-rw-r--r--   2 phedex   zh          418309738 Oct 16 15:52 6CA1C627-246C-E511-8A6A-02163E014147.root

On cmslpc, use the ls -l /eos/uscms command and the LFN to verify that a file exists in mass storage:

 
Changed:
<
<
Sometimes one may want to copy the entire file in the local Demo/DemoAnalyzer/ directory. Remember these files are big so this is not recommended. But, just as a reminder, before you copy the file make sure that data file exists. If the data file is absent try another one by searching in DAS. To copy a datafile on lxplus and cmslpc to your local working directory, in both cases the PFN is used. On lxplus, use the rfcp command:
>
>
[jstupak@cmslpc35 DemoAnalyzer]$ ls -l /eos/uscms/store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root
-rw-r--r-- 1 cmsprod us_cms 418309738 Dec  2 16:41 /eos/uscms/store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root

From any site with xrootd installed (cvmfs) use xrdfs with option stat in between both put the server site (output of edmFileUtil ) and last argument LFN to verify that a file exist in a given storage:

-bash-4.1$ xrdfs root://eoscms.cern.ch stat /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root
Path:   /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root
Id:     5764607523034286847
Size:   418309738
Flags:  16 (IsReadable)

-bash-4.1$ xrdfs root://cmsxrootd-site.fnal.gov stat /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root
Path:   /store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root
Id:     -3458764513820540908
Size:   418309738
Flags:  16 (IsReadable)

Sometimes one may want to copy the entire file in the local Demo/DemoAnalyzer/ directory. Remember these files are big so this is not recommended. But, just as a reminder, before you copy the file make sure that data file exists. If the data file is absent try another one by searching in DAS. To copy a datafile on lxplus and cmslpc to your local working directory, in both cases the PFN is used. On lxplus, use the xrdcp command:
 
Added:
>
>

xrdcp root://eoscms.cern.ch//eos/cms/store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root .
 
Added:
>
>
On cmslpc, use the cp /eos/uscms command and LFN:

cp /eos/uscms/store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v4/000/258/159/00000/6CA1C627-246C-E511-8A6A-02163E014147.root .
 In case you copy the file you will have to change in the configuration file fileNames parameter to point to the local copy. Since the data files are big, you may want to copy only a few events from the file, as explained in WorkBookDataSamples. If you DO NOT copy the data file to your working area, you can read it directly from mass storage.
<--/twistyPlugin-->

Revision 42015-12-30 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Line: 112 to 112
 We'll use a ROOT file as the data source when we run with this module. The data source is defined in the configuration file. For your convenience, there is already a data file processed in CMSSW_5_3_4, which is fully compatible with CMSSW_7_4_15 release, containing 100 events. It is located at /afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root.
Changed:
<
<
The mkedanlzr script has generated an example python configuration file demoanalyzer_cfg.py in the DemoAnalyzer directory. Open the file using your favorite text editor and change the data source file to as shown below.
>
>
The mkedanlzr script has generated an example python configuration file ConfFile_cfg.py in the DemoAnalyzer/python directory. Open the file using your favorite text editor and change the data source file to as shown below.
  And now the configuration file should read like this:

Revision 32015-12-29 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Line: 1568 to 1568
 %RESPONSIBLE% SudhirMalik
</>
<--/twistyPlugin-->

Added:
>
>
META FILEATTACHMENT attachment="tutorial.css" attr="" comment="" date="1451402887" name="tutorial.css" path="tutorial.css" size="258" user="eduardo" version="1"

Revision 22015-12-11 - eduardo

Line: 1 to 1
 
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5

Revision 12015-12-11 - eduardo

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WorkBook"

4.1.2 Writing your own EDAnalyzer

Complete: 5
Detailed Review status

Goals of this page:

You will learn the first steps of interacting with the CMS framework and how to write a module where you can put your analysis code.

Contents

Introduction

First, a few general words about analysis in the CMSSW framework. Physics analysis proceeds via a series of subsequent steps. Building blocks are identified and more complex objects are built on top of them. For instance, the Higgs search H -> ZZ -> µµµµ requires:
  • identifying muon candidates;
  • reconstructing Z candidates starting from muon candidates;
  • reconstructing Higgs candidates starting from Z candidates.
This process clearly identifies three products: muon candidates, Z candidates, and a Higgs candidate, as well as three processes to reconstruct them. These are well mapped into three Framework modules (EDProducers) that add into the Event three different products (the candidates collections).

Taking advantage of the modularity provided by the Framework for analysis enhances flexibility and allows separation of the analysis processes into single units that can be reused for different applications.

In this tutorial you will create (and later modify) a new EDAnalyzer module and a configuration file which will run it. You will create a configuration fragment include (cfi) file for the module, to contain the default values for its parameters. You will use the tracer to watch the processing.

<--

Task Formulation by the user

First, let's get an idea of the steps involved in creating and running a CMS analysis job on a local system.

The steps common to using a local or distributed computing system are: STARTWORKBOOK

  1. You, the user, must first determine what physics process to study, and what functionality the analysis requires.
  2. Determine the data set on which to run your analysis. You will specify it in terms of a physics abstraction, e.g., tier, run numbers, MC sample names, dates, and so on. The input file contents will determine how much processing you have to do so take a look at what is there for the tier you are accessing.
  3. Next, you will need to use C++ code to perform the analysis. You may be able to find appropriate existing code and edit it, or you may have to write your own, or some combination. You may choose to create an EDAnalyzer module to extract a particular signal from a series of events, or you may choose to create an EDProducer module which can perform the extraction and in addition can write the resulting product into the Event. This involves creating the parameter set that will be used to create instances of the new module or modules that will comprise your code.
  4. Determine the order of execution of the modules, if more than one module is used in the job.
-->

<--
STOPWORKBOOK
The next steps you must carry out are specific to running on your local system (and are different for GRID/batch processing) 
  1. Create your configuration file.
  2. Run your job -->

Set up your Environment

If you are working at Fermilab's cmslpc cluster you need to execute the following command before you start
   source /uscms/home/malik/cshrc prod
At CERN, you can login directly to lxplus.cern.ch
<--STARTWORKBOOK-->
 # make a your working directory 
   mkdir MYDEMOANALYZER
   cd MYDEMOANALYZER

# create a new project area
   cmsrel CMSSW_7_4_15 
   cd CMSSW_7_4_15/src/
   cmsenv

<-- 

Temporary Step for Now

This section is needed temporarily to tide over CMSSW_4_1_3. Soon the twiki will be updated to CMSSW_4_2_X and then this step is not needed. If you do not do this step then the BuildFile created as a consequence of mkedanlzr DemoAnalyzer in the next step would not be of the BuildFIle.xml which is the defult now.
 addpkg FWCore/Skeletons V01-01-01
 scram b
 rehash

-->

Write a Framework Module

First, create a subsystem area. The actual name used for the directory is not important, we'll use Demo. From the src directory, make and change to the Demo area:

mkdir Demo
cd Demo

Note that if you do not create the subsystem area and create you module directly under the src directory, your code will not compile. Create the "skeleton" of an EDAnalyzer module (see SWGuideSkeletonCodeGenerator for more information):

mkedanlzr DemoAnalyzer
<--STOPWORKBOOK-->
Compile the code:
cd DemoAnalyzer
scram b

We'll use a ROOT file as the data source when we run with this module. The data source is defined in the configuration file. For your convenience, there is already a data file processed in CMSSW_5_3_4, which is fully compatible with CMSSW_7_4_15 release, containing 100 events. It is located at /afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root.

The mkedanlzr script has generated an example python configuration file demoanalyzer_cfg.py in the DemoAnalyzer directory. Open the file using your favorite text editor and change the data source file to as shown below.

And now the configuration file should read like this:

<-- SyntaxHighlightingPlugin -->
import FWCore.ParameterSet.Config as cms

process = cms.Process("Demo")

process.load("FWCore.MessageService.MessageLogger_cfi")

process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )

process.source = cms.Source("PoolSource",
                                # replace 'myfile.root' with the source file you want to use
                                fileNames = cms.untracked.vstring(
            'file:/afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root'
                )
                            )

process.demo = cms.EDAnalyzer('DemoAnalyzer'
                              )


process.p = cms.Path(process.demo)

<-- end SyntaxHighlightingPlugin -->

Full documentation about the configuration language is in SWGuideAboutPythonConfigFile.

Run the job

  cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py

You should see something like this (click on Show result below):

<--/twistyPlugin twikiMakeVisibleInline-->

[lxplus402 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$  cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
11-Mar-2013 02:11:38 CET  Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
11-Mar-2013 02:11:45 CET  Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 11-Mar-2013 02:11:46.878 CET
Begin processing the 2nd record. Run 1, Event 261746009, LumiSection 872662 at 11-Mar-2013 02:11:46.879 CET
Begin processing the 3rd record. Run 1, Event 261746010, LumiSection 872662 at 11-Mar-2013 02:11:46.880 CET

...

Begin processing the 48th record. Run 1, Event 261746140, LumiSection 872662 at 11-Mar-2013 02:11:47.320 CET
Begin processing the 49th record. Run 1, Event 261746141, LumiSection 872662 at 11-Mar-2013 02:11:47.320 CET
Begin processing the 50th record. Run 1, Event 261746142, LumiSection 872662 at 11-Mar-2013 02:11:47.321 CET
11-Mar-2013 02:11:47 CET  Closed file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root

=============================================

MessageLogger Summary

 type     category        sev    module        subroutine        count    total
 ---- -------------------- -- ---------------- ----------------  -----    -----
    1 fileAction           -s file_close                             1        1
    2 fileAction           -s file_open                              2        2

 type    category    Examples: run/evt        run/evt          run/evt
 ---- -------------------- ---------------- ---------------- ----------------
    1 fileAction           PostEndRun                        
    2 fileAction           pre-events       pre-events       

Severity    # Occurrences   Total Occurrences
--------    -------------   -----------------
System                  3                   3


<--/twistyPlugin-->

Take notice that at this point, no action has been yet required in the new framework module - no output nor root files will be produced.

NOTE: You may want to run your analyzer on a data file of your choice instead of the one above.

<--/twistyPlugin twikiMakeVisibleInline-->
If you are using CMSSW version X and you are using the data file that is processed with CMSSW version Y, make sure that Y < X. For more info on how to look for data in DAS look at WorkBookLocatingDataSamples. Also BEFORE you run, make sure the data file you want to read actually exists. Every file in mass storage has a unique Logical File Name (LFN). The list of LFNs for all files in a specified dataset can be obtained from DAS. An example would be /store/data/Run2012B/SingleMu/AOD/PromptReco-v1/000/195/913/F2FCA13F-C0B3-E111-B906-001D09F25479.root. There is a mapping between the LFN of a file and its Physical File Name (PFN). The PFN of a file differs from site to site, unlike the LFN. To obtain the PFN of a file from its LFN, use the edmFileUtil command.

On lxplus:

[lxplus402 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src/Demo/DemoAnalyzer]$  edmFileUtil -d /store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root
root://eoscms//eos/cms/store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root?svcClass=default

On cmslpc:

[jstupak@cmslpc35 DemoAnalyzer]$ edmFileUtil -d /store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root
dcap://cmsdca1.fnal.gov:24140/pnfs/fnal.gov/usr/cms/WAX/11/store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root

On lxplus, use the cmsLs command and the LFN to verify that a file exists in mass storage:

[lxplus402 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src/Demo/DemoAnalyzer]$  cmsLs /store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root
-r--(016)   3587067458 2012-12-21 02:35:24 /store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root

On cmslpc, use the dcls command and the PFN to verify that a file exists in mass storage:

[jstupak@cmslpc35 DemoAnalyzer]$ dcls dcap://cmsdca1.fnal.gov:24140/pnfs/fnal.gov/usr/cms/WAX/11/store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root
dcap://cmsdca1.fnal.gov:24140/pnfs/fnal.gov/usr/cms/WAX/11/store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root

Sometimes one may want to copy the entire file in the local Demo/DemoAnalyzer/ directory. Remember these files are big so this is not recommended. But, just as a reminder, before you copy the file make sure that data file exists. If the data file is absent try another one by searching in DAS. To copy a datafile on lxplus and cmslpc to your local working directory, in both cases the PFN is used. On lxplus, use the rfcp command:

rfcp root://eoscms//eos/cms/store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root?svcClass=default .

On cmslpc, use the dccp command:

/opt/d-cache/dcap/bin/dccp dcap://cmsdca1.fnal.gov:24140/pnfs/fnal.gov/usr/cms/WAX/11/store/data/Run2012B/SingleMu/AOD/13Jul2012-v1/0004/FEF0EFBC-CCD6-E111-8D75-001E4F3F28D8.root .

In case you copy the file you will have to change in the configuration file fileNames parameter to point to the local copy. Since the data files are big, you may want to copy only a few events from the file, as explained in WorkBookDataSamples. If you DO NOT copy the data file to your working area, you can read it directly from mass storage.

<--/twistyPlugin-->

Get tracks from the Event

Demo/DemoAnalyzer/src/DemoAnalyzer.cc is the place to put your analysis code. In this example, we only add very simple statement printing the number of tracks.

Edit Demo/DemoAnalyzer/BuildFile.xml: so that it looks like this

<-- SyntaxHighlightingPlugin -->
<use name="FWCore/Framework"/>
<use name="FWCore/PluginManager"/>
<use name="FWCore/ParameterSet"/>
<use name="DataFormats/TrackReco"/>
<use name="CommonTools/UtilAlgos"/>
<flags EDM_PLUGIN="1"/>
<-- end SyntaxHighlightingPlugin -->

More on information on the structure of a typical BuildFile.xml can be found on WorkBookBuildFilesIntro.

Edit Demo/DemoAnalyzer/src/DemoAnalyzer.cc:

  • Add the following include statements (together with the other include statements):

<-- SyntaxHighlightingPlugin -->
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
<-- end SyntaxHighlightingPlugin -->

  • Edit the method analyze which starts with

<-- SyntaxHighlightingPlugin -->
DemoAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
<-- end SyntaxHighlightingPlugin -->
and put the following lines below using namespace edm;

<-- SyntaxHighlightingPlugin -->
Handle<reco::TrackCollection> tracks;
iEvent.getByLabel("generalTracks", tracks); 
LogInfo("Demo") << "number of tracks "<<tracks->size();
<-- end SyntaxHighlightingPlugin -->

To see how to access data from a triggered or simulated physics event look at SWGuideEDMGetDataFromEvent.

To know what other collections (besides TrackCollection of reconstructed objects are available, you can have a look to SWGuideRecoDataTable.

<--/twistyPlugin twikiMakeVisibleInline-->
Hold on, I have a question: if I want to add my own stuff in the analyzer, how am I supposed to know what header file to include and what to add to the BuildFile.xml?

<--/twistyPlugin twikiMakeVisibleInline-->
In this case, we want to add tracks. The tracks are part of event content. The event content can be found in SWGuideRecoDataTable. If you looking for tracks, you will find generalTracks in the table, and its collection name which you will need in the code as shown above. If you follow the link to the collection name, you will find the class documentation of the object. You will see that its header file is "DataFormats/TrackReco/interface/Track.h" and you will need to include it in your analyzer. As it resides in DataFormats/TrackReco package you will need to add it to your BuildFile.xml.

Warning, important: Many links in SWGuideRecoDataTable point to a non-existing version in the class documentation. We are working to fix it.

<--/twistyPlugin-->
<--/twistyPlugin-->

To print out the information that we added in the analyzer, we need to replace the line process.load("FWCore.MessageService.MessageLogger_cfi")) in file demoanalyzer_cfg.py with the segment below

<-- SyntaxHighlightingPlugin -->
# initialize MessageLogger and output report
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.threshold = 'INFO'
process.MessageLogger.categories.append('Demo')
process.MessageLogger.cerr.INFO = cms.untracked.PSet(
    limit = cms.untracked.int32(-1)
)
process.options   = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
<-- end SyntaxHighlightingPlugin -->

More information on the MessageLogger can be found on SWGuideMessageLogger.

Now, compile the code and run the job again:

 
scram b
cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py

The output should look something like this:

<--/twistyPlugin twikiMakeVisibleInline-->
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$  cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
12-Mar-2013 18:59:31 CET  Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
12-Mar-2013 18:59:36 CET  Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 18:59:36 CET  pre-events
no dictionary for class pair<edm::IndexIntoFile::IndexRunKey,Long64_t> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 18:59:36 CET  pre-events
no dictionary for class pair<edm::IndexIntoFile::IndexRunLumiKey,Long64_t> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 18:59:36 CET  pre-events
no dictionary for class pair<edm::BranchKey,edm::ConstBranchDescription> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 18:59:36 CET  pre-events
no dictionary for class pair<edm::BranchID,unsigned int> is available
%MSG
Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 12-Mar-2013 18:59:37.193 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 18:59:37 CET Run: 1 Event: 261746003
number of tracks 1211
%MSG
Begin processing the 2nd record. Run 1, Event 261746009, LumiSection 872662 at 12-Mar-2013 18:59:37.203 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 18:59:37 CET Run: 1 Event: 261746009
number of tracks 781
%MSG
Begin processing the 3rd record. Run 1, Event 261746010, LumiSection 872662 at 12-Mar-2013 18:59:37.206 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 18:59:37 CET Run: 1 Event: 261746010
number of tracks 1535

...

%MSG
Begin processing the 48th record. Run 1, Event 261746140, LumiSection 872662 at 12-Mar-2013 18:59:38.129 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 18:59:38 CET Run: 1 Event: 261746140
number of tracks 544
%MSG
Begin processing the 49th record. Run 1, Event 261746141, LumiSection 872662 at 12-Mar-2013 18:59:38.134 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 18:59:38 CET Run: 1 Event: 261746141
number of tracks 662
%MSG
Begin processing the 50th record. Run 1, Event 261746142, LumiSection 872662 at 12-Mar-2013 18:59:38.135 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 18:59:38 CET Run: 1 Event: 261746142
number of tracks 947
%MSG
12-Mar-2013 18:59:38 CET  Closed file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root

TrigReport ---------- Event  Summary ------------
TrigReport Events total = 50 passed = 50 failed = 0

TrigReport ---------- Path   Summary ------------
TrigReport  Trig Bit#        Run     Passed     Failed      Error Name
TrigReport     1    0         50         50          0          0 p

TrigReport -------End-Path   Summary ------------
TrigReport  Trig Bit#        Run     Passed     Failed      Error Name

TrigReport ---------- Modules in Path: p ------------
TrigReport  Trig Bit#    Visited     Passed     Failed      Error Name
TrigReport     1    0         50         50          0          0 demo

TrigReport ---------- Module Summary ------------
TrigReport    Visited        Run     Passed     Failed      Error Name
TrigReport         50         50         50          0          0 demo
TrigReport         50         50         50          0          0 TriggerResults

TimeReport ---------- Event  Summary ---[sec]----
TimeReport CPU/event = 0.002820 Real/event = 0.002912

TimeReport ---------- Path   Summary ---[sec]----
TimeReport             per event          per path-run 
TimeReport        CPU       Real        CPU       Real Name
TimeReport   0.002800   0.002883   0.002800   0.002883 p
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event          per path-run 

TimeReport -------End-Path   Summary ---[sec]----
TimeReport             per event       per endpath-run 
TimeReport        CPU       Real        CPU       Real Name
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event       per endpath-run 

TimeReport ---------- Modules in Path: p ---[sec]----
TimeReport             per event      per module-visit 
TimeReport        CPU       Real        CPU       Real Name
TimeReport   0.002800   0.002881   0.002800   0.002881 demo
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event      per module-visit 
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event      per module-visit 

TimeReport ---------- Module Summary ---[sec]----
TimeReport             per event        per module-run      per module-visit 
TimeReport        CPU       Real        CPU       Real        CPU       Real Name
TimeReport   0.002800   0.002881   0.002800   0.002881   0.002800   0.002881 demo
TimeReport   0.000020   0.000025   0.000020   0.000025   0.000020   0.000025 TriggerResults
TimeReport        CPU       Real        CPU       Real        CPU       Real Name
TimeReport             per event        per module-run      per module-visit 

T---Report end!


=============================================

MessageLogger Summary

 type     category        sev    module        subroutine        count    total
 ---- -------------------- -- ---------------- ----------------  -----    -----
    1 fileAction           -s file_close                             1        1
    2 fileAction           -s file_open                              2        2

 type    category    Examples: run/evt        run/evt          run/evt
 ---- -------------------- ---------------- ---------------- ----------------
    1 fileAction           PostEndRun                        
    2 fileAction           pre-events       pre-events       

Severity    # Occurrences   Total Occurrences
--------    -------------   -----------------
System                  3                   3

<--/twistyPlugin-->

Add parameters to our module

In this section, we determine the minimum number of tracks for an event to be displayed, and make it so we can change this number in the config and not need to recompile.

  • Edit the Demo/DemoAnalyzer/src/DemoAnalyzer.cc file. Add a new member data line to the DemoAnalyzer class:

<-- SyntaxHighlightingPlugin -->
private:
// ----------member data ---------------------------
unsigned int minTracks_;
<-- end SyntaxHighlightingPlugin -->

  • Edit the constructor

<-- SyntaxHighlightingPlugin -->
DemoAnalyzer::DemoAnalyzer(const edm::ParameterSet& iConfig)
{
   //now do what ever initialization is needed
}
<-- end SyntaxHighlightingPlugin -->

to set the value of minTracks_ from a parameter. It should look like this (Note ":" colon at the end of .....iConfig))

<-- SyntaxHighlightingPlugin -->
DemoAnalyzer::DemoAnalyzer(const edm::ParameterSet& iConfig) :
minTracks_(iConfig.getUntrackedParameter<unsigned int>("minTracks",0))
{
   //now do what ever initialization is needed
}
<-- end SyntaxHighlightingPlugin -->
  • Edit the

<-- SyntaxHighlightingPlugin -->
DemoAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
<-- end SyntaxHighlightingPlugin -->
method to use minTracks_ to decide when to print the number of tracks:

<-- SyntaxHighlightingPlugin -->
if( minTracks_ <= tracks->size() ) {
   LogInfo("Demo") << "number of tracks "<<tracks->size();
}
<-- end SyntaxHighlightingPlugin -->

So now this segment will look like this( Note: the first LogInfo("Demo").... has been commented, since now we want "number of tracks" to be printed only if minTracks_ is greater than a certain number as you will see below)

<-- SyntaxHighlightingPlugin -->
DemoAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
{
   using namespace edm;
  
     Handle<reco::TrackCollection> tracks;
     iEvent.getByLabel("generalTracks", tracks);
     //LogInfo("Demo") << "number of tracks "<<tracks->size();

     if( minTracks_ <= tracks->size() ) {
        LogInfo("Demo") << "number of tracks "<<tracks->size();
     }

#ifdef THIS_IS_AN_EVENT_EXAMPLE
   Handle<ExampleData> pIn;
   iEvent.getByLabel("example",pIn);
#endif

#ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
   ESHandle<SetupData> pSetup;
   iSetup.get<SetupRecord>().get(pSetup);
#endif
}
<-- end SyntaxHighlightingPlugin -->

Also to see if actually minTracks_ gets used, replace the line process.demo = cms.EDAnalyzer('DemoAnalyzer' ) in demoanalyzer_cfg.py by the segment below to use a value of say minTracks_ = 1000 .

<-- SyntaxHighlightingPlugin -->
process.demo = cms.EDAnalyzer('DemoAnalyzer',
           minTracks = cms.untracked.uint32(1000)
         )
<-- end SyntaxHighlightingPlugin -->

  • Compile the code.
     scram b
    
NOTE: whenever you make changes in the code of your analyzer you have to do scram b

  • Run the job.
    cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
    

The output should be something like this (Only events with tracks greater than 1000 get printed). Click here:

<--/twistyPlugin twikiMakeVisibleInline-->
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$  cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
12-Mar-2013 19:12:58 CET  Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
12-Mar-2013 19:13:03 CET  Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:13:03 CET  pre-events
no dictionary for class pair<edm::IndexIntoFile::IndexRunKey,Long64_t> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:13:03 CET  pre-events
no dictionary for class pair<edm::IndexIntoFile::IndexRunLumiKey,Long64_t> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:13:03 CET  pre-events
no dictionary for class pair<edm::BranchKey,edm::ConstBranchDescription> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:13:03 CET  pre-events
no dictionary for class pair<edm::BranchID,unsigned int> is available
%MSG
Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 12-Mar-2013 19:13:05.970 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 19:13:05 CET Run: 1 Event: 261746003
number of tracks 1211
%MSG
Begin processing the 2nd record. Run 1, Event 261746009, LumiSection 872662 at 12-Mar-2013 19:13:05.982 CET
Begin processing the 3rd record. Run 1, Event 261746010, LumiSection 872662 at 12-Mar-2013 19:13:05.985 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 19:13:05 CET Run: 1 Event: 261746010
number of tracks 1535
%MSG
Begin processing the 4th record. Run 1, Event 261746019, LumiSection 872662 at 12-Mar-2013 19:13:05.990 CET
Begin processing the 5th record. Run 1, Event 261746021, LumiSection 872662 at 12-Mar-2013 19:13:05.993 CET
Begin processing the 6th record. Run 1, Event 261746029, LumiSection 872662 at 12-Mar-2013 19:13:05.996 CET
Begin processing the 7th record. Run 1, Event 261746030, LumiSection 872662 at 12-Mar-2013 19:13:05.998 CET
Begin processing the 8th record. Run 1, Event 261746031, LumiSection 872662 at 12-Mar-2013 19:13:06.001 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 19:13:06 CET Run: 1 Event: 261746031
number of tracks 1350

...

<--/twistyPlugin-->

A look at demoanalyzer_cfi.py file

There is file named demoanalyzer_cfi.py in the Demo/DemoAnalyzer/python directory. A _cfi.py file contains default values of all the required parameters of a package. Rather than setting all the analyzer (we also call it module) parameters in your demoanalyzer_cfg.py file, one can define all of them in the demoanalyzer_cfi.py file. These parameters can then be reset (or overridden) by giving them a value you want in demoanalyzer_cfg.py. However, you will have to include demoanalyzer_cfi.py in demoanalyzer_cfg.py.

To explain it more clearly, I can put the default value of minTracks=0 in demoanalyzer_cfi.py and override it to say minTracks=50 in demoanalyzer_cfg.py. Thus if there are, say 10 parameters defined with their default values in demoanalyzer_cfi.py and I want to change two of those to some other value, I can do that in demoanalyzer_cfg.py WITHOUT changing the file demoanalyzer_cfi.py that has default values.

The mkedanlzr script has created a demoanalyzer_cfi.py file in the python directory as mentioned above.

  • Add the newly created parameter minTracks and its default value to this demoanalyzer_cfi.py file so that it its content looks like this:

<-- SyntaxHighlightingPlugin -->
import FWCore.ParameterSet.Config as cms

demo = cms.EDAnalyzer('DemoAnalyzer',
           minTracks=cms.untracked.uint32(0)
)
<-- end SyntaxHighlightingPlugin -->

  • Edit the demoanalyzer_cfg.py file and REPLACE

<-- SyntaxHighlightingPlugin -->
process.demo = cms.EDAnalyzer('DemoAnalyzer',
           minTracks=cms.untracked.uint32(1000)
)  
<-- end SyntaxHighlightingPlugin -->

WITH (these are 2 different lines, so should be on seperate lines each

<-- SyntaxHighlightingPlugin -->
process.load("Demo.DemoAnalyzer.demoanalyzer_cfi")
process.demo.minTracks=1000
<-- end SyntaxHighlightingPlugin -->

Here we use the default parameter values, and reset only the minTracks parameter to a different value.

  • Rerun the job:
cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py

You will see the same output as before EXCEPT that now you are overriding the default value of minTracks=0 defined in demoanalyzer_cfi.py with a value you choose (in this case minTracks=1000) in demoanalyzer_cfg.py. In this case the file with default parameters demoanalyzer_cfi.py remains untouched.

See what is available in the Event

1. Edit the configuration file, demoanalyzer_cfg.py and add the EventContentAnalyzer module. The module EventContentAnalyzer dumps all products stored in an event to the screen. One can add it to the path as follows:

<-- SyntaxHighlightingPlugin -->
process.dump=cms.EDAnalyzer('EventContentAnalyzer')
<-- end SyntaxHighlightingPlugin -->

Also REPLACE the line (which should still be the last line)

<-- SyntaxHighlightingPlugin -->
process.p = cms.Path(process.demo)
<-- end SyntaxHighlightingPlugin -->

WITH

<-- SyntaxHighlightingPlugin -->
process.p = cms.Path(process.demo*process.dump)
<-- end SyntaxHighlightingPlugin -->

In this case you probably want to run over only one event, change the number of events to 1 ( default is -1 which means all events)

<-- SyntaxHighlightingPlugin -->
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
<-- end SyntaxHighlightingPlugin -->

2. Run the job.

cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
The output should be something like this:

<--/twistyPlugin twikiMakeVisibleInline-->
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$  cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
12-Mar-2013 19:40:13 CET  Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
12-Mar-2013 19:40:18 CET  Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:40:18 CET  pre-events
no dictionary for class pair<edm::IndexIntoFile::IndexRunKey,Long64_t> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:40:18 CET  pre-events
no dictionary for class pair<edm::IndexIntoFile::IndexRunLumiKey,Long64_t> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:40:18 CET  pre-events
no dictionary for class pair<edm::BranchKey,edm::ConstBranchDescription> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:40:18 CET  pre-events
no dictionary for class pair<edm::BranchID,unsigned int> is available
%MSG
Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 12-Mar-2013 19:40:19.560 CET
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 19:40:19 CET Run: 1 Event: 261746003
number of tracks 1211
%MSG

++Event     1 contains 695 products with friendlyClassName, moduleLabel, productInstanceName and processName:
++BeamSpotOnlines "scalersRawToDigi" "" "RECO" (productId = 4:1)
++CSCDetIdCSCALCTDigiMuonDigiCollection "hltMuonCSCDigis" "MuonCSCALCTDigi" "HLT" (productId = 3:2)
++CSCDetIdCSCCLCTDigiMuonDigiCollection "hltMuonCSCDigis" "MuonCSCCLCTDigi" "HLT" (productId = 3:4)

...

++triggerTriggerFilterObjectWithRefs "hltPFTau35Track" "" "HLT" (productId = 3:2722)
++triggerTriggerFilterObjectWithRefs "hltPFTau35TrackPt20" "" "HLT" (productId = 3:2723)
++triggerTriggerFilterObjectWithRefs "hltPFTau35TrackPt20LooseIso" "" "HLT" (productId = 3:2724)
++uintedmValueMap "muons" "cosmicsVeto" "RECO" (productId = 4:1021)
12-Mar-2013 19:40:19 CET  Closed file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root

Summary for key being the concatenation of friendlyClassName, moduleLabel, productInstanceName and processName
     1 occurrences of key BeamSpotOnlines + "scalersRawToDigi" + "" "RECO"
     1 occurrences of key CSCDetIdCSCALCTDigiMuonDigiCollection + "hltMuonCSCDigis" + "MuonCSCALCTDigi" "HLT"
     1 occurrences of key CSCDetIdCSCCLCTDigiMuonDigiCollection + "hltMuonCSCDigis" + "MuonCSCCLCTDigi" "HLT"

...

     1 occurrences of key triggerTriggerFilterObjectWithRefs + "hltPFTau35TrackPt20" + "" "HLT"
     1 occurrences of key triggerTriggerFilterObjectWithRefs + "hltPFTau35TrackPt20LooseIso" + "" "HLT"
     1 occurrences of key uintedmValueMap + "muons" + "cosmicsVeto" "RECO"

TrigReport ---------- Event  Summary ------------
TrigReport Events total = 1 passed = 1 failed = 0

TrigReport ---------- Path   Summary ------------
TrigReport  Trig Bit#        Run     Passed     Failed      Error Name
TrigReport     1    0          1          1          0          0 p

TrigReport -------End-Path   Summary ------------
TrigReport  Trig Bit#        Run     Passed     Failed      Error Name

TrigReport ---------- Modules in Path: p ------------
TrigReport  Trig Bit#    Visited     Passed     Failed      Error Name
TrigReport     1    0          1          1          0          0 demo
TrigReport     1    0          1          1          0          0 dump

TrigReport ---------- Module Summary ------------
TrigReport    Visited        Run     Passed     Failed      Error Name
TrigReport          1          1          1          0          0 demo
TrigReport          1          1          1          0          0 dump
TrigReport          1          1          1          0          0 TriggerResults

TimeReport ---------- Event  Summary ---[sec]----
TimeReport CPU/event = 0.044994 Real/event = 0.048325

TimeReport ---------- Path   Summary ---[sec]----
TimeReport             per event          per path-run 
TimeReport        CPU       Real        CPU       Real Name
TimeReport   0.044994   0.048223   0.044994   0.048223 p
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event          per path-run 

TimeReport -------End-Path   Summary ---[sec]----
TimeReport             per event       per endpath-run 
TimeReport        CPU       Real        CPU       Real Name
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event       per endpath-run 

TimeReport ---------- Modules in Path: p ---[sec]----
TimeReport             per event      per module-visit 
TimeReport        CPU       Real        CPU       Real Name
TimeReport   0.008999   0.009337   0.008999   0.009337 demo
TimeReport   0.035995   0.038878   0.035995   0.038878 dump
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event      per module-visit 
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event      per module-visit 

TimeReport ---------- Module Summary ---[sec]----
TimeReport             per event        per module-run      per module-visit 
TimeReport        CPU       Real        CPU       Real        CPU       Real Name
TimeReport   0.008999   0.009337   0.008999   0.009337   0.008999   0.009337 demo
TimeReport   0.035995   0.038878   0.035995   0.038878   0.035995   0.038878 dump
TimeReport   0.000000   0.000093   0.000000   0.000093   0.000000   0.000093 TriggerResults
TimeReport        CPU       Real        CPU       Real        CPU       Real Name
TimeReport             per event        per module-run      per module-visit 

T---Report end!


=============================================

MessageLogger Summary

 type     category        sev    module        subroutine        count    total
 ---- -------------------- -- ---------------- ----------------  -----    -----
    1 EventContent         -s EventContentAnal                     696      696
    2 EventContent         -s EventContentAnal                     696      696
    3 fileAction           -s file_close                             1        1
    4 fileAction           -s file_open                              2        2

 type    category    Examples: run/evt        run/evt          run/evt
 ---- -------------------- ---------------- ---------------- ----------------
    1 EventContent         1/261746003      1/261746003      1/261746003
    2 EventContent         PostEndRun       PostEndRun       PostEndRun
    3 fileAction           PostEndRun                        
    4 fileAction           pre-events       pre-events       

Severity    # Occurrences   Total Occurrences
--------    -------------   -----------------
System               1395                1395
<--/twistyPlugin-->

3. A different way of looking at the content of ROOT file is using the command line tool edmDumpEventContent. Compare that output with the result of the above example with the EventContentAnalyzer. So you would know what is available in your root file that you want to access.

To do this do:

edmDumpEventContent /afs/cern.ch/cms/Tutorials/TWIKI_DATA/TTJets_8TeV_53X.root

For example if your edmDumpEventContent looks like this:

<--/twistyPlugin twikiMakeVisibleInline-->
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$  edmDumpEventContent /afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root

Type                                  Module                      Label             Process   
----------------------------------------------------------------------------------------------
LHEEventProduct                       "source"                    ""                "LHE"     
GenEventInfoProduct                   "generator"                 ""                "SIM"     
edm::HepMCProduct                     "generator"                 ""                "SIM"     
edm::TriggerResults                   "TriggerResults"            ""                "SIM"     
vector<SimTrack>                      "g4SimHits"                 ""                "SIM"     
vector<SimVertex>                     "g4SimHits"                 ""                "SIM"     
vector<int>                           "genParticles"              ""                "SIM"     
vector<reco::GenJet>                  "ak5GenJets"                ""                "SIM"     
vector<reco::GenJet>                  "ak7GenJets"                ""                "SIM"     
vector<reco::GenJet>                  "iterativeCone5GenJets"     ""                "SIM"     
vector<reco::GenJet>                  "kt4GenJets"                ""                "SIM"     
vector<reco::GenJet>                  "kt6GenJets"                ""                "SIM"     
vector<reco::GenMET>                  "genMetCalo"                ""                "SIM"     
vector<reco::GenMET>                  "genMetCaloAndNonPrompt"    ""                "SIM"     
vector<reco::GenMET>                  "genMetTrue"                ""                "SIM"     
vector<reco::GenParticle>             "genParticles"              ""                "SIM"     
FEDRawDataCollection                  "rawDataCollector"          ""                "HLT"     
L1GlobalTriggerObjectMapRecord        "hltL1GtObjectMap"          ""                "HLT"     
L1GlobalTriggerReadoutRecord          "hltGtDigis"                ""                "HLT"     
L1MuGMTReadoutCollection              "hltGtDigis"                ""                "HLT"     
MuonDigiCollection<CSCDetId,CSCALCTDigi>    "hltMuonCSCDigis"           "MuonCSCALCTDigi"   "HLT"     
MuonDigiCollection<CSCDetId,CSCCLCTDigi>    "hltMuonCSCDigis"           "MuonCSCCLCTDigi"   "HLT"     
MuonDigiCollection<CSCDetId,CSCComparatorDigi>    "hltMuonCSCDigis"           "MuonCSCComparatorDigi"   "HLT"     
MuonDigiCollection<CSCDetId,CSCCorrelatedLCTDigi>    "hltMuonCSCDigis"           "MuonCSCCorrelatedLCTDigi"   "HLT"     
MuonDigiCollection<CSCDetId,CSCDCCFormatStatusDigi>    "hltMuonCSCDigis"           "MuonCSCDCCFormatStatusDigi"   "HLT"     
MuonDigiCollection<CSCDetId,CSCRPCDigi>    "hltMuonCSCDigis"           "MuonCSCRPCDigi"   "HLT"     
MuonDigiCollection<CSCDetId,CSCStripDigi>    "hltMuonCSCDigis"           "MuonCSCStripDigi"   "HLT"     
MuonDigiCollection<CSCDetId,CSCWireDigi>    "hltMuonCSCDigis"           "MuonCSCWireDigi"   "HLT"     
MuonDigiCollection<DTChamberId,DTLocalTrigger>    "hltMuonDTDigis"            ""                "HLT"     
MuonDigiCollection<DTLayerId,DTDigi>    "hltMuonDTDigis"            ""                "HLT"     
MuonDigiCollection<DTLayerId,DTDigiSimLink>    "simMuonDTDigis"            ""                "HLT"     
MuonDigiCollection<RPCDetId,RPCDigi>    "hltMuonRPCDigis"           ""                "HLT"     
RPCRawDataCounts                      "hltMuonRPCDigis"           ""                "HLT"     
double                                "hltAntiKT5CaloJets"        "rho"             "HLT"     
double                                "hltAntiKT5PFJets"          "rho"             "HLT"     
double                                "hltAntiKT5CaloJets"        "sigma"           "HLT"     
double                                "hltAntiKT5PFJets"          "sigma"           "HLT"     
edm::AssociationMap<edm::OneToMany<vector<L2MuonTrajectorySeed>,vector<L2MuonTrajectorySeed>,unsigned int> >    "hltL2Muons"                ""                "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL2Muons"                ""                "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL3MuonsIOHit"           ""                "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL3MuonsOIHit"           ""                "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL3MuonsOIState"         ""                "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL3TkTracksFromL2IOHit"   ""                "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL3TkTracksFromL2OIHit"   ""                "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL3TkTracksFromL2OIState"   ""                "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL3MuonsIOHit"           "L2Seeded"        "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL3MuonsOIHit"           "L2Seeded"        "HLT"     
edm::AssociationMap<edm::OneToOne<vector<Trajectory>,vector<reco::Track>,unsigned short> >    "hltL3MuonsOIState"         "L2Seeded"        "HLT"     
edm::AssociationMap<edm::OneToOne<vector<reco::Track>,vector<reco::Track>,unsigned int> >    "hltL2Muons"                ""                "HLT"     
edm::AssociationVector<edm::RefToBaseProd<reco::Jet>,vector<edm::RefVector<vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track> > >,edm::RefToBase<reco::Jet>,unsigned int,edm::helper::AssociationIdenticalKeyReference>    "hltPFTauJetTracksAssociator"   ""                "HLT"     
edm::DetSetVector<RPCDigiSimLink>     "simMuonRPCDigis"           "RPCDigiSimLink"   "HLT"     
edm::DetSetVector<StripDigiSimLink>    "simMuonCSCDigis"           "MuonCSCStripDigiSimLinks"   "HLT"     
edm::DetSetVector<StripDigiSimLink>    "simMuonCSCDigis"           "MuonCSCWireDigiSimLinks"   "HLT"     
edm::LazyGetter<SiStripCluster>       "hltSiStripRawToClustersFacility"   ""                "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL2Muons"                ""                "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL3MuonsIOHit"           ""                "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL3MuonsOIHit"           ""                "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL3MuonsOIState"         ""                "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL3TkTracksFromL2IOHit"   ""                "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL3TkTracksFromL2OIHit"   ""                "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL3TkTracksFromL2OIState"   ""                "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL3MuonsIOHit"           "L2Seeded"        "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL3MuonsOIHit"           "L2Seeded"        "HLT"     
edm::OwnVector<TrackingRecHit,edm::ClonePolicy<TrackingRecHit> >    "hltL3MuonsOIState"         "L2Seeded"        "HLT"     
edm::RangeMap<CSCDetId,edm::OwnVector<CSCRecHit2D,edm::ClonePolicy<CSCRecHit2D> >,edm::ClonePolicy<CSCRecHit2D> >    "hltCsc2DRecHits"           ""                "HLT"     
edm::RangeMap<CSCDetId,edm::OwnVector<CSCSegment,edm::ClonePolicy<CSCSegment> >,edm::ClonePolicy<CSCSegment> >    "hltCscSegments"            ""                "HLT"     
edm::RangeMap<DTChamberId,edm::OwnVector<DTRecSegment4D,edm::ClonePolicy<DTRecSegment4D> >,edm::ClonePolicy<DTRecSegment4D> >    "hltDt4DSegments"           ""                "HLT"     
edm::RangeMap<RPCDetId,edm::OwnVector<RPCRecHit,edm::ClonePolicy<RPCRecHit> >,edm::ClonePolicy<RPCRecHit> >    "hltRpcRecHits"             ""                "HLT"     
edm::RefVector<vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track> >    "hltBSoftMuonMu5L3"         ""                "HLT"     
edm::SortedCollection<CaloTower,edm::StrictWeakOrdering<CaloTower> >    "hltTowerMakerForAll"       ""                "HLT"     
edm::SortedCollection<CaloTower,edm::StrictWeakOrdering<CaloTower> >    "hltTowerMakerForMuons"     ""                "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltEcalRecHitAll"          "EcalRecHitsEB"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltEcalRecHitAll"          "EcalRecHitsEE"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaEtaEBUncalibrator"   "etaEcalRecHitsEB"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaEtaEEUncalibrator"   "etaEcalRecHitsEB"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaEtaRecHitsFilterEBonly"   "etaEcalRecHitsEB"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaEtaEBUncalibrator"   "etaEcalRecHitsEE"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaEtaEEUncalibrator"   "etaEcalRecHitsEE"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaEtaRecHitsFilterEEonly"   "etaEcalRecHitsEE"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaEtaRecHitsFilterEBonly"   "etaEcalRecHitsES"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaEtaRecHitsFilterEEonly"   "etaEcalRecHitsES"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPhiSymStream"       "phiSymEcalRecHitsEB"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPhiSymUncalibrator"   "phiSymEcalRecHitsEB"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPhiSymStream"       "phiSymEcalRecHitsEE"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPhiSymUncalibrator"   "phiSymEcalRecHitsEE"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPi0EBUncalibrator"   "pi0EcalRecHitsEB"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPi0EEUncalibrator"   "pi0EcalRecHitsEB"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPi0RecHitsFilterEBonly"   "pi0EcalRecHitsEB"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPi0EBUncalibrator"   "pi0EcalRecHitsEE"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPi0EEUncalibrator"   "pi0EcalRecHitsEE"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPi0RecHitsFilterEEonly"   "pi0EcalRecHitsEE"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPi0RecHitsFilterEBonly"   "pi0EcalRecHitsES"   "HLT"     
edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >    "hltAlCaPi0RecHitsFilterEEonly"   "pi0EcalRecHitsES"   "HLT"     
edm::SortedCollection<ZDCDataFrame,edm::StrictWeakOrdering<ZDCDataFrame> >    "simHcalUnsuppressedDigis"   ""                "HLT"     
edm::TriggerResults                   "TriggerResults"            ""                "HLT"     
edmNew::DetSetVector<SiPixelCluster>    "hltSiPixelClusters"        ""                "HLT"     
reco::BeamSpot                        "hltOnlineBeamSpot"         ""                "HLT"     
vector<DcsStatus>                     "hltScalersRawToDigi"       ""                "HLT"     
vector<L1MuGMTCand>                   "hltGtDigis"                ""                "HLT"     
vector<L2MuonTrajectorySeed>          "hltL2MuonSeeds"            ""                "HLT"     
vector<L3MuonTrajectorySeed>          "hltL3TrajSeedIOHit"        ""                "HLT"     
vector<L3MuonTrajectorySeed>          "hltL3TrajSeedOIHit"        ""                "HLT"     
vector<L3MuonTrajectorySeed>          "hltL3TrajSeedOIState"      ""                "HLT"     
vector<L3MuonTrajectorySeed>          "hltL3TrajectorySeed"       ""                "HLT"     
vector<LumiScalers>                   "hltScalersRawToDigi"       ""                "HLT"     
vector<PileupSummaryInfo>             "addPileupInfo"             ""                "HLT"     
vector<TrackCandidate>                "hltL3TrackCandidateFromL2IOHit"   ""                "HLT"     
vector<TrackCandidate>                "hltL3TrackCandidateFromL2OIHit"   ""                "HLT"     
vector<TrackCandidate>                "hltL3TrackCandidateFromL2OIState"   ""                "HLT"     
vector<double>                        "hltAntiKT5CaloJets"        "rhos"            "HLT"     
vector<double>                        "hltAntiKT5PFJets"          "rhos"            "HLT"     
vector<double>                        "hltAntiKT5CaloJets"        "sigmas"          "HLT"     
vector<double>                        "hltAntiKT5PFJets"          "sigmas"          "HLT"     
vector<l1extra::L1EmParticle>         "hltL1extraParticles"       "Isolated"        "HLT"     
vector<l1extra::L1EmParticle>         "hltL1extraParticles"       "NonIsolated"     "HLT"     
vector<l1extra::L1EtMissParticle>     "hltL1extraParticles"       "MET"             "HLT"     
vector<l1extra::L1EtMissParticle>     "hltL1extraParticles"       "MHT"             "HLT"     
vector<l1extra::L1HFRings>            "hltL1extraParticles"       ""                "HLT"     
vector<l1extra::L1JetParticle>        "hltL1extraParticles"       "Central"         "HLT"     
vector<l1extra::L1JetParticle>        "hltL1extraParticles"       "Forward"         "HLT"     
vector<l1extra::L1JetParticle>        "hltL1extraParticles"       "Tau"             "HLT"     
vector<l1extra::L1MuonParticle>       "hltL1extraParticles"       ""                "HLT"     
vector<reco::CaloJet>                 "hltAntiKT5CaloJets"        ""                "HLT"     
vector<reco::CaloJet>                 "hltCaloJetCorrected"       ""                "HLT"     
vector<reco::CaloJet>                 "hltCaloJetCorrectedRegional"   ""                "HLT"     
vector<reco::CaloJet>                 "hltL2TauJets"              ""                "HLT"     
vector<reco::CaloMET>                 "hltMet"                    ""                "HLT"     
vector<reco::Electron>                "hltPixelMatch3HitElectronsActivity"   ""                "HLT"     
vector<reco::Electron>                "hltPixelMatch3HitElectronsL1Seeded"   ""                "HLT"     
vector<reco::Electron>                "hltPixelMatchElectronsActivity"   ""                "HLT"     
vector<reco::Electron>                "hltPixelMatchElectronsL1Seeded"   ""                "HLT"     
vector<reco::IsolatedPixelTrackCandidate>    "hltHITIPTCorrectorHB"      ""                "HLT"     
vector<reco::IsolatedPixelTrackCandidate>    "hltHITIPTCorrectorHE"      ""                "HLT"     
vector<reco::IsolatedPixelTrackCandidate>    "hltIsolPixelTrackProdHB"   ""                "HLT"     
vector<reco::IsolatedPixelTrackCandidate>    "hltIsolPixelTrackProdHE"   ""                "HLT"     
vector<reco::MuonTrackLinks>          "hltL3MuonsIOHit"           ""                "HLT"     
vector<reco::MuonTrackLinks>          "hltL3MuonsLinksCombination"   ""                "HLT"     
vector<reco::MuonTrackLinks>          "hltL3MuonsOIHit"           ""                "HLT"     
vector<reco::MuonTrackLinks>          "hltL3MuonsOIState"         ""                "HLT"     
vector<reco::PFCandidate>             "hltParticleFlow"           ""                "HLT"     
vector<reco::PFCandidate>             "hltParticleFlow"           "AddedMuonsAndHadrons"   "HLT"     
vector<reco::PFCandidate>             "hltParticleFlow"           "CleanedCosmicsMuons"   "HLT"     
vector<reco::PFCandidate>             "hltParticleFlow"           "CleanedFakeMuons"   "HLT"     
vector<reco::PFCandidate>             "hltParticleFlow"           "CleanedHF"       "HLT"     
vector<reco::PFCandidate>             "hltParticleFlow"           "CleanedPunchThroughMuons"   "HLT"     
vector<reco::PFCandidate>             "hltParticleFlow"           "CleanedPunchThroughNeutralHadrons"   "HLT"     
vector<reco::PFCandidate>             "hltParticleFlow"           "CleanedTrackerAndGlobalMuons"   "HLT"     
vector<reco::PFJet>                   "hltAntiKT5PFJets"          ""                "HLT"     
vector<reco::PFTauTagInfo>            "hltPFTauTagInfo"           ""                "HLT"     
vector<reco::RecoChargedCandidate>    "hltL2MuonCandidates"       ""                "HLT"     
vector<reco::RecoChargedCandidate>    "hltL2MuonCandidatesNoVtx"   ""                "HLT"     
vector<reco::RecoChargedCandidate>    "hltL3MuonCandidates"       ""                "HLT"     
vector<reco::RecoChargedCandidate>    "hltMuTrackJpsiCtfTrackCands"   ""                "HLT"     
vector<reco::RecoChargedCandidate>    "hltMuTrackJpsiPixelTrackCands"   ""                "HLT"     
vector<reco::RecoEcalCandidate>       "hltL1SeededRecoEcalCandidate"   ""                "HLT"     
vector<reco::RecoEcalCandidate>       "hltRecoEcalSuperClusterActivityCandidate"   ""                "HLT"     
vector<reco::RecoEcalCandidate>       "hltRecoEcalSuperClusterActivityCandidateSC4"   ""                "HLT"     
vector<reco::Track>                   "hltL2Muons"                ""                "HLT"     
vector<reco::Track>                   "hltL3Muons"                ""                "HLT"     
vector<reco::Track>                   "hltL3MuonsIOHit"           ""                "HLT"     
vector<reco::Track>                   "hltL3MuonsOIHit"           ""                "HLT"     
vector<reco::Track>                   "hltL3MuonsOIState"         ""                "HLT"     
vector<reco::Track>                   "hltL3TkFromL2OICombination"   ""                "HLT"     
vector<reco::Track>                   "hltL3TkTracksFromL2"       ""                "HLT"     
vector<reco::Track>                   "hltL3TkTracksFromL2IOHit"   ""                "HLT"     
vector<reco::Track>                   "hltL3TkTracksFromL2OIHit"   ""                "HLT"     
vector<reco::Track>                   "hltL3TkTracksFromL2OIState"   ""                "HLT"     
vector<reco::Track>                   "hltL3MuonsIOHit"           "L2Seeded"        "HLT"     
vector<reco::Track>                   "hltL3MuonsOIHit"           "L2Seeded"        "HLT"     
vector<reco::Track>                   "hltL3MuonsOIState"         "L2Seeded"        "HLT"     
vector<reco::Track>                   "hltL2Muons"                "UpdatedAtVtx"    "HLT"     
vector<reco::TrackExtra>              "hltL2Muons"                ""                "HLT"     
vector<reco::TrackExtra>              "hltL3MuonsIOHit"           ""                "HLT"     
vector<reco::TrackExtra>              "hltL3MuonsOIHit"           ""                "HLT"     
vector<reco::TrackExtra>              "hltL3MuonsOIState"         ""                "HLT"     
vector<reco::TrackExtra>              "hltL3TkTracksFromL2IOHit"   ""                "HLT"     
vector<reco::TrackExtra>              "hltL3TkTracksFromL2OIHit"   ""                "HLT"     
vector<reco::TrackExtra>              "hltL3TkTracksFromL2OIState"   ""                "HLT"     
vector<reco::TrackExtra>              "hltL3MuonsIOHit"           "L2Seeded"        "HLT"     
vector<reco::TrackExtra>              "hltL3MuonsOIHit"           "L2Seeded"        "HLT"     
vector<reco::TrackExtra>              "hltL3MuonsOIState"         "L2Seeded"        "HLT"     
trigger::TriggerEvent                 "hltTriggerSummaryAOD"      ""                "HLT"     
trigger::TriggerEventWithRefs         "hltTriggerSummaryRAW"      ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltL1MatchedLooseIsoPFTau20"   ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltL1sDoubleTauJet44erorDoubleJetC64"   ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltL1sL1ETM36or40"         ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltL1sL1SingleEG12"        ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltL1sMu12Eta2p1ETM20"     ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltMu8Ele17CaloIdTCaloIsoVLPixelMatchFilter"   ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltOverlapFilterIsoEle20LooseIsoPFTau20L1Jet"   ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltPFTau20"                ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltPFTau20Track"           ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltPFTau20TrackLooseIso"   ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltPFTau35"                ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltPFTau35Track"           ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltPFTau35TrackPt20"       ""                "HLT"     
trigger::TriggerFilterObjectWithRefs   "hltPFTau35TrackPt20LooseIso"   ""                "HLT"     
EBDigiCollection                      "selectDigi"                "selectedEcalEBDigiCollection"   "RECO"    
EEDigiCollection                      "selectDigi"                "selectedEcalEEDigiCollection"   "RECO"    
EcalTrigPrimCompactColl               "ecalCompactTrigPrim"       ""                "RECO"    
HcalNoiseSummary                      "hcalnoise"                 ""                "RECO"    
L1GlobalTriggerObjectMaps             "l1L1GtObjectMap"           ""                "RECO"    
L1GlobalTriggerReadoutRecord          "gtDigis"                   ""                "RECO"    
L1MuGMTReadoutCollection              "gtDigis"                   ""                "RECO"    
double                                "fixedGridRhoAll"           ""                "RECO"    
double                                "fixedGridRhoFastjetAll"    ""                "RECO"    
double                                "ak5CaloJets"               "rho"             "RECO"    
double                                "ak5PFJets"                 "rho"             "RECO"    
double                                "ak5TrackJets"              "rho"             "RECO"    
double                                "ak7BasicJets"              "rho"             "RECO"    
double                                "ak7CaloJets"               "rho"             "RECO"    
double                                "ak7PFJets"                 "rho"             "RECO"    
double                                "iterativeCone5CaloJets"    "rho"             "RECO"    
double                                "iterativeCone5PFJets"      "rho"             "RECO"    
double                                "kt4CaloJets"               "rho"             "RECO"    
double                                "kt4PFJets"                 "rho"             "RECO"    
double                                "kt4TrackJets"              "rho"             "RECO"    
double                                "kt6CaloJets"               "rho"             "RECO"    
double                                "kt6CaloJetsCentral"        "rho"             "RECO"    
double                                "kt6PFJets"                 "rho"             "RECO"    
double                                "kt6PFJetsCentralChargedPileUp"   "rho"             "RECO"    
double                                "kt6PFJetsCentralNeutral"   "rho"             "RECO"    
double                                "kt6PFJetsCentralNeutralTight"   "rho"             "RECO"    
double                                "ak5CaloJets"               "sigma"           "RECO"    
double                                "ak5PFJets"                 "sigma"           "RECO"    
double                                "ak5TrackJets"              "sigma"           "RECO"    
double                                "ak7BasicJets"              "sigma"           "RECO"    
double                                "ak7CaloJets"               "sigma"           "RECO"    
double                                "ak7PFJets"                 "sigma"           "RECO"    
double                                "iterativeCone5CaloJets"    "sigma"           "RECO"    
double                                "iterativeCone5PFJets"      "sigma"           "RECO"    
double                                "kt4CaloJets"               "sigma"           "RECO"    
double                                "kt4PFJets"                 "sigma"           "RECO"    
double                                "kt4TrackJets"              "sigma"           "RECO"    
double                                "kt6CaloJets"               "sigma"           "RECO"    
double                                "kt6CaloJetsCentral"        "sigma"           "RECO"    
double                                "kt6PFJets"                 "sigma"           "RECO"    
double                                "kt6PFJetsCentralChargedPileUp"   "sigma"           "RECO"    
double                                "kt6PFJetsCentralNeutral"   "sigma"           "RECO"    
double                                "kt6PFJetsCentralNeutralTight"   "sigma"           "RECO"    
edm::AssociationMap<edm::OneToOne<vector<reco::SuperCluster>,vector<reco::HFEMClusterShape>,unsigned int> >    "hfEMClusters"              ""                "RECO"    

...

vector<reco::Track>                   "ckfInOutTracksFromConversions"   ""                "RECO"    
vector<reco::Track>                   "ckfOutInTracksFromConversions"   ""                "RECO"    
vector<reco::Track>                   "conversionStepTracks"      ""                "RECO"    
vector<reco::Track>                   "cosmicMuons"               ""                "RECO"    
vector<reco::Track>                   "cosmicMuons1Leg"           ""                "RECO"    
vector<reco::Track>                   "cosmicsVetoTracks"         ""                "RECO"    
vector<reco::Track>                   "generalTracks"             ""                "RECO"    
vector<reco::Track>                   "globalCosmicMuons"         ""                "RECO"    
vector<reco::Track>                   "globalCosmicMuons1Leg"     ""                "RECO"    
vector<reco::Track>                   "globalMuons"               ""                "RECO"    
vector<reco::Track>                   "globalSETMuons"            ""                "RECO"    
vector<reco::Track>                   "pixelTracks"               ""                "RECO"    
vector<reco::Track>                   "refittedStandAloneMuons"   ""                "RECO"    
vector<reco::Track>                   "regionalCosmicTracks"      ""                "RECO"    
vector<reco::Track>                   "standAloneMuons"           ""                "RECO"    
vector<reco::Track>                   "standAloneSETMuons"        ""                "RECO"    
vector<reco::Track>                   "uncleanedOnlyCkfInOutTracksFromConversions"   ""                "RECO"    
vector<reco::Track>                   "uncleanedOnlyCkfOutInTracksFromConversions"   ""                "RECO"    
vector<reco::Track>                   "refittedStandAloneMuons"   "UpdatedAtVtx"    "RECO"    
vector<reco::Track>                   "standAloneMuons"           "UpdatedAtVtx"    "RECO"    
vector<reco::Track>                   "standAloneSETMuons"        "UpdatedAtVtx"    "RECO"    
vector<reco::Track>                   "tevMuons"                  "default"         "RECO"    
vector<reco::Track>                   "tevMuons"                  "dyt"             "RECO"    
vector<reco::Track>                   "tevMuons"                  "firstHit"        "RECO"    
vector<reco::Track>                   "impactParameterTagInfos"   "ghostTracks"     "RECO"    
vector<reco::Track>                   "tevMuons"                  "picky"           "RECO"    
vector<reco::TrackExtra>              "ckfInOutTracksFromConversions"   ""                "RECO"    
vector<reco::TrackExtra>              "ckfOutInTracksFromConversions"   ""                "RECO"    
vector<reco::TrackExtra>              "conversionStepTracks"      ""                "RECO"    
vector<reco::TrackExtra>              "cosmicMuons"               ""                "RECO"    
vector<reco::TrackExtra>              "cosmicMuons1Leg"           ""                "RECO"    
vector<reco::TrackExtra>              "electronGsfTracks"         ""                "RECO"    
vector<reco::TrackExtra>              "generalTracks"             ""                "RECO"    
vector<reco::TrackExtra>              "globalCosmicMuons"         ""                "RECO"    
vector<reco::TrackExtra>              "globalCosmicMuons1Leg"     ""                "RECO"    
vector<reco::TrackExtra>              "globalMuons"               ""                "RECO"    
vector<reco::TrackExtra>              "globalSETMuons"            ""                "RECO"    
vector<reco::TrackExtra>              "pixelTracks"               ""                "RECO"    
vector<reco::TrackExtra>              "refittedStandAloneMuons"   ""                "RECO"    
vector<reco::TrackExtra>              "regionalCosmicTracks"      ""                "RECO"    
vector<reco::TrackExtra>              "standAloneMuons"           ""                "RECO"    
vector<reco::TrackExtra>              "standAloneSETMuons"        ""                "RECO"    
vector<reco::TrackExtra>              "uncleanedOnlyCkfInOutTracksFromConversions"   ""                "RECO"    
vector<reco::TrackExtra>              "uncleanedOnlyCkfOutInTracksFromConversions"   ""                "RECO"    
vector<reco::TrackExtra>              "tevMuons"                  "default"         "RECO"    
vector<reco::TrackExtra>              "tevMuons"                  "dyt"             "RECO"    
vector<reco::TrackExtra>              "tevMuons"                  "firstHit"        "RECO"    
vector<reco::TrackExtra>              "tevMuons"                  "picky"           "RECO"    
vector<reco::TrackExtrapolation>      "trackExtrapolator"         ""                "RECO"    
vector<reco::TrackIPTagInfo>          "impactParameterTagInfos"   ""                "RECO"    
vector<reco::TrackJet>                "ak5TrackJets"              ""                "RECO"    
vector<reco::TrackJet>                "kt4TrackJets"              ""                "RECO"    
vector<reco::Vertex>                  "offlinePrimaryVertices"    ""                "RECO"    
vector<reco::Vertex>                  "offlinePrimaryVerticesWithBS"   ""                "RECO"    
vector<reco::Vertex>                  "pixelVertices"             ""                "RECO"    
vector<reco::VertexCompositeCandidate>    "generalV0Candidates"       "Kshort"          "RECO"    
vector<reco::VertexCompositeCandidate>    "generalV0Candidates"       "Lambda"          "RECO"    

<--/twistyPlugin-->

and if you want to use "generalTracks" in your code (which we already did in the DemoAnalyzer.cc code above), you would do the following:

  Handle<reco::TrackCollection> tracks;
  iEvent.getByLabel("generalTracks", tracks); 

Watch the processing of a job

1. Edit the configuration file, demoanalyzer_cfg.py, and add the Tracer service ( just above the line process.p = cms.Path(process.demo*process.dump)) in demoanalyzer_cfg.py. This service identifies what module is called and when.

<-- SyntaxHighlightingPlugin -->
process.Tracer = cms.Service("Tracer")
<-- end SyntaxHighlightingPlugin -->

You can remove the module dump if you added it as explained above, and set maxEvents to -1 (run over all events in the file).

2. Run the job

cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py

The output should be something like this:

<--/twistyPlugin twikiMakeVisibleInline-->
[lxplus404 @ ~/workbook/MYDEMOANALYZER/CMSSW_5_3_5/src]$  cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py
++ constructing source:PoolSource
++++open input file
12-Mar-2013 19:52:44 CET  Initiating request to open file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
12-Mar-2013 19:52:49 CET  Successfully opened file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
++++finished: open input file
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:52:49 CET  pre-events
no dictionary for class pair<edm::IndexIntoFile::IndexRunKey,Long64_t> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:52:49 CET  pre-events
no dictionary for class pair<edm::IndexIntoFile::IndexRunLumiKey,Long64_t> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:52:49 CET  pre-events
no dictionary for class pair<edm::BranchKey,edm::ConstBranchDescription> is available
%MSG
%MSG-i Root_Information:  AfterFile TClass::TClass() 12-Mar-2013 19:52:49 CET  pre-events
no dictionary for class pair<edm::BranchID,unsigned int> is available
%MSG
++ construction finished:PoolSource
++ constructing module:demo
++ construction finished:demo
++ constructing module:TriggerResults
++ construction finished:TriggerResults
%MSG-i path:  AfterModConstruction 12-Mar-2013 19:52:49 CET pre-events
The following module labels are not assigned to any path:
'dump'

%MSG
++ beginJob module:demo
++ beginJob finished:demo
++ beginJob module:TriggerResults
++ beginJob finished:TriggerResults
++ Job started
++++source run
++++finished: source run
++++ processing begin run:run: 1 time:1
++++++ processing path for begin run:p
++++++++ module for begin run:demo
++++++++ finished for begin run:demo
++++++ finished path for begin run:p
++++++++ module for begin run:TriggerResults
++++++++ finished for begin run:TriggerResults
++++ finished begin run:
++++source lumi
++++finished: source lumi
++++ processing begin lumi:run: 1 luminosityBlock: 872662 time:1230005000001
++++++ processing path for begin lumi:p
++++++++ module for begin lumi:demo
++++++++ finished for begin lumi:demo
++++++ finished path for begin lumi:p
++++++++ module for begin lumi:TriggerResults
++++++++ finished for begin lumi:TriggerResults
++++ finished begin lumi:
++++source event
++++finished: source event
Begin processing the 1st record. Run 1, Event 261746003, LumiSection 872662 at 12-Mar-2013 19:52:50.041 CET
++++ processing event:run: 1 lumi: 872662 event: 261746003 time:1230015000001
++++++ processing path for event:p
++++++++ module for event:demo
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 19:52:50 CET Run: 1 Event: 261746003
number of tracks 1211
%MSG
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 2nd record. Run 1, Event 261746009, LumiSection 872662 at 12-Mar-2013 19:52:50.052 CET
++++ processing event:run: 1 lumi: 872662 event: 261746009 time:1230045000001
++++++ processing path for event:p
++++++++ module for event:demo
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 3rd record. Run 1, Event 261746010, LumiSection 872662 at 12-Mar-2013 19:52:50.055 CET
++++ processing event:run: 1 lumi: 872662 event: 261746010 time:1230050000001
++++++ processing path for event:p
++++++++ module for event:demo
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 19:52:50 CET Run: 1 Event: 261746010
number of tracks 1535
%MSG
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 4th record. Run 1, Event 261746019, LumiSection 872662 at 12-Mar-2013 19:52:50.060 CET
++++ processing event:run: 1 lumi: 872662 event: 261746019 time:1230095000001
++++++ processing path for event:p
++++++++ module for event:demo
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 5th record. Run 1, Event 261746021, LumiSection 872662 at 12-Mar-2013 19:52:50.063 CET
++++ processing event:run: 1 lumi: 872662 event: 261746021 time:1230105000001
++++++ processing path for event:p
++++++++ module for event:demo
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 6th record. Run 1, Event 261746029, LumiSection 872662 at 12-Mar-2013 19:52:50.066 CET
++++ processing event:run: 1 lumi: 872662 event: 261746029 time:1230145000001
++++++ processing path for event:p
++++++++ module for event:demo
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 7th record. Run 1, Event 261746030, LumiSection 872662 at 12-Mar-2013 19:52:50.068 CET
++++ processing event:run: 1 lumi: 872662 event: 261746030 time:1230150000001
++++++ processing path for event:p
++++++++ module for event:demo
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 8th record. Run 1, Event 261746031, LumiSection 872662 at 12-Mar-2013 19:52:50.071 CET
++++ processing event:run: 1 lumi: 872662 event: 261746031 time:1230155000001
++++++ processing path for event:p
++++++++ module for event:demo
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 19:52:50 CET Run: 1 Event: 261746031
number of tracks 1350
%MSG
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 9th record. Run 1, Event 261746034, LumiSection 872662 at 12-Mar-2013 19:52:50.075 CET
++++ processing event:run: 1 lumi: 872662 event: 261746034 time:1230170000001
++++++ processing path for event:p
++++++++ module for event:demo
%MSG-i Demo:  DemoAnalyzer:demo 12-Mar-2013 19:52:50 CET Run: 1 Event: 261746034
number of tracks 1084
%MSG
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 10th record. Run 1, Event 261746035, LumiSection 872662 at 12-Mar-2013 19:52:50.079 CET
++++ processing event:run: 1 lumi: 872662 event: 261746035 time:1230175000001
++++++ processing path for event:p
++++++++ module for event:demo
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++source event
++++finished: source event
Begin processing the 11th record. Run 1, Event 261746036, LumiSection 872662 at 12-Mar-2013 19:52:50.082 CET
++++ processing event:run: 1 lumi: 872662 event: 261746036 time:1230180000001
++++++ processing path for event:p
++++++++ module for event:demo
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:

...

++++source event
++++finished: source event
Begin processing the 50th record. Run 1, Event 261746142, LumiSection 872662 at 12-Mar-2013 19:52:50.251 CET
++++ processing event:run: 1 lumi: 872662 event: 261746142 time:1230710000001
++++++ processing path for event:p
++++++++ module for event:demo
++++++++ finished for event:demo
++++++ finished path for event:p
++++++++ module for event:TriggerResults
++++++++ finished for event:TriggerResults
++++ finished event:
++++ processing end lumi:run: 1 luminosityBlock: 872662 time:1230005000001
++++++ processing path for end lumi:p
++++++++ module for end lumi:demo
++++++++ finished for end lumi:demo
++++++ finished path for end lumi:p
++++++++ module for end lumi:TriggerResults
++++++++ finished for end lumi:TriggerResults
++++ finished end lumi:
++++ processing end run:run: 1 time:2500000000001
++++++ processing path for end run:p
++++++++ module for end run:demo
++++++++ finished for end run:demo
++++++ finished path for end run:p
++++++++ module for end run:TriggerResults
++++++++ finished for end run:TriggerResults
++++ finished end run:
++++close input file
12-Mar-2013 19:52:50 CET  Closed file file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root
++++finished: close input file
++ endJob module:demo
++ endJob finished:demo
++ endJob module:TriggerResults
++ endJob finished:TriggerResults

TrigReport ---------- Event  Summary ------------
TrigReport Events total = 50 passed = 50 failed = 0

TrigReport ---------- Path   Summary ------------
TrigReport  Trig Bit#        Run     Passed     Failed      Error Name
TrigReport     1    0         50         50          0          0 p

TrigReport -------End-Path   Summary ------------
TrigReport  Trig Bit#        Run     Passed     Failed      Error Name

TrigReport ---------- Modules in Path: p ------------
TrigReport  Trig Bit#    Visited     Passed     Failed      Error Name
TrigReport     1    0         50         50          0          0 demo

TrigReport ---------- Module Summary ------------
TrigReport    Visited        Run     Passed     Failed      Error Name
TrigReport         50         50         50          0          0 demo
TrigReport         50         50         50          0          0 TriggerResults

TimeReport ---------- Event  Summary ---[sec]----
TimeReport CPU/event = 0.003100 Real/event = 0.003062

TimeReport ---------- Path   Summary ---[sec]----
TimeReport             per event          per path-run 
TimeReport        CPU       Real        CPU       Real Name
TimeReport   0.003040   0.003005   0.003040   0.003005 p
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event          per path-run 

TimeReport -------End-Path   Summary ---[sec]----
TimeReport             per event       per endpath-run 
TimeReport        CPU       Real        CPU       Real Name
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event       per endpath-run 

TimeReport ---------- Modules in Path: p ---[sec]----
TimeReport             per event      per module-visit 
TimeReport        CPU       Real        CPU       Real Name
TimeReport   0.003040   0.003002   0.003040   0.003002 demo
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event      per module-visit 
TimeReport        CPU       Real        CPU       Real Name
TimeReport             per event      per module-visit 

TimeReport ---------- Module Summary ---[sec]----
TimeReport             per event        per module-run      per module-visit 
TimeReport        CPU       Real        CPU       Real        CPU       Real Name
TimeReport   0.003040   0.003002   0.003040   0.003002   0.003040   0.003002 demo
TimeReport   0.000060   0.000044   0.000060   0.000044   0.000060   0.000044 TriggerResults
TimeReport        CPU       Real        CPU       Real        CPU       Real Name
TimeReport             per event        per module-run      per module-visit 

T---Report end!

++ Job ended

=============================================

MessageLogger Summary

 type     category        sev    module        subroutine        count    total
 ---- -------------------- -- ---------------- ----------------  -----    -----
    1 fileAction           -s file_close                             1        1
    2 fileAction           -s file_open                              2        2

 type    category    Examples: run/evt        run/evt          run/evt
 ---- -------------------- ---------------- ---------------- ----------------
    1 fileAction           PostEndRun                        
    2 fileAction           pre-events       pre-events       

Severity    # Occurrences   Total Occurrences
--------    -------------   -----------------
System                  3                   3
<--/twistyPlugin-->

Add a histogram

I will not go into detail about how you should add histograms. Below are the three files that you have to change to plot a histogram. Compare it to what you already have and make changes by seeing what is missing. If you do not want to make changes, just copy and paste them as is. Here are the steps. The order in which you do them does not matter.

1. Make changes in your demo analyzer DemoAnalyzer.cc and it should like this DemoAnalyzer.cc.

2. Make changes in the BuildFile.xml and it should look like this: BuildFile.xml

<-- NO NEED TO MAKE CHANGES IN CMSSW_3_6_1.py and tracks_CMSSW_3_6_1.png as they work and are same for 382  -->

3. Make changes in the config file demoanalyzer_cfg.py and it should like this demoanalyzer_cfg.py

Then do scram b and run it by doing cmsRun Demo/DemoAnalyzer/demoanalyzer_cfg.py

You will see that now you have a root file called histodemo.root. Open this root file and you will see a histogram showing number of tracks in 200 events over which you ran. The plot looks like this:

tracks_CMSSW_5_3_5.png

If you want to see other collections, as mentioned above you have to see what are available at Reco event content documentation.

Histo Analyzer

This package is similar to the DemoAnalyzer package. The point in having it here is that, having understood how to create, change and run your own demo analyzer (or module), you can also have look at this package that tells you how to add histograms to your analyzer which I already briefly showed you above. This has been historically here and I did not want to remove it. After all it does not hurt to tell how to include a histogram in your analyzer again.

Eventually, you may want your analyzer to record something rather than just print out track numbers. The mkedanlzr script has an option histo to generate an analyzer code which writes a histogram in a root file. If you use it together with the option track, it will access the tracks, find their charge and fill a histogram. To use this option, go to the CMSSW_7_4_15/src directory and create a new subdirectory

mkdir Histo
cd Histo
Create a new analyzer module
mkedanlzr -track -histo HistoAnalyzer 
Go to the HistoAnalyzer directory and compile the code
cd HistoAnalyzer
scram b
Change the data file to 'file:/afs/cern.ch/cms/Tutorials/TTJets_RECO_5_3_4.root' in histoanalyzer_cfg.py that we were already using in demoanalyzer_cfg.py and change 'ctfWithMaterialTracks' to 'generalTracks' by commenting out as follows

<-- SyntaxHighlightingPlugin -->
process.demo = cms.EDAnalyzer('HistoAnalyzer'
#    , tracks = cms.untracked.InputTag('ctfWithMaterialTracks')
      , tracks = cms.untracked.InputTag('generalTracks')
)
<-- end SyntaxHighlightingPlugin -->

Run the analyzer

cmsRun histoanalyzer_cfg.py
A root file histo.root has been created and you can find the histogram in root
root histo.root
new TBrowser
Double-click on ROOT files, double-click on histo.root and double-click on demo and you will find the histogram "charge" which is specified in the Histo/HistoAnalyzer/src/HistoAnalyzer.cc.

The histogram looks like this:

charge_CMSSW5_3_5.png

Detailed instructions on how to write out a histogram file can be found in page TFileService: a ROOT Histogram Service.

<--

Add data to the output file

Finally, you may want to store your new data together with the input data in the root file. You can use the mkedprod script producing a template EDProducer module. Go to your work area in =CMSSW_7_4_15 and create a subdirectory

mkdir Prod
cd Prod

Then create the producer

mkedprod -myparticle MyParticleProducer

Go to the new directory and compile

cd MyParticleProducer
scram b

-->

<-- ++ Information Sources  -->
<--Tutorial Introduction to the Framework by ChrisDJones 
-->
<-- Strategy for a Common Physics Software Infrastructure by Luca Lista, Stefano Argiro, Yana Osborne, rev 0.2-->

Review status

<--/twistyPlugin twikiMakeVisibleInline-->

Reviewer/Editor and Date (copy from screen) Comments

JohnStupak - 10 Mar 2013 Revised to CMSSW_5_3_5
SudhirMalik - 13 June 2011 Revised to CMSSW_4_2_4
SudhirMalik - 22 Mar 2011 Revised to CMSSW_4_1_3
SudhirMalik - 29 August 2010 Introduced WBRELEASE variables
RogerWolf - 7 June 2010 Lifted to CMSSW_3_6_2, CMSSW_3_6_1 input files and pictures are still valid though
SudhirMalik - 1 June 2010 Revised to CMSSW_3_6_1

%RESPONSIBLE% SudhirMalik

<--/twistyPlugin-->

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback