CMS 3D CMS Logo

ExtractorFromDeposits.cc
Go to the documentation of this file.
2 
6 
7 using namespace edm;
8 using namespace std;
9 using namespace reco;
10 using namespace muonisolation;
12 
13 ExtractorFromDeposits::ExtractorFromDeposits( const ParameterSet& par, edm::ConsumesCollector && iC ) :
14  theCollectionToken(iC.consumes<reco::IsoDepositMap>(par.getParameter<edm::InputTag>("IsolationCollectionTag")))
15 { }
16 
18  const edm::EventSetup & evSetup, const reco::TrackCollection & muons)
19 { }
20 
22  const EventSetup & eventSetup, const Track & muon) const
23 {
24  static const std::string metname = "RecoMuon|ExtractorFromDeposits";
26  event.getByToken(theCollectionToken, depMap);
27 
28  LogWarning(metname)<<"Call this method only if the original muon track collection is lost";
29 
30  // double vtx_z = muon.vz();
31  reco::isodeposit::Direction muonDir(muon.eta(), muon.phi());
32 
33  typedef reco::IsoDepositMap::const_iterator iterator_i;
34  typedef reco::IsoDepositMap::container::const_iterator iterator_ii;
35  iterator_i depI = depMap->begin();
36  iterator_i depIEnd = depMap->end();
37  for (; depI != depIEnd; ++depI){
38  iterator_ii depII = depI.begin();
39  iterator_ii depIIEnd = depI.end();
40  for (; depII != depIIEnd; ++depII){
41  reco::isodeposit::Direction depDir(depII->direction());
42  if (muonDir.deltaR(depDir) < 1.e-6) return *depII;
43  }
44  }
45 
46  return IsoDeposit();
47 }
48 
50  const EventSetup & eventSetup, const TrackRef & muon) const
51 {
53  event.getByToken(theCollectionToken, depMap);
54 
55  return (*depMap)[muon];
56 }
const_iterator end() const
Definition: ValueMap.h:208
virtual void fillVetos(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks)
const std::string metname
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
bool ev
edm::EDGetTokenT< reco::IsoDepositMap > theCollectionToken
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
reco::IsoDeposit IsoDeposit
Definition: Isolation.h:7
const_iterator begin() const
Definition: ValueMap.h:207
fixed size matrix
HLT enums.
Definition: event.py:1