CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFRecHitProducerECAL.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
6 
10 
14 
18 
24 
31 
32 
33 using namespace std;
34 using namespace edm;
35 
37  : PFRecHitProducer(iConfig) {
38 
39  // access to the collections of rechits
40 
41 
43  iConfig.getParameter<InputTag>("ecalRecHitsEB");
44 
46  iConfig.getParameter<InputTag>("ecalRecHitsEE");
47 
48 
50  iConfig.getParameter<bool>("crossBarrelEndcapBorder");
51 
53  iConfig.getParameter<bool>("timing_Cleaning");
54 
56  iConfig.getParameter<bool>("topological_Cleaning");
57 
59  iConfig.getParameter<double>("thresh_Cleaning_EB");
60 
62  iConfig.getParameter<double>("thresh_Cleaning_EE");
63 
65 }
66 
67 
68 
70 
71 
72 
73 
74 
75 
76 void
78  vector<reco::PFRecHit>& rechitsCleaned,
80  const edm::EventSetup& iSetup ) {
81 
82 
83 
84  // this map is necessary to find the rechit neighbours efficiently
85  //C but I should think about using Florian's hashed index to do this.
86  //C in which case the map might not be necessary anymore
87  //
88  // the key of this map is detId.
89  // the value is the index in the rechits vector
90  map<unsigned, unsigned > idSortedRecHits;
91 // typedef map<unsigned, unsigned >::iterator IDH;
92 
94  iSetup.get<CaloGeometryRecord>().get(geoHandle);
95 
96  // get the ecalBarrel geometry
97  const CaloSubdetectorGeometry *ebtmp =
98  geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
99 
100  const EcalBarrelGeometry* ecalBarrelGeometry =
101  dynamic_cast< const EcalBarrelGeometry* > (ebtmp);
102  assert( ecalBarrelGeometry );
103 
104  // get the ecalBarrel topology
105  EcalBarrelTopology ecalBarrelTopology(geoHandle);
106 
107  // get the endcap geometry
108  const CaloSubdetectorGeometry *eetmp =
109  geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
110 
111  const EcalEndcapGeometry* ecalEndcapGeometry =
112  dynamic_cast< const EcalEndcapGeometry* > (eetmp);
113  assert( ecalEndcapGeometry );
114 
115 
116  // get the endcap topology
117  EcalEndcapTopology ecalEndcapTopology(geoHandle);
118 
119 
121  ecalNeighbArray( *ecalBarrelGeometry,
122  ecalBarrelTopology,
123  *ecalEndcapGeometry,
124  ecalEndcapTopology );
125 
126 
127  // get the ecalBarrel rechits
128 
130 
131 
132  bool found = iEvent.getByLabel(inputTagEcalRecHitsEB_,
133  rhcHandle);
134 
135  if(!found) {
136 
137  ostringstream err;
138  err<<"could not find rechits "<<inputTagEcalRecHitsEB_;
139  LogError("PFRecHitProducerECAL")<<err.str()<<endl;
140 
141  throw cms::Exception( "MissingProduct", err.str());
142  }
143  else {
144  assert( rhcHandle.isValid() );
145 
146  // process ecal ecalBarrel rechits
147  for(unsigned i=0; i<rhcHandle->size(); i++) {
148 
149  const EcalRecHit& erh = (*rhcHandle)[i];
150  const DetId& detid = erh.detid();
151  double energy = erh.energy();
152  // uint32_t flag = erh.recoFlag();
153  double time = erh.time();
154 
156  if (esd != 1) continue;
157 
158  if(energy < thresh_Barrel_ ) continue;
159 
160  // Check and skip the TT recovered rechits
161  //if ( flag == EcalRecHit::kTowerRecovered ) {
163  // std::cout << "Rechit was recovered with energy " << energy << std::endl;
164  continue;
165  }
166 
167  // Just clean ECAL Barrel rechits out of time by more than 5 sigma.
168  // if ( timingCleaning_ && energy > threshCleaning_ && flag == EcalRecHit::kOutOfTime ) {
169  if ( ( timingCleaning_ && energy > threshCleaningEB_ &&
172  ( erh.checkFlag(EcalRecHit::kWeird) ||
173  erh.checkFlag(EcalRecHit::kDiWeird) ) ) ) {
174  reco::PFRecHit *pfrhCleaned = createEcalRecHit(detid, energy,
176  ecalBarrelGeometry);
177  if( !pfrhCleaned ) continue; // problem with this rechit. skip it
178  pfrhCleaned->setRescale(time);
179  rechitsCleaned.push_back( *pfrhCleaned );
180  delete pfrhCleaned;
181  continue;
182  }
183 
184 
185  reco::PFRecHit *pfrh = createEcalRecHit(detid, energy,
187  ecalBarrelGeometry);
188 
189  if( !pfrh ) continue; // problem with this rechit. skip it
190  pfrh->setRescale(time);
191 
192  rechits.push_back( *pfrh );
193  delete pfrh;
194  idSortedRecHits.insert( make_pair(detid.rawId(), rechits.size()-1 ) );
195  }
196  }
197 
198 
199 
200  //C proceed as for the barrel
201  // process ecal endcap rechits
202 
203  found = iEvent.getByLabel(inputTagEcalRecHitsEE_,
204  rhcHandle);
205 
206  if(!found) {
207  ostringstream err;
208  err<<"could not find rechits "<<inputTagEcalRecHitsEE_;
209  LogError("PFRecHitProducerECAL")<<err.str()<<endl;
210 
211  throw cms::Exception( "MissingProduct", err.str());
212  }
213  else {
214  assert( rhcHandle.isValid() );
215 
216  for(unsigned i=0; i<rhcHandle->size(); i++) {
217 
218  const EcalRecHit& erh = (*rhcHandle)[i];
219  const DetId& detid = erh.detid();
220  double energy = erh.energy();
221  //uint32_t flag = erh.recoFlag();
222  double time = erh.time();
224  if (esd != 2) continue;
225  if(energy < thresh_Endcap_ ) continue;
226 
227  // Check and skip the TT recovered rechits
229  // if ( flag == EcalRecHit::kTowerRecovered ) {
230  // std::cout << "Rechit was recovered with energy " << energy << std::endl;
231  continue;
232  }
233 
234 
235  // EE cleaning
236 
237  if ( ( timingCleaning_ && energy > threshCleaningEE_ &&
240  ( erh.checkFlag(EcalRecHit::kWeird) ) ) ) {
241  reco::PFRecHit *pfrhCleaned = createEcalRecHit(detid, energy,
243  ecalEndcapGeometry);
244  if( !pfrhCleaned ) continue; // problem with this rechit. skip it
245  pfrhCleaned->setRescale(time);
246  rechitsCleaned.push_back( *pfrhCleaned );
247  delete pfrhCleaned;
248  continue;
249  }
250 
251 
252 
253 
254  reco::PFRecHit *pfrh = createEcalRecHit(detid, energy,
256  ecalEndcapGeometry);
257  if( !pfrh ) continue; // problem with this rechit. skip it
258  pfrh->setRescale(time);
259 
260  rechits.push_back( *pfrh );
261  delete pfrh;
262  idSortedRecHits.insert( make_pair(detid.rawId(), rechits.size()-1 ) );
263  }
264  }
265 
266 
267  // do navigation
268  for(unsigned i=0; i<rechits.size(); i++ ) {
269 
270 // findRecHitNeighbours( rechits[i], idSortedRecHits,
271 // ecalBarrelTopology,
272 // *ecalBarrelGeometry,
273 // ecalEndcapTopology,
274 // *ecalEndcapGeometry);
275  findRecHitNeighboursECAL( rechits[i], idSortedRecHits );
276 
277  }
278 }
279 
280 
281 
282 
285  double energy,
286  PFLayer::Layer layer,
287  const CaloSubdetectorGeometry* geom ) {
288 
290  math::XYZVector axis;
291 
292  const CaloCellGeometry *thisCell
293  = geom->getGeometry(detid);
294 
295  // find rechit geometry
296  if(!thisCell) {
297  LogError("PFRecHitProducerECAL")
298  <<"warning detid "<<detid.rawId()
299  <<" not found in geometry"<<endl;
300  return 0;
301  }
302 
303  position.SetCoordinates ( thisCell->getPosition().x(),
304  thisCell->getPosition().y(),
305  thisCell->getPosition().z() );
306 
307 
308 
309  // the axis vector is the difference
310  const TruncatedPyramid* pyr
311  = dynamic_cast< const TruncatedPyramid* > (thisCell);
312  if( pyr ) {
313  axis.SetCoordinates( pyr->getPosition(1).x(),
314  pyr->getPosition(1).y(),
315  pyr->getPosition(1).z() );
316 
317  math::XYZVector axis0( pyr->getPosition(0).x(),
318  pyr->getPosition(0).y(),
319  pyr->getPosition(0).z() );
320 
321  axis -= axis0;
322  }
323  else return 0;
324 
325 // if( !geomfound ) {
326 // LogError("PFRecHitProducerECAL")<<"cannor find geometry for detid "
327 // <<detid.rawId()<<" in layer "<<layer<<endl;
328 // return 0; // geometry not found, skip rechit
329 // }
330 
331 
332  reco::PFRecHit *rh
333  = new reco::PFRecHit( detid.rawId(), layer,
334  energy,
335  position.x(), position.y(), position.z(),
336  axis.x(), axis.y(), axis.z() );
337 
338 
339  const CaloCellGeometry::CornersVec& corners = thisCell->getCorners();
340  assert( corners.size() == 8 );
341 
342  rh->setNECorner( corners[0].x(), corners[0].y(), corners[0].z() );
343  rh->setSECorner( corners[1].x(), corners[1].y(), corners[1].z() );
344  rh->setSWCorner( corners[2].x(), corners[2].y(), corners[2].z() );
345  rh->setNWCorner( corners[3].x(), corners[3].y(), corners[3].z() );
346 
347  return rh;
348 }
349 
350 
351 
352 
353 bool
357  math::XYZVector& axis ) {
358 
359 
360  const CaloCellGeometry *thisCell
361  = geom->getGeometry(detid);
362 
363  // find rechit geometry
364  if(!thisCell) {
365  LogError("PFRecHitProducerECAL")
366  <<"warning detid "<<detid.rawId()
367  <<" not found in geometry"<<endl;
368  return false;
369  }
370 
371  position.SetCoordinates ( thisCell->getPosition().x(),
372  thisCell->getPosition().y(),
373  thisCell->getPosition().z() );
374 
375 
376 
377  // the axis vector is the difference
378  const TruncatedPyramid* pyr
379  = dynamic_cast< const TruncatedPyramid* > (thisCell);
380  if( pyr ) {
381  axis.SetCoordinates( pyr->getPosition(1).x(),
382  pyr->getPosition(1).y(),
383  pyr->getPosition(1).z() );
384 
385  math::XYZVector axis0( pyr->getPosition(0).x(),
386  pyr->getPosition(0).y(),
387  pyr->getPosition(0).z() );
388 
389  axis -= axis0;
390 
391 
392  return true;
393  }
394  else return false;
395 }
396 
397 
398 
399 void
402  const map<unsigned,unsigned >& sortedHits ) {
403 
404  DetId center( rh.detId() );
405 
406 
407  DetId north = move( center, NORTH );
408  DetId northeast = move( center, NORTHEAST );
409  DetId northwest = move( center, NORTHWEST );
410  DetId south = move( center, SOUTH );
411  DetId southeast = move( center, SOUTHEAST );
412  DetId southwest = move( center, SOUTHWEST );
413  DetId east = move( center, EAST );
414  DetId west = move( center, WEST );
415 
416  IDH i = sortedHits.find( north.rawId() );
417  if(i != sortedHits.end() )
418  rh.add4Neighbour( i->second );
419 
420  i = sortedHits.find( northeast.rawId() );
421  if(i != sortedHits.end() )
422  rh.add8Neighbour( i->second );
423 
424  i = sortedHits.find( south.rawId() );
425  if(i != sortedHits.end() )
426  rh.add4Neighbour( i->second );
427 
428  i = sortedHits.find( southwest.rawId() );
429  if(i != sortedHits.end() )
430  rh.add8Neighbour( i->second );
431 
432  i = sortedHits.find( east.rawId() );
433  if(i != sortedHits.end() )
434  rh.add4Neighbour( i->second );
435 
436  i = sortedHits.find( southeast.rawId() );
437  if(i != sortedHits.end() )
438  rh.add8Neighbour( i->second );
439 
440  i = sortedHits.find( west.rawId() );
441  if(i != sortedHits.end() )
442  rh.add4Neighbour( i->second );
443 
444  i = sortedHits.find( northwest.rawId() );
445  if(i != sortedHits.end() )
446  rh.add8Neighbour( i->second );
447 }
448 
449 
450 
451 
452 // Build the array of (max)8 neighbors
453 void
455  const EcalBarrelGeometry& barrelGeom,
456  const CaloSubdetectorTopology& barrelTopo,
457  const EcalEndcapGeometry& endcapGeom,
458  const CaloSubdetectorTopology& endcapTopo ){
459 
460 
461  static const CaloDirection orderedDir[8]={SOUTHWEST,
462  SOUTH,
463  SOUTHEAST,
464  WEST,
465  EAST,
466  NORTHWEST,
467  NORTH,
468  NORTHEAST};
469 
470  const unsigned nbarrel = 62000;
471  // Barrel first. The hashed index runs from 0 to 61199
472  neighboursEB_.resize(nbarrel);
473 
474  //std::cout << " Building the array of neighbours (barrel) " ;
475 
476  const std::vector<DetId>& vec(barrelGeom.getValidDetIds(DetId::Ecal,
477  EcalBarrel));
478  unsigned size=vec.size();
479  for(unsigned ic=0; ic<size; ++ic)
480  {
481  // We get the 9 cells in a square.
482  std::vector<DetId> neighbours(barrelTopo.getWindow(vec[ic],3,3));
483  // std::cout << " Cell " << EBDetId(vec[ic]) << std::endl;
484  unsigned nneighbours=neighbours.size();
485 
486  unsigned hashedindex=EBDetId(vec[ic]).hashedIndex();
487  if(hashedindex>=nbarrel)
488  {
489  LogDebug("CaloGeometryTools") << " Array overflow " << std::endl;
490  }
491 
492 
493  // If there are 9 cells, it is easy, and this order is know:
494 // 6 7 8
495 // 3 4 5
496 // 0 1 2 (0 = SOUTHWEST)
497 
498  if(nneighbours==9)
499  {
500  neighboursEB_[hashedindex].reserve(8);
501  for(unsigned in=0;in<nneighbours;++in)
502  {
503  // remove the centre
504  if(neighbours[in]!=vec[ic])
505  {
506  neighboursEB_[hashedindex].push_back(neighbours[in]);
507  // std::cout << " Neighbour " << in << " " << EBDetId(neighbours[in]) << std::endl;
508  }
509  }
510  }
511  else
512  {
513  DetId central(vec[ic]);
514  neighboursEB_[hashedindex].resize(8,DetId(0));
515  for(unsigned idir=0;idir<8;++idir)
516  {
517  DetId testid=central;
518  bool status=stdmove(testid,orderedDir[idir],
519  barrelTopo, endcapTopo,
520  barrelGeom, endcapGeom);
521  if(status) neighboursEB_[hashedindex][idir]=testid;
522  }
523 
524  }
525  }
526 
527  // Moved to the endcap
528 
529  // std::cout << " done " << size << std::endl;
530  // std::cout << " Building the array of neighbours (endcap) " ;
531 
532 // vec.clear();
533  const std::vector<DetId>& vecee=endcapGeom.getValidDetIds(DetId::Ecal,EcalEndcap);
534  size=vecee.size();
535  // There are some holes in the hashedIndex for the EE. Hence the array is bigger than the number
536  // of crystals
537  const unsigned nendcap=19960;
538 
539  neighboursEE_.resize(nendcap);
540  for(unsigned ic=0; ic<size; ++ic)
541  {
542  // We get the 9 cells in a square.
543  std::vector<DetId> neighbours(endcapTopo.getWindow(vecee[ic],3,3));
544  unsigned nneighbours=neighbours.size();
545  // remove the centre
546  unsigned hashedindex=EEDetId(vecee[ic]).hashedIndex();
547 
548  if(hashedindex>=nendcap)
549  {
550  LogDebug("CaloGeometryTools") << " Array overflow " << std::endl;
551  }
552 
553  if(nneighbours==9)
554  {
555  neighboursEE_[hashedindex].reserve(8);
556  for(unsigned in=0;in<nneighbours;++in)
557  {
558  // remove the centre
559  if(neighbours[in]!=vecee[ic])
560  {
561  neighboursEE_[hashedindex].push_back(neighbours[in]);
562  }
563  }
564  }
565  else
566  {
567  DetId central(vecee[ic]);
568  neighboursEE_[hashedindex].resize(8,DetId(0));
569  for(unsigned idir=0;idir<8;++idir)
570  {
571  DetId testid=central;
572  bool status=stdmove(testid,orderedDir[idir],
573  barrelTopo, endcapTopo,
574  barrelGeom, endcapGeom);
575 
576  if(status) neighboursEE_[hashedindex][idir]=testid;
577  }
578 
579  }
580  }
581  // std::cout << " done " << size <<std::endl;
583 }
584 
585 
586 
587 bool
589  const CaloDirection& dir,
590  const CaloSubdetectorTopology& barrelTopo,
591  const CaloSubdetectorTopology& endcapTopo,
592  const EcalBarrelGeometry& barrelGeom,
593  const EcalEndcapGeometry& endcapGeom )
594  const {
595 
596  std::vector<DetId> neighbours;
597 
598  // BARREL CASE
599  if(cell.subdetId()==EcalBarrel) {
600  EBDetId ebDetId = cell;
601 
602  neighbours = barrelTopo.getNeighbours(ebDetId,dir);
603 
604  // first try to move according to the standard navigation
605  if(neighbours.size()>0 && !neighbours[0].null()) {
606  cell = neighbours[0];
607  return true;
608  }
609 
610  // failed.
611 
613  // are we on the outer ring ?
614  const int ietaAbs ( ebDetId.ietaAbs() ) ; // abs value of ieta
615  if( EBDetId::MAX_IETA == ietaAbs ) {
616  // get ee nbrs for for end of barrel crystals
617 
618  // yes we are
620  ol( * barrelGeom.getClosestEndcapCells( ebDetId ) ) ;
621 
622  // take closest neighbour on the other side, that is in the barrel.
623  cell = *(ol.begin() );
624  return true;
625  }
626  }
627  }
628 
629  // ENDCAP CASE
630  else if(cell.subdetId()==EcalEndcap) {
631 
632  EEDetId eeDetId = cell;
633 
634  neighbours= endcapTopo.getNeighbours(eeDetId,dir);
635 
636  if(neighbours.size()>0 && !neighbours[0].null()) {
637  cell = neighbours[0];
638  return true;
639  }
640 
641  // failed.
642 
644  // are we on the outer ring ?
645  const int iphi ( eeDetId.iPhiOuterRing() ) ;
646  if( iphi!= 0) {
647  // yes we are
649  ol( * endcapGeom.getClosestBarrelCells( eeDetId ) ) ;
650 
651  // take closest neighbour on the other side, that is in the barrel.
652  cell = *(ol.begin() );
653  return true;
654  }
655  }
656  }
657 
658  // everything failed
659  cell = DetId(0);
660  return false;
661 }
662 
663 
664 
665 bool
667  const CaloDirection& dir,
668  const CaloSubdetectorTopology& barrelTopo,
669  const CaloSubdetectorTopology& endcapTopo,
670  const EcalBarrelGeometry& barrelGeom,
671  const EcalEndcapGeometry& endcapGeom )
672 
673  const {
674 
675 
676  bool result;
677 
678  if(dir==NORTH) {
679  result = stdsimplemove(cell,NORTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
680  return result;
681  }
682  else if(dir==SOUTH) {
683  result = stdsimplemove(cell,SOUTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
684  return result;
685  }
686  else if(dir==EAST) {
687  result = stdsimplemove(cell,EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
688  return result;
689  }
690  else if(dir==WEST) {
691  result = stdsimplemove(cell,WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
692  return result;
693  }
694 
695 
696  // One has to try both paths
697  else if(dir==NORTHEAST)
698  {
699  result = stdsimplemove(cell,NORTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
700  if(result)
701  return stdsimplemove(cell,EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
702  else
703  {
704  result = stdsimplemove(cell,EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
705  if(result)
706  return stdsimplemove(cell,NORTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
707  else
708  return false;
709  }
710  }
711  else if(dir==NORTHWEST)
712  {
713  result = stdsimplemove(cell,NORTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
714  if(result)
715  return stdsimplemove(cell,WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
716  else
717  {
718  result = stdsimplemove(cell,WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
719  if(result)
720  return stdsimplemove(cell,NORTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
721  else
722  return false;
723  }
724  }
725  else if(dir == SOUTHEAST)
726  {
727  result = stdsimplemove(cell,SOUTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
728  if(result)
729  return stdsimplemove(cell,EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
730  else
731  {
732  result = stdsimplemove(cell,EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
733  if(result)
734  return stdsimplemove(cell,SOUTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
735  else
736  return false;
737  }
738  }
739  else if(dir == SOUTHWEST)
740  {
741  result = stdsimplemove(cell,SOUTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
742  if(result)
743  return stdsimplemove(cell,WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
744  else
745  {
746  result = stdsimplemove(cell,SOUTH, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
747  if(result)
748  return stdsimplemove(cell,WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
749  else
750  return false;
751  }
752  }
753  cell = DetId(0);
754  return false;
755 }
756 
757 
758 
760  const CaloDirection&dir ) const
761 {
762  DetId originalcell = cell;
763  if(dir==NONE || cell==DetId(0)) return false;
764 
765  // Conversion CaloDirection and index in the table
766  // CaloDirection :NONE,SOUTH,SOUTHEAST,SOUTHWEST,EAST,WEST, NORTHEAST,NORTHWEST,NORTH
767  // Table : SOUTHWEST,SOUTH,SOUTHEAST,WEST,EAST,NORTHWEST,NORTH, NORTHEAST
768  static const int calodirections[9]={-1,1,2,0,4,3,7,5,6};
769 
770  assert(neighbourmapcalculated_);
771 
772  DetId result = (originalcell.subdetId()==EcalBarrel) ?
773  neighboursEB_[EBDetId(originalcell).hashedIndex()][calodirections[dir]]:
774  neighboursEE_[EEDetId(originalcell).hashedIndex()][calodirections[dir]];
775  return result;
776 }
777 
#define LogDebug(id)
void setSECorner(double posx, double posy, double posz)
Definition: PFRecHit.cc:226
T getParameter(std::string const &) const
void add4Neighbour(unsigned index)
Definition: PFRecHit.cc:176
int i
Definition: DBlmapReader.cc:9
const OrderedListOfEEDetId * getClosestEndcapCells(EBDetId id) const
int hashedIndex() const
get a compact index for arrays
Definition: EBDetId.h:73
void ecalNeighbArray(const EcalBarrelGeometry &barrelGeom, const CaloSubdetectorTopology &barrelTopo, const EcalEndcapGeometry &endcapGeom, const CaloSubdetectorTopology &endcapTopo)
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
void add8Neighbour(unsigned index)
Definition: PFRecHit.cc:181
void setNECorner(double posx, double posy, double posz)
Definition: PFRecHit.cc:231
edm::InputTag inputTagEcalRecHitsEE_
const DetId & detid() const
Definition: CaloRecHit.h:22
unsigned detId() const
rechit detId
Definition: PFRecHit.h:99
T y() const
Definition: PV3DBase.h:62
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
float time() const
Definition: CaloRecHit.h:21
double double double z
edm::InputTag inputTagEcalRecHitsEB_
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
void setSWCorner(double posx, double posy, double posz)
Definition: PFRecHit.cc:221
int iEvent
Definition: GenABIO.cc:243
bool crossBarrelEndcapBorder_
if true, navigation will cross the barrel-endcap border
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
Base producer for particle flow rechits (PFRecHit)
bool checkFlag(int flag) const
check if the flag is true
Definition: EcalRecHit.h:102
float energy() const
Definition: CaloRecHit.h:19
PFRecHitProducerECAL(const edm::ParameterSet &)
T z() const
Definition: PV3DBase.h:63
tuple result
Definition: query.py:137
bool stdmove(DetId &cell, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom) const
int iPhiOuterRing() const
Definition: EEDetId.cc:404
bool stdsimplemove(DetId &cell, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom) const
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
bool findEcalRecHitGeometry(const DetId &detid, const CaloSubdetectorGeometry *geom, math::XYZVector &position, math::XYZVector &axis)
find the position and the axis of the cell for a given rechit
void setRescale(double factor)
Definition: PFRecHit.h:74
std::vector< std::vector< DetId > > neighboursEB_
for each ecal barrel rechit, keep track of the neighbours
bool isValid() const
Definition: HandleBase.h:76
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
void setNWCorner(double posx, double posy, double posz)
search for pointers to neighbours, using neighbours&#39; DetId.
Definition: PFRecHit.cc:216
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
Layer
layer definition
Definition: PFLayer.h:31
Definition: DetId.h:20
reco::PFRecHit * createEcalRecHit(const DetId &detid, double energy, PFLayer::Layer layer, const CaloSubdetectorGeometry *geom)
int hashedIndex() const
Definition: EEDetId.h:177
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
const GlobalPoint getPosition(CCGFloat depth) const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
const T & get() const
Definition: EventSetup.h:55
static const int MAX_IETA
Definition: EBDetId.h:122
void findRecHitNeighboursECAL(reco::PFRecHit &rh, const std::map< unsigned, unsigned > &sortedHits)
find rechit neighbours, using the hashed index
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
std::vector< std::vector< DetId > > neighboursEE_
for each ecal endcap rechit, keep track of the neighbours
void createRecHits(std::vector< reco::PFRecHit > &rechits, std::vector< reco::PFRecHit > &rechitsCleaned, edm::Event &, const edm::EventSetup &)
std::map< unsigned, unsigned >::const_iterator IDH
static int position[264][3]
Definition: ReadPGInfo.cc:509
DetId move(DetId cell, const CaloDirection &dir) const
double thresh_Barrel_
rechits with E &lt; threshold will not give rise to a PFRecHit
bool neighbourmapcalculated_
set to true in ecalNeighbArray
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
tuple status
Definition: ntuplemaker.py:245
x
Definition: VDTMath.h:216
EcalSubdetector
T x() const
Definition: PV3DBase.h:61
int ietaAbs() const
get the absolute value of the crystal ieta
Definition: EBDetId.h:42
tuple size
Write out results.
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell&#39;s volume.