CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
objects.IsoTrackAnalyzer Namespace Reference

Classes

class  IsoTrackAnalyzer
 

Functions

def makeNearestLeptons
 
def matchIsoTrack
 
def mtw
 
def printInfo
 
def process
 

Variables

string candidates = 'packedPFCandidates'
 
string candidatesTypes = 'std::vector<pat::PackedCandidate>'
 
 class_object = IsoTrackAnalyzer,
 event.pdgIdIsoTrack.append(event.selectedIsoTrack[0].pdgId()) event.isoIsoTrack.append(minIsoSum) event.dzIsoTrack.append(abs(dz(event.selectedIsoTrack[0]))) More...
 
 doPrune = True,
 
 doSecondVeto = False,
 unused More...
 
float dzMax = 0.1
 
float dzPartMax = 0.1
 
 foundNonIsoTrack = True
 ===> skip pfcands with a pt min (this should be 0) if part.pt()<self.cfg_ana.ptPartMin : continue ===> skip pfcands outside the cone (this should be 0.3) if deltaR(part.eta(), part.phi(), track.eta(), track.phi()) > self.cfg_ana.isoDR : continue More...
 
float isoDR = 0.3
 
int isoSum = 0
 
int maxAbsIso = 8
 
float MaxIsoSum = 0.1
 
float MaxIsoSumEMU = 0.2
 unused More...
 
tuple mtwIsoTrack = mtw(track, myMet)
 
list myLeptons = [ l for l in event.selectedLeptons if l.pt() > 10 ]
 
list myMet = self.handles['met']
 reset isoSum=0 for part in othertracks : ===> skip pfcands with a pt min (this should be 0) if part.pt()<self.cfg_ana.ptPartMin : continue ===> skip pfcands outside the cone (this should be 0.3) if deltaR(part.eta(), part.phi(), track.eta(), track.phi()) > self.cfg_ana.isoDR : continue isoSum += part.pt() More...
 
tuple nearestSelectedLeptons = makeNearestLeptons(myLeptons,track, event)
 
list othertracks = [ p for p in charged if( deltaR(p.eta(), p.phi(), track.eta(), track.phi()) < self.cfg_ana.isoDR and p.pt()>self.cfg_ana.ptPartMin ) ]
 ===> require Track Candidate above some pt and charged More...
 
int ptMin = 5
 
int ptMinEMU = 5
 
int ptPartMin = 0
 
 setOff = True,
 

Function Documentation

def objects.IsoTrackAnalyzer.makeNearestLeptons (   leptons,
  track,
  event 
)

Definition at line 24 of file IsoTrackAnalyzer.py.

References deltaR().

24 
25 def makeNearestLeptons(leptons,track, event):
26 
27  minDeltaR = 99999
28 
29  nearestLepton = []
30  ibest=-1
31  for i,lepton in enumerate(leptons):
32  minDeltaRtemp=deltaR(lepton.eta(),lepton.phi(),track.eta(),track.phi())
33  if minDeltaRtemp < minDeltaR:
34  minDeltaR = minDeltaRtemp
35  ibest=i
36 
37  if len(leptons) > 0 and ibest!=-1:
38  nearestLepton.append(leptons[ibest])
39 
40  return nearestLepton
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
def objects.IsoTrackAnalyzer.matchIsoTrack (   self,
  event 
)

Definition at line 161 of file IsoTrackAnalyzer.py.

References deltar.matchObjectCollection3().

162  def matchIsoTrack(self, event):
163  matchTau = matchObjectCollection3(event.selectedIsoTrack, event.gentaus + event.gentauleps + event.genleps, deltaRMax = 0.5)
164  for lep in event.selectedIsoTrack:
165  gen = matchTau[lep]
166  lep.mcMatchId = 1 if gen else 0
def matchObjectCollection3
Definition: deltar.py:38
def objects.IsoTrackAnalyzer.mtw (   x1,
  x2 
)

Definition at line 20 of file IsoTrackAnalyzer.py.

20 
21 def mtw(x1,x2):
22  import math
23  return math.sqrt(2*x1.pt()*x2.pt()*(1-math.cos(x1.phi()-x2.phi())))
def objects.IsoTrackAnalyzer.printInfo (   self,
  event 
)

Definition at line 167 of file IsoTrackAnalyzer.py.

References eta(), benchmark_cfg.pdgId, phi, and EnergyCorrector.pt.

168  def printInfo(self, event):
169  print 'event to Veto'
170  print '----------------'
171 
172  if len(event.selectedIsoTrack)>0:
173  print 'lenght: ',len(event.selectedIsoTrack)
174  print 'track candidate pt: ',event.selectedIsoTrack[0].pt()
175  print 'track candidate eta: ',event.selectedIsoTrack[0].eta()
176  print 'track candidate phi: ',event.selectedIsoTrack[0].phi()
177  print 'track candidate mass: ',event.selectedIsoTrack[0].mass()
178  print 'pdgId candidate : ',event.selectedIsoTrack[0].pdgId()
179  print 'dz: ',event.selectedIsoTrack[0].dz()
180  print 'iso: ',event.selectedIsoTrack[0].absIso
181  print 'matchId: ',event.selectedIsoTrack[0].mcMatchId
182 
183 # for lepton in event.selectedLeptons:
184 # print 'good lepton type: ',lepton.pdgId()
185 # print 'pt: ',lepton.pt()
186 
187 # for tau in event.selectedTaus:
188 # print 'good lepton type: ',tau.pdgId()
189 # print 'pt: ',tau.pt()
190 
191  print '----------------'
192 
T eta() const
Definition: DDAxes.h:10
def objects.IsoTrackAnalyzer.process (   self,
  event 
)

Definition at line 193 of file IsoTrackAnalyzer.py.

194  def process(self, event):
195 
196  if self.cfg_ana.setOff:
197  return True
198 
199  self.readCollections( event.input )
200  self.makeIsoTrack(event)
201 
202  if len(event.selectedIsoTrack)==0 : return True

Variable Documentation

string objects.IsoTrackAnalyzer.candidates = 'packedPFCandidates'

Definition at line 235 of file IsoTrackAnalyzer.py.

Referenced by pat::CandidateSummaryTable.analyze(), HWWAnalyzer.analyze(), CalibratableTest.analyze(), FWPFCandidateWithHitsProxyBuilder.build(), DTCombinatorialPatternReco.buildBestSegment(), DTCombinatorialExtendedPatternReco.buildBestSegment(), FWPFTauProxyBuilder.buildViewType(), L1RCTElectronIsolationCard.calcElectronCandidates(), ecaldqm.createMESet(), DDIsValid(), PFTauExtractor.depositFromObject(), PythiaFilterEMJetHeep.filter(), reco::modules::JetFlavourIdentifier.findLeptons(), TauTagValidation.getSumPt(), GroupedCkfTrajectoryBuilder.groupedLimitedCandidates(), MSLayersKeeperX0AtEta.init(), CkfTrajectoryBuilder.limitedCandidates(), operator<<(), TSGFromL1Muon.produce(), L3MuonCandidateProducerFromMuons.produce(), L2MuonCandidateProducer.produce(), L3MuonCandidateProducer.produce(), pat::PATCleaner< PATObjType >.produce(), edm::GenericSelectorByValueMap< T, C >.produce(), pat::PATTriggerMatchEmbedder< PATObjectType >.produce(), ObjectViewMatcher< T1, T2 >.produce(), ObjectViewCleaner< T >.produce(), DTCombinatorialPatternReco.reconstruct(), DTCombinatorialExtendedPatternReco.reconstruct(), DTMeantimerPatternReco.reconstruct(), TrajectorySegmentBuilder.segments(), reco::isodeposit::OtherCandidatesDeltaRVeto.setEvent(), and reco::isodeposit::OtherCandVeto.setEvent().

string objects.IsoTrackAnalyzer.candidatesTypes = 'std::vector<pat::PackedCandidate>'

Definition at line 236 of file IsoTrackAnalyzer.py.

objects.IsoTrackAnalyzer.class_object = IsoTrackAnalyzer,

event.pdgIdIsoTrack.append(event.selectedIsoTrack[0].pdgId()) event.isoIsoTrack.append(minIsoSum) event.dzIsoTrack.append(abs(dz(event.selectedIsoTrack[0])))

===> do matching self.printInfo(event) ===> do veto if needed self.printInfo(event) return False self.printInfo(event) return False

Definition at line 232 of file IsoTrackAnalyzer.py.

objects.IsoTrackAnalyzer.doPrune = True,

Definition at line 250 of file IsoTrackAnalyzer.py.

objects.IsoTrackAnalyzer.doSecondVeto = False,

unused

Definition at line 248 of file IsoTrackAnalyzer.py.

float objects.IsoTrackAnalyzer.dzMax = 0.1

Definition at line 239 of file IsoTrackAnalyzer.py.

Referenced by BeamMonitor.beginJob().

float objects.IsoTrackAnalyzer.dzPartMax = 0.1

Definition at line 243 of file IsoTrackAnalyzer.py.

objects.IsoTrackAnalyzer.foundNonIsoTrack = True

===> skip pfcands with a pt min (this should be 0) if part.pt()<self.cfg_ana.ptPartMin : continue ===> skip pfcands outside the cone (this should be 0.3) if deltaR(part.eta(), part.phi(), track.eta(), track.phi()) > self.cfg_ana.isoDR : continue

break the loop to save time

Definition at line 111 of file IsoTrackAnalyzer.py.

float objects.IsoTrackAnalyzer.isoDR = 0.3

Definition at line 241 of file IsoTrackAnalyzer.py.

int objects.IsoTrackAnalyzer.isoSum = 0

Definition at line 102 of file IsoTrackAnalyzer.py.

Referenced by pf2pat::IsolatedPFCandidateSelectorDefinition.select().

int objects.IsoTrackAnalyzer.maxAbsIso = 8

Definition at line 244 of file IsoTrackAnalyzer.py.

float objects.IsoTrackAnalyzer.MaxIsoSum = 0.1

Definition at line 246 of file IsoTrackAnalyzer.py.

float objects.IsoTrackAnalyzer.MaxIsoSumEMU = 0.2

unused

Definition at line 247 of file IsoTrackAnalyzer.py.

tuple objects.IsoTrackAnalyzer.mtwIsoTrack = mtw(track, myMet)

Definition at line 140 of file IsoTrackAnalyzer.py.

list objects.IsoTrackAnalyzer.myLeptons = [ l for l in event.selectedLeptons if l.pt() > 10 ]

Definition at line 145 of file IsoTrackAnalyzer.py.

list objects.IsoTrackAnalyzer.myMet = self.handles['met']

reset isoSum=0 for part in othertracks : ===> skip pfcands with a pt min (this should be 0) if part.pt()<self.cfg_ana.ptPartMin : continue ===> skip pfcands outside the cone (this should be 0.3) if deltaR(part.eta(), part.phi(), track.eta(), track.phi()) > self.cfg_ana.isoDR : continue isoSum += part.pt()

===> the sum should not contain the track candidate store a preIso track event.preIsoTrack.append(track)

Definition at line 139 of file IsoTrackAnalyzer.py.

Referenced by ZeePlots.analyze(), and WenuPlots.analyze().

tuple objects.IsoTrackAnalyzer.nearestSelectedLeptons = makeNearestLeptons(myLeptons,track, event)

Definition at line 146 of file IsoTrackAnalyzer.py.

list objects.IsoTrackAnalyzer.othertracks = [ p for p in charged if( deltaR(p.eta(), p.phi(), track.eta(), track.phi()) < self.cfg_ana.isoDR and p.pt()>self.cfg_ana.ptPartMin ) ]

===> require Track Candidate above some pt and charged

===> require is not the leading lepton and opposite to the leading lepton ===> Redundant:: require the Track Candidate with a minimum dz ===> compute the isolation and find the most isolated track

Definition at line 99 of file IsoTrackAnalyzer.py.

int objects.IsoTrackAnalyzer.ptMin = 5

Definition at line 237 of file IsoTrackAnalyzer.py.

int objects.IsoTrackAnalyzer.ptMinEMU = 5

Definition at line 238 of file IsoTrackAnalyzer.py.

int objects.IsoTrackAnalyzer.ptPartMin = 0

Definition at line 242 of file IsoTrackAnalyzer.py.

objects.IsoTrackAnalyzer.setOff = True,

Definition at line 233 of file IsoTrackAnalyzer.py.