CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
EcalClusterLazyToolsBase Class Reference

#include <EcalClusterLazyTools.h>

Inheritance diagram for EcalClusterLazyToolsBase:
EcalClusterLazyToolsT< EcalClusterToolsImpl >

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)
 
float eseffsirir (const reco::SuperCluster &cluster)
 
float eseffsixix (const reco::SuperCluster &cluster)
 
float eseffsiyiy (const reco::SuperCluster &cluster)
 
std::vector< float > getESHits (double X, double Y, double Z, const std::map< DetId, EcalRecHit > &rechits_map, const CaloGeometry *geometry, CaloSubdetectorTopology *topology_p, int row=0, int plane=1)
 
float getESShape (const std::vector< float > &ESHits0)
 
float SuperClusterSeedTime (const reco::SuperCluster &cluster)
 
float SuperClusterTime (const reco::SuperCluster &cluster, const edm::Event &ev)
 
 ~EcalClusterLazyToolsBase ()
 

Public Attributes

std::map< DetId, EcalRecHitrechits_map_
 

Protected Member Functions

void getADCToGeV (const edm::EventSetup &es)
 
void getEBRecHits (const edm::Event &ev)
 
const EcalRecHitCollectiongetEcalRecHitCollection (const reco::BasicCluster &cluster)
 
void getEERecHits (const edm::Event &ev)
 
void getESRecHits (const edm::Event &ev)
 
void getGeometry (const edm::EventSetup &es)
 
void getIntercalibConstants (const edm::EventSetup &es)
 
void getLaserDbService (const edm::EventSetup &es)
 
void getTopology (const edm::EventSetup &es)
 

Protected Attributes

edm::ESHandle
< EcalADCToGeVConstant
agc
 
const EcalRecHitCollectionebRecHits_
 
edm::EDGetTokenT
< EcalRecHitCollection
ebRHToken_
 
const EcalRecHitCollectioneeRecHits_
 
edm::EDGetTokenT
< EcalRecHitCollection
eeRHToken_
 
const EcalRecHitCollectionesRecHits_
 
edm::EDGetTokenT
< EcalRecHitCollection
esRHToken_
 
const CaloGeometrygeometry_
 
edm::ESHandle
< EcalIntercalibConstants
ical
 
EcalIntercalibConstantMap icalMap
 
edm::ESHandle< EcalLaserDbServicelaser
 
const CaloTopologytopology_
 

Detailed Description

Definition at line 34 of file EcalClusterLazyTools.h.

Constructor & Destructor Documentation

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.

References ebRHToken_, eeRHToken_, getADCToGeV(), getEBRecHits(), getEERecHits(), getGeometry(), getIntercalibConstants(), getLaserDbService(), and getTopology().

25  {
26 
27  ebRHToken_ = token1;
28  eeRHToken_ = token2;
29 
30  getGeometry( es );
31  getTopology( es );
32  getEBRecHits( ev );
33  getEERecHits( ev );
35  getADCToGeV ( es );
36  getLaserDbService ( es );
37 }
edm::EDGetTokenT< EcalRecHitCollection > eeRHToken_
void getADCToGeV(const edm::EventSetup &es)
void getIntercalibConstants(const edm::EventSetup &es)
void getTopology(const edm::EventSetup &es)
void getEBRecHits(const edm::Event &ev)
edm::EDGetTokenT< EcalRecHitCollection > ebRHToken_
void getLaserDbService(const edm::EventSetup &es)
void getGeometry(const edm::EventSetup &es)
void getEERecHits(const edm::Event &ev)
EcalClusterLazyToolsBase::~EcalClusterLazyToolsBase ( )

Definition at line 39 of file EcalClusterLazyTools.cc.

40 {}

Member Function Documentation

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

Definition at line 140 of file EcalClusterLazyTools.cc.

References edm::SortedCollection< T, SORT >::find(), and getEcalRecHitCollection().

Referenced by SuperClusterSeedTime().

141 {
142 
143  const EcalRecHitCollection *recHits = getEcalRecHitCollection( cluster );
144 
145  DetId id = cluster.seed();
146  EcalRecHitCollection::const_iterator theSeedHit = recHits->find (id);
147  // std::cout << "the seed of the BC has time: "
148  //<< (*theSeedHit).time()
149  //<< "and energy: " << (*theSeedHit).energy() << " collection size: " << recHits->size()
150  //<< "\n" <<std::endl; // GF debug
151 
152  return (*theSeedHit).time();
153 }
const EcalRecHitCollection * getEcalRecHitCollection(const reco::BasicCluster &cluster)
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: DetId.h:18
iterator find(key_type k)
float EcalClusterLazyToolsBase::BasicClusterTime ( const reco::BasicCluster cluster,
const edm::Event ev 
)

Definition at line 157 of file EcalClusterLazyTools.cc.

References ecalMGPA::adc(), agc, EcalBarrel, EcalEndcap, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), edm::SortedCollection< T, SORT >::find(), first, getEcalRecHitCollection(), icalMap, laser, mathSSE::sqrt(), and edm::EventBase::time().

Referenced by SuperClusterTime().

158 {
159 
160  std::vector<std::pair<DetId, float> > clusterComponents = (cluster).hitsAndFractions() ;
161  //std::cout << "BC has this many components: " << clusterComponents.size() << std::endl; // GF debug
162 
163  const EcalRecHitCollection *recHits = getEcalRecHitCollection( cluster );
164  //std::cout << "BasicClusterClusterTime - rechits are this many: " << recHits->size() << std::endl; // GF debug
165 
166 
167  float weightedTsum = 0;
168  float sumOfWeights = 0;
169 
170  for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterComponents.begin(); detitr != clusterComponents.end(); detitr++ )
171  {
172  // EcalRecHitCollection::const_iterator theSeedHit = recHits->find (id); // trash this
173  EcalRecHitCollection::const_iterator oneHit = recHits->find( (detitr -> first) ) ;
174 
175  // in order to get back the ADC counts from the recHit energy, three ingredients are necessary:
176  // 1) get laser correction coefficient
177  float lasercalib = 1.;
178  lasercalib = laser->getLaserCorrection( detitr->first, ev.time());
179  // 2) get intercalibration
181  EcalIntercalibConstant icalconst = 1.;
182  if( icalit!=icalMap.end() ) {
183  icalconst = (*icalit);
184  // std::cout << "icalconst set to: " << icalconst << std::endl;
185  } else {
186  edm::LogError("EcalClusterLazyTools") << "No intercalib const found for xtal " << (detitr->first).rawId() << "bailing out";
187  assert(0);
188  }
189  // 3) get adc2GeV
190  float adcToGeV = 1.;
191  if ( (detitr -> first).subdetId() == EcalBarrel ) adcToGeV = float(agc->getEBValue());
192  else if ( (detitr -> first).subdetId() == EcalEndcap ) adcToGeV = float(agc->getEEValue());
193  float adc = 2.;
194  if (icalconst>0 && lasercalib>0 && adcToGeV>0) adc= (*oneHit).energy()/(icalconst*lasercalib*adcToGeV);
195 
196  // don't consider recHits with too little amplitude; take sigma_noise_total into account
197  if( (detitr -> first).subdetId() == EcalBarrel && adc< (1.1*20) ) continue;
198  if( (detitr -> first).subdetId() == EcalEndcap && adc< (2.2*20) ) continue;
199 
200  // count only on rechits whose error is trusted by the method (ratio)
201  if(! (*oneHit).isTimeErrorValid()) continue;
202 
203  float timeError = (*oneHit).timeError();
204  // the constant used to build timeError is largely over-estimated ; remove in quadrature 0.6 and add 0.15 back.
205  // could be prettier if value of constant term was changed at recHit production level
206  if (timeError>0.6) timeError = sqrt( timeError*timeError - 0.6*0.6 + 0.15*0.15);
207  else timeError = sqrt( timeError*timeError + 0.15*0.15);
208 
209  // do the error weighting
210  weightedTsum += (*oneHit).time() / (timeError*timeError);
211  sumOfWeights += 1. / (timeError*timeError);
212 
213  }
214 
215  // what if no crytal is available for weighted average?
216  if ( sumOfWeights ==0 ) return -999;
217  else return ( weightedTsum / sumOfWeights);
218 
219 }
int adc(sample_type sample)
get the ADC sample (12 bits)
const EcalRecHitCollection * getEcalRecHitCollection(const reco::BasicCluster &cluster)
std::vector< EcalRecHit >::const_iterator const_iterator
edm::ESHandle< EcalADCToGeVConstant > agc
T sqrt(T t)
Definition: SSEVec.h:48
bool first
Definition: L1TdeRCT.cc:75
EcalIntercalibConstantMap icalMap
std::vector< Item >::const_iterator const_iterator
iterator find(key_type k)
const_iterator find(uint32_t rawId) const
const_iterator end() const
edm::ESHandle< EcalLaserDbService > laser
edm::Timestamp time() const
Definition: EventBase.h:57
float EcalIntercalibConstant
float EcalClusterLazyToolsBase::eseffsirir ( const reco::SuperCluster cluster)

Definition at line 239 of file EcalClusterLazyTools.cc.

References DetId::Ecal, EcalPreshower, reco::CaloCluster::eta(), geometry_, getESHits(), getESShape(), CaloGeometry::getSubdetectorGeometry(), rechits_map_, mathSSE::sqrt(), reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

240 {
241  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.;
242 
244  CaloSubdetectorTopology *topology_p = 0;
245  if (geometryES) topology_p = new EcalPreshowerTopology(geometry_);
246 
247  std::vector<float> phoESHitsIXIX = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, topology_p, 0, 1);
248  std::vector<float> phoESHitsIYIY = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, topology_p, 0, 2);
249  float phoESShapeIXIX = getESShape(phoESHitsIXIX);
250  float phoESShapeIYIY = getESShape(phoESHitsIYIY);
251 
252  return sqrt(phoESShapeIXIX*phoESShapeIXIX + phoESShapeIYIY*phoESShapeIYIY);
253 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const CaloGeometry * geometry_
float getESShape(const std::vector< float > &ESHits0)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:158
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:161
std::vector< float > getESHits(double X, double Y, double Z, const std::map< DetId, EcalRecHit > &rechits_map, const CaloGeometry *geometry, CaloSubdetectorTopology *topology_p, int row=0, int plane=1)
T sqrt(T t)
Definition: SSEVec.h:48
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:152
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:155
std::map< DetId, EcalRecHit > rechits_map_
float EcalClusterLazyToolsBase::eseffsixix ( const reco::SuperCluster cluster)

Definition at line 256 of file EcalClusterLazyTools.cc.

References DetId::Ecal, EcalPreshower, reco::CaloCluster::eta(), geometry_, getESHits(), getESShape(), CaloGeometry::getSubdetectorGeometry(), rechits_map_, reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

257 {
258  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.;
259 
261  CaloSubdetectorTopology *topology_p = 0;
262  if (geometryES) topology_p = new EcalPreshowerTopology(geometry_);
263 
264  std::vector<float> phoESHitsIXIX = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, topology_p, 0, 1);
265  float phoESShapeIXIX = getESShape(phoESHitsIXIX);
266 
267  return phoESShapeIXIX;
268 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const CaloGeometry * geometry_
float getESShape(const std::vector< float > &ESHits0)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:158
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:161
std::vector< float > getESHits(double X, double Y, double Z, const std::map< DetId, EcalRecHit > &rechits_map, const CaloGeometry *geometry, CaloSubdetectorTopology *topology_p, int row=0, int plane=1)
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:152
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:155
std::map< DetId, EcalRecHit > rechits_map_
float EcalClusterLazyToolsBase::eseffsiyiy ( const reco::SuperCluster cluster)

Definition at line 271 of file EcalClusterLazyTools.cc.

References DetId::Ecal, EcalPreshower, reco::CaloCluster::eta(), geometry_, getESHits(), getESShape(), CaloGeometry::getSubdetectorGeometry(), rechits_map_, reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

272 {
273  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.;
274 
276  CaloSubdetectorTopology *topology_p = 0;
277  if (geometryES) topology_p = new EcalPreshowerTopology(geometry_);
278 
279  std::vector<float> phoESHitsIYIY = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, topology_p, 0, 2);
280  float phoESShapeIYIY = getESShape(phoESHitsIYIY);
281 
282  return phoESShapeIYIY;
283 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const CaloGeometry * geometry_
float getESShape(const std::vector< float > &ESHits0)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:158
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:161
std::vector< float > getESHits(double X, double Y, double Z, const std::map< DetId, EcalRecHit > &rechits_map, const CaloGeometry *geometry, CaloSubdetectorTopology *topology_p, int row=0, int plane=1)
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:152
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:155
std::map< DetId, EcalRecHit > rechits_map_
void EcalClusterLazyToolsBase::getADCToGeV ( const edm::EventSetup es)
protected

Definition at line 107 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

108 {
109  // get ADCtoGeV
110  es.get<EcalADCToGeVConstantRcd>().get(agc);
111 }
edm::ESHandle< EcalADCToGeVConstant > agc
const T & get() const
Definition: EventSetup.h:55
void EcalClusterLazyToolsBase::getEBRecHits ( const edm::Event ev)
protected

Definition at line 54 of file EcalClusterLazyTools.cc.

References ebRecHits_, ebRHToken_, edm::Event::getByToken(), and edm::Handle< T >::product().

Referenced by EcalClusterLazyToolsBase().

54  {
56  ev.getByToken( ebRHToken_, pEBRecHits );
57  ebRecHits_ = pEBRecHits.product();
58 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
const EcalRecHitCollection * ebRecHits_
edm::EDGetTokenT< EcalRecHitCollection > ebRHToken_
T const * product() const
Definition: Handle.h:81
const EcalRecHitCollection * EcalClusterLazyToolsBase::getEcalRecHitCollection ( const reco::BasicCluster cluster)
protected

Definition at line 121 of file EcalClusterLazyTools.cc.

References ebRecHits_, EcalBarrel, EcalEndcap, eeRecHits_, edm::hlt::Exception, and first.

Referenced by BasicClusterSeedTime(), and BasicClusterTime().

122 {
123  if ( cluster.size() == 0 ) {
124  throw cms::Exception("InvalidCluster") << "The cluster has no crystals!";
125  }
126  DetId id = (cluster.hitsAndFractions()[0]).first; // size is by definition > 0 -- FIXME??
127  const EcalRecHitCollection *recHits = 0;
128  if ( id.subdetId() == EcalBarrel ) {
129  recHits = ebRecHits_;
130  } else if ( id.subdetId() == EcalEndcap ) {
131  recHits = eeRecHits_;
132  } else {
133  throw cms::Exception("InvalidSubdetector") << "The subdetId() " << id.subdetId() << " does not correspond to EcalBarrel neither EcalEndcap";
134  }
135  return recHits;
136 }
const EcalRecHitCollection * ebRecHits_
bool first
Definition: L1TdeRCT.cc:75
Definition: DetId.h:18
const EcalRecHitCollection * eeRecHits_
void EcalClusterLazyToolsBase::getEERecHits ( const edm::Event ev)
protected

Definition at line 60 of file EcalClusterLazyTools.cc.

References eeRecHits_, eeRHToken_, edm::Event::getByToken(), and edm::Handle< T >::product().

Referenced by EcalClusterLazyToolsBase().

60  {
62  ev.getByToken( eeRHToken_, pEERecHits );
63  eeRecHits_ = pEERecHits.product();
64 }
edm::EDGetTokenT< EcalRecHitCollection > eeRHToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
T const * product() const
Definition: Handle.h:81
const EcalRecHitCollection * eeRecHits_
std::vector< float > EcalClusterLazyToolsBase::getESHits ( double  X,
double  Y,
double  Z,
const std::map< DetId, EcalRecHit > &  rechits_map,
const CaloGeometry geometry,
CaloSubdetectorTopology topology_p,
int  row = 0,
int  plane = 1 
)

Definition at line 286 of file EcalClusterLazyTools.cc.

References DetId::Ecal, EcalPreshower, CaloGeometry::getSubdetectorGeometry(), i, j, GetRecoTauVFromDQM_MC_cff::next, and point.

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

287 {
288  std::map<DetId, EcalRecHit> rechits_map = _rechits_map;
289  std::vector<float> esHits;
290 
291  const GlobalPoint point(X,Y,Z);
292 
293  const CaloSubdetectorGeometry *geometry_p ;
294  geometry_p = geometry->getSubdetectorGeometry (DetId::Ecal,EcalPreshower) ;
295 
296  DetId esId = (dynamic_cast<const EcalPreshowerGeometry*>(geometry_p))->getClosestCellInPlane(point, plane);
297  ESDetId esDetId = (esId == DetId(0)) ? ESDetId(0) : ESDetId(esId);
298 
299  std::map<DetId, EcalRecHit>::iterator it;
300  ESDetId next;
301  ESDetId strip;
302  strip = esDetId;
303 
304  EcalPreshowerNavigator theESNav(strip, topology_p);
305  theESNav.setHome(strip);
306 
307  if (row == 1) {
308  if (plane==1 && strip != ESDetId(0)) strip = theESNav.north();
309  if (plane==2 && strip != ESDetId(0)) strip = theESNav.east();
310  } else if (row == -1) {
311  if (plane==1 && strip != ESDetId(0)) strip = theESNav.south();
312  if (plane==2 && strip != ESDetId(0)) strip = theESNav.west();
313  }
314 
315 
316  if (strip == ESDetId(0)) {
317  for (int i=0; i<31; ++i) esHits.push_back(0);
318  } else {
319  it = rechits_map.find(strip);
320  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
321  else esHits.push_back(0);
322  //cout<<"center : "<<strip<<" "<<it->second.energy()<<endl;
323 
324  // Front Plane
325  if (plane==1) {
326  // east road
327  for (int i=0; i<15; ++i) {
328  next = theESNav.east();
329  if (next != ESDetId(0)) {
330  it = rechits_map.find(next);
331  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
332  else esHits.push_back(0);
333  //cout<<"east "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
334  } else {
335  for (int j=i; j<15; j++) esHits.push_back(0);
336  break;
337  //cout<<"east "<<i<<" : "<<next<<" "<<0<<endl;
338  }
339  }
340 
341  // west road
342  theESNav.setHome(strip);
343  theESNav.home();
344  for (int i=0; i<15; ++i) {
345  next = theESNav.west();
346  if (next != ESDetId(0)) {
347  it = rechits_map.find(next);
348  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
349  else esHits.push_back(0);
350  //cout<<"west "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
351  } else {
352  for (int j=i; j<15; j++) esHits.push_back(0);
353  break;
354  //cout<<"west "<<i<<" : "<<next<<" "<<0<<endl;
355  }
356  }
357  } // End of Front Plane
358 
359  // Rear Plane
360  if (plane==2) {
361  // north road
362  for (int i=0; i<15; ++i) {
363  next = theESNav.north();
364  if (next != ESDetId(0)) {
365  it = rechits_map.find(next);
366  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
367  else esHits.push_back(0);
368  //cout<<"north "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
369  } else {
370  for (int j=i; j<15; j++) esHits.push_back(0);
371  break;
372  //cout<<"north "<<i<<" : "<<next<<" "<<0<<endl;
373  }
374  }
375 
376  // south road
377  theESNav.setHome(strip);
378  theESNav.home();
379  for (int i=0; i<15; ++i) {
380  next = theESNav.south();
381  if (next != ESDetId(0)) {
382  it = rechits_map.find(next);
383  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
384  else esHits.push_back(0);
385  //cout<<"south "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
386  } else {
387  for (int j=i; j<15; j++) esHits.push_back(0);
388  break;
389  //cout<<"south "<<i<<" : "<<next<<" "<<0<<endl;
390  }
391  }
392  } // End of Rear Plane
393  } // Fill ES RecHits
394 
395  return esHits;
396 }
const double Z[kNumberCalorimeter]
CaloNavigator< ESDetId > EcalPreshowerNavigator
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
#define X(str)
Definition: MuonsGrabber.cc:48
int j
Definition: DBlmapReader.cc:9
Definition: DetId.h:18
*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
void EcalClusterLazyToolsBase::getESRecHits ( const edm::Event ev)
protected

Definition at line 66 of file EcalClusterLazyTools.cc.

References esRecHits_, esRHToken_, edm::Event::getByToken(), edm::HandleBase::isValid(), edm::Handle< T >::product(), and rechits_map_.

66  {
68  ev.getByToken( esRHToken_, pESRecHits );
69  esRecHits_ = pESRecHits.product();
70  // make the map of rechits
71  rechits_map_.clear();
72  if (pESRecHits.isValid()) {
74  for (it = pESRecHits->begin(); it != pESRecHits->end(); ++it) {
75  // remove bad ES rechits
76  std::vector<int> badf = {
77  EcalRecHit::ESFlags::kESDead, // 1
78  EcalRecHit::ESFlags::kESTwoGoodRatios,
79  EcalRecHit::ESFlags::kESBadRatioFor12, // 5
80  EcalRecHit::ESFlags::kESBadRatioFor23Upper,
81  EcalRecHit::ESFlags::kESBadRatioFor23Lower,
82  EcalRecHit::ESFlags::kESTS1Largest,
83  EcalRecHit::ESFlags::kESTS3Largest,
84  EcalRecHit::ESFlags::kESTS3Negative, // 10
85  EcalRecHit::ESFlags::kESTS13Sigmas, // 14
86  };
87 
88  if (it->checkFlags(badf)) continue;
89 
90  //Make the map of DetID, EcalRecHit pairs
91  rechits_map_.insert(std::make_pair(it->id(), *it));
92  }
93  }
94 }
const EcalRecHitCollection * esRecHits_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< EcalRecHit >::const_iterator const_iterator
bool isValid() const
Definition: HandleBase.h:76
edm::EDGetTokenT< EcalRecHitCollection > esRHToken_
T const * product() const
Definition: Handle.h:81
std::map< DetId, EcalRecHit > rechits_map_
float EcalClusterLazyToolsBase::getESShape ( const std::vector< float > &  ESHits0)

Definition at line 400 of file EcalClusterLazyTools.cc.

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

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

401 {
402  const int nBIN = 21;
403  float esRH[nBIN];
404  for (int idx=0; idx<nBIN; idx++) {
405  esRH[idx] = 0.;
406  }
407 
408  for(int ibin=0; ibin<((nBIN+1)/2); ibin++) {
409  if (ibin==0) {
410  esRH[(nBIN-1)/2] = ESHits0[ibin];
411  } else {
412  esRH[(nBIN-1)/2+ibin] = ESHits0[ibin];
413  esRH[(nBIN-1)/2-ibin] = ESHits0[ibin+15];
414  }
415  }
416 
417  // ---- Effective Energy Deposit Width ---- //
418  double EffWidthSigmaISIS = 0.;
419  double totalEnergyISIS = 0.;
420  double EffStatsISIS = 0.;
421  for (int id_X=0; id_X<21; id_X++) {
422  totalEnergyISIS += esRH[id_X];
423  EffStatsISIS += esRH[id_X]*(id_X-10)*(id_X-10);
424  }
425  EffWidthSigmaISIS = (totalEnergyISIS>0.) ? sqrt(fabs(EffStatsISIS / totalEnergyISIS)) : 0.;
426 
427  return EffWidthSigmaISIS;
428 }
T sqrt(T t)
Definition: SSEVec.h:48
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void EcalClusterLazyToolsBase::getGeometry ( const edm::EventSetup es)
protected

Definition at line 42 of file EcalClusterLazyTools.cc.

References geometry_, edm::EventSetup::get(), and edm::ESHandle< class >::product().

Referenced by EcalClusterLazyToolsBase().

42  {
44  es.get<CaloGeometryRecord>().get(pGeometry);
45  geometry_ = pGeometry.product();
46 }
const CaloGeometry * geometry_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void EcalClusterLazyToolsBase::getIntercalibConstants ( const edm::EventSetup es)
protected

Definition at line 98 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

99 {
100  // get IC's
102  icalMap = ical->getMap();
103 }
edm::ESHandle< EcalIntercalibConstants > ical
EcalIntercalibConstantMap icalMap
const T & get() const
Definition: EventSetup.h:55
void EcalClusterLazyToolsBase::getLaserDbService ( const edm::EventSetup es)
protected

Definition at line 115 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

115  {
116  // transp corrections
117  es.get<EcalLaserDbRecord>().get(laser);
118 }
const T & get() const
Definition: EventSetup.h:55
edm::ESHandle< EcalLaserDbService > laser
void EcalClusterLazyToolsBase::getTopology ( const edm::EventSetup es)
protected

Definition at line 48 of file EcalClusterLazyTools.cc.

References edm::EventSetup::get(), edm::ESHandle< class >::product(), and topology_.

Referenced by EcalClusterLazyToolsBase().

48  {
50  es.get<CaloTopologyRecord>().get(pTopology);
51  topology_ = pTopology.product();
52 }
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
const CaloTopology * topology_
float EcalClusterLazyToolsBase::SuperClusterSeedTime ( const reco::SuperCluster cluster)

Definition at line 223 of file EcalClusterLazyTools.cc.

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

223  {
224 
225  return BasicClusterSeedTime ( (*cluster.seed()) );
226 
227 }
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
float BasicClusterSeedTime(const reco::BasicCluster &cluster)
float EcalClusterLazyToolsBase::SuperClusterTime ( const reco::SuperCluster cluster,
const edm::Event ev 
)

Definition at line 231 of file EcalClusterLazyTools.cc.

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

231  {
232 
233  return BasicClusterTime ( (*cluster.seed()) , ev);
234 
235 }
float BasicClusterTime(const reco::BasicCluster &cluster, const edm::Event &ev)
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66

Member Data Documentation

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

Definition at line 83 of file EcalClusterLazyTools.h.

Referenced by BasicClusterTime(), and getADCToGeV().

const EcalRecHitCollection* EcalClusterLazyToolsBase::ebRecHits_
protected

Definition at line 74 of file EcalClusterLazyTools.h.

Referenced by getEBRecHits(), and getEcalRecHitCollection().

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

Definition at line 78 of file EcalClusterLazyTools.h.

Referenced by EcalClusterLazyToolsBase(), and getEBRecHits().

const EcalRecHitCollection* EcalClusterLazyToolsBase::eeRecHits_
protected

Definition at line 75 of file EcalClusterLazyTools.h.

Referenced by getEcalRecHitCollection(), and getEERecHits().

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

Definition at line 78 of file EcalClusterLazyTools.h.

Referenced by EcalClusterLazyToolsBase(), and getEERecHits().

const EcalRecHitCollection* EcalClusterLazyToolsBase::esRecHits_
protected

Definition at line 76 of file EcalClusterLazyTools.h.

Referenced by getESRecHits().

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

Definition at line 78 of file EcalClusterLazyTools.h.

Referenced by getESRecHits().

const CaloGeometry* EcalClusterLazyToolsBase::geometry_
protected

Definition at line 72 of file EcalClusterLazyTools.h.

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

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

Definition at line 81 of file EcalClusterLazyTools.h.

Referenced by getIntercalibConstants().

EcalIntercalibConstantMap EcalClusterLazyToolsBase::icalMap
protected

Definition at line 82 of file EcalClusterLazyTools.h.

Referenced by BasicClusterTime(), and getIntercalibConstants().

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

Definition at line 84 of file EcalClusterLazyTools.h.

Referenced by BasicClusterTime(), and getLaserDbService().

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

Definition at line 50 of file EcalClusterLazyTools.h.

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

const CaloTopology* EcalClusterLazyToolsBase::topology_
protected

Definition at line 73 of file EcalClusterLazyTools.h.

Referenced by getTopology().