ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbbAnalysis/HbbAnalyzer/plugins/HbbCandidateFinder.cc
(Generate patch)

Comparing UserCode/VHbbAnalysis/HbbAnalyzer/plugins/HbbCandidateFinder.cc (file contents):
Revision 1.1 by tboccali, Tue Jun 14 15:55:44 2011 UTC vs.
Revision 1.10 by arizzi, Mon May 14 15:33:51 2012 UTC

# Line 1 | Line 1
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  
24  edm::Handle<VHbbEvent>  vHbbEvent;
25  iEvent.getByLabel(vhbbevent_, vHbbEvent);
19    
20 +  edm::Handle<VHbbEventAuxInfo>  vHbbEventAux;
21 +  //  iEvent.getByLabel(vhbbevent_, vHbbEvent);
22 +  iEvent.getByType(vHbbEventAux);
23 +  edm::Handle<VHbbEvent>  vHbbEvent;
24 +  //  iEvent.getByLabel(vhbbevent_, vHbbEvent);
25 +  iEvent.getByType(vHbbEvent);
26  
27    //
28    // start searching for candidates
# Line 32 | Line 31 | void HbbCandidateFinder::produce( edm::E
31    //  hbbCandidateFinderAlgo(vHbbCandidates, vHbbEvent-> result());
32    // do nothing for a test
33    
34 +  algo_->run(vHbbEvent.product(),(*vHbbCandidates),*vHbbEventAux.product());
35 +  
36 +  
37 +  if (verbose_)
38 +    std::cout <<" Pushing VHbb candidates: "<<vHbbCandidates->size()<<std::endl;
39 +  
40    iEvent.put(vHbbCandidates);  
41  
42 +  if (applyFilter == false) return true;
43 +  if (vHbbCandidates->size() == 0) return false;
44 +  return true;
45   }
46  
47  
48 +
49   //define this as a plug-in
50   DEFINE_FWK_MODULE(HbbCandidateFinder);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines