86 int tmp[10] = {5, 7, 3, 8, 6, 2, 4, 1, 9, 14};
87 for (
int i = 0;
i < 10;
i++){
97 gStyle->SetCanvasBorderMode(0);
98 gStyle->SetCanvasBorderSize(1);
99 gStyle->SetCanvasColor(0);
101 YZ =
new TCanvas (
"YZ",
"YZ Side View", -1, 0, 500, 500);
102 YZ->Range(-5.0, -50.0, 105.0, 50.0);
106 XZ =
new TCanvas (
"XZ",
"XZ Top View", -1, 500, 500, 500);
107 XZ->Range(-5.0, -50.0, 105.0, 50.0);
111 YX =
new TCanvas (
"YX",
"YX Front View", -506, 0, 500, 500);
112 YX->Range(-50.0, -50.0, 50.0, 50.0);
117 XYZ =
new TCanvas (
"XYZ",
"XYZ 3D View", -500, 500, 500, 500);
118 XYZ->Range(-5.0, -50.0, 115.0, 60.0);
159 int NRegMCTracks = 0;
162 if (fVerbose >= 10) {
163 cout <<
"Only reconstructable tracks are shown." << endl;
164 cout <<
"Red - primary p > 0.5 - (first iteration)" << endl;
165 cout <<
"Blue - primary p < 0.5 - (second iteration)" << endl;
166 cout <<
"Green - secondary p > 0.5 - (third\\first iteration)" << endl;
167 cout <<
"Gray - secondary p < 0.5 - (third\\second iteration)" << endl;
170 for( vector<CbmL1MCTrack>::iterator it =
L1.vMCTracks.begin(); it !=
L1.vMCTracks.end(); ++it){
177 if( T.
p<0.1 )
continue;
178 pline.SetLineColor(kRed);
179 if( T.
p<0.5 ) pline.SetLineColor(kBlue);
180 if( T.
mother_ID != -1) pline.SetLineColor(8);
181 if(( T.
mother_ID != -1) && ( T.
p<0.5 )) pline.SetLineColor(12);
182 if (fVerbose >= 1) cout <<
"MC Track: p = " << T.
p <<
" mother_ID = " << T.
mother_ID <<
" PDG = " << T.
pdg <<
" x,y,z = (" << T.
x <<
", " << T.
y <<
", " << T.
z <<
")" << endl;
192 int npoints = T.
Points.size();
193 if (fVerbose >= 10) cout <<
" NMCPoints = " << npoints << endl;
194 if( npoints<1 )
continue;
196 vector<double> lx, ly, lz;
197 lx.push_back(par[0]);
198 ly.push_back(par[1]);
199 lz.push_back(par[5]);
205 for (
int ih = 0; ih < T.
StsHits.size(); ih++)
209 for(
int ip=0; ip<npoints; ip++){
220 static float pz = -1;
221 if (
fabs(pz - p.
z) > 1.0) cout <<
"-- ";
222 cout <<
"point.z = " << p.
z << endl;
226 double Zfrst = par[5];
227 double Zlast = par1[5];
229 if( step>
fabs(Zfrst-Zlast)/5 ) step =
fabs(Zfrst-Zlast)/5;
230 if( Zlast<par[5] ) step = -step;
231 while(
fabs( par[5] - Zlast) >
fabs(step) ){
232 double znxt = par[5]+step;
235 double w =
fabs(znxt-Zfrst);
236 double w1 =
fabs(znxt-Zlast);
237 if( w+w1 < 1.e-3 ){ w=1; w1=0; }
238 float xl = ( w1*par[0] + w*par1[0])/(w+w1);
239 float yl = ( w1*par[1] + w*par1[1])/(w+w1);
240 float zl = ( w1*par[5] + w*par1[5])/(w+w1);
241 if ((
fabs(xl) > 50.0)||(
fabs(yl) > 50.0)){
247 lx.push_back( ( w1*par[0] + w*par1[0])/(w+w1) );
248 ly.push_back( ( w1*par[1] + w*par1[1])/(w+w1) );
249 lz.push_back( ( w1*par[5] + w*par1[5])/(w+w1) );
258 lx.push_back(par[0]);
259 ly.push_back(par[1]);
260 lz.push_back(par[5]);
268 pline.DrawPolyLine(lx.size(), &(lz[0]), &(ly[0]) );
270 pline.DrawPolyLine(lx.size(), &(lz[0]), &(lx[0]) );
272 pline.DrawPolyLine(lx.size(), &(lx[0]), &(ly[0]) );
281 cout <<
"L1CADraw: number of registered MC tracks: " << NRegMCTracks << endl;
283 YZ->cd(); YZ->Update();
284 XZ->cd(); XZ->Update();
285 YX->cd(); YX->Update();
299 vector< THitI > &recoHits = algo->
vRecoHits;
300 for( vector<L1Track>::iterator it = algo->
vTracks.begin(); it != algo->
vTracks.end(); ++it){
308 vector<double> lx, ly, lz;
309 vector<double> lx_turned, ly_turned, lz_turned;
312 pline.SetLineColor(kBlue);
318 for(
int iHit=0; iHit<nHits; iHit++){
319 unsigned int ih = recoHits[curRecoHit++];
324 Point p = GetHitCoor(ih);
329 TVector3 v3(p.x, p.y, p.z);
330 v3.RotateX(TMath::Pi()/5);
331 v3.RotateY(TMath::Pi()/20);
332 v3.RotateZ(TMath::Pi()/100);
333 lx_turned.push_back(v3.x());
334 ly_turned.push_back(v3.y());
335 lz_turned.push_back(v3.z());
346 pline.DrawPolyLine(lx.size(), &(lz[0]), &(ly[0]) );
348 pline.DrawPolyLine(lx.size(), &(lz[0]), &(lx[0]) );
350 pline.DrawPolyLine(lx.size(), &(lx[0]), &(ly[0]) );
352 pline.DrawPolyLine(lx_turned.size(), &(lz_turned[0]), &(lx_turned[0]) );
357 cout <<
"L1CADraw: number of reconstructed tracks: " << NRecTracks << endl;
359 YZ->cd(); YZ->Update();
360 XZ->cd(); XZ->Update();
361 YX->cd(); YX->Update();
428void L1AlgoDraw::DrawDoublets(vector<THitI>* Duplets_hits, map<THitI, THitI>* Duplets_start,
const int MaxArrSize,
THitI* StsRestHitsStartIndex,
unsigned int *realIHit)
430 for (
int iSta = 0; iSta < NStations-1; iSta++){
431 const int firstHitOnSta = StsRestHitsStartIndex[iSta];
432 const int firstHitOnNextSta = StsRestHitsStartIndex[iSta+1];
433 THitI* staDupletsHits = &(Duplets_hits[iSta][0]);
434 map<THitI, THitI>& staDupletsStart = Duplets_start[iSta];
436 for (
int iRestLHit = firstHitOnSta; iRestLHit < firstHitOnNextSta; iRestLHit++){
437 const int ilh = iRestLHit - firstHitOnSta;
438 const int iirhFirst = staDupletsStart[ilh];
439 const int iirhLast = staDupletsStart[ilh+1]-1;
441 for (
int iirh = iirhFirst; iirh <= iirhLast; iirh++){
442 const int iRestRHit = staDupletsHits[iirh] + firstHitOnNextSta;
444 const int iLHit = realIHit[iRestLHit];
445 const int iRHit = realIHit[iRestRHit];
447 DrawDoublet(iLHit, iRHit);
452 YZ->cd(); YZ->Update();
453 XZ->cd(); XZ->Update();
454 YX->cd(); YX->Update();
459 const int firstHitOnSta = StsRestHitsStartIndex[iSta];
460 const int firstHitOnNextSta = StsRestHitsStartIndex[iSta+1];
461 THitI* staDupletsHits = Duplets_hits + MaxArrSize*iSta;
462 THitI* staDupletsStart = Duplets_start + MaxArrSize*iSta;
464 for (
int iRestLHit = firstHitOnSta; iRestLHit < firstHitOnNextSta; iRestLHit++){
465 const int ilh = iRestLHit - firstHitOnSta;
466 const int iirhFirst = staDupletsStart[ilh];
467 const int iirhLast = staDupletsStart[ilh+1]-1;
469 for (
int iirh = iirhFirst; iirh <= iirhLast; iirh++){
470 const int iRestRHit = staDupletsHits[iirh] + firstHitOnNextSta;
472 const int iLHit = realIHit[iRestLHit];
473 const int iRHit = realIHit[iRestRHit];
475 DrawDoublet(iLHit, iRHit);
479 YZ->cd(); YZ->Update();
480 XZ->cd(); XZ->Update();
481 YX->cd(); YX->Update();
530 float x = 0,y = 0,z = 0;
533 TVector3 v3(x, y, z);
534 v3.RotateX(TMath::Pi()/5);
535 v3.RotateY(TMath::Pi()/20);
536 v3.RotateZ(TMath::Pi()/100);
543 TMarker *marker =
new TMarker(z, y, targetMStyle);
544 marker->SetMarkerColor(kRed);
545 marker->SetMarkerStyle(targetMStyle);
546 marker->SetMarkerSize(HitSize);
553 TMarker *marker =
new TMarker(z, x, targetMStyle);
554 marker->SetMarkerColor(kRed);
555 marker->SetMarkerStyle(targetMStyle);
556 marker->SetMarkerSize(HitSize);
563 TMarker *marker =
new TMarker(x, y, targetMStyle);
564 marker->SetMarkerColor(kRed);
565 marker->SetMarkerStyle(targetMStyle);
566 marker->SetMarkerSize(HitSize);
573 TMarker *marker =
new TMarker(z_t, x_t, targetMStyle);
574 marker->SetMarkerColor(kRed);
575 marker->SetMarkerStyle(targetMStyle);
576 marker->SetMarkerSize(HitSize);
586 latex.SetTextFont(132);
587 latex.SetTextAlign(12);
588 latex.SetTextSize(0.035);
590 YZ->cd(); latex.DrawLatex(0.0, 45.0,
"YZ Side View"); YZ->Draw();
591 XZ->cd(); latex.DrawLatex(0.0, 45.0,
"XZ Top View"); XZ->Draw();
592 YX->cd(); latex.DrawLatex(-45.0, 45.0,
"YX Front View"); YX->Draw();
595 int nhits = vStsHits.size();
596 Double_t x_poly[nhits], y_poly[nhits], z_poly[nhits];
597 Double_t x_poly_fake[nhits], y_poly_fake[nhits], z_poly_fake[nhits];
598 Double_t x_poly_turned[nhits], z_poly_turned[nhits];
599 Double_t x_poly_fake_turned[nhits], z_poly_fake_turned[nhits];
602 for (
int ista = NStations-1; ista>=0; ista--){
605 Int_t n_poly_fake = 0;
606 for (
int ih = StsHitsStartIndex[ista]; ih < StsHitsStopIndex[ista]; ih++){
613 algo->GetHitCoor(h ,x,y,z, st);
615 TVector3 v3(x, y, z);
616 v3.RotateX(TMath::Pi()/5);
617 v3.RotateY(TMath::Pi()/20);
618 v3.RotateZ(TMath::Pi()/100);
626 x_poly_turned[n_poly] = x_t;
627 z_poly_turned[n_poly] = z_t;
630 x_poly_fake[n_poly_fake] = x;
631 y_poly_fake[n_poly_fake] = y;
632 z_poly_fake[n_poly_fake] = z;
633 x_poly_fake_turned[n_poly_fake] = x_t;
634 z_poly_fake_turned[n_poly_fake] = z_t;
641 TLine *line =
new TLine();
642 line->SetLineColor(StaColor);
643 line->DrawLine(st.
z[0], -st.
Rmax[0], st.
z[0], st.
Rmax[0]);
645 TPolyMarker *pmyz =
new TPolyMarker(n_poly, z_poly, y_poly);
646 pmyz->SetMarkerColor(mcolor[ista]);
647 pmyz->SetMarkerStyle(hitsMStyle);
648 pmyz->SetMarkerSize(HitSize);
651 TPolyMarker *pmyz_fake =
new TPolyMarker(n_poly_fake, z_poly_fake, y_poly_fake);
652 pmyz_fake->SetMarkerColor(mcolor[ista]);
653 pmyz_fake->SetMarkerStyle(fakesMStyle);
654 pmyz_fake->SetMarkerSize(HitSize);
659 line->DrawLine(st.
z[0], -st.
Rmax[0], st.
z[0], st.
Rmax[0]);
661 TPolyMarker *pmxz =
new TPolyMarker(n_poly, z_poly, x_poly);
662 pmxz->SetMarkerColor(mcolor[ista]);
663 pmxz->SetMarkerStyle(hitsMStyle);
664 pmxz->SetMarkerSize(HitSize);
667 TPolyMarker *pmxz_fake =
new TPolyMarker(n_poly_fake, z_poly_fake, x_poly_fake);
668 pmxz_fake->SetMarkerColor(mcolor[ista]);
669 pmxz_fake->SetMarkerStyle(fakesMStyle);
670 pmxz_fake->SetMarkerSize(HitSize);
675 TEllipse *ellipse =
new TEllipse(0.0, 0.0, st.
Rmax[0]);
676 ellipse->SetLineColor(StaColor);
677 ellipse->SetFillStyle(0);
680 TPolyMarker *pmyx =
new TPolyMarker(n_poly, x_poly, y_poly);
681 pmyx->SetMarkerColor(mcolor[ista]);
682 pmyx->SetMarkerStyle(hitsMStyle);
683 pmyx->SetMarkerSize(HitSize);
686 TPolyMarker *pmyx_fake =
new TPolyMarker(n_poly_fake, x_poly_fake, y_poly_fake);
687 pmyx_fake->SetMarkerColor(mcolor[ista]);
688 pmyx_fake->SetMarkerStyle(fakesMStyle);
689 pmyx_fake->SetMarkerSize(HitSize);
694 TPolyMarker *pmxyz =
new TPolyMarker(n_poly, z_poly_turned, x_poly_turned);
695 pmxyz->SetMarkerColor(mcolor[ista]);
696 pmxyz->SetMarkerStyle(hitsMStyle);
697 pmxyz->SetMarkerSize(HitSize);
700 TPolyMarker *pmxyz_fake =
new TPolyMarker(n_poly_fake, z_poly_fake_turned, x_poly_fake_turned);
701 pmxyz_fake->SetMarkerColor(mcolor[ista]);
702 pmxyz_fake->SetMarkerStyle(fakesMStyle);
703 pmxyz_fake->SetMarkerSize(HitSize);
712 latex.SetTextFont(132);
713 latex.SetTextAlign(12);
714 latex.SetTextSize(0.035);
716 YZ->cd(); latex.DrawLatex(0.0, 45.0,
"YZ Side View"); YZ->Draw();
717 XZ->cd(); latex.DrawLatex(0.0, 45.0,
"XZ Top View"); XZ->Draw();
718 YX->cd(); latex.DrawLatex(-45.0, 45.0,
"YX Front View"); YX->Draw();
721 int nhits = vStsHits.size();
722 Double_t x_poly[nhits], y_poly[nhits], z_poly[nhits];
723 Double_t x_poly_fake[nhits], y_poly_fake[nhits], z_poly_fake[nhits];
726 for (
int ista = NStations-1; ista>=0; ista--){
729 Int_t n_poly_fake = 0;
730 for (
int iRestHit = StsRestHitsStartIndex[ista]; iRestHit < StsRestHitsStopIndex[ista]; iRestHit++){
731 int ih = realIHit[iRestHit];
737 algo->GetHitCoor(h ,x,y,z, st);
744 x_poly_fake[n_poly_fake] = x;
745 y_poly_fake[n_poly_fake] = y;
746 z_poly_fake[n_poly_fake] = z;
753 TLine *line =
new TLine();
754 line->SetLineColor(StaColor);
755 line->DrawLine(st.
z[0], -st.
Rmax[0], st.
z[0], st.
Rmax[0]);
757 TPolyMarker *pmyz =
new TPolyMarker(n_poly, z_poly, y_poly);
758 pmyz->SetMarkerColor(mcolor[ista]);
759 pmyz->SetMarkerStyle(hitsMStyle);
760 pmyz->SetMarkerSize(HitSize);
763 TPolyMarker *pmyz_fake =
new TPolyMarker(n_poly_fake, z_poly_fake, y_poly_fake);
764 pmyz_fake->SetMarkerColor(mcolor[ista]);
765 pmyz_fake->SetMarkerStyle(fakesMStyle);
766 pmyz_fake->SetMarkerSize(HitSize);
771 line->DrawLine(st.
z[0], -st.
Rmax[0], st.
z[0], st.
Rmax[0]);
773 TPolyMarker *pmxz =
new TPolyMarker(n_poly, z_poly, x_poly);
774 pmxz->SetMarkerColor(mcolor[ista]);
775 pmxz->SetMarkerStyle(hitsMStyle);
776 pmxz->SetMarkerSize(HitSize);
779 TPolyMarker *pmxz_fake =
new TPolyMarker(n_poly_fake, z_poly_fake, x_poly_fake);
780 pmxz_fake->SetMarkerColor(mcolor[ista]);
781 pmxz_fake->SetMarkerStyle(fakesMStyle);
782 pmxz_fake->SetMarkerSize(HitSize);
787 TEllipse *ellipse =
new TEllipse(0.0, 0.0, st.
Rmax[0]);
788 ellipse->SetLineColor(StaColor);
789 ellipse->SetFillStyle(0);
792 TPolyMarker *pmyx =
new TPolyMarker(n_poly, x_poly, y_poly);
793 pmyx->SetMarkerColor(mcolor[ista]);
794 pmyx->SetMarkerStyle(hitsMStyle);
795 pmyx->SetMarkerSize(HitSize);
798 TPolyMarker *pmyx_fake =
new TPolyMarker(n_poly_fake, x_poly_fake, y_poly_fake);
799 pmyx_fake->SetMarkerColor(mcolor[ista]);
800 pmyx_fake->SetMarkerStyle(fakesMStyle);
801 pmyx_fake->SetMarkerSize(HitSize);