CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
FWLite.ElectronMVAID Class Reference

Public Member Functions

def __call__ (self, ele, rho, debug=False)
 
def __init__ (self, name, tag, categoryCuts, xmls, variablesFile, debug=False)
 

Public Attributes

 categoryCuts
 
 estimator
 
 name
 
 tag
 
 variablesFile
 
 xmls
 

Private Attributes

 _debug
 
 _init
 

Detailed Description

Electron MVA wrapper class.

Definition at line 9 of file FWLite.py.

Constructor & Destructor Documentation

◆ __init__()

def FWLite.ElectronMVAID.__init__ (   self,
  name,
  tag,
  categoryCuts,
  xmls,
  variablesFile,
  debug = False 
)

Definition at line 13 of file FWLite.py.

13  def __init__(self, name, tag, categoryCuts, xmls, variablesFile, debug=False):
14  self.name = name
15  self.tag = tag
16  self.categoryCuts = categoryCuts
17  self.variablesFile = variablesFile
18  self.xmls = ROOT.vector(ROOT.string)()
19  for x in xmls: self.xmls.push_back(x)
20  self._init = False
21  self._debug = debug
22 

Member Function Documentation

◆ __call__()

def FWLite.ElectronMVAID.__call__ (   self,
  ele,
  rho,
  debug = False 
)
returns a tuple mva_value, category 
ele: a reco::GsfElectron
convs: conversions
beam_spot: beam spot
rho: energy density in the event
debug: enable debugging mode. 

example: 

    event.getByLabel(('slimmedElectrons'),       ele_handle)
    event.getByLabel(('fixedGridRhoFastjetAll'), rho_handle)
    
    electrons = ele_handle.product()
    rho       = rho_handle.product()

    mva, category = electron_mva_id(electron[0], rho)

Definition at line 23 of file FWLite.py.

23  def __call__(self, ele, rho, debug=False):
24  '''returns a tuple mva_value, category
25  ele: a reco::GsfElectron
26  convs: conversions
27  beam_spot: beam spot
28  rho: energy density in the event
29  debug: enable debugging mode.
30 
31  example:
32 
33  event.getByLabel(('slimmedElectrons'), ele_handle)
34  event.getByLabel(('fixedGridRhoFastjetAll'), rho_handle)
35 
36  electrons = ele_handle.product()
37  rho = rho_handle.product()
38 
39  mva, category = electron_mva_id(electron[0], rho)
40  '''
41  if not self._init:
42  print('Initializing ' + self.name + self.tag)
43  ROOT.gSystem.Load("libRecoEgammaElectronIdentification")
44  categoryCutStrings = ROOT.vector(ROOT.string)()
45  for x in self.categoryCuts :
46  categoryCutStrings.push_back(x)
47  self.estimator = ROOT.ElectronMVAEstimatorRun2(
48  self.tag, self.name, len(self.xmls),
49  self.variablesFile, categoryCutStrings, self.xmls, self._debug)
50  self._init = True
51  category = ctypes.c_int(0)
52  mva = self.estimator.mvaValue(ele, rho[0], category)
53  return mva, category.value
54 
55 

References ElectronMVAID.ElectronMVAID._init, FWLite.ElectronMVAID._init, FWLite.ElectronMVAID.categoryCuts, ElectronMVAID.ElectronMVAID.name, DigiComparisonTask.name, TestTask.name, TPComparisonTask.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, TmModule.name, cond::persistency::GTEditorData.name, FWLite.ElectronMVAID.name, cond::persistency::GLOBAL_TAG::NAME.name, cond::persistency::RUN_INFO::RUN_NUMBER.name, cond::persistency::RUN_INFO::START_TIME.name, cond::persistency::TAG::TIME_TYPE.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, cms::dd::NameValuePair< T >.name, cond::persistency::GLOBAL_TAG::INSERTION_TIME.name, cond::persistency::TAG::DESCRIPTION.name, cond::persistency::TAG::LAST_VALIDATED_TIME.name, cond::persistency::TAG::INSERTION_TIME.name, FWTGeoRecoGeometry::Info.name, cond::persistency::TAG::MODIFICATION_TIME.name, nanoaod::MergeableCounterTable::SingleColumn< T >.name, ParameterSet.name, preexistingValidation.PreexistingValidation.name, OutputMEPSet.name, PixelDCSObject< T >::Item.name, cms::DDSpecPar.name, SummaryTableOutputBranches::NamedBranchPtr.name, cms::dd::ValuePair< T, U >.name, dataset.BaseDataset.name, fit::RootMinuitCommand.name, personalPlayback.Applet.name, EventStringOutputBranches::NamedBranchPtr.name, Types._Untracked.name, MagCylinder.name, ParSet.name, analyzer.Analyzer.name, DQMRivetClient::LumiOption.name, production_tasks.Task.name, cond::persistency::GTProxyData.name, Barrel.name, TableOutputBranches::NamedBranchPtr.name, CharmTagger::MVAVar.name, DQMRivetClient::ScaleFactorOption.name, TriggerOutputBranches::NamedBranchPtr.name, EgHLTOfflineSummaryClient::SumHistBinData.name, edm::PathTimingSummary.name, cms::DDAlgoArguments.name, SingleObjectCondition.name, cond::TimeTypeSpecs.name, core.autovars.NTupleObjectType.name, perftools::EdmEventSize::BranchRecord.name, MyWatcher.name, edm::PathSummary.name, EcalLogicID.name, lumi::TriggerInfo.name, alignment.Alignment.name, PixelEndcapLinkMaker::Item.name, XMLProcessor::_loaderBaseConfig.name, MEtoEDM< T >::MEtoEDMObject.name, FWTableViewManager::TableEntry.name, PixelBarrelLinkMaker::Item.name, ExpressionHisto< T >.name, DQMGenericClient::EfficOption.name, Supermodule.name, python.rootplot.utilities.Hist2D.name, cond::persistency::GLOBAL_TAG_MAP::GLOBAL_TAG_NAME.name, TreeCrawler.Package.name, genericValidation.GenericValidation.name, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, options.ConnectionHLTMenu.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, MVAVar.name, cond::persistency::GLOBAL_TAG_MAP::TAG_NAME.name, cond::Tag_t.name, dqmoffline::l1t::HistDefinition.name, DQMGenericClient::ProfileOption.name, FastHFShowerLibrary.name, nanoaod::MergeableCounterTable::VectorColumn< T >.name, magneticfield::BaseVolumeHandle.name, PhysicsTools::Variable::Value.name, emtf::Node.name, cms::DDParsingContext::CompositeMaterial.name, h4DSegm.name, BTagProbabilityToDiscriminator::Discriminator.name, DQMGenericClient::NormOption.name, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.name, cond::persistency::PAYLOAD::HASH.name, looper.Looper.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, DQMGenericClient::CDOption.name, PhysicsTools::Calibration::Variable.name, cond::TagInfo_t.name, TriggerObjectTableProducer::SelectedObject.name, cond::persistency::PAYLOAD::DATA.name, cond::persistency::PAYLOAD::STREAMER_INFO.name, TrackerSectorStruct.name, cond::persistency::PAYLOAD::VERSION.name, MuonGeometrySanityCheckPoint.name, cond::persistency::PAYLOAD::INSERTION_TIME.name, FCDTask.name, DQMGenericClient::NoFlowOption.name, CounterChecker.name, Mapper::definition< ScannerT >.name, python.rootplot.tree2hists.Plot.name, EDMtoMEConverter.name, PhysicsTools::TreeReader::Value.name, classes.MonitorData.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, HistogramManager.name, classes.OutputData.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, Crystal.name, cond::persistency::IOV::TAG_NAME.name, cond::persistency::IOV::SINCE.name, h2DSegm.name, cond::persistency::IOV::PAYLOAD_HASH.name, cond::persistency::IOV::INSERTION_TIME.name, options.HLTProcessOptions.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, SiStripMonitorDigi.name, PhysicsTools::Variable.name, BulkSilicon.name, config.Service.name, nanoaod::FlatTable::Column.name, APD.name, NanoAODDQM::SelGroupConfig.name, core.autovars.NTupleCollection.name, BPHRecoBuilder::BPHRecoSource.name, cond::payloadInspector::TagReference.name, BPHRecoBuilder::BPHCompSource.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, InnerLayerVolume.name, personalPlayback.FrameworkJob.name, Grid.name, Grille.name, BackPipe.name, plotscripts.SawTeethFunction.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, SummaryOutputProducer::GenericSummary.name, BeautifulSoup.SoupStrainer.name, edm.print(), FWLite.ElectronMVAID.tag, tnp::TagProbePair.tag, cond::persistency::IOVEditorData.tag, Entry< T >.tag, DQMNet::CoreObject.tag, and personalPlayback.FrameworkJob.tag.

Member Data Documentation

◆ _debug

FWLite.ElectronMVAID._debug
private

Definition at line 21 of file FWLite.py.

◆ _init

FWLite.ElectronMVAID._init
private

Definition at line 20 of file FWLite.py.

Referenced by FWLite.ElectronMVAID.__call__().

◆ categoryCuts

FWLite.ElectronMVAID.categoryCuts

Definition at line 16 of file FWLite.py.

Referenced by FWLite.ElectronMVAID.__call__().

◆ estimator

FWLite.ElectronMVAID.estimator

Definition at line 47 of file FWLite.py.

◆ name

FWLite.ElectronMVAID.name

◆ tag

FWLite.ElectronMVAID.tag

◆ variablesFile

FWLite.ElectronMVAID.variablesFile

Definition at line 17 of file FWLite.py.

◆ xmls

FWLite.ElectronMVAID.xmls

Definition at line 18 of file FWLite.py.

edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66