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::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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(), HLT_25ns14e33_v3_cff::trackCollection, 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);
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:13
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:405
T const * product() const
Definition: Handle.h:81
tuple tracks
Definition: testEve_cfg.py:39
edm::AssociationVector< CandidateBaseRefProd, std::vector< double > > CandViewDoubleAssociations
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().