CMS 3D CMS Logo

HGCalRecHitSimpleAlgo.h
Go to the documentation of this file.
1 #ifndef RecoLocalCalo_HGCalRecAlgos_HGCalRecHitSimpleAlgo_HH
2 #define RecoLocalCalo_HGCalRecAlgos_HGCalRecHitSimpleAlgo_HH
3 
19 #include <iostream>
20 
22 public:
23  // default ctor
25  adcToGeVConstant_ = -1;
26  adcToGeVConstantIsSet_ = false;
27  }
28 
29  void setLayerWeights(const std::vector<float>& weights) override { weights_ = weights; }
30 
31  void setNoseLayerWeights(const std::vector<float>& weights) { weightsNose_ = weights; }
32 
33  void setADCToGeVConstant(const float value) override {
36  }
37 
38  // destructor
39  ~HGCalRecHitSimpleAlgo() override{};
40 
42  HGCRecHit makeRecHit(const HGCUncalibratedRecHit& uncalibRH, const uint32_t& flags = 0) const override {
44  throw cms::Exception("HGCalRecHitSimpleAlgoBadConfig")
45  << "makeRecHit: adcToGeVConstant_ not set before calling this method!";
46  }
47 
48  DetId baseid = uncalibRH.id();
49  unsigned layer = rhtools_.getLayerWithOffset(baseid);
50  bool hfnose = DetId::Forward == baseid.det() && HFNose == baseid.subdetId();
51 
52  // float clockToNsConstant = 25;
53  float energy = (hfnose ? (uncalibRH.amplitude() * weightsNose_[layer] * 0.001f)
54  : (uncalibRH.amplitude() * weights_[layer] * 0.001f));
55  float time = uncalibRH.jitter();
56 
57  //if(time<0) time = 0; // fast-track digi conversion
58 
59  HGCRecHit rh(uncalibRH.id(), energy, time);
60 
61  // Now fill flags
62  // all rechits from the digitizer are "good" at present
64 
65  return rh;
66  }
67 
68 private:
71  std::vector<float> weights_, weightsNose_;
72 };
73 #endif
HGCScintillatorDetId.h
HGCalRecHitSimpleAlgo::~HGCalRecHitSimpleAlgo
~HGCalRecHitSimpleAlgo() override
Definition: HGCalRecHitSimpleAlgo.h:39
HGCalRecHitSimpleAlgo::weightsNose_
std::vector< float > weightsNose_
Definition: HGCalRecHitSimpleAlgo.h:71
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HGCSiliconDetId.h
HGCalRecHitSimpleAlgo
Definition: HGCalRecHitSimpleAlgo.h:21
protons_cff.time
time
Definition: protons_cff.py:35
HFNoseDetId.h
HGCalRecHitSimpleAlgo::HGCalRecHitSimpleAlgo
HGCalRecHitSimpleAlgo()
Definition: HGCalRecHitSimpleAlgo.h:24
HGCalRecHitAbsAlgo::rhtools_
hgcal::RecHitTools rhtools_
Definition: HGCalRecHitAbsAlgo.h:34
HGCUncalibratedRecHit
Definition: HGCUncalibratedRecHit.h:7
HGCRecHit::setFlag
void setFlag(int flag)
set the flags (from Flags or ESFlags)
Definition: HGCRecHit.h:101
DetId
Definition: DetId.h:17
HGCalRecHitSimpleAlgo::setADCToGeVConstant
void setADCToGeVConstant(const float value) override
Definition: HGCalRecHitSimpleAlgo.h:33
HGCalRecHitSimpleAlgo::adcToGeVConstantIsSet_
bool adcToGeVConstantIsSet_
Definition: HGCalRecHitSimpleAlgo.h:70
HGCalRecHitAbsAlgo.h
HFNose
Definition: ForwardSubdetector.h:11
HLT_FULL_cff.weights
weights
Definition: HLT_FULL_cff.py:99207
mixOne_premix_on_sim_cfi.hfnose
hfnose
Definition: mixOne_premix_on_sim_cfi.py:297
HGCUncalibratedRecHit::id
DetId id() const
Definition: HGCUncalibratedRecHit.h:33
HGCUncalibratedRecHit::jitter
float jitter() const
Definition: HGCUncalibratedRecHit.h:25
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
HGCRecHit
Definition: HGCRecHit.h:14
HGCalRecHitSimpleAlgo::adcToGeVConstant_
float adcToGeVConstant_
Definition: HGCalRecHitSimpleAlgo.h:69
HGCRecHit::kGood
Definition: HGCRecHit.h:20
HGCalRecHitAbsAlgo
Definition: HGCalRecHitAbsAlgo.h:17
hgcal::RecHitTools::getLayerWithOffset
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:362
HcalDetId.h
value
Definition: value.py:1
HGCalRecHitSimpleAlgo::weights_
std::vector< float > weights_
Definition: HGCalRecHitSimpleAlgo.h:71
HGCalDetId.h
HGCalRecHitSimpleAlgo::setNoseLayerWeights
void setNoseLayerWeights(const std::vector< float > &weights)
Definition: HGCalRecHitSimpleAlgo.h:31
HGCUncalibratedRecHit::amplitude
float amplitude() const
Definition: HGCUncalibratedRecHit.h:23
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:245
Exception.h
HGCalRecHitSimpleAlgo::makeRecHit
HGCRecHit makeRecHit(const HGCUncalibratedRecHit &uncalibRH, const uint32_t &flags=0) const override
Compute parameters.
Definition: HGCalRecHitSimpleAlgo.h:42
DetId::Forward
Definition: DetId.h:30
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13168
HGCDataFrame.h
HGCalRecHitSimpleAlgo::setLayerWeights
void setLayerWeights(const std::vector< float > &weights) override
make rechits from dataframes
Definition: HGCalRecHitSimpleAlgo.h:29