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 Attributes
ElectronSqPtTkIsolationProducer Class Reference

#include <ElectronSqPtTkIsolationProducer.h>

Inheritance diagram for ElectronSqPtTkIsolationProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 ElectronSqPtTkIsolationProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~ElectronSqPtTkIsolationProducer ()
 
- 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 Attributes

bool absolut_
 
edm::ParameterSet conf_
 
edm::InputTag electronProducer_
 
double extRadius_
 
double intRadius_
 
double maxVtxDist_
 
double ptMin_
 
edm::InputTag trackProducer_
 

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 14 of file ElectronSqPtTkIsolationProducer.h.

Constructor & Destructor Documentation

ElectronSqPtTkIsolationProducer::ElectronSqPtTkIsolationProducer ( const edm::ParameterSet config)
explicit

Definition at line 15 of file ElectronSqPtTkIsolationProducer.cc.

References absolut_, conf_, electronProducer_, extRadius_, edm::ParameterSet::getParameter(), intRadius_, maxVtxDist_, ptMin_, and trackProducer_.

15  : conf_(config)
16 {
17  // use configuration file to setup input/output collection names
18  electronProducer_ = conf_.getParameter<edm::InputTag>("electronProducer");
19 
20  trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer");
21 
22  ptMin_ = conf_.getParameter<double>("ptMin");
23  intRadius_ = conf_.getParameter<double>("intRadius");
24  extRadius_ = conf_.getParameter<double>("extRadius");
25  maxVtxDist_ = conf_.getParameter<double>("maxVtxDist");
26 
27  absolut_ = conf_.getParameter<bool>("absolut");
28 
29  //register your products
30  produces < reco::CandViewDoubleAssociations>();
31 
32 }
T getParameter(std::string const &) const
ElectronSqPtTkIsolationProducer::~ElectronSqPtTkIsolationProducer ( )

Definition at line 34 of file ElectronSqPtTkIsolationProducer.cc.

34 {}

Member Function Documentation

void ElectronSqPtTkIsolationProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 38 of file ElectronSqPtTkIsolationProducer.cc.

References absolut_, electronProducer_, create_public_lumi_plots::exp, extRadius_, edm::Ref< C, T, F >::get(), edm::Event::getByLabel(), ElectronSqPtTkIsolation::getPtTracks(), i, intRadius_, maxVtxDist_, edm::Handle< T >::product(), ptMin_, edm::Event::put(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), funct::sin(), trackProducer_, and testEve_cfg::tracks.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

39 {
40  // Get the filtered objects
42  iEvent.getByLabel(electronProducer_,electronHandle);
43 
44  //get the tracks
46  iEvent.getByLabel(trackProducer_,tracks);
47  const reco::TrackCollection* trackCollection = tracks.product();
48 
50 
51  ElectronSqPtTkIsolation myTkIsolation (extRadius_,intRadius_,ptMin_,maxVtxDist_,trackCollection) ;
52 
53  for(unsigned int i = 0 ; i < electronHandle->size(); ++i ){
54  double isoValue = myTkIsolation.getPtTracks(&(electronHandle->at(i)));
55  if(absolut_==true){
56  isoMap->setValue(i,isoValue);
57  }
58  else{
59  reco::SuperClusterRef sc = (electronHandle->at(i)).superCluster();
60  double et = sc.get()->energy()*sin(2*atan(exp(-sc.get()->eta())));
61  isoMap->setValue(i,isoValue/et);
62  }
63  }
64 
65  std::auto_ptr<reco::CandViewDoubleAssociations> isolMap(isoMap);
66  iEvent.put(isolMap);
67 }
int i
Definition: DBlmapReader.cc:9
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple tracks
Definition: testEve_cfg.py:39
T const * product() const
Definition: Handle.h:74
edm::AssociationVector< CandidateBaseRefProd, std::vector< double > > CandViewDoubleAssociations
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
void setValue(size_type i, typename CVal::value_type const &val)

Member Data Documentation

bool ElectronSqPtTkIsolationProducer::absolut_
private

Definition at line 30 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

edm::ParameterSet ElectronSqPtTkIsolationProducer::conf_
private

Definition at line 32 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer().

edm::InputTag ElectronSqPtTkIsolationProducer::electronProducer_
private

Definition at line 22 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

double ElectronSqPtTkIsolationProducer::extRadius_
private

Definition at line 27 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

double ElectronSqPtTkIsolationProducer::intRadius_
private

Definition at line 26 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

double ElectronSqPtTkIsolationProducer::maxVtxDist_
private

Definition at line 28 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

double ElectronSqPtTkIsolationProducer::ptMin_
private

Definition at line 25 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

edm::InputTag ElectronSqPtTkIsolationProducer::trackProducer_
private

Definition at line 23 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().