CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
coreTools.RunOnData Class Reference
Inheritance diagram for coreTools.RunOnData:

Public Member Functions

def __call__ (self, process, names=None, postfix=None, outputModules=None)
 
def __init__ (self)
 
def getDefaultParameters (self)
 
def toolCode (self, process)
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

 _defaultParameters
 
 _label
 

Detailed Description

Remove monte carlo matching from a given collection or all PAT
candidate collections and adapt the JEC's:

Definition at line 7 of file coreTools.py.

Constructor & Destructor Documentation

def coreTools.RunOnData.__init__ (   self)

Definition at line 14 of file coreTools.py.

References coreTools.RunOnData._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, root::helper::RootFunctionAdapter< F, args >.addParameter(), root::helper::RootFunctionHelper< F, args, Tag >.addParameter(), ParameterMgr.addParameter(), fit::RootMinuit< Function >.addParameter(), DropBoxMetadata::Parameters.addParameter(), Python11ParameterSet.addParameter(), cmspython3::Python11ParameterSet.addParameter(), l1t::TriggerSystem.addParameter(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

14  def __init__(self):
15  ConfigToolBase.__init__(self)
16  self.addParameter(self._defaultParameters,'names',['All'], "collection name; supported are 'Photons', 'Electrons', 'LowPtElectrons', 'Muons', 'Taus', 'TausBoosted', 'Jets', 'METs', 'All', 'PFAll', 'PFElectrons','PFTaus','PFMuons'", allowedValues=['Photons', 'Electrons', 'LowPtElectrons', 'Muons', 'Taus', 'TausBoosted', 'Jets', 'METs', 'All', 'PFAll', 'PFElectrons','PFTaus','PFMuons'])
17  self.addParameter(self._defaultParameters,'postfix',"", "postfix of default sequence")
18  self.addParameter(self._defaultParameters,'outputModules',['out'], "names of all output modules specified to be adapted (default is ['out'])")
19  self._parameters=copy.deepcopy(self._defaultParameters)
20  self._comment = ""
21 
def __init__(self)
Definition: coreTools.py:14

Member Function Documentation

def coreTools.RunOnData.__call__ (   self,
  process,
  names = None,
  postfix = None,
  outputModules = None 
)

Definition at line 28 of file coreTools.py.

References coreTools.RunOnData._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, SignedImpactParameter3D.apply(), gen::PhotosInterfaceBase.apply(), SurveyParameters.apply(), SignedTransverseImpactParameter.apply(), SignedDecayLength3D.apply(), DummyOOTPileupCorrection.apply(), MatrixReader.MatrixReader.apply, gen::PhotosppInterface.apply(), gen::PhotosInterface.apply(), FWPSetCellEditor.apply(), RigidBodyAlignmentParameters.apply(), BeamSpotAlignmentParameters.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), ConfigToolBase.ConfigToolBase.apply(), BowedSurfaceAlignmentParameters.apply(), OOTPileupCorrData.apply(), AlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), AbsOOTPileupCorrection.apply(), Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), TwoBowedSurfacesAlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog.apply(), reco::Add< T >.apply(), reco::Sub< T >.apply(), reco::Mul< T >.apply(), reco::Div< T >.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), reco::And< bool >.apply(), models.RegExp.apply(), reco::Or< bool >.apply(), reco::Less< T >.apply(), reco::LessEqual< T >.apply(), reco::More< T >.apply(), reco::MoreEqual< T >.apply(), reco::Equal< T >.apply(), ArrayND< Num2, Len2, Dim2 >.apply(), ArrayND< Numeric, Len2, Dim2 >.apply(), ArrayND< Accumulator >.apply(), ArrayND< Numeric, Len, Dim >.apply(), npstat::ArrayND< Num1, Len1, Dim1 >.apply(), npstat::ArrayND< Numeric >.apply(), npstat::ArrayND< Numeric, StackLen, StackDim >.apply(), Config.ProcessModifier.apply(), PedeReader.setParameter(), QIE8Simulator.setParameter(), AbsElectronicODERHS.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

Referenced by coreTools.RunOnData.getDefaultParameters().

28  outputModules = None) :
29  if names is None:
30  names=self._defaultParameters['names'].value
31  if postfix is None:
32  postfix=self._defaultParameters['postfix'].value
33  if outputModules is None:
34  outputModules=self._defaultParameters['outputModules'].value
35  self.setParameter('names',names)
36  self.setParameter('postfix',postfix)
37  self.setParameter('outputModules',outputModules)
38  self.apply(process)
39 
def coreTools.RunOnData.getDefaultParameters (   self)
def coreTools.RunOnData.toolCode (   self,
  process 
)

Definition at line 40 of file coreTools.py.

References editorTools.UserCodeTool._parameters, coreTools.RunOnData._parameters, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, ConfigToolBase.ConfigToolBase._parameters, editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, edm.print(), python.rootplot.root2matplotlib.replace(), and split.

40  def toolCode(self, process):
41  names=self._parameters['names'].value
42  postfix=self._parameters['postfix'].value
43  outputModules=self._parameters['outputModules'].value
44 
45  print('******************* RunOnData *******************')
46  removeMCMatching(process, names=names, postfix=postfix, outputModules=outputModules)
47  for mod in process.producerNames().split():
48  if mod.startswith('patJetCorrFactors'):
49  prefix = getattr(process, mod).payload.pythonValue().replace("'","")
50  if 'L3Absolute' in getattr(process,mod).levels:
51  if not 'L2L3Residual' in getattr(process,mod).levels:
52  getattr(process,mod).levels.insert(getattr(process,mod).levels.index('L3Absolute')+1, 'L2L3Residual')
53  print('adding L2L3Residual JEC for:', getattr(process,mod).label_())
54  if hasattr(process, prefix+'CombinedCorrector'+postfix):
55  if prefix+'L3Absolute' in getattr(process,prefix+'CombinedCorrector'+postfix).correctors:
56  if not prefix+'L2L3Residual' in getattr(process,prefix+'CombinedCorrector'+postfix).correctors:
57  idx = getattr(process,prefix+'CombinedCorrector'+postfix).correctors.index(prefix+'L3Absolute')+1
58  getattr(process,prefix+'CombinedCorrector'+postfix).correctors.insert(idx, prefix+'L2L3Residual')
59  print('adding L2L3Residual for TypeI MET correction:', getattr(process,prefix+'CombinedCorrector'+postfix).label_())
60 
61 runOnData=RunOnData()
62 
63 
def replace(string, replacements)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
double split
Definition: MVATrainer.cc:139
def toolCode(self, process)
Definition: coreTools.py:40

Member Data Documentation

coreTools.RunOnData._comment
private

Definition at line 20 of file coreTools.py.

coreTools.RunOnData._defaultParameters
staticprivate

Definition at line 13 of file coreTools.py.

Referenced by HiCoreTools.RestrictInputToAOD.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), editorTools.ChangeSource.__call__(), HiCoreTools.RemoveMCMatching.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetCollection.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.UpdateJetCollection.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), editorTools.UserCodeTool.__init__(), metTools.AddMETCollection.__init__(), trackTools.MakeAODTrackCandidates.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), coreTools.RunOnData.__init__(), runJetUncertainties.RunJetUncertainties.__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__init__(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.__init__(), editorTools.ChangeSource.__init__(), HiCoreTools.RemoveMCMatching.__init__(), coreTools.RemoveMCMatching.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), tauTools.AddTauCollection.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), jetTools.AddJetCollection.__init__(), jetTools.SwitchJetCollection.__init__(), jetTools.UpdateJetCollection.__init__(), jetTools.AddJetID.__init__(), jetTools.SetTagInfos.__init__(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), heavyIonTools.ConfigureHeavyIons.getDefaultParameters(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), coreTools.RunOnData.getDefaultParameters(), metTools.AddMETCollection.getDefaultParameters(), heavyIonTools.ProductionDefaults.getDefaultParameters(), editorTools.ChangeSource.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), coreTools.RemoveMCMatching.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getDefaultParameters(), heavyIonTools.SelectionDefaults.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), heavyIonTools.DisbaleMonteCarloDeps.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), tauTools.AddTauCollection.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), jetTools.AddJetCollection.getDefaultParameters(), jetTools.SwitchJetCollection.getDefaultParameters(), jetTools.UpdateJetCollection.getDefaultParameters(), jetTools.AddJetID.getDefaultParameters(), jetTools.SetTagInfos.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.initializeInputTag(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

coreTools.RunOnData._label
staticprivate
coreTools.RunOnData._parameters
private

Definition at line 19 of file coreTools.py.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.ak4JetReclustering(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createSmearedJetModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getCorrectedMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getMETUncertainties(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getUnclusteredVariationsForMVAMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getVariations(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetCleaning(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfigurationPost(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.recomputeRawMetFromPfcs(), HiCoreTools.RestrictInputToAOD.toolCode(), coreTools.RunOnData.toolCode(), trackTools.MakeAODTrackCandidates.toolCode(), metTools.AddMETCollection.toolCode(), runJetUncertainties.RunJetUncertainties.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), coreTools.RemoveMCMatching.toolCode(), trigTools.SwitchOnTrigger.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.toolCode(), trackTools.MakeTrackCandidates.toolCode(), tauTools.AddTauCollection.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), jetTools.AddJetCollection.toolCode(), jetTools.SwitchJetCollection.toolCode(), jetTools.UpdateJetCollection.toolCode(), jetTools.AddJetID.toolCode(), jetTools.SetTagInfos.toolCode(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.updateJECs().