CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ElectronSeedProducer Class Reference

#include <ElectronSeedProducer.h>

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

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) final
 
 ElectronSeedProducer (const edm::ParameterSet &)
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void produce (edm::Event &, const edm::EventSetup &) final
 
 ~ElectronSeedProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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, edm::Event &e, const edm::EventSetup &setup)
 
void filterSeeds (edm::Event &e, const edm::EventSetup &setup, reco::SuperClusterRefVector &sclRefs)
 

Private Attributes

bool allowHGCal_
 
bool applyHOverECut_
 
bool applySigmaIEtaIEtaCut_
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotTag_
 
edm::ESHandle< CaloGeometrycaloGeom_
 
unsigned long long caloGeomCacheId_
 
edm::ESHandle< CaloTopologycaloTopo_
 
unsigned long long caloTopoCacheId_
 
edm::ParameterSet conf_
 
edm::EDGetTokenT< EcalRecHitCollectionebRecHitCollection_
 
edm::EDGetTokenT< EcalRecHitCollectioneeRecHitCollection_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > filterVtxTag_
 
bool fromTrackerSeeds_
 
ElectronHcalHelperhcalHelper_
 
std::unique_ptr< hgcal::ClusterToolshgcClusterTools_
 
edm::EDGetTokenT< TrajectorySeedCollectioninitialSeeds_
 
ElectronSeedGeneratormatcher_
 
double maxHBarrel_
 
double maxHEndcaps_
 
double maxHOverEBarrel_
 
double maxHOverEEndcaps_
 
double maxSigmaIEtaIEtaBarrel_
 
double maxSigmaIEtaIEtaEndcaps_
 
bool prefilteredSeeds_
 
double SCEtCut_
 
std::unique_ptr< SeedFilterseedFilter_
 
edm::EDGetTokenT< reco::SuperClusterCollectionsuperClusters_ [2]
 
TrajectorySeedCollectiontheInitialSeedColl
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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
 
- 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

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 42 of file ElectronSeedProducer.h.

Constructor & Destructor Documentation

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

Definition at line 59 of file ElectronSeedProducer.cc.

References allowHGCal_, applyHOverECut_, applySigmaIEtaIEtaCut_, beamSpotTag_, conf_, edm::EDConsumerBase::consumesCollector(), ebRecHitCollection_, eeRecHitCollection_, filterVtxTag_, fromTrackerSeeds_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), hcalHelper_, ElectronHcalHelper::Configuration::hcalTowers, hgcClusterTools_, ElectronHcalHelper::Configuration::hOverEConeSize, ElectronHcalHelper::Configuration::hOverEPtMin, initialSeeds_, matcher_, maxHBarrel_, maxHEndcaps_, maxHOverEBarrel_, maxHOverEEndcaps_, maxSigmaIEtaIEtaBarrel_, maxSigmaIEtaIEtaEndcaps_, prefilteredSeeds_, SCEtCut_, seedFilter_, superClusters_, SeedFilter::Tokens::token_bs, ElectronSeedGenerator::Tokens::token_bs, ElectronSeedGenerator::Tokens::token_measTrkEvt, SeedFilter::Tokens::token_vtx, ElectronSeedGenerator::Tokens::token_vtx, funct::true, and ElectronHcalHelper::Configuration::useTowers.

60  : //conf_(iConfig),
61  applyHOverECut_(true), hcalHelper_(nullptr),
62  caloGeom_(nullptr), caloGeomCacheId_(0), caloTopo_(nullptr), caloTopoCacheId_(0)
63  {
64  conf_ = iConfig.getParameter<edm::ParameterSet>("SeedConfiguration") ;
65 
66  initialSeeds_ = consumes<TrajectorySeedCollection>(conf_.getParameter<edm::InputTag>("initialSeeds")) ;
67  SCEtCut_ = conf_.getParameter<double>("SCEtCut");
68  fromTrackerSeeds_ = conf_.getParameter<bool>("fromTrackerSeeds") ;
69  prefilteredSeeds_ = conf_.getParameter<bool>("preFilteredSeeds") ;
70 
71  auto theconsumes = consumesCollector();
72 
73  // new beamSpot tag
74  beamSpotTag_ = consumes<reco::BeamSpot>(conf_.getParameter<edm::InputTag>("beamSpot"));
75 
76  // for H/E
77  applyHOverECut_ = conf_.getParameter<bool>("applyHOverECut") ;
78  if (applyHOverECut_)
79  {
81  hcalCfg.hOverEConeSize = conf_.getParameter<double>("hOverEConeSize") ;
82  if (hcalCfg.hOverEConeSize>0)
83  {
84  hcalCfg.useTowers = true ;
85  hcalCfg.hcalTowers =
86  consumes<CaloTowerCollection>(conf_.getParameter<edm::InputTag>("hcalTowers")) ;
87  hcalCfg.hOverEPtMin = conf_.getParameter<double>("hOverEPtMin") ;
88  }
89  hcalHelper_ = new ElectronHcalHelper(hcalCfg) ;
90 
91  allowHGCal_ = conf_.getParameter<bool>("allowHGCal");
92  if( allowHGCal_ ) {
93  const edm::ParameterSet& hgcCfg = conf_.getParameterSet("HGCalConfig");
94  hgcClusterTools_.reset( new hgcal::ClusterTools(hgcCfg, theconsumes) );
95  }
96 
97  maxHOverEBarrel_=conf_.getParameter<double>("maxHOverEBarrel") ;
98  maxHOverEEndcaps_=conf_.getParameter<double>("maxHOverEEndcaps") ;
99  maxHBarrel_=conf_.getParameter<double>("maxHBarrel") ;
100  maxHEndcaps_=conf_.getParameter<double>("maxHEndcaps") ;
101  }
102 
103  applySigmaIEtaIEtaCut_ = conf_.getParameter<bool>("applySigmaIEtaIEtaCut");
104 
105  // apply sigma_ieta_ieta cut
106  if (applySigmaIEtaIEtaCut_ == true)
107  {
108  maxSigmaIEtaIEtaBarrel_ = conf_.getParameter<double>("maxSigmaIEtaIEtaBarrel");
109  maxSigmaIEtaIEtaEndcaps_ = conf_.getParameter<double>("maxSigmaIEtaIEtaEndcaps");
110  }
111 
112  edm::ParameterSet rpset = conf_.getParameter<edm::ParameterSet>("RegionPSet");
113  filterVtxTag_ = consumes<std::vector<reco::Vertex> >(rpset.getParameter<edm::InputTag> ("VertexProducer"));
114 
116  esg_tokens.token_bs = beamSpotTag_;
117  esg_tokens.token_vtx = mayConsume<reco::VertexCollection>(conf_.getParameter<edm::InputTag>("vertices"));
118  esg_tokens.token_measTrkEvt= consumes<MeasurementTrackerEvent>(conf_.getParameter<edm::InputTag>("measurementTrackerEvent"));
119 
120  matcher_ = new ElectronSeedGenerator(conf_,esg_tokens) ;
121 
122  // get collections from config
123  if (applySigmaIEtaIEtaCut_ == true) {
124  ebRecHitCollection_ = consumes<EcalRecHitCollection> (iConfig.getParameter<edm::InputTag>("ebRecHitCollection"));
125  eeRecHitCollection_ = consumes<EcalRecHitCollection> (iConfig.getParameter<edm::InputTag>("eeRecHitCollection"));
126  }
127 
128  superClusters_[0]=
129  consumes<reco::SuperClusterCollection>(iConfig.getParameter<edm::InputTag>("barrelSuperClusters")) ;
130  superClusters_[1]=
131  consumes<reco::SuperClusterCollection>(iConfig.getParameter<edm::InputTag>("endcapSuperClusters")) ;
132 
133  // Construction of SeedFilter was in beginRun() with the comment
134  // below, but it has to be done here because of ConsumesCollector
135  //
136  // FIXME: because of a bug presumably in tracker seeding,
137  // perhaps in CombinedHitPairGenerator, badly caching some EventSetup product,
138  // we must redo the SeedFilter for each run.
139  if (prefilteredSeeds_) {
140  SeedFilter::Tokens sf_tokens;
141  sf_tokens.token_bs = beamSpotTag_;
142  sf_tokens.token_vtx = filterVtxTag_;
144  seedFilter_.reset(new SeedFilter(conf_, sf_tokens, iC));
145  }
146 
147  //register your products
148  produces<ElectronSeedCollection>() ;
149 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::BeamSpot > token_bs
unsigned long long caloGeomCacheId_
edm::EDGetTokenT< std::vector< reco::Vertex > > filterVtxTag_
edm::EDGetTokenT< TrajectorySeedCollection > initialSeeds_
edm::EDGetTokenT< EcalRecHitCollection > eeRecHitCollection_
edm::ESHandle< CaloTopology > caloTopo_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< EcalRecHitCollection > ebRecHitCollection_
std::unique_ptr< SeedFilter > seedFilter_
edm::ParameterSet conf_
edm::ESHandle< CaloGeometry > caloGeom_
ElectronSeedGenerator * matcher_
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< reco::SuperClusterCollection > superClusters_[2]
unsigned long long caloTopoCacheId_
edm::EDGetTokenT< reco::BeamSpot > token_bs
Definition: SeedFilter.h:37
edm::EDGetTokenT< CaloTowerCollection > hcalTowers
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
edm::EDGetTokenT< std::vector< reco::Vertex > > token_vtx
ElectronHcalHelper * hcalHelper_
edm::EDGetTokenT< std::vector< reco::Vertex > > token_vtx
Definition: SeedFilter.h:36
std::unique_ptr< hgcal::ClusterTools > hgcClusterTools_
ElectronSeedProducer::~ElectronSeedProducer ( )
override

Definition at line 157 of file ElectronSeedProducer.cc.

References hcalHelper_, and matcher_.

158  {
159  delete hcalHelper_ ;
160  delete matcher_ ;
161  }
ElectronSeedGenerator * matcher_
ElectronHcalHelper * hcalHelper_

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 151 of file ElectronSeedProducer.cc.

152 {}
void ElectronSeedProducer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
finalvirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 154 of file ElectronSeedProducer.cc.

155 {}
void ElectronSeedProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 323 of file ElectronSeedProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

323  {
325  desc.add<edm::InputTag>("endcapSuperClusters",edm::InputTag("particleFlowSuperClusterECAL","particleFlowSuperClusterECALEndcapWithPreshower"));
326  {
327  edm::ParameterSetDescription psd0, psd1, psd2, psd3, psd4;
328  psd1.add<unsigned int>("maxElement", 0);
329  psd1.add<std::string>("ComponentName", std::string("StandardHitPairGenerator"));
330  psd1.addUntracked<int>("useOnDemandTracker", 0);
331  psd1.add<edm::InputTag>("SeedingLayers", edm::InputTag("hltMixedLayerPairs"));
332  psd0.add<edm::ParameterSetDescription>("OrderedHitsFactoryPSet", psd1);
333 
334  psd2.add<double>("deltaPhiRegion", 0.4);
335  psd2.add<double>("originHalfLength", 15.0);
336  psd2.add<bool>("useZInVertex", true);
337  psd2.add<double>("deltaEtaRegion", 0.1);
338  psd2.add<double>("ptMin", 1.5 );
339  psd2.add<double>("originRadius", 0.2);
340  psd2.add<edm::InputTag>("VertexProducer", edm::InputTag("dummyVertices"));
341  psd0.add<edm::ParameterSetDescription>("RegionPSet", psd2);
342 
343  psd0.add<double>("PhiMax2B",0.002);
344  psd0.add<double>("hOverEPtMin",0.0);
345  psd0.add<double>("PhiMax2F",0.003);
346  psd0.add<bool>("searchInTIDTEC",true);
347  psd0.add<double>("pPhiMax1",0.125);
348  psd0.add<double>("HighPtThreshold",35.0);
349  psd0.add<double>("r2MinF",-0.15);
350  psd0.add<double>("maxHBarrel",0.0);
351  psd0.add<double>("DeltaPhi1Low",0.23);
352  psd0.add<double>("DeltaPhi1High",0.08);
353  psd0.add<double>("ePhiMin1",-0.125);
354  psd0.add<edm::InputTag>("hcalTowers",edm::InputTag("towerMaker"));
355  psd0.add<double>("LowPtThreshold",5.0);
356  psd0.add<double>("maxHOverEBarrel",0.15);
357  psd0.add<double>("maxSigmaIEtaIEtaBarrel", 0.5);
358  psd0.add<double>("maxSigmaIEtaIEtaEndcaps", 0.5);
359  psd0.add<bool>("dynamicPhiRoad",true);
360  psd0.add<double>("ePhiMax1",0.075);
361  psd0.add<std::string>("measurementTrackerName","");
362  psd0.add<double>("SizeWindowENeg",0.675);
363  psd0.add<double>("nSigmasDeltaZ1",5.0);
364  psd0.add<double>("rMaxI",0.2);
365  psd0.add<double>("maxHEndcaps",0.0);
366  psd0.add<bool>("preFilteredSeeds",false);
367  psd0.add<double>("r2MaxF",0.15);
368  psd0.add<double>("hOverEConeSize",0.15);
369  psd0.add<double>("pPhiMin1",-0.075);
370  psd0.add<edm::InputTag>("initialSeeds",edm::InputTag("newCombinedSeeds"));
371  psd0.add<double>("deltaZ1WithVertex",25.0);
372  psd0.add<double>("SCEtCut",0.0);
373  psd0.add<double>("z2MaxB",0.09);
374  psd0.add<bool>("fromTrackerSeeds",true);
375  psd0.add<edm::InputTag>("hcalRecHits",edm::InputTag("hbhereco"));
376  psd0.add<double>("z2MinB",-0.09);
377  psd0.add<double>("rMinI",-0.2);
378  psd0.add<double>("maxHOverEEndcaps",0.15);
379  psd0.add<double>("hOverEHBMinE",0.7);
380  psd0.add<bool>("useRecoVertex",false);
381  psd0.add<edm::InputTag>("beamSpot",edm::InputTag("offlineBeamSpot"));
382  psd0.add<edm::InputTag>("measurementTrackerEvent",edm::InputTag("MeasurementTrackerEvent"));
383  psd0.add<edm::InputTag>("vertices",edm::InputTag("offlinePrimaryVerticesWithBS"));
384  psd0.add<bool>("applyHOverECut",true);
385  psd0.add<edm::InputTag>("ebRecHitCollection", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
386  psd0.add<edm::InputTag>("eeRecHitCollection", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
387  psd0.add<bool>("applySigmaIEtaIEtaCut", false);
388  psd0.add<double>("DeltaPhi2F",0.012);
389  psd0.add<double>("PhiMin2F",-0.003);
390  psd0.add<double>("hOverEHFMinE",0.8);
391  psd0.add<double>("DeltaPhi2B",0.008);
392  psd0.add<double>("PhiMin2B",-0.002);
393  psd0.add<bool>("allowHGCal",false);
394 
395  psd3.add<std::string>("ComponentName",std::string("SeedFromConsecutiveHitsCreator"));
396  psd3.add<std::string>("propagator",std::string("PropagatorWithMaterial"));
397  psd3.add<double>("SeedMomentumForBOFF",5.0);
398  psd3.add<double>("OriginTransverseErrorMultiplier",1.0);
399  psd3.add<double>("MinOneOverPtError",1.0);
400  psd3.add<std::string>("magneticField",std::string(""));
401  psd3.add<std::string>("TTRHBuilder",std::string("WithTrackAngle"));
402  psd3.add<bool>("forceKinematicWithRegionDirection",false);
403 
404  psd4.add<edm::InputTag>("HGCEEInput",edm::InputTag("HGCalRecHit","HGCEERecHits"));
405  psd4.add<edm::InputTag>("HGCFHInput",edm::InputTag("HGCalRecHit","HGCHEFRecHits"));
406  psd4.add<edm::InputTag>("HGCBHInput",edm::InputTag("HGCalRecHit","HGCHEBRecHits"));
407 
408  psd0.add<edm::ParameterSetDescription>("HGCalConfig",psd4);
409 
410  psd0.add<edm::ParameterSetDescription>("SeedCreatorPSet",psd3);
411 
412  desc.add<edm::ParameterSetDescription>("SeedConfiguration",psd0);
413  }
414  desc.add<edm::InputTag>("barrelSuperClusters",edm::InputTag("particleFlowSuperClusterECAL","particleFlowSuperClusterECALBarrel"));
415  descriptions.add("ecalDrivenElectronSeeds",desc);
416 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ElectronSeedProducer::filterClusters ( const reco::BeamSpot bs,
const edm::Handle< reco::SuperClusterCollection > &  superClusters,
reco::SuperClusterRefVector sclRefs,
std::vector< float > &  hoe1s,
std::vector< float > &  hoe2s,
edm::Event e,
const edm::EventSetup setup 
)
private

Definition at line 246 of file ElectronSeedProducer.cc.

References allowHGCal_, applyHOverECut_, applySigmaIEtaIEtaCut_, gamEcalExtractorBlocks_cff::detector, ebRecHitCollection_, EcalBarrel, EcalEndcap, eeRecHitCollection_, reco::CaloCluster::energy(), PVValHelper::eta, funct::false, filterSeeds(), DetId::Forward, HcalEndcap, ElectronHcalHelper::hcalESumDepth1(), ElectronHcalHelper::hcalESumDepth2(), hcalHelper_, hgcClusterTools_, reco::CaloCluster::hitsAndFractions(), mps_fire::i, infinity, edm::isNotFinite(), EcalClusterLazyToolsT< EcalClusterToolsImpl >::localCovariances(), LogDebug, maxHBarrel_, maxHEndcaps_, maxHOverEBarrel_, maxHOverEEndcaps_, reco::BeamSpot::position(), reco::CaloCluster::position(), edm::RefVector< C, T, F >::push_back(), SCEtCut_, reco::SuperCluster::seed(), edm::RefVector< C, T, F >::size(), and mathSSE::sqrt().

Referenced by produce().

251  {
252 
253  std::vector<float> sigmaIEtaIEtaEB_;
254  std::vector<float> sigmaIEtaIEtaEE_;
255 
256  for (unsigned int i=0;i<superClusters->size();++i)
257  {
258  const SuperCluster & scl = (*superClusters)[i] ;
259  double sclEta = EleRelPoint(scl.position(),bs.position()).eta() ;
260  if (scl.energy()/cosh(sclEta)>SCEtCut_)
261  {
262 // if ((applyHOverECut_==true)&&((hcalHelper_->hcalESum(scl)/scl.energy()) > maxHOverE_))
263 // { continue ; }
264 // sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
265  double had1, had2, had, scle ;
266 
267  bool HoeVeto = false ;
268  if (applyHOverECut_==true)
269  {
270  had1 = hcalHelper_->hcalESumDepth1(scl);
271  had2 = hcalHelper_->hcalESumDepth2(scl);
272  had = had1+had2 ;
273  scle = scl.energy() ;
274  int det_group = scl.seed()->hitsAndFractions()[0].first.det() ;
275  int detector = scl.seed()->hitsAndFractions()[0].first.subdetId() ;
276  if ( detector==EcalBarrel && (had<maxHBarrel_ || had/scle<maxHOverEBarrel_)) HoeVeto=true;
277  else if( !allowHGCal_ && detector==EcalEndcap && (had<maxHEndcaps_ || had/scle<maxHOverEEndcaps_) ) HoeVeto=true;
278  else if( allowHGCal_ && (detector==HcalEndcap || det_group == DetId::Forward) ) {
279  float had_fraction = hgcClusterTools_->getClusterHadronFraction(*(scl.seed()));
280  had1 = had_fraction*scl.seed()->energy();
281  had2 = 0.;
282  HoeVeto= ( had_fraction >= 0.f && had_fraction < maxHOverEEndcaps_ );
283  }
284  if (HoeVeto)
285  {
286  sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
287  hoe1s.push_back(had1/scle) ;
288  hoe2s.push_back(had2/scle) ;
289  }
290  }
291  else
292  {
293  sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
294  hoe1s.push_back(std::numeric_limits<float>::infinity()) ;
295  hoe2s.push_back(std::numeric_limits<float>::infinity()) ;
296  }
297  }
298 
299  if (applySigmaIEtaIEtaCut_ == true)
300  {
302  std::vector<float> vCov = lazyTool_noZS.localCovariances(*(scl.seed()));
303  int detector = scl.seed()->hitsAndFractions()[0].first.subdetId() ;
304  if (detector==EcalBarrel) sigmaIEtaIEtaEB_ .push_back(edm::isNotFinite(vCov[0]) ? 0. : sqrt(vCov[0]));
305  if (detector==EcalEndcap) sigmaIEtaIEtaEE_ .push_back(edm::isNotFinite(vCov[0]) ? 0. : sqrt(vCov[0]));
306  }
307  }
308  LogDebug("ElectronSeedProducer")<<"Filtered out "<<sclRefs.size()<<" superclusters from "<<superClusters->size() ;
309  }
#define LogDebug(id)
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:129
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:195
edm::EDGetTokenT< EcalRecHitCollection > eeRecHitCollection_
bool isNotFinite(T x)
Definition: isFinite.h:10
T sqrt(T t)
Definition: SSEVec.h:18
edm::EDGetTokenT< EcalRecHitCollection > ebRecHitCollection_
const double infinity
double hcalESumDepth2(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
double energy() const
cluster energy
Definition: CaloCluster.h:124
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
const Point & position() const
position
Definition: BeamSpot.h:62
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
ElectronHcalHelper * hcalHelper_
Definition: event.py:1
std::unique_ptr< hgcal::ClusterTools > hgcClusterTools_
void ElectronSeedProducer::filterSeeds ( edm::Event e,
const edm::EventSetup setup,
reco::SuperClusterRefVector sclRefs 
)
private

Definition at line 312 of file ElectronSeedProducer.cc.

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

Referenced by filterClusters(), and produce().

314  {
315  for ( unsigned int i=0 ; i<sclRefs.size() ; ++i )
316  {
317  seedFilter_->seeds(event,setup,sclRefs[i],theInitialSeedColl) ;
318  LogDebug("ElectronSeedProducer")<<"Number of Seeds: "<<theInitialSeedColl->size() ;
319  }
320  }
#define LogDebug(id)
std::unique_ptr< SeedFilter > seedFilter_
TrajectorySeedCollection * theInitialSeedColl
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
Definition: event.py:1
void ElectronSeedProducer::produce ( edm::Event e,
const edm::EventSetup iSetup 
)
final

Definition at line 163 of file ElectronSeedProducer.cc.

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

164  {
165  LogDebug("ElectronSeedProducer") <<"[ElectronSeedProducer::produce] entering " ;
166 
167  edm::Handle<reco::BeamSpot> theBeamSpot ;
168  e.getByToken(beamSpotTag_,theBeamSpot) ;
169 
170  if (hcalHelper_)
171  {
172  hcalHelper_->checkSetup(iSetup) ;
173  hcalHelper_->readEvent(e) ;
174  if( allowHGCal_ ) {
175  hgcClusterTools_->getEventSetup(iSetup);
176  hgcClusterTools_->getEvent(e);
177  }
178  }
179 
180  // get calo geometry
182  iSetup.get<CaloGeometryRecord>().get(caloGeom_);
183  caloGeomCacheId_=iSetup.get<CaloGeometryRecord>().cacheIdentifier();
184  }
186  caloTopoCacheId_=iSetup.get<CaloTopologyRecord>().cacheIdentifier();
187  iSetup.get<CaloTopologyRecord>().get(caloTopo_);
188  }
189 
190  matcher_->setupES(iSetup);
191 
192  // get initial TrajectorySeeds if necessary
193  if (fromTrackerSeeds_)
194  {
195  if (!prefilteredSeeds_)
196  {
198  e.getByToken(initialSeeds_, hSeeds);
199  theInitialSeedColl = const_cast<TrajectorySeedCollection *> (hSeeds.product());
200  }
201  else
203  }
204  else
205  { theInitialSeedColl = nullptr ; } // not needed in this case
206 
208 
209  // loop over barrel + endcap
210  for (unsigned int i=0; i<2; i++) {
212  e.getByToken(superClusters_[i],clusters);
213  SuperClusterRefVector clusterRefs ;
214  std::vector<float> hoe1s, hoe2s ;
215  filterClusters(*theBeamSpot,clusters,/*mhbhe_,*/clusterRefs,hoe1s,hoe2s,e, iSetup);
217  { filterSeeds(e,iSetup,clusterRefs) ; }
218  matcher_->run(e,iSetup,clusterRefs,hoe1s,hoe2s,theInitialSeedColl,*seeds);
219  }
220 
221  // store the accumulated result
222  std::unique_ptr<ElectronSeedCollection> pSeeds(seeds);
223  ElectronSeedCollection::iterator is ;
224  for ( is=pSeeds->begin() ; is!=pSeeds->end() ; is++ ) {
225  edm::RefToBase<CaloCluster> caloCluster = is->caloCluster() ;
226  SuperClusterRef superCluster = caloCluster.castTo<SuperClusterRef>() ;
227  LogDebug("ElectronSeedProducer")
228  << "new seed with "
229  << (*is).nHits() << " hits"
230  << ", charge " << (*is).getCharge()
231  << " and cluster energy " << superCluster->energy()
232  << " PID "<<superCluster.id() ;
233  }
234  e.put(std::move(pSeeds));
236  }
#define LogDebug(id)
void filterClusters(const reco::BeamSpot &bs, const edm::Handle< reco::SuperClusterCollection > &superClusters, reco::SuperClusterRefVector &sclRefs, std::vector< float > &hoe1s, std::vector< float > &hoe2s, edm::Event &e, const edm::EventSetup &setup)
unsigned long long cacheIdentifier() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
void readEvent(const edm::Event &)
void setupES(const edm::EventSetup &setup)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
unsigned long long caloGeomCacheId_
void checkSetup(const edm::EventSetup &)
edm::EDGetTokenT< TrajectorySeedCollection > initialSeeds_
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 &)
#define nullptr
ProductID id() const
Accessor for product ID.
Definition: Ref.h:259
edm::ESHandle< CaloTopology > caloTopo_
std::vector< TrajectorySeed > TrajectorySeedCollection
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
edm::ESHandle< CaloGeometry > caloGeom_
T const * product() const
Definition: Handle.h:81
ElectronSeedGenerator * matcher_
TrajectorySeedCollection * theInitialSeedColl
REF castTo() const
Definition: RefToBase.h:286
const T & get() const
Definition: EventSetup.h:58
edm::EDGetTokenT< reco::SuperClusterCollection > superClusters_[2]
unsigned long long caloTopoCacheId_
void filterSeeds(edm::Event &e, const edm::EventSetup &setup, reco::SuperClusterRefVector &sclRefs)
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
ElectronHcalHelper * hcalHelper_
def move(src, dest)
Definition: eostools.py:510
std::unique_ptr< hgcal::ClusterTools > hgcClusterTools_

Member Data Documentation

bool ElectronSeedProducer::allowHGCal_
private

Definition at line 109 of file ElectronSeedProducer.h.

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

bool ElectronSeedProducer::applyHOverECut_
private

Definition at line 81 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

bool ElectronSeedProducer::applySigmaIEtaIEtaCut_
private

Definition at line 102 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

edm::EDGetTokenT<reco::BeamSpot> ElectronSeedProducer::beamSpotTag_
private

Definition at line 68 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

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

Definition at line 85 of file ElectronSeedProducer.h.

Referenced by produce().

unsigned long long ElectronSeedProducer::caloGeomCacheId_
private

Definition at line 86 of file ElectronSeedProducer.h.

Referenced by produce().

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

Definition at line 87 of file ElectronSeedProducer.h.

Referenced by produce().

unsigned long long ElectronSeedProducer::caloTopoCacheId_
private

Definition at line 88 of file ElectronSeedProducer.h.

Referenced by produce().

edm::ParameterSet ElectronSeedProducer::conf_
private

Definition at line 72 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

edm::EDGetTokenT<EcalRecHitCollection> ElectronSeedProducer::ebRecHitCollection_
private

Definition at line 69 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

edm::EDGetTokenT<EcalRecHitCollection> ElectronSeedProducer::eeRecHitCollection_
private

Definition at line 70 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

edm::EDGetTokenT<std::vector<reco::Vertex> > ElectronSeedProducer::filterVtxTag_
private

Definition at line 67 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

bool ElectronSeedProducer::fromTrackerSeeds_
private

Definition at line 106 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

ElectronHcalHelper* ElectronSeedProducer::hcalHelper_
private
std::unique_ptr<hgcal::ClusterTools> ElectronSeedProducer::hgcClusterTools_
private

Definition at line 110 of file ElectronSeedProducer.h.

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

edm::EDGetTokenT<TrajectorySeedCollection> ElectronSeedProducer::initialSeeds_
private

Definition at line 66 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

ElectronSeedGenerator* ElectronSeedProducer::matcher_
private

Definition at line 73 of file ElectronSeedProducer.h.

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

double ElectronSeedProducer::maxHBarrel_
private

Definition at line 94 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

double ElectronSeedProducer::maxHEndcaps_
private

Definition at line 95 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

double ElectronSeedProducer::maxHOverEBarrel_
private

Definition at line 92 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

double ElectronSeedProducer::maxHOverEEndcaps_
private

Definition at line 93 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

double ElectronSeedProducer::maxSigmaIEtaIEtaBarrel_
private

Definition at line 103 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

double ElectronSeedProducer::maxSigmaIEtaIEtaEndcaps_
private

Definition at line 104 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

bool ElectronSeedProducer::prefilteredSeeds_
private

Definition at line 107 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

double ElectronSeedProducer::SCEtCut_
private

Definition at line 100 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

std::unique_ptr<SeedFilter> ElectronSeedProducer::seedFilter_
private

Definition at line 74 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterSeeds().

edm::EDGetTokenT<reco::SuperClusterCollection> ElectronSeedProducer::superClusters_[2]
private

Definition at line 65 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

TrajectorySeedCollection* ElectronSeedProducer::theInitialSeedColl
private

Definition at line 76 of file ElectronSeedProducer.h.

Referenced by filterSeeds(), and produce().