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<>

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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::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::EDGetTokenT< EcalRecHitCollectionebRecHitCollection_
 
edm::EDGetTokenT< EcalRecHitCollectioneeRecHitCollection_
 
bool fromTrackerSeeds_
 
ElectronHcalHelperhcalHelper_
 
std::unique_ptr< hgcal::ClusterToolshgcClusterTools_
 
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > initialSeeds_
 
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
 
std::vector< const TrajectorySeedCollection * > theInitialSeedColls
 

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
 

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 61 of file ElectronSeedProducer.cc.

References allowHGCal_, applyHOverECut_, applySigmaIEtaIEtaCut_, beamSpotTag_, ebRecHitCollection_, eeRecHitCollection_, edm::ParameterSet::empty(), 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_, GlobalPosition_Frontier_DevDB_cff::tag, SeedFilter::Tokens::token_bs, ElectronSeedGenerator::Tokens::token_bs, SeedFilter::Tokens::token_vtx, funct::true, ElectronHcalHelper::Configuration::useTowers, and edm::vector_transform().

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

Definition at line 168 of file ElectronSeedProducer.cc.

References hcalHelper_, and matcher_.

169  {
170  delete hcalHelper_ ;
171  delete matcher_ ;
172  }
ElectronSeedGenerator * matcher_
ElectronHcalHelper * hcalHelper_

Member Function Documentation

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

Definition at line 162 of file ElectronSeedProducer.cc.

163 {}
void ElectronSeedProducer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
final

Definition at line 165 of file ElectronSeedProducer.cc.

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

Definition at line 348 of file ElectronSeedProducer.cc.

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

348  {
350  desc.add<edm::InputTag>("endcapSuperClusters",edm::InputTag("particleFlowSuperClusterECAL","particleFlowSuperClusterECALEndcapWithPreshower"));
351  {
352  edm::ParameterSetDescription psd0, psd1, psd2, psd3, psd4;
353  psd1.add<unsigned int>("maxElement", 0);
354  psd1.add<std::string>("ComponentName", std::string("StandardHitPairGenerator"));
355  psd1.addUntracked<int>("useOnDemandTracker", 0);
356  psd1.add<edm::InputTag>("SeedingLayers", edm::InputTag("hltMixedLayerPairs"));
357  psd0.add<edm::ParameterSetDescription>("OrderedHitsFactoryPSet", psd1);
358 
359  psd2.add<double>("deltaPhiRegion", 0.4);
360  psd2.add<double>("originHalfLength", 15.0);
361  psd2.add<bool>("useZInVertex", true);
362  psd2.add<double>("deltaEtaRegion", 0.1);
363  psd2.add<double>("ptMin", 1.5 );
364  psd2.add<double>("originRadius", 0.2);
365  psd2.add<edm::InputTag>("VertexProducer", edm::InputTag("dummyVertices"));
366  psd0.add<edm::ParameterSetDescription>("RegionPSet", psd2);
367 
368  psd0.add<double>("PhiMax2B",0.002);
369  psd0.add<double>("hOverEPtMin",0.0);
370  psd0.add<double>("PhiMax2F",0.003);
371  psd0.add<bool>("searchInTIDTEC",true);
372  psd0.add<double>("pPhiMax1",0.125);
373  psd0.add<double>("HighPtThreshold",35.0);
374  psd0.add<double>("r2MinF",-0.15);
375  psd0.add<double>("maxHBarrel",0.0);
376  psd0.add<double>("DeltaPhi1Low",0.23);
377  psd0.add<double>("DeltaPhi1High",0.08);
378  psd0.add<double>("ePhiMin1",-0.125);
379  psd0.add<edm::InputTag>("hcalTowers",edm::InputTag("towerMaker"));
380  psd0.add<double>("LowPtThreshold",5.0);
381  psd0.add<double>("maxHOverEBarrel",0.15);
382  psd0.add<double>("maxSigmaIEtaIEtaBarrel", 0.5);
383  psd0.add<double>("maxSigmaIEtaIEtaEndcaps", 0.5);
384  psd0.add<bool>("dynamicPhiRoad",true);
385  psd0.add<double>("ePhiMax1",0.075);
386  psd0.add<std::string>("measurementTrackerName","");
387  psd0.add<double>("SizeWindowENeg",0.675);
388  psd0.add<double>("nSigmasDeltaZ1",5.0);
389  psd0.add<double>("rMaxI",0.2);
390  psd0.add<double>("maxHEndcaps",0.0);
391  psd0.add<bool>("preFilteredSeeds",false);
392  psd0.add<double>("r2MaxF",0.15);
393  psd0.add<double>("hOverEConeSize",0.15);
394  psd0.add<double>("pPhiMin1",-0.075);
395  psd0.add<edm::InputTag>("initialSeeds",edm::InputTag(""));//keep for be compatibility
396  psd0.add<std::vector<edm::InputTag>>("initialSeedsVector",{{"newCombinedSeeds"}});
397  psd0.add<double>("deltaZ1WithVertex",25.0);
398  psd0.add<double>("SCEtCut",0.0);
399  psd0.add<double>("z2MaxB",0.09);
400  psd0.add<bool>("fromTrackerSeeds",true);
401  psd0.add<edm::InputTag>("hcalRecHits",edm::InputTag("hbhereco"));
402  psd0.add<double>("z2MinB",-0.09);
403  psd0.add<double>("rMinI",-0.2);
404  psd0.add<double>("maxHOverEEndcaps",0.15);
405  psd0.add<double>("hOverEHBMinE",0.7);
406  psd0.add<bool>("useRecoVertex",false);
407  psd0.add<edm::InputTag>("beamSpot",edm::InputTag("offlineBeamSpot"));
408  psd0.add<edm::InputTag>("measurementTrackerEvent",edm::InputTag("MeasurementTrackerEvent"));
409  psd0.add<edm::InputTag>("vertices",edm::InputTag("offlinePrimaryVerticesWithBS"));
410  psd0.add<bool>("applyHOverECut",true);
411  psd0.add<edm::InputTag>("ebRecHitCollection", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
412  psd0.add<edm::InputTag>("eeRecHitCollection", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
413  psd0.add<bool>("applySigmaIEtaIEtaCut", false);
414  psd0.add<double>("DeltaPhi2F",0.012);
415  psd0.add<double>("PhiMin2F",-0.003);
416  psd0.add<double>("hOverEHFMinE",0.8);
417  psd0.add<double>("DeltaPhi2B",0.008);
418  psd0.add<double>("PhiMin2B",-0.002);
419  psd0.add<bool>("allowHGCal",false);
420 
421  psd3.add<std::string>("ComponentName",std::string("SeedFromConsecutiveHitsCreator"));
422  psd3.add<std::string>("propagator",std::string("PropagatorWithMaterial"));
423  psd3.add<double>("SeedMomentumForBOFF",5.0);
424  psd3.add<double>("OriginTransverseErrorMultiplier",1.0);
425  psd3.add<double>("MinOneOverPtError",1.0);
426  psd3.add<std::string>("magneticField",std::string(""));
427  psd3.add<std::string>("TTRHBuilder",std::string("WithTrackAngle"));
428  psd3.add<bool>("forceKinematicWithRegionDirection",false);
429 
430  psd4.add<edm::InputTag>("HGCEEInput",edm::InputTag("HGCalRecHit","HGCEERecHits"));
431  psd4.add<edm::InputTag>("HGCFHInput",edm::InputTag("HGCalRecHit","HGCHEFRecHits"));
432  psd4.add<edm::InputTag>("HGCBHInput",edm::InputTag("HGCalRecHit","HGCHEBRecHits"));
433 
434  psd0.add<edm::ParameterSetDescription>("HGCalConfig",psd4);
435 
436  psd0.add<edm::ParameterSetDescription>("SeedCreatorPSet",psd3);
437 
438  desc.add<edm::ParameterSetDescription>("SeedConfiguration",psd0);
439  }
440  desc.add<edm::InputTag>("barrelSuperClusters",edm::InputTag("particleFlowSuperClusterECAL","particleFlowSuperClusterECALBarrel"));
441  descriptions.add("ecalDrivenElectronSeeds",desc);
442 }
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 270 of file ElectronSeedProducer.cc.

References allowHGCal_, applyHOverECut_, applySigmaIEtaIEtaCut_, gamEcalExtractorBlocks_cff::detector, ebRecHitCollection_, EcalBarrel, EcalEndcap, eeRecHitCollection_, reco::CaloCluster::energy(), PVValHelper::eta, funct::false, filterSeeds(), ElectronHcalHelper::hcalESumDepth1(), ElectronHcalHelper::hcalESumDepth2(), hcalHelper_, hgcClusterTools_, reco::CaloCluster::hitsAndFractions(), mps_fire::i, infinity, EcalTools::isHGCalDet(), edm::isNotFinite(), EcalClusterLazyToolsT< ClusterTools >::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().

275  {
276 
277  std::vector<float> sigmaIEtaIEtaEB_;
278  std::vector<float> sigmaIEtaIEtaEE_;
279 
280  for (unsigned int i=0;i<superClusters->size();++i)
281  {
282  const SuperCluster & scl = (*superClusters)[i] ;
283  double sclEta = EleRelPoint(scl.position(),bs.position()).eta() ;
284  if (scl.energy()/cosh(sclEta)>SCEtCut_)
285  {
286 // if ((applyHOverECut_==true)&&((hcalHelper_->hcalESum(scl)/scl.energy()) > maxHOverE_))
287 // { continue ; }
288 // sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
289  double had1, had2, had, scle ;
290 
291  bool HoeVeto = false ;
292  if (applyHOverECut_==true)
293  {
294  had1 = hcalHelper_->hcalESumDepth1(scl);
295  had2 = hcalHelper_->hcalESumDepth2(scl);
296  had = had1+had2 ;
297  scle = scl.energy() ;
298  int det_group = scl.seed()->hitsAndFractions()[0].first.det() ;
299  int detector = scl.seed()->hitsAndFractions()[0].first.subdetId() ;
300  if ( detector==EcalBarrel && (had<maxHBarrel_ || had/scle<maxHOverEBarrel_)) HoeVeto=true;
301  else if( !allowHGCal_ && detector==EcalEndcap && (had<maxHEndcaps_ || had/scle<maxHOverEEndcaps_) ) HoeVeto=true;
302  else if( allowHGCal_ && EcalTools::isHGCalDet((DetId::Detector)det_group) ) {
303  float had_fraction = hgcClusterTools_->getClusterHadronFraction(*(scl.seed()));
304  had1 = had_fraction*scl.seed()->energy();
305  had2 = 0.;
306  HoeVeto= ( had_fraction >= 0.f && had_fraction < maxHOverEEndcaps_ );
307  }
308  if (HoeVeto)
309  {
310  sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
311  hoe1s.push_back(had1/scle) ;
312  hoe2s.push_back(had2/scle) ;
313  }
314  }
315  else
316  {
317  sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
318  hoe1s.push_back(std::numeric_limits<float>::infinity()) ;
319  hoe2s.push_back(std::numeric_limits<float>::infinity()) ;
320  }
321  }
322 
323  if (applySigmaIEtaIEtaCut_ == true)
324  {
326  std::vector<float> vCov = lazyTool_noZS.localCovariances(*(scl.seed()));
327  int detector = scl.seed()->hitsAndFractions()[0].first.subdetId() ;
328  if (detector==EcalBarrel) sigmaIEtaIEtaEB_ .push_back(edm::isNotFinite(vCov[0]) ? 0. : sqrt(vCov[0]));
329  if (detector==EcalEndcap) sigmaIEtaIEtaEE_ .push_back(edm::isNotFinite(vCov[0]) ? 0. : sqrt(vCov[0]));
330  }
331  }
332  LogDebug("ElectronSeedProducer")<<"Filtered out "<<sclRefs.size()<<" superclusters from "<<superClusters->size() ;
333  }
#define LogDebug(id)
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:131
static bool isHGCalDet(DetId::Detector thedet)
identify HGCal cells
Definition: EcalTools.h:54
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:197
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0) const
edm::EDGetTokenT< EcalRecHitCollection > eeRecHitCollection_
T sqrt(T t)
Definition: SSEVec.h:18
edm::EDGetTokenT< EcalRecHitCollection > ebRecHitCollection_
const double infinity
double energy() const
cluster energy
Definition: CaloCluster.h:126
double hcalESumDepth2(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0) const
Detector
Definition: DetId.h:26
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 336 of file ElectronSeedProducer.cc.

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

Referenced by filterClusters(), and produce().

338  {
339  for ( unsigned int i=0 ; i<sclRefs.size() ; ++i )
340  {
341  seedFilter_->seeds(event,setup,sclRefs[i],theInitialSeedColl) ;
343  LogDebug("ElectronSeedProducer")<<"Number of Seeds: "<<theInitialSeedColl->size() ;
344  }
345  }
#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
std::vector< const TrajectorySeedCollection * > theInitialSeedColls
void ElectronSeedProducer::produce ( edm::Event e,
const edm::EventSetup iSetup 
)
final

Definition at line 174 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_, theInitialSeedColl, and theInitialSeedColls.

175  {
176  LogDebug("ElectronSeedProducer") <<"[ElectronSeedProducer::produce] entering " ;
177 
178  edm::Handle<reco::BeamSpot> theBeamSpot ;
179  e.getByToken(beamSpotTag_,theBeamSpot) ;
180 
181  if (hcalHelper_)
182  {
183  hcalHelper_->checkSetup(iSetup) ;
184  hcalHelper_->readEvent(e) ;
185  if( allowHGCal_ ) {
186  hgcClusterTools_->getEventSetup(iSetup);
187  hgcClusterTools_->getEvent(e);
188  }
189  }
190 
191  // get calo geometry
193  iSetup.get<CaloGeometryRecord>().get(caloGeom_);
194  caloGeomCacheId_=iSetup.get<CaloGeometryRecord>().cacheIdentifier();
195  }
197  caloTopoCacheId_=iSetup.get<CaloTopologyRecord>().cacheIdentifier();
198  iSetup.get<CaloTopologyRecord>().get(caloTopo_);
199  }
200 
201  matcher_->setupES(iSetup);
202 
203  // get initial TrajectorySeeds if necessary
204  if (fromTrackerSeeds_)
205  {
206  if (!prefilteredSeeds_)
207  {
208  theInitialSeedColls.clear();
209  for (auto const& seeds : initialSeeds_)
210  {
212  e.getByToken(seeds, hSeeds);
213  theInitialSeedColls.push_back(hSeeds.product());
214  }
215  theInitialSeedColl = nullptr;// not needed in this case
216 
217  }
218  else
219  {
220  theInitialSeedColls.clear();//reset later
222  }
223  }
224  else
225  {
226  // not needed in this case
227  theInitialSeedColls.clear();
229  }
230 
232 
233  // loop over barrel + endcap
234  for (unsigned int i=0; i<2; i++) {
236  e.getByToken(superClusters_[i],clusters);
237  SuperClusterRefVector clusterRefs ;
238  std::vector<float> hoe1s, hoe2s ;
239  filterClusters(*theBeamSpot,clusters,/*mhbhe_,*/clusterRefs,hoe1s,hoe2s,e, iSetup);
241  { filterSeeds(e,iSetup,clusterRefs) ; }
242  matcher_->run(e,iSetup,clusterRefs,hoe1s,hoe2s,theInitialSeedColls,*seeds);
243  }
244 
245  // store the accumulated result
246  std::unique_ptr<ElectronSeedCollection> pSeeds(seeds);
247  ElectronSeedCollection::iterator is ;
248  for ( is=pSeeds->begin() ; is!=pSeeds->end() ; is++ ) {
249  edm::RefToBase<CaloCluster> caloCluster = is->caloCluster() ;
250  SuperClusterRef superCluster = caloCluster.castTo<SuperClusterRef>() ;
251  LogDebug("ElectronSeedProducer")
252  << "new seed with "
253  << (*is).nHits() << " hits"
254  << ", charge " << (*is).getCharge()
255  << " and cluster energy " << superCluster->energy()
256  << " PID "<<superCluster.id() ;
257  }
258  e.put(std::move(pSeeds));
260  }
#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:125
void readEvent(const edm::Event &)
void setupES(const edm::EventSetup &setup)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
#define nullptr
unsigned long long caloGeomCacheId_
void checkSetup(const edm::EventSetup &)
ProductID id() const
Accessor for product ID.
Definition: Ref.h:257
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:74
ElectronSeedGenerator * matcher_
TrajectorySeedCollection * theInitialSeedColl
REF castTo() const
Definition: RefToBase.h:289
edm::EDGetTokenT< reco::SuperClusterCollection > superClusters_[2]
unsigned long long caloTopoCacheId_
void filterSeeds(edm::Event &e, const edm::EventSetup &setup, reco::SuperClusterRefVector &sclRefs)
T get() const
Definition: EventSetup.h:71
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
ElectronHcalHelper * hcalHelper_
void run(edm::Event &, const edm::EventSetup &setup, const reco::SuperClusterRefVector &, const std::vector< float > &hoe1s, const std::vector< float > &hoe2s, const std::vector< const TrajectorySeedCollection * > &seedsV, reco::ElectronSeedCollection &)
def move(src, dest)
Definition: eostools.py:511
std::unique_ptr< hgcal::ClusterTools > hgcClusterTools_
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > initialSeeds_
std::vector< const TrajectorySeedCollection * > theInitialSeedColls

Member Data Documentation

bool ElectronSeedProducer::allowHGCal_
private

Definition at line 108 of file ElectronSeedProducer.h.

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

bool ElectronSeedProducer::applyHOverECut_
private

Definition at line 80 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

bool ElectronSeedProducer::applySigmaIEtaIEtaCut_
private

Definition at line 101 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

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

Definition at line 67 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

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

Definition at line 84 of file ElectronSeedProducer.h.

Referenced by produce().

unsigned long long ElectronSeedProducer::caloGeomCacheId_
private

Definition at line 85 of file ElectronSeedProducer.h.

Referenced by produce().

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

Definition at line 86 of file ElectronSeedProducer.h.

Referenced by produce().

unsigned long long ElectronSeedProducer::caloTopoCacheId_
private

Definition at line 87 of file ElectronSeedProducer.h.

Referenced by produce().

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

Definition at line 68 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

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

Definition at line 69 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

bool ElectronSeedProducer::fromTrackerSeeds_
private

Definition at line 105 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

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

Definition at line 109 of file ElectronSeedProducer.h.

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

std::vector<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 71 of file ElectronSeedProducer.h.

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

double ElectronSeedProducer::maxHBarrel_
private

Definition at line 93 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

double ElectronSeedProducer::maxHEndcaps_
private

Definition at line 94 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

double ElectronSeedProducer::maxHOverEBarrel_
private

Definition at line 91 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

double ElectronSeedProducer::maxHOverEEndcaps_
private

Definition at line 92 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

double ElectronSeedProducer::maxSigmaIEtaIEtaBarrel_
private

Definition at line 102 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

double ElectronSeedProducer::maxSigmaIEtaIEtaEndcaps_
private

Definition at line 103 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

bool ElectronSeedProducer::prefilteredSeeds_
private

Definition at line 106 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

double ElectronSeedProducer::SCEtCut_
private

Definition at line 99 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and filterClusters().

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

Definition at line 72 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 74 of file ElectronSeedProducer.h.

Referenced by filterSeeds(), and produce().

std::vector<const TrajectorySeedCollection *> ElectronSeedProducer::theInitialSeedColls
private

Definition at line 75 of file ElectronSeedProducer.h.

Referenced by filterSeeds(), and produce().