Esempio n. 1
0
    def addKinematicSelection(
        self, process, dumperTemplate=None, dumpTrees=True, dumpWorkspace=False, dumpHistos=True, splitByIso=True
    ):
        """
        Add basic kinematic selection to the process    
        """
        if not dumperTemplate:
            dumperTemplate = self.dumperTemplate

        src = self.sourceDiphotons
        if self.computeRechitFlags:
            process.flashggDiPhotonsWithFlags = cms.EDProducer(
                "DiphotonsDiPhotonsRechiFlagProducer",
                src=cms.InputTag(src),
                reducedBarrelRecHitCollection=cms.InputTag("reducedEgamma", "reducedEBRecHits"),
                reducedEndcapRecHitCollection=cms.InputTag("reducedEgamma", "reducedEERecHits"),
                reducedPreshowerRecHitCollection=cms.InputTag("reducedEgamma", "reducedESRecHits"),
            )
            src = "flashggDiPhotonsWithFlags"
        if self.applyDiphotonCorrections:
            if self.diphotonCorrectionsVersion == "OT":
                process.load("flashgg.Systematics.flashggDiPhotonSystematics0T_cfi")
            else:
                process.load("flashgg.Systematics.flashggDiPhotonSystematics_cfi")
            process.flashggDiPhotonSystematics.src = src
            src = "flashggDiPhotonSystematics"

        template = simpleTemplate.clone(
            src=cms.InputTag(src),
            cut=cms.string(
                "mass > %(massCut)f"
                " && leadingPhoton.pt > %(ptLead)f %(scalingFunc)s && subLeadingPhoton.pt > %(ptSublead)f %(scalingFunc)s"
                " && abs(leadingPhoton.superCluster.eta)<2.5 && abs(subLeadingPhoton.superCluster.eta)<2.5 "
                " && ( abs(leadingPhoton.superCluster.eta)<1.4442 || abs(leadingPhoton.superCluster.eta)>1.566)"
                " && ( abs(subLeadingPhoton.superCluster.eta)<1.4442 || abs(subLeadingPhoton.superCluster.eta)>1.566)"
                " && ( abs(leadingPhoton.superCluster.eta) < 1.5 || abs(subLeadingPhoton.superCluster.eta) < 1.5 )"
                % {
                    "massCut": self.massCut,
                    "ptLead": self.ptLead,
                    "ptSublead": self.ptSublead,
                    "scalingFunc": self.scalingFunc,
                }
            ),
        )

        if self.computeMVA:
            setattr(process, "tmpKinDiphotons", template)
            template = diphotonsWithMVA.clone(src=cms.InputTag("tmpKinDiphotons"))

        self.analysisSelections += self.addDiphoSelection(
            process,
            "kin",
            template,
            dumperTemplate,
            dumpTrees=dumpTrees,
            dumpWorkspace=dumpWorkspace,
            dumpHistos=dumpHistos,
            splitByIso=splitByIso,
            selectN=False,
        )
Esempio n. 2
0
 def addKinematicSelection(self,process,dumperTemplate=None,
                           dumpTrees=True,dumpWorkspace=False,dumpHistos=True,splitByIso=True):
     """
     Add basic kinematic selection to the process    
     """
     if not dumperTemplate:
         dumperTemplate = self.dumperTemplate
     
     template = simpleTemplate.clone(src=cms.InputTag("flashggDiPhotons"),
                                     cut = cms.string(
             "mass > %(massCut)f"
             " && leadingPhoton.pt > %(ptLead)f %(scalingFunc)s && subLeadingPhoton.pt > %(ptSublead)f %(scalingFunc)s"
             " && abs(leadingPhoton.superCluster.eta)<2.5 && abs(subLeadingPhoton.superCluster.eta)<2.5 "
             " && ( abs(leadingPhoton.superCluster.eta)<1.4442 || abs(leadingPhoton.superCluster.eta)>1.566)"
             " && ( abs(subLeadingPhoton.superCluster.eta)<1.4442 || abs(subLeadingPhoton.superCluster.eta)>1.566)" 
             " && ( abs(leadingPhoton.superCluster.eta) < 1.5 || abs(subLeadingPhoton.superCluster.eta) < 1.5 )"
             % { "massCut" : self.massCut, 
                 "ptLead"  : self.ptLead,
                 "ptSublead" : self.ptSublead,
                 "scalingFunc" : self.scalingFunc
                 }
             )
                                     )
     
     if self.computeMVA:
         setattr(process,"tmpKinDiphotons",template)
         template = diphotonsWithMVA.clone(src=cms.InputTag("tmpKinDiphotons"))
     
     self.analysisSelections += self.addDiphoSelection(process,"kin",template,dumperTemplate,
                                                       dumpTrees=dumpTrees,dumpWorkspace=dumpWorkspace,dumpHistos=dumpHistos,splitByIso=splitByIso,selectN=False)
Esempio n. 3
0
 def addKinematicSelection(self,process,dumperTemplate=None,
                           dumpTrees=True,dumpWorkspace=False,dumpHistos=True,splitByIso=True):
     """
     Add basic kinematic selection to the process    
     """
     if not dumperTemplate:
         dumperTemplate = self.dumperTemplate
     
     src = "flashggDiPhotons"
     if self.computeRechitFlags:
         process.flashggDiPhotonsWithFlags = cms.EDProducer("DiphotonsDiPhotonsRechiFlagProducer",
                                                            src=cms.InputTag("flashggDiPhotons"),
                                                            reducedBarrelRecHitCollection = cms.InputTag('reducedEgamma','reducedEBRecHits'),
                                                            reducedEndcapRecHitCollection = cms.InputTag('reducedEgamma','reducedEERecHits'),
                                                            reducedPreshowerRecHitCollection = cms.InputTag('reducedEgamma','reducedESRecHits')                
                                                            )
         src = "flashggDiPhotonsWithFlags"
         
     template = simpleTemplate.clone(src=cms.InputTag(src),
                                     cut = cms.string(
             "mass > %(massCut)f"
             " && leadingPhoton.pt > %(ptLead)f %(scalingFunc)s && subLeadingPhoton.pt > %(ptSublead)f %(scalingFunc)s"
             " && abs(leadingPhoton.superCluster.eta)<2.5 && abs(subLeadingPhoton.superCluster.eta)<2.5 "
             " && ( abs(leadingPhoton.superCluster.eta)<1.4442 || abs(leadingPhoton.superCluster.eta)>1.566)"
             " && ( abs(subLeadingPhoton.superCluster.eta)<1.4442 || abs(subLeadingPhoton.superCluster.eta)>1.566)" 
             " && ( abs(leadingPhoton.superCluster.eta) < 1.5 || abs(subLeadingPhoton.superCluster.eta) < 1.5 )"
             % { "massCut" : self.massCut, 
                 "ptLead"  : self.ptLead,
                 "ptSublead" : self.ptSublead,
                 "scalingFunc" : self.scalingFunc
                 }
             )
                                     )
     
     if self.computeMVA:
         setattr(process,"tmpKinDiphotons",template)
         template = diphotonsWithMVA.clone(src=cms.InputTag("tmpKinDiphotons"))
     
     self.analysisSelections += self.addDiphoSelection(process,"kin",template,dumperTemplate,
                                                       dumpTrees=dumpTrees,dumpWorkspace=dumpWorkspace,dumpHistos=dumpHistos,splitByIso=splitByIso,selectN=False)