CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
EcalClusterLazyToolsBase Class Reference

#include <EcalClusterLazyTools.h>

Inheritance diagram for EcalClusterLazyToolsBase:
EcalClusterLazyToolsT< ClusterTools >

Public Member Functions

float BasicClusterSeedTime (const reco::BasicCluster &cluster)
 
float BasicClusterTime (const reco::BasicCluster &cluster, const edm::Event &ev)
 
 EcalClusterLazyToolsBase (const edm::Event &ev, const edm::EventSetup &es, edm::EDGetTokenT< EcalRecHitCollection > token1, edm::EDGetTokenT< EcalRecHitCollection > token2)
 
 EcalClusterLazyToolsBase (const edm::Event &ev, const edm::EventSetup &es, edm::EDGetTokenT< EcalRecHitCollection > token1, edm::EDGetTokenT< EcalRecHitCollection > token2, edm::EDGetTokenT< EcalRecHitCollection > token3)
 
float eseffsirir (const reco::SuperCluster &cluster)
 
float eseffsixix (const reco::SuperCluster &cluster)
 
float eseffsiyiy (const reco::SuperCluster &cluster)
 
const EcalRecHitCollectiongetEcalEBRecHitCollection () const
 
const EcalRecHitCollectiongetEcalEERecHitCollection () const
 
const EcalRecHitCollectiongetEcalESRecHitCollection () const
 
const EcalIntercalibConstantsgetEcalIntercalibConstants () const
 
std::vector< float > getESHits (double X, double Y, double Z, const std::map< DetId, EcalRecHit > &rechits_map, const CaloGeometry *geometry, CaloSubdetectorTopology const *topology_p, int row=0, int plane=1)
 
float getESShape (const std::vector< float > &ESHits0)
 
const edm::ESHandle< EcalLaserDbService > & getLaserHandle () const
 
float SuperClusterSeedTime (const reco::SuperCluster &cluster)
 
float SuperClusterTime (const reco::SuperCluster &cluster, const edm::Event &ev)
 

Public Attributes

std::map< DetId, EcalRecHitrechits_map_
 

Protected Member Functions

void getADCToGeV (const edm::EventSetup &es)
 
const EcalRecHitCollectiongetEcalRecHitCollection (const reco::BasicCluster &cluster) const
 
void getIntercalibConstants (const edm::EventSetup &es)
 
void getLaserDbService (const edm::EventSetup &es)
 

Protected Attributes

edm::ESHandle< EcalADCToGeVConstantagc
 
const EcalRecHitCollectionebRecHits_
 
std::shared_ptr< CaloSubdetectorTopology const > ecalPS_topology_
 
const EcalRecHitCollectioneeRecHits_
 
const EcalRecHitCollectionesRecHits_
 
edm::EDGetTokenT< EcalRecHitCollectionesRHToken_
 
const CaloGeometrygeometry_
 
edm::ESHandle< EcalIntercalibConstantsical
 
const EcalIntercalibConstantMapicalMap
 
edm::ESHandle< EcalLaserDbServicelaser
 
const CaloTopologytopology_
 

Private Member Functions

void getESRecHits (const edm::Event &ev)
 

Detailed Description

Definition at line 33 of file EcalClusterLazyTools.h.

Constructor & Destructor Documentation

◆ EcalClusterLazyToolsBase() [1/2]

EcalClusterLazyToolsBase::EcalClusterLazyToolsBase ( const edm::Event ev,
const edm::EventSetup es,
edm::EDGetTokenT< EcalRecHitCollection token1,
edm::EDGetTokenT< EcalRecHitCollection token2 
)

Definition at line 25 of file EcalClusterLazyTools.cc.

29  : geometry_(&edm::get<CaloGeometry, CaloGeometryRecord>(es)),
30  topology_(&edm::get<CaloTopology, CaloTopologyRecord>(es)),
31  ebRecHits_(&edm::get(ev, token1)),
32  eeRecHits_(&edm::get(ev, token2)) {
34  getADCToGeV(es);
36 }

References getADCToGeV(), getIntercalibConstants(), and getLaserDbService().

◆ EcalClusterLazyToolsBase() [2/2]

EcalClusterLazyToolsBase::EcalClusterLazyToolsBase ( const edm::Event ev,
const edm::EventSetup es,
edm::EDGetTokenT< EcalRecHitCollection token1,
edm::EDGetTokenT< EcalRecHitCollection token2,
edm::EDGetTokenT< EcalRecHitCollection token3 
)

Definition at line 38 of file EcalClusterLazyTools.cc.

43  : geometry_(&edm::get<CaloGeometry, CaloGeometryRecord>(es)),
44  topology_(&edm::get<CaloTopology, CaloTopologyRecord>(es)),
45  ebRecHits_(&edm::get(ev, token1)),
46  eeRecHits_(&edm::get(ev, token2)) {
48  if (geometryES) {
49  ecalPS_topology_ = std::make_shared<EcalPreshowerTopology>();
50  } else {
51  edm::LogInfo("subdetector geometry not available") << "EcalPreshower geometry is missing" << std::endl;
52  }
53 
54  esRHToken_ = token3;
56 
58  getADCToGeV(es);
60 }

References DetId::Ecal, EcalPreshower, ecalPS_topology_, esRHToken_, ev, geometry_, getADCToGeV(), getESRecHits(), getIntercalibConstants(), getLaserDbService(), and CaloGeometry::getSubdetectorGeometry().

Member Function Documentation

◆ BasicClusterSeedTime()

float EcalClusterLazyToolsBase::BasicClusterSeedTime ( const reco::BasicCluster cluster)

Definition at line 127 of file EcalClusterLazyTools.cc.

127  {
129 
130  DetId id = cluster.seed();
131  EcalRecHitCollection::const_iterator theSeedHit = recHits->find(id);
132  // std::cout << "the seed of the BC has time: "
133  //<< (*theSeedHit).time()
134  //<< "and energy: " << (*theSeedHit).energy() << " collection size: " << recHits->size()
135  //<< "\n" <<std::endl; // GF debug
136 
137  return (*theSeedHit).time();
138 }

References getEcalRecHitCollection(), FastTrackerRecHitMaskProducer_cfi::recHits, and reco::CaloCluster::seed().

Referenced by SuperClusterSeedTime().

◆ BasicClusterTime()

float EcalClusterLazyToolsBase::BasicClusterTime ( const reco::BasicCluster cluster,
const edm::Event ev 
)

Definition at line 141 of file EcalClusterLazyTools.cc.

141  {
142  std::vector<std::pair<DetId, float> > clusterComponents = (cluster).hitsAndFractions();
143  //std::cout << "BC has this many components: " << clusterComponents.size() << std::endl; // GF debug
144 
146  //std::cout << "BasicClusterClusterTime - rechits are this many: " << recHits->size() << std::endl; // GF debug
147 
148  float weightedTsum = 0;
149  float sumOfWeights = 0;
150 
151  for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterComponents.begin();
152  detitr != clusterComponents.end();
153  detitr++) {
154  // EcalRecHitCollection::const_iterator theSeedHit = recHits->find (id); // trash this
155  EcalRecHitCollection::const_iterator oneHit = recHits->find((detitr->first));
156 
157  // in order to get back the ADC counts from the recHit energy, three ingredients are necessary:
158  // 1) get laser correction coefficient
159  float lasercalib = 1.;
160  lasercalib = laser->getLaserCorrection(detitr->first, ev.time());
161  // 2) get intercalibration
162  EcalIntercalibConstantMap::const_iterator icalit = icalMap->find(detitr->first);
163  EcalIntercalibConstant icalconst = 1.;
164  if (icalit != icalMap->end()) {
165  icalconst = (*icalit);
166  // std::cout << "icalconst set to: " << icalconst << std::endl;
167  } else {
168  edm::LogError("EcalClusterLazyTools")
169  << "No intercalib const found for xtal " << (detitr->first).rawId() << "bailing out";
170  assert(false);
171  }
172  // 3) get adc2GeV
173  float adcToGeV = 1.;
174  if ((detitr->first).subdetId() == EcalBarrel)
175  adcToGeV = float(agc->getEBValue());
176  else if ((detitr->first).subdetId() == EcalEndcap)
177  adcToGeV = float(agc->getEEValue());
178  float adc = 2.;
179  if (icalconst > 0 && lasercalib > 0 && adcToGeV > 0)
180  adc = (*oneHit).energy() / (icalconst * lasercalib * adcToGeV);
181 
182  // don't consider recHits with too little amplitude; take sigma_noise_total into account
183  if ((detitr->first).subdetId() == EcalBarrel && adc < (1.1 * 20))
184  continue;
185  if ((detitr->first).subdetId() == EcalEndcap && adc < (2.2 * 20))
186  continue;
187 
188  // count only on rechits whose error is trusted by the method (ratio)
189  if (!(*oneHit).isTimeErrorValid())
190  continue;
191 
192  float timeError = (*oneHit).timeError();
193  // the constant used to build timeError is largely over-estimated ; remove in quadrature 0.6 and add 0.15 back.
194  // could be prettier if value of constant term was changed at recHit production level
195  if (timeError > 0.6)
196  timeError = sqrt(timeError * timeError - 0.6 * 0.6 + 0.15 * 0.15);
197  else
198  timeError = sqrt(timeError * timeError + 0.15 * 0.15);
199 
200  // do the error weighting
201  weightedTsum += (*oneHit).time() / (timeError * timeError);
202  sumOfWeights += 1. / (timeError * timeError);
203  }
204 
205  // what if no crytal is available for weighted average?
206  if (sumOfWeights == 0)
207  return -999;
208  else
209  return (weightedTsum / sumOfWeights);
210 }

References ecalMGPA::adc(), agc, cms::cuda::assert(), EcalBarrel, EcalEndcap, EcalCondObjectContainer< T >::end(), ev, EcalCondObjectContainer< T >::find(), EcalADCToGeVConstant::getEBValue(), getEcalRecHitCollection(), EcalADCToGeVConstant::getEEValue(), EcalLaserDbService::getLaserCorrection(), icalMap, laser, FastTrackerRecHitMaskProducer_cfi::recHits, and mathSSE::sqrt().

Referenced by SuperClusterTime().

◆ eseffsirir()

float EcalClusterLazyToolsBase::eseffsirir ( const reco::SuperCluster cluster)

Definition at line 223 of file EcalClusterLazyTools.cc.

223  {
224  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.))
225  return 0.;
226 
227  if (!ecalPS_topology_)
228  return 0.;
229 
230  std::vector<float> phoESHitsIXIX =
231  getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, ecalPS_topology_.get(), 0, 1);
232  std::vector<float> phoESHitsIYIY =
233  getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, ecalPS_topology_.get(), 0, 2);
234  float phoESShapeIXIX = getESShape(phoESHitsIXIX);
235  float phoESShapeIYIY = getESShape(phoESHitsIYIY);
236 
237  return sqrt(phoESShapeIXIX * phoESShapeIXIX + phoESShapeIYIY * phoESShapeIYIY);
238 }

References ecalPS_topology_, reco::CaloCluster::eta(), geometry_, getESHits(), getESShape(), rechits_map_, mathSSE::sqrt(), reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

◆ eseffsixix()

float EcalClusterLazyToolsBase::eseffsixix ( const reco::SuperCluster cluster)

Definition at line 241 of file EcalClusterLazyTools.cc.

241  {
242  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.))
243  return 0.;
244 
245  if (!ecalPS_topology_)
246  return 0.;
247 
248  std::vector<float> phoESHitsIXIX =
249  getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, ecalPS_topology_.get(), 0, 1);
250  float phoESShapeIXIX = getESShape(phoESHitsIXIX);
251 
252  return phoESShapeIXIX;
253 }

References ecalPS_topology_, reco::CaloCluster::eta(), geometry_, getESHits(), getESShape(), rechits_map_, reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

◆ eseffsiyiy()

float EcalClusterLazyToolsBase::eseffsiyiy ( const reco::SuperCluster cluster)

Definition at line 256 of file EcalClusterLazyTools.cc.

256  {
257  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.))
258  return 0.;
259 
260  if (!ecalPS_topology_)
261  return 0.;
262 
263  std::vector<float> phoESHitsIYIY =
264  getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, ecalPS_topology_.get(), 0, 2);
265  float phoESShapeIYIY = getESShape(phoESHitsIYIY);
266 
267  return phoESShapeIYIY;
268 }

References ecalPS_topology_, reco::CaloCluster::eta(), geometry_, getESHits(), getESShape(), rechits_map_, reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

◆ getADCToGeV()

void EcalClusterLazyToolsBase::getADCToGeV ( const edm::EventSetup es)
protected

Definition at line 99 of file EcalClusterLazyTools.cc.

99  {
100  // get ADCtoGeV
102 }

References agc, edm::EventSetup::get(), and get.

Referenced by EcalClusterLazyToolsBase().

◆ getEcalEBRecHitCollection()

const EcalRecHitCollection* EcalClusterLazyToolsBase::getEcalEBRecHitCollection ( ) const
inline

Definition at line 72 of file EcalClusterLazyTools.h.

72 { return ebRecHits_; }

References ebRecHits_.

◆ getEcalEERecHitCollection()

const EcalRecHitCollection* EcalClusterLazyToolsBase::getEcalEERecHitCollection ( ) const
inline

Definition at line 73 of file EcalClusterLazyTools.h.

73 { return eeRecHits_; }

References eeRecHits_.

◆ getEcalESRecHitCollection()

const EcalRecHitCollection* EcalClusterLazyToolsBase::getEcalESRecHitCollection ( ) const
inline

Definition at line 74 of file EcalClusterLazyTools.h.

74 { return esRecHits_; }

References esRecHits_.

◆ getEcalIntercalibConstants()

const EcalIntercalibConstants& EcalClusterLazyToolsBase::getEcalIntercalibConstants ( ) const
inline

Definition at line 75 of file EcalClusterLazyTools.h.

75 { return *icalMap; }

References icalMap.

◆ getEcalRecHitCollection()

const EcalRecHitCollection * EcalClusterLazyToolsBase::getEcalRecHitCollection ( const reco::BasicCluster cluster) const
protected

Definition at line 109 of file EcalClusterLazyTools.cc.

109  {
110  if (cluster.size() == 0) {
111  throw cms::Exception("InvalidCluster") << "The cluster has no crystals!";
112  }
113  DetId id = (cluster.hitsAndFractions()[0]).first; // size is by definition > 0 -- FIXME??
114  const EcalRecHitCollection *recHits = nullptr;
115  if (id.subdetId() == EcalBarrel) {
117  } else if (id.subdetId() == EcalEndcap) {
119  } else {
120  throw cms::Exception("InvalidSubdetector")
121  << "The subdetId() " << id.subdetId() << " does not correspond to EcalBarrel neither EcalEndcap";
122  }
123  return recHits;
124 }

References ebRecHits_, EcalBarrel, EcalEndcap, eeRecHits_, Exception, dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), FastTrackerRecHitMaskProducer_cfi::recHits, and reco::CaloCluster::size().

Referenced by BasicClusterSeedTime(), BasicClusterTime(), EcalClusterLazyToolsT< ClusterTools >::covariances(), EcalClusterLazyToolsT< ClusterTools >::e1x3(), EcalClusterLazyToolsT< ClusterTools >::e1x5(), EcalClusterLazyToolsT< ClusterTools >::e2nd(), EcalClusterLazyToolsT< ClusterTools >::e2x2(), EcalClusterLazyToolsT< ClusterTools >::e2x5Bottom(), EcalClusterLazyToolsT< ClusterTools >::e2x5Left(), EcalClusterLazyToolsT< ClusterTools >::e2x5Max(), EcalClusterLazyToolsT< ClusterTools >::e2x5Right(), EcalClusterLazyToolsT< ClusterTools >::e2x5Top(), EcalClusterLazyToolsT< ClusterTools >::e3x1(), EcalClusterLazyToolsT< ClusterTools >::e3x2(), EcalClusterLazyToolsT< ClusterTools >::e3x3(), EcalClusterLazyToolsT< ClusterTools >::e4x4(), EcalClusterLazyToolsT< ClusterTools >::e5x1(), EcalClusterLazyToolsT< ClusterTools >::e5x5(), EcalClusterLazyToolsT< ClusterTools >::eBottom(), EcalClusterLazyToolsT< ClusterTools >::eLeft(), EcalClusterLazyToolsT< ClusterTools >::eMax(), EcalClusterLazyToolsT< ClusterTools >::energyBasketFractionEta(), EcalClusterLazyToolsT< ClusterTools >::energyBasketFractionPhi(), EcalClusterLazyToolsT< ClusterTools >::energyMatrix(), EcalClusterLazyToolsT< ClusterTools >::eRight(), EcalClusterLazyToolsT< ClusterTools >::eTop(), EcalClusterLazyToolsT< ClusterTools >::getMaximum(), EcalClusterLazyToolsT< ClusterTools >::lat(), EcalClusterLazyToolsT< ClusterTools >::localCovariances(), EcalClusterLazyToolsT< ClusterTools >::n5x5(), EcalClusterLazyToolsT< ClusterTools >::scLocalCovariances(), EcalClusterLazyToolsT< ClusterTools >::zernike20(), and EcalClusterLazyToolsT< ClusterTools >::zernike42().

◆ getESHits()

std::vector< float > EcalClusterLazyToolsBase::getESHits ( double  X,
double  Y,
double  Z,
const std::map< DetId, EcalRecHit > &  rechits_map,
const CaloGeometry geometry,
CaloSubdetectorTopology const *  topology_p,
int  row = 0,
int  plane = 1 
)

Definition at line 271 of file EcalClusterLazyTools.cc.

278  {
279  std::map<DetId, EcalRecHit> rechits_map = _rechits_map;
280  std::vector<float> esHits;
281 
282  const GlobalPoint point(X, Y, Z);
283 
284  const CaloSubdetectorGeometry *geometry_p = geometry->getSubdetectorGeometry(DetId::Ecal, EcalPreshower);
285 
286  DetId esId = (dynamic_cast<const EcalPreshowerGeometry *>(geometry_p))->getClosestCellInPlane(point, plane);
287  ESDetId esDetId = (esId == DetId(0)) ? ESDetId(0) : ESDetId(esId);
288 
289  std::map<DetId, EcalRecHit>::iterator it;
290  ESDetId next;
291  ESDetId strip;
292  strip = esDetId;
293 
294  EcalPreshowerNavigator theESNav(strip, topology_p);
295  theESNav.setHome(strip);
296 
297  if (row == 1) {
298  if (plane == 1 && strip != ESDetId(0))
299  strip = theESNav.north();
300  if (plane == 2 && strip != ESDetId(0))
301  strip = theESNav.east();
302  } else if (row == -1) {
303  if (plane == 1 && strip != ESDetId(0))
304  strip = theESNav.south();
305  if (plane == 2 && strip != ESDetId(0))
306  strip = theESNav.west();
307  }
308 
309  if (strip == ESDetId(0)) {
310  for (int i = 0; i < 31; ++i)
311  esHits.push_back(0);
312  } else {
313  it = rechits_map.find(strip);
314  if (it != rechits_map.end() && it->second.energy() > 1.0e-10)
315  esHits.push_back(it->second.energy());
316  else
317  esHits.push_back(0);
318  //cout<<"center : "<<strip<<" "<<it->second.energy()<<endl;
319 
320  // Front Plane
321  if (plane == 1) {
322  // east road
323  for (int i = 0; i < 15; ++i) {
324  next = theESNav.east();
325  if (next != ESDetId(0)) {
326  it = rechits_map.find(next);
327  if (it != rechits_map.end() && it->second.energy() > 1.0e-10)
328  esHits.push_back(it->second.energy());
329  else
330  esHits.push_back(0);
331  //cout<<"east "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
332  } else {
333  for (int j = i; j < 15; j++)
334  esHits.push_back(0);
335  break;
336  //cout<<"east "<<i<<" : "<<next<<" "<<0<<endl;
337  }
338  }
339 
340  // west road
341  theESNav.setHome(strip);
342  theESNav.home();
343  for (int i = 0; i < 15; ++i) {
344  next = theESNav.west();
345  if (next != ESDetId(0)) {
346  it = rechits_map.find(next);
347  if (it != rechits_map.end() && it->second.energy() > 1.0e-10)
348  esHits.push_back(it->second.energy());
349  else
350  esHits.push_back(0);
351  //cout<<"west "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
352  } else {
353  for (int j = i; j < 15; j++)
354  esHits.push_back(0);
355  break;
356  //cout<<"west "<<i<<" : "<<next<<" "<<0<<endl;
357  }
358  }
359  } // End of Front Plane
360 
361  // Rear Plane
362  if (plane == 2) {
363  // north road
364  for (int i = 0; i < 15; ++i) {
365  next = theESNav.north();
366  if (next != ESDetId(0)) {
367  it = rechits_map.find(next);
368  if (it != rechits_map.end() && it->second.energy() > 1.0e-10)
369  esHits.push_back(it->second.energy());
370  else
371  esHits.push_back(0);
372  //cout<<"north "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
373  } else {
374  for (int j = i; j < 15; j++)
375  esHits.push_back(0);
376  break;
377  //cout<<"north "<<i<<" : "<<next<<" "<<0<<endl;
378  }
379  }
380 
381  // south road
382  theESNav.setHome(strip);
383  theESNav.home();
384  for (int i = 0; i < 15; ++i) {
385  next = theESNav.south();
386  if (next != ESDetId(0)) {
387  it = rechits_map.find(next);
388  if (it != rechits_map.end() && it->second.energy() > 1.0e-10)
389  esHits.push_back(it->second.energy());
390  else
391  esHits.push_back(0);
392  //cout<<"south "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
393  } else {
394  for (int j = i; j < 15; j++)
395  esHits.push_back(0);
396  break;
397  //cout<<"south "<<i<<" : "<<next<<" "<<0<<endl;
398  }
399  }
400  } // End of Rear Plane
401  } // Fill ES RecHits
402 
403  return esHits;
404 }

References CaloNavigator< T, TOPO >::east(), DetId::Ecal, EcalPreshower, CaloNavigator< T, TOPO >::home(), mps_fire::i, dqmiolumiharvest::j, GetRecoTauVFromDQM_MC_cff::next, CaloNavigator< T, TOPO >::north(), point, CaloNavigator< T, TOPO >::setHome(), CaloNavigator< T, TOPO >::south(), digitizers_cfi::strip, CaloNavigator< T, TOPO >::west(), X, DOFs::Y, and DOFs::Z.

Referenced by eseffsirir(), eseffsixix(), and eseffsiyiy().

◆ getESRecHits()

void EcalClusterLazyToolsBase::getESRecHits ( const edm::Event ev)
private

Definition at line 62 of file EcalClusterLazyTools.cc.

62  {
64  ev.getByToken(esRHToken_, pESRecHits);
65  esRecHits_ = pESRecHits.product();
66  // make the map of rechits
67  rechits_map_.clear();
68  if (pESRecHits.isValid()) {
70  for (it = pESRecHits->begin(); it != pESRecHits->end(); ++it) {
71  // remove bad ES rechits
72  std::vector<int> badf = {
73  EcalRecHit::ESFlags::kESDead, // 1
74  EcalRecHit::ESFlags::kESTwoGoodRatios,
75  EcalRecHit::ESFlags::kESBadRatioFor12, // 5
76  EcalRecHit::ESFlags::kESBadRatioFor23Upper,
77  EcalRecHit::ESFlags::kESBadRatioFor23Lower,
78  EcalRecHit::ESFlags::kESTS1Largest,
79  EcalRecHit::ESFlags::kESTS3Largest,
80  EcalRecHit::ESFlags::kESTS3Negative, // 10
81  EcalRecHit::ESFlags::kESTS13Sigmas, // 14
82  };
83 
84  if (it->checkFlags(badf))
85  continue;
86 
87  //Make the map of DetID, EcalRecHit pairs
88  rechits_map_.insert(std::make_pair(it->id(), *it));
89  }
90  }
91 }

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), esRecHits_, esRHToken_, ev, edm::HandleBase::isValid(), edm::Handle< T >::product(), and rechits_map_.

Referenced by EcalClusterLazyToolsBase().

◆ getESShape()

float EcalClusterLazyToolsBase::getESShape ( const std::vector< float > &  ESHits0)

Definition at line 407 of file EcalClusterLazyTools.cc.

407  {
408  const int nBIN = 21;
409  float esRH[nBIN];
410  for (int idx = 0; idx < nBIN; idx++) {
411  esRH[idx] = 0.;
412  }
413 
414  for (int ibin = 0; ibin < ((nBIN + 1) / 2); ibin++) {
415  if (ibin == 0) {
416  esRH[(nBIN - 1) / 2] = ESHits0[ibin];
417  } else {
418  esRH[(nBIN - 1) / 2 + ibin] = ESHits0[ibin];
419  esRH[(nBIN - 1) / 2 - ibin] = ESHits0[ibin + 15];
420  }
421  }
422 
423  // ---- Effective Energy Deposit Width ---- //
424  double EffWidthSigmaISIS = 0.;
425  double totalEnergyISIS = 0.;
426  double EffStatsISIS = 0.;
427  for (int id_X = 0; id_X < 21; id_X++) {
428  totalEnergyISIS += esRH[id_X];
429  EffStatsISIS += esRH[id_X] * (id_X - 10) * (id_X - 10);
430  }
431  EffWidthSigmaISIS = (totalEnergyISIS > 0.) ? sqrt(fabs(EffStatsISIS / totalEnergyISIS)) : 0.;
432 
433  return EffWidthSigmaISIS;
434 }

References training_settings::idx, and mathSSE::sqrt().

Referenced by eseffsirir(), eseffsixix(), and eseffsiyiy().

◆ getIntercalibConstants()

void EcalClusterLazyToolsBase::getIntercalibConstants ( const edm::EventSetup es)
protected

Definition at line 93 of file EcalClusterLazyTools.cc.

93  {
94  // get IC's
96  icalMap = &ical->getMap();
97 }

References edm::EventSetup::get(), get, ical, and icalMap.

Referenced by EcalClusterLazyToolsBase().

◆ getLaserDbService()

void EcalClusterLazyToolsBase::getLaserDbService ( const edm::EventSetup es)
protected

Definition at line 104 of file EcalClusterLazyTools.cc.

104  {
105  // transp corrections
107 }

References edm::EventSetup::get(), get, and laser.

Referenced by EcalClusterLazyToolsBase().

◆ getLaserHandle()

const edm::ESHandle<EcalLaserDbService>& EcalClusterLazyToolsBase::getLaserHandle ( ) const
inline

Definition at line 76 of file EcalClusterLazyTools.h.

76 { return laser; }

References laser.

◆ SuperClusterSeedTime()

float EcalClusterLazyToolsBase::SuperClusterSeedTime ( const reco::SuperCluster cluster)

Definition at line 213 of file EcalClusterLazyTools.cc.

213  {
214  return BasicClusterSeedTime((*cluster.seed()));
215 }

References BasicClusterSeedTime(), and reco::SuperCluster::seed().

◆ SuperClusterTime()

float EcalClusterLazyToolsBase::SuperClusterTime ( const reco::SuperCluster cluster,
const edm::Event ev 
)

Definition at line 218 of file EcalClusterLazyTools.cc.

218  {
219  return BasicClusterTime((*cluster.seed()), ev);
220 }

References BasicClusterTime(), ev, and reco::SuperCluster::seed().

Member Data Documentation

◆ agc

edm::ESHandle<EcalADCToGeVConstant> EcalClusterLazyToolsBase::agc
protected

Definition at line 93 of file EcalClusterLazyTools.h.

Referenced by BasicClusterTime(), and getADCToGeV().

◆ ebRecHits_

const EcalRecHitCollection* EcalClusterLazyToolsBase::ebRecHits_
protected

Definition at line 83 of file EcalClusterLazyTools.h.

Referenced by getEcalEBRecHitCollection(), and getEcalRecHitCollection().

◆ ecalPS_topology_

std::shared_ptr<CaloSubdetectorTopology const> EcalClusterLazyToolsBase::ecalPS_topology_
protected

◆ eeRecHits_

const EcalRecHitCollection* EcalClusterLazyToolsBase::eeRecHits_
protected

Definition at line 84 of file EcalClusterLazyTools.h.

Referenced by getEcalEERecHitCollection(), and getEcalRecHitCollection().

◆ esRecHits_

const EcalRecHitCollection* EcalClusterLazyToolsBase::esRecHits_
protected

Definition at line 85 of file EcalClusterLazyTools.h.

Referenced by getEcalESRecHitCollection(), and getESRecHits().

◆ esRHToken_

edm::EDGetTokenT<EcalRecHitCollection> EcalClusterLazyToolsBase::esRHToken_
protected

Definition at line 87 of file EcalClusterLazyTools.h.

Referenced by EcalClusterLazyToolsBase(), and getESRecHits().

◆ geometry_

const CaloGeometry* EcalClusterLazyToolsBase::geometry_
protected

◆ ical

edm::ESHandle<EcalIntercalibConstants> EcalClusterLazyToolsBase::ical
protected

Definition at line 91 of file EcalClusterLazyTools.h.

Referenced by getIntercalibConstants().

◆ icalMap

const EcalIntercalibConstantMap* EcalClusterLazyToolsBase::icalMap
protected

◆ laser

edm::ESHandle<EcalLaserDbService> EcalClusterLazyToolsBase::laser
protected

Definition at line 94 of file EcalClusterLazyTools.h.

Referenced by BasicClusterTime(), getLaserDbService(), and getLaserHandle().

◆ rechits_map_

std::map<DetId, EcalRecHit> EcalClusterLazyToolsBase::rechits_map_

Definition at line 55 of file EcalClusterLazyTools.h.

Referenced by eseffsirir(), eseffsixix(), eseffsiyiy(), and getESRecHits().

◆ topology_

const CaloTopology* EcalClusterLazyToolsBase::topology_
protected
EcalClusterLazyToolsBase::getEcalRecHitCollection
const EcalRecHitCollection * getEcalRecHitCollection(const reco::BasicCluster &cluster) const
Definition: EcalClusterLazyTools.cc:109
EcalCondObjectContainer::end
const_iterator end() const
Definition: EcalCondObjectContainer.h:76
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
reco::CaloCluster::y
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:175
EcalClusterLazyToolsBase::BasicClusterTime
float BasicClusterTime(const reco::BasicCluster &cluster, const edm::Event &ev)
Definition: EcalClusterLazyTools.cc:141
reco::CaloCluster::size
size_t size() const
size in number of hits (e.g. in crystals for ECAL)
Definition: CaloCluster.h:187
EcalClusterLazyToolsBase::ebRecHits_
const EcalRecHitCollection * ebRecHits_
Definition: EcalClusterLazyTools.h:83
mps_fire.i
i
Definition: mps_fire.py:355
EcalClusterLazyToolsBase::BasicClusterSeedTime
float BasicClusterSeedTime(const reco::BasicCluster &cluster)
Definition: EcalClusterLazyTools.cc:127
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
EcalClusterLazyToolsBase::getADCToGeV
void getADCToGeV(const edm::EventSetup &es)
Definition: EcalClusterLazyTools.cc:99
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EcalClusterLazyToolsBase::eeRecHits_
const EcalRecHitCollection * eeRecHits_
Definition: EcalClusterLazyTools.h:84
X
#define X(str)
Definition: MuonsGrabber.cc:38
EcalClusterLazyToolsBase::rechits_map_
std::map< DetId, EcalRecHit > rechits_map_
Definition: EcalClusterLazyTools.h:55
EcalClusterLazyToolsBase::topology_
const CaloTopology * topology_
Definition: EcalClusterLazyTools.h:82
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
geometry
Definition: geometry.py:1
EcalClusterLazyToolsBase::esRecHits_
const EcalRecHitCollection * esRecHits_
Definition: EcalClusterLazyTools.h:85
EcalClusterLazyToolsBase::agc
edm::ESHandle< EcalADCToGeVConstant > agc
Definition: EcalClusterLazyTools.h:93
edm::LogInfo
Definition: MessageLogger.h:254
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
cms::cuda::assert
assert(be >=bs)
edm::SortedCollection< EcalRecHit >
reco::CaloCluster::z
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:178
ESDetId
Definition: ESDetId.h:15
EcalClusterLazyToolsBase::ical
edm::ESHandle< EcalIntercalibConstants > ical
Definition: EcalClusterLazyTools.h:91
edm::Handle
Definition: AssociativeIterator.h:50
training_settings.idx
idx
Definition: training_settings.py:16
dqmdumpme.first
first
Definition: dqmdumpme.py:55
EcalBarrel
Definition: EcalSubdetector.h:10
EcalIntercalibConstant
float EcalIntercalibConstant
Definition: EcalIntercalibConstants.h:10
DetId
Definition: DetId.h:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
EcalClusterLazyToolsBase::icalMap
const EcalIntercalibConstantMap * icalMap
Definition: EcalClusterLazyTools.h:92
EcalClusterLazyToolsBase::getESShape
float getESShape(const std::vector< float > &ESHits0)
Definition: EcalClusterLazyTools.cc:407
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EcalClusterLazyToolsBase::ecalPS_topology_
std::shared_ptr< CaloSubdetectorTopology const > ecalPS_topology_
Definition: EcalClusterLazyTools.h:89
EcalCondObjectContainer::find
const_iterator find(uint32_t rawId) const
Definition: EcalCondObjectContainer.h:53
Point3DBase< float, GlobalTag >
EcalLaserDbRecord
Definition: EcalLaserDbRecord.h:19
EcalEndcap
Definition: EcalSubdetector.h:10
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
EcalADCToGeVConstant::getEEValue
float getEEValue() const
Definition: EcalADCToGeVConstant.h:21
edm::LogError
Definition: MessageLogger.h:183
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
EcalClusterLazyToolsBase::getIntercalibConstants
void getIntercalibConstants(const edm::EventSetup &es)
Definition: EcalClusterLazyTools.cc:93
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
reco::CaloCluster::hitsAndFractions
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:210
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
edm::get
T const & get(Event const &event, InputTag const &tag) noexcept(false)
Definition: Event.h:669
DOFs::Z
Definition: AlignPCLThresholdsWriter.cc:37
EcalClusterLazyToolsBase::getLaserDbService
void getLaserDbService(const edm::EventSetup &es)
Definition: EcalClusterLazyTools.cc:104
DetId::Ecal
Definition: DetId.h:27
get
#define get
reco::CaloCluster::seed
DetId seed() const
return DetId of seed
Definition: CaloCluster.h:219
EcalClusterLazyToolsBase::laser
edm::ESHandle< EcalLaserDbService > laser
Definition: EcalClusterLazyTools.h:94
EcalClusterLazyToolsBase::esRHToken_
edm::EDGetTokenT< EcalRecHitCollection > esRHToken_
Definition: EcalClusterLazyTools.h:87
EcalPreshower
Definition: EcalSubdetector.h:10
EcalLaserDbService::getLaserCorrection
float getLaserCorrection(DetId const &xid, edm::Timestamp const &iTime) const
Definition: EcalLaserDbService.cc:26
CaloNavigator
Definition: CaloNavigator.h:7
DOFs::Y
Definition: AlignPCLThresholdsWriter.cc:37
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Exception
Definition: hltDiff.cc:246
EcalClusterLazyToolsBase::getESRecHits
void getESRecHits(const edm::Event &ev)
Definition: EcalClusterLazyTools.cc:62
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
EcalCondObjectContainer< float >::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: EcalCondObjectContainer.h:19
EcalClusterLazyToolsBase::geometry_
const CaloGeometry * geometry_
Definition: EcalClusterLazyTools.h:81
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
EcalADCToGeVConstant::getEBValue
float getEBValue() const
Definition: EcalADCToGeVConstant.h:20
EcalIntercalibConstantsRcd
Definition: EcalIntercalibConstantsRcd.h:5
EcalADCToGeVConstantRcd
Definition: EcalADCToGeVConstantRcd.h:5
reco::CaloCluster::x
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:172
EcalClusterLazyToolsBase::getESHits
std::vector< float > getESHits(double X, double Y, double Z, const std::map< DetId, EcalRecHit > &rechits_map, const CaloGeometry *geometry, CaloSubdetectorTopology const *topology_p, int row=0, int plane=1)
Definition: EcalClusterLazyTools.cc:271
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31