14 #include <FairLogger.h>
16 #include <Math/Point2D.h>
17 #include <Math/Point2Dfwd.h>
31 fMap->GeneratePadPlane();
35 : fMap(other.fMap), fEventID(other.fEventID), fGain(other.fGain), fLowGainFactor(other.fLowGainFactor),
36 fGETGain(other.fGETGain), fPeakingTime(other.fPeakingTime), fTBTime(other.fTBTime), fNumTbs(other.fNumTbs),
37 fTBEntrance(other.fTBEntrance), fTBPadPlane(other.fTBPadPlane), fResponse(other.fResponse),
38 fUseFastGain(other.fUseFastGain), fNoiseSigma(other.fNoiseSigma), fSaveCharge(other.fSaveCharge),
39 fDoConvolution(other.fDoConvolution), fAvgGainDeviation(other.fAvgGainDeviation)
45 for (Int_t padS = 0; padS <
fMap->GetNumPads(); padS++) {
48 std::make_unique<TH1F>(TString::Format(
"%d", padS), TString::Format(
"%d", padS),
fNumTbs, 0, maxTime);
69 for (
auto &point : vec)
71 LOG(info) <<
"Skipped " << (double)(vec.size() - numFilled) / vec.size() * 100 <<
"% of " << vec.size()
84 auto axis = hist.GetXaxis();
85 double binWidth = axis->GetBinWidth(10);
86 auto charge = std::make_unique<AtPadArray>();
88 for (
int kk = 1; kk <=
fNumTbs; ++kk) {
89 double nEle = hist.GetBinContent(kk);
100 for (
int nn = kk - 1; nn <
fNumTbs; ++nn) {
101 double binCenter = axis->GetBinCenter(kk);
102 double time = ((double)nn + 0.5) * binWidth - binCenter;
120 for (
int i = 0; i <
fNumTbs; ++i) {
146 "gain",
"pow([1]+1,[1]+1)/ROOT::Math::tgamma([1]+1)*pow((x/[0]),[1])*exp(-([1]+1)*(x/[0]))", 0,
154 TMath::Sqrt(TMath::Gamma(b + 3) / TMath::Gamma(b + 1) -
155 TMath::Gamma(b + 2) * TMath::Gamma(b + 2) / TMath::Gamma(b + 1) / TMath::Gamma(b + 1));
157 LOG(info) <<
"Gain: " <<
fGain;
158 LOG(info) <<
"GETGain: " <<
fGETGain;
160 LOG(info) <<
"TB Time: " <<
fTBTime;
166 for (Int_t padS = 0; padS <
fMap->GetNumPads(); padS++) {
169 std::make_unique<TH1F>(TString::Format(
"%d", padS), TString::Format(
"%d", padS),
fNumTbs, 0, maxTime);
184 if (point ==
nullptr)
190 auto pos =
XYPoint(coord.X(), coord.Y());
192 int padNum =
fMap->GetPadNum(pos);
193 if (padNum < 0 || padNum >=
fMap->GetNumPads())
196 double gain =
GetGain(padNum, charge);
200 fPadCharge[padNum]->Fill(eTime, gain * charge);
209 if (numElectrons <= 0)
220 for (Int_t i = 0; i < numElectrons; i++)
222 return g / numElectrons * lowGain;