| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

EsPmtEffectPulseTool.h

Go to the documentation of this file.
00001 
00016 #ifndef ESPMTEFFECTPULSETOOL_H
00017 #define ESPMTEFFECTPULSETOOL_H 1
00018 
00019 #include "ElecSim/IEsPulseTool.h"
00020 #include "Event/ElecPmtPulse.h"
00021 #include "GaudiAlg/GaudiTool.h"
00022 #include "GaudiKernel/IRndmGenSvc.h"
00023 #include "GaudiKernel/RndmGenerators.h"
00024 #include "DataSvc/ICableSvc.h"
00025 #include "DataSvc/ISimDataSvc.h"
00026 #include "Context/TimeStamp.h"
00027 
00028 namespace DayaBay{
00029   class SimHitCollection;
00030   class ElecPulseCollection;
00031 }
00032 
00033 class EsPmtEffectPulseTool : public GaudiTool , virtual public IEsPulseTool
00034 {
00035 public:  
00036   
00037     EsPmtEffectPulseTool(const std::string& type,
00038                      const std::string& name,
00039                      const IInterface* parent);
00040                  
00041     virtual ~EsPmtEffectPulseTool();
00042     
00043     virtual StatusCode generatePulses(DayaBay::SimHitCollection*,
00044                                       DayaBay::ElecPulseCollection*);
00045     virtual StatusCode initialize();
00046     virtual StatusCode finalize();
00047 
00048  private:
00049 
00050     // Property CableSvcName - Name of the cable service (default="StaticCableSvc")
00051     std::string m_cableSvcName;    
00052     /* Property SimDataSvcName - Name of the simulation data service
00053      * that provides access to pmt properties (default="StaticSimDataSvc")
00054      */
00055     std::string m_simDataSvcName;    
00056 
00057     // user-defined PDF and associated bin edges for pre- and after-pulses
00058     // PDFs defined wrt main pulse time
00059     // default is single count in [-50ns,0ns] and [0us,10us], respectively
00060     std::vector<double> m_prePulsePdf;
00061     std::vector<double> m_prePulseEdges;
00062     std::vector<double> m_afterPulsePdf;
00063     std::vector<double> m_afterPulseEdges;
00064     std::vector<double> m_afterPulseTime;
00065     
00066     bool m_enablePrePulse;
00067     bool m_enableAfterPulse;
00068     
00069     // Mode for afterpulse amplitude distribution:
00070     // SinglePE: Fixed single p.e. amplitude with Gaussian smearing
00071     // PDF: Use amplitude PDF with peak at single p.e and long tail
00072     std::string m_afterPulseAmpMode;
00073     std::string m_darkPulseAmpMode;
00074     
00075     // PDFs for afterpulse amplitude
00076     std::vector<double> m_afterPulseAmpPdf;
00077     std::vector<double> m_afterPulseAmpEdges;
00078 
00079     // Property: EnableNonlinearAfterpulse
00080     // Applies nonlinear afterpulsing rate model if true
00081     bool m_enableNonlinearAfterpulse;
00082     // Property: LinearAfterpulseThreshold
00083     // Upper limit of linear afterpulsing in number of PE.
00084     double m_linearAfterpulseThreshold;
00085 
00086     // Property: EnableVeryLongTimeSuppression
00087     // Enable suppression of hit times in the far future
00088     bool m_enableVeryLongTimeSuppression;
00089     // Property: VeryLongTime
00090     // Definition of very long time for hit time suppression
00091     double m_veryLongTime; 
00092 
00093     //Weight of the exponential contribution to the spe response function
00094     double m_expWeight;
00095     // Decay time of the exponential
00096     double m_speExpDecay;
00097     double m_speCutoff;
00098 
00099     // CableSvc
00100     ICableSvc *m_cableSvc;
00101     // SimDataSvc
00102     ISimDataSvc *m_simDataSvc;
00103     
00104     // Random numbers
00105     Rndm::Numbers m_uni,m_gauss,m_exp;
00106     Rndm::Numbers m_randPrePulseTime,m_randAfterPulseTime;
00107 
00108     // electronic simulation beginning and end times, defined by ElecHeader
00109     TimeStamp m_simTimeEarliest;
00110     TimeStamp m_simTimeLatest;
00111 
00112     // DWL: Size of PMT hits counting window
00113     double m_timeInterval;
00114 
00115     DayaBay::ElecPulse* makePrePulse  (DayaBay::ElecPulse* simpulse,
00116                                        const DayaBay::PmtSimData& pmtData);
00117     DayaBay::ElecPulse* makeAfterPulse(DayaBay::ElecPulse* simpulse,
00118                                        const DayaBay::PmtSimData& pmtData);
00119     DayaBay::ElecPulse* makeDarkPulse (const DayaBay::ElecChannelId& channelId,
00120                                        const DayaBay::PmtSimData& pmtData);
00121     float  PulseAmp(float weight, float gain, float gainFwhm);
00122     double ConvertPdfRand(double rand, std::vector<double> pdf, std::vector<double> edges);
00123     double ConvertPdfRand01(double rand, std::vector<double> pdf, std::vector<double> edges);
00124     int PoissonRand(double mean);
00125     // DWL: computing number of after-pulses based on the charge of the primary pulse
00126     double NumAfterPulse(const int numPmtHit);
00127     // Get afterpulse amplitude PDF
00128     void getAfterPulseAmpPdf(std::vector<double>& pdf);
00129     void getAfterPulseAmpEdges(std::vector<double>& edges);
00130 };
00131 
00132 #endif // ESPMTEFFECTPULSETOOL_H
00133 
00134 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:49:26 2011 for ElecSim by doxygen 1.4.7