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, const edm::InputTag &redEBRecHits, const edm::InputTag &redEERecHits, const edm::ParameterSet &config)
 
 EcalClusterLazyToolsBase (const edm::Event &ev, const edm::EventSetup &es, const edm::InputTag &redEBRecHits, const edm::InputTag &redEERecHits)
 
 EcalClusterLazyToolsBase (const edm::Event &ev, const edm::EventSetup &es, const edm::InputTag &redEBRecHits, const edm::InputTag &redEERecHits, const edm::InputTag &redESRecHits)
 
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 edm::InputTag &redEBRecHits)
 
const EcalRecHitCollectiongetEcalRecHitCollection (const reco::BasicCluster &cluster)
 
void getEERecHits (const edm::Event &ev, const edm::InputTag &redEERecHits)
 
void getESRecHits (const edm::Event &ev, const edm::InputTag &redESRecHits)
 
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_
 
const EcalRecHitCollectioneeRecHits_
 
const EcalRecHitCollectionesRecHits_
 
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,
const edm::InputTag redEBRecHits,
const edm::InputTag redEERecHits,
const edm::ParameterSet config 
)

Definition at line 61 of file EcalClusterLazyTools.cc.

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

62 {
63  getGeometry( es );
64  getTopology( es );
65  getEBRecHits( ev, redEBRecHits );
66  getEERecHits( ev, redEERecHits );
68  getADCToGeV ( es );
69  getLaserDbService ( es );
70 
71 // edm::ESHandle<EcalSeverityLevelAlgo> sevLv;
72 // es.get<EcalSeverityLevelAlgoRcd>().get(sevLv);
73 
74 }
void getADCToGeV(const edm::EventSetup &es)
void getIntercalibConstants(const edm::EventSetup &es)
void getTopology(const edm::EventSetup &es)
void getEERecHits(const edm::Event &ev, const edm::InputTag &redEERecHits)
void getLaserDbService(const edm::EventSetup &es)
void getGeometry(const edm::EventSetup &es)
void getEBRecHits(const edm::Event &ev, const edm::InputTag &redEBRecHits)
EcalClusterLazyToolsBase::EcalClusterLazyToolsBase ( const edm::Event ev,
const edm::EventSetup es,
const edm::InputTag redEBRecHits,
const edm::InputTag redEERecHits 
)

Definition at line 26 of file EcalClusterLazyTools.cc.

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

27 {
28  getGeometry( es );
29  getTopology( es );
30  getEBRecHits( ev, redEBRecHits );
31  getEERecHits( ev, redEERecHits );
33  getADCToGeV ( es );
34  getLaserDbService ( es );
35 
36  //AA
37  //Flags and Severities to be excluded from photon calculations
38 /*
39  const std::vector<std::string> flagnames =
40  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcluded");
41 
42  flagsexcl_=
43  StringToEnumValue<EcalRecHit::Flags>(flagnames);
44 
45  const std::vector<std::string> severitynames =
46  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcluded");
47 
48  severitiesexcl_=
49  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynames);
50  //AA
51 
52  //AA
53 */
54  //Get the severity level object
55 // edm::ESHandle<EcalSeverityLevelAlgo> sevLv;
56 // es.get<EcalSeverityLevelAlgoRcd>().get(sevLv);
57  //
58 
59 }
void getADCToGeV(const edm::EventSetup &es)
void getIntercalibConstants(const edm::EventSetup &es)
void getTopology(const edm::EventSetup &es)
void getEERecHits(const edm::Event &ev, const edm::InputTag &redEERecHits)
void getLaserDbService(const edm::EventSetup &es)
void getGeometry(const edm::EventSetup &es)
void getEBRecHits(const edm::Event &ev, const edm::InputTag &redEBRecHits)
EcalClusterLazyToolsBase::EcalClusterLazyToolsBase ( const edm::Event ev,
const edm::EventSetup es,
const edm::InputTag redEBRecHits,
const edm::InputTag redEERecHits,
const edm::InputTag redESRecHits 
)

Definition at line 76 of file EcalClusterLazyTools.cc.

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

77 {
78  getGeometry( es );
79  getTopology( es );
80  getEBRecHits( ev, redEBRecHits );
81  getEERecHits( ev, redEERecHits );
82  getESRecHits( ev, redESRecHits );
84  getADCToGeV ( es );
85  getLaserDbService ( es );
86 
87 }
void getADCToGeV(const edm::EventSetup &es)
void getIntercalibConstants(const edm::EventSetup &es)
void getESRecHits(const edm::Event &ev, const edm::InputTag &redESRecHits)
void getTopology(const edm::EventSetup &es)
void getEERecHits(const edm::Event &ev, const edm::InputTag &redEERecHits)
void getLaserDbService(const edm::EventSetup &es)
void getGeometry(const edm::EventSetup &es)
void getEBRecHits(const edm::Event &ev, const edm::InputTag &redEBRecHits)
EcalClusterLazyToolsBase::~EcalClusterLazyToolsBase ( )

Definition at line 89 of file EcalClusterLazyTools.cc.

90 {
91 }

Member Function Documentation

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

Definition at line 195 of file EcalClusterLazyTools.cc.

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

Referenced by SuperClusterSeedTime().

196 {
197 
198  const EcalRecHitCollection *recHits = getEcalRecHitCollection( cluster );
199 
200  DetId id = cluster.seed();
201  EcalRecHitCollection::const_iterator theSeedHit = recHits->find (id);
202  // std::cout << "the seed of the BC has time: "
203  //<< (*theSeedHit).time()
204  //<< "and energy: " << (*theSeedHit).energy() << " collection size: " << recHits->size()
205  //<< "\n" <<std::endl; // GF debug
206 
207  return (*theSeedHit).time();
208 }
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 212 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().

213 {
214 
215  std::vector<std::pair<DetId, float> > clusterComponents = (cluster).hitsAndFractions() ;
216  //std::cout << "BC has this many components: " << clusterComponents.size() << std::endl; // GF debug
217 
218  const EcalRecHitCollection *recHits = getEcalRecHitCollection( cluster );
219  //std::cout << "BasicClusterClusterTime - rechits are this many: " << recHits->size() << std::endl; // GF debug
220 
221 
222  float weightedTsum = 0;
223  float sumOfWeights = 0;
224 
225  for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterComponents.begin(); detitr != clusterComponents.end(); detitr++ )
226  {
227  // EcalRecHitCollection::const_iterator theSeedHit = recHits->find (id); // trash this
228  EcalRecHitCollection::const_iterator oneHit = recHits->find( (detitr -> first) ) ;
229 
230  // in order to get back the ADC counts from the recHit energy, three ingredients are necessary:
231  // 1) get laser correction coefficient
232  float lasercalib = 1.;
233  lasercalib = laser->getLaserCorrection( detitr->first, ev.time());
234  // 2) get intercalibration
236  EcalIntercalibConstant icalconst = 1.;
237  if( icalit!=icalMap.end() ) {
238  icalconst = (*icalit);
239  // std::cout << "icalconst set to: " << icalconst << std::endl;
240  } else {
241  edm::LogError("EcalClusterLazyTools") << "No intercalib const found for xtal " << (detitr->first).rawId() << "bailing out";
242  assert(0);
243  }
244  // 3) get adc2GeV
245  float adcToGeV = 1.;
246  if ( (detitr -> first).subdetId() == EcalBarrel ) adcToGeV = float(agc->getEBValue());
247  else if ( (detitr -> first).subdetId() == EcalEndcap ) adcToGeV = float(agc->getEEValue());
248  float adc = 2.;
249  if (icalconst>0 && lasercalib>0 && adcToGeV>0) adc= (*oneHit).energy()/(icalconst*lasercalib*adcToGeV);
250 
251  // don't consider recHits with too little amplitude; take sigma_noise_total into account
252  if( (detitr -> first).subdetId() == EcalBarrel && adc< (1.1*20) ) continue;
253  if( (detitr -> first).subdetId() == EcalEndcap && adc< (2.2*20) ) continue;
254 
255  // count only on rechits whose error is trusted by the method (ratio)
256  if(! (*oneHit).isTimeErrorValid()) continue;
257 
258  float timeError = (*oneHit).timeError();
259  // the constant used to build timeError is largely over-estimated ; remove in quadrature 0.6 and add 0.15 back.
260  // could be prettier if value of constant term was changed at recHit production level
261  if (timeError>0.6) timeError = sqrt( timeError*timeError - 0.6*0.6 + 0.15*0.15);
262  else timeError = sqrt( timeError*timeError + 0.15*0.15);
263 
264  // do the error weighting
265  weightedTsum += (*oneHit).time() / (timeError*timeError);
266  sumOfWeights += 1. / (timeError*timeError);
267 
268  }
269 
270  // what if no crytal is available for weighted average?
271  if ( sumOfWeights ==0 ) return -999;
272  else return ( weightedTsum / sumOfWeights);
273 
274 }
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:79
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 294 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().

295 {
296  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.;
297 
299  CaloSubdetectorTopology *topology_p = 0;
300  if (geometryES) topology_p = new EcalPreshowerTopology(geometry_);
301 
302  std::vector<float> phoESHitsIXIX = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, topology_p, 0, 1);
303  std::vector<float> phoESHitsIYIY = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, topology_p, 0, 2);
304  float phoESShapeIXIX = getESShape(phoESHitsIXIX);
305  float phoESShapeIYIY = getESShape(phoESHitsIYIY);
306 
307  return sqrt(phoESShapeIXIX*phoESShapeIXIX + phoESShapeIYIY*phoESShapeIYIY);
308 }
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 311 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().

312 {
313  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.;
314 
316  CaloSubdetectorTopology *topology_p = 0;
317  if (geometryES) topology_p = new EcalPreshowerTopology(geometry_);
318 
319  std::vector<float> phoESHitsIXIX = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, topology_p, 0, 1);
320  float phoESShapeIXIX = getESShape(phoESHitsIXIX);
321 
322  return phoESShapeIXIX;
323 }
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 326 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().

327 {
328  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.;
329 
331  CaloSubdetectorTopology *topology_p = 0;
332  if (geometryES) topology_p = new EcalPreshowerTopology(geometry_);
333 
334  std::vector<float> phoESHitsIYIY = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, topology_p, 0, 2);
335  float phoESShapeIYIY = getESShape(phoESHitsIYIY);
336 
337  return phoESShapeIYIY;
338 }
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 162 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

163 {
164  // get ADCtoGeV
165  es.get<EcalADCToGeVConstantRcd>().get(agc);
166 }
edm::ESHandle< EcalADCToGeVConstant > agc
const T & get() const
Definition: EventSetup.h:55
void EcalClusterLazyToolsBase::getEBRecHits ( const edm::Event ev,
const edm::InputTag redEBRecHits 
)
protected

Definition at line 113 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

114 {
116  ev.getByLabel( redEBRecHits, pEBRecHits );
117  ebRecHits_ = pEBRecHits.product();
118 }
const EcalRecHitCollection * ebRecHits_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
T const * product() const
Definition: Handle.h:81
const EcalRecHitCollection * EcalClusterLazyToolsBase::getEcalRecHitCollection ( const reco::BasicCluster cluster)
protected

Definition at line 176 of file EcalClusterLazyTools.cc.

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

Referenced by BasicClusterSeedTime(), and BasicClusterTime().

177 {
178  if ( cluster.size() == 0 ) {
179  throw cms::Exception("InvalidCluster") << "The cluster has no crystals!";
180  }
181  DetId id = (cluster.hitsAndFractions()[0]).first; // size is by definition > 0 -- FIXME??
182  const EcalRecHitCollection *recHits = 0;
183  if ( id.subdetId() == EcalBarrel ) {
184  recHits = ebRecHits_;
185  } else if ( id.subdetId() == EcalEndcap ) {
186  recHits = eeRecHits_;
187  } else {
188  throw cms::Exception("InvalidSubdetector") << "The subdetId() " << id.subdetId() << " does not correspond to EcalBarrel neither EcalEndcap";
189  }
190  return recHits;
191 }
const EcalRecHitCollection * ebRecHits_
bool first
Definition: L1TdeRCT.cc:79
Definition: DetId.h:18
const EcalRecHitCollection * eeRecHits_
void EcalClusterLazyToolsBase::getEERecHits ( const edm::Event ev,
const edm::InputTag redEERecHits 
)
protected

Definition at line 122 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

123 {
125  ev.getByLabel( redEERecHits, pEERecHits );
126  eeRecHits_ = pEERecHits.product();
127 }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
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 341 of file EcalClusterLazyTools.cc.

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

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

342 {
343  std::map<DetId, EcalRecHit> rechits_map = _rechits_map;
344  std::vector<float> esHits;
345 
346  const GlobalPoint point(X,Y,Z);
347 
348  const CaloSubdetectorGeometry *geometry_p ;
349  geometry_p = geometry->getSubdetectorGeometry (DetId::Ecal,EcalPreshower) ;
350 
351  DetId esId = (dynamic_cast<const EcalPreshowerGeometry*>(geometry_p))->getClosestCellInPlane(point, plane);
352  ESDetId esDetId = (esId == DetId(0)) ? ESDetId(0) : ESDetId(esId);
353 
354  std::map<DetId, EcalRecHit>::iterator it;
355  ESDetId next;
356  ESDetId strip;
357  strip = esDetId;
358 
359  EcalPreshowerNavigator theESNav(strip, topology_p);
360  theESNav.setHome(strip);
361 
362  if (row == 1) {
363  if (plane==1 && strip != ESDetId(0)) strip = theESNav.north();
364  if (plane==2 && strip != ESDetId(0)) strip = theESNav.east();
365  } else if (row == -1) {
366  if (plane==1 && strip != ESDetId(0)) strip = theESNav.south();
367  if (plane==2 && strip != ESDetId(0)) strip = theESNav.west();
368  }
369 
370 
371  if (strip == ESDetId(0)) {
372  for (int i=0; i<31; ++i) esHits.push_back(0);
373  } else {
374  it = rechits_map.find(strip);
375  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
376  else esHits.push_back(0);
377  //cout<<"center : "<<strip<<" "<<it->second.energy()<<endl;
378 
379  // Front Plane
380  if (plane==1) {
381  // east road
382  for (int i=0; i<15; ++i) {
383  next = theESNav.east();
384  if (next != ESDetId(0)) {
385  it = rechits_map.find(next);
386  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
387  else esHits.push_back(0);
388  //cout<<"east "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
389  } else {
390  for (int j=i; j<15; j++) esHits.push_back(0);
391  break;
392  //cout<<"east "<<i<<" : "<<next<<" "<<0<<endl;
393  }
394  }
395 
396  // west road
397  theESNav.setHome(strip);
398  theESNav.home();
399  for (int i=0; i<15; ++i) {
400  next = theESNav.west();
401  if (next != ESDetId(0)) {
402  it = rechits_map.find(next);
403  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
404  else esHits.push_back(0);
405  //cout<<"west "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
406  } else {
407  for (int j=i; j<15; j++) esHits.push_back(0);
408  break;
409  //cout<<"west "<<i<<" : "<<next<<" "<<0<<endl;
410  }
411  }
412  } // End of Front Plane
413 
414  // Rear Plane
415  if (plane==2) {
416  // north road
417  for (int i=0; i<15; ++i) {
418  next = theESNav.north();
419  if (next != ESDetId(0)) {
420  it = rechits_map.find(next);
421  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
422  else esHits.push_back(0);
423  //cout<<"north "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
424  } else {
425  for (int j=i; j<15; j++) esHits.push_back(0);
426  break;
427  //cout<<"north "<<i<<" : "<<next<<" "<<0<<endl;
428  }
429  }
430 
431  // south road
432  theESNav.setHome(strip);
433  theESNav.home();
434  for (int i=0; i<15; ++i) {
435  next = theESNav.south();
436  if (next != ESDetId(0)) {
437  it = rechits_map.find(next);
438  if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
439  else esHits.push_back(0);
440  //cout<<"south "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
441  } else {
442  for (int j=i; j<15; j++) esHits.push_back(0);
443  break;
444  //cout<<"south "<<i<<" : "<<next<<" "<<0<<endl;
445  }
446  }
447  } // End of Rear Plane
448  } // Fill ES RecHits
449 
450  return esHits;
451 }
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,
const edm::InputTag redESRecHits 
)
protected

Definition at line 131 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

132 {
134  ev.getByLabel( redESRecHits, pESRecHits );
135  esRecHits_ = pESRecHits.product();
136 
137  // make the map of rechits
138  rechits_map_.clear();
139  if (pESRecHits.isValid()) {
141  for (it = pESRecHits->begin(); it != pESRecHits->end(); ++it) {
142  // remove bad ES rechits
143  if (it->recoFlag()==1 || it->recoFlag()==14 || (it->recoFlag()<=10 && it->recoFlag()>=5)) continue;
144  //Make the map of DetID, EcalRecHit pairs
145  rechits_map_.insert(std::make_pair(it->id(), *it));
146  }
147  }
148 
149 }
const EcalRecHitCollection * esRecHits_
std::vector< EcalRecHit >::const_iterator const_iterator
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
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 455 of file EcalClusterLazyTools.cc.

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

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

456 {
457  const int nBIN = 21;
458  float esRH[nBIN];
459  for (int idx=0; idx<nBIN; idx++) {
460  esRH[idx] = 0.;
461  }
462 
463  for(int ibin=0; ibin<((nBIN+1)/2); ibin++) {
464  if (ibin==0) {
465  esRH[(nBIN-1)/2] = ESHits0[ibin];
466  } else {
467  esRH[(nBIN-1)/2+ibin] = ESHits0[ibin];
468  esRH[(nBIN-1)/2-ibin] = ESHits0[ibin+15];
469  }
470  }
471 
472  // ---- Effective Energy Deposit Width ---- //
473  double EffWidthSigmaISIS = 0.;
474  double totalEnergyISIS = 0.;
475  double EffStatsISIS = 0.;
476  for (int id_X=0; id_X<21; id_X++) {
477  totalEnergyISIS += esRH[id_X];
478  EffStatsISIS += esRH[id_X]*(id_X-10)*(id_X-10);
479  }
480  EffWidthSigmaISIS = (totalEnergyISIS>0.) ? sqrt(fabs(EffStatsISIS / totalEnergyISIS)) : 0.;
481 
482  return EffWidthSigmaISIS;
483 }
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 95 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

96 {
98  es.get<CaloGeometryRecord>().get(pGeometry);
99  geometry_ = pGeometry.product();
100 }
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 153 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

154 {
155  // get IC's
157  icalMap = ical->getMap();
158 }
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 170 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

170  {
171  // transp corrections
172  es.get<EcalLaserDbRecord>().get(laser);
173 }
const T & get() const
Definition: EventSetup.h:55
edm::ESHandle< EcalLaserDbService > laser
void EcalClusterLazyToolsBase::getTopology ( const edm::EventSetup es)
protected

Definition at line 104 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

105 {
106  edm::ESHandle<CaloTopology> pTopology;
107  es.get<CaloTopologyRecord>().get(pTopology);
108  topology_ = pTopology.product();
109 }
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 278 of file EcalClusterLazyTools.cc.

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

278  {
279 
280  return BasicClusterSeedTime ( (*cluster.seed()) );
281 
282 }
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 286 of file EcalClusterLazyTools.cc.

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

286  {
287 
288  return BasicClusterTime ( (*cluster.seed()) , ev);
289 
290 }
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 82 of file EcalClusterLazyTools.h.

Referenced by BasicClusterTime(), and getADCToGeV().

const EcalRecHitCollection* EcalClusterLazyToolsBase::ebRecHits_
protected

Definition at line 75 of file EcalClusterLazyTools.h.

Referenced by getEBRecHits(), and getEcalRecHitCollection().

const EcalRecHitCollection* EcalClusterLazyToolsBase::eeRecHits_
protected

Definition at line 76 of file EcalClusterLazyTools.h.

Referenced by getEcalRecHitCollection(), and getEERecHits().

const EcalRecHitCollection* EcalClusterLazyToolsBase::esRecHits_
protected

Definition at line 77 of file EcalClusterLazyTools.h.

Referenced by getESRecHits().

const CaloGeometry* EcalClusterLazyToolsBase::geometry_
protected

Definition at line 73 of file EcalClusterLazyTools.h.

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

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

Definition at line 80 of file EcalClusterLazyTools.h.

Referenced by getIntercalibConstants().

EcalIntercalibConstantMap EcalClusterLazyToolsBase::icalMap
protected

Definition at line 81 of file EcalClusterLazyTools.h.

Referenced by BasicClusterTime(), and getIntercalibConstants().

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

Definition at line 83 of file EcalClusterLazyTools.h.

Referenced by BasicClusterTime(), and getLaserDbService().

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

Definition at line 51 of file EcalClusterLazyTools.h.

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

const CaloTopology* EcalClusterLazyToolsBase::topology_
protected

Definition at line 74 of file EcalClusterLazyTools.h.

Referenced by getTopology().