CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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__
 
def __init__
 
def getDefaultParameters
 
def toolCode
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

tuple _defaultParameters = dicttypes.SortedKeysDict()
 
string _label = 'makePATTrackCandidates'
 

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(), Python11ParameterSet.addParameter(), l1t::TriggerSystem.addParameter(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

76 
77  def __init__(self):
78  ConfigToolBase.__init__(self)
79  self.addParameter(self._defaultParameters,'label','TrackCands', "output will be 'all/selectedLayer1'+label")
80  self.addParameter(self._defaultParameters,'input',cms.InputTag('patAODTrackCands'), 'name of the input collection')
81  self.addParameter(self._defaultParameters,'selection','pt > 10', 'selection on PAT Layer 1 objects')
82  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'])
83  self.addParameter(self._defaultParameters,'isoDeposits',['tracker','ecalTowers','hcalTowers'], 'iso deposits')
84  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)
85 
86  self._parameters=copy.deepcopy(self._defaultParameters)
87  self._comment = ""

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, ProcessAcceleratorCUDA.ProcessAcceleratorCUDA.apply(), SignedImpactParameter3D.apply(), SignedDecayLength3D.apply(), SignedTransverseImpactParameter.apply(), gen::PhotosInterfaceBase.apply(), SurveyParameters.apply(), DummyOOTPileupCorrection.apply(), MatrixReader.MatrixReader.apply, gen::PhotosppInterface.apply(), gen::PhotosInterface.apply(), FWPSetCellEditor.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), AlignmentParameters.apply(), ConfigToolBase.ConfigToolBase.apply(), BowedSurfaceAlignmentParameters.apply(), OOTPileupCorrData.apply(), AbsOOTPileupCorrection.apply(), TwoBowedSurfacesAlignmentParameters.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), models.RegExp.apply(), ArrayND< Num2, Len2, Dim2 >.apply(), ArrayND< Numeric, Len2, Dim2 >.apply(), npstat::ArrayND< Numeric, StackLen, StackDim >.apply(), ArrayND< Num1, Len1, Dim1 >.apply(), npstat::ArrayND< Numeric >.apply(), ArrayND< Numeric, Len, Dim >.apply(), ArrayND< Accumulator >.apply(), Config.ProcessModifier.apply(), Config.ProcessAccelerator.apply(), Config.ProcessAcceleratorTest.apply(), Config.ProcessAcceleratorTest2.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 trackTools.MakePATTrackCandidates.getDefaultParameters().

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

Definition at line 88 of file trackTools.py.

References trackTools.MakePATTrackCandidates.__call__(), 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, and jetTools.SetTagInfos._defaultParameters.

88 
89  def getDefaultParameters(self):
90  return self._defaultParameters
def trackTools.MakePATTrackCandidates.toolCode (   self,
  process 
)

Definition at line 118 of file trackTools.py.

References heavyIonTools.ConfigureHeavyIons._parameters, trackTools.MakeAODTrackCandidates._parameters, coreTools.RunOnData._parameters, metTools.AddMETCollection._parameters, heavyIonTools.ProductionDefaults._parameters, ConfigToolBase.ConfigToolBase._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(), helpers.getPatAlgosToolsTask(), and if().

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

Member Data Documentation

trackTools.MakePATTrackCandidates._comment
private

Definition at line 86 of file trackTools.py.

tuple trackTools.MakePATTrackCandidates._defaultParameters = dicttypes.SortedKeysDict()
staticprivate

Definition at line 74 of file trackTools.py.

Referenced by runJetUncertainties.RunJetUncertainties.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), runJetUncertainties.RunJetUncertainties.__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.initializeInputTag(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

string trackTools.MakePATTrackCandidates._label = 'makePATTrackCandidates'
staticprivate

Definition at line 73 of file trackTools.py.

Referenced by validation.SimpleSample.digest(), validation.SimpleSample.label(), trigTools.SwitchOnTrigger.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), and trigTools.SwitchOnTriggerMatchEmbedding.toolCode().

trackTools.MakePATTrackCandidates._parameters
private

Definition at line 85 of file trackTools.py.

Referenced by 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(), runJetUncertainties.RunJetUncertainties.toolCode(), trigTools.SwitchOnTrigger.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.toolCode(), trackTools.MakeTrackCandidates.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.updateJECs().