Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-23 03:25:35

0001 #ifndef CastorSim_CastorHitCorrection_h
0002 #define CastorSim_CastorHitCorrection_h
0003 
0004 /** Applies a correction for time slewing
0005     Makes bigger signals come at a delayed time
0006 
0007  */
0008 
0009 #include "DataFormats/DetId/interface/DetId.h"
0010 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0011 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVHitCorrection.h"
0012 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVSimParameterMap.h"
0013 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
0014 #include <map>
0015 #include <vector>
0016 
0017 namespace CLHEP {
0018   class HepRandomEngine;
0019 }
0020 
0021 class CastorHitCorrection : public CaloVHitCorrection {
0022 public:
0023   typedef std::map<DetId, double> ChargeSumsByChannel;
0024 
0025   CastorHitCorrection(const CaloVSimParameterMap *parameterMap);
0026   ~CastorHitCorrection() override {}
0027 
0028   void fillChargeSums(MixCollection<PCaloHit> &hits);
0029 
0030   void fillChargeSums(const std::vector<PCaloHit> &hits);
0031 
0032   void clear();
0033 
0034   /// how much charge we expect from this hit
0035   double charge(const PCaloHit &hit) const;
0036 
0037   /// how much delay this hit will get
0038   double delay(const PCaloHit &hit, CLHEP::HepRandomEngine *) const override;
0039 
0040   /// which time bin the peak of the signal will fall in
0041   int timeBin(const PCaloHit &hit) const;
0042 
0043   /// simple average approximation
0044   double timeOfFlight(const DetId &id) const;
0045 
0046 private:
0047   const CaloVSimParameterMap *theParameterMap;
0048 
0049   ChargeSumsByChannel theChargeSumsForTimeBin[10];
0050 };
0051 
0052 #endif