Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:15:08

0001 #ifndef TPC_TPCDAQDEFS_H
0002 #define TPC_TPCDAQDEFS_H
0003 
0004 #include <stdint.h>
0005 #include <map>
0006 #include <string>
0007 #include <utility>  // std::pair, std::make_pair
0008 #include <vector>
0009 
0010 class TCanvas;
0011 class TPaveText;
0012 
0013 namespace TPCDaqDefs
0014 {
0015 //! TPC v1 FEE test stand decoder
0016 namespace FEEv1
0017 {
0018 static const unsigned int kPACKET_ID = 1024;
0019 static const unsigned int kPACKET_LENGTH = 137;
0020 static const unsigned int kN_CHANNELS = 256;
0021 static const unsigned int kSAMPLE_LENGTH = 128;
0022 
0023 static const unsigned int kMaxPadX = 50;
0024 static const unsigned int kMaxPadY = 12;
0025 std::pair<int, int> SAMPAChan2PadXY(uint32_t fee_channel);
0026 
0027 class SampleFit_PowerLawDoubleExp_PDFMaker
0028 {
0029 public:
0030   SampleFit_PowerLawDoubleExp_PDFMaker();
0031   ~SampleFit_PowerLawDoubleExp_PDFMaker();
0032   explicit SampleFit_PowerLawDoubleExp_PDFMaker(const SampleFit_PowerLawDoubleExp_PDFMaker&) = delete;
0033   SampleFit_PowerLawDoubleExp_PDFMaker& operator=(const SampleFit_PowerLawDoubleExp_PDFMaker&) = delete;
0034   void MakeSectionPage(const std::string & title);
0035 private:
0036   TCanvas * m_canvas;
0037   TPaveText * m_pavedtext;
0038 };
0039 
0040 //! Power law double exp fit
0041 bool SampleFit_PowerLawDoubleExp(          //
0042     const std::vector<double> &samples,    //
0043     double &peak,                          //! peak amplitude.
0044     double &peak_sample,                   //! peak sample position. Fixed to the input value if NOT NAN
0045     double &pedestal,                      //! pedestal
0046     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")
0047     const int verbosity = 0);
0048 
0049 // Abhisek's power-law + exp signal shape model
0050 double
0051 SignalShape_PowerLawExp(double *x, double *par);
0052 double
0053 SignalShape_PowerLawDoubleExp(double *x, double *par);
0054 
0055 }  // namespace FEEv1
0056 
0057 }  // namespace TPCDaqDefs
0058 
0059 #endif  //TPC_TPCDAQDEFS_H