1 #include "StFcsDbPulse.h"
43 if( tail == 0 ){
return;}
70 else{ LOG_WARN <<
"StFcsDbPulse::setTail - Invalid Tail value " << tail << endm; }
74 if( gae == 0 ){LOG_ERROR <<
"StFcsDbPulse::setTGraphAsymmErrors - Graph object cannot be zero" << endm;
return;}
76 if(adc<mAdcSaturation) { HighY=Yerr; }
77 else { HighY=YerrSat; }
78 gae->SetPointError(i,0,0,Yerr,HighY);
83 double ret = p[0]*exp(-0.5*pow((x[0]-p[1])/p[2],2));
85 double x1 = x[0] - p[1] -
mXoff1;
87 double a0 = p[0] * p[2];
90 double x2 = x[0] - p[1] -
mXoff2;
103 for(
int i=0; i<npulse; i++){
111 if( npars<5 ){LOG_WARN <<
"StFcsDbPulse::createPulse - npars must be greater than or equal to 5 paramaters" <<endm;
return 0;}
112 else if( xlow>=xhigh ){LOG_ERROR <<
"StFcsDbPulse::createPulse - Invalid range" <<endm;
return 0;}
118 if( value<=0 ){
return ceil( static_cast<double>(value+(Nvals*PadNums))/static_cast<double>(Nvals) );}
119 else{
return GenericPadPos(value-(Nvals*PadNums), Nvals, PadNums); }
136 else{ LOG_ERROR <<
"This only works for Ecal and Hcal" << endm;
return 0;}
139 return 4*(padrow-1)+padcol;
144 if( gae==0 ){
return -1; }
147 Double_t MinY = Ymax;
148 Double_t MaxY = Ymin;
149 for(
int i=0; i<gae->GetN(); ++i )
151 Double_t X; Double_t Y;
152 gae->GetPoint(i,X,Y);
153 if( X<xmin || X>xmax ){
continue;}
154 if( Y>MaxY ){ MaxY=Y; index=i;}
155 if( Y<MinY ){ MinY=Y; }
157 if( index<0 ){std::cout <<
"Unable to find a maximum ADC value" << std::endl;
return index;}
165 std::cout <<
"Constants"
169 std::cout <<
"TimebinInfo"
174 std::cout <<
"PulseInfo"
178 <<
"|Xoff1:" <<
Xoff1()
179 <<
"|Xoff2:" <<
Xoff2()
180 <<
"|Tau1:" <<
Tau1()
181 <<
"|Tau2:" <<
Tau2()
static double sqrtpi()
sqrt(TMath::Pi)
double mXoff1
pulse shape tail: x offset of first xexp function
StFcsDbPulse(const char *name="fcsPulse")
Constructor.
double nsecPerTB() const
nanoseconds per timebin
static Int_t getYMinMax(TGraphAsymmErrors *gae, Double_t &Ymin, Double_t &Ymax, Double_t xmin=-5, Double_t xmax=2000)
Finds minimum and maximum y-values in a TGraph and returns index for max y.
TF1 * createPulse(double xlow=0, double xhigh=1, int npars=5)
Function to create pulse shape for FCS, 5 parameters is minimum.
double BeamLengthSig() const
beam length sigma
double mP1
pulse shape tail: power of first xexp function
int Init()
Initialize object.
static double sqrt2pi()
sqrt(2*TMath::Pi)
double mXoff2
pulse shape tail: x offset of second xexp function
double mGSigma
pulse shape nominal sigma of Gaussian part
static void setTGraphAsymmErrors(TGraphAsymmErrors *gae, const int &i, const double &adc, double Yerr, double YerrSat)
Figure out and set the errors on FCS pulse data stored in a TGraphAsymmErrors object.
static int GenericPadPos(int value, int Nvals, int PadNums)
Function to tell you pad number when drawing multiple objects on the same pad.
double mTau2
pulse shape tail: scale of second xexp function
virtual ~StFcsDbPulse()
Destructor.
static int PadNum4x4(int det, int col, int row)
Function that gives pad number when drawing a specific detector id.
double mA1
pulse shape tail: height of first xexp function
double mA2
pulse shape tail: height of second xexp function
double multiPulseShape(double *x, double *p)
Multi-pulse shape function constant+gaus+xexp+xexp for many pulses.
double mTau1
pulse shape tail: scale of first xexp function
double pulseShape(double *x, double *p)
Single pulse shape gaus+xexp+xexp.
double mTBPerRC
number of timebins in one RHIC crossing
double mP2
pulse shape tail: power of second xexp function
void setTail(int tail)
Sets the variables needed by the sum of xexp functions that describe the tail of the pulse shape...
virtual void Print(Option_t *opt="") const
Print all the constants associated with this class.