Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-10 02:59:03

0001 #ifndef CaloSimAlgos_CaloSimParameters_h
0002 #define CaloSimAlgos_CaloSimParameters_h
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include <iosfwd>
0007 /**
0008 
0009    \class CaloSimParameters
0010 
0011    \brief Main class for Parameters in different subdetectors.
0012 
0013 */
0014 class CaloSimParameters {
0015 public:
0016   // note: sampling factor not used
0017   CaloSimParameters(double simHitToPhotoelectrons,
0018                     double photoelectronsToAnalog,
0019                     double samplingFactor,
0020                     double timePhase,
0021                     int readoutFrameSize,
0022                     int binOfMaximum,
0023                     bool doPhotostatistics,
0024                     bool syncPhase = true);
0025 
0026   CaloSimParameters(const edm::ParameterSet &p, bool skipPe2Fc = false);
0027 
0028   virtual ~CaloSimParameters() {}
0029 
0030   /// the factor which goes from whatever units the SimHit amplitudes
0031   /// are in (could be deposited GeV, real GeV, or photoelectrons)
0032   /// and converts to photoelectrons
0033   /// probably should make everything virtual, but this is enough for HCAL
0034   double simHitToPhotoelectrons() const { return simHitToPhotoelectrons_; }
0035   virtual double simHitToPhotoelectrons(const DetId &) const { return simHitToPhotoelectrons_; }
0036 
0037   /// the factor which goes from photoelectrons to whatever gets read by ADCs
0038   double photoelectronsToAnalog() const { return photoelectronsToAnalog_; }
0039   virtual double photoelectronsToAnalog(const DetId &detId) const { return photoelectronsToAnalog_; }
0040 
0041   /// the adjustment you need to apply to get the signal where you want it
0042   double timePhase() const { return timePhase_; }
0043 
0044   /// for now, the LinearFrames and trhe digis will be one-to-one.
0045   int readoutFrameSize() const { return readoutFrameSize_; }
0046 
0047   int binOfMaximum() const { return binOfMaximum_; }
0048 
0049   /// some datamixing apps need this to be set dynamically
0050   void setReadoutFrameSize(int frameSize) { readoutFrameSize_ = frameSize; }
0051   void setBinOfMaximum(int binOfMax) { binOfMaximum_ = binOfMax; }
0052 
0053   /// whether or not to apply Poisson statistics to photoelectrons
0054   bool doPhotostatistics() const { return doPhotostatistics_; }
0055 
0056   /// choice of the ADC time alignment (synchronous for LHC, asynchronous for
0057   /// test beams)
0058   bool syncPhase() const { return syncPhase_; }
0059 
0060 private:
0061   double simHitToPhotoelectrons_;
0062   double photoelectronsToAnalog_;
0063   double timePhase_;
0064   int readoutFrameSize_;
0065   int binOfMaximum_;
0066   bool doPhotostatistics_;
0067   bool syncPhase_;
0068 };
0069 
0070 std::ostream &operator<<(std::ostream &os, const CaloSimParameters &p);
0071 
0072 #endif