1 #// -------------------------------------------------------------------------
6 1 // =1 means active, other: without Label and not relying on TEvePointSet
8 1 // =1 means active, other: not relying on VelocityError of CbmTofTracklet
12 #include "CbmTofHit.h"
15 #include <FairEventManager.h>
16 #include <FairLogger.h>
17 #include <FairRootManager.h>
21 #include <TClonesArray.h>
22 #include <TEveElement.h>
23 #include <TEveManager.h>
24 #include <TEvePathMark.h>
25 #include <TEvePointSet.h>
26 #include <TEveTrack.h>
27 #include <TEveTrackPropagator.h>
28 #include <TEveVSDStructs.h>
29 #include <TEveVector.h>
30 #include <TGenericClassInfo.h>
31 #include <TObjArray.h>
32 #include <TParticle.h>
42 : FairTask(
"CbmEvDisTracks", 0)
45 , fEventManager(nullptr)
66 : FairTask(name, iVerbose)
69 , fEventManager(nullptr)
70 , fEveTrList(new TObjArray(16))
73 , fEvePSList(new TObjArray(8))
84 LOG(debug) <<
"CbmEvDisTracks::Init()";
85 FairRootManager* fManager = FairRootManager::Instance();
86 fTrackList = (TClonesArray*) fManager->GetObject(
"TofTracks");
88 LOG(warn) <<
"CbmEvDisTracks::Init() branch " << GetName()
89 <<
" Not found! Task will be deactivated ";
92 LOG(debug1) <<
"CbmEvDisTracks::Init() get track list" <<
fTrackList;
93 LOG(debug1) <<
"CbmEvDisTracks::Init() create propagator";
95 LOG(debug1) <<
"CbmEvDisTracks::Init() get instance of FairEventManager ";
111 LOG(debug2) <<
" CbmEvDisTracks::Exec starting with verbosity " << fVerbose
112 <<
" and option " << option;
114 const Double_t* point;
119 LOG(debug4) <<
" CbmEvDisTracks:: NTrks " <<
fTrackList->GetEntries();
121 for (Int_t iOpt = 0; iOpt < 2; iOpt++)
123 LOG(debug4) <<
"CbmEvDisTracks::Exec " <<
i;
125 if (
nullptr == tr)
continue;
128 #if TOFDisplay == 1 //List for TEvePointSets
133 TParticle* P =
new TParticle();
136 if (iCol > 4) iCol++;
137 track->SetAttLineAttMarker(
fTrList);
138 track->SetLineColor(iCol);
139 track->SetMarkerColor(iCol);
140 track->SetMarkerSize(2.);
145 TEveVector pos0 = TEveVector(tr->
GetFitX(0.), tr->
GetFitY(0.), 0.);
146 TEvePathMark* path0 =
new TEvePathMark();
148 track->AddPathMark(*path0);
150 Double_t pbuf[3], vbuf[3];
155 pbuf[2] = 1. / tr->
GetTt();
161 track->SetName(Form(
"TEveTrack %d", rt.fIndex));
165 Double_t beta, beta_err, res_x, res_y, res_t;
167 case 0: track->SetStdTitle();
break;
170 == 1 //setting content of label depending on available information
171 beta = (1 / tr->
GetTt()) / 29.98;
174 track->SetTitle(Form(
"%s\nChiSqDoF = %2.2f\nbeta = %1.3f +/- %1.3f",
180 track->SetTitle(Form(
"%s\nChiSqDoF = %2.2f\nbeta = %1.3f",
186 track->SetStdTitle();
193 TEvePointSetArray* psa =
194 new TEvePointSetArray(Form(
"TEveTrack Points %d",
i),
"");
195 psa->SetMarkerColor(iCol);
196 psa->SetMarkerSize(2.0);
197 psa->SetMarkerStyle(4);
198 psa->InitBins(
"Hits", Np, 0.5, Np + 0.5);
201 for (Int_t n = 0; n < Np; n++) {
208 psa->Fill(point[0], point[1], point[2], n + 1);
210 res_x = (point[0] - tr->
GetFitX(point[2])) / hit->
GetDx();
211 res_y = (point[1] - tr->
GetFitY(point[2])) / hit->
GetDy();
214 psa->GetBin(n + 1)->SetTitle(Form(
215 "%s\nPointId = %d\nResiduals:\nX = %1.3f\nY = %1.3f\nT = %1.3f",
225 track->SetPoint(n + 1, point[0], point[1], point[2]);
227 " CbmEvDisTracks::Exec SetPoint %d, %6.2f, %6.2f, %6.2f, %6.2f ",
234 TEveVector
pos = TEveVector(point[0], point[1], point[2]);
235 TEvePathMark* path =
new TEvePathMark();
237 path->fTime = point[3];
239 TEveVector Mom = TEveVector(P->Px(), P->Py(), P->Pz());
242 LOG(debug4) <<
"Path marker added " << path;
244 track->AddPathMark(*path);
246 LOG(debug4) <<
"Path marker added " << path;
249 if (iOpt == 0) {
fPSList->AddElement(psa); }
251 track->SortPathMarksByTime();
253 LOG(debug3) <<
i <<
". track added: " << track->GetName();
261 gEve->Redraw3D(kFALSE);
276 TEveTrackList* ele = (TEveTrackList*)
fEveTrList->At(
i);
282 TEveElementList* ele = (TEveElementList*)
fEvePSList->At(
i);
292 case 0:
gr = Form(
"Trkl_hmul%d", ihmul);
break;
293 case 1:
gr = Form(
"FTrkl_hmul%d", ihmul);
break;
297 TEveTrackList* TrListIn = (TEveTrackList*)
fEveTrList->At(
i);
298 if (strcmp(TrListIn->GetName(),
gr) == 0) {
304 fTrPr =
new TEveTrackPropagator();
307 if (iCol > 4) iCol++;
337 gr = Form(
"PTrkl_hmul%d", ihmul);
340 TEveElementList* l = (TEveElementList*)
fEvePSList->At(
i);
341 if (strcmp(l->GetName(),
gr) == 0) {
349 if (iCol > 4) iCol++;