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

#include <ElectronSeedProducer.h>

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

Public Member Functions

virtual void beginRun (edm::Run &, edm::EventSetup const &)
 
 ElectronSeedProducer (const edm::ParameterSet &)
 
virtual void endRun (edm::Run &, edm::EventSetup const &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~ElectronSeedProducer ()
 
- 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 filterClusters (const reco::BeamSpot &bs, const edm::Handle< reco::SuperClusterCollection > &superClusters, reco::SuperClusterRefVector &sclRefs, std::vector< float > &hoe1s, std::vector< float > &hoe2s)
 
void filterSeeds (edm::Event &e, const edm::EventSetup &setup, reco::SuperClusterRefVector &sclRefs)
 

Private Attributes

bool applyHOverECut_
 
edm::InputTag beamSpotTag_
 
edm::ESHandle< CaloGeometrycaloGeom_
 
unsigned long long caloGeomCacheId_
 
edm::ESHandle< CaloTopologycaloTopo_
 
unsigned long long caloTopoCacheId_
 
edm::ParameterSet conf_
 
bool fromTrackerSeeds_
 
ElectronHcalHelperhcalHelper_
 
edm::InputTag initialSeeds_
 
ElectronSeedGeneratormatcher_
 
double maxHBarrel_
 
double maxHEndcaps_
 
double maxHOverEBarrel_
 
double maxHOverEEndcaps_
 
bool prefilteredSeeds_
 
double SCEtCut_
 
SeedFilterseedFilter_
 
edm::InputTag superClusters_ [2]
 
TrajectorySeedCollectiontheInitialSeedColl
 

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

Description: MeasurementEstimator for Pixel Barrel, ported from ORCA Class defining the search area in the barrel in the pixel match Implementation: <Notes on="" implementation>="">

Description: MeasurementEstimator for Pixel Barrel, ported from ORCA

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

Description: EDProducer of ElectronSeed objects

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

Definition at line 40 of file ElectronSeedProducer.h.

Constructor & Destructor Documentation

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

Definition at line 51 of file ElectronSeedProducer.cc.

References applyHOverECut_, beamSpotTag_, conf_, edm::ParameterSet::exists(), fromTrackerSeeds_, edm::ParameterSet::getParameter(), hcalHelper_, ElectronHcalHelper::Configuration::hcalTowers, ElectronHcalHelper::Configuration::hOverEConeSize, ElectronHcalHelper::Configuration::hOverEPtMin, initialSeeds_, matcher_, maxHBarrel_, maxHEndcaps_, maxHOverEBarrel_, maxHOverEEndcaps_, prefilteredSeeds_, SCEtCut_, superClusters_, funct::true, and ElectronHcalHelper::Configuration::useTowers.

52  : beamSpotTag_("offlineBeamSpot"),
53  //conf_(iConfig),
56  {
57  conf_ = iConfig.getParameter<edm::ParameterSet>("SeedConfiguration") ;
58 
59  initialSeeds_ = conf_.getParameter<edm::InputTag>("initialSeeds") ;
60  SCEtCut_ = conf_.getParameter<double>("SCEtCut") ;
61  fromTrackerSeeds_ = conf_.getParameter<bool>("fromTrackerSeeds") ;
62  prefilteredSeeds_ = conf_.getParameter<bool>("preFilteredSeeds") ;
63 
64  // new beamSpot tag
65  if (conf_.exists("beamSpot"))
66  { beamSpotTag_ = conf_.getParameter<edm::InputTag>("beamSpot") ; }
67 
68  // for H/E
69 // if (conf_.exists("applyHOverECut"))
70 // { applyHOverECut_ = conf_.getParameter<bool>("applyHOverECut") ; }
71  applyHOverECut_ = conf_.getParameter<bool>("applyHOverECut") ;
72  if (applyHOverECut_)
73  {
75  hcalCfg.hOverEConeSize = conf_.getParameter<double>("hOverEConeSize") ;
76  if (hcalCfg.hOverEConeSize>0)
77  {
78  hcalCfg.useTowers = true ;
79  hcalCfg.hcalTowers = conf_.getParameter<edm::InputTag>("hcalTowers") ;
80  hcalCfg.hOverEPtMin = conf_.getParameter<double>("hOverEPtMin") ;
81  }
82  hcalHelper_ = new ElectronHcalHelper(hcalCfg) ;
83  maxHOverEBarrel_=conf_.getParameter<double>("maxHOverEBarrel") ;
84  maxHOverEEndcaps_=conf_.getParameter<double>("maxHOverEEndcaps") ;
85  maxHBarrel_=conf_.getParameter<double>("maxHBarrel") ;
86  maxHEndcaps_=conf_.getParameter<double>("maxHEndcaps") ;
87 // hOverEConeSize_=conf_.getParameter<double>("hOverEConeSize") ;
88 // hOverEHBMinE_=conf_.getParameter<double>("hOverEHBMinE") ;
89 // hOverEHFMinE_=conf_.getParameter<double>("hOverEHFMinE") ;
90  }
91 
93 
94  // get collections from config'
95  superClusters_[0]=iConfig.getParameter<edm::InputTag>("barrelSuperClusters") ;
96  superClusters_[1]=iConfig.getParameter<edm::InputTag>("endcapSuperClusters") ;
97 
98  //register your products
99  produces<ElectronSeedCollection>() ;
100 }
T getParameter(std::string const &) const
unsigned long long caloGeomCacheId_
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::ESHandle< CaloTopology > caloTopo_
edm::InputTag superClusters_[2]
edm::ParameterSet conf_
edm::ESHandle< CaloGeometry > caloGeom_
ElectronSeedGenerator * matcher_
unsigned long long caloTopoCacheId_
ElectronHcalHelper * hcalHelper_
ElectronSeedProducer::~ElectronSeedProducer ( )
virtual

Definition at line 117 of file ElectronSeedProducer.cc.

References hcalHelper_, and matcher_.

118  {
119  delete hcalHelper_ ;
120  delete matcher_ ;
121  }
ElectronSeedGenerator * matcher_
ElectronHcalHelper * hcalHelper_

Member Function Documentation

void ElectronSeedProducer::beginRun ( edm::Run ,
edm::EventSetup const &   
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 103 of file ElectronSeedProducer.cc.

References conf_, prefilteredSeeds_, and seedFilter_.

104  {
105  // FIXME: because of a bug presumably in tracker seeding,
106  // perhaps in CombinedHitPairGenerator, badly caching some EventSetup product,
107  // we must redo the SeedFilter for each run.
109  }
edm::ParameterSet conf_
void ElectronSeedProducer::endRun ( edm::Run ,
edm::EventSetup const &   
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 111 of file ElectronSeedProducer.cc.

References seedFilter_.

112  {
113  delete seedFilter_ ;
114  seedFilter_ = 0 ;
115  }
void ElectronSeedProducer::filterClusters ( const reco::BeamSpot bs,
const edm::Handle< reco::SuperClusterCollection > &  superClusters,
reco::SuperClusterRefVector sclRefs,
std::vector< float > &  hoe1s,
std::vector< float > &  hoe2s 
)
private

Definition at line 205 of file ElectronSeedProducer.cc.

References EcalBarrel, EcalEndcap, reco::CaloCluster::energy(), eta(), funct::false, i, infinity, LogDebug, reco::BeamSpot::position(), reco::CaloCluster::position(), edm::RefVector< C, T, F >::push_back(), reco::SuperCluster::seed(), and edm::RefVector< C, T, F >::size().

Referenced by produce().

209  {
210  for (unsigned int i=0;i<superClusters->size();++i)
211  {
212  const SuperCluster & scl = (*superClusters)[i] ;
213  double sclEta = EleRelPoint(scl.position(),bs.position()).eta() ;
214  if (scl.energy()/cosh(sclEta)>SCEtCut_)
215  {
216 // if ((applyHOverECut_==true)&&((hcalHelper_->hcalESum(scl)/scl.energy()) > maxHOverE_))
217 // { continue ; }
218 // sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
219  double had1, had2, had, scle ;
220  bool HoeVeto = false ;
221  if (applyHOverECut_==true)
222  {
223  had1 = hcalHelper_->hcalESumDepth1(scl);
224  had2 = hcalHelper_->hcalESumDepth2(scl);
225  had = had1+had2 ;
226  scle = scl.energy() ;
227  int detector = scl.seed()->hitsAndFractions()[0].first.subdetId() ;
228  if (detector==EcalBarrel && (had<maxHBarrel_ || had/scle<maxHOverEBarrel_)) HoeVeto=true;
229  else if (detector==EcalEndcap && (had<maxHEndcaps_ || had/scle<maxHOverEEndcaps_)) HoeVeto=true;
230  if (HoeVeto)
231  {
232  sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
233  hoe1s.push_back(had1/scle) ;
234  hoe2s.push_back(had2/scle) ;
235  }
236  }
237  else
238  {
239  sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
240  hoe1s.push_back(std::numeric_limits<float>::infinity()) ;
241  hoe2s.push_back(std::numeric_limits<float>::infinity()) ;
242  }
243  }
244  }
245  LogDebug("ElectronSeedProducer")<<"Filtered out "<<sclRefs.size()<<" superclusters from "<<superClusters->size() ;
246  }
#define LogDebug(id)
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:123
int i
Definition: DBlmapReader.cc:9
T eta() const
const double infinity
double hcalESumDepth2(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
double energy() const
cluster energy
Definition: CaloCluster.h:120
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
const Point & position() const
position
Definition: BeamSpot.h:63
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:62
ElectronHcalHelper * hcalHelper_
void ElectronSeedProducer::filterSeeds ( edm::Event e,
const edm::EventSetup setup,
reco::SuperClusterRefVector sclRefs 
)
private

Definition at line 249 of file ElectronSeedProducer.cc.

References i, LogDebug, and edm::RefVector< C, T, F >::size().

Referenced by produce().

251  {
252  for ( unsigned int i=0 ; i<sclRefs.size() ; ++i )
253  {
254  seedFilter_->seeds(event,setup,sclRefs[i],theInitialSeedColl) ;
255  LogDebug("ElectronSeedProducer")<<"Number of Seeds: "<<theInitialSeedColl->size() ;
256  }
257  }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
void seeds(edm::Event &, const edm::EventSetup &, const reco::SuperClusterRef &, TrajectorySeedCollection *)
Definition: SeedFilter.cc:79
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
TrajectorySeedCollection * theInitialSeedColl
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
void ElectronSeedProducer::produce ( edm::Event e,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 123 of file ElectronSeedProducer.cc.

References beamSpotTag_, edm::eventsetup::EventSetupRecord::cacheIdentifier(), caloGeom_, caloGeomCacheId_, caloTopo_, caloTopoCacheId_, edm::RefToBase< T >::castTo(), ElectronHcalHelper::checkSetup(), filterClusters(), filterSeeds(), fromTrackerSeeds_, edm::EventSetup::get(), edm::Event::getByLabel(), hcalHelper_, i, edm::Ref< C, T, F >::id(), initialSeeds_, LogDebug, matcher_, prefilteredSeeds_, edm::Handle< T >::product(), edm::Event::put(), ElectronHcalHelper::readEvent(), ElectronSeedGenerator::run(), ElectronSeedGenerator::setupES(), superClusters_, and theInitialSeedColl.

124  {
125  LogDebug("ElectronSeedProducer") <<"[ElectronSeedProducer::produce] entering " ;
126 
127  edm::Handle<reco::BeamSpot> theBeamSpot ;
128  e.getByLabel(beamSpotTag_,theBeamSpot) ;
129 
130  if (hcalHelper_)
131  {
132  hcalHelper_->checkSetup(iSetup) ;
133  hcalHelper_->readEvent(e) ;
134  }
135 
136  // get calo geometry
138  iSetup.get<CaloGeometryRecord>().get(caloGeom_);
139  caloGeomCacheId_=iSetup.get<CaloGeometryRecord>().cacheIdentifier();
140  }
142  caloTopoCacheId_=iSetup.get<CaloTopologyRecord>().cacheIdentifier();
143  iSetup.get<CaloTopologyRecord>().get(caloTopo_);
144  }
145 
146  matcher_->setupES(iSetup);
147 
148  // get initial TrajectorySeeds if necessary
149  if (fromTrackerSeeds_)
150  {
151  if (!prefilteredSeeds_)
152  {
154  e.getByLabel(initialSeeds_, hSeeds);
155  theInitialSeedColl = const_cast<TrajectorySeedCollection *> (hSeeds.product());
156  }
157  else
159  }
160  else
161  { theInitialSeedColl = 0 ; } // not needed in this case
162 
164 
165  // loop over barrel + endcap
166  for (unsigned int i=0; i<2; i++)
167  {
169  if (e.getByLabel(superClusters_[i],clusters))
170  {
171  SuperClusterRefVector clusterRefs ;
172  std::vector<float> hoe1s, hoe2s ;
173  filterClusters(*theBeamSpot,clusters,/*mhbhe_,*/clusterRefs,hoe1s,hoe2s) ;
175  { filterSeeds(e,iSetup,clusterRefs) ; }
176  matcher_->run(e,iSetup,clusterRefs,hoe1s,hoe2s,theInitialSeedColl,*seeds) ;
177  }
178  }
179 
180  // store the accumulated result
181  std::auto_ptr<ElectronSeedCollection> pSeeds(seeds) ;
182  ElectronSeedCollection::iterator is ;
183  for ( is=pSeeds->begin() ; is!=pSeeds->end() ; is++ )
184  {
185  edm::RefToBase<CaloCluster> caloCluster = is->caloCluster() ;
186  SuperClusterRef superCluster = caloCluster.castTo<SuperClusterRef>() ;
187  LogDebug("ElectronSeedProducer")<< "new seed with "
188  << (*is).nHits() << " hits"
189  << ", charge " << (*is).getCharge()
190  << " and cluster energy " << superCluster->energy()
191  << " PID "<<superCluster.id() ;
192  }
193  e.put(pSeeds) ;
195  }
#define LogDebug(id)
unsigned long long cacheIdentifier() const
int i
Definition: DBlmapReader.cc:9
void readEvent(const edm::Event &)
void setupES(const edm::EventSetup &setup)
unsigned long long caloGeomCacheId_
void checkSetup(const edm::EventSetup &)
void run(edm::Event &, const edm::EventSetup &setup, const reco::SuperClusterRefVector &, const std::vector< float > &hoe1s, const std::vector< float > &hoe2s, TrajectorySeedCollection *seeds, reco::ElectronSeedCollection &)
edm::ESHandle< CaloTopology > caloTopo_
void filterClusters(const reco::BeamSpot &bs, const edm::Handle< reco::SuperClusterCollection > &superClusters, reco::SuperClusterRefVector &sclRefs, std::vector< float > &hoe1s, std::vector< float > &hoe2s)
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::InputTag superClusters_[2]
edm::ESHandle< CaloGeometry > caloGeom_
ElectronSeedGenerator * matcher_
TrajectorySeedCollection * theInitialSeedColl
const T & get() const
Definition: EventSetup.h:55
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:241
T const * product() const
Definition: Handle.h:74
unsigned long long caloTopoCacheId_
void filterSeeds(edm::Event &e, const edm::EventSetup &setup, reco::SuperClusterRefVector &sclRefs)
ProductID id() const
Accessor for product ID.
Definition: Ref.h:256
ElectronHcalHelper * hcalHelper_

Member Data Documentation

bool ElectronSeedProducer::applyHOverECut_
private

Definition at line 76 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

edm::InputTag ElectronSeedProducer::beamSpotTag_
private

Definition at line 64 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

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

Definition at line 80 of file ElectronSeedProducer.h.

Referenced by produce().

unsigned long long ElectronSeedProducer::caloGeomCacheId_
private

Definition at line 81 of file ElectronSeedProducer.h.

Referenced by produce().

edm::ESHandle<CaloTopology> ElectronSeedProducer::caloTopo_
private

Definition at line 82 of file ElectronSeedProducer.h.

Referenced by produce().

unsigned long long ElectronSeedProducer::caloTopoCacheId_
private

Definition at line 83 of file ElectronSeedProducer.h.

Referenced by produce().

edm::ParameterSet ElectronSeedProducer::conf_
private

Definition at line 66 of file ElectronSeedProducer.h.

Referenced by beginRun(), and ElectronSeedProducer().

bool ElectronSeedProducer::fromTrackerSeeds_
private

Definition at line 100 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

ElectronHcalHelper* ElectronSeedProducer::hcalHelper_
private

Definition at line 77 of file ElectronSeedProducer.h.

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

edm::InputTag ElectronSeedProducer::initialSeeds_
private

Definition at line 63 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

ElectronSeedGenerator* ElectronSeedProducer::matcher_
private

Definition at line 67 of file ElectronSeedProducer.h.

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

double ElectronSeedProducer::maxHBarrel_
private

Definition at line 90 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

double ElectronSeedProducer::maxHEndcaps_
private

Definition at line 91 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

double ElectronSeedProducer::maxHOverEBarrel_
private

Definition at line 88 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

double ElectronSeedProducer::maxHOverEEndcaps_
private

Definition at line 89 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

bool ElectronSeedProducer::prefilteredSeeds_
private

Definition at line 101 of file ElectronSeedProducer.h.

Referenced by beginRun(), ElectronSeedProducer(), and produce().

double ElectronSeedProducer::SCEtCut_
private

Definition at line 97 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

SeedFilter* ElectronSeedProducer::seedFilter_
private

Definition at line 68 of file ElectronSeedProducer.h.

Referenced by beginRun(), and endRun().

edm::InputTag ElectronSeedProducer::superClusters_[2]
private

Definition at line 62 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

TrajectorySeedCollection* ElectronSeedProducer::theInitialSeedColl
private

Definition at line 70 of file ElectronSeedProducer.h.

Referenced by produce().