CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 66 of file trackTools.py.

Constructor & Destructor Documentation

def trackTools.MakePATTrackCandidates.__init__ (   self)

Definition at line 73 of file trackTools.py.

References metTools.AddMETCollection._defaultParameters, editorTools.UserCodeTool._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jetTools.AddJetCollection._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, tauTools.AddTauCollection._defaultParameters, jetTools.SwitchJetCollection._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(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

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

References metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, editorTools.UserCodeTool._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jetTools.AddJetCollection._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, tauTools.AddTauCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, SignedImpactParameter3D.apply(), SignedTransverseImpactParameter.apply(), MatrixReader.MatrixReader.apply, SignedDecayLength3D.apply(), SurveyParameters.apply(), FWPSetCellEditor.apply(), gen::PhotosInterface.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), MatRepSparse< T, D1, D2, S, F >.apply(), ConfigToolBase.ConfigToolBase.apply(), BowedSurfaceAlignmentParameters.apply(), AlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), TwoBowedSurfacesAlignmentParameters.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), Vispa.Gui.BoxContentDialog.BoxContentDialog.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(), 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< Num1, Len1, Dim1 >.apply(), ArrayND< Accumulator >.apply(), ArrayND< Num2, Len2, Dim2 >.apply(), ArrayND< Numeric, Len, Dim >.apply(), npstat::ArrayND< Numeric >.apply(), npstat::ArrayND< Numeric, StackLen, StackDim >.apply(), ArrayND< Numeric, Len2, Dim2 >.apply(), ora::OraMainTable.setParameter(), ora::IMainTable.setParameter(), PedeReader.setParameter(), ora::PoolMainTable.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

Referenced by trackTools.MakePATTrackCandidates.getDefaultParameters().

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

Definition at line 85 of file trackTools.py.

References trackTools.MakePATTrackCandidates.__call__(), metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, editorTools.UserCodeTool._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jetTools.AddJetCollection._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, tauTools.AddTauCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, and jetTools.SetTagInfos._defaultParameters.

85 
86  def getDefaultParameters(self):
87  return self._defaultParameters
def trackTools.MakePATTrackCandidates.toolCode (   self,
  process 
)

Definition at line 115 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, jetTools.AddJetCollection._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, trackTools.MakePATTrackCandidates._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, tauTools.AddTauCollection._parameters, jetTools.SwitchJetCollection._parameters, jetTools.AddJetID._parameters, jetTools.SetTagInfos._parameters, statics.clone, and reco.if().

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

Member Data Documentation

trackTools.MakePATTrackCandidates._comment
private

Definition at line 83 of file trackTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__().

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

Definition at line 71 of file trackTools.py.

Referenced by HiCoreTools.RestrictInputToAOD.__call__(), HiCoreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__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__(), metUncertaintyTools.RunMEtUncertainties.__call__(), HiCoreTools.RestrictInputToAOD.__init__(), metUncertaintyTools.RunMEtUncertainties.__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__(), metUncertaintyTools.RunMEtUncertainties._initializeInputTag(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), metUncertaintyTools.RunMEtUncertainties.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.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(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

string trackTools.MakePATTrackCandidates._label = 'makePATTrackCandidates'
staticprivate

Definition at line 70 of file trackTools.py.

Referenced by trigTools.SwitchOnTrigger.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), and trigTools.SwitchOnTriggerMatchEmbedding.toolCode().

trackTools.MakePATTrackCandidates._parameters
private

Definition at line 82 of file trackTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__(), HiCoreTools.RestrictInputToAOD.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), trigTools.SwitchOnTrigger.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trackTools.MakeTrackCandidates.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and metUncertaintyTools.RunMEtUncertainties.toolCode().