ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/ForwardAnalysis/Utilities/src/TrackOutsideJetsSelector.cc
Revision: 1.1
Committed: Thu Aug 25 19:10:02 2011 UTC (13 years, 8 months ago) by antoniov
Content type: text/plain
Branch: MAIN
CVS Tags: V01-01-01, V01-01-00, antoniov-forwardAnalysis-09Jul2012-v1, antoniov-forwardAnalysis-29Jun2012-v1, V01-00-00, antoniov-utilities-11Jun2012-v1, antoniov-forwardAnalysis-Oct072011-v1, sfonseca_10_04_2011, antoniov-forwardAnalysis-Sep182011-v1, antoniov-forwardAnalysis-Sep102011-v1, sfonseca_08_26_2011, HEAD
Log Message:
moving plugins to ForwardAnalysis

File Contents

# Content
1 #include "ForwardAnalysis/Utilities/interface/TrackOutsideJetsSelector.h"
2
3 #include "DataFormats/Common/interface/Handle.h"
4 #include "FWCore/Framework/interface/Event.h"
5 #include "FWCore/ParameterSet/interface/ParameterSet.h"
6
7 #include "DataFormats/Candidate/interface/Candidate.h"
8 #include "DataFormats/TrackReco/interface/Track.h"
9 #include "DataFormats/Math/interface/deltaR.h"
10
11 using namespace reco;
12
13 namespace forwardAnalysis {
14
15 TrackOutsideJetsSelector::TrackOutsideJetsSelector(const edm::ParameterSet& pset):
16 jetTag_(pset.getParameter<edm::InputTag>("JetTag")),
17 coneSize_(pset.getParameter<double>("JetConeSize")){}
18
19 TrackOutsideJetsSelector::~TrackOutsideJetsSelector() {}
20
21 bool TrackOutsideJetsSelector::operator()(const reco::Track& track, const edm::Event& event) const {
22 edm::Handle<edm::View<Candidate> > jetCollectionH;
23 event.getByLabel(jetTag_,jetCollectionH);
24 const edm::View<Candidate>& jetColl = *(jetCollectionH.product());
25
26 bool associated = false;
27 for(edm::View<Candidate>::const_iterator jet = jetColl.begin(); jet != jetColl.end(); ++jet){
28 //FIXME: use jet-tracks association
29 if(deltaR(jet->eta(),jet->phi(),track.eta(),track.phi()) < coneSize_) associated = true;
30 }
31
32 bool accept = !associated;
33
34 return accept;
35 }
36
37 } // namespace