CMS 3D CMS Logo

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