4 |
|
#include "DataFormats/Common/interface/ValueMap.h" |
5 |
|
#include "DataFormats/Candidate/interface/Candidate.h" |
6 |
|
#include "DataFormats/HepMCCandidate/interface/GenParticle.h" |
7 |
+ |
|
8 |
|
#include "DataFormats/MuonReco/interface/Muon.h" |
9 |
|
#include "DataFormats/MuonReco/interface/MuonFwd.h" |
10 |
|
#include "DataFormats/MuonReco/interface/MuonSelectors.h" |
19 |
|
#include "DataFormats/PatCandidates/interface/Jet.h" |
20 |
|
#include "DataFormats/PatCandidates/interface/MET.h" |
21 |
|
|
22 |
+ |
#include "SimDataFormats/GeneratorProducts/interface/GenRunInfoProduct.h" |
23 |
+ |
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" |
24 |
+ |
|
25 |
|
#include "FWCore/ServiceRegistry/interface/Service.h" |
26 |
+ |
#include "FWCore/Framework/interface/Run.h" |
27 |
|
#include "CommonTools/UtilAlgos/interface/TFileService.h" |
28 |
|
|
24 |
– |
|
29 |
|
#include "UserCode/HbbAnalysis/interface/Electron.hh" |
30 |
|
#include "UserCode/HbbAnalysis/interface/Muon.hh" |
31 |
|
#include "UserCode/HbbAnalysis/interface/Tau.hh" |
125 |
|
event_->lumiBlock(aEvt.luminosityBlock()); |
126 |
|
event_->isRealData(aEvt.isRealData()); |
127 |
|
|
128 |
+ |
|
129 |
+ |
if (!processData_) { |
130 |
+ |
edm::Handle<edm::HepMCProduct> mcProd; |
131 |
+ |
edm::Handle<GenRunInfoProduct> lRunProd; |
132 |
+ |
try { |
133 |
+ |
aEvt.getByLabel("generator", mcProd ); |
134 |
+ |
} catch(cms::Exception& e) { |
135 |
+ |
std::cout << "AMM: Collection HepMCProduct not available! Exception : " << e.what() << ". " << std::endl; |
136 |
+ |
} |
137 |
+ |
try { |
138 |
+ |
aEvt.getRun().getByLabel("generator",lRunProd); |
139 |
+ |
} catch(cms::Exception& e) { |
140 |
+ |
std::cout << "AMM: Collection GenInfoProduct not available! Exception : " << e.what() << ". " << std::endl; |
141 |
+ |
} |
142 |
+ |
|
143 |
+ |
HbbGenInfo(mcProd,lRunProd); |
144 |
+ |
} |
145 |
+ |
|
146 |
|
edm::Handle<reco::GenParticleCollection> lGenParticles; |
147 |
|
try { |
148 |
|
aEvt.getByLabel(genParticleSrc_,lGenParticles); |
1412 |
|
} |
1413 |
|
|
1414 |
|
} |
1415 |
+ |
|
1416 |
|
void HbbTreeMaker::HbbHLTObjects(const edm::Handle<trigger::TriggerEvent> & aCol, |
1417 |
|
std::vector<HbbAnalysis::HLTObject> & aVec) |
1418 |
|
{ |
1449 |
|
|
1450 |
|
} |
1451 |
|
|
1452 |
+ |
void HbbTreeMaker::HbbGenInfo(const edm::Handle<edm::HepMCProduct> & amcProd, |
1453 |
+ |
const edm::Handle<GenRunInfoProduct> & aRunProd) |
1454 |
+ |
{ |
1455 |
+ |
const HepMC::GenEvent * genEvt = amcProd->GetEvent(); |
1456 |
+ |
HbbAnalysis::GenInfo lInfo; |
1457 |
+ |
|
1458 |
+ |
lInfo.processID(genEvt->signal_process_id()); |
1459 |
+ |
lInfo.ptHat(genEvt->event_scale()); |
1460 |
+ |
|
1461 |
+ |
lInfo.internalXS(aRunProd->internalXSec().value(), |
1462 |
+ |
aRunProd->internalXSec().error()); |
1463 |
|
|
1464 |
+ |
lInfo.externalXSLO(aRunProd->externalXSecLO().value(), |
1465 |
+ |
aRunProd->externalXSecLO().error()); |
1466 |
+ |
|
1467 |
+ |
lInfo.externalXSNLO(aRunProd->externalXSecNLO().value(), |
1468 |
+ |
aRunProd->externalXSecNLO().error()); |
1469 |
+ |
|
1470 |
+ |
lInfo.filterEff(aRunProd->filterEfficiency()); |
1471 |
+ |
|
1472 |
+ |
event_->generatorInfo(lInfo); |
1473 |
+ |
|
1474 |
+ |
} |
1475 |
+ |
|
1476 |
|
#include "FWCore/Framework/interface/MakerMacros.h" |
1477 |
|
DEFINE_FWK_MODULE(HbbTreeMaker); |
1478 |
|
|