25 #include "TClonesArray.h"
26 #include "TDirectory.h"
31 #include "TGraphErrors.h"
40 #include "TStopwatch.h"
51 #include "CbmTofHit.h"
53 #include "TDatabasePDG.h"
60 #include "KFPTrackVector.h"
61 #include "KFParticleTopoReconstructor.h"
78 KFParticleTopoReconstructor* tr,
89 , fRecoLevel(recoLevel)
91 , fEventStats(EventStats)
145 TDirectory* currentDir = gDirectory;
149 gDirectory->cd(
"Models");
151 histodir = gDirectory;
153 gDirectory->mkdir(
"MultiscatteringModel");
154 gDirectory->cd(
"MultiscatteringModel");
155 gDirectory->mkdir(fModeName);
156 gDirectory->cd(fModeName);
159 TString tname =
"PerEvent";
160 if (fEventStats != 1)
162 TString(
"Each ") + TString::Itoa(fEventStats, 10) + TString(
" events");
163 gDirectory->mkdir(tname);
164 gDirectory->cd(tname);
168 int CurrentIndex = 0;
170 IndexSigt = CurrentIndex;
171 histo1D[CurrentIndex] =
172 new TH1F(
"sigma_t",
"Event-by-event sigma_t", 300, 0., 3.);
173 histo1D[CurrentIndex]->SetXTitle(
"sigma_t (GeV)");
174 histo1D[CurrentIndex]->SetYTitle(
"Entries");
178 IndexSigz = CurrentIndex;
179 histo1D[CurrentIndex] =
180 new TH1F(
"sigma_z",
"Event-by-event sigma_z", 300, 0., 15.);
181 histo1D[CurrentIndex]->SetXTitle(
"sigma_z (GeV)");
182 histo1D[CurrentIndex]->SetYTitle(
"Entries");
186 IndexQz = CurrentIndex;
187 histo1D[CurrentIndex] =
new TH1F(
"Qz",
"Event-by-event Qz", 300, 0., 10.);
188 histo1D[CurrentIndex]->SetXTitle(
"Q_{z} (GeV)");
189 histo1D[CurrentIndex]->SetYTitle(
"Entries");
192 IndexPt = CurrentIndex;
193 histo1D[CurrentIndex] =
new TH1F(
"f(p_{t})",
"pt distribution", 300, 0., 5.);
194 histo1D[CurrentIndex]->SetXTitle(
"p_{t} (GeV)");
195 histo1D[CurrentIndex]->SetYTitle(
"Entries");
198 IndexPz = CurrentIndex;
199 histo1D[CurrentIndex] =
200 new TH1F(
"f(p_{z})",
"pz distribution", 300, -20., 20.);
201 histo1D[CurrentIndex]->SetXTitle(
"p_{z} (GeV)");
202 histo1D[CurrentIndex]->SetYTitle(
"Entries");
205 IndexY = CurrentIndex;
206 histo1D[CurrentIndex] =
207 new TH1F(
"dN/dy",
"rapidity distribution", 300, -10., 10.);
208 histo1D[CurrentIndex]->SetXTitle(
"y");
209 histo1D[CurrentIndex]->SetYTitle(
"Entries");
213 IndexModelPt = CurrentIndex;
214 histo1D[CurrentIndex] =
215 new TH1F(
"Model f(p_{t})",
"Model pt distribution", 300, 0., 5.);
216 histo1D[CurrentIndex]->SetXTitle(
"p_{t} (GeV)");
217 histo1D[CurrentIndex]->SetYTitle(
"Entries");
220 IndexModelPz = CurrentIndex;
221 histo1D[CurrentIndex] =
222 new TH1F(
"Model f(p_{z})",
"Model pz distribution", 300, -20., 20.);
223 histo1D[CurrentIndex]->SetXTitle(
"p_{z} (GeV)");
224 histo1D[CurrentIndex]->SetYTitle(
"Entries");
227 IndexModelY = CurrentIndex;
228 histo1D[CurrentIndex] =
229 new TH1F(
"Model dN/dy",
"Model rapidity distribution", 300, -10., 10.);
230 histo1D[CurrentIndex]->SetXTitle(
"y");
231 histo1D[CurrentIndex]->SetYTitle(
"Entries");
235 IndexYPt = CurrentIndex;
236 histo2D[CurrentIndex] =
237 new TH2F(
"y-pt",
"y-pt distribution", 100, -3., 3., 100, 0., 5.);
238 histo2D[CurrentIndex]->SetXTitle(
"y");
239 histo2D[CurrentIndex]->SetYTitle(
"p_t (GeV)");
242 IndexModelYPt = CurrentIndex;
243 histo2D[CurrentIndex] =
new TH2F(
244 "Model y-pt",
"Model y-pt distribution", 100, -3., 3., 100, 0., 5.);
245 histo2D[CurrentIndex]->SetXTitle(
"y");
246 histo2D[CurrentIndex]->SetYTitle(
"p_t (GeV)");
249 gDirectory->cd(
"..");
250 gDirectory->cd(
"..");
251 gDirectory->cd(
"..");
253 gDirectory = currentDir;
258 ycm = 0.5 *
log((1. + betacm) / (1. - betacm));
263 std::cout <<
"ekin = " << ekin <<
"\n";
264 std::cout <<
"ycm = " << ycm <<
"\n";
268 paramsLocal.resize(3);
269 paramsGlobal.resize(3);
270 for (
int i = 0;
i < 3; ++
i) {
271 paramsLocal[
i] = paramsGlobal[
i] = 0.;
273 totalGlobal = totalLocal = 0;
284 flistMCTracks =
dynamic_cast<TClonesArray*
>(fManger->GetObject(
"MCTrack"));
314 std::cout <<
"sigt = " << sigt <<
"\n";
315 std::cout <<
"sigz = " << sigz <<
"\n";
316 std::cout <<
"qz = " <<
p0cm - qz <<
"\n";
319 for (
int i = 0;
i < 3; ++
i) {
333 std::cout <<
"sigt = " << sigt <<
"\n";
334 std::cout <<
"sigz = " << sigz <<
"\n";
335 std::cout <<
"qz = " <<
p0cm - qz <<
"\n";
385 if (RecoLevel == -1) {
386 vector<CbmMCTrack> vRTracksMC;
388 std::cout <<
"MC tracks: " << nTracksMC <<
"\n";
389 vRTracksMC.resize(nTracksMC);
390 for (
int iTr = 0; iTr < nTracksMC; iTr++)
394 for (
int iTr = 0; iTr < nTracksMC; iTr++) {
396 if (vRTracksMC[iTr].GetPdgCode() ==
PPDG
397 && vRTracksMC[iTr].GetMotherId() == -1) {
399 double pt = vRTracksMC[iTr].GetPt();
400 double ty = vRTracksMC[iTr].GetRapidity() -
ycm;
402 TMath::Sqrt(vRTracksMC[iTr].GetMass() * vRTracksMC[iTr].GetMass()
422 for (
int itype = 2; itype <= 3; ++itype) {
424 const kfvector_int& pdgs = tr.PDG();
425 for (
unsigned int ind = 0; ind < pdgs.size(); ++ind) {
426 int iPDG = pdgs[ind];
430 double pt = tr.Pt(ind);
431 double p = tr.P(ind);
432 double m = TDatabasePDG::Instance()->GetParticle(iPDG)->Mass();
433 double p0 = TMath::Sqrt(
m *
m + p * p);
434 double ty = 0.5 *
log((p0 + p) / (p0 - p)) -
ycm;
435 double pz = TMath::Sqrt(
m *
m + pt * pt) * TMath::SinH(ty);