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 57 of file FWLite.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 61 of file FWLite.py.

61  def __init__(self, name, tag, working_points, logistic_transform=False):
62  self.name = name
63  self.tag = tag
64  self.working_points = self._reformat_cut_definitions(working_points)
65  self.logistic_transform = logistic_transform
66 
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

◆ _reformat_cut_definitions()

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

Definition at line 67 of file FWLite.py.

References createfilelist.int, join(), ElectronMVAID.ElectronMVAID.name, AlignableObjectId::entry.name, average.Average.name, counter.Counter.name, histograms.Histograms.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, core.autovars.NTupleVariable.name, cond::persistency::TAG::OBJECT_TYPE.name, cond::persistency::GLOBAL_TAG::DESCRIPTION.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, cond::persistency::O2O_RUN::JOB_NAME.name, cond::persistency::TAG::DESCRIPTION.name, cms::dd::NameValuePair< T >.name, cond::persistency::GLOBAL_TAG::INSERTION_TIME.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, 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, EventStringOutputBranches::NamedBranchPtr.name, Types._Untracked.name, MagCylinder.name, analyzer.Analyzer.name, production_tasks.Task.name, heppy::ParSet.name, DQMRivetClient::LumiOption.name, cond::persistency::GTProxyData.name, CharmTagger::MVAVar.name, SingleObjectCondition.name, TriggerOutputBranches::NamedBranchPtr.name, TableOutputBranches::NamedBranchPtr.name, HeavyIonCSVTagger::MVAVar.name, edm::PathTimingSummary.name, DQMRivetClient::ScaleFactorOption.name, cms::DDAlgoArguments.name, EgHLTOfflineSummaryClient::SumHistBinData.name, Barrel.name, perftools::EdmEventSize::BranchRecord.name, core.autovars.NTupleObjectType.name, cond::TimeTypeSpecs.name, EcalLogicID.name, LumiOutputBranches::NamedBranchPtr.name, edm::PathSummary.name, lumi::TriggerInfo.name, XMLProcessor::_loaderBaseConfig.name, PixelEndcapLinkMaker::Item.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, 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, 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, BTagProbabilityToDiscriminator::Discriminator.name, DQMGenericClient::NormOption.name, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.name, DQMGenericClient::CDOption.name, CounterChecker.name, cond::TagInfo_t.name, TrackerSectorStruct.name, MuonGeometrySanityCheckPoint.name, PhysicsTools::Calibration::Variable.name, cond::persistency::PAYLOAD::HASH.name, EDMtoMEConverter.name, DQMGenericClient::NoFlowOption.name, looper.Looper.name, Mapper::definition< ScannerT >.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, cond::persistency::PAYLOAD::DATA.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, BPHDecayToResResBuilderBase::DZSelect.name, Crystal.name, h2DSegm.name, cond::persistency::IOV::TAG_NAME.name, options.HLTProcessOptions.name, cond::persistency::IOV::SINCE.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, BulkSilicon.name, config.Service.name, APD.name, core.autovars.NTupleCollection.name, BPHRecoBuilder::BPHRecoSource.name, nanoaod::FlatTable::Column.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, NanoAODDQM::SelGroupConfig.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, trklet::TrackletConfigBuilder::DTCinfo.name, Grille.name, BackPipe.name, plotscripts.SawTeethFunction.name, PatchPanel.name, BackCoolTank.name, DryAirTube.name, python.rootplot.utilities.RootFile.name, crabFunctions.CrabTask.name, MBCoolTube.name, MBManif.name, cscdqm::ParHistoDef.name, hTMaxCell.name, and SummaryOutputProducer::GenericSummary.name.

67  def _reformat_cut_definitions(self, working_points):
68  new_definitions = dict()
69  for wpname, definitions in working_points.items():
70  new_definitions[wpname] = dict()
71  for name, cut in definitions.cuts.items():
72  categ_id = int(name.lstrip('cutCategory'))
73  cut = cut.replace('pt','x')
74  formula = ROOT.TFormula('_'.join([self.name, wpname, name]), cut)
75  new_definitions[wpname][categ_id] = formula
76  return new_definitions
77 
static std::string join(char **cmd)
Definition: RemoteFile.cc:19

◆ passed()

def FWLite.WorkingPoints.passed (   self,
  ele,
  mva,
  category,
  wp 
)
return true if ele passes wp

Definition at line 78 of file FWLite.py.

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

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

Member Data Documentation

◆ logistic_transform

FWLite.WorkingPoints.logistic_transform

Definition at line 65 of file FWLite.py.

Referenced by FWLite.WorkingPoints.passed().

◆ name

FWLite.WorkingPoints.name

◆ tag

FWLite.WorkingPoints.tag

◆ working_points

FWLite.WorkingPoints.working_points

Definition at line 64 of file FWLite.py.

Referenced by FWLite.WorkingPoints.passed().