Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:47

0001 //-----------------------------------------------------------------------
0002 //----------------------------------------------------------------------
0003 // File PulseFitWithFunction.h
0004 // ===========================================================
0005 // ==                                                       ==
0006 // ==     Class for a LIGHT weights method                  ==
0007 // ==                                                       ==
0008 // ==  Date:   July 16th 2003                               ==
0009 // ==  Author: Patrick Jarry                                ==
0010 // ==            ==
0011 // ==                                                       ==
0012 // ===========================================================
0013 /* This routine is used to fit the signal line
0014       shape of CMS barrel calorimeter
0015   The method used is the one described in note LPC 84-30 (Billoir 1984) :
0016     "Methode d'ajustement dans un probleme a parametrisation hierarchisee"
0017   In this class we calculate the amplitude maximum and the time of arrival
0018   of this maximum (done with function fit_electronic)
0019  */
0020 
0021 #ifndef PulseFitWithFunction_H
0022 #define PulseFitWithFunction_H
0023 
0024 #include <CalibCalorimetry/EcalLaserAnalyzer/interface/PulseFit.h>
0025 
0026 class PulseFitWithFunction : public TObject {
0027 public:
0028   // Default Constructor, mainly for Root
0029   PulseFitWithFunction();
0030 
0031   // Destructor: Does nothing
0032   ~PulseFitWithFunction() override;
0033 
0034   // Initialize
0035   virtual void init(int, int, int, int, double, double);
0036 
0037   // Compute amplitude of a channel
0038 
0039   virtual double doFit(double *);
0040 
0041   double fFunc_max;        // amplitude maximum as input of fit
0042   double fTim_max;         // time of amplitude maximum as input of fit
0043   double fAmp_fitted_max;  // amplitude maximum fitted
0044   double fTim_fitted_max;  // time of amplitude maximum fitted
0045   double fValue_tim_max;   // value of time of arrival of maximum from pol3 fit
0046   int fNumber_samp_max;    // number of the sample which is maximum
0047   double fSigma_ped;       // sigma of pedestal to be used in fit
0048 
0049   double getAmpl_parab() { return amp_parab; }
0050   double getTime_parab() { return tim_parab; }
0051 
0052   double getAmpl() { return fAmp_fitted_max; }
0053   double getTime() { return fTim_fitted_max; }
0054 
0055   double getMax_parab() { return amp_max; }
0056   int getSampMax_parab() { return imax; }
0057 
0058 private:
0059   double amp_max, amp_parab, tim_parab;
0060   int imax;
0061 
0062   int fNsamples;  // maximum number of samples into framelegth
0063 
0064   double fAlpha_laser;
0065   double fBeta_laser;
0066   double fAlpha_beam;
0067   double fBeta_beam;
0068   double fAlpha;
0069   double fBeta;
0070   int fNb_iter;             // maximum number of iterations
0071   int fNum_samp_bef_max;    // number of samples before maximum sample
0072   int fNum_samp_after_max;  // number of samples after  maximum sample
0073 
0074   double Fit_electronic(int, double *, double);
0075   void Fit_parab(double *, int, int, double *);
0076   double Electronic_shape(double);
0077 
0078   ClassDefOverride(PulseFitWithFunction, 0)  //!< The processed part of the class is persistant
0079 };
0080 
0081 #endif
0082 
0083 //-----------------------------------------------------------------------
0084 //----------------------------------------------------------------------