CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
IsolationProducerForTracks Class Reference
Inheritance diagram for IsolationProducerForTracks:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 IsolationProducerForTracks (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 7 of file IsolationProducerForTracks.cc.

Constructor & Destructor Documentation

IsolationProducerForTracks::IsolationProducerForTracks ( const edm::ParameterSet pset)

Definition at line 39 of file IsolationProducerForTracks.cc.

39  :
40  tracks_( pset.getParameter<InputTag>( "tracks" ) ),
41  highPtTracks_( pset.getParameter<InputTag>( "highPtTracks" ) ),
42  isoDeps_( pset.getParameter<InputTag>( "isoDeps" ) ),
43  trackPtMin_( pset.getParameter<double>( "trackPtMin" ) ),
44  coneSize_( pset.getParameter<double>( "coneSize" ) )
45  {
46  produces<TkIsoMap>();
47  }
T getParameter(std::string const &) const

Member Function Documentation

void IsolationProducerForTracks::produce ( edm::Event event,
const edm::EventSetup setup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 49 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, muon::overlap(), reco::Candidate::pt(), trackPtMin_, testEve_cfg::tracks, and tracks_.

49  {
50  std::auto_ptr<TkIsoMap> caloIsolations(new TkIsoMap);
51  TkIsoMap::Filler filler(*caloIsolations);
52  {
54  event.getByLabel(tracks_, tracks);
55 
57  event.getByLabel(highPtTracks_, highPtTracks);
58 
59  Handle<IsoDepositMap> isoDeps;
60  event.getByLabel(isoDeps_, isoDeps);
61 
62  int nTracks = tracks->size();
63  int nHighPtTracks = highPtTracks->size();
64  std::vector<double> iso(nTracks);
65 
67 
68  for(int i = 0; i < nTracks; ++i ) {
69  const Candidate & tkCand = (*tracks)[ i ];
70  double caloIso = - 1.0;
71  if( tkCand.pt() > trackPtMin_) {
72  for(int j = 0; j < nHighPtTracks; ++j ) {
73  const Candidate & highPtTkCand = (*highPtTracks)[ j ];
74  if(overlap(tkCand, highPtTkCand) ) {
75  CandidateBaseRef tkRef = highPtTracks->refAt(j);
76  const IsoDeposit &isoDep = (*isoDeps)[tkRef];
77  caloIso = isoDep.depositWithin(coneSize_);
78  break;
79  }
80  }
81  }
82  iso[i] = caloIso;
83  }
84  filler.insert(tracks, iso.begin(), iso.end());
85  }
86 
87  // really fill the association map
88  filler.fill();
89  event.put(caloIsolations);
90 }
int i
Definition: DBlmapReader.cc:9
virtual double pt() const =0
transverse momentum
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
double depositWithin(double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const
Get deposit.
Definition: IsoDeposit.cc:34
int j
Definition: DBlmapReader.cc:9
tuple tracks
Definition: testEve_cfg.py:39

Member Data Documentation

double IsolationProducerForTracks::coneSize_
private

Definition at line 17 of file IsolationProducerForTracks.cc.

Referenced by produce().

edm::InputTag IsolationProducerForTracks::highPtTracks_
private

Definition at line 14 of file IsolationProducerForTracks.cc.

Referenced by produce().

edm::InputTag IsolationProducerForTracks::isoDeps_
private

Definition at line 15 of file IsolationProducerForTracks.cc.

Referenced by produce().

double IsolationProducerForTracks::trackPtMin_
private

Definition at line 16 of file IsolationProducerForTracks.cc.

Referenced by produce().

edm::InputTag IsolationProducerForTracks::tracks_
private

Definition at line 13 of file IsolationProducerForTracks.cc.

Referenced by produce().