8 #include <FairLogger.h>
10 #include <Math/Point2D.h>
11 #include <Math/Point2Dfwd.h>
12 #include <Math/Vector3D.h>
20 constexpr
auto cRED =
"\033[1;31m";
23 constexpr
auto cGREEN =
"\033[1;32m";
31 Double_t Sigma = TMath::Sqrt(2 * time / (R * C) + 2 * Dc * t_amp) * SigmaPercent;
32 Double_t rtTwo = TMath::Sqrt(2);
34 G / 4 * (TMath::Erf((xi + W / 2 - x0) / (rtTwo * Sigma)) - TMath::Erf((xi - W / 2 - x0) / (rtTwo * Sigma))) *
35 (TMath::Erf((yi + W / 2 - y0) / (rtTwo * Sigma)) - TMath::Erf((yi - W / 2 - y0) / (rtTwo * Sigma)));
46 if (AdjecentPads == 0) {
51 auto xElectron = coord.x();
52 auto yElectron = coord.y();
53 auto eTime = coord.z();
55 auto padNumber =
fMap->GetPadNum(
XYPoint{xElectron, yElectron});
57 if (padNumber < 0 || padNumber >=
fMap->GetNumPads()) {
59 padNumber =
fMap->GetPadNum(
XYPoint{xElectron + 0.001, yElectron + 0.001});
62 auto PadCenter =
fMap->CalcPadCenter(padNumber);
65 Double_t coords[Items];
66 for (Int_t n = 0; n < Items; n++) {
67 coords[n] = AdjecentPads * -2.2 + 2.2 * n;
70 Int_t numPads =
fMap->GetNumPads();
73 Double_t xPadCurrent, yPadCurrent;
74 for (Int_t i = 0; i < Items; i++) {
75 xPadCurrent = PadCenter.X() + coords[i];
76 for (Int_t j = 0; j < Items; j++) {
77 yPadCurrent = PadCenter.Y() + coords[j];
80 auto newpadNumber =
fMap->GetPadNum(
XYPoint{xPadCurrent, yPadCurrent});
83 if (newpadNumber < 0 || newpadNumber >= numPads || gAvg == 0) {
84 LOG(debug) <<
"Skipping electron...";
89 Double_t ChargeDispersed =
ChargeDispersion(gAvg, eTime, xElectron, yElectron, xPadCurrent, yPadCurrent);
90 fPadCharge[newpadNumber]->Fill(eTime, ChargeDispersed);
95 if (padNumber < 0 || padNumber >= numPads) {
96 LOG(debug) <<
"Skipping electron...";
105 LOG(debug) <<
"Exec of AtPulseGADGET";
108 Int_t nMCPoints = vec.size();
109 std::cout <<
" AtPulseGADGET: Number of Points " << nMCPoints << std::endl;
110 std::cout <<
" AtPulseGADGET: Number of Points (plus dispersion) " << (nMCPoints * Items * Items) << std::endl;
114 int skippedDispersion = 0;
115 for (
auto &point : vec) {
117 numFilled -= fSkippy;
118 skippedDispersion += fSkippy;
120 LOG(info) <<
"Skipped " << (double)(vec.size() - numFilled) / vec.size() * 100 <<
"% of " << vec.size()
123 LOG(info) <<
"Skipped dispersion " << (double)skippedDispersion / (nMCPoints * Items * Items) * 100 <<
"% of "
124 << (nMCPoints * Items * Items);