CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void beginRun (edm::Run const &, edm::EventSetup const &) overridefinal
 
 ElectronSeedProducer (const edm::ParameterSet &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) overridefinal
 
virtual void produce (edm::Event &, const edm::EventSetup &) overridefinal
 
virtual ~ElectronSeedProducer ()
 
- 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 ()
 

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 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
< EcalRecHitCollection
ebRecHitCollection_
 
edm::EDGetTokenT
< EcalRecHitCollection
eeRecHitCollection_
 
edm::EDGetTokenT< std::vector
< reco::Vertex > > 
filterVtxTag_
 
bool fromTrackerSeeds_
 
ElectronHcalHelperhcalHelper_
 
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::SuperClusterCollection
superClusters_ [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, 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
 
- 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 41 of file ElectronSeedProducer.h.

Constructor & Destructor Documentation

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

Definition at line 56 of file ElectronSeedProducer.cc.

References applyHOverECut_, applySigmaIEtaIEtaCut_, beamSpotTag_, conf_, edm::EDConsumerBase::consumesCollector(), ebRecHitCollection_, eeRecHitCollection_, filterVtxTag_, fromTrackerSeeds_, edm::ParameterSet::getParameter(), hcalHelper_, ElectronHcalHelper::Configuration::hcalTowers, 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.

57  : //conf_(iConfig),
58  applyHOverECut_(true), hcalHelper_(0),
60  {
61  conf_ = iConfig.getParameter<edm::ParameterSet>("SeedConfiguration") ;
62 
63  initialSeeds_ = consumes<TrajectorySeedCollection>(conf_.getParameter<edm::InputTag>("initialSeeds")) ;
64  SCEtCut_ = conf_.getParameter<double>("SCEtCut");
65  fromTrackerSeeds_ = conf_.getParameter<bool>("fromTrackerSeeds") ;
66  prefilteredSeeds_ = conf_.getParameter<bool>("preFilteredSeeds") ;
67 
68  // new beamSpot tag
69  beamSpotTag_ = consumes<reco::BeamSpot>(conf_.getParameter<edm::InputTag>("beamSpot"));
70 
71  // for H/E
72  applyHOverECut_ = conf_.getParameter<bool>("applyHOverECut") ;
73  if (applyHOverECut_)
74  {
76  hcalCfg.hOverEConeSize = conf_.getParameter<double>("hOverEConeSize") ;
77  if (hcalCfg.hOverEConeSize>0)
78  {
79  hcalCfg.useTowers = true ;
80  hcalCfg.hcalTowers =
81  consumes<CaloTowerCollection>(conf_.getParameter<edm::InputTag>("hcalTowers")) ;
82  hcalCfg.hOverEPtMin = conf_.getParameter<double>("hOverEPtMin") ;
83  }
84  hcalHelper_ = new ElectronHcalHelper(hcalCfg) ;
85  maxHOverEBarrel_=conf_.getParameter<double>("maxHOverEBarrel") ;
86  maxHOverEEndcaps_=conf_.getParameter<double>("maxHOverEEndcaps") ;
87  maxHBarrel_=conf_.getParameter<double>("maxHBarrel") ;
88  maxHEndcaps_=conf_.getParameter<double>("maxHEndcaps") ;
89  }
90 
91  applySigmaIEtaIEtaCut_ = conf_.getParameter<bool>("applySigmaIEtaIEtaCut");
92 
93  // apply sigma_ieta_ieta cut
94  if (applySigmaIEtaIEtaCut_ == true)
95  {
96  maxSigmaIEtaIEtaBarrel_ = conf_.getParameter<double>("maxSigmaIEtaIEtaBarrel");
97  maxSigmaIEtaIEtaEndcaps_ = conf_.getParameter<double>("maxSigmaIEtaIEtaEndcaps");
98  }
99 
100  edm::ParameterSet rpset = conf_.getParameter<edm::ParameterSet>("RegionPSet");
101  filterVtxTag_ = consumes<std::vector<reco::Vertex> >(rpset.getParameter<edm::InputTag> ("VertexProducer"));
102 
104  esg_tokens.token_bs = beamSpotTag_;
105  esg_tokens.token_vtx = mayConsume<reco::VertexCollection>(conf_.getParameter<edm::InputTag>("vertices"));
106  esg_tokens.token_measTrkEvt= consumes<MeasurementTrackerEvent>(conf_.getParameter<edm::InputTag>("measurementTrackerEvent"));
107 
108  matcher_ = new ElectronSeedGenerator(conf_,esg_tokens) ;
109 
110  // get collections from config
111  if (applySigmaIEtaIEtaCut_ == true) {
112  ebRecHitCollection_ = consumes<EcalRecHitCollection> (iConfig.getParameter<edm::InputTag>("ebRecHitCollection"));
113  eeRecHitCollection_ = consumes<EcalRecHitCollection> (iConfig.getParameter<edm::InputTag>("eeRecHitCollection"));
114  }
115 
116  superClusters_[0]=
117  consumes<reco::SuperClusterCollection>(iConfig.getParameter<edm::InputTag>("barrelSuperClusters")) ;
118  superClusters_[1]=
119  consumes<reco::SuperClusterCollection>(iConfig.getParameter<edm::InputTag>("endcapSuperClusters")) ;
120 
121  // Construction of SeedFilter was in beginRun() with the comment
122  // below, but it has to be done here because of ConsumesCollector
123  //
124  // FIXME: because of a bug presumably in tracker seeding,
125  // perhaps in CombinedHitPairGenerator, badly caching some EventSetup product,
126  // we must redo the SeedFilter for each run.
127  if (prefilteredSeeds_) {
128  SeedFilter::Tokens sf_tokens;
129  sf_tokens.token_bs = beamSpotTag_;
130  sf_tokens.token_vtx = filterVtxTag_;
132  seedFilter_.reset(new SeedFilter(conf_, sf_tokens, iC));
133  }
134 
135  //register your products
136  produces<ElectronSeedCollection>() ;
137 }
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_
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
ElectronSeedProducer::~ElectronSeedProducer ( )
virtual

Definition at line 145 of file ElectronSeedProducer.cc.

References hcalHelper_, and matcher_.

146  {
147  delete hcalHelper_ ;
148  delete matcher_ ;
149  }
ElectronSeedGenerator * matcher_
ElectronHcalHelper * hcalHelper_

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 139 of file ElectronSeedProducer.cc.

140 {}
void ElectronSeedProducer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
finaloverridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 142 of file ElectronSeedProducer.cc.

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

Definition at line 300 of file ElectronSeedProducer.cc.

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

300  {
302  desc.add<edm::InputTag>("endcapSuperClusters",edm::InputTag("particleFlowSuperClusterECAL","particleFlowSuperClusterECALEndcapWithPreshower"));
303  {
304  edm::ParameterSetDescription psd0, psd1, psd2, psd3;
305  psd1.add<unsigned int>("maxElement", 0);
306  psd1.add<std::string>("ComponentName", std::string("StandardHitPairGenerator"));
307  psd1.addUntracked<int>("useOnDemandTracker", 0);
308  psd1.add<edm::InputTag>("SeedingLayers", edm::InputTag("hltMixedLayerPairs"));
309  psd0.add<edm::ParameterSetDescription>("OrderedHitsFactoryPSet", psd1);
310 
311  psd2.add<double>("deltaPhiRegion", 0.4);
312  psd2.add<double>("originHalfLength", 15.0);
313  psd2.add<bool>("useZInVertex", true);
314  psd2.add<double>("deltaEtaRegion", 0.1);
315  psd2.add<double>("ptMin", 1.5 );
316  psd2.add<double>("originRadius", 0.2);
317  psd2.add<edm::InputTag>("VertexProducer", edm::InputTag("dummyVertices"));
318  psd0.add<edm::ParameterSetDescription>("RegionPSet", psd2);
319 
320  psd0.add<double>("PhiMax2B",0.002);
321  psd0.add<double>("hOverEPtMin",0.0);
322  psd0.add<double>("PhiMax2F",0.003);
323  psd0.add<bool>("searchInTIDTEC",true);
324  psd0.add<double>("pPhiMax1",0.125);
325  psd0.add<double>("HighPtThreshold",35.0);
326  psd0.add<double>("r2MinF",-0.15);
327  psd0.add<double>("maxHBarrel",0.0);
328  psd0.add<double>("DeltaPhi1Low",0.23);
329  psd0.add<double>("DeltaPhi1High",0.08);
330  psd0.add<double>("ePhiMin1",-0.125);
331  psd0.add<edm::InputTag>("hcalTowers",edm::InputTag("towerMaker"));
332  psd0.add<double>("LowPtThreshold",5.0);
333  psd0.add<double>("maxHOverEBarrel",0.15);
334  psd0.add<double>("maxSigmaIEtaIEtaBarrel", 0.5);
335  psd0.add<double>("maxSigmaIEtaIEtaEndcaps", 0.5);
336  psd0.add<bool>("dynamicPhiRoad",true);
337  psd0.add<double>("ePhiMax1",0.075);
338  psd0.add<std::string>("measurementTrackerName","");
339  psd0.add<double>("SizeWindowENeg",0.675);
340  psd0.add<double>("nSigmasDeltaZ1",5.0);
341  psd0.add<double>("rMaxI",0.2);
342  psd0.add<double>("maxHEndcaps",0.0);
343  psd0.add<bool>("preFilteredSeeds",false);
344  psd0.add<double>("r2MaxF",0.15);
345  psd0.add<double>("hOverEConeSize",0.15);
346  psd0.add<double>("pPhiMin1",-0.075);
347  psd0.add<edm::InputTag>("initialSeeds",edm::InputTag("newCombinedSeeds"));
348  psd0.add<double>("deltaZ1WithVertex",25.0);
349  psd0.add<double>("SCEtCut",0.0);
350  psd0.add<double>("z2MaxB",0.09);
351  psd0.add<bool>("fromTrackerSeeds",true);
352  psd0.add<edm::InputTag>("hcalRecHits",edm::InputTag("hbhereco"));
353  psd0.add<double>("z2MinB",-0.09);
354  psd0.add<double>("rMinI",-0.2);
355  psd0.add<double>("maxHOverEEndcaps",0.15);
356  psd0.add<double>("hOverEHBMinE",0.7);
357  psd0.add<bool>("useRecoVertex",false);
358  psd0.add<edm::InputTag>("beamSpot",edm::InputTag("offlineBeamSpot"));
359  psd0.add<edm::InputTag>("measurementTrackerEvent",edm::InputTag("MeasurementTrackerEvent"));
360  psd0.add<edm::InputTag>("vertices",edm::InputTag("offlinePrimaryVerticesWithBS"));
361  psd0.add<bool>("applyHOverECut",true);
362  psd0.add<edm::InputTag>("ebRecHitCollection", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
363  psd0.add<edm::InputTag>("eeRecHitCollection", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
364  psd0.add<bool>("applySigmaIEtaIEtaCut", false);
365  psd0.add<double>("DeltaPhi2F",0.012);
366  psd0.add<double>("PhiMin2F",-0.003);
367  psd0.add<double>("hOverEHFMinE",0.8);
368  psd0.add<double>("DeltaPhi2B",0.008);
369  psd0.add<double>("PhiMin2B",-0.002);
370 
371  psd3.add<std::string>("ComponentName",std::string("SeedFromConsecutiveHitsCreator"));
372  psd3.add<std::string>("propagator",std::string("PropagatorWithMaterial"));
373  psd3.add<double>("SeedMomentumForBOFF",5.0);
374  psd3.add<double>("OriginTransverseErrorMultiplier",1.0);
375  psd3.add<double>("MinOneOverPtError",1.0);
376  psd3.add<std::string>("magneticField",std::string(""));
377  psd3.add<std::string>("TTRHBuilder",std::string("WithTrackAngle"));
378  psd3.add<bool>("forceKinematicWithRegionDirection",false);
379  psd0.add<edm::ParameterSetDescription>("SeedCreatorPSet",psd3);
380 
381  desc.add<edm::ParameterSetDescription>("SeedConfiguration",psd0);
382  }
383  desc.add<edm::InputTag>("barrelSuperClusters",edm::InputTag("particleFlowSuperClusterECAL","particleFlowSuperClusterECALBarrel"));
384  descriptions.add("ecalDrivenElectronSeeds",desc);
385 }
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 230 of file ElectronSeedProducer.cc.

References EcalBarrel, EcalEndcap, reco::CaloCluster::energy(), eta, edm::false, i, infinity, edm::detail::isnan(), EcalClusterLazyToolsT< EcalClusterToolsImpl >::localCovariances(), LogDebug, reco::BeamSpot::position(), reco::CaloCluster::position(), edm::RefVector< C, T, F >::push_back(), reco::SuperCluster::seed(), edm::RefVector< C, T, F >::size(), and mathSSE::sqrt().

Referenced by produce().

235  {
236 
237  std::vector<float> sigmaIEtaIEtaEB_;
238  std::vector<float> sigmaIEtaIEtaEE_;
239 
240  for (unsigned int i=0;i<superClusters->size();++i)
241  {
242  const SuperCluster & scl = (*superClusters)[i] ;
243  double sclEta = EleRelPoint(scl.position(),bs.position()).eta() ;
244  if (scl.energy()/cosh(sclEta)>SCEtCut_)
245  {
246 // if ((applyHOverECut_==true)&&((hcalHelper_->hcalESum(scl)/scl.energy()) > maxHOverE_))
247 // { continue ; }
248 // sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
249  double had1, had2, had, scle ;
250 
251  bool HoeVeto = false ;
252  if (applyHOverECut_==true)
253  {
254  had1 = hcalHelper_->hcalESumDepth1(scl);
255  had2 = hcalHelper_->hcalESumDepth2(scl);
256  had = had1+had2 ;
257  scle = scl.energy() ;
258  int detector = scl.seed()->hitsAndFractions()[0].first.subdetId() ;
259  if (detector==EcalBarrel && (had<maxHBarrel_ || had/scle<maxHOverEBarrel_)) HoeVeto=true;
260  else if (detector==EcalEndcap && (had<maxHEndcaps_ || had/scle<maxHOverEEndcaps_)) HoeVeto=true;
261  if (HoeVeto)
262  {
263  sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
264  hoe1s.push_back(had1/scle) ;
265  hoe2s.push_back(had2/scle) ;
266  }
267  }
268  else
269  {
270  sclRefs.push_back(edm::Ref<reco::SuperClusterCollection>(superClusters,i)) ;
271  hoe1s.push_back(std::numeric_limits<float>::infinity()) ;
272  hoe2s.push_back(std::numeric_limits<float>::infinity()) ;
273  }
274  }
275 
276  if (applySigmaIEtaIEtaCut_ == true)
277  {
279  std::vector<float> vCov = lazyTool_noZS.localCovariances(*(scl.seed()));
280  int detector = scl.seed()->hitsAndFractions()[0].first.subdetId() ;
281  if (detector==EcalBarrel) sigmaIEtaIEtaEB_ .push_back(isnan(vCov[0]) ? 0. : sqrt(vCov[0]));
282  if (detector==EcalEndcap) sigmaIEtaIEtaEE_ .push_back(isnan(vCov[0]) ? 0. : sqrt(vCov[0]));
283  }
284  }
285  LogDebug("ElectronSeedProducer")<<"Filtered out "<<sclRefs.size()<<" superclusters from "<<superClusters->size() ;
286  }
#define LogDebug(id)
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< EcalRecHitCollection > eeRecHitCollection_
bool isnan(float x)
Definition: math.h:13
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:121
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
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:62
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
const Point & position() const
position
Definition: BeamSpot.h:62
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
volatile std::atomic< bool > shutdown_flag false
ElectronHcalHelper * hcalHelper_
void ElectronSeedProducer::filterSeeds ( edm::Event e,
const edm::EventSetup setup,
reco::SuperClusterRefVector sclRefs 
)
private

Definition at line 289 of file ElectronSeedProducer.cc.

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

Referenced by produce().

291  {
292  for ( unsigned int i=0 ; i<sclRefs.size() ; ++i )
293  {
294  seedFilter_->seeds(event,setup,sclRefs[i],theInitialSeedColl) ;
295  LogDebug("ElectronSeedProducer")<<"Number of Seeds: "<<theInitialSeedColl->size() ;
296  }
297  }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
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
std::unique_ptr< SeedFilter > seedFilter_
TrajectorySeedCollection * theInitialSeedColl
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
void ElectronSeedProducer::produce ( edm::Event e,
const edm::EventSetup iSetup 
)
finaloverridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 151 of file ElectronSeedProducer.cc.

References beamSpotTag_, edm::eventsetup::EventSetupRecord::cacheIdentifier(), caloGeom_, caloGeomCacheId_, caloTopo_, caloTopoCacheId_, edm::RefToBase< T >::castTo(), ElectronHcalHelper::checkSetup(), HLT_25ns10e33_v2_cff::clusters, filterClusters(), filterSeeds(), fromTrackerSeeds_, edm::EventSetup::get(), edm::Event::getByToken(), 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.

152  {
153  LogDebug("ElectronSeedProducer") <<"[ElectronSeedProducer::produce] entering " ;
154 
155  edm::Handle<reco::BeamSpot> theBeamSpot ;
156  e.getByToken(beamSpotTag_,theBeamSpot) ;
157 
158  if (hcalHelper_)
159  {
160  hcalHelper_->checkSetup(iSetup) ;
161  hcalHelper_->readEvent(e) ;
162  }
163 
164  // get calo geometry
166  iSetup.get<CaloGeometryRecord>().get(caloGeom_);
167  caloGeomCacheId_=iSetup.get<CaloGeometryRecord>().cacheIdentifier();
168  }
170  caloTopoCacheId_=iSetup.get<CaloTopologyRecord>().cacheIdentifier();
171  iSetup.get<CaloTopologyRecord>().get(caloTopo_);
172  }
173 
174  matcher_->setupES(iSetup);
175 
176  // get initial TrajectorySeeds if necessary
177  if (fromTrackerSeeds_)
178  {
179  if (!prefilteredSeeds_)
180  {
182  e.getByToken(initialSeeds_, hSeeds);
183  theInitialSeedColl = const_cast<TrajectorySeedCollection *> (hSeeds.product());
184  }
185  else
187  }
188  else
189  { theInitialSeedColl = 0 ; } // not needed in this case
190 
192 
193  // loop over barrel + endcap
194  for (unsigned int i=0; i<2; i++) {
196  e.getByToken(superClusters_[i],clusters);
197  SuperClusterRefVector clusterRefs ;
198  std::vector<float> hoe1s, hoe2s ;
199  filterClusters(*theBeamSpot,clusters,/*mhbhe_,*/clusterRefs,hoe1s,hoe2s,e, iSetup);
201  { filterSeeds(e,iSetup,clusterRefs) ; }
202  matcher_->run(e,iSetup,clusterRefs,hoe1s,hoe2s,theInitialSeedColl,*seeds);
203  }
204 
205  // store the accumulated result
206  std::auto_ptr<ElectronSeedCollection> pSeeds(seeds) ;
207  ElectronSeedCollection::iterator is ;
208  for ( is=pSeeds->begin() ; is!=pSeeds->end() ; is++ ) {
209  edm::RefToBase<CaloCluster> caloCluster = is->caloCluster() ;
210  SuperClusterRef superCluster = caloCluster.castTo<SuperClusterRef>() ;
211  LogDebug("ElectronSeedProducer")
212  << "new seed with "
213  << (*is).nHits() << " hits"
214  << ", charge " << (*is).getCharge()
215  << " and cluster energy " << superCluster->energy()
216  << " PID "<<superCluster.id() ;
217  }
218  e.put(pSeeds) ;
220  }
#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
int i
Definition: DBlmapReader.cc:9
void readEvent(const edm::Event &)
void setupES(const edm::EventSetup &setup)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
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 &)
ProductID id() const
Accessor for product ID.
Definition: Ref.h:258
edm::ESHandle< CaloTopology > caloTopo_
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
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:271
const T & get() const
Definition: EventSetup.h:56
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_

Member Data Documentation

bool ElectronSeedProducer::applyHOverECut_
private

Definition at line 80 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

bool ElectronSeedProducer::applySigmaIEtaIEtaCut_
private

Definition at line 101 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

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::ParameterSet ElectronSeedProducer::conf_
private

Definition at line 71 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

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

Definition at line 68 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

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

Definition at line 69 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

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

Definition at line 66 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

bool ElectronSeedProducer::fromTrackerSeeds_
private

Definition at line 105 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

ElectronHcalHelper* ElectronSeedProducer::hcalHelper_
private

Definition at line 81 of file ElectronSeedProducer.h.

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

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

Definition at line 65 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

ElectronSeedGenerator* ElectronSeedProducer::matcher_
private

Definition at line 72 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().

double ElectronSeedProducer::maxHEndcaps_
private

Definition at line 94 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

double ElectronSeedProducer::maxHOverEBarrel_
private

Definition at line 91 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

double ElectronSeedProducer::maxHOverEEndcaps_
private

Definition at line 92 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

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

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

Definition at line 73 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer().

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

Definition at line 64 of file ElectronSeedProducer.h.

Referenced by ElectronSeedProducer(), and produce().

TrajectorySeedCollection* ElectronSeedProducer::theInitialSeedColl
private

Definition at line 75 of file ElectronSeedProducer.h.

Referenced by produce().