48 std::cout <<
"init init" << std::endl;
50 FairRootManager* rm = FairRootManager::Instance();
62 fPmt = (TClonesArray*)rm->GetObject(
"NeulandCalData");
75 std::ostringstream hss;
76 hss <<
"h_p" << pln + 1 <<
"b" << bar + 1;
77 TString hname = hss.str();
79 std::ostringstream hssq;
80 hssq <<
"hq_p" << pln + 1 <<
"b" << bar + 1;
81 TString hnameq = hssq.str();
83 hTimeRes[pln][bar] =
new TH1F(hname, hname, 1000, -20., 20.);
84 hTimeResQ[pln][bar] =
new TH2F(hnameq, hnameq, 400, 0, 1000, 400, -20., 20.);
105 std::cout << std::endl;
106 std::cout <<
"done 1" << std::endl;
118 Int_t nHits =
fPmt->GetEntries();
122 Double_t fCharge1[300] = { 0. }, fCharge2[300] = { 0. };
123 Double_t fTime1[300] = { 0. }, fTime2[300] = { 0. };
131 for (Int_t i = 0; i < nHits; i++)
139 Int_t iPlane = (hit->
GetBarId() - 1) / 50;
140 Int_t iBar = (hit->
GetBarId() - 1) % 50;
141 Int_t iSide = hit->
GetSide() - 1;
148 fCharge1[iPlane * 50 + iBar] = hit->
GetQdc();
149 fTime1[iPlane * 50 + iBar] = hit->
GetTime() -
wlk(fCharge1[iPlane * 50 + iBar]);
154 fCharge2[iPlane * 50 + iBar] = hit->
GetQdc();
155 fTime2[iPlane * 50 + iBar] = hit->
GetTime() -
wlk(fCharge2[iPlane * 50 + iBar]);
168 Double_t t1 = fTime1[pl * 50 + bar - 1];
169 Double_t t2 = fTime2[pl * 50 + bar - 1];
170 Double_t t3 = fTime1[pl * 50 + bar];
171 Double_t t4 = fTime2[pl * 50 + bar];
173 Double_t qdc12 = sqrt(fCharge1[pl * 50 + bar - 1] * fCharge2[pl * 50 + bar - 1]);
174 Double_t qdc34 = sqrt(fCharge1[pl * 50 + bar] * fCharge2[pl * 50 + bar]);
177 if (t1 > 0 && t2 > 0 && t3 > 0 && t4 > 0 && qdc12 > 75. && qdc34 > 75.)
180 if (pl % 2 == 0 && mult[pl] > 10)
182 hTimeRes[pl][bar]->Fill((t3 + t4) / 2. - (t1 + t2) / 2.);
183 hTimeResQ[pl][bar]->Fill(qdc34, (t3 + t4) / 2. - (t1 + t2) / 2.);
185 if (pl % 2 == 1 && mult[pl] > 10)
187 hTimeRes[pl][bar]->Fill((t3 + t4) / 2. - (t1 + t2) / 2.);
188 hTimeResQ[pl][bar]->Fill(qdc34, (t3 + t4) / 2. - (t1 + t2) / 2.);
192 if (
hTimeRes[pl][bar]->GetEntries() > 3000)
199 std::cout << std::endl;
200 std::cout <<
"bars done: " <<
bars_done << std::endl;
203 Int_t a =
hTimeRes[pl][bar]->GetEntries();
205 Double_t ampli =
hTimeRes[pl][bar]->GetMaximum();
206 Int_t binmax =
hTimeRes[pl][bar]->GetMaximumBin();
207 Double_t posi =
hTimeRes[pl][bar]->GetXaxis()->GetBinCenter(binmax);
209 Double_t sigma = 0.150;
210 Double_t min = posi - 1.0;
211 Double_t max = posi + 1.0;
213 std::cout <<
"position of peak: " << posi <<
" " << ampli << std::endl;
215 std::ostringstream fss;
216 fss <<
"f_p" << pl + 1 <<
"b" << bar + 1;
217 TString fname = fss.str();
221 fitfunc[pl][bar] =
new TF1(fname,
"gaus");
222 fitfunc[pl][bar]->SetParameters(ampli, posi, sigma);
226 fitfunc[pl][bar] =
new TF1(fname,
"gaus(0)+gaus(3)");
227 fitfunc[pl][bar]->SetParameters(ampli, posi - 0.3, sigma, ampli, posi + 0.3, sigma);
232 Double_t nmax =
fitfunc[pl][bar]->GetParameter(0);
233 Double_t mean =
fitfunc[pl][bar]->GetParameter(1);
234 Double_t tres =
fitfunc[pl][bar]->GetParameter(2);
238 std::ofstream timeres_file(
"timeres.txt", std::ios::app);
240 timeres_file <<
"time res p" << pl + 1 <<
"b" << bar + 1 <<
" " << nmax <<
" " << mean <<
" "
241 << tres << std::endl;
243 timeres_file.close();
275 Double_t par1 = 3.34290e+01;
276 Double_t par2 = -4.48725e+05;
277 Double_t par3 = -2.07310e+02;
278 Double_t par4 = 2.48974e+02;
279 Double_t par5 = 6.36355e-03;
280 Double_t par6 = -2.93865e-05;
282 if (x > 0 && x < 400)
283 y = par2 * TMath::Power(x, par3) + par4 / x + par5 * x + par6 * x * x;