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, TPComparisonTask.name, HcalOfflineHarvesting.name, HFRaddamTask.name, LaserTask.name, NoCQTask.name, PedestalTask.name, QIE10Task.name, HcalOnlineHarvesting.name, QIE11Task.name, RecHitTask.name, UMNioTask.name, ZDCTask.name, AlignableObjectId::entry.name, RawTask.name, average.Average.name, counter.Counter.name, TPTask.name, DigiTask.name, histograms.Histograms.name, LEDTask.name, cond::persistency::TAG::NAME.name, cond::persistency::RUN_INFO::RUN_NUMBER.name, TmModule.name, cond::persistency::GTEditorData.name, FWLite.ElectronMVAID.name, cond::persistency::GLOBAL_TAG::NAME.name, cond::persistency::TAG::TIME_TYPE.name, cond::persistency::RUN_INFO::START_TIME.name, cond::persistency::GLOBAL_TAG::VALIDITY.name, cond::persistency::RUN_INFO::END_TIME.name, cond::persistency::TAG::OBJECT_TYPE.name, core.autovars.NTupleVariable.name, cond::persistency::GLOBAL_TAG::DESCRIPTION.name, DQMRivetClient::NormOption.name, cond::persistency::TAG::SYNCHRONIZATION.name, cond::persistency::GLOBAL_TAG::RELEASE.name, cond::persistency::TAG::END_OF_VALIDITY.name, MEPSet.name, cond::persistency::GLOBAL_TAG::SNAPSHOT_TIME.name, cond::persistency::O2O_RUN::JOB_NAME.name, cond::persistency::GLOBAL_TAG::INSERTION_TIME.name, cond::persistency::TAG::DESCRIPTION.name, cms::dd::NameValuePair< T >.name, cond::persistency::O2O_RUN::START_TIME.name, cond::persistency::TAG::LAST_VALIDATED_TIME.name, FWTGeoRecoGeometry::Info.name, cond::persistency::O2O_RUN::END_TIME.name, cond::persistency::TAG::INSERTION_TIME.name, cond::persistency::O2O_RUN::STATUS_CODE.name, cond::persistency::TAG::MODIFICATION_TIME.name, cond::persistency::O2O_RUN::LOG.name, nanoaod::MergeableCounterTable::SingleColumn< T >.name, ParameterSet.name, cond::persistency::TAG::PROTECTION_CODE.name, preexistingValidation.PreexistingValidation.name, OutputMEPSet.name, PixelDCSObject< T >::Item.name, dataset.BaseDataset.name, SummaryTableOutputBranches::NamedBranchPtr.name, AlignmentConstraint.name, cms::dd::ValuePair< T, U >.name, fit::RootMinuitCommand.name, personalPlayback.Applet.name, Types._Untracked.name, EventStringOutputBranches::NamedBranchPtr.name, MagCylinder.name, analyzer.Analyzer.name, production_tasks.Task.name, HcalForwardLibWriter::FileHandle.name, DQMRivetClient::LumiOption.name, heppy::ParSet.name, cond::persistency::GTProxyData.name, TableOutputBranches::NamedBranchPtr.name, CharmTagger::MVAVar.name, edm::PathTimingSummary.name, DQMRivetClient::ScaleFactorOption.name, TriggerOutputBranches::NamedBranchPtr.name, HeavyIonCSVTagger::MVAVar.name, SingleObjectCondition.name, EgHLTOfflineSummaryClient::SumHistBinData.name, cms::DDAlgoArguments.name, RHStopTracer::StopPoint.name, Barrel.name, MyWatcher.name, cond::TimeTypeSpecs.name, perftools::EdmEventSize::BranchRecord.name, core.autovars.NTupleObjectType.name, edm::PathSummary.name, EcalLogicID.name, alignment.Alignment.name, lumi::TriggerInfo.name, PixelEndcapLinkMaker::Item.name, XMLProcessor::_loaderBaseConfig.name, dirstructure.Weighted.name, FWTableViewManager::TableEntry.name, MEtoEDM< T >::MEtoEDMObject.name, PixelBarrelLinkMaker::Item.name, ExpressionHisto< T >.name, PrintMaterialBudgetInfo.name, DQMGenericClient::EfficOption.name, python.rootplot.utilities.Hist2D.name, TreeCrawler.Package.name, Supermodule.name, cond::persistency::GLOBAL_TAG_MAP::GLOBAL_TAG_NAME.name, genericValidation.GenericValidation.name, CaloTrkProcessing::Detector.name, options.ConnectionHLTMenu.name, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, MVAVar.name, cond::persistency::GLOBAL_TAG_MAP::TAG_NAME.name, cms::DDParsingContext::CompositeMaterial.name, DisplayManager.DisplayManager.name, FWLite.WorkingPoints.name, cond::Tag_t.name, FastHFShowerLibrary.name, dqmoffline::l1t::HistDefinition.name, DQMGenericClient::ProfileOption.name, magneticfield::BaseVolumeHandle.name, nanoaod::MergeableCounterTable::VectorColumn< T >.name, PhysicsTools::Variable::Value.name, emtf::Node.name, h4DSegm.name, BTagProbabilityToDiscriminator::Discriminator.name, DQMGenericClient::NormOption.name, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.name, looper.Looper.name, DQMGenericClient::CDOption.name, PhysicsTools::Calibration::Variable.name, TriggerObjectTableProducer::SelectedObject.name, cond::TagInfo_t.name, TrackerSectorStruct.name, MuonGeometrySanityCheckPoint.name, cond::persistency::PAYLOAD::HASH.name, FCDTask.name, DQMGenericClient::NoFlowOption.name, CounterChecker.name, Mapper::definition< ScannerT >.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, cond::persistency::PAYLOAD::DATA.name, EDMtoMEConverter.name, python.rootplot.tree2hists.Plot.name, cond::persistency::PAYLOAD::STREAMER_INFO.name, cond::persistency::PAYLOAD::VERSION.name, cond::persistency::PAYLOAD::INSERTION_TIME.name, PhysicsTools::TreeReader::Value.name, classes.MonitorData.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, HistogramManager.name, classes.OutputData.name, Crystal.name, h2DSegm.name, options.HLTProcessOptions.name, cond::persistency::IOV::TAG_NAME.name, cond::persistency::IOV::SINCE.name, utils.StatisticalTest.name, cond::persistency::IOV::PAYLOAD_HASH.name, cond::persistency::IOV::INSERTION_TIME.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, config.Service.name, BulkSilicon.name, CaloSD::Detector.name, APD.name, nanoaod::FlatTable::Column.name, core.autovars.NTupleCollection.name, NanoAODDQM::SelGroupConfig.name, BPHRecoBuilder::BPHRecoSource.name, BPHRecoBuilder::BPHCompSource.name, StraightTrackAlignment::RPSetPlots.name, cond::persistency::TAG_AUTHORIZATION::TAG_NAME.name, cond::persistency::TAG_AUTHORIZATION::ACCESS_TYPE.name, cond::persistency::TAG_AUTHORIZATION::CREDENTIAL.name, cond::persistency::TAG_AUTHORIZATION::CREDENTIAL_TYPE.name, InnerLayerVolume.name, cond::payloadInspector::TagReference.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, 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, SingleObjectCondition.threshold, HLTLogMonitorFilter::CategoryEntry.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