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
utils.StatisticalTest Class Reference
Inheritance diagram for utils.StatisticalTest:
utils.BinToBin utils.BinToBin1percent utils.Chi2 utils.KS

Public Member Functions

def __init__
 
def do_test
 
def get_rank
 
def get_status
 
def set_operands
 

Public Attributes

 h1
 
 h2
 
 is_init
 
 name
 
 rank
 2D! return test_codes["2D"] More...
 
 threshold
 

Detailed Description

Definition at line 102 of file utils.py.

Constructor & Destructor Documentation

def utils.StatisticalTest.__init__ (   self,
  threshold 
)

Definition at line 103 of file utils.py.

104  def __init__(self,threshold):
105  self.name=""
106  self.h1=None
107  self.h2=None
108  self.threshold=float(threshold)
109  self.rank=-1
110  self.is_init=False
rank
2D! return test_codes["2D"]
Definition: utils.py:108

Member Function Documentation

def utils.StatisticalTest.do_test (   self)

Definition at line 166 of file utils.py.

Referenced by utils.StatisticalTest.get_rank().

167  def do_test(self):
168  pass
169 
170 #-------------------------------------------------------------------------------
def utils.StatisticalTest.get_rank (   self)

Definition at line 115 of file utils.py.

References utils.StatisticalTest.do_test(), utils.getNbins(), FitSlicesYTool.h1, ConfigurableHisto.h1, XmasToDQMSource.h1, DQMSourceExample.h1, utils.StatisticalTest.h1, PlotAlignmentValidation::DMRPlotInfo.h1, FitSlicesYTool.h2, EgammaTowerIsolationNew< NC >::Sum.h2, ConfigurableHisto.h2, EgammaTowerIsolationNew< NC >.h2, DQMSourceExample.h2, utils.StatisticalTest.h2, PlotAlignmentValidation::DMRPlotInfo.h2, utils.is_empty(), utils.StatisticalTest.is_init, utils.logger(), utils.StatisticalTest.rank, and dirstructure.Comparison.rank.

Referenced by utils.StatisticalTest.get_status().

116  def get_rank(self):
117  if not self.is_init:
118  if self.rank < 0:
119  type1=type(self.h1)
120  type2=type(self.h2)
121  if (type1 != type2):
122  logger(1,"*** ERROR: object types in comparison don't match: %s!=%s" %(type1,type2))
123  self.rank=test_codes["DIFF_TYPES"]
124  elif not self.h2.InheritsFrom("TH1"):
125  logger(1,"*** ERROR: object type is not histogram but a %s" %(type1))
126  self.rank=test_codes["NO_HIST"]
127  # if histos are empty
128  #elif self.h1.InheritsFrom("TH2") and not "BinToBin" in self.name:
129  ## 2D!
130  #return test_codes["2D"]
131  else:
132  is_empty1=is_empty(self.h1)
133  is_empty2=is_empty(self.h2)
134  are_empty=is_empty1 and is_empty2
135  one_empty=is_empty1 or is_empty2
136 
137  Nbins1= getNbins(self.h1)
138  Nbins2= getNbins(self.h2)
139 
140  if are_empty:
141  #return -103
142  # Conversation with JeanRoch and David 5 April
143  return 1
144  elif one_empty:
145  #return -103
146  # Conversation with JeanRoch and David 5 April
147  return 1
148 
149  # if histos have different number of bins
150  if Nbins1!=Nbins2:
151  return test_codes["DIFF_BIN"]
152 
153  self.rank=self.do_test()
154  self.is_init=True
155  return self.rank
rank
2D! return test_codes[&quot;2D&quot;]
Definition: utils.py:108
def logger
Definition: utils.py:47
def is_empty
Definition: utils.py:171
def getNbins
Definition: utils.py:92
def utils.StatisticalTest.get_status (   self)

Definition at line 156 of file utils.py.

References utils.StatisticalTest.get_rank(), utils.logger(), cond::TagInfo.name, entry.name, genericValidation.GenericValidation.name, TmModule.name, Select.name, ora::RecordSpecImpl::Item.name, FWTGeoRecoGeometry::Info.name, Types._Untracked.name, alignment.Alignment.name, GifDisplay.name, Button.name, PixelDCSObject< class >::Item.name, fit::RootMinuitCommand.name, ParameterSet.name, SeedingLayerSetsBuilder::LayerSpec.name, DQMRivetClient::LumiOption.name, MagCylinder.name, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.name, PrintSensitive.name, RHStopTracer::StopPoint.name, CombinedMVAJetTagComputer::Computer.name, DQMRivetClient::ScaleFactorOption.name, EgHLTOfflineSummaryClient::SumHistBinData.name, PhysicsTools::Source.name, CSCDCCExaminer::OStream.name, MyWatcher.name, lumi::TriggerInfo.name, SingleObjectCondition.name, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, cond::TimeTypeSpecs.name, PrintMaterialBudgetInfo.name, DQMGenericClient::EfficOption.name, edm::PathSummary.name, dirstructure.Weighted.name, PixelEndcapLinkMaker::Item.name, perftools::EdmEventSize::BranchRecord.name, FWTableViewManager::TableEntry.name, PixelBarrelLinkMaker::Item.name, Mapper::definition< ScannerT >.name, options.ConnectionHLTMenu.name, McSelector.name, EcalLogicID.name, ExpressionHisto< T >.name, MEtoEDM< T >::MEtoEDMObject.name, RecoSelector.name, python.rootplot.utilities.Hist2D.name, TreeCrawler.Package.name, XMLProcessor::_loaderBaseConfig.name, CaloTrkProcessing::Detector.name, SensitiveDetector.name, PrintGeomInfoAction.name, HcalForwardLibWriter::FileHandle.name, PrintGeomMatInfo.name, MagGeoBuilderFromDDD::volumeHandle.name, DQMGenericClient::NormOption.name, PhysicsTools::Calibration::Variable.name, DQMGenericClient::CDOption.name, h4DSegm.name, PhysicsTools::Variable::Value.name, options.HLTProcessOptions.name, ProcTMVA::Method.name, EDMtoMEConverter.name, TreeSaver::Var.name, python.rootplot.tree2hists.Plot.name, MuonGeometrySanityCheckPoint.name, PhysicsTools::TrainProcessor.name, PhysicsTools::TreeReader::Value.name, TotemSD.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, utils.StatisticalTest.name, PhysicsTools::MVATrainer.name, EfficiencyHandler.name, h2DSegm.name, python.rootplot.utilities.Hist.name, BscSD.name, stor::DataSenderMonitorCollection::OutputModuleRecord.name, DQMNet::WaitObject.name, SiStripMonitorDigi.name, AlpgenParameterName.name, FP420SD.name, Vardesc.name, public_plots_tools.ColorScheme.name, PhysicsTools::Variable.name, Namelist.name, PhysicsTools::TrainerMonitoring::Object.name, stor::DataSenderMonitorCollection::OutputModuleResult.name, plotscripts.SawTeethFunction.name, dirstructure.Comparison.name, @16190::Id.name, dqm_interfaces.DirID.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, dqm_interfaces.DirWalkerFile.name, @16186::Id.name, BeautifulSoup.SoupStrainer.name, TiXmlAttribute.name, utils.StatisticalTest.rank, dirstructure.Comparison.rank, CrabWatch.CrabWatch.threshold, EcalTPGFineGrainStripEE::Item.threshold, muonisolation::Cuts::CutSpec.threshold, GaussNoiseFP420.threshold, SiGaussianTailNoiseAdder.threshold, JetVertexMain.threshold, SingleObjectCondition.threshold, HLTLogMonitorFilter::CategoryEntry.threshold, MatchJet.threshold, dictionary.threshold, SingleObjectTrigger.threshold, IsASeed.threshold, MuIsolatorResultProducer< BT >::DepositConf.threshold, edm::service::MessageLoggerDefaults::Category.threshold, edm::service::MessageLoggerDefaults::Destination.threshold, edm::MessageLoggerQ.threshold, utils.StatisticalTest.threshold, EcalTrigPrimFunctionalAlgo.threshold, SiStripHitEffFromCalibTree.threshold, and edm::service::ELdestination.threshold.

157  def get_status(self):
158  status = SUCCESS
159  if self.get_rank()<0:
160  status=NULL
161  logger(0,"+++ Test %s FAILED: rank is %s and threshold is %s ==> %s" %(self.name, self.rank, self.threshold, status))
162  elif self.get_rank() < self.threshold:
163  status=FAIL
164  logger(0,"+++ Test %s: rank is %s and threshold is %s ==> %s" %(self.name, self.rank, self.threshold, status))
165  return status
rank
2D! return test_codes[&quot;2D&quot;]
Definition: utils.py:108
def logger
Definition: utils.py:47
def utils.StatisticalTest.set_operands (   self,
  h1,
  h2 
)

Definition at line 111 of file utils.py.

References FitSlicesYTool.h1, ConfigurableHisto.h1, XmasToDQMSource.h1, DQMSourceExample.h1, utils.StatisticalTest.h1, PlotAlignmentValidation::DMRPlotInfo.h1, FitSlicesYTool.h2, EgammaTowerIsolationNew< NC >::Sum.h2, ConfigurableHisto.h2, EgammaTowerIsolationNew< NC >.h2, DQMSourceExample.h2, utils.StatisticalTest.h2, and PlotAlignmentValidation::DMRPlotInfo.h2.

112  def set_operands(self,h1,h2):
113  self.h1=h1
114  self.h2=h2

Member Data Documentation

utils.StatisticalTest.h1

Definition at line 105 of file utils.py.

Referenced by utils.Chi2.absval(), utils.Chi2.check_filled_bins(), utils.KS.do_test(), utils.Chi2.do_test(), utils.BinToBin.do_test(), utils.BinToBin1percent.do_test(), utils.StatisticalTest.get_rank(), and utils.StatisticalTest.set_operands().

utils.StatisticalTest.h2

Definition at line 106 of file utils.py.

Referenced by utils.Chi2.absval(), utils.Chi2.check_filled_bins(), utils.KS.do_test(), utils.Chi2.do_test(), utils.StatisticalTest.get_rank(), and utils.StatisticalTest.set_operands().

utils.StatisticalTest.is_init

Definition at line 109 of file utils.py.

Referenced by utils.StatisticalTest.get_rank().

utils.StatisticalTest.name

Definition at line 104 of file utils.py.

Referenced by dataset.Dataset.__getFileInfoList(), cuy.divideElement.__init__(), cuy.plotElement.__init__(), cuy.additionElement.__init__(), cuy.superimposeElement.__init__(), cuy.graphElement.__init__(), BeautifulSoup.Tag._invert(), utils.StatisticalTest.get_status(), and Vispa.Views.PropertyView.Property.valueChanged().

utils.StatisticalTest.rank

2D! return test_codes["2D"]

Definition at line 108 of file utils.py.

Referenced by utils.StatisticalTest.get_rank(), and utils.StatisticalTest.get_status().

utils.StatisticalTest.threshold

Definition at line 107 of file utils.py.

Referenced by utils.StatisticalTest.get_status().