CMS 3D CMS Logo

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

Public Member Functions

def __call__ (self, process, label=None, input=None, selection=None, isolation=None, isoDeposits=None, mcAs=None)
 
def __init__ (self)
 
def getDefaultParameters (self)
 
def toolCode (self, process)
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

 _defaultParameters
 
 _label
 

Detailed Description

Create pat track candidates from AOD track collections:

Definition at line 69 of file trackTools.py.

Constructor & Destructor Documentation

def trackTools.MakePATTrackCandidates.__init__ (   self)

Definition at line 76 of file trackTools.py.

References heavyIonTools.ConfigureHeavyIons._defaultParameters, metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, coreTools.RunOnData._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, tauTools.AddTauCollection._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, root::helper::RootFunctionAdapter< F, args >.addParameter(), root::helper::RootFunctionHelper< F, args, Tag >.addParameter(), ParameterMgr.addParameter(), fit::RootMinuit< Function >.addParameter(), DropBoxMetadata::Parameters.addParameter(), PythonParameterSet.addParameter(), l1t::TriggerSystem.addParameter(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

76  def __init__(self):
77  ConfigToolBase.__init__(self)
78  self.addParameter(self._defaultParameters,'label','TrackCands', "output will be 'all/selectedLayer1'+label")
79  self.addParameter(self._defaultParameters,'input',cms.InputTag('patAODTrackCands'), 'name of the input collection')
80  self.addParameter(self._defaultParameters,'selection','pt > 10', 'selection on PAT Layer 1 objects')
81  self.addParameter(self._defaultParameters,'isolation',{'tracker':0.3, 'ecalTowers':0.3, 'hcalTowers':0.3}, "solation to use (as 'source': value of dR)\ntracker : as muon iso from tracks\necalTowers : as muon iso from calo tower\nhcalTowers : as muon iso from calo towers",allowedValues=['tracker','ecalTowers','hcalTowers'])
82  self.addParameter(self._defaultParameters,'isoDeposits',['tracker','ecalTowers','hcalTowers'], 'iso deposits')
83  self.addParameter(self._defaultParameters,'mcAs',None, "eplicate mc match as the one used by PAT on this AOD collection (None=no mc match); choose 'photon', 'electron', 'muon', 'tau','jet', 'met' as input string",Type=str, allowedValues=['photon', 'electron', 'muon', 'tau','jet', 'met', None], acceptNoneValue = True)
84 
85  self._parameters=copy.deepcopy(self._defaultParameters)
86  self._comment = ""
87 

Member Function Documentation

def trackTools.MakePATTrackCandidates.__call__ (   self,
  process,
  label = None,
  input = None,
  selection = None,
  isolation = None,
  isoDeposits = None,
  mcAs = None 
)

Definition at line 97 of file trackTools.py.

References heavyIonTools.ConfigureHeavyIons._defaultParameters, metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, coreTools.RunOnData._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, tauTools.AddTauCollection._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, SignedImpactParameter3D.apply(), gen::PhotosInterfaceBase.apply(), SignedTransverseImpactParameter.apply(), SignedDecayLength3D.apply(), DummyOOTPileupCorrection.apply(), MatrixReader.MatrixReader.apply, gen::PhotosppInterface.apply(), SurveyParameters.apply(), FWPSetCellEditor.apply(), gen::PhotosInterface.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), ConfigToolBase.ConfigToolBase.apply(), OOTPileupCorrData.apply(), AlignmentParameters.apply(), BowedSurfaceAlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), AbsOOTPileupCorrection.apply(), TwoBowedSurfacesAlignmentParameters.apply(), Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), reco::modules::TrackerTrackHitFilter::Rule.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(), npstat::ArrayND< Numeric, StackLen, StackDim >.apply(), ArrayND< Num2, Len2, Dim2 >.apply(), ArrayND< Numeric, Len2, Dim2 >.apply(), npstat::ArrayND< Num1, Len1, Dim1 >.apply(), npstat::ArrayND< Numeric >.apply(), ArrayND< Numeric, Len, Dim >.apply(), ArrayND< Accumulator >.apply(), Config.ProcessModifier.apply(), PedeReader.setParameter(), QIE8Simulator.setParameter(), AbsElectronicODERHS.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

Referenced by trackTools.MakePATTrackCandidates.getDefaultParameters().

97  mcAs = None) :
98  if label is None:
99  label=self._defaultParameters['label'].value
100  if input is None:
101  input=self._defaultParameters['input'].value
102  if selection is None:
103  selection=self._defaultParameters['selection'].value
104  if isolation is None:
105  isolation=self._defaultParameters['isolation'].value
106  if isoDeposits is None:
107  isoDeposits=self._defaultParameters['isoDeposits'].value
108  if mcAs is None:
109  mcAs=self._defaultParameters['mcAs'].value
110  self.setParameter('label',label)
111  self.setParameter('input',input)
112  self.setParameter('selection',selection)
113  self.setParameter('isolation',isolation)
114  self.setParameter('isoDeposits',isoDeposits)
115  self.setParameter('mcAs',mcAs,True)
116  self.apply(process)
117 
def trackTools.MakePATTrackCandidates.getDefaultParameters (   self)
def trackTools.MakePATTrackCandidates.toolCode (   self,
  process 
)

Definition at line 118 of file trackTools.py.

References editorTools.UserCodeTool._parameters, heavyIonTools.ConfigureHeavyIons._parameters, coreTools.RunOnData._parameters, trackTools.MakeAODTrackCandidates._parameters, metTools.AddMETCollection._parameters, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, heavyIonTools.ProductionDefaults._parameters, ConfigToolBase.ConfigToolBase._parameters, editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, trackTools.MakePATTrackCandidates._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, tauTools.AddTauCollection._parameters, jetTools.AddJetCollection._parameters, jetTools.SwitchJetCollection._parameters, jetTools.UpdateJetCollection._parameters, jetTools.AddJetID._parameters, jetTools.SetTagInfos._parameters, helpers.addToProcessAndTask(), clone(), and helpers.getPatAlgosToolsTask().

118  def toolCode(self, process):
119  label=self._parameters['label'].value
120  input=self._parameters['input'].value
121  selection=self._parameters['selection'].value
122  isolation=self._parameters['isolation'].value
123  isoDeposits=self._parameters['isoDeposits'].value
124  mcAs=self._parameters['mcAs'].value
125 
126  ## add patTracks to the process
127  from PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi import patGenericParticles
128  task = getPatAlgosToolsTask(process)
129  addToProcessAndTask('pat' + label, patGenericParticles.clone(src = input), process, task)
130 
131  ## add selectedPatTracks to the process
132  addToProcessAndTask('selectedPat' + label,
133  cms.EDFilter("PATGenericParticleSelector",
134  src = cms.InputTag("pat"+label),
135  cut = cms.string(selection)),
136  process, task)
137  ## add cleanPatTracks to the process
138  from PhysicsTools.PatAlgos.cleaningLayer1.genericTrackCleaner_cfi import cleanPatTracks
139  addToProcessAndTask('cleanPat' + label,
140  cleanPatTracks.clone(src = cms.InputTag('selectedPat' + label)),
141  process, task)
142 
143  ## get them as variables, so we can put them in the sequences and/or configure them
144  l1cands = getattr(process, 'pat' + label)
145  selectedL1cands = getattr(process, 'selectedPat' + label)
146  cleanL1cands = getattr(process, 'cleanPat' + label)
147 
148  ### add them to the Summary Tables
149  #process.patCandidateSummary.candidates += [ cms.InputTag("allPat"+label) ]
150  #process.selectedPatCandidateSummary.candidates += [ cms.InputTag("selectedPat"+label) ]
151  #process.cleanPatCandidateSummary.candidates += [ cms.InputTag("cleanPat"+label) ]
152 
153  ## isolation: start with empty config
154  if(isolation or isoDeposits):
155  process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi")
156  process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi")
157  process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAny_cfi")
158  runIsoDeps = {'tracker':False, 'caloTowers':False}
159 
160  for source,deltaR in isolation.items():
161  ## loop items in isolation
162  if(source == 'tracker'):
163  runIsoDeps['tracker'] = True
164  l1cands.userIsolation.tracker = cms.PSet(
165  src = cms.InputTag('pat'+label+'IsoDepositTracks'),
166  deltaR = cms.double(deltaR),
167  )
168  elif(source == 'ecalTowers'):
169  runIsoDeps['caloTowers'] = True
170  l1cands.userIsolation.ecal = cms.PSet(
171  src = cms.InputTag('pat'+label+'IsoDepositCaloTowers', 'ecal'),
172  deltaR = cms.double(deltaR),
173  )
174  elif(source == 'hcalTowers'):
175  runIsoDeps['caloTowers'] = True
176  l1cands.userIsolation.hcal = cms.PSet(
177  src = cms.InputTag('pat'+label+'IsoDepositCaloTowers', 'hcal'),
178  deltaR = cms.double(deltaR),
179  )
180 
181  for source in isoDeposits:
182  ## loop items in isoDeposits
183  if(source == 'tracker'):
184  runIsoDeps['tracker'] = True
185  l1cands.isoDeposits.tracker = cms.InputTag('pat'+label+'IsoDepositTracks')
186  elif(source == 'ecalTowers'):
187  runIsoDeps['caloTowers'] = True
188  l1cands.isoDeposits.ecal = cms.InputTag('pat'+label+'IsoDepositCaloTowers', 'ecal')
189  elif(source == 'hcalTowers'):
190  runIsoDeps['caloTowers'] = True
191  l1cands.isoDeposits.hcal = cms.InputTag('pat'+label+'IsoDepositCaloTowers', 'hcal')
192 
193  for dep in [ dep for dep,runme in runIsoDeps.items() if runme == True ]:
194  if(dep == 'tracker'):
195  from RecoMuon.MuonIsolationProducers.trackExtractorBlocks_cff import MIsoTrackExtractorCtfBlock
196  addToProcessAndTask('pat'+label+'IsoDepositTracks',
197  cms.EDProducer("CandIsoDepositProducer",
198  src = input,
199  trackType = cms.string('best'),
200  MultipleDepositsFlag = cms.bool(False),
201  ExtractorPSet = cms.PSet( MIsoTrackExtractorCtfBlock )),
202  process, task)
203 
204 
205  elif(dep == 'caloTowers'):
206  from RecoMuon.MuonIsolationProducers.caloExtractorByAssociatorBlocks_cff import MIsoCaloExtractorByAssociatorTowersBlock
207  addToProcessAndTask('pat'+label+'IsoDepositCaloTowers',
208  cms.EDProducer("CandIsoDepositProducer",
209  src = input,
210  trackType = cms.string('best'),
211  MultipleDepositsFlag = cms.bool(True),
212  ExtractorPSet = cms.PSet( MIsoCaloExtractorByAssociatorTowersBlock )),
213  process, task)
214 
215  # ES
216  process.load( 'TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff' )
217  # MC
218  from PhysicsTools.PatAlgos.tools.helpers import MassSearchParamVisitor
219  if(not isinstance(mcAs, type(None))):
220  findMatch= []
221  findMatch.append(getattr(process, mcAs+'Match'))
222 
223  ## clone mc matchiong module of object mcAs and add it to the path
224  addToProcessAndTask('pat'+label+'MCMatch', findMatch[0].clone(src = input), process, task)
225 
226  l1cands.addGenMatch = True
227  l1cands.genParticleMatch = cms.InputTag('pat'+label+'MCMatch')
228 
229 
230 makePATTrackCandidates=MakePATTrackCandidates()
231 
232 
def addToProcessAndTask(label, module, process, task)
Definition: helpers.py:29
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
def getPatAlgosToolsTask(process)
Definition: helpers.py:14

Member Data Documentation

trackTools.MakePATTrackCandidates._comment
private

Definition at line 86 of file trackTools.py.

trackTools.MakePATTrackCandidates._defaultParameters
staticprivate

Definition at line 74 of file trackTools.py.

Referenced by HiCoreTools.RestrictInputToAOD.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), editorTools.ChangeSource.__call__(), HiCoreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), editorTools.UserCodeTool.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), runJetUncertainties.RunJetUncertainties.__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__init__(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.__init__(), editorTools.ChangeSource.__init__(), HiCoreTools.RemoveMCMatching.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), editorTools.ChangeSource.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.initializeInputTag(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

trackTools.MakePATTrackCandidates._label
staticprivate
trackTools.MakePATTrackCandidates._parameters
private

Definition at line 85 of file trackTools.py.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.ak4JetReclustering(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createSmearedJetModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getCorrectedMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getUnclusteredVariationsForMVAMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getVariations(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetCleaning(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfigurationPost(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.produceMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.recomputeRawMetFromPfcs(), HiCoreTools.RestrictInputToAOD.toolCode(), runJetUncertainties.RunJetUncertainties.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), trigTools.SwitchOnTrigger.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.toolCode(), trackTools.MakeTrackCandidates.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.updateJECs().