1 |
|
#include "VHbbAnalysis/HbbAnalyzer/interface/HbbCandidateFinder.h" |
2 |
|
|
3 |
< |
|
4 |
< |
|
5 |
< |
|
6 |
< |
HbbCandidateFinder::HbbCandidateFinder(const edm::ParameterSet& iConfig): vhbbevent_(iConfig.getParameter<edm::InputTag>("VHbbEventLabel")) { |
3 |
> |
HbbCandidateFinder::HbbCandidateFinder(const edm::ParameterSet& iConfig): verbose_(iConfig.getParameter<bool>("verbose") ) { |
4 |
> |
algo_ = new HbbCandidateFinderAlgo(iConfig.getParameter<bool>("verbose"), iConfig.getParameter<double>("jetPtThreshold"), |
5 |
> |
iConfig.getParameter<bool>("useHighestPtHiggs") ); |
6 |
> |
applyFilter = iConfig.getParameter<bool>("actAsAFilter"); |
7 |
|
produces<std::vector<VHbbCandidate > >(); |
8 |
|
} |
9 |
|
|
10 |
< |
HbbCandidateFinder::~HbbCandidateFinder(){} |
10 |
> |
HbbCandidateFinder::~HbbCandidateFinder(){delete algo_;} |
11 |
|
|
12 |
|
void HbbCandidateFinder::beginJob(){} |
13 |
|
void HbbCandidateFinder::endJob(){} |
14 |
|
|
15 |
< |
|
16 |
< |
float HbbCandidateFinder::getDeltaTheta( VHbbEvent::SimpleJet * j1, VHbbEvent::SimpleJet * j2 ){return -1.;} |
17 |
< |
|
18 |
< |
|
19 |
< |
|
20 |
< |
void HbbCandidateFinder::produce( edm::Event& iEvent, const edm::EventSetup& iEventSetup){ |
15 |
> |
bool HbbCandidateFinder::filter( edm::Event& iEvent, const edm::EventSetup& iEventSetup){ |
16 |
|
|
17 |
|
std::auto_ptr<std::vector<VHbbCandidate> > vHbbCandidates( new std::vector<VHbbCandidate> ); |
18 |
|
|
19 |
|
edm::Handle<VHbbEvent> vHbbEvent; |
20 |
< |
iEvent.getByLabel(vhbbevent_, vHbbEvent); |
20 |
> |
// iEvent.getByLabel(vhbbevent_, vHbbEvent); |
21 |
> |
iEvent.getByType(vHbbEvent); |
22 |
|
|
23 |
|
|
24 |
|
// |
28 |
|
// hbbCandidateFinderAlgo(vHbbCandidates, vHbbEvent-> result()); |
29 |
|
// do nothing for a test |
30 |
|
|
31 |
+ |
algo_->run(vHbbEvent.product(),(*vHbbCandidates)); |
32 |
+ |
|
33 |
+ |
|
34 |
+ |
if (verbose_) |
35 |
+ |
std::cout <<" Pushing VHbb candidates: "<<vHbbCandidates->size()<<std::endl; |
36 |
+ |
|
37 |
|
iEvent.put(vHbbCandidates); |
38 |
|
|
39 |
+ |
if (applyFilter == false) return true; |
40 |
+ |
if (vHbbCandidates->size() == 0) return false; |
41 |
+ |
return true; |
42 |
|
} |
43 |
|
|
44 |
|
|
45 |
+ |
|
46 |
|
//define this as a plug-in |
47 |
|
DEFINE_FWK_MODULE(HbbCandidateFinder); |