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)
 
 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 (void)
 
const EcalRecHitCollectiongetEcalEERecHitCollection (void)
 
const EcalRecHitCollectiongetEcalESRecHitCollection (void)
 
const EcalIntercalibConstantsgetEcalIntercalibConstants (void)
 
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 (void)
 
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_
 
std::shared_ptr
< CaloSubdetectorTopology
const > 
ecalPS_topology_
 
const EcalRecHitCollectioneeRecHits_
 
edm::EDGetTokenT
< EcalRecHitCollection
eeRHToken_
 
const EcalRecHitCollectionesRecHits_
 
edm::EDGetTokenT
< EcalRecHitCollection
esRHToken_
 
const CaloGeometrygeometry_
 
edm::ESHandle
< EcalIntercalibConstants
ical
 
const EcalIntercalibConstantMapicalMap
 
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 ( const edm::Event ev,
const edm::EventSetup es,
edm::EDGetTokenT< EcalRecHitCollection token1,
edm::EDGetTokenT< EcalRecHitCollection token2,
edm::EDGetTokenT< EcalRecHitCollection token3 
)

Definition at line 39 of file EcalClusterLazyTools.cc.

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

39  {
40 
41  ebRHToken_ = token1;
42  eeRHToken_ = token2;
43  esRHToken_ = token3;
44 
45  getGeometry( es );
46  getTopology( es );
47  getEBRecHits( ev );
48  getEERecHits( ev );
49  getESRecHits( ev );
51  getADCToGeV ( es );
52  getLaserDbService ( es );
53 }
edm::EDGetTokenT< EcalRecHitCollection > eeRHToken_
void getADCToGeV(const edm::EventSetup &es)
void getIntercalibConstants(const edm::EventSetup &es)
void getESRecHits(const edm::Event &ev)
edm::EDGetTokenT< EcalRecHitCollection > esRHToken_
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 55 of file EcalClusterLazyTools.cc.

56 {}

Member Function Documentation

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

Definition at line 164 of file EcalClusterLazyTools.cc.

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

Referenced by SuperClusterSeedTime().

165 {
166 
168 
169  DetId id = cluster.seed();
170  EcalRecHitCollection::const_iterator theSeedHit = recHits->find (id);
171  // std::cout << "the seed of the BC has time: "
172  //<< (*theSeedHit).time()
173  //<< "and energy: " << (*theSeedHit).energy() << " collection size: " << recHits->size()
174  //<< "\n" <<std::endl; // GF debug
175 
176  return (*theSeedHit).time();
177 }
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 181 of file EcalClusterLazyTools.cc.

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

Referenced by SuperClusterTime().

182 {
183 
184  std::vector<std::pair<DetId, float> > clusterComponents = (cluster).hitsAndFractions() ;
185  //std::cout << "BC has this many components: " << clusterComponents.size() << std::endl; // GF debug
186 
188  //std::cout << "BasicClusterClusterTime - rechits are this many: " << recHits->size() << std::endl; // GF debug
189 
190 
191  float weightedTsum = 0;
192  float sumOfWeights = 0;
193 
194  for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterComponents.begin(); detitr != clusterComponents.end(); detitr++ )
195  {
196  // EcalRecHitCollection::const_iterator theSeedHit = recHits->find (id); // trash this
197  EcalRecHitCollection::const_iterator oneHit = recHits->find( (detitr -> first) ) ;
198 
199  // in order to get back the ADC counts from the recHit energy, three ingredients are necessary:
200  // 1) get laser correction coefficient
201  float lasercalib = 1.;
202  lasercalib = laser->getLaserCorrection( detitr->first, ev.time());
203  // 2) get intercalibration
204  EcalIntercalibConstantMap::const_iterator icalit = icalMap->find(detitr->first);
205  EcalIntercalibConstant icalconst = 1.;
206  if( icalit!=icalMap->end() ) {
207  icalconst = (*icalit);
208  // std::cout << "icalconst set to: " << icalconst << std::endl;
209  } else {
210  edm::LogError("EcalClusterLazyTools") << "No intercalib const found for xtal " << (detitr->first).rawId() << "bailing out";
211  assert(0);
212  }
213  // 3) get adc2GeV
214  float adcToGeV = 1.;
215  if ( (detitr -> first).subdetId() == EcalBarrel ) adcToGeV = float(agc->getEBValue());
216  else if ( (detitr -> first).subdetId() == EcalEndcap ) adcToGeV = float(agc->getEEValue());
217  float adc = 2.;
218  if (icalconst>0 && lasercalib>0 && adcToGeV>0) adc= (*oneHit).energy()/(icalconst*lasercalib*adcToGeV);
219 
220  // don't consider recHits with too little amplitude; take sigma_noise_total into account
221  if( (detitr -> first).subdetId() == EcalBarrel && adc< (1.1*20) ) continue;
222  if( (detitr -> first).subdetId() == EcalEndcap && adc< (2.2*20) ) continue;
223 
224  // count only on rechits whose error is trusted by the method (ratio)
225  if(! (*oneHit).isTimeErrorValid()) continue;
226 
227  float timeError = (*oneHit).timeError();
228  // the constant used to build timeError is largely over-estimated ; remove in quadrature 0.6 and add 0.15 back.
229  // could be prettier if value of constant term was changed at recHit production level
230  if (timeError>0.6) timeError = sqrt( timeError*timeError - 0.6*0.6 + 0.15*0.15);
231  else timeError = sqrt( timeError*timeError + 0.15*0.15);
232 
233  // do the error weighting
234  weightedTsum += (*oneHit).time() / (timeError*timeError);
235  sumOfWeights += 1. / (timeError*timeError);
236 
237  }
238 
239  // what if no crytal is available for weighted average?
240  if ( sumOfWeights ==0 ) return -999;
241  else return ( weightedTsum / sumOfWeights);
242 
243 }
int adc(sample_type sample)
get the ADC sample (12 bits)
const EcalRecHitCollection * getEcalRecHitCollection(const reco::BasicCluster &cluster)
assert(m_qm.get())
std::vector< EcalRecHit >::const_iterator const_iterator
const EcalIntercalibConstantMap * icalMap
edm::ESHandle< EcalADCToGeVConstant > agc
T sqrt(T t)
Definition: SSEVec.h:18
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:60
float EcalIntercalibConstant
float EcalClusterLazyToolsBase::eseffsirir ( const reco::SuperCluster cluster)

Definition at line 263 of file EcalClusterLazyTools.cc.

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

264 {
265  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.;
266 
267  if (!ecalPS_topology_) return 0.;
268 
269  std::vector<float> phoESHitsIXIX = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, ecalPS_topology_.get(), 0, 1);
270  std::vector<float> phoESHitsIYIY = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, ecalPS_topology_.get(), 0, 2);
271  float phoESShapeIXIX = getESShape(phoESHitsIXIX);
272  float phoESShapeIYIY = getESShape(phoESHitsIYIY);
273 
274  return sqrt(phoESShapeIXIX*phoESShapeIXIX + phoESShapeIYIY*phoESShapeIYIY);
275 }
const CaloGeometry * geometry_
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)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:160
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:163
T sqrt(T t)
Definition: SSEVec.h:18
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:154
std::shared_ptr< CaloSubdetectorTopology const > ecalPS_topology_
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:157
std::map< DetId, EcalRecHit > rechits_map_
float EcalClusterLazyToolsBase::eseffsixix ( const reco::SuperCluster cluster)

Definition at line 278 of file EcalClusterLazyTools.cc.

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

279 {
280  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.;
281 
282  if (!ecalPS_topology_) return 0.;
283 
284  std::vector<float> phoESHitsIXIX = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, ecalPS_topology_.get(), 0, 1);
285  float phoESShapeIXIX = getESShape(phoESHitsIXIX);
286 
287  return phoESShapeIXIX;
288 }
const CaloGeometry * geometry_
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)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:160
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:163
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:154
std::shared_ptr< CaloSubdetectorTopology const > ecalPS_topology_
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:157
std::map< DetId, EcalRecHit > rechits_map_
float EcalClusterLazyToolsBase::eseffsiyiy ( const reco::SuperCluster cluster)

Definition at line 291 of file EcalClusterLazyTools.cc.

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

292 {
293  if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.;
294 
295  if (!ecalPS_topology_) return 0.;
296 
297  std::vector<float> phoESHitsIYIY = getESHits(cluster.x(), cluster.y(), cluster.z(), rechits_map_, geometry_, ecalPS_topology_.get(), 0, 2);
298  float phoESShapeIYIY = getESShape(phoESHitsIYIY);
299 
300  return phoESShapeIYIY;
301 }
const CaloGeometry * geometry_
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)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:160
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:163
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:154
std::shared_ptr< CaloSubdetectorTopology const > ecalPS_topology_
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:157
std::map< DetId, EcalRecHit > rechits_map_
void EcalClusterLazyToolsBase::getADCToGeV ( const edm::EventSetup es)
protected

Definition at line 131 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

132 {
133  // get ADCtoGeV
134  es.get<EcalADCToGeVConstantRcd>().get(agc);
135 }
edm::ESHandle< EcalADCToGeVConstant > agc
const T & get() const
Definition: EventSetup.h:56
void EcalClusterLazyToolsBase::getEBRecHits ( const edm::Event ev)
protected

Definition at line 78 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

78  {
80  ev.getByToken( ebRHToken_, pEBRecHits );
81  ebRecHits_ = pEBRecHits.product();
82 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
const EcalRecHitCollection * ebRecHits_
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< EcalRecHitCollection > ebRHToken_
const EcalRecHitCollection* EcalClusterLazyToolsBase::getEcalEBRecHitCollection ( void  )
inline

Definition at line 96 of file EcalClusterLazyTools.h.

References ebRecHits_.

96 {return ebRecHits_;};
const EcalRecHitCollection * ebRecHits_
const EcalRecHitCollection* EcalClusterLazyToolsBase::getEcalEERecHitCollection ( void  )
inline

Definition at line 97 of file EcalClusterLazyTools.h.

References eeRecHits_.

97 {return eeRecHits_;};
const EcalRecHitCollection * eeRecHits_
const EcalRecHitCollection* EcalClusterLazyToolsBase::getEcalESRecHitCollection ( void  )
inline

Definition at line 98 of file EcalClusterLazyTools.h.

References esRecHits_.

98 {return esRecHits_;};
const EcalRecHitCollection * esRecHits_
const EcalIntercalibConstants& EcalClusterLazyToolsBase::getEcalIntercalibConstants ( void  )
inline

Definition at line 99 of file EcalClusterLazyTools.h.

References icalMap.

99 {return *icalMap;};
const EcalIntercalibConstantMap * icalMap
const EcalRecHitCollection * EcalClusterLazyToolsBase::getEcalRecHitCollection ( const reco::BasicCluster cluster)
protected

Definition at line 145 of file EcalClusterLazyTools.cc.

References ebRecHits_, EcalBarrel, EcalEndcap, eeRecHits_, Exception, plotBeamSpotDB::first, and HLT_25ns10e33_v2_cff::recHits.

Referenced by BasicClusterSeedTime(), and BasicClusterTime().

146 {
147  if ( cluster.size() == 0 ) {
148  throw cms::Exception("InvalidCluster") << "The cluster has no crystals!";
149  }
150  DetId id = (cluster.hitsAndFractions()[0]).first; // size is by definition > 0 -- FIXME??
151  const EcalRecHitCollection *recHits = 0;
152  if ( id.subdetId() == EcalBarrel ) {
153  recHits = ebRecHits_;
154  } else if ( id.subdetId() == EcalEndcap ) {
155  recHits = eeRecHits_;
156  } else {
157  throw cms::Exception("InvalidSubdetector") << "The subdetId() " << id.subdetId() << " does not correspond to EcalBarrel neither EcalEndcap";
158  }
159  return recHits;
160 }
const EcalRecHitCollection * ebRecHits_
Definition: DetId.h:18
const EcalRecHitCollection * eeRecHits_
void EcalClusterLazyToolsBase::getEERecHits ( const edm::Event ev)
protected

Definition at line 84 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

84  {
86  ev.getByToken( eeRHToken_, pEERecHits );
87  eeRecHits_ = pEERecHits.product();
88 }
edm::EDGetTokenT< EcalRecHitCollection > eeRHToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
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 const *  topology_p,
int  row = 0,
int  plane = 1 
)

Definition at line 304 of file EcalClusterLazyTools.cc.

References CaloNavigator< T, TOPO >::east(), DetId::Ecal, EcalPreshower, CaloGeometry::getSubdetectorGeometry(), CaloNavigator< T, TOPO >::home(), i, j, GetRecoTauVFromDQM_MC_cff::next, CaloNavigator< T, TOPO >::north(), point, CaloNavigator< T, TOPO >::setHome(), CaloNavigator< T, TOPO >::south(), and CaloNavigator< T, TOPO >::west().

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

305 {
306  std::map<DetId, EcalRecHit> rechits_map = _rechits_map;
307  std::vector<float> esHits;
308 
309  const GlobalPoint point(X,Y,Z);
310 
311  const CaloSubdetectorGeometry *geometry_p ;
312  geometry_p = geometry->getSubdetectorGeometry (DetId::Ecal,EcalPreshower) ;
313 
314  DetId esId = (dynamic_cast<const EcalPreshowerGeometry*>(geometry_p))->getClosestCellInPlane(point, plane);
315  ESDetId esDetId = (esId == DetId(0)) ? ESDetId(0) : ESDetId(esId);
316 
317  std::map<DetId, EcalRecHit>::iterator it;
318  ESDetId next;
319  ESDetId strip;
320  strip = esDetId;
321 
322  EcalPreshowerNavigator theESNav(strip, topology_p);
323  theESNav.setHome(strip);
324 
325  if (row == 1) {
326  if (plane==1 && strip != ESDetId(0)) strip = theESNav.north();
327  if (plane==2 && strip != ESDetId(0)) strip = theESNav.east();
328  } else if (row == -1) {
329  if (plane==1 && strip != ESDetId(0)) strip = theESNav.south();
330  if (plane==2 && strip != ESDetId(0)) strip = theESNav.west();
331  }
332 
333 
334  if (strip == ESDetId(0)) {
335  for (int i=0; i<31; ++i) esHits.push_back(0);
336  } else {
337  it = rechits_map.find(strip);
338  if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
339  else esHits.push_back(0);
340  //cout<<"center : "<<strip<<" "<<it->second.energy()<<endl;
341 
342  // Front Plane
343  if (plane==1) {
344  // east road
345  for (int i=0; i<15; ++i) {
346  next = theESNav.east();
347  if (next != ESDetId(0)) {
348  it = rechits_map.find(next);
349  if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
350  else esHits.push_back(0);
351  //cout<<"east "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
352  } else {
353  for (int j=i; j<15; j++) esHits.push_back(0);
354  break;
355  //cout<<"east "<<i<<" : "<<next<<" "<<0<<endl;
356  }
357  }
358 
359  // west road
360  theESNav.setHome(strip);
361  theESNav.home();
362  for (int i=0; i<15; ++i) {
363  next = theESNav.west();
364  if (next != ESDetId(0)) {
365  it = rechits_map.find(next);
366  if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
367  else esHits.push_back(0);
368  //cout<<"west "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
369  } else {
370  for (int j=i; j<15; j++) esHits.push_back(0);
371  break;
372  //cout<<"west "<<i<<" : "<<next<<" "<<0<<endl;
373  }
374  }
375  } // End of Front Plane
376 
377  // Rear Plane
378  if (plane==2) {
379  // north road
380  for (int i=0; i<15; ++i) {
381  next = theESNav.north();
382  if (next != ESDetId(0)) {
383  it = rechits_map.find(next);
384  if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
385  else esHits.push_back(0);
386  //cout<<"north "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
387  } else {
388  for (int j=i; j<15; j++) esHits.push_back(0);
389  break;
390  //cout<<"north "<<i<<" : "<<next<<" "<<0<<endl;
391  }
392  }
393 
394  // south road
395  theESNav.setHome(strip);
396  theESNav.home();
397  for (int i=0; i<15; ++i) {
398  next = theESNav.south();
399  if (next != ESDetId(0)) {
400  it = rechits_map.find(next);
401  if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
402  else esHits.push_back(0);
403  //cout<<"south "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
404  } else {
405  for (int j=i; j<15; j++) esHits.push_back(0);
406  break;
407  //cout<<"south "<<i<<" : "<<next<<" "<<0<<endl;
408  }
409  }
410  } // End of Rear Plane
411  } // Fill ES RecHits
412 
413  return esHits;
414 }
const double Z[kNumberCalorimeter]
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 90 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

90  {
92  ev.getByToken( esRHToken_, pESRecHits );
93  esRecHits_ = pESRecHits.product();
94  // make the map of rechits
95  rechits_map_.clear();
96  if (pESRecHits.isValid()) {
98  for (it = pESRecHits->begin(); it != pESRecHits->end(); ++it) {
99  // remove bad ES rechits
100  std::vector<int> badf = {
101  EcalRecHit::ESFlags::kESDead, // 1
102  EcalRecHit::ESFlags::kESTwoGoodRatios,
103  EcalRecHit::ESFlags::kESBadRatioFor12, // 5
104  EcalRecHit::ESFlags::kESBadRatioFor23Upper,
105  EcalRecHit::ESFlags::kESBadRatioFor23Lower,
106  EcalRecHit::ESFlags::kESTS1Largest,
107  EcalRecHit::ESFlags::kESTS3Largest,
108  EcalRecHit::ESFlags::kESTS3Negative, // 10
109  EcalRecHit::ESFlags::kESTS13Sigmas, // 14
110  };
111 
112  if (it->checkFlags(badf)) continue;
113 
114  //Make the map of DetID, EcalRecHit pairs
115  rechits_map_.insert(std::make_pair(it->id(), *it));
116  }
117  }
118 }
const EcalRecHitCollection * esRecHits_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< EcalRecHit >::const_iterator const_iterator
bool isValid() const
Definition: HandleBase.h:75
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 418 of file EcalClusterLazyTools.cc.

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

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

419 {
420  const int nBIN = 21;
421  float esRH[nBIN];
422  for (int idx=0; idx<nBIN; idx++) {
423  esRH[idx] = 0.;
424  }
425 
426  for(int ibin=0; ibin<((nBIN+1)/2); ibin++) {
427  if (ibin==0) {
428  esRH[(nBIN-1)/2] = ESHits0[ibin];
429  } else {
430  esRH[(nBIN-1)/2+ibin] = ESHits0[ibin];
431  esRH[(nBIN-1)/2-ibin] = ESHits0[ibin+15];
432  }
433  }
434 
435  // ---- Effective Energy Deposit Width ---- //
436  double EffWidthSigmaISIS = 0.;
437  double totalEnergyISIS = 0.;
438  double EffStatsISIS = 0.;
439  for (int id_X=0; id_X<21; id_X++) {
440  totalEnergyISIS += esRH[id_X];
441  EffStatsISIS += esRH[id_X]*(id_X-10)*(id_X-10);
442  }
443  EffWidthSigmaISIS = (totalEnergyISIS>0.) ? sqrt(fabs(EffStatsISIS / totalEnergyISIS)) : 0.;
444 
445  return EffWidthSigmaISIS;
446 }
T sqrt(T t)
Definition: SSEVec.h:18
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void EcalClusterLazyToolsBase::getGeometry ( const edm::EventSetup es)
protected

Definition at line 58 of file EcalClusterLazyTools.cc.

References DetId::Ecal, EcalPreshower, ecalPS_topology_, geometry_, edm::EventSetup::get(), CaloGeometry::getSubdetectorGeometry(), and edm::ESHandle< class >::product().

Referenced by EcalClusterLazyToolsBase().

58  {
60  es.get<CaloGeometryRecord>().get(pGeometry);
61  geometry_ = pGeometry.product();
62 
64  if (geometryES) {
66  } else {
67  ecalPS_topology_.reset();
68  edm::LogWarning("subdetector geometry not available") << "EcalPreshower geometry is missing" << std::endl;
69  }
70 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const CaloGeometry * geometry_
std::shared_ptr< CaloSubdetectorTopology const > ecalPS_topology_
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
void EcalClusterLazyToolsBase::getIntercalibConstants ( const edm::EventSetup es)
protected

Definition at line 122 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

123 {
124  // get IC's
126  icalMap = &ical->getMap();
127 }
edm::ESHandle< EcalIntercalibConstants > ical
const EcalIntercalibConstantMap * icalMap
const T & get() const
Definition: EventSetup.h:56
void EcalClusterLazyToolsBase::getLaserDbService ( const edm::EventSetup es)
protected

Definition at line 139 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

139  {
140  // transp corrections
141  es.get<EcalLaserDbRecord>().get(laser);
142 }
const T & get() const
Definition: EventSetup.h:56
edm::ESHandle< EcalLaserDbService > laser
const edm::ESHandle<EcalLaserDbService>& EcalClusterLazyToolsBase::getLaserHandle ( void  )
inline

Definition at line 100 of file EcalClusterLazyTools.h.

References laser.

100 {return laser;};
edm::ESHandle< EcalLaserDbService > laser
void EcalClusterLazyToolsBase::getTopology ( const edm::EventSetup es)
protected

Definition at line 72 of file EcalClusterLazyTools.cc.

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

Referenced by EcalClusterLazyToolsBase().

72  {
74  es.get<CaloTopologyRecord>().get(pTopology);
75  topology_ = pTopology.product();
76 }
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
const CaloTopology * topology_
float EcalClusterLazyToolsBase::SuperClusterSeedTime ( const reco::SuperCluster cluster)

Definition at line 247 of file EcalClusterLazyTools.cc.

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

247  {
248 
249  return BasicClusterSeedTime ( (*cluster.seed()) );
250 
251 }
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 255 of file EcalClusterLazyTools.cc.

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

255  {
256 
257  return BasicClusterTime ( (*cluster.seed()) , ev);
258 
259 }
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 86 of file EcalClusterLazyTools.h.

Referenced by BasicClusterTime(), and getADCToGeV().

const EcalRecHitCollection* EcalClusterLazyToolsBase::ebRecHits_
protected
edm::EDGetTokenT<EcalRecHitCollection> EcalClusterLazyToolsBase::ebRHToken_
protected

Definition at line 79 of file EcalClusterLazyTools.h.

Referenced by EcalClusterLazyToolsBase(), and getEBRecHits().

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

Definition at line 81 of file EcalClusterLazyTools.h.

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

const EcalRecHitCollection* EcalClusterLazyToolsBase::eeRecHits_
protected
edm::EDGetTokenT<EcalRecHitCollection> EcalClusterLazyToolsBase::eeRHToken_
protected

Definition at line 79 of file EcalClusterLazyTools.h.

Referenced by EcalClusterLazyToolsBase(), and getEERecHits().

const EcalRecHitCollection* EcalClusterLazyToolsBase::esRecHits_
protected

Definition at line 77 of file EcalClusterLazyTools.h.

Referenced by getEcalESRecHitCollection(), and getESRecHits().

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

Definition at line 79 of file EcalClusterLazyTools.h.

Referenced by EcalClusterLazyToolsBase(), and 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 84 of file EcalClusterLazyTools.h.

Referenced by getIntercalibConstants().

const EcalIntercalibConstantMap* EcalClusterLazyToolsBase::icalMap
protected
edm::ESHandle<EcalLaserDbService> EcalClusterLazyToolsBase::laser
protected

Definition at line 87 of file EcalClusterLazyTools.h.

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

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