64 |
|
tr->Branch("luminosityBlock",&luminosityBlock); |
65 |
|
tr->Branch("isRealData",&isRealData); |
66 |
|
tr->Branch("HBHENoiseFilterResult",&HBHENoiseFilterResult); |
67 |
< |
tr->Branch("beamspot_x0",&beamspot_x0); |
68 |
< |
tr->Branch("beamspot_y0",&beamspot_y0); |
69 |
< |
tr->Branch("beamspot_z0",&beamspot_z0); |
70 |
< |
|
67 |
> |
if(doPV){ |
68 |
> |
tr->Branch("beamspot_x0",&beamspot_x0); |
69 |
> |
tr->Branch("beamspot_y0",&beamspot_y0); |
70 |
> |
tr->Branch("beamspot_z0",&beamspot_z0); |
71 |
> |
} |
72 |
|
if(doElectrons){ |
73 |
|
electron_sources = iConfig.getParameter<std::vector<std::string> >("electron_sources"); |
74 |
|
for(size_t j=0; j< electron_sources.size(); ++j){ |
198 |
|
pvs[j].push_back(pv); |
199 |
|
} |
200 |
|
} |
201 |
+ |
|
202 |
+ |
edm::Handle<reco::BeamSpot> beamSpot; |
203 |
+ |
iEvent.getByLabel(edm::InputTag("offlineBeamSpot"), beamSpot); |
204 |
+ |
const reco::BeamSpot & bsp = *beamSpot; |
205 |
+ |
|
206 |
+ |
beamspot_x0 = bsp.x0(); |
207 |
+ |
beamspot_y0 = bsp.y0(); |
208 |
+ |
beamspot_z0 = bsp.z0(); |
209 |
|
} |
201 |
– |
|
202 |
– |
edm::Handle<reco::BeamSpot> beamSpot; |
203 |
– |
iEvent.getByLabel(edm::InputTag("offlineBeamSpot"), beamSpot); |
204 |
– |
const reco::BeamSpot & bsp = *beamSpot; |
205 |
– |
|
206 |
– |
beamspot_x0 = bsp.x0(); |
207 |
– |
beamspot_y0 = bsp.y0(); |
208 |
– |
beamspot_z0 = bsp.z0(); |
210 |
|
|
211 |
|
// ------------- electrons ------------- |
212 |
|
if(doElectrons){ |
357 |
|
tau.eta = pat_tau.eta(); |
358 |
|
tau.phi = pat_tau.phi(); |
359 |
|
tau.energy = pat_tau.energy(); |
360 |
< |
|
360 |
> |
tau.decayModeFinding = pat_tau.tauID("decayModeFinding")>0.5; |
361 |
> |
tau.byVLooseCombinedIsolationDeltaBetaCorr = pat_tau.tauID("byVLooseCombinedIsolationDeltaBetaCorr")>0.5; |
362 |
> |
tau.byLooseCombinedIsolationDeltaBetaCorr = pat_tau.tauID("byLooseCombinedIsolationDeltaBetaCorr")>0.5; |
363 |
> |
tau.byMediumCombinedIsolationDeltaBetaCorr = pat_tau.tauID("byMediumCombinedIsolationDeltaBetaCorr")>0.5; |
364 |
> |
tau.byTightCombinedIsolationDeltaBetaCorr = pat_tau.tauID("byTightCombinedIsolationDeltaBetaCorr")>0.5; |
365 |
> |
tau.againstElectronLoose = pat_tau.tauID("againstElectronLoose")>0.5; |
366 |
> |
tau.againstElectronMedium = pat_tau.tauID("againstElectronMedium")>0.5; |
367 |
> |
tau.againstElectronTight = pat_tau.tauID("againstElectronTight")>0.5; |
368 |
> |
tau.againstElectronMVA = pat_tau.tauID("againstElectronMVA")>0.5; |
369 |
> |
tau.againstMuonLoose = pat_tau.tauID("againstMuonLoose")>0.5; |
370 |
> |
tau.againstMuonMedium = pat_tau.tauID("againstMuonMedium")>0.5; |
371 |
> |
tau.againstMuonTight = pat_tau.tauID("againstMuonTight")>0.5; |
372 |
> |
|
373 |
|
taus[j].push_back(tau); |
374 |
|
} |
375 |
|
} |
715 |
|
void |
716 |
|
NtupleWriter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) |
717 |
|
{ |
718 |
< |
bool setup_changed = false; |
719 |
< |
hlt_cfg.init(iRun, iSetup, "HLT", setup_changed); |
720 |
< |
newrun=true; |
721 |
< |
|
722 |
< |
edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl; |
710 |
< |
iSetup.get<JetCorrectionsRecord>().get("AK5PF",JetCorParColl); |
711 |
< |
JetCorrectorParameters const & JetCorPar = (*JetCorParColl)["Uncertainty"]; |
712 |
< |
jecUnc = new JetCorrectionUncertainty(JetCorPar); |
718 |
> |
if(doTrigger){ |
719 |
> |
bool setup_changed = false; |
720 |
> |
hlt_cfg.init(iRun, iSetup, "HLT", setup_changed); |
721 |
> |
newrun=true; |
722 |
> |
} |
723 |
|
|
724 |
+ |
if(doJets || doTopJets){ |
725 |
+ |
edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl; |
726 |
+ |
iSetup.get<JetCorrectionsRecord>().get("AK5PF",JetCorParColl); |
727 |
+ |
JetCorrectorParameters const & JetCorPar = (*JetCorParColl)["Uncertainty"]; |
728 |
+ |
jecUnc = new JetCorrectionUncertainty(JetCorPar); |
729 |
+ |
} |
730 |
|
} |
731 |
|
|
732 |
|
// ------------ method called when ending the processing of a run ------------ |