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 
)

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 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ do_test()

def utils.StatisticalTest.do_test (   self)

Definition at line 174 of file utils.py.

Referenced by utils.StatisticalTest.get_rank().

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

◆ get_rank()

def utils.StatisticalTest.get_rank (   self)

Definition at line 124 of file utils.py.

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().

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 
Definition: logger.py:1
def getNbins(h)
Definition: utils.py:94
def is_empty(h)
Definition: utils.py:179

◆ get_status()

def utils.StatisticalTest.get_status (   self)

Definition at line 164 of file utils.py.

References utils.StatisticalTest.get_rank(), ElectronMVAID.ElectronMVAID.name, HcalOfflineHarvesting.name, HcalOnlineHarvesting.name, HFRaddamTask.name, LaserTask.name, NoCQTask.name, PedestalTask.name, QIE10Task.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, ParameterSet.name, nanoaod::MergeableCounterTable::SingleColumn< T >.name, cond::persistency::TAG::PROTECTION_CODE.name, preexistingValidation.PreexistingValidation.name, OutputMEPSet.name, AlignmentConstraint.name, PixelDCSObject< T >::Item.name, dataset.BaseDataset.name, SummaryTableOutputBranches::NamedBranchPtr.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, LumiOutputBranches::NamedBranchPtr.name, TableOutputBranches::NamedBranchPtr.name, TriggerOutputBranches::NamedBranchPtr.name, CharmTagger::MVAVar.name, SingleObjectCondition.name, edm::PathTimingSummary.name, DQMRivetClient::ScaleFactorOption.name, HeavyIonCSVTagger::MVAVar.name, EgHLTOfflineSummaryClient::SumHistBinData.name, cms::DDAlgoArguments.name, RHStopTracer::StopPoint.name, Barrel.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, MEtoEDM< T >::MEtoEDMObject.name, FWTableViewManager::TableEntry.name, PixelBarrelLinkMaker::Item.name, ExpressionHisto< T >.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, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, options.ConnectionHLTMenu.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, cms::DDParsingContext::CompositeMaterial.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, magneticfield::BaseVolumeHandle.name, nanoaod::MergeableCounterTable::VectorColumn< T >.name, FastHFShowerLibrary.name, emtf::Node.name, PhysicsTools::Variable::Value.name, h4DSegm.name, PrintMaterialBudgetInfo.name, BTagProbabilityToDiscriminator::Discriminator.name, DQMGenericClient::NormOption.name, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.name, DQMGenericClient::CDOption.name, CounterChecker.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, cond::persistency::PAYLOAD::OBJECT_TYPE.name, looper.Looper.name, Mapper::definition< ScannerT >.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, 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, core.TriggerBitAnalyzer.TriggerBitAnalyzer.name, DQMNet::WaitObject.name, python.rootplot.utilities.Hist.name, AlpgenParameterName.name, config.Analyzer.name, geometry.Structure.name, hDigis.name, core.autovars.NTupleSubObject.name, Capsule.name, core.autovars.NTupleObject.name, Ceramic.name, PhysicsTools::Variable.name, SiStripMonitorDigi.name, config.Service.name, BulkSilicon.name, adaptToRunAtMiniAOD.adaptToRunAtMiniAOD.name, CaloSD::Detector.name, APD.name, core.autovars.NTupleCollection.name, nanoaod::FlatTable::Column.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, python.rootplot.utilities.RootFile.name, crabFunctions.CrabTask.name, MBCoolTube.name, hHits.name, MBManif.name, cscdqm::ParHistoDef.name, hDeltaR.name, hTMaxCell.name, BeautifulSoup.Tag.name, dqm_interfaces.DirWalkerFile.name, hParam.name, hMuonStat.name, hTOF.name, hTDelay.name, hTimes< hTime >.name, SummaryOutputProducer::GenericSummary.name, BeautifulSoup.SoupStrainer.name, utils.StatisticalTest.rank, l1t::EMTFTrack.rank, dirstructure.Comparison.rank, MessageLogger.threshold, EcalTPGFineGrainStripEE::Item.threshold, GaussNoiseFP420.threshold, muonisolation::Cuts::CutSpec.threshold, SiGaussianTailNoiseAdder.threshold, JetVertexMain.threshold, SingleObjectCondition.threshold, HLTLogMonitorFilter::CategoryEntry.threshold, MatchJet.threshold, SingleObjectTrigger.threshold, CondFormats_ESObjects::dictionary.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.

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 
Definition: logger.py:1

◆ 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().