CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
python.diffProv.difference Class Reference

Public Member Functions

def __init__ (self, v)
 
def list_diff (self, aList1, aList2, string1, string2)
 
def module_diff (self, module1, module2, string1, string2)
 
def onefilemodules (self, module1, module2, string)
 

Public Attributes

 verbose
 

Private Attributes

 _diffprocess
 
 _sameprocess
 

Detailed Description

Definition at line 4 of file diffProv.py.

Constructor & Destructor Documentation

◆ __init__()

def python.diffProv.difference.__init__ (   self,
  v 
)

Definition at line 6 of file diffProv.py.

6  def __init__(self,v):
7  self.verbose = v
8  self._diffprocess=[]
9  self._sameprocess=()
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ list_diff()

def python.diffProv.difference.list_diff (   self,
  aList1,
  aList2,
  string1,
  string2 
)

Definition at line 10 of file diffProv.py.

References print(), FastTimerService_cff.range, str, python.diff_provenance.difference.verbose, python.diffProv.difference.verbose, core.SkimAnalyzerCount.SkimAnalyzerCount.verbose, VisualizationOptions.verbose, CSCTFanalyzer.verbose, L1TdeStage2EMTF.verbose, L1TStage2uGMTMuon.verbose, analyzer.Analyzer.verbose, L1TStage2EMTF.verbose, L1TStage2RegionalShower.verbose, heppy::Davismt2.verbose, DQMGenericTnPClient.verbose, dqmTnP::AbstractFitter.verbose, L1TStage2OMTF.verbose, TritonService::FallbackOpts.verbose, DeviationsFromFileSensor2D.verbose, L1TStage2BMTF.verbose, L1TStage2MuonComp.verbose, confdbOfflineConverter.OfflineConverter.verbose, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.verbose, L1TStage2RegionalMuonCandComp.verbose, L1TCaloLayer1.verbose, L1TCaloLayer1RawToDigi.verbose, L1TCaloSummary.verbose, HIPAlignmentAlgorithm.verbose, L1TCaloLayer1Validator.verbose, config.Analyzer.verbose, FFTJetLookupTableESProducer< CT >.verbose, FFTJetCorrectionESProducer< CT >.verbose, BeamSpotDipServer.verbose, o2olib.O2OJobMgr.verbose, config.Service.verbose, objects.VertexAnalyzer.VertexAnalyzer.verbose, L1TStage2uGTCaloLayer2Comp.verbose, OpticalObject.verbose, L1TdeStage2CaloLayer2.verbose, objects.LeptonAnalyzer.LeptonAnalyzer.verbose, and HltDiff.verbose.

Referenced by python.diffProv.difference.module_diff().

10  def list_diff(self,aList1, aList2, string1, string2):
11  "Searches for differences between two modules of the same kind"
12  differences=[]
13  for i in range(2,len(aList1)):
14  for j in range(2,len(aList2)):
15  if (i==j) and (aList1[i]!=aList2[j]):
16  if aList1[i][:(aList1[i].index('=')+1)] == aList2[j][:(aList2[j].index('=')+1)]:
17  if self.verbose==str(2) or self.verbose==str(1):
18  str1 = aList1[i][2:aList1[i].index('=')+1] + aList1[i][aList1[i].index('=')+1:]+' ['+ string1+']'
19  str2 = len(aList1[i][2:aList1[i].index('=')+1])*' '+aList2[j][aList2[j].index('=')+1:]+' ['+string2+']'
20  print(str1,'\n',str2,'\n')
21  differences.append(str1)
22  differences.append(str2)
23 
24  return differences
25 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)

◆ module_diff()

def python.diffProv.difference.module_diff (   self,
  module1,
  module2,
  string1,
  string2 
)

Definition at line 26 of file diffProv.py.

References python.diffProv.difference._diffprocess, python.diffProv.difference._sameprocess, mps_setup.append, python.diff_provenance.difference.list_diff(), python.diffProv.difference.list_diff(), python.diff_provenance.difference.onefilemodules(), python.diffProv.difference.onefilemodules(), print(), FastTimerService_cff.range, submitPVValidationJobs.split(), python.diff_provenance.difference.verbose, python.diffProv.difference.verbose, core.SkimAnalyzerCount.SkimAnalyzerCount.verbose, VisualizationOptions.verbose, CSCTFanalyzer.verbose, L1TdeStage2EMTF.verbose, L1TStage2uGMTMuon.verbose, L1TStage2EMTF.verbose, analyzer.Analyzer.verbose, L1TStage2RegionalShower.verbose, heppy::Davismt2.verbose, DQMGenericTnPClient.verbose, dqmTnP::AbstractFitter.verbose, L1TStage2OMTF.verbose, TritonService::FallbackOpts.verbose, DeviationsFromFileSensor2D.verbose, L1TStage2BMTF.verbose, L1TStage2MuonComp.verbose, confdbOfflineConverter.OfflineConverter.verbose, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.verbose, L1TStage2RegionalMuonCandComp.verbose, L1TCaloLayer1.verbose, L1TCaloLayer1RawToDigi.verbose, L1TCaloSummary.verbose, L1TCaloLayer1Validator.verbose, HIPAlignmentAlgorithm.verbose, config.Analyzer.verbose, FFTJetLookupTableESProducer< CT >.verbose, FFTJetCorrectionESProducer< CT >.verbose, BeamSpotDipServer.verbose, o2olib.O2OJobMgr.verbose, config.Service.verbose, objects.VertexAnalyzer.VertexAnalyzer.verbose, L1TStage2uGTCaloLayer2Comp.verbose, OpticalObject.verbose, L1TdeStage2CaloLayer2.verbose, objects.LeptonAnalyzer.LeptonAnalyzer.verbose, and HltDiff.verbose.

26  def module_diff(self,module1,module2, string1, string2):
27  "Searches for modules which are in both the files but whose parameters are setted at different values"
28  print('\nList of modules present in both the files with different parameter values\n')
29  for i in module1.keys():
30  for j in module2.keys():
31  if (i==j) and (i=='Processing'):
32  list= module1[i]
33  for k in range(len(list)):
34  process1=module1[i][k].split()
35  process2=module2[i][k].split()
36  if process1[0]!= process2[0]:
37  key1=process1[0]
38  key2=process2[0]
39  self._diffprocess.append( (key1,key2) )
40 
41  if len(self._diffprocess)>1:
42  print('Differences in the processing history')
43  for l,m in self._diffprocess:
44  print(l+' ['+string1+']')
45  print(m+' ['+string2+']')
46  print('')
47  if len(self._diffprocess)==1:
48  self._sameprocess=self._diffprocess[0]
49 
50  elif ( (i==j)or (i,j)==self._sameprocess ) and (i!='Processing'):
51  for name1,value1 in module1[i]:
52  for name2,value2 in module2[j]:
53  if (name1==name2) and (value1[1:]!=value2[1:]):
54  print('Process: '+'"'+i+'"'+'\n'+'Module: '+'"'+name1+'"'+'\n')
55  d=difference(self.verbose)
56  d.firstvalue=value1
57  d.secondvalue=value2
58  self.list_diff(d.firstvalue,d.secondvalue, string1, string2)
59 
60  self.onefilemodules(module1,module2,'first')
61  self.onefilemodules(module2,module1,'second')
62 
63 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ onefilemodules()

def python.diffProv.difference.onefilemodules (   self,
  module1,
  module2,
  string 
)

Definition at line 64 of file diffProv.py.

References python.diffProv.difference._sameprocess, print(), str, python.diff_provenance.difference.verbose, python.diffProv.difference.verbose, core.SkimAnalyzerCount.SkimAnalyzerCount.verbose, VisualizationOptions.verbose, CSCTFanalyzer.verbose, L1TdeStage2EMTF.verbose, L1TStage2uGMTMuon.verbose, L1TStage2RegionalShower.verbose, analyzer.Analyzer.verbose, L1TStage2EMTF.verbose, heppy::Davismt2.verbose, DQMGenericTnPClient.verbose, dqmTnP::AbstractFitter.verbose, L1TStage2OMTF.verbose, TritonService::FallbackOpts.verbose, DeviationsFromFileSensor2D.verbose, L1TStage2BMTF.verbose, L1TStage2MuonComp.verbose, confdbOfflineConverter.OfflineConverter.verbose, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.verbose, L1TStage2RegionalMuonCandComp.verbose, L1TCaloLayer1.verbose, L1TCaloLayer1RawToDigi.verbose, L1TCaloSummary.verbose, HIPAlignmentAlgorithm.verbose, L1TCaloLayer1Validator.verbose, config.Analyzer.verbose, FFTJetLookupTableESProducer< CT >.verbose, FFTJetCorrectionESProducer< CT >.verbose, BeamSpotDipServer.verbose, o2olib.O2OJobMgr.verbose, config.Service.verbose, objects.VertexAnalyzer.VertexAnalyzer.verbose, L1TStage2uGTCaloLayer2Comp.verbose, OpticalObject.verbose, L1TdeStage2CaloLayer2.verbose, objects.LeptonAnalyzer.LeptonAnalyzer.verbose, and HltDiff.verbose.

Referenced by python.diffProv.difference.module_diff().

64  def onefilemodules(self,module1,module2,string):
65  "Searches for modules present only in one of the two files"
66  print('\nModules run only on the '+string+ ' edmfile:'+'\n')
67  for i in module1.keys():
68  labelList=[]
69  if (i not in module2.keys())and (i not in self._sameprocess):
70  print('\n Process '+i+' not run on edmfile '+string +'\n')
71  elif i!='Processing':
72  k=i
73  if i in self._sameprocess:
74  if i==self._sameprocess[0]:
75  k= self._sameprocess[1]
76  elif i==self._sameprocess[1]:
77  k= self._sameprocess[0]
78  labelList2=[module[0] for module in module2[k]]
79  labelList1=[module[0] for module in module1[i]]
80  for name, value in module1[i] :
81  if (name not in labelList2):
82  print('Process: '+'"'+i+'"'+'\n'+'Module: '+'"'+name+'"')
83  if self.verbose==str(2):
84  for k in value[1:]:
85  print(k)
86 
87 
88 
89 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)

Member Data Documentation

◆ _diffprocess

python.diffProv.difference._diffprocess
private

Definition at line 8 of file diffProv.py.

Referenced by python.diffProv.difference.module_diff().

◆ _sameprocess

python.diffProv.difference._sameprocess
private

◆ verbose

python.diffProv.difference.verbose