CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions
FWLite.WorkingPoints Class Reference
Inheritance diagram for FWLite.WorkingPoints:

Public Member Functions

def __init__ (self, name, tag, working_points, logistic_transform=False)
 
def passed (self, ele, mva, category, wp)
 

Public Attributes

 logistic_transform
 
 name
 
 tag
 
 working_points
 

Private Member Functions

def _reformat_cut_definitions (self, working_points)
 

Detailed Description

Working Points. Keeps track of the cuts associated to a given flavour of the MVA ID 
for each working point and allows to test the working points

Definition at line 61 of file FWLite.py.

Constructor & Destructor Documentation

def FWLite.WorkingPoints.__init__ (   self,
  name,
  tag,
  working_points,
  logistic_transform = False 
)

Definition at line 65 of file FWLite.py.

65  def __init__(self, name, tag, working_points, logistic_transform=False):
66  self.name = name
67  self.tag = tag
68  self.working_points = self._reformat_cut_definitions(working_points)
69  self.logistic_transform = logistic_transform
70 
def _reformat_cut_definitions(self, working_points)
Definition: FWLite.py:71
def __init__(self, name, tag, working_points, logistic_transform=False)
Definition: FWLite.py:65

Member Function Documentation

def FWLite.WorkingPoints._reformat_cut_definitions (   self,
  working_points 
)
private

Definition at line 71 of file FWLite.py.

References cmsPerfStripChart.dict, createfilelist.int, join(), ElectronMVAID.ElectronMVAID.name, average.Average.name, counter.Counter.name, histograms.Histograms.name, AlignableObjectId::entry.name, FWLite.ElectronMVAID.name, cond::persistency::TAG::NAME.name, TmModule.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, core.autovars.NTupleVariable.name, cond::persistency::RUN_INFO::START_TIME.name, cond::persistency::RUN_INFO::END_TIME.name, cond::persistency::TAG::OBJECT_TYPE.name, cond::persistency::GLOBAL_TAG::DESCRIPTION.name, cond::persistency::TAG::SYNCHRONIZATION.name, cond::persistency::GLOBAL_TAG::RELEASE.name, MEPSet.name, cond::persistency::TAG::END_OF_VALIDITY.name, cond::persistency::GLOBAL_TAG::SNAPSHOT_TIME.name, cond::persistency::TAG::DESCRIPTION.name, cond::persistency::GTEditorData.name, cond::persistency::GLOBAL_TAG::INSERTION_TIME.name, nanoaod::MergeableCounterTable::SingleColumn< T >.name, cond::persistency::TAG::LAST_VALIDATED_TIME.name, cond::persistency::TAG::INSERTION_TIME.name, cond::persistency::TAG::MODIFICATION_TIME.name, FWTGeoRecoGeometry::Info.name, preexistingValidation.PreexistingValidation.name, OutputMEPSet.name, EventStringOutputBranches::NamedBranchPtr.name, SummaryTableOutputBranches::NamedBranchPtr.name, dataset.BaseDataset.name, fit::RootMinuitCommand.name, personalPlayback.Applet.name, Types._Untracked.name, ParameterSet.name, PixelDCSObject< T >::Item.name, DQMRivetClient::LumiOption.name, MagCylinder.name, analyzer.Analyzer.name, production_tasks.Task.name, CharmTagger::MVAVar.name, TriggerOutputBranches::NamedBranchPtr.name, ParSet.name, TableOutputBranches::NamedBranchPtr.name, edm::PathTimingSummary.name, DQMRivetClient::ScaleFactorOption.name, EgHLTOfflineSummaryClient::SumHistBinData.name, PhysicsTools::Source.name, cond::persistency::GTProxyData.name, SingleObjectCondition.name, MyWatcher.name, core.autovars.NTupleObjectType.name, edm::PathSummary.name, nanoaod::MergeableCounterTable::VectorColumn< T >.name, cond::TimeTypeSpecs.name, lumi::TriggerInfo.name, alignment.Alignment.name, cond::persistency::GLOBAL_TAG_MAP::GLOBAL_TAG_NAME.name, PixelEndcapLinkMaker::Item.name, perftools::EdmEventSize::BranchRecord.name, DQMGenericClient::EfficOption.name, FWTableViewManager::TableEntry.name, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, PixelBarrelLinkMaker::Item.name, EcalLogicID.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, MEtoEDM< T >::MEtoEDMObject.name, cond::persistency::GLOBAL_TAG_MAP::TAG_NAME.name, ExpressionHisto< T >.name, cms::DDAlgoArguments.name, XMLProcessor::_loaderBaseConfig.name, cond::persistency::PAYLOAD::HASH.name, python.rootplot.utilities.Hist2D.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, cond::persistency::PAYLOAD::DATA.name, cond::persistency::PAYLOAD::STREAMER_INFO.name, TreeCrawler.Package.name, cond::persistency::PAYLOAD::VERSION.name, genericValidation.GenericValidation.name, options.ConnectionHLTMenu.name, MagGeoBuilderFromDDD::volumeHandle.name, cond::persistency::PAYLOAD::INSERTION_TIME.name, DQMGenericClient::ProfileOption.name, MVAVar.name, dqmoffline::l1t::HistDefinition.name, FWLite.WorkingPoints.name, DQMGenericClient::NormOption.name, BTagProbabilityToDiscriminator::Discriminator.name, emtf::Node.name, FastHFShowerLibrary.name, h4DSegm.name, PhysicsTools::Variable::Value.name, PhysicsTools::Calibration::Variable.name, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.name, DQMGenericClient::CDOption.name, CounterChecker.name, TriggerObjectTableProducer::SelectedObject.name, TrackerSectorStruct.name, cond::TagInfo_t.name, ProcTMVA::Method.name, TreeSaver::Var.name, DQMGenericClient::NoFlowOption.name, looper.Looper.name, python.rootplot.tree2hists.Plot.name, cond::persistency::IOV::TAG_NAME.name, EDMtoMEConverter.name, cond::persistency::IOV::SINCE.name, cond::persistency::IOV::PAYLOAD_HASH.name, Mapper::definition< ScannerT >.name, PhysicsTools::TreeReader::Value.name, classes.MonitorData.name, cond::persistency::IOV::INSERTION_TIME.name, HistogramManager.name, MuonGeometrySanityCheckPoint.name, PhysicsTools::TrainProcessor.name, classes.OutputData.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, options.HLTProcessOptions.name, PhysicsTools::MVATrainer.name, h2DSegm.name, core.TriggerBitAnalyzer.TriggerBitAnalyzer.name, python.rootplot.utilities.Hist.name, nanoaod::FlatTable::Column.name, config.Analyzer.name, geometry.Structure.name, core.autovars.NTupleSubObject.name, DQMNet::WaitObject.name, AlpgenParameterName.name, NanoAODDQM::SelGroupConfig.name, SiStripMonitorDigi.name, core.autovars.NTupleObject.name, config.Service.name, PhysicsTools::Variable.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, PhysicsTools::TrainerMonitoring::Object.name, cond::persistency::TAG_LOG::USER_TEXT.name, core.autovars.NTupleCollection.name, BPHRecoBuilder::BPHRecoSource.name, BPHRecoBuilder::BPHCompSource.name, personalPlayback.FrameworkJob.name, plotscripts.SawTeethFunction.name, python.rootplot.utilities.RootFile.name, crabFunctions.CrabTask.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, Id.name, SummaryOutputProducer::GenericSummary.name, and BeautifulSoup.SoupStrainer.name.

71  def _reformat_cut_definitions(self, working_points):
72  new_definitions = dict()
73  for wpname, definitions in working_points.iteritems():
74  new_definitions[wpname] = dict()
75  for name, cut in definitions.cuts.iteritems():
76  categ_id = int(name.lstrip('cutCategory'))
77  cut = cut.replace('pt','x')
78  formula = ROOT.TFormula('_'.join([self.name, wpname, name]), cut)
79  new_definitions[wpname][categ_id] = formula
80  return new_definitions
81 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def _reformat_cut_definitions(self, working_points)
Definition: FWLite.py:71
def FWLite.WorkingPoints.passed (   self,
  ele,
  mva,
  category,
  wp 
)
return true if ele passes wp

Definition at line 82 of file FWLite.py.

References JetChargeProducer_cfi.exp, FWLite.WorkingPoints.logistic_transform, and FWLite.WorkingPoints.working_points.

82  def passed(self, ele, mva, category, wp):
83  '''return true if ele passes wp'''
84  threshold = self.working_points[wp][category].Eval(ele.pt())
85  if self.logistic_transform:
86  mva = 2.0/(1.0+exp(-2.0*mva))-1
87  return mva > threshold
88 
89 
90 # Import information needed to construct the e/gamma MVAs
91 
def passed(self, ele, mva, category, wp)
Definition: FWLite.py:82

Member Data Documentation

FWLite.WorkingPoints.logistic_transform

Definition at line 69 of file FWLite.py.

Referenced by FWLite.WorkingPoints.passed().

FWLite.WorkingPoints.name
FWLite.WorkingPoints.tag
FWLite.WorkingPoints.working_points

Definition at line 68 of file FWLite.py.

Referenced by FWLite.WorkingPoints.passed().