ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/CMSSW/PhysicsTools/PythonAnalysis/scripts/edmProvDiff
Revision: 1.3
Committed: Sun Jan 10 18:38:23 2010 UTC (15 years, 3 months ago) by hegner
Branch: MAIN
CVS Tags: CMSSW_6_2_0, CMSSW_6_2_0_pre7_TS133806, CMSSW_5_3_11_patch3, CMSSW_6_1_2_SLHC6_patch1, CMSSW_5_3_11_patch2, CMSSW_5_3_11_patch1, CMSSW_6_2_0_pre8, CMSSW_6_1_2_SLHC6, CMSSW_4_1_8_patch13, CMSSW_6_1_2_SLHC5, CMSSW_5_3_11, CMSSW_6_2_0_pre7_TS132947, CMSSW_4_4_5_patch3, CMSSW_6_2_0_pre7_g496p02, CMSSW_6_2_0_pre7, CMSSW_5_3_10_patch2, CMSSW_6_1_2_SLHC4_patch1, CMSSW_6_1_2_SLHC4, CMSSW_6_1_2_SLHC2_patch3, CMSSW_6_2_0_pre6_patch1, CMSSW_6_1_2_SLHC2_patch2, CMSSW_6_2_0_pre6, CMSSW_5_3_10_patch1, CMSSW_6_1_2_SLHC3, CMSSW_6_1_2_SLHC2_patch1, CMSSW_4_1_8_patch11, CMSSW_5_3_10, CMSSW_6_1_2_SLHC2, CMSSW_6_2_0_pre5slc6, CMSSW_5_3_9_patch3, CMSSW_6_1_2_SLHC1, CMSSW_6_2_0_pre5, CMSSW_6_1_X_2012-12-19-0200, CMSSW_6_0_X_2012-08-07-0200, CMSSW_5_2_X_2012-05-03-0200, CMSSW_5_2_X_2012-03-08-0200, CMSSW_5_0_X_2011-12-18-0200, CMSSW_4_4_X_2011-06-09-0400, CMSSW_5_3_9_patch2, CMSSW_6_1_2, CMSSW_6_2_0_pre4, CMSSW_5_3_9_patch1, CMSSW_6_2_0_pre3, CMSSW_6_1_1_SLHCphase2tk1, CMSSW_5_3_9, CMSSW_6_1_1_SLHCphase1tk1, CMSSW_5_2_9, CMSSW_6_2_0_pre2, CMSSW_6_1_1, CMSSW_5_3_8_patch3, CMSSW_5_3_7_patch6, CMSSW_6_2_0_pre1, CMSSW_5_3_8_patch2, CMSSW_5_3_8_patch1, CMSSW_5_3_8, CMSSW_5_3_8_HI_patch2, CMSSW_5_3_7_patch5, CMSSW_5_3_8_HI_patch1, CMSSW_5_2_6_patch2, CMSSW_6_1_0, CMSSW_5_3_8_HI, CMSSW_5_3_7_patch4, CMSSW_5_3_7_patch3, CMSSW_6_0_1_PostLS1v2_patch4, CMSSW_6_1_0_pre8, CMSSW_5_3_7_25nspatch1, CMSSW_5_3_7_patch2, CMSSW_6_1_0_pre7_TS127013, CMSSW_6_0_1_PostLS1v2_patch3, CMSSW_6_1_0_pre7, CMSSW_5_3_7_patch1, CMSSW_6_1_0_pre6_TS126203_TS126341_patch1, CMSSW_5_3_7_alcapatch1, CMSSW_6_1_0_pre6g496cand01, CMSSW_5_3_7, CMSSW_6_0_1_PostLS1v2_patch2, CMSSW_6_0_1_PostLS1v2_patch1, CMSSW_6_1_0_pre6_TS126203_TS126341, CMSSW_6_1_0_pre6, CMSSW_6_0_1_PostLS1v2, CMSSW_4_4_5_patch2, CMSSW_5_3_6_patch1, CMSSW_5_2_8, CMSSW_6_1_0_pre5, CMSSW_6_0_1_PostLS1v1, CMSSW_5_2_7_hltpatch2, CMSSW_5_3_4_TC125616patch1, CMSSW_6_0_1, CMSSW_5_3_4_patch2, CMSSW_6_1_0_pre3_TS124729, CMSSW_6_1_0_pre4, CMSSW_5_3_5, CMSSW_5_3_3_patch3, CMSSW_5_3_4_patch1, CMSSW_6_1_0_pre3, CMSSW_4_4_5_patch1, CMSSW_5_2_7, CMSSW_5_3_4, CMSSW_5_3_2_patch5, CMSSW_6_1_0_pre2, CMSSW_5_3_4_cand2, CMSSW_5_3_4_cand1_patch1, CMSSW_6_0_0_patch1, CMSSW_6_0_0_SLHCtkpre1, CMSSW_6_1_0_pre1, CMSSW_5_3_4_cand1, CMSSW_6_0_0_TS123272, CMSSW_5_2_6_patch1, CMSSW_6_0_0, CMSSW_4_4_5, CMSSW_5_3_3_patch2, CMSSW_4_2_8_SLHChcal6, CMSSW_5_3_3, CMSSW_5_3_3_patch1, CMSSW_6_0_0_pre11, CMSSW_6_0_0_pre10, CMSSW_4_2_8_SLHChcal5, CMSSW_6_0_0_pre9, CMSSW_4_2_8_SLHCstd2_patch2, CMSSW_4_2_8_SLHCtk3_patch2, CMSSW_4_2_8_SLHChcal2_patch3, CMSSW_5_3_2_patch4, CMSSW_6_0_0_pre8, CMSSW_4_2_8_SLHCstd2_patch1, CMSSW_4_2_8_SLHCtk3_patch1, CMSSW_4_2_8_SLHChcal4_patch4, CMSSW_5_3_3_cand1, CMSSW_5_3_2_patch2, CMSSW_5_3_2_metpatch1, CMSSW_5_2_6_hltpatch1, CMSSW_4_2_8_SLHChcal4_patch3, CMSSW_6_0_0_pre7py273, CMSSW_5_2_6, CMSSW_5_3_2_patch1, CMSSW_4_2_8_SLHChcal4_patch2, CMSSW_4_2_8_SLHChcal4_patch1, CMSSW_5_3_2, CMSSW_6_0_0_pre7, CMSSW_5_2_4_hltpatch4, CMSSW_6_0_0_pre6g495p01, CMSSW_5_2_5_patch3, CMSSW_5_2_5_patch2, CMSSW_6_0_0_pre6, CMSSW_5_3_1, CMSSW_4_1_8_patch10, CMSSW_5_2_5_ecalpatch1, CMSSW_6_0_0_pre5, CMSSW_5_3_0_patch1, CMSSW_4_2_8_SLHChcal4, CMSSW_4_2_8_SLHCtk3, CMSSW_5_2_5, CMSSW_5_2_5_patch1, CMSSW_4_2_9_HLT1_bphpatch4, CMSSW_sm120515a, CMSSW_4_2_8_SLHCstd2, CMSSW_5_3_0, CMSSW_6_0_0_pre4, CMSSW_5_2_4_hltpatch2, CMSSW_4_2_9_HLT1_bphpatch3, CMSSW_6_0_X, CMSSW_5_2_5_cand1, CMSSW_4_2_8_SLHC2_patch2, CMSSW_4_2_8_SLHCtk_patch2, CMSSW_4_2_8_SLHChcal2_patch2, CMSSW_5_2_4_patch4, CMSSW_6_0_0_pre3, CMSSW_5_2_4_patch3, CMSSW_4_2_8_SLHCtk2, CMSSW_5_2_4_patch2, CMSSW_4_2_8_SLHChcal3, CMSSW_4_2_8_SLHCstd, CMSSW_5_2_4_patch1, CMSSW_5_2_4, CMSSW_5_2_3_patch4, CMSSW_4_2_8_SLHC2_patch1, CMSSW_4_2_8_SLHCtk_patch1, CMSSW_4_2_8_SLHChcal2_patch1, CMSSW_4_2_9_HLT1_bphpatch2, CMSSW_5_2_3_patch3, CMSSW_4_2_9_HLT1_bphpatch1, CMSSW_6_0_0_pre2, CMSSW_5_2_3_patch2, CMSSW_5_2_3_patch1, CMSSW_5_2_3, CMSSW_6_0_0_pre1, CMSSW_5_1_3, CMSSW_5_2_2, CMSSW_5_2_1, CMSSW_4_4_4, CMSSW_5_1_2_patch1, CMSSW_5_2_0, CMSSW_5_1_1_patch3, CMSSW_5_2_0_pre5_TS117504, CMSSW_5_1_2, CMSSW_5_2_0_pre6, CMSSW_5_1_1_patch2, CMSSW_4_4_3_patch1, CMSSW_5_1_1_patch1, CMSSW_5_2_0_pre5, CMSSW_5_1_1, CMSSW_5_0_1_patch3, CMSSW_4_1_8_patch8, CMSSW_5_0_1_patch2, CMSSW_5_2_0_pre4, CMSSW_4_2_8_SLHCtk, CMSSW_5_0_1_patch1, CMSSW_5_2_0_pre3HLT, CMSSW_4_2_8_p7rootfix, CMSSW_5_2_0_pre3, CMSSW_5_0_1, CMSSW_5_2_0_pre2_TS113282, CMSSW_4_4_3, CMSSW_5_0_0_patch1, CMSSW_5_2_0_pre2, CMSSW_5_2_0_pre1, CMSSW_5_1_0_pre2, CMSSW_5_1_0_pre1, CMSSW_4_1_8_patch7, CMSSW_4_4_2_patch10, CMSSW_5_0_0, CMSSW_4_2_8_SLHChcal, CMSSW_4_4_2_patch9, CMSSW_4_4_2_patch8, CMSSW_4_1_8_patch6, CMSSW_5_0_0_pre7, CMSSW_4_2_8_SLHC1, CMSSW_4_2_8_SLHC2, CMSSW_5_0_0_pre6g494, CMSSW_4_4_2_patch7, CMSSW_4_1_8_patch5, CMSSW_5_0_0_pre6, CMSSW_4_4_2_patch6, CMSSW_4_1_8_patch4, CMSSW_5_0_0_pre5_root532rc1, CMSSW_4_4_2_patch5, CMSSW_4_4_2_patch4, CMSSW_4_4_2_patch3, CMSSW_4_2_3_SLHC4_patch1, CMSSW_4_4_2_patch2, CMSSW_5_0_0_pre5, CMSSW_4_4_2_patch1, V00-05-04, CMSSW_4_4_2, CMSSW_5_0_0_pre4, CMSSW_4_4_0_patch4, CMSSW_4_2_8_patch7, CMSSW_5_0_0_pre3, CMSSW_4_4_1, CMSSW_5_0_0_pre2, CMSSW_4_4_0_patch3, CMSSW_4_2_8_patch6, CMSSW_4_4_0_patch2, CMSSW_4_2_9_HLT2_hltpatch1, CMSSW_4_2_9_HLT1_hltpatch2, CMSSW_4_4_0_patch1, CMSSW_4_2_8_patch5, CMSSW_4_2_9_HLT3, CMSSW_5_0_0_pre1, CMSSW_4_4_0, CMSSW_4_2_9_HLT2, CMSSW_4_2_8_patch4, CMSSW_4_2_9_HLT1_patch1, CMSSW_4_4_0_pre10, CMSSW_4_1_8_patch1, CMSSW_4_2_8_patch3, CMSSW_4_4_0_pre9, CMSSW_4_1_8, V00-05-03, CMSSW_4_2_8_patch2, CMSSW_4_2_9_HLT1, CMSSW_4_2_9_HLT, CMSSW_4_4_0_pre8, CMSSW_4_2_7_hltpatch3, CMSSW_4_1_7_patch3, CMSSW_4_2_8_patch1, CMSSW_4_4_0_pre7_g494p02, CMSSW_4_1_7_patch2, CMSSW_4_4_0_pre7, CMSSW_4_4_0_pre6, CMSSW_4_2_8, CMSSW_4_2_7_hltpatch2, CMSSW_4_2_3_SLHC4, CMSSW_4_2_3_SLHC2, CMSSW_4_2_7_hltpatch1, CMSSW_4_2_5_hltpatch1, CMSSW_4_2_7_patch2, CMSSW_4_4_0_pre5, CMSSW_4_2_7_patch1, CMSSW_4_2_7, CMSSW_4_1_7_patch1, CMSSW_4_4_0_pre4, CMSSW_4_3_0_dqmpatch2, CMSSW_4_2_6, CMSSW_4_4_0_pre3, CMSSW_4_3_0_dqmpatch1, CMSSW_4_3_0, CMSSW_4_4_0_pre2, CMSSW_4_2_4_patch2, CMSSW_4_2_4_hltpatch1, CMSSW_4_2_5, CMSSW_4_1_7, logger_cbern_19Jun11-09h37m04s, CMSSW_4_4_0_pre1, CMSSW_4_3_0_pre6_dqmIO, CMSSW_4_3_0_pre7, CMSSW_4_2_4_patch1, CMSSW_4_2_3_SLHC3, CMSSW_4_2_4, CMSSW_4_1_6_patch1, CMSSW_4_2_3_patch5, CMSSW_4_2_3_patch4, CMSSW_4_3_0_pre6, CMSSW_4_2_3_patch3, V00-05-02, CMSSW_4_2_3_patch2, CMSSW_4_3_0_pre5, CMSSW_4_2_3_patch1, CMSSW_4_2_3_SLHC_pre1, CMSSW_4_1_6, CMSSW_4_2_2_patch2, CMSSW_4_2_3, CMSSW_4_2_2_patch1, CMSSW_4_3_0_pre4, CMSSW_4_2_1_patch2, CMSSW_4_2_2_SLHC_pre1, CMSSW_4_1_4_patch4, CMSSW_4_2_2, CMSSW_4_1_5, CMSSW_4_1_4_patch3, CMSSW_4_2_1_patch1, CMSSW_4_3_0_pre3, CMSSW_4_2_1, CMSSW_4_1_4_patch2, CMSSW_4_1_4_patch1, CMSSW_4_1_4, CMSSW_4_2_0, CMSSW_4_3_0_pre2, CMSSW_4_3_0_pre1, CMSSW_4_1_3_patch2, CMSSW_4_2_0_pre8, CMSSW_4_1_3, CMSSW_4_1_2, CMSSW_4_1_2_patch1, CMSSW_3_11_3, CMSSW_4_2_0_pre7, CMSSW_3_11_2, CMSSW_4_2_0_pre6, CMSSW_3_11_1_hltpatch1, CMSSW_3_11_1_hclpatch1, CMSSW_3_11_1_patch3, CMSSW_3_9_9_patch1, CMSSW_3_9_9, CMSSW_4_2_0_pre5, CMSSW_4_2_0_pre4, CMSSW_3_11_1_patch1, CMSSW_4_2_0_pre3, CMSSW_3_11_1, CMSSW_3_9_8_patch2, CMSSW_4_2_0_pre2, CMSSW_3_9_8_patch1, CMSSW_3_9_8, CMSSW_4_2_0_pre1, CMSSW_3_11_0, CMSSW_3_10_1, CMSSW_3_11_0_pre4, CMSSW_3_11_0_pre5, CMSSW_3_11_0_pre3, CMSSW_3_11_0_pre2, CMSSW_3_9_7, CMSSW_3_10_0, CMSSW_3_9_6, CMSSW_3_8_7_patch1, CMSSW_3_11_0_pre1, CMSSW_3_10_0_pre9, CMSSW_3_9_5_patch2, CMSSW_3_10_0_pre8, CMSSW_3_10_0_pre7g494c1, CMSSW_3_9_5_patch1, CMSSW_3_10_0_pre7, CMSSW_3_8_7, CMSSW_3_9_5, CMSSW_3_10_0_pre6, CMSSW_3_9_4, CMSSW_3_10_0_pre5, CMSSW_3_9_3, CMSSW_3_9_2_patch5, CMSSW_3_10_0_pre4, CMSSW_3_9_2_patch4, CMSSW_3_8_6_patch1, CMSSW_3_9_2_patch3, CMSSW_3_9_2_patch2, CMSSW_3_9_2_patch1, CMSSW_3_9_2, CMSSW_3_10_0_pre3, CMSSW_3_8_6, CMSSW_3_9_1_patch1, CMSSW_3_9_1, CMSSW_3_10_0_pre2, CMSSW_3_8_5_patch3, CMSSW_3_10_0_pre1, CMSSW_3_8_5_patch2, CMSSW_3_9_0, V00-05-01, CMSSW_3_9_0_pre7, CMSSW_3_8_4_patch4, CMSSW_3_8_5, CMSSW_3_9_0_pre6, CMSSW_3_8_4_patch3, V00-05-00, CMSSW_3_9_0_pre5, CMSSW_3_8_4_patch2, CMSSW_3_8_4_patch1, CMSSW_3_9_0_pre4, CMSSW_3_8_4, CMSSW_3_8_3, CMSSW_3_8_2_patch1, CMSSW_3_6_3_SLHC1, CMSSW_3_9_0_pre3, CMSSW_3_8_1_patch4, CMSSW_3_8_2, CMSSW_3_8_1_patch3, CMSSW_3_6_1_patch7, CMSSW_3_9_0_pre2, CMSSW_3_8_1_patch2, CMSSW_3_8_1_patch1, CMSSW_3_7_1, CMSSW_3_8_1, CMSSW_3_6_3_patch2, CMSSW_3_9_0_pre1, CMSSW_3_8_0_patch1, CMSSW_3_8_0, V00-04-00, CMSSW_3_6_1_patch6, CMSSW_3_8_0_pre8, CMSSW_3_8_0_pre7, CMSSW_3_8_0_pre6, CMSSW_3_6_3_patch1, CMSSW_3_7_0_patch4, CMSSW_3_7_0_patch3, CMSSW_3_8_0_pre5, CMSSW_3_6_1_patch5, CMSSW_3_8_0_pre4, CMSSW_3_6_3, CMSSW_3_8_0_pre2, CMSSW_3_7_0_patch2, CMSSW_3_6_2, CMSSW_3_7_0_patch1, CMSSW_3_8_0_pre1, CMSSW_3_6_1_patch4, CMSSW_3_7_0, CMSSW_3_6_1_patch3, CMSSW_3_5_7_hltpatch4, CMSSW_3_7_0_pre5, CMSSW_3_6_1_patch1, CMSSW_3_5_8_patch4, CMSSW_3_7_0_pre4, CMSSW_3_6_1, CMSSW_3_7_0_pre3, CMSSW_3_6_0_patch2, CMSSW_3_6_0_patch1, CMSSW_3_5_8_patch3, CMSSW_3_5_8_patch2, CMSSW_3_5_8_patch1, CMSSW_3_7_0_pre2, CMSSW_3_5_8, CMSSW_3_7_0_pre1, CMSSW_3_5_7, CMSSW_3_6_0, CMSSW_3_6_0_pre6, CMSSW_3_6_0_pre5, CMSSW_3_5_6_patch1, CMSSW_3_5_6, CMSSW_3_5_4_patch2, CMSSW_3_5_5, CMSSW_3_6_0_pre4, CMSSW_3_5_4_patch1, CMSSW_3_6_0_pre3, CMSSW_3_5_4, CMSSW_3_5_3, CMSSW_3_6_0_pre2, CMSSW_3_5_2_patch2, CMSSW_3_5_2_patch1, CMSSW_3_6_0_pre1, CMSSW_3_5_2, CMSSW_3_5_1_patch1, CMSSW_3_5_0_patch1, CMSSW_3_4_2_patch1, CMSSW_3_5_1, CMSSW_3_4_2, CMSSW_3_5_0, CMSSW_3_5_0_pre5, CMSSW_3_5_0_pre3, V00-03-01, HEAD
Changes since 1.2: +4 -4 lines
Log Message:
improve error message

File Contents

# Content
1 #!/usr/bin/env python
2
3 # A script to compare the provenance of two input root files.
4 # It prints out informations about those modules which are common to the input files,
5 # but whose parameters are setted to different values, and about those modules
6 # present only in one of the two files.
7 # According to the level of verbosity, it will be report the name of these modules
8 # and details about the parameters and their values.
9 #
10 # author: Annapaola de Cosa
11
12 from optparse import OptionParser
13 import sys
14 from subprocess import Popen, PIPE, STDOUT
15 from PhysicsTools.PythonAnalysis.readProv import *
16 from PhysicsTools.PythonAnalysis.diffProv import *
17
18
19 usage = "usage: %prog filename1 filename2"
20 parser = OptionParser(usage=usage, version="%prog 0.1")
21 parser.add_option("-v", "--verbosity_level", dest="verbose", help="[0] to print short message [1], to print details about the differences of modules common to both files, [2] to print all the details about the differences between the two files")
22 (options, args) = parser.parse_args()
23
24 if len(args) != 2:
25 parser.error('Please specify two EDM files to compare')
26
27 def provenance(args):
28 cmd="edmProvDump "+args
29 if sys.platform == "linux2":
30 close_fds = True
31 else:
32 close_fds = False
33 pipe = Popen(cmd, bufsize=1,stdin=PIPE, stdout=PIPE, stderr=PIPE, shell = True, close_fds=close_fds)
34 provenance, provenanceerr=pipe.communicate()
35 s=args[:args.index('.')]
36 file=open(s,'w')
37 file.write(provenance)
38
39 return s
40 try:
41 prov1=provenance(args[0])
42 prov2=provenance(args[1])
43 except IndexError:
44 print "Specify input file names\nType 'edmProvDiff -h' to visualize the arguments needed"
45 f=filereader()
46 module1=f.readfile(prov1)
47 module2=f.readfile(prov2)
48 d=difference(options.verbose)
49 d.module_diff(module1,module2,args[0],args[1])
50
51