genSrc      = cms.InputTag("genParticles"),
    debugString = cms.string("all gen's"),
)
#================ configure filters and analysis sequence=======================

process.load('SandBox.Skims.RA2Objects_cff')
process.load('SandBox.Skims.RA2Selection_cff')

process.load('ZInvisibleBkgds.Photons.ZinvBkgdGenPhotons_cff')
process.load('ZInvisibleBkgds.Photons.ZinvBkgdObjects_cff')
process.load('ZInvisibleBkgds.Photons.ZinvBkgdJets_cff')
#from ZInvisibleBkgds.Photons.ZinvBkgdGenPhotons_cff import *
#from ZInvisibleBkgds.Photons.ZinvBkgdJets_cff import *
from ZInvisibleBkgds.Photons.ZinvBkgdPhotons_cff import countPhotonsIDPFIso

process.countGenBosons = countPhotonsIDPFIso.clone(
    src = cms.InputTag("zinvBkgdst3ZBosons"))
process.countGenNuNu   = countPhotonsIDPFIso.clone(
    src = cms.InputTag("zinvBkgdst3ZNuNuBosons"),
    minNumber = cms.uint32(1))
process.countGenMuMu   = countPhotonsIDPFIso.clone(
    src = cms.InputTag("zinvBkgdst3ZMuMuBosons"),
    minNumber = cms.uint32(1))
process.countGenElEl   = countPhotonsIDPFIso.clone(
    src = cms.InputTag("zinvBkgdst3ZElElBosons"),
    minNumber = cms.uint32(1))
process.countGenTauTau = countPhotonsIDPFIso.clone(
    src = cms.InputTag("zinvBkgdst3ZTauTauBosons"),
    minNumber = cms.uint32(1))

process.load('ZInvisibleBkgds.Photons.ZinvVetos_cff')
from ZInvisibleBkgds.Photons.addphotonuserdata_cfi import *
process.patPhotonsUser1 = addphotonuserdata1.clone()
process.patPhotonsUser1.photonLabel = cms.InputTag("patPhotonsRA2")
process.patPhotonsUser1.userData.userFloats = cms.PSet(
    src = cms.VInputTag(
        cms.InputTag("rhoToPhotonMap")
    )
)
process.patPhotonsUserData = addphotonuserdata2.clone()
process.patPhotonsUserData.photonLabel = cms.InputTag("patPhotonsUser1")

process.load('ZInvisibleBkgds.Photons.ZinvMETProducers_cff')
process.load('ZInvisibleBkgds.Photons.ZinvVetos_cff')

from ZInvisibleBkgds.Photons.ZinvBkgdPhotons_cff import countPhotonsIDPFIso
process.countDirectPhotons        = countPhotonsIDPFIso.clone(src = cms.InputTag("zinvBkgdDirectPhotons"))
process.countSecondaryPhotons     = countPhotonsIDPFIso.clone(src = cms.InputTag("zinvBkgdSecondaryPhotons"))
process.countFragmentationPhotons = countPhotonsIDPFIso.clone(src = cms.InputTag("zinvBkgdFragmentationPhotons"))

process.analysisSeq = cms.Sequence(  process.ra2PFchsJets
                                   * process.htPFchs
                                   * process.mhtPFchs
                                   * process.zinvBJetsPF
                                   * process.rhoToPhotonMap
                                   * process.patPhotonsUser1
                                   * process.patPhotonsUserData
                                   * process.photonObjectsPF
                                   * process.photonMETCollections
                                   * process.photonVetos
                                   * process.zinvBJetsPFNoPhotonIDSpecial
#                                   * process.zinvBkgdGenPhotons
)
#================ configure filters and analysis sequence=======================

process.load('SandBox.Skims.RA2Objects_cff')
process.load('SandBox.Skims.RA2Selection_cff')
#from SusyAnalysis.MyAnalysis.filterBoolean_cfi import *
#process.load("SusyAnalysis.MyAnalysis.filterBoolean_cfi")

process.load('ZInvisibleBkgds.Photons.ZinvBkgdGenPhotons_cff')
process.load('ZInvisibleBkgds.Photons.ZinvBkgdObjects_cff')
process.load('ZInvisibleBkgds.Photons.ZinvBkgdJets_cff')
from ZInvisibleBkgds.Photons.ZinvBkgdGenPhotons_cff import *
from ZInvisibleBkgds.Photons.ZinvBkgdJets_cff import *
from ZInvisibleBkgds.Photons.ZinvBkgdPhotons_cff import countPhotonsIDPFIso

process.countGenBosons  = countPhotonsIDPFIso.clone(src = cms.InputTag("zinvBkgdst3ZBosons"))

process.analysisSeq = cms.Sequence(  process.ra2PFchsJets
                                   * process.zinvBkgdGenZBosons
                                   * process.zinvBJetsPF
                                   * process.countGenBosons
                                   * process.ra2MuonVeto
                                   * process.ra2ElectronVeto
####
                                   #* process.directPhotons
                                   #* process.secondaryPhotons
                                   #* process.fragmentationPhotons
                                   #* process.mistagPhotons
                                   #* process.st1ZBosons
                                   * process.st3ZBosons
process.load('ZInvisibleBkgds.Photons.zCandFilter_cff')
process.load('ZInvisibleBkgds.Photons.specialMuonCollection_cff')
process.specialMuonCollection.candidateLabel = cms.InputTag("zToMuMu")
process.patMuonsPFID.MuonSource    = cms.InputTag("patMuonsPF")
process.patMuonsPFIDIso.MuonSource = cms.InputTag("patMuonsPF")
process.load('ZInvisibleBkgds.Photons.ZinvBkgdGenPhotons_cff')
process.load('ZInvisibleBkgds.Photons.ZinvMETProducers_cff')
process.load('ZInvisibleBkgds.Photons.ZinvVetos_cff')

process.patJetsPFNoMuon.checkOverlaps.muons.src = cms.InputTag('patMuonsPFIDIso')
process.patJetsPFNoMuonPt30.checkOverlaps.muons.src = cms.InputTag('patMuonsPFIDIso')
process.patJetsPFNoMuonPt50Eta25.checkOverlaps.muons.src = cms.InputTag('patMuonsPFIDIso')

from ZInvisibleBkgds.Photons.ZinvBkgdPhotons_cff import countPhotonsIDPFIso
process.countGenMuMu   = countPhotonsIDPFIso.clone(
    src = cms.InputTag("zinvBkgdst3ZMuMuBosons"),
    minNumber = cms.uint32(1))

process.analysisSeq = cms.Sequence(process.zinvBkgdst3ZMuMuBosons
                                 #* process.zinvBkgdst3ZBosons
                                 * process.countGenMuMu
                                 * process.ra2PFchsJets
                                 * process.htPFchs
                                 * process.mhtPFchs
                                 * process.zinvBJetsPF
                                 * process.patMuonsPFIDIso
                                 #* process.zToMuMu
                                 #* process.zCandFilter
                                 #* process.specialMuonCollection
                                 * process.muonObjectsPF
                                 * process.zmumuMETCollections