Commit cfb4ab51 authored by Norbert Herrmann's avatar Norbert Herrmann
Browse files

fix features in tof display

parent aba57a8b
......@@ -27,6 +27,8 @@
#include <TEveTrackPropagator.h> // for TEveTrackPropagator
#include <TEveVSDStructs.h> // for TEveRecTrack
#include <TEveVector.h> // for TEveVector, TEveVectorT
#include <TGLAnnotation.h>
#include <TGLViewer.h>
#include <TGenericClassInfo.h> // for TGenericClassInfo
#include <TObjArray.h> // for TObjArray
#include <TParticle.h> // for TParticle
......@@ -37,6 +39,9 @@
ClassImp(CbmEvDisTracks);
CbmEvDisTracks* CbmEvDisTracks::fInstance = 0;
static TGLAnnotation* anne;
static TGLAnnotation* annt;
// ----- Default constructor -------------------------------------------
CbmEvDisTracks::CbmEvDisTracks()
: FairTask("CbmEvDisTracks", 0)
......@@ -117,6 +122,7 @@ void CbmEvDisTracks::Exec(Option_t* option) {
Reset();
LOG(debug4) << " CbmEvDisTracks:: NTrks " << fTrackList->GetEntries();
Int_t TMul[10]={10*0}; //FIXME - don't use constants in code
for (Int_t iOpt = 0; iOpt < 2; iOpt++)
for (Int_t i = 0; i < fTrackList->GetEntriesFast(); i++) {
......@@ -126,6 +132,7 @@ void CbmEvDisTracks::Exec(Option_t* option) {
Int_t Np = tr->GetNofHits();
#if TOFDisplay == 1 //List for TEvePointSets
if(iOpt==0) TMul[Np]++;
fPSList = GetPSGroup(Np, iOpt);
#endif
......@@ -202,9 +209,9 @@ void CbmEvDisTracks::Exec(Option_t* option) {
switch (iOpt) {
case 0:
point = tr->GetPoint(
n); //pointer to membervaribale so GetFitPoint() would also change GetPoint()
n); //pointer to member variable so GetFitPoint() would also change GetPoint()
#if TOFDisplay == 1
// follwing belongs to filling and labeling of PointSetArray
// following belongs to filling and labeling of PointSetArray
psa->Fill(point[0], point[1], point[2], n + 1);
hit = tr->GetTofHitPointer(n);
res_x = (point[0] - tr->GetFitX(point[2])) / hit->GetDx();
......@@ -258,6 +265,22 @@ void CbmEvDisTracks::Exec(Option_t* option) {
}
fEventManager->SetEvtMaxEnergy(MaxEnergyLimit);
fEventManager->SetEvtMinEnergy(MinEnergyLimit);
TString cEventInfo=Form("ev# %d ",fEventManager->GetCurrentEvent());
TString cTrackInfo="trkl mul: "; // to be completed while building the display
for (Int_t i=9; i>0; i--) if(TMul[i]>0) cTrackInfo += Form("M%d %d/",i,TMul[i]);
TGLViewer* v = gEve->GetDefaultGLViewer();
if(NULL != anne) anne->SetText(cEventInfo);
else anne = new TGLAnnotation(v,cEventInfo,0.01,0.95);
if(NULL != annt) annt->SetText(cTrackInfo);
else annt = new TGLAnnotation(v,cTrackInfo,0.01,0.92);
anne->SetTextSize(0.03);// % of window diagonal
annt->SetTextSize(0.03);// % of window diagonal
anne->SetTextColor(4);
annt->SetTextColor(4);
gEve->Redraw3D(kFALSE);
//gEve->DoRedraw3D();
//gEve->Redraw3D(kTRUE);
......
......@@ -71,9 +71,9 @@ void CbmPointSetArray::FillValues(Int_t id,
void CbmPointSetArray::ApplyColorMode() {
//parameters needed for color-calculation
Double_t binTime =
3.5; // ns max. length of one particle passing through detector
12.; // ns max. length of one particle passing through detector
Double_t binCol =
35; // green ->allows for visual distinction of a track-time
35.; // green ->allows for visual distinction of a track-time
Double_t eveTime = 50; // 50ns Event Length
Double_t binToT =
20; // a.u. max. ToT of hit in arbitray units (aka calibrated to mean of 5)
......@@ -81,6 +81,8 @@ void CbmPointSetArray::ApplyColorMode() {
1, 0); //rainbow color palette with 50 colors from purple to red
Int_t nCol = TColor::GetNumberOfColors();
LOG(info) << "ApplyColorMode " << fColorMode << " with " << nCol << " colors";
for (Int_t id = 0; id < fNPoints; id++) {
switch (fColorMode) {
case 1: //according to hit-time
......@@ -98,6 +100,8 @@ void CbmPointSetArray::ApplyColorMode() {
* (nCol - binCol - 1)
/ (eveTime - binTime)));
}
LOG(info) << "Color for id " << id << ", ind " << fIndex[id] << ", t "<<fTime[id]<<": " << this->GetBin(fIndex[id])->GetMainColor();
break;
case 2: //according to Tot of hit
// color calculated to represent ToT. high ToT -> yellow and red . low ToT -> purple and blue. max.ToT = binToT
......
......@@ -142,11 +142,7 @@ Int_t CbmPointSetArrayDraw::GetClusterSize(TObject* obj) {
CbmTofHit* p = (CbmTofHit*) obj;
Double_t cluSize = p->GetFlag();
//Flag= #digis = 2*cluSize +100 if used for track
if (cluSize > 100) {
cluSize = (cluSize - 100) / 2;
} else {
cluSize /= 2;
}
cluSize=((int)cluSize%100)/2;
LOG(debug3) << "-I- CbmPointSetArrayDraw::GetClusterSize(): " << cluSize;
return cluSize;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment