CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
dqm_interfaces.DirWalkerDB Class Reference
Inheritance diagram for dqm_interfaces.DirWalkerDB:

Public Member Functions

def __init__ (self, comm1, comm2, base1, base2, directory, depth=0, do_pngs=True, stat_test="KS", test_threshold=.5, black_list=[])
 
def run (self)
 

Public Attributes

 base2
 
 black_list
 
 comm1
 
 comm2
 
 depth
 
 directory
 
 do_pngs
 
 stat_test
 
 test_threshold
 

Detailed Description

An interface to the DQM document db. It is threaded to compensate the 
latency introduced by the finite response time of the server.

Definition at line 394 of file dqm_interfaces.py.

Constructor & Destructor Documentation

◆ __init__()

def dqm_interfaces.DirWalkerDB.__init__ (   self,
  comm1,
  comm2,
  base1,
  base2,
  directory,
  depth = 0,
  do_pngs = True,
  stat_test = "KS",
  test_threshold = .5,
  black_list = [] 
)

Definition at line 398 of file dqm_interfaces.py.

398  def __init__ (self,comm1,comm2,base1,base2,directory,depth=0,do_pngs=True,stat_test="KS",test_threshold=.5,black_list=[]):
399  Thread.__init__(self)
400  self.comm1 = deepcopy(comm1)
401  self.comm2 = deepcopy(comm2)
402  self.base1,self.base2 = base1,base2
403  self.directory = directory
404  self.depth=depth
405  self.do_pngs=do_pngs
406  self.test_threshold=test_threshold
407  self.stat_test=stat_test
408  self.black_list=black_list
409  # name of the thread
410  self.name+="_%s" %directory.name
411 
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

◆ run()

def dqm_interfaces.DirWalkerDB.run (   self)

Definition at line 412 of file dqm_interfaces.py.

References dqm_interfaces.DirWalkerDB.base2, dqm_interfaces.DirWalkerDB.black_list, dqm_interfaces.DirWalkerDB.comm1, dqm_interfaces.DirWalkerDB.comm2, MyHcalDetId.depth, CaloPoint.depth, HcalNumberingFromDDD::HcalID.depth, HcalChannelId.depth, PFClusterTimeSelector::CutInfo.depth, GEMELMap::GEMVFatMap.depth, HcalDDDRecConstants::HcalID.depth, RecoObj.depth, ZdcShowerLibrary::Hit.depth, LutXml::_Config.depth, reco::CastorJetID.depth, HFShower::Hit.depth, HFShowerParam::Hit.depth, LMapRow.depth, HFGflash::Hit.depth, HFShowerLibrary::Hit.depth, HcalDDDRecConstants::HcalActiveLength.depth, HFChannel.depth, HcalHardcodeGeometryLoader::HBHOCellParameters.depth, HcalFlexiHardcodeGeometryLoader::HBHOCellParameters.depth, HcalDDDRecConstants::HFCellParameters.depth, cms::MinBias.depth, SimAnalyzerMinbias.depth, LMapDetId.depth, XMLProcessor::_LMapRowHBEF.depth, RecAnalyzerHF.depth, HCALGPUAnalyzer.depth, ECalSD.depth, HcalHardcodeGeometryLoader::HECellParameters.depth, HcalFlexiHardcodeGeometryLoader::HECellParameters.depth, AnalyzerMinbias.depth, cms::Analyzer_minbias.depth, HcalHardcodeGeometryLoader::HFCellParameters.depth, HcalFlexiHardcodeGeometryLoader::HFCellParameters.depth, RecAnalyzerMinbias.depth, dqm_interfaces.DirID.depth, dqm_interfaces.DirWalkerDB.depth, HcalObjRepresent::ADataRepr.depth, CMTRawAnalyzer.depth, Book.directory, edmIntegrityCheck.IntegrityCheck.directory, dqm_interfaces.DirFetcher.directory, dqm_interfaces.DirWalkerDB.directory, dirstructure.Directory.do_pngs, dirstructure.Comparison.do_pngs, dqm_interfaces.DirWalkerDB.do_pngs, join(), ROOTData.literal2root(), print(), dqm_interfaces.DirWalkerDB.stat_test, and dqm_interfaces.DirWalkerDB.test_threshold.

412  def run(self):
413 
414  this_dir=DirID(self.directory.name,self.depth)
415  if this_dir in self.black_list:
416  print("Skipping %s since blacklisted!" %this_dir)
417  return 0
418 
419  self.depth+=1
420 
421  the_test=Statistical_Tests[self.stat_test](self.test_threshold)
422  #print "Test %s with threshold %s" %(self.stat_test,self.test_threshold)
423 
424  directory1=self.base1+"/"+self.directory.mother_dir+"/"+self.directory.name
425  directory2=self.base2+"/"+self.directory.mother_dir+"/"+self.directory.name
426 
427  fetchers =(DirFetcher(self.comm1,directory1),DirFetcher(self.comm2,directory2))
428  for fetcher in fetchers:
429  fetcher.start()
430  for fetcher in fetchers:
431  fetcher.join()
432 
433  contents1 = fetchers[0].contents
434  contents2 = fetchers[1].contents
435  set1= set(contents1.keys())
436  set2= set(contents2.keys())
437 
438  walkers=[]
439  self_directory_directories=self.directory.subdirs
440  self_directory_comparisons=self.directory.comparisons
441  contents_names=list(set1.intersection(set2))
442 
443  for name in contents_names:
444  content = contents1[name]
445  if "dir" in content["type"]:
446  #if this_dir not in DirWalker.white_list:continue
447  subdir=Directory(name,join(self.directory.mother_dir,self.directory.name))
448  dirwalker=DirWalkerDB(self.comm1,self.comm2,self.base1,self.base2,subdir,self.depth,
449  self.do_pngs,self.stat_test,self.test_threshold,self.black_list)
450  dirwalker.start()
451  walkers.append(dirwalker)
452  n_threads=activeCount()
453  if n_threads>5:
454  #print >> stderr, "Threads that are running: %s. Joining them." %(n_threads)
455  dirwalker.join()
456  elif content["kind"]=="ROOT":
457 # print directory1,name
458  comparison=Comparison(name,
459  join(self.directory.mother_dir,self.directory.name),
460  literal2root(content["obj_as_string"],content["type"]),
461  literal2root(contents2[name]["obj_as_string"],content["type"]),
462  deepcopy(the_test),
463  do_pngs=self.do_pngs)
464  self_directory_comparisons.append(comparison)
465 
466 
467  for walker in walkers:
468  walker.join()
469  walker_directory=walker.directory
470  if not walker_directory.is_empty():
471  self_directory_directories.append(walker_directory)
472 
473 #-------------------------------------------------------------------------------
474 
def literal2root(literal, rootType, debug=False)
Definition: ROOTData.py:53
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19

Member Data Documentation

◆ base2

dqm_interfaces.DirWalkerDB.base2

Definition at line 402 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

◆ black_list

dqm_interfaces.DirWalkerDB.black_list

Definition at line 408 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

◆ comm1

dqm_interfaces.DirWalkerDB.comm1

Definition at line 400 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

◆ comm2

dqm_interfaces.DirWalkerDB.comm2

Definition at line 401 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

◆ depth

dqm_interfaces.DirWalkerDB.depth

Definition at line 404 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

◆ directory

dqm_interfaces.DirWalkerDB.directory

◆ do_pngs

dqm_interfaces.DirWalkerDB.do_pngs

Definition at line 405 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

◆ stat_test

dqm_interfaces.DirWalkerDB.stat_test

Definition at line 407 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

◆ test_threshold

dqm_interfaces.DirWalkerDB.test_threshold

Definition at line 406 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().