CMS 3D CMS Logo

CaloCleaner.cc
Go to the documentation of this file.
2 
9 
16 
17 //-------------------------------------------------------------------------------
18 // define 'buildRecHit' functions used for different types of recHits
19 //-------------------------------------------------------------------------------
20 
21 template <typename T>
22 void CaloCleaner<T>::fill_correction_map(TrackDetMatchInfo *, std::map<uint32_t, float> *) {
23  assert(0); // CV: make sure general function never gets called;
24  // always use template specializations
25 }
26 
27 template <>
28 void CaloCleaner<EcalRecHit>::fill_correction_map(TrackDetMatchInfo *info, std::map<uint32_t, float> *cor_map) {
29  if (is_preshower_) {
30  for (std::vector<DetId>::const_iterator detId = info->crossedPreshowerIds.begin();
31  detId != info->crossedPreshowerIds.end();
32  ++detId) {
33  (*cor_map)[detId->rawId()] = 9999999; // just remove all energy (Below 0 is not possible)
34  }
35  } else {
36  for (std::vector<const EcalRecHit *>::const_iterator hit = info->crossedEcalRecHits.begin();
37  hit != info->crossedEcalRecHits.end();
38  hit++) {
39  // (*cor_map) [(*hit)->detid().rawId()] +=(*hit)->energy();
40  (*cor_map)[(*hit)->detid().rawId()] = (*hit)->energy();
41  }
42  }
43 }
44 
45 template <>
46 void CaloCleaner<HBHERecHit>::fill_correction_map(TrackDetMatchInfo *info, std::map<uint32_t, float> *cor_map) {
47  for (std::vector<const HBHERecHit *>::const_iterator hit = info->crossedHcalRecHits.begin();
48  hit != info->crossedHcalRecHits.end();
49  hit++) {
50  (*cor_map)[(*hit)->detid().rawId()] = (*hit)->energy();
51  }
52 }
53 
54 template <>
55 void CaloCleaner<HORecHit>::fill_correction_map(TrackDetMatchInfo *info, std::map<uint32_t, float> *cor_map) {
56  for (std::vector<const HORecHit *>::const_iterator hit = info->crossedHORecHits.begin();
57  hit != info->crossedHORecHits.end();
58  hit++) {
59  (*cor_map)[(*hit)->detid().rawId()] = (*hit)->energy();
60  }
61 }
62 
63 template <>
64 void CaloCleaner<HFRecHit>::fill_correction_map(TrackDetMatchInfo *info, std::map<uint32_t, float> *cor_map) {
65  return; // No corrections for HF
66 }
67 
68 template <>
69 void CaloCleaner<CastorRecHit>::fill_correction_map(TrackDetMatchInfo *info, std::map<uint32_t, float> *cor_map) {
70  return; // No corrections for Castor
71 }
72 
73 template <>
74 void CaloCleaner<ZDCRecHit>::fill_correction_map(TrackDetMatchInfo *info, std::map<uint32_t, float> *cor_map) {
75  return; // No corrections for Castor
76 }
77 
81 // no need for cleaning outside of tracker, so just a copy of the old collection
ZDCRecHit.h
CaloCleaner.h
CaloCleaner::fill_correction_map
void fill_correction_map(TrackDetMatchInfo *, std::map< uint32_t, float > *)
Definition: CaloCleaner.cc:22
HBHERecHitColCleaner
CaloCleaner< HBHERecHit > HBHERecHitColCleaner
Definition: CaloCleaner.cc:11
cms::cuda::assert
assert(be >=bs)
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
HFRecHitColCleaner
CaloCleaner< HFRecHit > HFRecHitColCleaner
Definition: CaloCleaner.cc:12
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HFRecHit.h
CaloCleaner
Definition: CaloCleaner.h:36
EcalRecHit.h
EcalRecHitColCleaner
CaloCleaner< EcalRecHit > EcalRecHitColCleaner
Definition: CaloCleaner.cc:10
HBHERecHit.h
CastorRecHitColCleaner
CaloCleaner< CastorRecHit > CastorRecHitColCleaner
Definition: CaloCleaner.cc:14
TrackDetMatchInfo
Definition: TrackDetMatchInfo.h:13
HORecHitColCleaner
CaloCleaner< HORecHit > HORecHitColCleaner
Definition: CaloCleaner.cc:13
HORecHit.h
ZDCRecHitColCleaner
CaloCleaner< ZDCRecHit > ZDCRecHitColCleaner
Definition: CaloCleaner.cc:15
CastorRecHit.h
hit
Definition: SiStripHitEffFromCalibTree.cc:88