def __init__(self, collection = None, minEcalSeverity = 2, minHcalSeverity = 10, excludeHf = True, prune = True) : for item in ["collection", "minEcalSeverity", "minHcalSeverity", "prune"] : setattr(self, item, eval(item)) self.considerSeverity = self.collection=="Calo" self.subdetectors = configuration.detectorSpecs()["cms"]["%sSubdetectors"%self.collection] if excludeHf : self.subdetectors = filter(lambda s:"Hf" not in s, self.subdetectors) self.recHitCollections = configuration.detectorSpecs()["cms"]["%sRecHitCollections"%self.collection]
def __init__(self, cs, jetCs, maxIndex=0): self.cs = cs self.jetCs = jetCs self.maxIndex = maxIndex self.moreName = "%s%s through index %d" % (self.cs + (maxIndex,)) self.photonIndicesName = "%sIndices%s" % self.cs self.p4sName = "%sP4%s" % self.cs self.seedTimes = "%sWrappedSeedTime%s" % self.cs self.jetIndicesName = "%sIndices%s" % self.jetCs self.jetP4Name = "%sCorrectedP4%s" % self.jetCs self.mhtName = "%sSumP4%s" % self.jetCs self.htName = "%sSumEt%s" % self.jetCs self.etaBE = configuration.detectorSpecs()["cms"]["etaBE"] self.minDeltaRToJet = "%s%sMinDeltaRToJet%s%s" % (self.cs[0], self.cs[1], self.jetCs[0], self.jetCs[1])
def __init__(self, collection = None, level = None) : self.cs = collection self.idName = "%sID%s%s" % (self.cs[0],level,self.cs[1]) self.p4Name = "%sP4%s" % self.cs for var in ["EcalRecHitEtConeDR04", "HcalTowSumEtConeDR04", "HadronicOverEm", "TrkSumPtHollowConeDR04", "SigmaIetaIeta","HasPixelSeed"] : setattr(self,var, ("%s"+var+"%s")%self.cs) jei = {}; jeiLower = {}; tbhi = {}; tbhiLower = {}; hcti = {}; hctiLower = {}; hoe = {}; shhBarrel = {}; shhEndcap = {}; ptVar = {}; etaBE = {}; moreName = {} for l in ["EmFromTwiki","LooseFromTwiki","TightFromTwiki", "AnalysisNote_10_268","EGM_10_006_Loose","EGM_10_006_Tight","TrkIsoSideBand","TrkIsoRelaxed","IsoSideBand","IsoRelaxed","NoIsoReq"] : jei [l] = (4.2, 0.0060); jeiLower[l] = None tbhi[l] = (2.2, 0.0025); tbhiLower[l] = None hcti[l] = None ; hctiLower[l] = None hoe [l] = (0.05, 0.0000) shhBarrel[l] = None shhEndcap[l] = None ptVar[l] = "pt" etaBE[l] = configuration.detectorSpecs()["cms"]["etaBE"] moreName[l] = "PhotonID twiki, 2010-10-14, %s"%("is"+l.replace("FromTwiki","")) hcti ["LooseFromTwiki"] = (3.5, 0.001) hcti ["TightFromTwiki"] = (2.0, 0.001) shhBarrel["TightFromTwiki"] = (0.013, 0.0) shhEndcap["TightFromTwiki"] = (0.030, 0.0) jei ["AnalysisNote_10_268"] = (4.2, 0.003) tbhi ["AnalysisNote_10_268"] = (2.2, 0.001) hcti ["AnalysisNote_10_268"] = (2.0, 0.001) ptVar ["AnalysisNote_10_268"] = "Et" moreName ["AnalysisNote_10_268"] = "from CMS AN 10-268" jei ["EGM_10_006_Tight"] = (2.4, 0.0) tbhi ["EGM_10_006_Tight"] = (1.0, 0.0) hcti ["EGM_10_006_Tight"] = (0.9, 0.0) hoe ["EGM_10_006_Tight"] = (0.03, 0.0) shhBarrel["EGM_10_006_Tight"] = (0.01, 0.0) shhEndcap["EGM_10_006_Tight"] = (0.028,0.0) moreName ["EGM_10_006_Tight"] = "EGM 10-006 tight" jei ["EGM_10_006_Loose"] = (4.2, 0.0) tbhi ["EGM_10_006_Loose"] = (2.2, 0.0) hcti ["EGM_10_006_Loose"] = (2.0, 0.0) hoe ["EGM_10_006_Loose"] = (0.05, 0.0) shhBarrel["EGM_10_006_Loose"] = (0.01, 0.0) shhEndcap["EGM_10_006_Loose"] = (0.03, 0.0) moreName ["EGM_10_006_Loose"] = "EGM 10-006 loose" hcti ["TrkIsoRelaxed"] = (10.0, 0.001) moreName ["TrkIsoRelaxed"] = "relaxed trkIso" hcti ["TrkIsoSideBand"] = (10.0, 0.001) hctiLower["TrkIsoSideBand"] = ( 2.0, 0.001) moreName ["TrkIsoSideBand"] = "side-band of trkIso" jei ["NoIsoReq"] = (100.0, 0.0) tbhi ["NoIsoReq"] = (100.0, 0.0) hcti ["NoIsoReq"] = (100.0, 0.0) moreName ["NoIsoReq"] = "relaxed trkIso [ ,100]; hcalIso[ ,100]; ecalIso[ ,100]" jei ["IsoRelaxed"] = (8.2, 0.0060) tbhi ["IsoRelaxed"] = (6.2, 0.0025) hcti ["IsoRelaxed"] = (10.0, 0.001) moreName ["IsoRelaxed"] = "relaxed trkIso [ ,10]; hcalIso[ ,6]; ecalIso[ ,8]" jei ["IsoSideBand"] = (8.2, 0.0060) jeiLower ["IsoSideBand"] = jei ["TightFromTwiki"] tbhi ["IsoSideBand"] = (6.2, 0.0025) tbhiLower["IsoSideBand"] = tbhi["TightFromTwiki"] hcti ["IsoSideBand"] = (10.0, 0.001) hctiLower["IsoSideBand"] = hcti["TightFromTwiki"] moreName ["IsoSideBand"] = "side-band of trkIso [2,10]; hcalIso[2,6]; ecalIso[4,8]" for item in ["jei","jeiLower", "tbhi","tbhiLower", "hcti","hctiLower", "hoe","shhBarrel","shhEndcap","ptVar","etaBE","moreName"] : setattr(self,item,eval(item)[level])
def __init__(self, collection = None, minEcalSeverity = 2, minHcalSeverity = 10) : for item in ["collection", "minEcalSeverity", "minHcalSeverity"] : setattr(self, item, eval(item)) self.considerSeverity = self.collection=="Calo" self.subdetectors = configuration.detectorSpecs()["cms"]["%sSubdetectors"%self.collection] self.recHitCollections = configuration.detectorSpecs()["cms"]["%sRecHitCollections"%self.collection]
from core import utils,configuration from core.wrappedChain import * from calculables.Muon import IndicesOther,IndicesNonIso,IndicesAnyIso,IndicesAnyIsoIsoOrder,LeadingPt ############################## barrelEtaMax = configuration.detectorSpecs()["cms"]["barrelEtaMax"] endcapEtaMin = configuration.detectorSpecs()["cms"]["endcapEtaMin"] ############################## class Indices(wrappedChain.calculable) : def __init__(self, collection = None, ptMin = None, simpleEleID = None, useCombinedIso = True) : self.fixes = collection self.stash(["IndicesOther","IndicesNonIso","P4"]) isotype = "c" if useCombinedIso else "rel" self.eID = ("%sID"+simpleEleID+"%s")% self.fixes self.eIso = ("%s"+isotype+"Iso"+simpleEleID+"%s") % self.fixes self.ptMin = ptMin self.moreName = "pt>%.1f; simple%s; %sIso" % (ptMin, simpleEleID, isotype) def update(self,ignored) : self.value = [] other = self.source[self.IndicesOther] nonIso = self.source[self.IndicesNonIso] p4s = self.source[self.P4] eID = self.source[self.eID] eIso = self.source[self.eIso] for i in range(p4s.size()) : if p4s.at(i).pt() < self.ptMin : break elif eID[i]: if eIso[i]: self.value.append(i) else : nonIso.append(i) else: other.append(i) ##############################