CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
jetCollectionTools.RecoJetInfo Class Reference
Inheritance diagram for jetCollectionTools.RecoJetInfo:

Public Member Functions

def __init__ (self, jet, inputCollection)
 

Public Attributes

 doCalo
 
 doCS
 
 doPF
 
 inputCollection
 
 jet
 
 jetAlgo
 
 jetCorrPayload
 
 jetLower
 
 jetPUMethod
 
 jetReco
 
 jetSize
 
 jetSizeNr
 
 jetTagName
 
 jetUpper
 
 skipUserData
 

Detailed Description

Class to hold information of a recojet collection

Definition at line 129 of file jetCollectionTools.py.

Constructor & Destructor Documentation

def jetCollectionTools.RecoJetInfo.__init__ (   self,
  jet,
  inputCollection 
)

Definition at line 133 of file jetCollectionTools.py.

133  def __init__(self, jet, inputCollection):
134  self.jet = jet
135  self.jetLower = jet.lower()
136  self.jetUpper = jet.upper()
137  self.jetTagName = self.jetUpper
138  self.inputCollection = inputCollection
139  algoKey = 'algo'
140  sizeKey = 'size'
141  recoKey = 'reco'
142  puMethodKey = 'puMethod'
143  jetRegex = re.compile(
144  r'(?P<{algo}>({algoList}))(?P<{size}>[0-9]+)(?P<{reco}>(pf|calo))(?P<{puMethod}>(chs|puppi|sk|cs|))'.format(
145  algo = algoKey,
146  algoList = '|'.join(supportedJetAlgos.keys()),
147  size = sizeKey,
148  reco = recoKey,
149  puMethod = puMethodKey,
150  )
151  )
152  jetMatch = jetRegex.match(jet.lower())
153  if not jetMatch:
154  raise RuntimeError('Invalid jet collection: %s' % jet)
155 
156  self.jetAlgo = jetMatch.group(algoKey)
157  self.jetSize = jetMatch.group(sizeKey)
158  self.jetReco = jetMatch.group(recoKey)
159  self.jetPUMethod = jetMatch.group(puMethodKey)
160 
161  self.jetSizeNr = float(self.jetSize) / 10.
162 
163  self.doCalo = self.jetReco == "calo"
164  self.doPF = self.jetReco == "pf"
165 
166  self.doCS = self.jetPUMethod == "cs"
167  self.skipUserData = self.doCalo or (self.jetPUMethod in [ "puppi", "sk" ] and inputCollection == "")
168 
169  self.jetCorrPayload = "{}{}{}".format(
170  self.jetAlgo.upper(), self.jetSize, "Calo" if self.doCalo else self.jetReco.upper()
171  )
172 
173  if self.jetPUMethod == "puppi":
174  self.jetCorrPayload += "Puppi"
175  elif self.jetPUMethod in [ "cs", "sk" ]:
176  self.jetCorrPayload += "chs"
177  else:
178  self.jetCorrPayload += self.jetPUMethod.lower()
179 
180 #============================================
181 #
182 # RecoJetAdder
183 #
184 #============================================
def __init__(self, jet, inputCollection)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Member Data Documentation

jetCollectionTools.RecoJetInfo.doCalo

Definition at line 163 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.doCS

Definition at line 166 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.doPF

Definition at line 164 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.inputCollection

Definition at line 138 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jet

Definition at line 134 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetAlgo

Definition at line 156 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetCorrPayload

Definition at line 169 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetLower

Definition at line 135 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetPUMethod

Definition at line 159 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetReco

Definition at line 158 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetSize

Definition at line 157 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetSizeNr

Definition at line 161 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetTagName

Definition at line 137 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetUpper

Definition at line 136 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.skipUserData

Definition at line 167 of file jetCollectionTools.py.