CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
std::vector< DetId > crossedPreshowerIds
static const TGPicture * info(bool iBackgroundIsBlack)
CaloCleaner< CastorRecHit > CastorRecHitColCleaner
Definition: CaloCleaner.cc:14
void fill_correction_map(TrackDetMatchInfo *, std::map< uint32_t, float > *)
Definition: CaloCleaner.cc:22
std::vector< const HBHERecHit * > crossedHcalRecHits
CaloCleaner< HORecHit > HORecHitColCleaner
Definition: CaloCleaner.cc:13
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CaloCleaner< HBHERecHit > HBHERecHitColCleaner
Definition: CaloCleaner.cc:11
assert(be >=bs)
CaloCleaner< EcalRecHit > EcalRecHitColCleaner
Definition: CaloCleaner.cc:10
std::vector< const EcalRecHit * > crossedEcalRecHits
hits in detector elements crossed by a track
CaloCleaner< ZDCRecHit > ZDCRecHitColCleaner
Definition: CaloCleaner.cc:15
CaloCleaner< HFRecHit > HFRecHitColCleaner
Definition: CaloCleaner.cc:12
std::vector< const HORecHit * > crossedHORecHits