PageRenderTime 30ms CodeModel.GetById 14ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/ElectroWeakAnalysis/ZEE/test/pat_ZeePlots_data.py

https://github.com/aivanov-cern/cmssw
Python | 189 lines | 164 code | 10 blank | 15 comment | 0 complexity | 1f1048b27d47893a2f63d5f89c3fdb97 MD5 | raw file
  1import FWCore.ParameterSet.Config as cms
  2
  3process = cms.Process("PAT")
  4
  5
  6process.MessageLogger = cms.Service(
  7        "MessageLogger",
  8            categories = cms.untracked.vstring('info', 'debug','cout')
  9            )
 10
 11process.options = cms.untracked.PSet(
 12    Rethrow = cms.untracked.vstring('ProductNotFound')
 13)
 14
 15
 16# source
 17process.source = cms.Source("PoolSource", 
 18     fileNames = cms.untracked.vstring(
 19    "dcap://gfe02:22128/pnfs/hep.ph.ic.ac.uk/data/cms/store/data/Commissioning10/MinimumBias/RECO/May6thPDSkim2_SD_EG-v1/0135/FCC2FA5A-BB5D-DF11-8246-002618943978.root"
 20    )
 21)
 22process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(300) )
 23
 24## Load additional processes
 25process.load("Configuration.StandardSequences.Geometry_cff")
 26process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
 27## global tags:
 28process.GlobalTag.globaltag = cms.string('GR_R_35X_V8B::All')
 29process.load("Configuration.StandardSequences.MagneticField_cff")
 30
 31
 32################################################################################################
 33###    P r e p a r a t i o n      o f    t h e    P A T    O b j e c t s   f r o m    A O D  ###
 34################################################################################################
 35
 36## pat sequences to be loaded:
 37#process.load("PhysicsTools.PFCandProducer.PF2PAT_cff")
 38process.load("PhysicsTools.PatAlgos.patSequences_cff")
 39#process.load("PhysicsTools.PatAlgos.triggerLayer1.triggerProducer_cff")
 40##
 41## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 42## MET creation     <=== WARNING: YOU MAY WANT TO MODIFY THIS PART OF THE CODE       %%%%%%%%%%%%%
 43##                                specify the names of the MET collections that you need here %%%%
 44##                                                                                             #%%
 45## if you don't specify anything the default MET is the raw Calo MET                           #%%
 46process.layer1RawCaloMETs = process.patMETs.clone(                                          #%%
 47    metSource = cms.InputTag("met","","RECO"),
 48    addTrigMatch = cms.bool(False),
 49    addMuonCorrections = cms.bool(False),
 50    addGenMET = cms.bool(False),
 51    )
 52## specify here what you want to have on the plots! <===== MET THAT YOU WANT ON THE PLOTS  %%%%%%%
 53myDesiredMetCollection = 'layer1RawCaloMETs'
 54## modify the sequence of the MET creation:                                                    #%%
 55process.makePatMETs = cms.Sequence(process.layer1RawCaloMETs)
 56## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 57## modify the final pat sequence: keep only electrons + METS (muons are needed for met corrections)
 58process.load("RecoEgamma.EgammaIsolationAlgos.egammaIsolationSequence_cff")
 59#process.patElectronIsolation = cms.Sequence(process.egammaIsolationSequence)
 60#
 61process.patElectrons.isoDeposits = cms.PSet()
 62process.patElectrons.userIsolation = cms.PSet(
 63#       tracker = cms.PSet(
 64#            src = cms.InputTag("electronTrackIsolationScone"),
 65#        ),
 66#        ecal = cms.PSet(
 67#            src = cms.InputTag("electronEcalRecHitIsolationLcone"),
 68#        ),
 69#        hcal = cms.PSet(
 70#            src = cms.InputTag("electronHcalTowerIsolationLcone"),
 71#        ),
 72#        user = cms.VPSet(),
 73    )
 74
 75##
 76## Pre-calculated electron identification selections
 77##
 78## set the variable false if you don't need them, or if you use your own PSet
 79##
 80## any input tag you set corresponds to a valuemap that either it is stored in the event
 81## or you create it yourself
 82process.patElectrons.addElectronID = cms.bool(True)
 83process.patElectrons.electronIDSources = cms.PSet(
 84    simpleEleId95relIso= cms.InputTag("simpleEleId95relIso"),
 85    simpleEleId90relIso= cms.InputTag("simpleEleId90relIso"),
 86    simpleEleId85relIso= cms.InputTag("simpleEleId85relIso"),
 87    simpleEleId80relIso= cms.InputTag("simpleEleId80relIso"),
 88    simpleEleId70relIso= cms.InputTag("simpleEleId70relIso"),
 89    simpleEleId60relIso= cms.InputTag("simpleEleId60relIso"),
 90    simpleEleId95cIso= cms.InputTag("simpleEleId95cIso"),
 91    simpleEleId90cIso= cms.InputTag("simpleEleId90cIso"),
 92    simpleEleId85cIso= cms.InputTag("simpleEleId85cIso"),
 93    simpleEleId80cIso= cms.InputTag("simpleEleId80cIso"),
 94    simpleEleId70cIso= cms.InputTag("simpleEleId70cIso"),
 95    simpleEleId60cIso= cms.InputTag("simpleEleId60cIso"),    
 96    )
 97##
 98process.patElectrons.addGenMatch = cms.bool(False)
 99process.patElectrons.embedGenMatch = cms.bool(False)
100##
101process.patElectrons.addGenMatch = cms.bool(False)
102process.patElectrons.embedGenMatch = cms.bool(False)
103##
104process.load("ElectroWeakAnalysis.ZEE.simpleEleIdSequence_cff")
105process.patElectronIDs = cms.Sequence(process.simpleEleIdSequence)
106process.makePatElectrons = cms.Sequence(process.patElectronIDs*process.patElectrons)
107# process.makePatMuons may be needed depending on how you calculate the MET
108process.makePatCandidates = cms.Sequence(process.makePatElectrons+process.makePatMETs)
109process.patDefaultSequence = cms.Sequence(process.makePatCandidates)
110##  ################################################################################
111##
112##  the filter to select the candidates from the data samples
113##
114## WARNING: you may want to modify this item:  T R I G G E R     S E L E C T I O N
115HLT_process_name = "HLT"   # 
116# trigger path selection
117HLT_path_name     = "HLT_Photon10_L1R" #= "HLT_Ele15_LW_L1R" #
118# trigger filter name
119HLT_filter_name  =  "hltL1NonIsoHLTNonIsoSinglePhotonEt10HcalIsolFilter"
120#
121process.zeeFilter = cms.EDFilter('ZeeCandidateFilter',
122                                 # cfg for data
123                                 dataMagneticFieldSetUp = cms.untracked.bool(True),
124                                 dcsTag = cms.untracked.InputTag("scalersRawToDigi"),
125                                 # cuts
126                                 ETCut = cms.untracked.double(20.),
127                                 METCut = cms.untracked.double(0.),
128                                 useTriggerInfo = cms.untracked.bool(True),
129                                 # trigger
130                                 triggerCollectionTag = cms.untracked.InputTag("TriggerResults","",HLT_process_name),
131                                 triggerEventTag = cms.untracked.InputTag("hltTriggerSummaryAOD","",HLT_process_name),
132                                 hltpath = cms.untracked.string(HLT_path_name),
133                                 hltpathFilter = cms.untracked.InputTag(HLT_filter_name,"",HLT_process_name),
134                                 electronMatched2HLT = cms.untracked.bool(True),
135                                 electronMatched2HLT_DR = cms.untracked.double(0.2),
136                                 # exra variable calculation
137                                 calculateConversionRejection = cms.untracked.bool(True),
138                                 calculateValidFirstPXBHit = cms.untracked.bool(True),
139                                 calculateExpectedMissingHits = cms.untracked.bool(True),
140                                 # electrons and MET
141                                 electronCollectionTag = cms.untracked.InputTag("patElectrons","","PAT"),
142                                 metCollectionTag = cms.untracked.InputTag(myDesiredMetCollection,"","PAT")
143                                 )
144####################################################################################
145##
146## the Z selection that you prefer
147from ElectroWeakAnalysis.ZEE.simpleCutBasedSpring10SelectionBlocks_cfi import *
148
149selection_inverse = cms.PSet (
150    deta_EB_inv = cms.untracked.bool(True),
151    deta_EE_inv = cms.untracked.bool(True)
152    )
153
154
155selection_secondLeg = cms.PSet (
156    ## set this to true if you want to switch on diff 2nd leg selection
157    useDifferentSecondLegSelection = cms.untracked.bool(False),
158    ## preselection criteria are independent of useDifferentSecondLegSelection
159    #  set them to False if you don't want them
160    useConversionRejection2 = cms.untracked.bool(False),
161    useValidFirstPXBHit2 = cms.untracked.bool(False),
162    useExpectedMissingHits2 =cms.untracked.bool(False),
163    maxNumberOfExpectedMissingHits2 = cms.untracked.int32(1),    
164    ##
165    usePrecalcID2 = cms.untracked.bool(False),
166    usePrecalcIDType2 = cms.untracked.string('simpleEleId95cIso'),
167    usePrecalcIDSign2 = cms.untracked.string('='),
168    usePrecalcIDValue2 = cms.untracked.double(7),    
169    )
170
171####################################################################################
172##
173## and the plot creator
174process.plotter = cms.EDAnalyzer('ZeePlots',
175                                 selection_95relIso,
176                                 selection_secondLeg,
177                                 usePrecalcID = cms.untracked.bool(False),
178                                 usePrecalcIDType = cms.untracked.string('simpleEleId95cIso'),
179                                 usePrecalcIDSign = cms.untracked.string('='),
180                                 usePrecalcIDValue = cms.untracked.double(7),
181                                 zeeCollectionTag = cms.untracked.InputTag("zeeFilter","selectedZeeCandidates","PAT")
182                                 )
183
184
185
186
187process.p = cms.Path(process.patDefaultSequence +process.zeeFilter + process.plotter)
188
189