14 print " EcalCondDB - inpect EcalCondDB"
17 print " EcalCondDB [options] [command] [command_options]"
21 print "Specify short options as '-o foo', long options as '--option=foo'"
23 print " -c, --connect= [connectstring]"
24 print " specify database, default frontier://FrontierProd/CMS_COND_31X_ECAL"
26 print " -P, --authpath= [authenticationpath], default /afs/cern.ch/cms/DB/conddb "
28 print "COMMAND OPTIONS"
30 print " -t, --tag= [tag,file] specify tag or xml file (histo,compare)"
32 print " -s, --since= [runnumber] specify since"
36 print " -l, --listtags list all tags and exit"
38 print " -m, --listiovs list iovs for a given tag"
39 print " Example EcalCondDB.py -t tag"
41 print " -d, --dump= [file] dump record to xml file"
42 print " Example EcalCondDB.py -d file.xml -t tag -s since"
44 print " -p, --plot= [file] plot record to file, extension specifies ",\
45 "format (.root,.png,.jpg,.gif,.svg)"
46 print " Example: EcalCondDB.py -p=plot.png -t tag -s since"
49 print " -q, --compare= [file]"
50 print " compare two tags and write histograms to file, extension",\
53 print " EcalCondDB -q=h.root -t tag1 -s since1 -t tag2 -s since2"
55 print " -g, --histo= [file] make histograms and write to file"
57 print " EcalCondDB -g=h.png -t tag1 -s since1 "
61 opts, args = getopt.getopt(sys.argv[1:],
62 "c:P:t:ld:p:q:g:ms:h",
63 [
"connect=",
"authpath=",
"tag=",
"listtags",\
64 "dump=",
"plot=",
"compare=",
"histo=",
"listiovs",\
71 except getopt.GetoptError
as ex:
73 print ex,
" , use -h or --help for help"
76 dbName =
"frontier://FrontierProd/CMS_COND_31X_ECAL"
77 authpath=
"/afs/cern.ch/cms/DB/conddb"
98 if opt
in (
"-c",
"--connect"):
101 if opt
in (
"-P",
"--authpath"):
104 if opt
in (
"-h",
"--help"):
108 if opt
in (
"-t",
"--tag"):
110 if arg.find(
".xml")>0 :
111 print "WARNING : plot from XML is not protected against changes"
112 print " in DetId or CondFormats"
114 if opt
in (
"-l",
"--listtags"):
117 if opt
in (
"-q",
"--compare"):
121 if opt
in (
"-d",
"--dump"):
125 if opt
in (
"-p",
"--plot"):
129 if opt
in (
"-g",
"--histo"):
133 if opt
in (
"-m",
"--listiovs"):
136 if opt
in (
"-s",
"--since"):
145 sys.setdlopenflags(DLFCN.RTLD_GLOBAL+DLFCN.RTLD_LAZY)
146 from pluginCondDBPyInterface
import *
150 rdbms = RDBMS(authpath)
151 db = rdbms.getReadOnlyDB(dbName)
160 print "Must specify tag with -t"
165 if not len(tags)
or not len (sinces):
166 print "Must specify tag with -t [tag] -s [since]"
172 print "Must give exactly two tags to compare: -t tag1 -t tag2"
174 if tags[0].
find(
'.xml')<0
and len(sinces)!=2 :
175 print "Must specify tag, since to compare with -t [tag1] \
176 -s [since1] -t [tag2] -s [since2] "
180 tags[1],db,sinces[1],outfilename)
184 print "Must specify tag, since, with -t [tag] \
185 -s [runsince] (since not needed for xml)"
188 if tags[0].
find(
'.xml')<0
and not len(sinces) :
189 print "Must specify tag, since, with -t [tag] \
197 print "Must specify tag with -t [tag]"
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)