181 cout <<
"================CbmTrdRecoQa==============" << endl;
188 Int_t nPoints(0), nDigis(0), nClusters(0), nHits(0);
194 TH1D* digiMaxSpectrum =
new TH1D(
"digiMaxSpectrum",
"digiMaxSpectrum", 10000, 0, 1e-4);
195 TH1D* digiSpectrum =
new TH1D(
"digiSpectrum",
"digiSpectrum", 10000, 0, 1e-4);
197 LOG(info) <<
"CbmTrdRecoQa::Exec : MC-Points:" << nPoints;
198 LOG(info) <<
"CbmTrdRecoQa::Exec : Digis: " << nDigis;
199 LOG(info) <<
"CbmTrdRecoQa::Exec : Cluster: " << nClusters;
200 LOG(info) <<
"CbmTrdRecoQa::Exec : Hits: " << nHits;
201 Int_t moduleAddress(-1), moduleId(-1);
206 Int_t pointCounter = 0;
207 for (Int_t iPoint = 0; iPoint < nPoints; iPoint++) {
212 gGeoManager->FindNode((out[0] + in[0]) / 2, (out[1] + in[1]) / 2, (out[2] + in[2]) / 2);
213 if (!TString(gGeoManager->GetPath()).Contains(
"gas")) {
214 LOG(error) <<
"CbmTrdRecoQa::Exec: MC-track not in TRD! Node:" << TString(gGeoManager->GetPath()).Data()
215 <<
" gGeoManager->MasterToLocal() failed!";
225 std::map<Int_t, TGraphErrors*>::iterator it =
fModuleMapPoint.find(moduleAddress);
227 name.Form(
"ModuleAddress%05i", moduleAddress);
228 fModuleMap[moduleAddress] =
new TCanvas(name, name, 1000, 1000);
238 dummy->SetStats(kFALSE);
239 name.Form(
"ModuleAddress%05iDigis", moduleAddress);
245 name.Form(
"ModuleAddress%05iClusters", moduleAddress);
251 name.Form(
"ModuleAddress%05iHits", moduleAddress);
269 Double_t local_in[3];
270 Double_t local_out[3];
271 gGeoManager->MasterToLocal(in, local_in);
272 gGeoManager->MasterToLocal(out, local_out);
274 for (Int_t i = 0; i < 3; i++)
277 + 0.975 * (local_out[i] - local_in[i]);
279 Int_t row_in(0), row_out(0), col_in(0), col_out(0), sec_in(0), sec_out(0);
280 Double_t x_in(0), y_in(0), x_out(0), y_out(0);
283 if ((sec_in < 0) || (sec_in > 2)) {
284 cout <<
"sec_in:" << sec_in << endl;
291 if ((sec_out < 0) || (sec_out > 2)) {
292 cout <<
"sec_out:" << sec_out << endl;
307 fModuleMapPoint[moduleAddress]->SetPoint(pointCounter, ((col_in + x_in / W_in) + (col_out + x_out / W_out)) / 2.,
308 ((row_in + y_in / H_in) + (row_out + y_out / H_out)) / 2.);
312 new TLine(col_in + x_in / W_in, row_in + y_in / H_in, col_out + x_out / W_out, row_out + y_out / H_out);
328 printf(
"Address:%i ID:%i\n", moduleAddress, moduleId);
339 for (Int_t iDigi = 0; iDigi < nDigis; iDigi++) {
350 Int_t lastModule(0), iCounter(0);
351 for (Int_t iCluster = 0; iCluster < nClusters; iCluster++) {
352 Double_t charge(0), chargeMax(0);
356 for (Int_t iDigi = 0; iDigi < nDigisInCluster; iDigi++) {
361 if (iDigi == 0 && lastModule != moduleAddress) {
363 lastModule = moduleAddress;
372 if (charge > chargeMax) chargeMax = charge;
374 digiMaxSpectrum->Fill(chargeMax);
379 for (Int_t iHit = 0; iHit < nHits; iHit++) {
390 gGeoManager->FindNode(
pos[0],
pos[1],
pos[2] - 0.3);
391 Double_t local_pos[3];
392 gGeoManager->MasterToLocal(
pos, local_pos);
393 Int_t sec(-1), col(-1), row(-1);
396 Double_t
x(-1),
y(-1);
401 fModuleMapHit[moduleAddress]->SetPoint(modHit, col +
x / W, row +
y / H);
403 if (hit->
GetDx() <= W)
409 gDirectory->mkdir(
"TrdRecoQA");
410 gDirectory->cd(
"TrdRecoQA");
411 digiMaxSpectrum->Write(
"", TObject::kOverwrite);
412 digiSpectrum->Write(
"", TObject::kOverwrite);
413 map<Int_t, TCanvas*>::iterator it;
419 TPaveText* ptext =
new TPaveText(10, 3.5, 11, 4.0);
420 ptext->SetTextSize(0.035);
421 ptext->SetTextColor(15);
422 ptext->SetFillStyle(0);
423 ptext->SetLineColor(0);
424 ptext->AddText(name);
430 it->second->cd(1)->Update();
436 TPolyLine* pad = NULL;
440 for (Int_t iRow = 1; iRow <= nRow; iRow++) {
441 for (Int_t iCol = 1; iCol <= nCol; iCol++) {
442 Double_t charge =
fModuleMapDigi[it->first]->GetBinContent(iCol, iRow);
487 TPolyLine* pad = NULL;
490 const Double_t max_Range =
492 for (Int_t iRow = 1; iRow <= nRow; iRow++) {
493 for (Int_t iCol = 1; iCol <= nCol; iCol++) {
507 it->second->cd(3)->Update();
520 TPaveText* text =
new TPaveText(10, 2.0, 11, 2.5);
521 text->SetFillStyle(0);
522 text->SetLineColor(0);
523 text->SetTextSize(0.035);
525 TMultiGraph* mg =
new TMultiGraph();
534 mg->GetXaxis()->SetLimits(
fModuleMapDigi[it->first]->GetXaxis()->GetXmin(),
539 it->second->Update();
540 it->second->SaveAs(
"pics/" + (TString)(it->second->GetName()) +
".png");
541 it->second->Write(
"", TObject::kOverwrite);
544 gDirectory->cd(
"..");
546 Double_t rtime = timer.RealTime();
547 Double_t ctime = timer.CpuTime();
549 printf(
"\n\n******************** Reading Test **********************\n");
550 printf(
" RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime);
551 printf(
"*********************************************************\n\n");