From 698e2c9b3bffbeaf0f60fc693748c3dc785b99a2 Mon Sep 17 00:00:00 2001 From: mtadel Date: Mon, 28 Jan 2008 09:51:48 +0000 Subject: [PATCH] Add class and function docs. --- EVE/EveDet/AliEveITSModule.cxx | 42 +++++++----- EVE/EveDet/AliEveITSModule.h | 34 +++++----- EVE/EveDet/AliEveITSModuleStepper.cxx | 73 +++++++++++++++++---- EVE/EveDet/AliEveITSModuleStepper.h | 46 ++++++------- EVE/EveDet/AliEveITSModuleStepperEditor.cxx | 15 +++-- EVE/EveDet/AliEveITSModuleStepperEditor.h | 13 ++-- EVE/EveDet/AliEveITSScaledModule.cxx | 7 ++ EVE/EveDet/AliEveITSScaledModule.h | 22 +++---- EVE/EveDet/AliEveITSScaledModuleEditor.cxx | 41 ++++++------ EVE/EveDet/AliEveITSScaledModuleEditor.h | 19 +++--- 10 files changed, 191 insertions(+), 121 deletions(-) diff --git a/EVE/EveDet/AliEveITSModule.cxx b/EVE/EveDet/AliEveITSModule.cxx index b490083cb33..94d43024a6a 100644 --- a/EVE/EveDet/AliEveITSModule.cxx +++ b/EVE/EveDet/AliEveITSModule.cxx @@ -21,6 +21,12 @@ #include +//______________________________________________________________________________ +// +// Visualization of an ITS module. + +ClassImp(AliEveITSModule) + Bool_t AliEveITSModule::fgStaticInitDone = kFALSE; TEveFrameBox* AliEveITSModule::fgSPDFrameBox = 0; @@ -31,13 +37,6 @@ TEveRGBAPalette* AliEveITSModule::fgSPDPalette = 0; TEveRGBAPalette* AliEveITSModule::fgSDDPalette = 0; TEveRGBAPalette* AliEveITSModule::fgSSDPalette = 0; -//______________________________________________________________________________ -// AliEveITSModule -// -// - -ClassImp(AliEveITSModule) - /******************************************************************************/ AliEveITSModule::AliEveITSModule(const Text_t* n, const Text_t* t) : @@ -46,7 +45,9 @@ AliEveITSModule::AliEveITSModule(const Text_t* n, const Text_t* t) : fID(-1), fDetID(-1), fLayer(-1), fLadder(-1), fDet(-1), fDx(0), fDz(0), fDy(0) -{} +{ + // Constructor. +} AliEveITSModule::AliEveITSModule(Int_t gid, AliEveITSDigitsInfo* info) : TEveQuadSet(Form("ITS module %d", gid)), @@ -55,12 +56,16 @@ AliEveITSModule::AliEveITSModule(Int_t gid, AliEveITSDigitsInfo* info) : fLayer(-1), fLadder(-1), fDet(-1), fDx(0), fDz(0), fDy(0) { + // Constructor with module id and data-source. + SetDigitsInfo(info); SetID(gid); } AliEveITSModule::~AliEveITSModule() { + // Destructor. + if(fInfo) fInfo->DecRefCount(); } @@ -68,6 +73,8 @@ AliEveITSModule::~AliEveITSModule() void AliEveITSModule::InitStatics(AliEveITSDigitsInfo* info) { + // Initialize static variables, + if (fgStaticInitDone) return; fgStaticInitDone = kTRUE; @@ -118,6 +125,8 @@ void AliEveITSModule::InitStatics(AliEveITSDigitsInfo* info) void AliEveITSModule::SetDigitsInfo(AliEveITSDigitsInfo* info) { + // Set data and geometry source. + if (fInfo == info) return; if (fInfo) fInfo->DecRefCount(); fInfo = info; @@ -128,6 +137,8 @@ void AliEveITSModule::SetDigitsInfo(AliEveITSDigitsInfo* info) void AliEveITSModule::SetID(Int_t gid, Bool_t trans) { + // Set detector id. + static const TEveException eH("AliEveITSModule::SetID "); if(fInfo == 0) @@ -255,12 +266,8 @@ void AliEveITSModule::SetID(Int_t gid, Bool_t trans) void AliEveITSModule::LoadQuads() { - // Here we still use 'z' for the name of axial coordinates. - // The transforamtion matrix aplied rotates y -> z. - // We need this as TEveQuadSet offers optimized treatment for - // quads in the x-y plane. - - // printf("its module load quads \n"); + // Read module data from source and create low-level objects for + // visualization - called quads. TClonesArray *digits = fInfo->GetDigits(fID, fDetID); Int_t ndigits = digits ? digits->GetEntriesFast() : 0; @@ -381,7 +388,7 @@ void AliEveITSModule::SetTrans() void AliEveITSModule::DigitSelected(Int_t idx) { - // Override control-click from TEveQuadSet + // Override control-click from TEveQuadSet. DigitBase_t* qb = GetDigit(idx); TObject* obj = qb->fId.GetObject(); @@ -399,5 +406,8 @@ void AliEveITSModule::DigitSelected(Int_t idx) void AliEveITSModule::Print(Option_t* ) const { - printf("ID %d, layer %d, ladder %d, det %d \n", fID, fLayer, fLadder, fDetID); + // Print object summary information. + + printf("AliEveITSModule: ID %d, layer %d, ladder %d, det %d\n", + fID, fLayer, fLadder, fDetID); } diff --git a/EVE/EveDet/AliEveITSModule.h b/EVE/EveDet/AliEveITSModule.h index 0d2aef1ea6f..97e806bb6b1 100644 --- a/EVE/EveDet/AliEveITSModule.h +++ b/EVE/EveDet/AliEveITSModule.h @@ -20,20 +20,20 @@ class AliEveITSModule : public TEveQuadSet AliEveITSModule& operator=(const AliEveITSModule&); // Not implemented protected: - AliEveITSDigitsInfo* fInfo; + AliEveITSDigitsInfo* fInfo; // Source of geometry and data. - Int_t fID; // Module id - Int_t fDetID; // Detector id (0~SPD, 1~SDD, 2~SSD) + Int_t fID; // Module id. + Int_t fDetID; // Detector id (0~SPD, 1~SDD, 2~SSD). - Int_t fLayer; - Int_t fLadder; - Int_t fDet; + Int_t fLayer; // Layer (0 - 5). + Int_t fLadder; // Ladder. + Int_t fDet; // Detector. - Float_t fDx; - Float_t fDz; - Float_t fDy; + Float_t fDx; // Digit half-size in x. + Float_t fDz; // Digit half-size in z. + Float_t fDy; // Digit half-size in y. - static Bool_t fgStaticInitDone; + static Bool_t fgStaticInitDone; // Flag for static variable initialization. public: AliEveITSModule(const Text_t* n="AliEveITSModule", const Text_t* t=0); @@ -57,15 +57,15 @@ public: virtual void Print(Option_t* opt="") const; - static TEveFrameBox* fgSPDFrameBox; - static TEveFrameBox* fgSDDFrameBox; - static TEveFrameBox* fgSSDFrameBox; + static TEveFrameBox *fgSPDFrameBox; // Module frame for SPD. + static TEveFrameBox *fgSDDFrameBox; // Module frame for SDD. + static TEveFrameBox *fgSSDFrameBox; // Module frame for SSD. - static TEveRGBAPalette* fgSPDPalette; - static TEveRGBAPalette* fgSDDPalette; - static TEveRGBAPalette* fgSSDPalette; + static TEveRGBAPalette *fgSPDPalette; // Signal to color mapping for SPD. + static TEveRGBAPalette *fgSDDPalette; // Signal to color mapping for SDD. + static TEveRGBAPalette *fgSSDPalette; // Signal to color mapping for SSD. - ClassDef(AliEveITSModule, 1); + ClassDef(AliEveITSModule, 1); // Visualization of an ITS module. }; #endif diff --git a/EVE/EveDet/AliEveITSModuleStepper.cxx b/EVE/EveDet/AliEveITSModuleStepper.cxx index 150b78e08b4..0fdab8133da 100644 --- a/EVE/EveDet/AliEveITSModuleStepper.cxx +++ b/EVE/EveDet/AliEveITSModuleStepper.cxx @@ -34,8 +34,10 @@ //______________________________________________________________________________ -// AliEveITSModuleStepper // +// Display scaled ITS modules in a paged layout, also providing +// GL-overaly control GUI. + ClassImp(AliEveITSModuleStepper) @@ -71,6 +73,8 @@ AliEveITSModuleStepper::AliEveITSModuleStepper(AliEveITSDigitsInfo* di) : fWActiveCol(45), fFontCol(8) { + // Constructor. + // override member from base TEveElementList fChildClass = AliEveITSScaledModule::Class(); @@ -99,6 +103,8 @@ AliEveITSModuleStepper::AliEveITSModuleStepper(AliEveITSDigitsInfo* di) : AliEveITSModuleStepper::~AliEveITSModuleStepper() { + // Destructor. + gEve->GetGLViewer()->RemoveOverlayElement(this); fScaleInfo->DecRefCount(); @@ -114,6 +120,10 @@ AliEveITSModuleStepper::~AliEveITSModuleStepper() void AliEveITSModuleStepper::Capacity() { + // Make sure we have just enough children (module representations) + // to store as many modules as required by the grid-stepper + // configuration. + Int_t N = fStepper->GetNx()*fStepper->GetNy(); if (N != GetNChildren()) { @@ -132,8 +142,8 @@ void AliEveITSModuleStepper::SetFirst(Int_t first) Int_t lastpage = fIDs.size()/Nxy(); if(fIDs.size() % Nxy() ) lastpage++; - Int_t first_lastpage = (lastpage -1)*Nxy(); - if(first > first_lastpage) first = first_lastpage; + Int_t firstLastpage = (lastpage - 1)*Nxy(); + if(first > firstLastpage) first = firstLastpage; if(first < 0) first = 0; fPosition = first; Apply(); @@ -141,26 +151,33 @@ void AliEveITSModuleStepper::SetFirst(Int_t first) void AliEveITSModuleStepper::Start() { + // Go to first page. + fPosition = 0; Apply(); } void AliEveITSModuleStepper::Next() { + // Go to next page. + SetFirst(fPosition + Nxy()); } void AliEveITSModuleStepper::Previous() { - // move to the top left corner first + // Go to previous page. + SetFirst(fPosition - Nxy()); } void AliEveITSModuleStepper::End() { + // Go to last page. + Int_t lastpage = fIDs.size()/Nxy(); - if(fIDs.size() % Nxy() ) lastpage++; - fPosition = (lastpage -1)*Nxy(); + if (fIDs.size() % Nxy()) lastpage++; + fPosition = (lastpage - 1)*Nxy(); fStepper->Reset(); Apply(); @@ -170,6 +187,8 @@ void AliEveITSModuleStepper::End() void AliEveITSModuleStepper::DisplayDet(Int_t det, Int_t layer) { + // Select modules to display by sub-det type / layer. + fSubDet = det; fIDs.clear(); AliEveITSModuleSelection sel = AliEveITSModuleSelection(); @@ -185,6 +204,8 @@ void AliEveITSModuleStepper::DisplayDet(Int_t det, Int_t layer) void AliEveITSModuleStepper::DisplayTheta(Float_t min, Float_t max) { + // Select modules to display by theta range. + fIDs.clear(); AliEveITSModuleSelection sel = AliEveITSModuleSelection(); sel.SetThetaRange(min, max); @@ -196,9 +217,11 @@ void AliEveITSModuleStepper::DisplayTheta(Float_t min, Float_t max) Int_t AliEveITSModuleStepper::GetCurrentPage() { - Int_t idx = fPosition +1; - Int_t n = idx/Nxy(); - if(idx % Nxy()) n++; + // Get number of current page. + + Int_t idx = fPosition + 1; + Int_t n = idx/Nxy(); + if (idx % Nxy()) n++; return n; } @@ -206,6 +229,8 @@ Int_t AliEveITSModuleStepper::GetCurrentPage() Int_t AliEveITSModuleStepper::GetPages() { + // Get number of all pages. + Int_t n = fIDs.size()/Nxy(); if(fIDs.size() % Nxy()) n++; return n; @@ -215,6 +240,8 @@ Int_t AliEveITSModuleStepper::GetPages() void AliEveITSModuleStepper::Apply() { + // Apply current settings to children modules. + // printf("AliEveITSModuleStepper::Apply fPosition %d \n", fPosition); gEve->DisableRedraw(); Capacity(); @@ -280,6 +307,8 @@ void AliEveITSModuleStepper::Apply() void AliEveITSModuleStepper::Render(TGLRnrCtx& rnrCtx) { + // Render the overlay elements. + // render everyting in relative coordinates glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -329,6 +358,8 @@ void AliEveITSModuleStepper::Render(TGLRnrCtx& rnrCtx) //______________________________________________________________________________ Float_t AliEveITSModuleStepper::TextLength(const char* txt) { + // Calculate length of text txt. + Float_t llx, lly, llz, urx, ury, urz; fText->BBox(txt, llx, lly, llz, urx, ury, urz); return (urx-llx)*fTextSize; @@ -337,6 +368,8 @@ Float_t AliEveITSModuleStepper::TextLength(const char* txt) //______________________________________________________________________________ void AliEveITSModuleStepper::RenderString(TString string, Int_t id) { + // Render text for button id. + Float_t txtY = fWHeight*0.5; Float_t txtl = TextLength(string.Data()); @@ -373,7 +406,10 @@ void AliEveITSModuleStepper::RenderString(TString string, Int_t id) //______________________________________________________________________________ void AliEveITSModuleStepper::RenderFrame(Float_t dx, Float_t dy, Int_t id) { - if(fRnrFrame == kFALSE)return; + // Render frame for button id, taking into account if it is currently + // below mouse. + + if (fRnrFrame == kFALSE)return; glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); @@ -394,6 +430,9 @@ void AliEveITSModuleStepper::RenderFrame(Float_t dx, Float_t dy, Int_t id) //______________________________________________________________________________ void AliEveITSModuleStepper::RenderSymbol(Float_t dx, Float_t dy, Int_t id) { + // Render an overlay / GUI symbol, based on button id: + // 1 ~ <, 2 ~ <<, 3 ~ >, 4 ~ >>, 5 ~ ^, 6 ~ v. + glLoadName(id); UChar_t color[4]; @@ -465,6 +504,8 @@ void AliEveITSModuleStepper::RenderSymbol(Float_t dx, Float_t dy, Int_t id) //______________________________________________________________________________ void AliEveITSModuleStepper::RenderPalette(Float_t dx, Float_t x, Float_t y) { + // Render color palette with number axis. + glPushMatrix(); glLoadIdentity(); glTranslatef(1 -x- dx, -1+y*4, 0); @@ -505,6 +546,8 @@ void AliEveITSModuleStepper::RenderPalette(Float_t dx, Float_t x, Float_t y) //______________________________________________________________________________ void AliEveITSModuleStepper::RenderMenu() { + // Render menu: page control, scale control, detector type buttons. + Float_t ww = 2*fWWidth; Float_t wh = 2*fWHeight; @@ -600,6 +643,8 @@ void AliEveITSModuleStepper::RenderMenu() //______________________________________________________________________________ void AliEveITSModuleStepper::RenderCellIDs() { + // Render module-ids under their cells. + fText->SetTextSize(fStepper->GetDy()*0.1); fText->SetTextColor(fFontCol); Double_t x, y, z; @@ -632,8 +677,8 @@ void AliEveITSModuleStepper::RenderCellIDs() //______________________________________________________________________________ Bool_t AliEveITSModuleStepper::Handle(TGLRnrCtx & /*rnrCtx*/, - TGLOvlSelectRecord & rec, - Event_t * event) + TGLOvlSelectRecord & rec, + Event_t * event) { // Handle overlay event. // Return TRUE if event was handled. @@ -718,13 +763,15 @@ Bool_t AliEveITSModuleStepper::Handle(TGLRnrCtx & /*rnrCtx*/, //______________________________________________________________________________ Bool_t AliEveITSModuleStepper::MouseEnter(TGLOvlSelectRecord& /*rec*/) { + // Mouse has entered overlay area. + return kTRUE; } //______________________________________________________________________________ void AliEveITSModuleStepper::MouseLeave() { - // Mouse has left the element. + // Mouse has left overlay area. fWActive = -1; } diff --git a/EVE/EveDet/AliEveITSModuleStepper.h b/EVE/EveDet/AliEveITSModuleStepper.h index 41f335c0cb5..6889199a376 100644 --- a/EVE/EveDet/AliEveITSModuleStepper.h +++ b/EVE/EveDet/AliEveITSModuleStepper.h @@ -34,40 +34,40 @@ public: typedef std::vector::iterator vpInt_i; private: - vpInt_t fIDs; - UInt_t fPosition; // position of top corner ITS module in vector fIDs + vpInt_t fIDs; // Vector of module IDs to be displayed. + UInt_t fPosition; // Position of top corner ITS module in vector fIDs. AliEveITSModuleStepper(const AliEveITSModuleStepper&); // Not implemented AliEveITSModuleStepper& operator=(const AliEveITSModuleStepper&); // Not implemented protected: - AliEveITSDigitsInfo *fDigitsInfo; - AliEveDigitScaleInfo *fScaleInfo; - Int_t fSubDet; + AliEveITSDigitsInfo *fDigitsInfo; // Source of data and geometry. + AliEveDigitScaleInfo *fScaleInfo; // Parameters for digit-scaling. + Int_t fSubDet; // Sub-det, 0~SPD, 1~SDD, 2~SSD. - TEveGridStepper *fStepper; - TGLAxis *fAxis; - TGLText *fText; - Float_t fTextSize; - Float_t fPagerGap; - Bool_t fRnrFrame; + TEveGridStepper *fStepper; // Module placement. + TGLAxis *fAxis; // Axis of color scale. + TGLText *fText; // GL text-output object. + Float_t fTextSize; // Overlay text size. + Float_t fPagerGap; // + Bool_t fRnrFrame; // // module configuration - Float_t fExpandCell; - Color_t fModuleFrameCol; + Float_t fExpandCell; // + Color_t fModuleFrameCol; // // palette configuratiom - Float_t fPaletteOffset; - Float_t fPaletteLength; + Float_t fPaletteOffset; // + Float_t fPaletteLength; // // symbol configuration - Int_t fWActive; - Float_t fWWidth; - Float_t fWHeight; - Float_t fWOff; // offset relative to widget size - Color_t fWCol; - Int_t fWActiveCol; - Color_t fFontCol; + Int_t fWActive; // + Float_t fWWidth; // + Float_t fWHeight; // + Float_t fWOff; // Offset relative to widget size. + Color_t fWCol; // + Int_t fWActiveCol; // + Color_t fFontCol; // // wrappers Float_t TextLength(const char* txt); @@ -118,7 +118,7 @@ public: TGLText* GetFont() { return fText; } void SetGLText(TGLText* t) { fText = t; } - ClassDef(AliEveITSModuleStepper, 0); + ClassDef(AliEveITSModuleStepper, 0); // Display scaled ITS modules in a paged layout, also providing GL-overaly control GUI. }; #endif diff --git a/EVE/EveDet/AliEveITSModuleStepperEditor.cxx b/EVE/EveDet/AliEveITSModuleStepperEditor.cxx index 06310379f73..84e59f3f30f 100644 --- a/EVE/EveDet/AliEveITSModuleStepperEditor.cxx +++ b/EVE/EveDet/AliEveITSModuleStepperEditor.cxx @@ -23,8 +23,8 @@ //______________________________________________________________________________ -// AliEveITSModuleStepperEditor // +// Editor for AliEveITSModuleStepper. ClassImp(AliEveITSModuleStepperEditor) @@ -35,28 +35,31 @@ AliEveITSModuleStepperEditor::AliEveITSModuleStepperEditor(const TGWindow *p, In fM(0), fStepper(0) { + // Constructor. + MakeTitle("AliEveITSModuleStepper"); fStepper = new TEveGridStepperSubEditor(this); - fStepper->Connect("Changed()", "AliEveITSModuleStepperEditor", this, "UpdateStore()"); + fStepper->Connect("Changed()", "AliEveITSModuleStepperEditor", this, "UpdateStepper()"); AddFrame(fStepper, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0)); } -AliEveITSModuleStepperEditor::~AliEveITSModuleStepperEditor() -{} - /******************************************************************************/ void AliEveITSModuleStepperEditor::SetModel(TObject* obj) { + // Set model object. + fM = dynamic_cast(obj); fStepper->SetModel(fM->GetStepper()); } /******************************************************************************/ -void AliEveITSModuleStepperEditor::UpdateStore() +void AliEveITSModuleStepperEditor::UpdateStepper() { + // Update the model object. + fM->Apply(); Update(); gEve->Redraw3D(kTRUE); diff --git a/EVE/EveDet/AliEveITSModuleStepperEditor.h b/EVE/EveDet/AliEveITSModuleStepperEditor.h index cab2993a3ff..dfda0f4a7a5 100644 --- a/EVE/EveDet/AliEveITSModuleStepperEditor.h +++ b/EVE/EveDet/AliEveITSModuleStepperEditor.h @@ -28,18 +28,19 @@ private: AliEveITSModuleStepperEditor& operator=(const AliEveITSModuleStepperEditor&); // Not implemented protected: - AliEveITSModuleStepper* fM; // fModel dynamic-casted to AliEveITSModuleStepperEditor + AliEveITSModuleStepper *fM; // Model object. - TEveGridStepperSubEditor* fStepper; + TEveGridStepperSubEditor *fStepper; // GUI component for grid-stepper control. public: AliEveITSModuleStepperEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - virtual ~AliEveITSModuleStepperEditor(); + virtual ~AliEveITSModuleStepperEditor() {} virtual void SetModel(TObject* obj); - void UpdateStore(); - ClassDef(AliEveITSModuleStepperEditor, 0); // Editor for AliEveITSModuleStepper -}; // endclass AliEveITSModuleStepperEditor + void UpdateStepper(); + + ClassDef(AliEveITSModuleStepperEditor, 0); // Editor for AliEveITSModuleStepper. +}; #endif diff --git a/EVE/EveDet/AliEveITSScaledModule.cxx b/EVE/EveDet/AliEveITSScaledModule.cxx index de3b577745b..b3938041e5a 100644 --- a/EVE/EveDet/AliEveITSScaledModule.cxx +++ b/EVE/EveDet/AliEveITSScaledModule.cxx @@ -23,6 +23,7 @@ //______________________________________________________________________________ // AliEveDigitScaleInfo // + ClassImp(AliEveDigitScaleInfo) AliEveDigitScaleInfo::AliEveDigitScaleInfo(): @@ -86,9 +87,15 @@ void AliEveITSScaledModule::ScaledDigit::Dump() const printf("N %d, sum %f, sqr_sum %f",N, sum, sqr_sum); } + //______________________________________________________________________________ + // AliEveITSScaledModule + +//______________________________________________________________________________ // +// Visualization of an ITS module with digits aggregated +// on a grid of pre-defined size. ClassImp(AliEveITSScaledModule) diff --git a/EVE/EveDet/AliEveITSScaledModule.h b/EVE/EveDet/AliEveITSScaledModule.h index febe59dd913..dce43eb4187 100644 --- a/EVE/EveDet/AliEveITSScaledModule.h +++ b/EVE/EveDet/AliEveITSScaledModule.h @@ -31,23 +31,23 @@ private: AliEveDigitScaleInfo& operator=(const AliEveDigitScaleInfo&); // Not implemented protected: - Int_t fScale; - Int_t fStatType; + Int_t fScale; // Current scale. + Int_t fStatType; // Digit scaling algorithm, see StatType_e. - Bool_t fSyncPalette; + Bool_t fSyncPalette; // Synchronize palette on next usage. public: AliEveDigitScaleInfo(); - virtual ~AliEveDigitScaleInfo(){} + virtual ~AliEveDigitScaleInfo() {} - Int_t GetScale() { return fScale; } - void ScaleChanged(Int_t s); + Int_t GetScale() const { return fScale; } + void ScaleChanged(Int_t s); - Int_t GetStatType() { return fStatType; } - void StatTypeChanged(Int_t t); + Int_t GetStatType() const { return fStatType; } + void StatTypeChanged(Int_t t); - Bool_t GetSyncPalette(){return fSyncPalette;} - void SetSyncPalette(Bool_t x){fSyncPalette = x;} + Bool_t GetSyncPalette() const { return fSyncPalette; } + void SetSyncPalette(Bool_t x) { fSyncPalette = x; } ClassDef(AliEveDigitScaleInfo, 1); }; @@ -109,7 +109,7 @@ public: void GetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total); AliEveDigitScaleInfo* GetScaleInfo() { return fScaleInfo; } - ClassDef(AliEveITSScaledModule, 1); + ClassDef(AliEveITSScaledModule, 1); // Visualization of an ITS module with digits aggregated on a grid of pre-defined size. }; // endclass AliEveITSScaledModule #endif diff --git a/EVE/EveDet/AliEveITSScaledModuleEditor.cxx b/EVE/EveDet/AliEveITSScaledModuleEditor.cxx index 4b6a7dd9a1c..7a4d69e2c9a 100644 --- a/EVE/EveDet/AliEveITSScaledModuleEditor.cxx +++ b/EVE/EveDet/AliEveITSScaledModuleEditor.cxx @@ -26,24 +26,23 @@ //______________________________________________________________________________ -// AliEveITSScaledModuleEditor // +// Editor for AliEveITSScaledModule. ClassImp(AliEveITSScaledModuleEditor) - AliEveITSScaledModuleEditor::AliEveITSScaledModuleEditor(const TGWindow *p, Int_t width, Int_t height, - UInt_t options, Pixel_t back) : - TGedFrame(p, width, height, options | kVerticalFrame, back), - - fInfoFrame(0), - - fModule(0), - - fScale(0), - fStatistic(0), - fInfoLabel0(0), - fInfoLabel1(0) +AliEveITSScaledModuleEditor::AliEveITSScaledModuleEditor(const TGWindow *p, Int_t width, Int_t height, + UInt_t options, Pixel_t back) : + TGedFrame(p, width, height, options | kVerticalFrame, back), + fModule(0), + fScale(0), + fStatistic(0), + fInfoFrame(0), + fInfoLabel0(0), + fInfoLabel1(0) { + // Constructor. + MakeTitle("AliEveITSScaledModule"); // Create widgets { @@ -76,12 +75,11 @@ ClassImp(AliEveITSScaledModuleEditor) } /******************************************************************************/ -AliEveITSScaledModuleEditor::~AliEveITSScaledModuleEditor() -{} -/******************************************************************************/ void AliEveITSScaledModuleEditor::CreateInfoFrame() { + // Create a frame under tab "Info". + fInfoFrame = CreateEditorTabSubFrame("Info"); TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10, kHorizontalFrame | @@ -100,19 +98,20 @@ void AliEveITSScaledModuleEditor::CreateInfoFrame() fInfoLabel0 = new TGLabel(fInfoFrame); fInfoLabel0->SetTextJustify(kTextLeft); fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, - lp, 0, 8, 0)); + lp, 0, 8, 0)); fInfoLabel1 = new TGLabel(fInfoFrame); fInfoLabel1->SetTextJustify(kTextLeft); fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, - lp, 0, 2, 8)); - + lp, 0, 2, 8)); } /******************************************************************************/ void AliEveITSScaledModuleEditor::SetModel(TObject* obj) { + // Set model object. + fModule = dynamic_cast(obj); // widgets @@ -131,6 +130,8 @@ void AliEveITSScaledModuleEditor::SetModel(TObject* obj) void AliEveITSScaledModuleEditor::DoScale() { + // Slot for Scale. + fModule->GetScaleInfo()->ScaleChanged(fScale->GetIntNumber()); Int_t cnx, cnz, total; @@ -144,6 +145,8 @@ void AliEveITSScaledModuleEditor::DoScale() void AliEveITSScaledModuleEditor::DoStatType(Int_t v) { + // Slot for StatType. + fModule->GetScaleInfo()->StatTypeChanged(v); Update(); fGedEditor->SetModel(fGedEditor->GetPad(), fGedEditor->GetModel(), kButton1Down); diff --git a/EVE/EveDet/AliEveITSScaledModuleEditor.h b/EVE/EveDet/AliEveITSScaledModuleEditor.h index 47e7bc4a811..736d18d94f0 100644 --- a/EVE/EveDet/AliEveITSScaledModuleEditor.h +++ b/EVE/EveDet/AliEveITSScaledModuleEditor.h @@ -37,26 +37,25 @@ private: void CreateInfoFrame(); protected: - TGVerticalFrame* fInfoFrame; + AliEveITSScaledModule *fModule; // Model object. - AliEveITSScaledModule* fModule; // fModel dynamic-casted to AliEveITSScaledModuleEditor + TGNumberEntry *fScale; // Number-entry for digit-scale. + TGComboBox *fStatistic; // Selection of scaling algorithm. - TGNumberEntry* fScale; - TGComboBox* fStatistic; - - TGLabel* fInfoLabel0; - TGLabel* fInfoLabel1; + TGVerticalFrame *fInfoFrame; // Frame in "Info" tab. + TGLabel *fInfoLabel0; // Info text. + TGLabel *fInfoLabel1; // Info text. public: AliEveITSScaledModuleEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - virtual ~AliEveITSScaledModuleEditor(); + virtual ~AliEveITSScaledModuleEditor() {} virtual void SetModel(TObject* obj); void DoScale(); void DoStatType(Int_t t); - ClassDef(AliEveITSScaledModuleEditor, 0); // Editor for AliEveITSScaledModule -}; // endclass AliEveITSScaledModuleEditor + ClassDef(AliEveITSScaledModuleEditor, 0); // Editor for AliEveITSScaledModule. +}; #endif -- 2.39.3