Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:38

0001 #ifndef CASTORSIMPLERECALGO_H
0002 #define CASTORSIMPLERECALGO_H 1
0003 
0004 #include "DataFormats/HcalDigi/interface/CastorDataFrame.h"
0005 #include "DataFormats/HcalRecHit/interface/CastorRecHit.h"
0006 #include "CalibFormats/CastorObjects/interface/CastorCoder.h"
0007 #include "CalibFormats/CastorObjects/interface/CastorCalibrations.h"
0008 #include "CalibCalorimetry/CastorCalib/interface/CastorPulseContainmentCorrection.h"
0009 #include <memory>
0010 
0011 /** \class CastorSimpleRecAlgo
0012 
0013    This class reconstructs RecHits from Digis for CASTOR by addition
0014    of selected time samples, pedestal subtraction, and gain application. The
0015    time of the hit is reconstructed using a weighted peak bin calculation
0016    supplemented by precise time lookup table. A consumer of this class also
0017    has the option of correcting the reconstructed time for energy-dependent
0018    time slew associated with the QIE.
0019 
0020    \author P. Katsas (Univ. of Athens) 
0021 */
0022 class CastorSimpleRecAlgo {
0023 public:
0024   /** Full featured constructor for HB/HE and HO (HPD-based detectors) */
0025   CastorSimpleRecAlgo(
0026       int firstSample, int samplesToAdd, bool correctForTimeslew, bool correctForContainment, float fixedPhaseNs);
0027   /** Simple constructor for PMT-based detectors */
0028   CastorSimpleRecAlgo(int firstSample, int samplesToAdd);
0029 
0030   CastorRecHit reconstruct(const CastorDataFrame& digi,
0031                            const CastorCoder& coder,
0032                            const CastorCalibrations& calibs) const;
0033 
0034   // sets rechit saturation status bit on if ADC count is >= maxADCvalue
0035   void checkADCSaturation(CastorRecHit& rechit, const CastorDataFrame& digi, const int& maxADCvalue) const;
0036 
0037   //++++ Saturation Correction +++++
0038   // recover pulse shape if ADC count is >= masADCvalue
0039   void recoverADCSaturation(CastorRecHit& rechit,
0040                             const CastorCoder& coder,
0041                             const CastorCalibrations& calibs,
0042                             const CastorDataFrame& digi,
0043                             const int& maxADCvalue,
0044                             const double& satCorrConst) const;
0045 
0046   void resetTimeSamples(int f, int t) {
0047     firstSample_ = f;
0048     samplesToAdd_ = t;
0049   }
0050 
0051 private:
0052   int firstSample_, samplesToAdd_;
0053   bool correctForTimeslew_;
0054   std::unique_ptr<CastorPulseContainmentCorrection> pulseCorr_;
0055 };
0056 
0057 #endif