X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVE%2FEveDet%2FAliEveTOFSector.cxx;h=5c50955b1db1028a025ae8abfc0b01463556e004;hb=c023384e7d798b9b8d712d19cad74bbbc6e8fc24;hp=70836c911b952f95536a8acc8861468d8f3ebc9f;hpb=ee9d8eca318b3fb973ab5386a4b0a35baf7cbd1d;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVE/EveDet/AliEveTOFSector.cxx b/EVE/EveDet/AliEveTOFSector.cxx index 70836c911b9..5c50955b1db 100644 --- a/EVE/EveDet/AliEveTOFSector.cxx +++ b/EVE/EveDet/AliEveTOFSector.cxx @@ -1,19 +1,29 @@ -// $Id$ -// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 - /************************************************************************** * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#include "AliEveTOFSector.h" -#include +// $Id$ +// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 + +// +// Class to visualize the TOF digit information +// in TOF sector frame +// +// Author: A. De Caro (email: decaro@sa.infn.t) +// + +#include +#include +#include + +#include #include #include -#include +#include "AliEveTOFSector.h" Bool_t AliEveTOFSector::fgStaticInitDone = kFALSE; TEveFrameBox* AliEveTOFSector::fgTOFsectorFrameBox = 0; @@ -42,11 +52,13 @@ AliEveTOFSector::AliEveTOFSector(const Text_t* n, const Text_t* t) : fGeoManager(0) { + // default ctr + fPlateFlag = new Bool_t[5]; for (Int_t ii=0; ii<5; ii++) fPlateFlag[ii]=kTRUE; - //fGeoManager = (TGeoManager*)gEve->GetGeometry("$REVESYS/alice-data/alice_fullgeo.root"); + //fGeoManager = AliEveEventManager::AssertGeometry(); if (!fGeoManager) { printf("ERROR: no TGeo\n"); } @@ -74,6 +86,8 @@ AliEveTOFSector::AliEveTOFSector(TGeoManager *localGeoManager, fGeoManager(localGeoManager) { + // ctr + fPlateFlag = new Bool_t[5]; for (Int_t ii=0; ii<5; ii++) fPlateFlag[ii]=kTRUE; @@ -109,6 +123,8 @@ AliEveTOFSector::AliEveTOFSector(TGeoManager *localGeoManager, fGeoManager(localGeoManager) { + // ctr + fPlateFlag = new Bool_t[5]; for (Int_t ii=0; ii<5; ii++) fPlateFlag[ii]=kTRUE; @@ -138,6 +154,8 @@ AliEveTOFSector::AliEveTOFSector(TGeoManager *localGeoManager, fGeoManager(localGeoManager) { + // ctr + fPlateFlag = new Bool_t[5]; for (Int_t ii=0; ii<5; ii++) fPlateFlag[ii]=kTRUE; @@ -148,6 +166,9 @@ AliEveTOFSector::AliEveTOFSector(TGeoManager *localGeoManager, AliEveTOFSector::~AliEveTOFSector() { + + // dtr + /* fGeoManager = 0x0; delete fGeoManager; @@ -172,20 +193,27 @@ void AliEveTOFSector::SetDigitsInfo(AliEveTOFDigitsInfo* info) /* ************************************************************************ */ void AliEveTOFSector::InitStatics() { + // + // To initialize statistic variables + // + if (fgStaticInitDone) return; Float_t dx = 124.5; Float_t dz = 29.; Float_t dy = 370.6*2.; fgTOFsectorFrameBox = new TEveFrameBox(); - fgTOFsectorFrameBox->SetAABox(-dx*0.5, -dy*0.5, -dz*0.5, dx, dy, dz); - fgTOFsectorFrameBox->SetFrameColor((Color_t) 32);//31); + fgTOFsectorFrameBox->SetFrameColor(Color_t(32)); + fgTOFsectorFrameBox->IncRefCount(); //fgTOFsectorPalette = new TEveRGBAPalette(0, 2048); // TOT //fgTOFsectorPalette->SetLimits(0, 2048); - fgTOFsectorPalette = new TEveRGBAPalette(0, 8192); // TDC - //fgTOFsectorPalette->SetLimits(0, 8192); + //fgTOFsectorPalette = new TEveRGBAPalette(0, 8192); // TDC + fgTOFsectorPalette = new TEveRGBAPalette(0, 100000); // TDC + fgTOFsectorPalette->SetOverflowAction(2); + fgTOFsectorPalette->SetUnderflowAction(2); + fgTOFsectorPalette->IncRefCount(); fgStaticInitDone = kTRUE; } @@ -193,6 +221,9 @@ void AliEveTOFSector::InitStatics() /* ************************************************************************ */ void AliEveTOFSector::InitModule() { + // + // To initialize TOF sector frame variables + // fDx = fTOFgeometry->XPad()*fTOFgeometry->NpadX(); //fDy = fTOFgeometry->XPad()*fTOFgeometry->NpadX(); @@ -214,6 +245,9 @@ void AliEveTOFSector::InitModule() /* ************************************************************************ */ void AliEveTOFSector::LoadQuads() { + // + // Load TOF digit as illuminated pad + // //Int_t n_col = gStyle->GetNumberOfColors(); @@ -323,7 +357,12 @@ void AliEveTOFSector::LoadQuads() /* ************************************************************ */ void AliEveTOFSector::SetTrans() { - fHMTrans.UnitTrans(); + // + // Set the translation matrix for TOF sector + // + + InitMainTrans(); + TEveTrans& t = RefMainTrans(); //Int_t det[5] = {fSector, -1, -1, -1, -1}; Char_t path[100]; @@ -338,17 +377,20 @@ void AliEveTOFSector::SetTrans() Double_t *rotMat = global.GetRotationMatrix(); Double_t *tr = global.GetTranslation(); - fHMTrans.SetBaseVec(1, rotMat[0], rotMat[3], rotMat[6]); - fHMTrans.SetBaseVec(2, rotMat[1], rotMat[4], rotMat[7]); - fHMTrans.SetBaseVec(3, rotMat[2], rotMat[5], rotMat[8]); - - fHMTrans.SetBaseVec(4, tr); + t.SetBaseVec(1, rotMat[0], rotMat[3], rotMat[6]); + t.SetBaseVec(2, rotMat[1], rotMat[4], rotMat[7]); + t.SetBaseVec(3, rotMat[2], rotMat[5], rotMat[8]); + t.SetBaseVec(4, tr); } //----------------------------------------------------- void AliEveTOFSector::SetSectorID(Int_t id) { + // + // Set TOF sector ID to be visualized + // + fSectorID = id; fSector = id; if (fAutoTrans) @@ -361,6 +403,9 @@ void AliEveTOFSector::SetSectorID(Int_t id) void AliEveTOFSector::SetPlate(Int_t nPlate, Bool_t r) { + // + // Set visualization flag to visualize TOF modules + // fPlateFlag[nPlate] = r; @@ -371,6 +416,10 @@ void AliEveTOFSector::SetPlate(Int_t nPlate, Bool_t r) void AliEveTOFSector::SetThreshold(Short_t t) { + // + // Set visualization threshold + // + fThreshold = TMath::Min(t, (Short_t)(fMaxVal - 1)); // ClearColorArray(); } @@ -379,6 +428,10 @@ void AliEveTOFSector::SetThreshold(Short_t t) void AliEveTOFSector::SetMaxVal(Int_t mv) { + // + // Set visualization max value + // + fMaxVal = TMath::Max(mv, (Int_t)(fThreshold + 1)); //ClearColorArray(); } @@ -387,16 +440,13 @@ void AliEveTOFSector::SetMaxVal(Int_t mv) void AliEveTOFSector::DigitSelected(Int_t idx) { + // // Override control-click from TEveQuadSet + // - DigitBase_t* qb = GetDigit(idx); - TObject* obj = qb->fId.GetObject(); + TObject* obj = GetId(idx); AliTOFdigit* digs = dynamic_cast(obj); // printf("AliEveTOFSector::QuadSelected "); Print(); - /* - printf(" idx = %5i, value = %5d, obj = 0x%lx, digit = 0x%lx ", - idx, qb->fValue, (ULong_t)obj, (ULong_t)digs); - */ if (digs) printf("\n Sector = %2i Plate = %1i Strip = %2i PadZ = %1i PadX = %2i ToT = %3i Tof = %5i\n", fSector , digs->GetPlate(), digs->GetStrip(), digs->GetPadz(), digs->GetPadx(), digs->GetToT(), digs->GetTdc());