Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-19 09:24:44

0001 #ifndef TPC_TPCDAQDEFS_H
0002 #define TPC_TPCDAQDEFS_H
0003 
0004 #include "ChanMap.h"
0005 
0006 #include <map>
0007 #include <string>
0008 #include <vector>
0009 
0010 class TCanvas;
0011 class TPaveText;
0012 
0013 namespace TpcPrototypeDefs
0014 {
0015 //! TPC v1 FEE test stand decoder
0016 namespace FEEv2
0017 {
0018 static const unsigned int kPACKET_ID = 3000;
0019 
0020 static const unsigned int kPACKET_LENGTH = 137;
0021 static const unsigned int kN_CHANNELS = 256;
0022 static const unsigned int kSAMPLE_LENGTH = 128;
0023 
0024 static const unsigned int kN_FEES = 8;
0025 static const unsigned int kMaxPadY=16*8;
0026 static const unsigned int kMaxPadX=16;
0027 
0028 //! static R2 channel map
0029 static  TPCR2Map TpcR2Map;
0030 
0031 class SampleFit_PowerLawDoubleExp_PDFMaker
0032 {
0033  public:
0034   SampleFit_PowerLawDoubleExp_PDFMaker();
0035   ~SampleFit_PowerLawDoubleExp_PDFMaker();
0036   void MakeSectionPage(const std::string &title);
0037 
0038  private:
0039   TCanvas *m_canvas;
0040   TPaveText *m_pavedtext;
0041 };
0042 
0043 //! Power law double exp fit
0044 bool SampleFit_PowerLawDoubleExp(          //
0045     const std::vector<double> &samples,    //
0046     double &peak,                          //! peak amplitude.
0047     double &peak_sample,                   //! peak sample position. Fixed to the input value if NOT NAN
0048     double &pedestal,                      //! pedestal
0049     std::map<int, double> &parameters_io,  //! IO for fullset of parameters. If a parameter exist and not an NAN, the fit parameter will be fixed to that value. The order of the parameters are ("Amplitude 1", "Sample Start", "Power", "Peak Time 1", "Pedestal", "Amplitude 2", "Peak Time 2")
0050     const int verbosity = 0);
0051 
0052 // Abhisek's power-law + exp signal shape model
0053 double
0054 SignalShape_PowerLawExp(double *x, double *par);
0055 double
0056 SignalShape_PowerLawDoubleExp(double *x, double *par);
0057 
0058 }  // namespace FEEv2
0059 
0060 }  // namespace TpcPrototypeDefs
0061 
0062 #endif  //TPC_TPCDAQDEFS_H