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 99 of file utils.py.

Constructor & Destructor Documentation

def utils.StatisticalTest.__init__ (   self,
  threshold 
)

Definition at line 100 of file utils.py.

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

Member Function Documentation

def utils.StatisticalTest.do_test (   self)

Definition at line 163 of file utils.py.

Referenced by utils.StatisticalTest.get_rank().

164  def do_test(self):
165  pass
166 
167 #-------------------------------------------------------------------------------
def utils.StatisticalTest.get_rank (   self)

Definition at line 112 of file utils.py.

References utils.StatisticalTest.do_test(), utils.getNbins(), FitSlicesYTool.h1, ConfigurableHisto.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().

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

Definition at line 153 of file utils.py.

References utils.StatisticalTest.get_rank(), utils.logger(), entry.name, genericValidation.GenericValidation.name, TmModule.name, cond::persistency::GLOBAL_TAG::NAME.name, cond::persistency::TAG::NAME.name, cond::persistency::TAG::TIME_TYPE.name, cond::persistency::GLOBAL_TAG::VALIDITY.name, cond::persistency::TAG::OBJECT_TYPE.name, cond::persistency::GLOBAL_TAG::DESCRIPTION.name, cond::persistency::TAG::SYNCHRONIZATION.name, EventMonitor::Entry.name, cond::persistency::GLOBAL_TAG::RELEASE.name, ora::RecordSpecImpl::Item.name, cond::persistency::TAG::END_OF_VALIDITY.name, cond::persistency::GLOBAL_TAG::SNAPSHOT_TIME.name, cond::persistency::GTEditorData.name, cond::persistency::TAG::DESCRIPTION.name, cond::persistency::GLOBAL_TAG::INSERTION_TIME.name, cond::persistency::TAG::LAST_VALIDATED_TIME.name, FWTGeoRecoGeometry::Info.name, Types._Untracked.name, alignment.Alignment.name, cond::persistency::TAG::INSERTION_TIME.name, cond::persistency::TAG::MODIFICATION_TIME.name, ParameterSet.name, fit::RootMinuitCommand.name, CombinedMVAJetTagComputer::Computer.name, PixelDCSObject< class >::Item.name, DQMRivetClient::LumiOption.name, MagCylinder.name, PrintSensitive.name, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.name, cond::persistency::GTProxyData.name, RHStopTracer::StopPoint.name, DQMRivetClient::ScaleFactorOption.name, SingleObjectCondition.name, EgHLTOfflineSummaryClient::SumHistBinData.name, DQMGenericClient::EfficOption.name, PhysicsTools::Source.name, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, MyWatcher.name, edm::PathTimingSummary.name, dirstructure.Weighted.name, cond::TimeTypeSpecs.name, lumi::TriggerInfo.name, edm::PathSummary.name, cond::persistency::GLOBAL_TAG_MAP::GLOBAL_TAG_NAME.name, PrintMaterialBudgetInfo.name, perftools::EdmEventSize::BranchRecord.name, PixelEndcapLinkMaker::Item.name, FWTableViewManager::TableEntry.name, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, PixelBarrelLinkMaker::Item.name, options.ConnectionHLTMenu.name, EcalLogicID.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, Mapper::definition< ScannerT >.name, cond::persistency::GLOBAL_TAG_MAP::TAG_NAME.name, ExpressionHisto< T >.name, McSelector.name, SensitiveDetector.name, RecoSelector.name, python.rootplot.utilities.Hist2D.name, XMLProcessor::_loaderBaseConfig.name, DQMGenericClient::NormOption.name, cond::persistency::PAYLOAD::HASH.name, TreeCrawler.Package.name, TrajectorySeedProducer::LayerSpec.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, CaloTrkProcessing::Detector.name, cond::persistency::PAYLOAD::DATA.name, PrintGeomInfoAction.name, cond::persistency::PAYLOAD::STREAMER_INFO.name, HcalForwardLibWriter::FileHandle.name, cond::persistency::PAYLOAD::VERSION.name, MagGeoBuilderFromDDD::volumeHandle.name, PrintGeomMatInfo.name, DQMGenericClient::CDOption.name, cond::persistency::PAYLOAD::INSERTION_TIME.name, PhysicsTools::Calibration::Variable.name, cond::TagInfo_t.name, h4DSegm.name, PhysicsTools::Variable::Value.name, options.HLTProcessOptions.name, EDMtoMEConverter.name, ProcTMVA::Method.name, TreeSaver::Var.name, python.rootplot.tree2hists.Plot.name, MEtoEDM< T >::MEtoEDMObject.name, cond::persistency::IOV::TAG_NAME.name, cond::persistency::IOV::SINCE.name, cond::persistency::IOV::PAYLOAD_HASH.name, cond::persistency::IOV::INSERTION_TIME.name, PhysicsTools::TreeReader::Value.name, MuonGeometrySanityCheckPoint.name, PhysicsTools::TrainProcessor.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, h2DSegm.name, python.rootplot.utilities.Hist.name, BscSD.name, DQMNet::WaitObject.name, AlpgenParameterName.name, SiStripMonitorDigi.name, FP420SD.name, cond::persistency::TAG_MIGRATION::SOURCE_ACCOUNT.name, cond::persistency::TAG_MIGRATION::SOURCE_TAG.name, cond::persistency::TAG_MIGRATION::TAG_NAME.name, cond::persistency::TAG_MIGRATION::STATUS_CODE.name, cond::persistency::TAG_MIGRATION::INSERTION_TIME.name, public_plots_tools.ColorScheme.name, PhysicsTools::Variable.name, PhysicsTools::TrainerMonitoring::Object.name, FastTimerService::LuminosityDescription.name, conddblib.Tag.name, conddblib.GlobalTag.name, plotscripts.SawTeethFunction.name, dirstructure.Comparison.name, @16310::Id.name, dqm_interfaces.DirID.name, FastTimerService::ProcessDescription.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, dqm_interfaces.DirWalkerFile.name, BeautifulSoup.Tag.name, @16306::Id.name, TiXmlAttribute.name, BeautifulSoup.SoupStrainer.name, utils.StatisticalTest.rank, dirstructure.Comparison.rank, CrabWatch.CrabWatch.threshold, muonisolation::Cuts::CutSpec.threshold, EcalTPGFineGrainStripEE::Item.threshold, GaussNoiseFP420.threshold, SiGaussianTailNoiseAdder.threshold, JetVertexMain.threshold, HLTLogMonitorFilter::CategoryEntry.threshold, SingleObjectCondition.threshold, MatchJet.threshold, CondFormats_ESObjects::dictionary.threshold, SingleObjectTrigger.threshold, MuIsolatorResultProducer< BT >::DepositConf.threshold, edm::service::MessageLoggerDefaults::Category.threshold, IsASeed.threshold, edm::service::MessageLoggerDefaults::Destination.threshold, edm::MessageLoggerQ.threshold, utils.StatisticalTest.threshold, EcalTrigPrimFunctionalAlgo.threshold, SiStripHitEffFromCalibTree.threshold, and edm::service::ELdestination.threshold.

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

Definition at line 108 of file utils.py.

References FitSlicesYTool.h1, ConfigurableHisto.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.

109  def set_operands(self,h1,h2):
110  self.h1=h1
111  self.h2=h2

Member Data Documentation

utils.StatisticalTest.h1

Definition at line 102 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 103 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 106 of file utils.py.

Referenced by utils.StatisticalTest.get_rank().

utils.StatisticalTest.name

Definition at line 101 of file utils.py.

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

utils.StatisticalTest.rank

2D! return test_codes["2D"]

Definition at line 105 of file utils.py.

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

utils.StatisticalTest.threshold

Definition at line 104 of file utils.py.

Referenced by utils.StatisticalTest.get_status().