CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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__
 
def run
 

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 392 of file dqm_interfaces.py.

Constructor & Destructor Documentation

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 396 of file dqm_interfaces.py.

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

Member Function Documentation

def dqm_interfaces.DirWalkerDB.run (   self)

Definition at line 410 of file dqm_interfaces.py.

References dqm_interfaces.DirWalkerDB.base2, dqm_interfaces.DirWalkerDB.black_list, dqm_interfaces.DirWalkerDB.comm1, dqm_interfaces.DirWalkerDB.comm2, DBlmapWriter::_LMapRowHBEF.depth, MyHcalDetId.depth, HBHOCellParameters.depth, CaloPoint.depth, HcalChannelId.depth, HcalNumberingFromDDD::HcalID.depth, HFShower::Hit.depth, reco::CastorJetID.depth, LutXml::_Config.depth, ZdcShowerLibrary::Hit.depth, HFGflash::Hit.depth, HFShowerParam::Hit.depth, HECellParameters.depth, LMapRow.depth, HFShowerLibrary::Hit.depth, LMapLoader::_LMapRowHBEF.depth, HFCellParameters.depth, XMLHTRZeroSuppressionLoader::_datasetDBConfig.depth, cms::MinBias.depth, LMapDetId.depth, XMLProcessor::_LMapRowHBEF.depth, Raddam_ch.depth, cms::Analyzer_minbias.depth, EtaPhiHists.depth, dqm_interfaces.DirID.depth, dqm_interfaces.DirWalkerDB.depth, HcalObjRepresent::ADataRepr.depth, TiXmlPrinter.depth, dirstructure.Directory.do_pngs, dirstructure.Comparison.do_pngs, dqm_interfaces.DirWalkerDB.do_pngs, join(), list(), ROOTData.literal2root(), runtimedef.set(), dqm_interfaces.DirWalkerDB.stat_test, and dqm_interfaces.DirWalkerDB.test_threshold.

411  def run(self):
412 
413  this_dir=DirID(self.directory.name,self.depth)
414  if this_dir in self.black_list:
415  print "Skipping %s since blacklisted!" %this_dir
416  return 0
417 
418  self.depth+=1
419 
420  the_test=Statistical_Tests[self.stat_test](self.test_threshold)
421  #print "Test %s with threshold %s" %(self.stat_test,self.test_threshold)
422 
423  directory1=self.base1+"/"+self.directory.mother_dir+"/"+self.directory.name
424  directory2=self.base2+"/"+self.directory.mother_dir+"/"+self.directory.name
425 
426  fetchers =(DirFetcher(self.comm1,directory1),DirFetcher(self.comm2,directory2))
427  for fetcher in fetchers:
428  fetcher.start()
429  for fetcher in fetchers:
430  fetcher.join()
431 
432  contents1 = fetchers[0].contents
433  contents2 = fetchers[1].contents
434  set1= set(contents1.keys())
435  set2= set(contents2.keys())
436 
437  walkers=[]
438  self_directory_directories=self.directory.subdirs
439  self_directory_comparisons=self.directory.comparisons
440  contents_names=list(set1.intersection(set2))
441 
442  for name in contents_names:
443  content = contents1[name]
444  if "dir" in content["type"]:
445  #if this_dir not in DirWalker.white_list:continue
446  subdir=Directory(name,join(self.directory.mother_dir,self.directory.name))
447  dirwalker=DirWalkerDB(self.comm1,self.comm2,self.base1,self.base2,subdir,self.depth,
448  self.do_pngs,self.stat_test,self.test_threshold,self.black_list)
449  dirwalker.start()
450  walkers.append(dirwalker)
451  n_threads=activeCount()
452  if n_threads>5:
453  #print >> stderr, "Threads that are running: %s. Joining them." %(n_threads)
454  dirwalker.join()
455  elif content["kind"]=="ROOT":
456 # print directory1,name
457  comparison=Comparison(name,
458  join(self.directory.mother_dir,self.directory.name),
459  literal2root(content["obj_as_string"],content["type"]),
460  literal2root(contents2[name]["obj_as_string"],content["type"]),
461  deepcopy(the_test),
462  do_pngs=self.do_pngs)
463  self_directory_comparisons.append(comparison)
464 
465 
466  for walker in walkers:
467  walker.join()
468  walker_directory=walker.directory
469  if not walker_directory.is_empty():
470  self_directory_directories.append(walker_directory)
471 
472 #-------------------------------------------------------------------------------
def literal2root
Definition: ROOTData.py:24
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void set(const std::string &name, int value)
set the flag, with a run-time name

Member Data Documentation

dqm_interfaces.DirWalkerDB.base2

Definition at line 400 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dqm_interfaces.DirWalkerDB.black_list

Definition at line 406 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dqm_interfaces.DirWalkerDB.comm1

Definition at line 398 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dqm_interfaces.DirWalkerDB.comm2

Definition at line 399 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dqm_interfaces.DirWalkerDB.depth

Definition at line 402 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dqm_interfaces.DirWalkerDB.directory

Definition at line 401 of file dqm_interfaces.py.

Referenced by utils.unpickler.run(), and dqm_interfaces.DirWalkerFile.walk().

dqm_interfaces.DirWalkerDB.do_pngs

Definition at line 403 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dqm_interfaces.DirWalkerDB.stat_test

Definition at line 405 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dqm_interfaces.DirWalkerDB.test_threshold

Definition at line 404 of file dqm_interfaces.py.

Referenced by dqm_interfaces.DirWalkerDB.run().