CMS 3D CMS Logo

printConversionInfo.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 import ROOT
4 import sys
5 from DataFormats.FWLite import Events, Handle
6 
7 from FWCore.ParameterSet.VarParsing import VarParsing
8 options = VarParsing ('python')
9 options.parseArguments()
10 
11 print "maxEvents", options.maxEvents
12 
13 events = Events (options)
14 conversionHandle = Handle ('vector<reco::Conversion>')
15 conversionLabel = ("conversions")
16 
17 for event in events:
18  aux = event.object().eventAuxiliary()
19  print "run %6d event %d" % (aux.run(), aux.event())
20  event.getByLabel (conversionLabel, conversionHandle)
21  conversionVector = conversionHandle.product()
22  for index, conversion in enumerate (conversionVector):
23  print " %2d %8.4f" % (index, conversion.EoverP())