Public Member Functions | |
IsolationProducerForTracks (const edm::ParameterSet &) | |
Private Member Functions | |
void | produce (edm::Event &event, const edm::EventSetup &setup) |
Private Attributes | |
double | coneSize_ |
edm::InputTag | highPtTracks_ |
edm::InputTag | isoDeps_ |
double | trackPtMin_ |
edm::InputTag | tracks_ |
Definition at line 7 of file IsolationProducerForTracks.cc.
IsolationProducerForTracks::IsolationProducerForTracks | ( | const edm::ParameterSet & | pset | ) |
Definition at line 40 of file IsolationProducerForTracks.cc.
00040 : 00041 tracks_( pset.getParameter<InputTag>( "tracks" ) ), 00042 highPtTracks_( pset.getParameter<InputTag>( "highPtTracks" ) ), 00043 isoDeps_( pset.getParameter<InputTag>( "isoDeps" ) ), 00044 trackPtMin_( pset.getParameter<double>( "trackPtMin" ) ), 00045 coneSize_( pset.getParameter<double>( "coneSize" ) ) 00046 { 00047 produces<TkIsoMap>(); 00048 }
void IsolationProducerForTracks::produce | ( | edm::Event & | event, | |
const edm::EventSetup & | setup | |||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 50 of file IsolationProducerForTracks.cc.
References coneSize_, reco::IsoDeposit::depositWithin(), edm::helper::Filler< Map >::fill(), highPtTracks_cfi::highPtTracks, highPtTracks_, i, edm::helper::Filler< Map >::insert(), isoDeps_, j, reco::Particle::pt(), trackPtMin_, tracks, and tracks_.
00050 { 00051 std::auto_ptr<TkIsoMap> caloIsolations(new TkIsoMap); 00052 TkIsoMap::Filler filler(*caloIsolations); 00053 { 00054 Handle<CandidateView> tracks; 00055 event.getByLabel(tracks_, tracks); 00056 00057 Handle<CandidateView> highPtTracks; 00058 event.getByLabel(highPtTracks_, highPtTracks); 00059 00060 Handle<IsoDepositMap> isoDeps; 00061 event.getByLabel(isoDeps_, isoDeps); 00062 00063 int nTracks = tracks->size(); 00064 int nHighPtTracks = highPtTracks->size(); 00065 std::vector<double> iso(nTracks); 00066 00067 OverlapChecker overlap; 00068 00069 for(int i = 0; i < nTracks; ++i ) { 00070 const Candidate & tkCand = (*tracks)[ i ]; 00071 double caloIso = - 1.0; 00072 if( tkCand.pt() > trackPtMin_) { 00073 for(int j = 0; j < nHighPtTracks; ++j ) { 00074 const Candidate & highPtTkCand = (*highPtTracks)[ j ]; 00075 if(overlap(tkCand, highPtTkCand) ) { 00076 CandidateBaseRef tkRef = highPtTracks->refAt(j); 00077 const IsoDeposit &isoDep = (*isoDeps)[tkRef]; 00078 caloIso = isoDep.depositWithin(coneSize_); 00079 break; 00080 } 00081 } 00082 } 00083 iso[i] = caloIso; 00084 } 00085 filler.insert(tracks, iso.begin(), iso.end()); 00086 } 00087 00088 // really fill the association map 00089 filler.fill(); 00090 event.put(caloIsolations); 00091 }
double IsolationProducerForTracks::coneSize_ [private] |
double IsolationProducerForTracks::trackPtMin_ [private] |