CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DummyOOTPileupCorrection.cc
Go to the documentation of this file.
2 
3 #include "boost/serialization/export.hpp"
4 
6 
8  const HcalDetId& /* id */,
9  const double* inputCharge, const unsigned lenInputCharge,
10  const BunchXParameter* /* bcParams */, unsigned /* lenBcParams */,
11  unsigned /* firstTimeSlice */, unsigned /* nTimeSlices */,
12  double* correctedCharge, const unsigned lenCorrectedCharge,
13  bool* pulseShapeCorrApplied, bool* leakCorrApplied,
14  bool* readjustTiming) const
15 {
16  // Check the arguments
17  if (inputCharge == 0 || correctedCharge == 0 ||
18  lenCorrectedCharge < lenInputCharge ||
19  pulseShapeCorrApplied == 0 || leakCorrApplied == 0 ||
20  readjustTiming == 0)
21  throw cms::Exception(
22  "Invalid arguments in DummyOOTPileupCorrection::apply");
23 
24  // Perform the correction
25  for (unsigned i=0; i<lenInputCharge; ++i)
26  correctedCharge[i] = scale_ * inputCharge[i];
27 
28  // Tell the code that runs after this which additional
29  // corrections should be discarded
30  *pulseShapeCorrApplied = false;
31  *leakCorrApplied = false;
32 
33  // Tell the code that runs after this whether corrected
34  // amplitudes should be used for timing calculations
35  *readjustTiming = false;
36 }
37 
39 {
40  // Note the use of static_cast rather than dynamic_cast below.
41  // static_cast works faster and it is guaranteed to succeed here.
42  const DummyOOTPileupCorrection& r =
43  static_cast<const DummyOOTPileupCorrection&>(otherBase);
44  return descr_ == r.descr_ && scale_ == r.scale_;
45 }
46 
47 BOOST_CLASS_EXPORT_IMPLEMENT(DummyOOTPileupCorrection)
int i
Definition: DBlmapReader.cc:9
bool isEqual(const AbsOOTPileupCorrection &otherBase) const
void apply(const HcalDetId &id, const double *inputCharge, unsigned lenInputCharge, const BunchXParameter *bcParams, unsigned lenBcParams, unsigned firstTimeSlice, unsigned nTimeSlices, double *correctedCharge, unsigned lenCorrectedCharge, bool *pulseShapeCorrApplied, bool *leakCorrApplied, bool *readjustTiming) const