CMS 3D CMS Logo

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