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
FastElectronSeedProducer Class Reference

#include <FastElectronSeedProducer.h>

Inheritance diagram for FastElectronSeedProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run const &run, const edm::EventSetup &es) override
 
 FastElectronSeedProducer (const edm::ParameterSet &conf)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) override
 
virtual ~FastElectronSeedProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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 Member Functions

void filterClusters (const edm::Handle< reco::SuperClusterCollection > &superClusters, reco::SuperClusterRefVector &sclRefs)
 

Private Attributes

edm::ESHandle< CaloGeometrycaloGeom_
 
unsigned long long caloGeomCacheId_
 
edm::InputTag clusters_ [2]
 
bool fromTrackerSeeds_
 
EgammaHcalIsolationhcalIso_
 
edm::InputTag hcalRecHits_
 
const HBHERecHitCollectionhithbhe_
 
double hOverEConeSize_
 
double hOverEHBMinE_
 
double hOverEHFMinE_
 
TrajectorySeedCollectioninitialSeedColl_
 
edm::InputTag initialSeeds_
 
FastElectronSeedGeneratormatcher_
 
double maxHOverE_
 
double SCEtCut_
 
edm::InputTag simTracks_
 
edm::InputTag trackerHits_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 33 of file FastElectronSeedProducer.h.

Constructor & Destructor Documentation

FastElectronSeedProducer::FastElectronSeedProducer ( const edm::ParameterSet iConfig)
explicit

Description: EDProducer of ElectronGSPixelSeed objects

Implementation: <Notes on="" implementation>="">

Definition at line 46 of file FastElectronSeedProducer.cc.

References clusters_, fromTrackerSeeds_, edm::ParameterSet::getParameter(), hcalRecHits_, hOverEConeSize_, hOverEHBMinE_, hOverEHFMinE_, initialSeeds_, matcher_, maxHOverE_, SCEtCut_, simTracks_, and trackerHits_.

47  : matcher_(0), caloGeomCacheId_(0), hcalIso_(0) /*, doubleConeSel_(0) */
48  {
49  edm::ParameterSet pset = iConfig.getParameter<edm::ParameterSet>("SeedConfiguration");
50  SCEtCut_=pset.getParameter<double>("SCEtCut");
51  maxHOverE_=pset.getParameter<double>("maxHOverE");
52  hOverEConeSize_=pset.getParameter<double>("hOverEConeSize");
53  hOverEHBMinE_=pset.getParameter<double>("hOverEHBMinE");
54  hOverEHFMinE_=pset.getParameter<double>("hOverEHFMinE");
55  fromTrackerSeeds_=pset.getParameter<bool>("fromTrackerSeeds");
56  initialSeeds_=pset.getParameter<edm::InputTag>("initialSeeds");
57 
59  iConfig.getParameter<double>("pTMin"),
60  iConfig.getParameter<edm::InputTag>("beamSpot"));
61 
62  // get labels from config'
63  clusters_[0]=iConfig.getParameter<edm::InputTag>("barrelSuperClusters");
64  clusters_[1]=iConfig.getParameter<edm::InputTag>("endcapSuperClusters");
65  simTracks_=iConfig.getParameter<edm::InputTag>("simTracks");
66  trackerHits_=iConfig.getParameter<edm::InputTag>("trackerHits");
67  hcalRecHits_= pset.getParameter<edm::InputTag>("hcalRecHits");
68 
69  //register your products
70  produces<reco::ElectronSeedCollection>();
71 
72 }
T getParameter(std::string const &) const
FastElectronSeedGenerator * matcher_
EgammaHcalIsolation * hcalIso_
FastElectronSeedProducer::~FastElectronSeedProducer ( )
virtual

Definition at line 75 of file FastElectronSeedProducer.cc.

References hcalIso_, and matcher_.

76  {
77  // do anything here that needs to be done at desctruction time
78  // (e.g. close files, deallocate resources etc.)
79  delete matcher_ ;
80  //delete doubleConeSel_ ;
81  delete hcalIso_ ;
82  }
FastElectronSeedGenerator * matcher_
EgammaHcalIsolation * hcalIso_

Member Function Documentation

void FastElectronSeedProducer::beginRun ( edm::Run const &  run,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 85 of file FastElectronSeedProducer.cc.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), caloGeom_, caloGeomCacheId_, edm::EventSetup::get(), matcher_, and FastElectronSeedGenerator::setupES().

86  {
87  // get calo geometry
89  {
90  es.get<CaloGeometryRecord>().get(caloGeom_);
91  caloGeomCacheId_=es.get<CaloGeometryRecord>().cacheIdentifier();
92  }
93 
94 // // The H/E calculator
95 // calc_=HoECalculator(caloGeom_);
96 
97  matcher_->setupES(es) ;
98 
99  }
unsigned long long cacheIdentifier() const
void setupES(const edm::EventSetup &setup)
FastElectronSeedGenerator * matcher_
edm::ESHandle< CaloGeometry > caloGeom_
const T & get() const
Definition: EventSetup.h:55
void FastElectronSeedProducer::filterClusters ( const edm::Handle< reco::SuperClusterCollection > &  superClusters,
reco::SuperClusterRefVector sclRefs 
)
private

Definition at line 170 of file FastElectronSeedProducer.cc.

References reco::CaloCluster::energy(), reco::CaloCluster::eta(), i, LogDebug, edm::RefVector< C, T, F >::push_back(), and edm::RefVector< C, T, F >::size().

Referenced by produce().

172  {
173  // filter the superclusters
174  // - with EtCut
175  // - with HoE using calo cone
176  for (unsigned int i=0;i<superClusters->size();++i)
177  {
178  const reco::SuperCluster & scl=(*superClusters)[i] ;
179  if (scl.energy()/cosh(scl.eta())>SCEtCut_)
180  {
181 // //double HoE=calc_(&scl,mhbhe);
182 // double HoE = 0. ;
183 // double hcalE = 0. ;
184 // if (mhbhe_)
185 // {
186 // math::XYZPoint caloPos = scl.position() ;
187 // GlobalPoint pclu(caloPos.x(),caloPos.y(),caloPos.z()) ;
188 // std::auto_ptr<CaloRecHitMetaCollectionV> chosen
189 // = doubleConeSel_->select(pclu,*mhbhe_) ;
190 // CaloRecHitMetaCollectionV::const_iterator i ;
191 // for ( i = chosen->begin () ; i != chosen->end () ; ++i )
192 // {
193 // double hcalHit_E = i->energy() ;
194 // if ( i->detid().subdetId()==HcalBarrel && hcalHit_E > hOverEHBMinE_)
195 // { hcalE += hcalHit_E ; } //HB case
196 // //if ( i->detid().subdetId()==HcalBarrel)
197 // // { std::cout << "[ElectronSeedProducer] HcalBarrel: hcalHit_E, hOverEHBMinE_ " << hcalHit_E << " " << hOverEHBMinE_ << std::endl; }
198 // if ( i->detid().subdetId()==HcalEndcap && hcalHit_E > hOverEHFMinE_)
199 // { hcalE += hcalHit_E ; } //HF case
200 // //if ( i->detid().subdetId()==HcalEndcap)
201 // // { std::cout << "[ElectronSeedProducer] HcalEndcap: hcalHit_E, hOverEHFMinE_ " << hcalHit_E << " " << hOverEHFMinE_ << std::endl; }
202 // }
203 // }
204 // HoE = hcalE/scl.energy() ;
205  //double hcalE = hcalHelper_->hcalESum(scl), HoE = hcalE/scl.energy() ;
206  double newHcalE = hcalIso_->getHcalESum(&scl), newHoE = newHcalE/scl.energy() ;
207  //std::cout << "[ElectronSeedProducer] HoE, maxHOverE_ " << newHoE << " " << HoE << " " << maxHOverE_ << std::endl ;
208  if (newHoE<=maxHOverE_)
209  { sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ; }
210  }
211  }
212 
213  LogDebug("ElectronSeedProducer")<<"Filtered out "
214  <<sclRefs.size()<<" superclusters from "<<superClusters->size() ;
215  }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:163
EgammaHcalIsolation * hcalIso_
double energy() const
cluster energy
Definition: CaloCluster.h:121
double getHcalESum(const reco::Candidate *c) const
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:62
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
void FastElectronSeedProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 102 of file FastElectronSeedProducer.cc.

References caloGeom_, HLT_25ns14e33_v1_cff::clusters, clusters_, filterClusters(), fromTrackerSeeds_, edm::EventSetup::get(), edm::Event::getByLabel(), hcalIso_, hcalRecHits_, hOverEConeSize_, hOverEHBMinE_, hOverEHFMinE_, i, initialSeedColl_, initialSeeds_, LogDebug, matcher_, edm::Handle< T >::product(), edm::ESHandle< class >::product(), edm::Event::put(), FastElectronSeedGenerator::run(), simTracks_, and trackerHits_.

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

103 {
104  LogDebug("FastElectronSeedProducer")<<"[FastElectronSeedProducer::produce] entering " ;
105 
106  // get initial TrajectorySeeds if necessary
107  if (fromTrackerSeeds_) {
108 
110  e.getByLabel(initialSeeds_, hSeeds);
111  initialSeedColl_ = const_cast<TrajectorySeedCollection *> (hSeeds.product());
112 
113  } else {
114 
115  initialSeedColl_=0;// not needed in this case
116 
117  }
118 
120 
121  // Get the Monte Carlo truth (SimTracks)
123  e.getByLabel(simTracks_,theSTC);
124  const edm::SimTrackContainer* theSimTracks = &(*theSTC);
125 
126  // Get the collection of Tracker RecHits
128  e.getByLabel(trackerHits_, theRHC);
129  const SiTrackerGSMatchedRecHit2DCollection* theGSRecHits = &(*theRHC);
130 
131  //Retrieve tracker topology from geometry
133  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
134  const TrackerTopology *tTopo=tTopoHand.product();
135 
136 
137  // get Hcal Rechit collection
139  e.getByLabel(hcalRecHits_,hbhe);
140 
141  // define cone for H/E
142 // delete doubleConeSel_;
143 // doubleConeSel_ = new CaloDualConeSelector(0.,hOverEConeSize_,caloGeom_.product(),DetId::Hcal) ;
144 
145  // HCAL iso deposits
146  delete hcalIso_ ;
148 
149  // Get the two supercluster collections
150  for (unsigned int i=0; i<2; i++) {
151 
152  // invoke algorithm
154  e.getByLabel(clusters_[i],clusters);
155  reco::SuperClusterRefVector clusterRefs;
156  filterClusters(clusters,/*mhbhe_,*/clusterRefs) ;
157  matcher_->run(e,clusterRefs,theGSRecHits,theSimTracks,initialSeedColl_,tTopo,*seeds);
158 
159  }
160 
161  // Save event content
162  std::auto_ptr<reco::ElectronSeedCollection> pSeeds(seeds) ;
163  e.put(pSeeds);
164 
165 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
FastElectronSeedGenerator * matcher_
edm::ESHandle< CaloGeometry > caloGeom_
EgammaHcalIsolation * hcalIso_
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:413
T const * product() const
Definition: Handle.h:81
void run(edm::Event &e, const reco::SuperClusterRefVector &sclRefs, const SiTrackerGSMatchedRecHit2DCollection *theGSRecHits, const edm::SimTrackContainer *theSimTracks, TrajectorySeedCollection *seeds, const TrackerTopology *tTopo, reco::ElectronSeedCollection &out)
TrajectorySeedCollection * initialSeedColl_
T const * product() const
Definition: ESHandle.h:86
void filterClusters(const edm::Handle< reco::SuperClusterCollection > &superClusters, reco::SuperClusterRefVector &sclRefs)
std::vector< SimTrack > SimTrackContainer

Member Data Documentation

edm::ESHandle<CaloGeometry> FastElectronSeedProducer::caloGeom_
private

Definition at line 72 of file FastElectronSeedProducer.h.

Referenced by beginRun(), and produce().

unsigned long long FastElectronSeedProducer::caloGeomCacheId_
private

Definition at line 73 of file FastElectronSeedProducer.h.

Referenced by beginRun().

edm::InputTag FastElectronSeedProducer::clusters_[2]
private

Definition at line 57 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer(), and produce().

bool FastElectronSeedProducer::fromTrackerSeeds_
private

Definition at line 84 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer(), and produce().

EgammaHcalIsolation* FastElectronSeedProducer::hcalIso_
private

Definition at line 74 of file FastElectronSeedProducer.h.

Referenced by produce(), and ~FastElectronSeedProducer().

edm::InputTag FastElectronSeedProducer::hcalRecHits_
private

Definition at line 60 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer(), and produce().

const HBHERecHitCollection* FastElectronSeedProducer::hithbhe_
private

Definition at line 67 of file FastElectronSeedProducer.h.

double FastElectronSeedProducer::hOverEConeSize_
private

Definition at line 79 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer(), and produce().

double FastElectronSeedProducer::hOverEHBMinE_
private

Definition at line 80 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer(), and produce().

double FastElectronSeedProducer::hOverEHFMinE_
private

Definition at line 81 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer(), and produce().

TrajectorySeedCollection* FastElectronSeedProducer::initialSeedColl_
private

Definition at line 68 of file FastElectronSeedProducer.h.

Referenced by produce().

edm::InputTag FastElectronSeedProducer::initialSeeds_
private

Definition at line 61 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer(), and produce().

FastElectronSeedGenerator* FastElectronSeedProducer::matcher_
private
double FastElectronSeedProducer::maxHOverE_
private

Definition at line 78 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer().

double FastElectronSeedProducer::SCEtCut_
private

Definition at line 82 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer().

edm::InputTag FastElectronSeedProducer::simTracks_
private

Definition at line 58 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer(), and produce().

edm::InputTag FastElectronSeedProducer::trackerHits_
private

Definition at line 59 of file FastElectronSeedProducer.h.

Referenced by FastElectronSeedProducer(), and produce().