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 | Public Attributes
jetCollectionTools.RecoJetInfo Class Reference
Inheritance diagram for jetCollectionTools.RecoJetInfo:

Public Member Functions

def __init__
 

Public Attributes

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

Detailed Description

Class to hold information of a recojet collection

Definition at line 133 of file jetCollectionTools.py.

Constructor & Destructor Documentation

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

Definition at line 137 of file jetCollectionTools.py.

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

Member Data Documentation

jetCollectionTools.RecoJetInfo.doCalo

Definition at line 167 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.doCS

Definition at line 170 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.doPF

Definition at line 168 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.inputCollection

Definition at line 142 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jet

Definition at line 138 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetAlgo

Definition at line 160 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetCorrPayload

Definition at line 173 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetLower

Definition at line 139 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetPUMethod

Definition at line 163 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetReco

Definition at line 162 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetSize

Definition at line 161 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetSizeNr

Definition at line 165 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetTagName

Definition at line 141 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.jetUpper

Definition at line 140 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.patJetFinalCollection

Definition at line 184 of file jetCollectionTools.py.

jetCollectionTools.RecoJetInfo.skipUserData

Definition at line 171 of file jetCollectionTools.py.