Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:21

0001 #ifndef CaloSimAlgos_CaloVNoiseSignalGenerator_h
0002 #define CaloSimAlgos_CaloVNoiseSignalGenerator_h
0003 
0004 #include "CalibFormats/CaloObjects/interface/CaloSamples.h"
0005 #include <vector>
0006 
0007 namespace CLHEP {
0008   class HepRandomEngine;
0009 }
0010 
0011 class CaloVNoiseSignalGenerator {
0012 public:
0013   CaloVNoiseSignalGenerator();
0014   virtual ~CaloVNoiseSignalGenerator() {}
0015 
0016   ///  fill theNoiseSignals with one event's worth of noise, in units of pe
0017   void fillEvent(CLHEP::HepRandomEngine *);
0018 
0019   void fillEvent();  // don't need random engine for some tasks
0020 
0021   void getNoiseSignals(std::vector<CaloSamples> &noiseSignals) { noiseSignals = theNoiseSignals; }
0022 
0023   bool contains(const DetId &detId) const;
0024 
0025   /// if you want to externally fill signals for the event, call this
0026   /// before fillEvent gets called.
0027   void setNoiseSignals(const std::vector<CaloSamples> &noiseSignals);
0028 
0029 protected:
0030   /// if you want to fill signals on demand, override this
0031   /// subclass is responsible for clearing theNoiseSignals before adding
0032   virtual void fillNoiseSignals(CLHEP::HepRandomEngine *) = 0;
0033   virtual void fillNoiseSignals() = 0;
0034   std::vector<CaloSamples> theNoiseSignals;
0035 
0036 private:
0037   void fillDetIds();
0038   std::vector<unsigned int> theDetIds;
0039 };
0040 
0041 #endif