CMS 3D CMS Logo

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__ (self, threshold)
 
def do_test (self)
 
def get_rank (self)
 
def get_status (self)
 
def set_operands (self, h1, h2)
 

Public Attributes

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

Detailed Description

Definition at line 111 of file utils.py.

Constructor & Destructor Documentation

◆ __init__()

def utils.StatisticalTest.__init__ (   self,
  threshold 
)

Reimplemented in utils.BinToBin1percent, utils.BinToBin, utils.Chi2, and utils.KS.

Definition at line 112 of file utils.py.

112  def __init__(self,threshold):
113  self.name=""
114  self.h1=None
115  self.h2=None
116  self.threshold=float(threshold)
117  self.rank=-1
118  self.is_init=False
119 

Member Function Documentation

◆ do_test()

def utils.StatisticalTest.do_test (   self)

Reimplemented in utils.BinToBin1percent, utils.BinToBin, utils.Chi2, and utils.KS.

Definition at line 174 of file utils.py.

174  def do_test(self):
175  pass
176 
177 #-------------------------------------------------------------------------------
178 

Referenced by utils.StatisticalTest.get_rank().

◆ get_rank()

def utils.StatisticalTest.get_rank (   self)

Definition at line 124 of file utils.py.

124  def get_rank(self):
125  if not self.is_init:
126  if self.rank < 0:
127  type1=type(self.h1)
128  type2=type(self.h2)
129  if (type1 != type2):
130  logger(1,"*** ERROR: object types in comparison don't match: %s!=%s" %(type1,type2))
131  self.rank=test_codes["DIFF_TYPES"]
132  elif not self.h2.InheritsFrom("TH1"):
133  logger(1,"*** ERROR: object type is not histogram but a %s" %(type1))
134  self.rank=test_codes["NO_HIST"]
135  # if histos are empty
136  #elif self.h1.InheritsFrom("TH2") and not "BinToBin" in self.name:
137 
139  else:
140  is_empty1=is_empty(self.h1)
141  is_empty2=is_empty(self.h2)
142  are_empty=is_empty1 and is_empty2
143  one_empty=is_empty1 or is_empty2
144 
145  Nbins1= getNbins(self.h1)
146  Nbins2= getNbins(self.h2)
147 
148  if are_empty:
149  #return -103
150  # Conversation with JeanRoch and David 5 April
151  return 1
152  elif one_empty:
153  # Due conversation with Giovanni on 2015-09-10
154  return 0
155 
156  # if histos have different number of bins
157  if Nbins1!=Nbins2:
158  return test_codes["DIFF_BIN"]
159 
160  self.rank=self.do_test()
161  self.is_init=True
162  return self.rank
163 

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

Referenced by utils.StatisticalTest.get_status().

◆ get_status()

def utils.StatisticalTest.get_status (   self)

Definition at line 164 of file utils.py.

164  def get_status(self):
165  status = SUCCESS
166  if self.get_rank()<0:
167  status=NULL
168  logger(0,"+++ Test %s FAILED: rank is %s and threshold is %s ==> %s" %(self.name, self.rank, self.threshold, status))
169  elif self.get_rank() < self.threshold:
170  status=FAIL
171  logger(0,"+++ Test %s: rank is %s and threshold is %s ==> %s" %(self.name, self.rank, self.threshold, status))
172  return status
173 

References utils.StatisticalTest.get_rank(), ElectronMVAID.ElectronMVAID.name, DigiComparisonTask.name, TestTask.name, TPComparisonTask.name, HcalOfflineHarvesting.name, HcalOnlineHarvesting.name, HFRaddamTask.name, LaserTask.name, NoCQTask.name, PedestalTask.name, QIE10Task.name, QIE11Task.name, RecHitTask.name, UMNioTask.name, ZDCTask.name, RawTask.name, AlignableObjectId::entry.name, average.Average.name, counter.Counter.name, TPTask.name, DigiTask.name, histograms.Histograms.name, LEDTask.name, cond::persistency::TAG::NAME.name, cond::persistency::GTEditorData.name, TmModule.name, FWLite.ElectronMVAID.name, cond::persistency::GLOBAL_TAG::NAME.name, cond::persistency::RUN_INFO::RUN_NUMBER.name, cond::persistency::TAG::TIME_TYPE.name, cond::persistency::GLOBAL_TAG::VALIDITY.name, cond::persistency::RUN_INFO::START_TIME.name, cond::persistency::TAG::OBJECT_TYPE.name, core.autovars.NTupleVariable.name, cond::persistency::GLOBAL_TAG::DESCRIPTION.name, cond::persistency::RUN_INFO::END_TIME.name, cond::persistency::TAG::SYNCHRONIZATION.name, cond::persistency::GLOBAL_TAG::RELEASE.name, DQMRivetClient::NormOption.name, cond::persistency::TAG::END_OF_VALIDITY.name, MEPSet.name, cond::persistency::GLOBAL_TAG::SNAPSHOT_TIME.name, cms::dd::NameValuePair< T >.name, cond::persistency::TAG::DESCRIPTION.name, cond::persistency::GLOBAL_TAG::INSERTION_TIME.name, cond::persistency::TAG::LAST_VALIDATED_TIME.name, cond::persistency::TAG::INSERTION_TIME.name, FWTGeoRecoGeometry::Info.name, cond::persistency::TAG::MODIFICATION_TIME.name, nanoaod::MergeableCounterTable::SingleColumn< T >.name, ParameterSet.name, preexistingValidation.PreexistingValidation.name, OutputMEPSet.name, PixelDCSObject< T >::Item.name, cms::DDSpecPar.name, SummaryTableOutputBranches::NamedBranchPtr.name, cms::dd::ValuePair< T, U >.name, dataset.BaseDataset.name, fit::RootMinuitCommand.name, personalPlayback.Applet.name, EventStringOutputBranches::NamedBranchPtr.name, Types._Untracked.name, MagCylinder.name, ParSet.name, analyzer.Analyzer.name, HcalForwardLibWriter::FileHandle.name, DQMRivetClient::LumiOption.name, production_tasks.Task.name, cond::persistency::GTProxyData.name, Barrel.name, TableOutputBranches::NamedBranchPtr.name, CharmTagger::MVAVar.name, DQMRivetClient::ScaleFactorOption.name, TriggerOutputBranches::NamedBranchPtr.name, EgHLTOfflineSummaryClient::SumHistBinData.name, edm::PathTimingSummary.name, cms::DDAlgoArguments.name, RHStopTracer::StopPoint.name, SingleObjectCondition.name, cond::TimeTypeSpecs.name, perftools::EdmEventSize::BranchRecord.name, core.autovars.NTupleObjectType.name, MyWatcher.name, edm::PathSummary.name, EcalLogicID.name, CaloTrkProcessing::Detector.name, lumi::TriggerInfo.name, alignment.Alignment.name, PixelEndcapLinkMaker::Item.name, dirstructure.Weighted.name, XMLProcessor::_loaderBaseConfig.name, MEtoEDM< T >::MEtoEDMObject.name, FWTableViewManager::TableEntry.name, PixelBarrelLinkMaker::Item.name, ExpressionHisto< T >.name, PrintMaterialBudgetInfo.name, DQMGenericClient::EfficOption.name, Supermodule.name, python.rootplot.utilities.Hist2D.name, TreeCrawler.Package.name, cond::persistency::GLOBAL_TAG_MAP::GLOBAL_TAG_NAME.name, genericValidation.GenericValidation.name, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, options.ConnectionHLTMenu.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, MVAVar.name, cond::persistency::GLOBAL_TAG_MAP::TAG_NAME.name, DisplayManager.DisplayManager.name, cond::Tag_t.name, FWLite.WorkingPoints.name, dqmoffline::l1t::HistDefinition.name, DQMGenericClient::ProfileOption.name, FastHFShowerLibrary.name, nanoaod::MergeableCounterTable::VectorColumn< T >.name, magneticfield::BaseVolumeHandle.name, PhysicsTools::Variable::Value.name, cms::DDParsingContext::CompositeMaterial.name, emtf::Node.name, h4DSegm.name, BTagProbabilityToDiscriminator::Discriminator.name, DQMGenericClient::NormOption.name, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.name, cond::persistency::PAYLOAD::HASH.name, looper.Looper.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, DQMGenericClient::CDOption.name, PhysicsTools::Calibration::Variable.name, cond::TagInfo_t.name, TriggerObjectTableProducer::SelectedObject.name, cond::persistency::PAYLOAD::DATA.name, cond::persistency::PAYLOAD::STREAMER_INFO.name, TrackerSectorStruct.name, cond::persistency::PAYLOAD::VERSION.name, cond::persistency::PAYLOAD::INSERTION_TIME.name, MuonGeometrySanityCheckPoint.name, FCDTask.name, DQMGenericClient::NoFlowOption.name, CounterChecker.name, Mapper::definition< ScannerT >.name, python.rootplot.tree2hists.Plot.name, EDMtoMEConverter.name, PhysicsTools::TreeReader::Value.name, classes.MonitorData.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, HistogramManager.name, classes.OutputData.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, Crystal.name, cond::persistency::IOV::TAG_NAME.name, cond::persistency::IOV::SINCE.name, h2DSegm.name, cond::persistency::IOV::PAYLOAD_HASH.name, cond::persistency::IOV::INSERTION_TIME.name, options.HLTProcessOptions.name, utils.StatisticalTest.name, DQMNet::WaitObject.name, core.TriggerBitAnalyzer.TriggerBitAnalyzer.name, python.rootplot.utilities.Hist.name, AlpgenParameterName.name, config.Analyzer.name, geometry.Structure.name, core.autovars.NTupleSubObject.name, Capsule.name, core.autovars.NTupleObject.name, Ceramic.name, PhysicsTools::Variable.name, SiStripMonitorDigi.name, BulkSilicon.name, config.Service.name, APD.name, nanoaod::FlatTable::Column.name, NanoAODDQM::SelGroupConfig.name, core.autovars.NTupleCollection.name, BPHRecoBuilder::BPHRecoSource.name, cond::payloadInspector::TagReference.name, BPHRecoBuilder::BPHCompSource.name, cond::persistency::TAG_LOG::TAG_NAME.name, cond::persistency::TAG_LOG::EVENT_TIME.name, cond::persistency::TAG_LOG::USER_NAME.name, cond::persistency::TAG_LOG::HOST_NAME.name, cond::persistency::TAG_LOG::COMMAND.name, cond::persistency::TAG_LOG::ACTION.name, cond::persistency::TAG_LOG::USER_TEXT.name, InnerLayerVolume.name, personalPlayback.FrameworkJob.name, Grid.name, Grille.name, BackPipe.name, plotscripts.SawTeethFunction.name, dirstructure.Comparison.name, dqm_interfaces.DirID.name, PatchPanel.name, BackCoolTank.name, DryAirTube.name, crabFunctions.CrabTask.name, python.rootplot.utilities.RootFile.name, MBCoolTube.name, MBManif.name, cscdqm::ParHistoDef.name, hTMaxCell.name, BeautifulSoup.Tag.name, dqm_interfaces.DirWalkerFile.name, SummaryOutputProducer::GenericSummary.name, BeautifulSoup.SoupStrainer.name, utils.StatisticalTest.rank, l1t::EMTFTrack.rank, dirstructure.Comparison.rank, EcalTPGFineGrainStripEE::Item.threshold, GaussNoiseFP420.threshold, muonisolation::Cuts::CutSpec.threshold, SiGaussianTailNoiseAdder.threshold, JetVertexMain.threshold, HLTLogMonitorFilter::CategoryEntry.threshold, SingleObjectCondition.threshold, MatchJet.threshold, CondFormats_ESObjects::dictionary.threshold, SingleObjectTrigger.threshold, FastLineRecognition.threshold, TotemRPUVPatternFinder.threshold, MuIsolatorResultProducer< BT >::DepositConf.threshold, edm::service::MessageLoggerDefaults::Category.threshold, edm::service::MessageLoggerDefaults::Destination.threshold, edm::MessageLoggerQ.threshold, EcalEBTrigPrimTestAlgo.threshold, utils.StatisticalTest.threshold, edm::service::ELdestination.threshold, SiStripHitEffFromCalibTree.threshold, and EcalTrigPrimFunctionalAlgo.threshold.

◆ set_operands()

def utils.StatisticalTest.set_operands (   self,
  h1,
  h2 
)

Member Data Documentation

◆ h1

utils.StatisticalTest.h1

◆ h2

utils.StatisticalTest.h2

◆ is_init

utils.StatisticalTest.is_init

Definition at line 118 of file utils.py.

Referenced by utils.StatisticalTest.get_rank().

◆ name

utils.StatisticalTest.name

◆ rank

utils.StatisticalTest.rank

2D! return test_codes["2D"]

Definition at line 117 of file utils.py.

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

◆ threshold

utils.StatisticalTest.threshold

Definition at line 116 of file utils.py.

Referenced by utils.StatisticalTest.get_status().

dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
logger
Definition: logger.py:1
utils.is_empty
def is_empty(h)
Definition: utils.py:179
utils.getNbins
def getNbins(h)
Definition: utils.py:94