Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:08

0001 #ifndef CondFormats_HcalObjects_DummyOOTPileupCorrection_h
0002 #define CondFormats_HcalObjects_DummyOOTPileupCorrection_h
0003 
0004 #include <string>
0005 
0006 #include "boost/serialization/version.hpp"
0007 
0008 #include "CondFormats/HcalObjects/interface/AbsOOTPileupCorrection.h"
0009 
0010 class DummyOOTPileupCorrection : public AbsOOTPileupCorrection {
0011 public:
0012   // Constructor
0013   inline DummyOOTPileupCorrection(const std::string& itemDescription, const double scale)
0014       : descr_(itemDescription), scale_(scale) {}
0015 
0016   // Destructor
0017   inline ~DummyOOTPileupCorrection() override {}
0018 
0019   // Inspectors
0020   inline const std::string& description() const { return descr_; }
0021   inline double getScale() const { return scale_; }
0022 
0023   // Main correction function
0024   void apply(const HcalDetId& id,
0025              const double* inputCharge,
0026              unsigned lenInputCharge,
0027              const BunchXParameter* bcParams,
0028              unsigned lenBcParams,
0029              unsigned firstTimeSlice,
0030              unsigned nTimeSlices,
0031              double* correctedCharge,
0032              unsigned lenCorrectedCharge,
0033              bool* pulseShapeCorrApplied,
0034              bool* leakCorrApplied,
0035              bool* readjustTiming) const override;
0036 
0037   // Are we using charge or energy?
0038   inline bool inputIsEnergy() const override { return false; }
0039 
0040 protected:
0041   // Comparison function must be implemented
0042   bool isEqual(const AbsOOTPileupCorrection& otherBase) const override;
0043 
0044 public:
0045   // Default constructor needed for serialization.
0046   // Do not use in application code.
0047   inline DummyOOTPileupCorrection() {}
0048 
0049 private:
0050   std::string descr_;
0051   double scale_;
0052 
0053   friend class boost::serialization::access;
0054 
0055   template <class Archive>
0056   inline void serialize(Archive& ar, unsigned /* version */) {
0057     boost::serialization::base_object<AbsOOTPileupCorrection>(*this);
0058     ar& descr_& scale_;
0059   }
0060 };
0061 
0062 BOOST_CLASS_VERSION(DummyOOTPileupCorrection, 1)
0063 BOOST_CLASS_EXPORT_KEY(DummyOOTPileupCorrection)
0064 
0065 #endif  // CondFormats_HcalObjects_DummyOOTPileupCorrection_h