CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 111 of file utils.py.

Constructor & Destructor Documentation

def utils.StatisticalTest.__init__ (   self,
  threshold 
)

Definition at line 112 of file utils.py.

113  def __init__(self,threshold):
114  self.name=""
115  self.h1=None
116  self.h2=None
117  self.threshold=float(threshold)
118  self.rank=-1
119  self.is_init=False
rank
2D! return test_codes["2D"]
Definition: utils.py:117

Member Function Documentation

def utils.StatisticalTest.do_test (   self)

Definition at line 174 of file utils.py.

Referenced by utils.StatisticalTest.get_rank().

175  def do_test(self):
176  pass
177 
178 #-------------------------------------------------------------------------------
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().

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

Definition at line 164 of file utils.py.

References utils.StatisticalTest.get_rank(), ElectronMVAID.ElectronMVAID.name, AlignableObjectId::entry.name, average.Average.name, counter.Counter.name, histograms.Histograms.name, TmModule.name, cond::persistency::TAG::NAME.name, cond::persistency::RUN_INFO::RUN_NUMBER.name, FWLite.ElectronMVAID.name, cond::persistency::GTEditorData.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, core.autovars.NTupleVariable.name, cond::persistency::TAG::OBJECT_TYPE.name, cond::persistency::GLOBAL_TAG::DESCRIPTION.name, cond::persistency::TAG::SYNCHRONIZATION.name, DQMRivetClient::NormOption.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, cond::persistency::O2O_RUN::END_TIME.name, cond::persistency::TAG::INSERTION_TIME.name, FWTGeoRecoGeometry::Info.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< class >::Item.name, dataset.BaseDataset.name, SummaryTableOutputBranches::NamedBranchPtr.name, cms::dd::ValuePair< T, U >.name, fit::RootMinuitCommand.name, personalPlayback.Applet.name, EventStringOutputBranches::NamedBranchPtr.name, Types._Untracked.name, MagCylinder.name, analyzer.Analyzer.name, production_tasks.Task.name, HcalForwardLibWriter::FileHandle.name, heppy::ParSet.name, DQMRivetClient::LumiOption.name, o2olib.O2OJob.name, cond::persistency::GTProxyData.name, TableOutputBranches::NamedBranchPtr.name, CharmTagger::MVAVar.name, TriggerOutputBranches::NamedBranchPtr.name, HeavyIonCSVTagger::MVAVar.name, SingleObjectCondition.name, EgHLTOfflineSummaryClient::SumHistBinData.name, edm::PathTimingSummary.name, DQMRivetClient::ScaleFactorOption.name, cms::DDAlgoArguments.name, RHStopTracer::StopPoint.name, Barrel.name, perftools::EdmEventSize::BranchRecord.name, core.autovars.NTupleObjectType.name, cond::TimeTypeSpecs.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, 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, dqmoffline::l1t::HistDefinition.name, DQMGenericClient::ProfileOption.name, magneticfield::BaseVolumeHandle.name, nanoaod::MergeableCounterTable::VectorColumn< T >.name, FastHFShowerLibrary.name, emtf::Node.name, PhysicsTools::Variable::Value.name, PrintMaterialBudgetInfo.name, h4DSegm.name, DQMGenericClient::NormOption.name, BTagProbabilityToDiscriminator::Discriminator.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, DQMGenericClient::NoFlowOption.name, Mapper::definition< ScannerT >.name, looper.Looper.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, 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, 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, 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, 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, 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.

165  def get_status(self):
166  status = SUCCESS
167  if self.get_rank()<0:
168  status=NULL
169  logger(0,"+++ Test %s FAILED: rank is %s and threshold is %s ==> %s" %(self.name, self.rank, self.threshold, status))
170  elif self.get_rank() < self.threshold:
171  status=FAIL
172  logger(0,"+++ Test %s: rank is %s and threshold is %s ==> %s" %(self.name, self.rank, self.threshold, status))
173  return status
Definition: logger.py:1
rank
2D! return test_codes[&quot;2D&quot;]
Definition: utils.py:117
def utils.StatisticalTest.set_operands (   self,
  h1,
  h2 
)

Definition at line 120 of file utils.py.

References 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, and FitSlicesYTool.h2.

121  def set_operands(self,h1,h2):
122  self.h1=h1
123  self.h2=h2

Member Data Documentation

utils.StatisticalTest.h1

Definition at line 114 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 115 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 118 of file utils.py.

Referenced by utils.StatisticalTest.get_rank().

utils.StatisticalTest.name

Definition at line 113 of file utils.py.

Referenced by config.CFG.__str__(), geometryComparison.GeometryComparison.createScript(), validation.Sample.digest(), utils.StatisticalTest.get_status(), primaryVertexResolution.PrimaryVertexResolution.getRepMap(), primaryVertexValidation.PrimaryVertexValidation.getRepMap(), zMuMuValidation.ZMuMuValidation.getRepMap(), and VIDSelectorBase.VIDSelectorBase.initialize().

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

utils.StatisticalTest.threshold

Definition at line 116 of file utils.py.

Referenced by utils.StatisticalTest.get_status().