CMS 3D CMS Logo

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 &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~ElectronSqPtTkIsolationProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 ( )
override

Definition at line 34 of file ElectronSqPtTkIsolationProducer.cc.

34 {}

Member Function Documentation

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

Definition at line 38 of file ElectronSqPtTkIsolationProducer.cc.

References absolut_, electronProducer_, stringResolutionProvider_cfi::et, JetChargeProducer_cfi::exp, extRadius_, edm::Ref< C, T, F >::get(), edm::Event::getByLabel(), ElectronSqPtTkIsolation::getPtTracks(), mps_fire::i, intRadius_, maxVtxDist_, eostools::move(), edm::Handle< T >::product(), ptMin_, edm::Event::put(), SimDataFormats::CaloAnalysis::sc, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), funct::sin(), findElectronsInSiStrips_cfi::trackCollection, trackProducer_, and l1t::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::unique_ptr<reco::CandViewDoubleAssociations> isolMap(isoMap);
66  iEvent.put(std::move(isolMap));
67 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:15
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
T const * product() const
Definition: Handle.h:74
et
define resolution functions of each parameter
edm::AssociationVector< CandidateBaseRefProd, std::vector< double > > CandViewDoubleAssociations
void setValue(size_type i, typename CVal::value_type const &val)
def move(src, dest)
Definition: eostools.py:511

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().