From a15e6d7d7c80edcd0858dcdfd1d4bc5a888b9bf4 Mon Sep 17 00:00:00 2001 From: mtadel Date: Thu, 13 Mar 2008 15:27:38 +0000 Subject: [PATCH] Merge changes from branches/dev/EVE. This branch was following development in ROOT trunk. ROOT-5.19.2 is required to compile. --- EVE/EveBase/AliEveEventManager.cxx | 125 ++++++------ EVE/EveBase/AliEveEventManager.h | 16 +- EVE/EveBase/AliEveJetPlane.cxx | 10 +- EVE/EveBase/AliEveJetPlane.h | 22 +-- EVE/EveBase/AliEveJetPlaneEditor.cxx | 19 +- EVE/EveBase/AliEveJetPlaneEditor.h | 9 +- EVE/EveBase/AliEveJetPlaneGL.cxx | 23 ++- EVE/EveBase/AliEveJetPlaneGL.h | 11 +- EVE/EveBase/AliEveKineTools.cxx | 49 ++--- EVE/EveBase/AliEveKineTools.h | 4 +- EVE/EveBase/AliEveTrackFitter.cxx | 120 +++++------ EVE/EveBase/AliEveTrackFitter.h | 44 +++-- EVE/EveBase/AliEveTrackFitterEditor.cxx | 6 +- EVE/EveBase/AliEveTrackFitterEditor.h | 5 +- EVE/EveBase/AliEveVSDCreator.cxx | 184 +++++++++-------- EVE/EveBase/AliEveVSDCreator.h | 9 +- EVE/EveBase/LinkDef.h | 2 +- .../blacklisted-classes/AliEveCascade.h | 4 +- .../AliEveCascadeEditors.h | 4 +- EVE/EveBase/blacklisted-classes/AliEveV0.h | 4 +- .../blacklisted-classes/AliEveV0Editors.h | 4 +- EVE/EveDet/.SKEL-ged.h | 4 +- EVE/EveDet/.SKEL-gedsubed.h | 4 +- EVE/EveDet/.SKEL-gl.h | 4 +- EVE/EveDet/.SKEL.h | 4 +- EVE/EveDet/AliEveITSDigitsInfo.cxx | 18 +- EVE/EveDet/AliEveITSDigitsInfo.h | 16 +- EVE/EveDet/AliEveITSModule.cxx | 11 +- EVE/EveDet/AliEveITSModule.h | 4 +- EVE/EveDet/AliEveITSModuleStepper.cxx | 54 +++-- EVE/EveDet/AliEveITSModuleStepper.h | 15 +- EVE/EveDet/AliEveITSModuleStepperEditor.cxx | 11 +- EVE/EveDet/AliEveITSModuleStepperEditor.h | 4 +- EVE/EveDet/AliEveITSScaledModule.cxx | 176 +++++++++-------- EVE/EveDet/AliEveITSScaledModule.h | 26 +-- EVE/EveDet/AliEveITSScaledModuleEditor.cxx | 11 +- EVE/EveDet/AliEveITSScaledModuleEditor.h | 6 +- EVE/EveDet/AliEveMUONChamber.cxx | 10 +- EVE/EveDet/AliEveMUONChamber.h | 8 +- EVE/EveDet/AliEveMUONChamberData.cxx | 7 +- EVE/EveDet/AliEveMUONChamberData.h | 17 +- EVE/EveDet/AliEveMUONChamberEditor.cxx | 9 +- EVE/EveDet/AliEveMUONChamberEditor.h | 7 +- EVE/EveDet/AliEveMUONChamberGL.cxx | 17 +- EVE/EveDet/AliEveMUONChamberGL.h | 7 +- EVE/EveDet/AliEveMUONData.cxx | 14 +- EVE/EveDet/AliEveMUONData.h | 8 +- EVE/EveDet/AliEveMUONTrack.cxx | 38 ++-- EVE/EveDet/AliEveMUONTrack.h | 17 +- EVE/EveDet/AliEvePMDModule.cxx | 53 +++-- EVE/EveDet/AliEvePMDModule.h | 50 +++-- EVE/EveDet/AliEvePMDModuleEditor.cxx | 35 ++-- EVE/EveDet/AliEvePMDModuleEditor.h | 31 ++- EVE/EveDet/AliEveT0Module.cxx | 85 ++++---- EVE/EveDet/AliEveT0Module.h | 31 +-- EVE/EveDet/AliEveTOFDigitsInfo.cxx | 2 +- EVE/EveDet/AliEveTOFDigitsInfo.h | 4 +- EVE/EveDet/AliEveTOFDigitsInfoEditor.h | 4 +- EVE/EveDet/AliEveTOFSector.cxx | 16 +- EVE/EveDet/AliEveTOFSector.h | 4 +- EVE/EveDet/AliEveTOFSectorEditor.h | 4 +- EVE/EveDet/AliEveTOFStrip.cxx | 21 +- EVE/EveDet/AliEveTOFStrip.h | 4 +- EVE/EveDet/AliEveTOFStripEditor.h | 4 +- EVE/EveDet/AliEveTPCData.cxx | 10 +- EVE/EveDet/AliEveTPCData.h | 14 +- EVE/EveDet/AliEveTPCLoader.cxx | 24 ++- EVE/EveDet/AliEveTPCLoader.h | 11 +- EVE/EveDet/AliEveTPCLoaderEditor.cxx | 14 +- EVE/EveDet/AliEveTPCLoaderEditor.h | 15 +- EVE/EveDet/AliEveTPCSector2D.cxx | 17 +- EVE/EveDet/AliEveTPCSector2D.h | 10 +- EVE/EveDet/AliEveTPCSector2DEditor.h | 15 +- EVE/EveDet/AliEveTPCSector2DGL.cxx | 101 +++++----- EVE/EveDet/AliEveTPCSector2DGL.h | 28 +-- EVE/EveDet/AliEveTPCSector3D.cxx | 11 +- EVE/EveDet/AliEveTPCSector3D.h | 8 +- EVE/EveDet/AliEveTPCSector3DEditor.cxx | 7 - EVE/EveDet/AliEveTPCSector3DEditor.h | 13 +- EVE/EveDet/AliEveTPCSector3DGL.cxx | 8 +- EVE/EveDet/AliEveTPCSector3DGL.h | 13 +- EVE/EveDet/AliEveTPCSectorData.cxx | 79 ++++---- EVE/EveDet/AliEveTPCSectorData.h | 20 +- EVE/EveDet/AliEveTPCSectorViz.cxx | 34 ++-- EVE/EveDet/AliEveTPCSectorViz.h | 25 +-- EVE/EveDet/AliEveTPCSectorVizEditor.cxx | 5 +- EVE/EveDet/AliEveTPCSectorVizEditor.h | 14 +- EVE/EveDet/AliEveTRDData.cxx | 42 ++-- EVE/EveDet/AliEveTRDData.h | 22 +-- EVE/EveDet/AliEveTRDLoader.cxx | 123 +++++++----- EVE/EveDet/AliEveTRDLoader.h | 24 +-- EVE/EveDet/AliEveTRDLoaderImp.cxx | 91 ++++----- EVE/EveDet/AliEveTRDLoaderImp.h | 26 +-- EVE/EveDet/AliEveTRDLoaderManager.cxx | 49 ++--- EVE/EveDet/AliEveTRDLoaderManager.h | 25 +-- EVE/EveDet/AliEveTRDModule.cxx | 32 ++- EVE/EveDet/AliEveTRDModule.h | 51 +++-- EVE/EveDet/AliEveTRDModuleImp.cxx | 34 +++- EVE/EveDet/AliEveTRDModuleImp.h | 4 +- EVE/EveHLT/AliEveHOMERManager.cxx | 10 +- EVE/EveHLT/AliEveHOMERManager.h | 50 ++--- EVE/EveHLT/AliEveHOMERManagerEditor.h | 4 +- EVE/EveHLT/AliEveHOMERSource.cxx | 24 ++- EVE/EveHLT/AliEveHOMERSource.h | 64 +++++- EVE/EveHLT/AliEveHOMERSourceList.cxx | 59 +++++- EVE/EveHLT/AliEveHOMERSourceList.h | 31 ++- EVE/EveHLT/AliEveHOMERSourceMap.cxx | 183 +++++++++++++++++ EVE/EveHLT/AliEveHOMERSourceMap.h | 187 ++++++++++++++++++ EVE/EveHLT/LinkDef.h | 2 + EVE/alice-macros/MUON_display.C | 20 +- EVE/alice-macros/MUON_geom.C | 1 - EVE/alice-macros/MUON_geomAll.C | 1 - EVE/alice-macros/NLT_test.C | 33 ---- EVE/alice-macros/NLT_trackcount_init.C | 22 ++- EVE/alice-macros/emcal_digits.C | 2 +- EVE/alice-macros/esd_tracks.C | 26 +-- EVE/alice-macros/event_goto.C | 4 +- EVE/alice-macros/event_next.C | 4 +- EVE/alice-macros/event_prev.C | 4 +- EVE/alice-macros/geom_gentle.C | 3 +- EVE/alice-macros/geom_vzero.C | 8 +- EVE/alice-macros/primary_vertex.C | 2 +- EVE/alice-macros/t0_raw.C | 2 +- EVE/alice-macros/tpc_digits.C | 8 +- EVE/alice-macros/vzero_digits.C | 4 +- EVE/alieve_main/alieve_main.cxx | 8 +- EVE/binalieve.pkg | 4 +- EVE/hlt-macros/homer_display.C | 5 +- EVE/hlt-macros/sampleConfig.xml | 31 +++ EVE/hlt-macros/test_sources.C | 31 +++ EVE/macros/alieve_init.C | 4 +- EVE/macros/trackcount_init.C | 6 +- 132 files changed, 2026 insertions(+), 1389 deletions(-) create mode 100644 EVE/EveHLT/AliEveHOMERSourceMap.cxx create mode 100644 EVE/EveHLT/AliEveHOMERSourceMap.h delete mode 100644 EVE/alice-macros/NLT_test.C create mode 100755 EVE/hlt-macros/sampleConfig.xml create mode 100644 EVE/hlt-macros/test_sources.C diff --git a/EVE/EveBase/AliEveEventManager.cxx b/EVE/EveBase/AliEveEventManager.cxx index 1fa79364ff7..2e1d20e1213 100644 --- a/EVE/EveBase/AliEveEventManager.cxx +++ b/EVE/EveBase/AliEveEventManager.cxx @@ -8,7 +8,6 @@ **************************************************************************/ #include "AliEveEventManager.h" -#include #include #include @@ -22,14 +21,14 @@ #include #include -#include - -#include #include +//============================================================================== +//============================================================================== +// AliEveEventManager +//============================================================================== //______________________________________________________________________________ -// AliEveEventManager // // Provide interface for loading and navigating standard AliRoot data // (AliRunLoader) and ESDs. @@ -37,10 +36,13 @@ // Missing support for raw-data. For now this is handled individually // by each sub-detector. // +// Also provides interface to magnetic-field and geometry. Mostly +// intended as wrappers over standard AliRoot functionality for +// convenient use from visualizateion macros. ClassImp(AliEveEventManager) -AliEveEventManager* gEvent = 0; +AliEveEventManager* gAliEveEvent = 0; Bool_t AliEveEventManager::fgAssertRunLoader = kFALSE; Bool_t AliEveEventManager::fgAssertESD = kFALSE; @@ -75,6 +77,15 @@ AliEveEventManager::AliEveEventManager(TString path, Int_t ev) : if (ev >= 0) GotoEvent(ev); } +AliEveEventManager::~AliEveEventManager() +{ + // Destructor. + + // Somewhat unclear what to do here. + // In principle should close all data sources and deregister from + // TEveManager. +} + /******************************************************************************/ void AliEveEventManager::Open() @@ -85,7 +96,7 @@ void AliEveEventManager::Open() // Global data-members fgAssertRunLoader and fgAssertESD can be set // to throw exceptions instead. - static const TEveException eH("AliEveEventManager::Open "); + static const TEveException kEH("AliEveEventManager::Open "); gSystem->ExpandPathName(fPath); if (fPath[0] != '/') @@ -93,17 +104,17 @@ void AliEveEventManager::Open() Int_t runNo = -1; - TString ga_path(Form("%s/galice.root", fPath.Data())); - if (gSystem->AccessPathName(ga_path, kReadPermission) == kFALSE) + TString gaPath(Form("%s/galice.root", fPath.Data())); + if (gSystem->AccessPathName(gaPath, kReadPermission) == kFALSE) { - fRunLoader = AliRunLoader::Open(ga_path); + fRunLoader = AliRunLoader::Open(gaPath); if (fRunLoader) { - TString alice_path = fPath + "/"; - fRunLoader->SetDirName(alice_path); + TString alicePath = fPath + "/"; + fRunLoader->SetDirName(alicePath); if (fRunLoader->LoadgAlice() != 0) - Warning(eH, "failed loading gAlice via run-loader."); + Warning(kEH, "failed loading gAlice via run-loader."); if (fRunLoader->LoadHeader() == 0) { @@ -111,33 +122,33 @@ void AliEveEventManager::Open() } else { - Warning(eH, "failed loading run-loader's header."); + Warning(kEH, "failed loading run-loader's header."); delete fRunLoader; fRunLoader = 0; } } else // run-loader open failed { - Warning(eH, "failed opening ALICE run-loader from '%s'.", ga_path.Data()); + Warning(kEH, "failed opening ALICE run-loader from '%s'.", gaPath.Data()); } } else // galice not readable { - Warning(eH, "can not read '%s'.", ga_path.Data()); + Warning(kEH, "can not read '%s'.", gaPath.Data()); } if (fRunLoader == 0) { if (fgAssertRunLoader) - throw(eH + "Bootstraping of run-loader failed. Its precence was requested."); + throw(kEH + "Bootstraping of run-loader failed. Its precence was requested."); else - Warning(eH, "Bootstraping of run-loader failed."); + Warning(kEH, "Bootstraping of run-loader failed."); } - TString esd_path(Form("%s/AliESDs.root", fPath.Data())); - if (gSystem->AccessPathName(esd_path, kReadPermission) == kFALSE) + TString esdPath(Form("%s/AliESDs.root", fPath.Data())); + if (gSystem->AccessPathName(esdPath, kReadPermission) == kFALSE) { - fESDFile = new TFile(esd_path); + fESDFile = new TFile(esdPath); if (fESDFile->IsZombie() == kFALSE) { fESD = new AliESDEvent(); @@ -159,37 +170,37 @@ void AliEveEventManager::Open() else // esdtree == 0 { delete fESDFile; fESDFile = 0; - Warning(eH, "failed getting the esdTree."); + Warning(kEH, "failed getting the esdTree."); } } else // esd tfile is zombie { delete fESDFile; fESDFile = 0; - Warning(eH, "failed opening ESD from '%s'.", esd_path.Data()); + Warning(kEH, "failed opening ESD from '%s'.", esdPath.Data()); } } else // esd not readable { - Warning(eH, "can not read ESD file '%s'.", esd_path.Data()); + Warning(kEH, "can not read ESD file '%s'.", esdPath.Data()); } if (fESDTree == 0) { if (fgAssertESD) { - throw(eH + "ESD not initialized. Its precence was requested."); + throw(kEH + "ESD not initialized. Its precence was requested."); } else { - Warning(eH, "ESD not initialized."); + Warning(kEH, "ESD not initialized."); } } if (runNo < 0) - throw(eH + "invalid run number."); + throw(kEH + "invalid run number."); { AliCDBManager* cdb = AliCDBManager::Instance(); cdb->SetDefaultStorage(fgCdbUri); if (cdb->IsDefaultStorageSet() == kFALSE) - throw(eH + "CDB initialization failed."); + throw(kEH + "CDB initialization failed."); cdb->SetRun(runNo); } @@ -206,7 +217,7 @@ void AliEveEventManager::GotoEvent(Int_t event) // AfterNewEventLoaded() is called. This executes commands that // were registered via TEveEventManager::AddNewEventCommand(). - static const TEveException eH("AliEveEventManager::GotoEvent "); + static const TEveException kEH("AliEveEventManager::GotoEvent "); Int_t maxEvent = 0; if (fRunLoader) @@ -214,10 +225,10 @@ void AliEveEventManager::GotoEvent(Int_t event) else if (fESDTree) maxEvent = fESDTree->GetEntries() - 1; else - throw(eH + "neither RunLoader nor ESD loaded."); + throw(kEH + "neither RunLoader nor ESD loaded."); if (event < 0 || event > maxEvent) - throw(eH + Form("event %d not present, available range [%d, %d].", + throw(kEH + Form("event %d not present, available range [%d, %d].", event, 0, maxEvent)); TEveManager::TRedrawDisabler rd(gEve); @@ -233,12 +244,12 @@ void AliEveEventManager::GotoEvent(Int_t event) if (fRunLoader) { if (fRunLoader->GetEvent(fEventId) != 0) - throw(eH + "failed getting required event."); + throw(kEH + "failed getting required event."); } if (fESDTree) { if (fESDTree->GetEntry(fEventId) <= 0) - throw(eH + "failed getting required event from ESD."); + throw(kEH + "failed getting required event from ESD."); if (fESDfriendExists) fESD->SetESDfriend(fESDfriend); @@ -273,13 +284,13 @@ AliRunLoader* AliEveEventManager::AssertRunLoader() // Throws exception in case run-loader is not available. // Static utility for macros. - static const TEveException eH("AliEveEventManager::AssertRunLoader "); + static const TEveException kEH("AliEveEventManager::AssertRunLoader "); - if (gEvent == 0) - throw(eH + "ALICE event not ready."); - if (gEvent->fRunLoader == 0) - throw(eH + "AliRunLoader not initialised."); - return gEvent->fRunLoader; + if (gAliEveEvent == 0) + throw(kEH + "ALICE event not ready."); + if (gAliEveEvent->fRunLoader == 0) + throw(kEH + "AliRunLoader not initialised."); + return gAliEveEvent->fRunLoader; } AliESDEvent* AliEveEventManager::AssertESD() @@ -288,13 +299,13 @@ AliESDEvent* AliEveEventManager::AssertESD() // Throws exception in case ESD is not available. // Static utility for macros. - static const TEveException eH("AliEveEventManager::AssertESD "); + static const TEveException kEH("AliEveEventManager::AssertESD "); - if (gEvent == 0) - throw(eH + "ALICE event not ready."); - if (gEvent->fESD == 0) - throw(eH + "AliESD not initialised."); - return gEvent->fESD; + if (gAliEveEvent == 0) + throw(kEH + "ALICE event not ready."); + if (gAliEveEvent->fESD == 0) + throw(kEH + "AliESD not initialised."); + return gAliEveEvent->fESD; } AliESDfriend* AliEveEventManager::AssertESDfriend() @@ -303,13 +314,13 @@ AliESDfriend* AliEveEventManager::AssertESDfriend() // Throws exception in case ESDfriend-loader is not available. // Static utility for macros. - static const TEveException eH("AliEveEventManager::AssertESDfriend "); + static const TEveException kEH("AliEveEventManager::AssertESDfriend "); - if (gEvent == 0) - throw(eH + "ALICE event not ready."); - if (gEvent->fESDfriend == 0) - throw(eH + "AliESDfriend not initialised."); - return gEvent->fESDfriend; + if (gAliEveEvent == 0) + throw(kEH + "ALICE event not ready."); + if (gAliEveEvent->fESDfriend == 0) + throw(kEH + "AliESDfriend not initialised."); + return gAliEveEvent->fESDfriend; } AliMagF* AliEveEventManager::AssertMagField() @@ -320,8 +331,8 @@ AliMagF* AliEveEventManager::AssertMagField() if (fgMagField == 0) { - if (gEvent && gEvent->fRunLoader && gEvent->fRunLoader->GetAliRun()) - fgMagField = gEvent->fRunLoader->GetAliRun()->Field(); + if (gAliEveEvent && gAliEveEvent->fRunLoader && gAliEveEvent->fRunLoader->GetAliRun()) + fgMagField = gAliEveEvent->fRunLoader->GetAliRun()->Field(); else fgMagField = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG); } @@ -338,7 +349,7 @@ TGeoManager* AliEveEventManager::AssertGeometry() // !!!! Should we set gGeoManager here? - static const TEveException eH("AliEveEventManager::AssertGeometry "); + static const TEveException kEH("AliEveEventManager::AssertGeometry "); if (AliGeomManager::GetGeometry() == 0) { @@ -346,12 +357,12 @@ TGeoManager* AliEveEventManager::AssertGeometry() AliGeomManager::LoadGeometry(); if ( ! AliGeomManager::GetGeometry()) { - throw(eH + "can not load geometry."); + throw(kEH + "can not load geometry."); } if ( ! AliGeomManager::ApplyAlignObjsFromCDB("ITS TPC TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO ACORDE")) { - ::Warning(eH, "mismatch of alignable volumes. Proceeding."); - // throw(eH + "could not apply align objs."); + ::Warning(kEH, "mismatch of alignable volumes. Proceeding."); + // throw(kEH + "could not apply align objs."); } } diff --git a/EVE/EveBase/AliEveEventManager.h b/EVE/EveBase/AliEveEventManager.h index 4fcfed587de..8310147dec1 100644 --- a/EVE/EveBase/AliEveEventManager.h +++ b/EVE/EveBase/AliEveEventManager.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_EventAlieve_H -#define ALIEVE_EventAlieve_H +#ifndef AliEveEventManaget_H +#define AliEveEventManager_H #include @@ -22,6 +22,14 @@ class TFile; class TTree; class TGeoManager; +//============================================================================== +// +// AliEveEventManager +// +// Interface to ALICE event-data (RunLoader, ESD), magnetic field and +// geometry. +// + class AliEveEventManager : public TEveEventManager { @@ -54,6 +62,8 @@ public: AliEveEventManager(); AliEveEventManager(TString path, Int_t ev=0); + virtual ~AliEveEventManager(); + virtual void Open(); virtual void GotoEvent(Int_t event); @@ -80,6 +90,6 @@ public: ClassDef(AliEveEventManager, 1); }; // endclass AliEveEventManager -extern AliEveEventManager* gEvent; +extern AliEveEventManager* gAliEveEvent; #endif diff --git a/EVE/EveBase/AliEveJetPlane.cxx b/EVE/EveBase/AliEveJetPlane.cxx index 7d341eac564..755b12fbf6f 100644 --- a/EVE/EveBase/AliEveJetPlane.cxx +++ b/EVE/EveBase/AliEveJetPlane.cxx @@ -8,7 +8,9 @@ **************************************************************************/ #include "AliEveJetPlane.h" -#include + +#include + #include #include #include @@ -17,6 +19,8 @@ //______________________________________________________________________________ // // Show jets and tracks in eta-phi plane. +// +// ClassImp(AliEveJetPlane) @@ -46,7 +50,6 @@ AliEveJetPlane::AliEveJetPlane(Int_t iev) : fGridColor(5), - fHMTrans(), fJets(), fTracks(), @@ -61,6 +64,7 @@ AliEveJetPlane::AliEveJetPlane(Int_t iev) : fSelectionFlag (1) { SetMainColorPtr(&fGridColor); + InitMainTrans(); } /******************************************************************************/ @@ -103,7 +107,7 @@ void AliEveJetPlane::Paint(Option_t* /*option*/) buff.fID = this; buff.fColor = fGridColor; buff.fTransparency = 0; - fHMTrans.SetBuffer3D(buff); + if (HasMainTrans()) RefMainTrans().SetBuffer3D(buff); buff.SetSectionsValid(TBuffer3D::kCore); Int_t reqSections = gPad->GetViewer3D()->AddObject(buff); diff --git a/EVE/EveBase/AliEveJetPlane.h b/EVE/EveBase/AliEveJetPlane.h index b7c20922651..a6981ea761c 100644 --- a/EVE/EveBase/AliEveJetPlane.h +++ b/EVE/EveBase/AliEveJetPlane.h @@ -7,12 +7,10 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_JetPlane_H -#define ALIEVE_JetPlane_H +#ifndef AliEveJetPlane_H +#define AliEveJetPlane_H -#include #include -#include #include #include @@ -22,6 +20,11 @@ #include +//============================================================================== +// +// AliEveJetPlane +// +// Class for display of jets and tracks in eta-phi plane. class AliEveJetPlane : public TEveElementList, public TAtt3D, @@ -48,8 +51,6 @@ protected: Color_t fGridColor; // Color of coordinate grid. - TEveTrans fHMTrans;// Transformation matrix. - std::vector fJets; // Jets to display. std::vector fTracks; // Tracks to display. @@ -113,18 +114,11 @@ public: void SetSelectionFlag(Int_t s) { fSelectionFlag = s;} - virtual Bool_t CanEditMainColor() { return kTRUE; } - - virtual Bool_t CanEditMainHMTrans() { return kTRUE; } - virtual TEveTrans* PtrMainHMTrans() { return &fHMTrans; } + virtual Bool_t CanEditMainColor()const { return kTRUE; } virtual void ComputeBBox(); virtual void Paint(Option_t* option = ""); - TEveTrans& RefHMTrans() { return fHMTrans; } - void SetTransMatrix(Double_t* carr) { fHMTrans.SetFrom(carr); } - void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat); } - ClassDef(AliEveJetPlane, 1); // Show jets and tracks in eta-phi plane. }; // endclass AliEveJetPlane diff --git a/EVE/EveBase/AliEveJetPlaneEditor.cxx b/EVE/EveBase/AliEveJetPlaneEditor.cxx index adf43903064..6cd0df59363 100644 --- a/EVE/EveBase/AliEveJetPlaneEditor.cxx +++ b/EVE/EveBase/AliEveJetPlaneEditor.cxx @@ -12,21 +12,19 @@ #include -#include -#include -#include -#include #include #include -#include -#include #include #include +//============================================================================== +//============================================================================== +// AliEveJetPlaneEditor +//============================================================================== //______________________________________________________________________________ -// AliEveJetPlaneEditor // +// GUI editor for AliEveJetPlane class. AliEveJetPlaneEditor::StaticDataWindow* AliEveJetPlaneEditor::fgStaticWindow = 0; @@ -175,12 +173,15 @@ void AliEveJetPlaneEditor::DoStaticDataWindow() } -/******************************************************************************/ -/******************************************************************************/ +//============================================================================== +//============================================================================== +// AliEveJetPlaneEditor::StaticDataWindow +//============================================================================== //______________________________________________________________________________ // // Common settings for all AliEveJetPlane objects. +// Used as a pop-up from AliEveJetPlaneEditor. ClassImp(AliEveJetPlaneEditor::StaticDataWindow) diff --git a/EVE/EveBase/AliEveJetPlaneEditor.h b/EVE/EveBase/AliEveJetPlaneEditor.h index dca81cb68a2..e5364172dd0 100644 --- a/EVE/EveBase/AliEveJetPlaneEditor.h +++ b/EVE/EveBase/AliEveJetPlaneEditor.h @@ -7,22 +7,17 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_JetPlaneEditor_H -#define ALIEVE_JetPlaneEditor_H +#ifndef AliEveJetPlaneEditor_H +#define AliEveJetPlaneEditor_H #include -#include class TGButton; class TGCheckButton; class TGNumberEntry; class TGColorSelect; - class TEveGValuator; - -// class TEveGValuator; - class AliEveJetPlane; class AliEveJetPlaneEditor : public TGedFrame diff --git a/EVE/EveBase/AliEveJetPlaneGL.cxx b/EVE/EveBase/AliEveJetPlaneGL.cxx index 0897800557b..7226bf95bac 100644 --- a/EVE/EveBase/AliEveJetPlaneGL.cxx +++ b/EVE/EveBase/AliEveJetPlaneGL.cxx @@ -10,7 +10,6 @@ #include "AliEveJetPlaneGL.h" #include "AliEveJetPlane.h" -#include #include #include @@ -21,6 +20,10 @@ #include #include +//============================================================================== +//============================================================================== +// AliEveJetPlaneGL +//============================================================================== //______________________________________________________________________________ // @@ -71,10 +74,10 @@ void AliEveJetPlaneGL::DirectDraw(TGLRnrCtx & /*rnrCtx*/) const // Show frame for Eta-Phi coordinates glBegin(GL_LINE_LOOP); - glVertex3f( minEta, minPhi, 0); - glVertex3f( maxEta, minPhi, 0); - glVertex3f( maxEta, maxPhi, 0); - glVertex3f( minEta, maxPhi, 0); + glVertex3f(minEta, minPhi, 0); + glVertex3f(maxEta, minPhi, 0); + glVertex3f(maxEta, maxPhi, 0); + glVertex3f(minEta, maxPhi, 0); glEnd(); // Show grid in Eta-Phi coordinates @@ -82,7 +85,7 @@ void AliEveJetPlaneGL::DirectDraw(TGLRnrCtx & /*rnrCtx*/) const dPhi = (maxPhi-minPhi)/(fM->fNPhiDiv - 1); dEta = (maxEta-minEta)/(fM->fNEtaDiv - 1); - for (int count=1; count < fM->fNPhiDiv-1; count++) + for (Int_t count = 1; count < fM->fNPhiDiv-1; ++count) { phiCoord = minPhi + count*dPhi; glBegin(GL_LINES); @@ -91,19 +94,19 @@ void AliEveJetPlaneGL::DirectDraw(TGLRnrCtx & /*rnrCtx*/) const glEnd(); } - for (int count=1; count < fM->fNEtaDiv-1; count++) + for (Int_t count = 1; count < fM->fNEtaDiv-1; ++count) { etaCoord = minEta + count*dEta; glBegin(GL_LINES); - glVertex3f( etaCoord, minPhi, 0); - glVertex3f( etaCoord, maxPhi, 0); + glVertex3f(etaCoord, minPhi, 0); + glVertex3f(etaCoord, maxPhi, 0); glEnd(); } // Show axis tick marks and labels { - TGLCapabilitySwitch lights_off(GL_LIGHTING, false); + TGLCapabilitySwitch lightsOff(GL_LIGHTING, false); TGLAxis ap; ap.SetLineColor(fM->fGridColor); diff --git a/EVE/EveBase/AliEveJetPlaneGL.h b/EVE/EveBase/AliEveJetPlaneGL.h index 6be8d0e182a..8deb2e9c6ae 100644 --- a/EVE/EveBase/AliEveJetPlaneGL.h +++ b/EVE/EveBase/AliEveJetPlaneGL.h @@ -7,17 +7,22 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_JetPlaneGL_H -#define ALIEVE_JetPlaneGL_H +#ifndef AliEveJetPlaneGL_H +#define AliEveJetPlaneGL_H #include class TGLViewer; class TGLScene; - class AliEveJetPlane; +//============================================================================== +// +// AliEveJetPlaneGL +// +// GL rendering code for AliEveJetPlane class. + class AliEveJetPlaneGL : public TGLObject { private: diff --git a/EVE/EveBase/AliEveKineTools.cxx b/EVE/EveBase/AliEveKineTools.cxx index 4c1e5e16788..7e16b7f5045 100644 --- a/EVE/EveBase/AliEveKineTools.cxx +++ b/EVE/EveBase/AliEveKineTools.cxx @@ -28,11 +28,8 @@ // Tools for import of kinematics. Preliminary version. // -using namespace std; - ClassImp(AliEveKineTools) - namespace { typedef std::map TrackMap_t; @@ -61,16 +58,16 @@ void AliEveKineTools::SetDaughterPathMarks(TEveElement* cont, AliStack* stack, B { TEveTrack* track = dynamic_cast(*iter); TParticle* p = stack->Particle(track->GetLabel()); - if(p->GetNDaughters()) { + if (p->GetNDaughters()) + { Int_t d0 = p->GetDaughter(0), d1 = p->GetDaughter(1); - for(int d=d0; d>0 && d<=d1; ++d) + for(int d = d0; d > 0 && d <= d1; ++d) { TParticle* dp = stack->Particle(d); - TEvePathMark* pm = new TEvePathMark(TEvePathMark::kDaughter); - pm->fV.Set(dp->Vx(), dp->Vy(), dp->Vz()); - pm->fP.Set(dp->Px(), dp->Py(), dp->Pz()); - pm->fTime = dp->T(); - track->AddPathMark(pm); + track->AddPathMark(TEvePathMark(TEvePathMark::kDaughter, + TEveVector(dp->Vx(), dp->Vy(), dp->Vz()), + TEveVector(dp->Px(), dp->Py(), dp->Pz()), + dp->T())); } if (recurse) SetDaughterPathMarks(track, stack, recurse); @@ -85,7 +82,7 @@ void AliEveKineTools::SetTrackReferences(TEveElement* cont, TTree* treeTR, Bool_ { // Set decay and track reference path-marks. - static const TEveException eH("AliEveKineTools::ImportPathMarks"); + static const TEveException kEH("AliEveKineTools::ImportPathMarks"); TrackMap_t map; MapTracks(map, cont, recurse); @@ -115,21 +112,22 @@ void AliEveKineTools::SetTrackReferences(TEveElement* cont, TTree* treeTR, Bool_ Int_t label = atr->GetTrack(); if (label < 0) - throw(eH + Form("negative label for entry %d in branch %s.", + throw(kEH + Form("negative label for entry %d in branch %s.", iTrackRef, el->GetName())); - if(label != last_label) { - iter = map.find(label); + if (label != last_label) + { + iter = map.find(label); last_label = label; } - if (iter != map.end()) { - TEvePathMark* pm = new TEvePathMark(isRef ? TEvePathMark::kReference : TEvePathMark::kDecay); - pm->fV.Set(atr->X(),atr->Y(), atr->Z()); - pm->fP.Set(atr->Px(),atr->Py(), atr->Pz()); - pm->fTime = atr->GetTime(); - TEveTrack* track = iter->second; - track->AddPathMark(pm); + if (iter != map.end()) + { + iter->second->AddPathMark + (TEvePathMark(isRef ? TEvePathMark::kReference : TEvePathMark::kDecay, + TEveVector(atr->X(), atr->Y(), atr->Z()), + TEveVector(atr->Px(), atr->Py(), atr->Pz()), + atr->GetTime())); } } // loop track refs } // loop primaries in clones arrays @@ -143,13 +141,16 @@ void AliEveKineTools::SortPathMarks(TEveElement* el, Bool_t recurse) { // Sort path-marks for all tracks by time. + // !!!!! MT ... this is one level deep only! + TEveTrack* track = dynamic_cast(el); - if(track) track->SortPathMarksByTime(); + if (track) track->SortPathMarksByTime(); TEveElement::List_i i = el->BeginChildren(); - while (i != el->EndChildren() && recurse) { + while (i != el->EndChildren() && recurse) + { track = dynamic_cast(el); if (track) track->SortPathMarksByTime(); - i++; + ++i; } } diff --git a/EVE/EveBase/AliEveKineTools.h b/EVE/EveBase/AliEveKineTools.h index 4d61e0f407f..0e3204683a0 100644 --- a/EVE/EveBase/AliEveKineTools.h +++ b/EVE/EveBase/AliEveKineTools.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_KineTools_H -#define ALIEVE_KineTools_H +#ifndef AliEveKineTools_H +#define AliEveKineTools_H #include #include diff --git a/EVE/EveBase/AliEveTrackFitter.cxx b/EVE/EveBase/AliEveTrackFitter.cxx index aeeec3abfe1..bf4a7d30c5e 100644 --- a/EVE/EveBase/AliEveTrackFitter.cxx +++ b/EVE/EveBase/AliEveTrackFitter.cxx @@ -12,8 +12,8 @@ #include "TCanvas.h" #include "TGraph.h" #include "TGraphErrors.h" +#include "TQObject.h" -#include "AliCluster.h" #include "AliRieman.h" #include "AliExternalTrackParam.h" @@ -23,19 +23,24 @@ #include -//______________________________________________________________________________ +//============================================================================== +//============================================================================== // AliEveTrackFitter +//============================================================================== + +//______________________________________________________________________________ // // AliEveTrackFitter is an interface to TEvePointSet allowing AliRieman fit. -// It builds a list of points by listening to selection signal of any object of type -// TEvePointSet. After selection the list is feeded to AliRieman fitter, -// which returns helix parameters visualized with TEveTrack. +// It builds a list of points by listening to selection signal of any +// object of type TEvePointSet. After selection the list is feeded to +// AliRieman fitter, which returns helix parameters visualized with +// TEveTrack. // ClassImp(AliEveTrackFitter) -AliEveTrackFitter::AliEveTrackFitter(const Text_t* name, Int_t n_points) : - TEvePointSet (name, n_points), +AliEveTrackFitter::AliEveTrackFitter(const Text_t* name, Int_t nPoints) : + TEvePointSet (name, nPoints), fAlpha (0), fRieman (0), @@ -53,11 +58,11 @@ AliEveTrackFitter::AliEveTrackFitter(const Text_t* name, Int_t n_points) : SetOwnIds(kFALSE); fTrackList = new TEveTrackList("Tracks"); + fTrackList->IncDenyDestroy(); fTrackList->SetLineWidth(2); fTrackList->SetLineColor(8); - fTrackList->IncDenyDestroy(); fTrackList->GetPropagator()->SetEditPathMarks(kTRUE); - gEve->AddElement(fTrackList, this); + AddElement(fTrackList); UpdateItems(); fGraphPicked = new TGraph(); @@ -75,23 +80,39 @@ AliEveTrackFitter::~AliEveTrackFitter() { // Destructor. - if(fRieman) delete fRieman; + if (fRieman) delete fRieman; fTrackList->DecDenyDestroy(); - delete fTrackList; } /******************************************************************************/ + +void AliEveTrackFitter::DestroyElements() +{ + // Virtual method of base class TEveElement. + // Preserves TEveTrackList object for fitted helices. + + TEveElement::DestroyElements(); + + // fTrackList is destroyed because DenyDestroy is set. + gEve->AddElement(fTrackList, this); + fTrackList->DestroyElements(); + + UpdateItems(); +} + +/******************************************************************************/ + void AliEveTrackFitter::Start() { // Clear existing point selection and maintain connection to the // TEvePointSet signal. Reset(); - if(fConnected == kFALSE) + if (fConnected == kFALSE) { - TQObject::Connect("TEvePointSet", "PointCtrlClicked(TEvePointSet*,Int_t)", - "AliEveTrackFitter", this, "AddFitPoint(TEvePointSet*,Int_t)"); + TQObject::Connect("TEvePointSet", "PointSelected(Int_t)", + "AliEveTrackFitter", this, "AddFitPoint(Int_t)"); fConnected = kTRUE; } } @@ -100,48 +121,49 @@ void AliEveTrackFitter::Stop() { // Stop adding points for the fit. - if(fConnected) + if (fConnected) { - TQObject::Disconnect("TEvePointSet", "AddFitPoint(TEvePointSet*,Int_t)"); + TQObject::Disconnect("TEvePointSet", "AddFitPoint(Int_t)"); fConnected = kFALSE; } } -void AliEveTrackFitter::Reset(Int_t n, Int_t ids) +void AliEveTrackFitter::Reset(Int_t nPoints, Int_t nIntIds) { // Reset selection. - if(fRieman) fRieman->Reset(); - TEvePointSet::Reset(n, ids); + if (fRieman) fRieman->Reset(); + TEvePointSet::Reset(nPoints, nIntIds); fSPMap.clear(); } /******************************************************************************/ -void AliEveTrackFitter::AddFitPoint(TEvePointSet* ps, Int_t n) +void AliEveTrackFitter::AddFitPoint(Int_t pointId) { // Add or remove given point depending if exists in the map. Float_t x, y, z; - PointMap_t::iterator g = fSPMap.find(Point_t(ps, n)); - if(g != fSPMap.end()) + TEvePointSet* ps = dynamic_cast((TQObject*) gTQSender); + + PointMap_t::iterator g = fSPMap.find(Point_t(ps, pointId)); + if (g != fSPMap.end()) { Int_t idx = g->second; - if(idx != fLastPoint) + if (idx != fLastPoint) { GetPoint(fLastPoint, x, y, z); SetPoint(idx, x, y, z); } fSPMap.erase(g); - fLastPoint--; + --fLastPoint; } else { - fSPMap[Point_t(ps, n)] = Size(); - ps->GetPoint(n, x, y, z); + fSPMap[Point_t(ps, pointId)] = Size(); + ps->GetPoint(pointId, x, y, z); SetNextPoint(x, y, z); - SetPointId(ps->GetPointId(n)); } ResetBBox(); @@ -156,7 +178,7 @@ void AliEveTrackFitter::FitTrack() using namespace TMath; - if(fRieman) delete fRieman; + if (fRieman) delete fRieman; fRieman = new AliRieman(Size()); Float_t x, y, z; @@ -190,58 +212,46 @@ void AliEveTrackFitter::FitTrack() // curvature to pt param[4] /= TEveTrackPropagator::fgDefMagField*TEveTrackPropagator::fgkB2C; // sign in tang - if(param[4] < 0) param[3] *= -1; + if (param[4] < 0) param[3] *= -1; AliExternalTrackParam trackParam(r, fAlpha, param, cov); trackParam.Print(); // make track - Double_t AliEveV0[3]; - trackParam.GetXYZAt(r, TEveTrackPropagator::fgDefMagField, AliEveV0); - Double_t P0[3]; - trackParam.GetPxPyPzAt(r, TEveTrackPropagator::fgDefMagField, P0); + Double_t v0[3]; + trackParam.GetXYZAt(r, TEveTrackPropagator::fgDefMagField, v0); + Double_t p0[3]; + trackParam.GetPxPyPzAt(r, TEveTrackPropagator::fgDefMagField, p0); TEveRecTrack rc; - rc.fV.Set(AliEveV0); - rc.fP.Set(P0); + rc.fV.Set(v0); + rc.fP.Set(p0); rc.fSign = trackParam.Charge(); TEveTrack* track = new TEveTrack(&rc, fTrackList->GetPropagator()); track->SetName(Form("track %f", fAlpha)); - TEvePathMark* pm = new TEvePathMark(TEvePathMark::kDaughter); - for(Int_t i=0; i==fLastPoint; i++) + for(Int_t i=0; i<=fLastPoint; ++i) { + TEvePathMark pm(TEvePathMark::kDaughter); GetPoint(i, x, y, z); - pm->fV.Set(x, y, z); - pm->fP.Set(P0); + pm.fV.Set(x, y, z); + pm.fP.Set(p0); track->AddPathMark(pm); } track->MakeTrack(); track->SetAttLineAttMarker(fTrackList); - gEve->AddElement(track, fTrackList); + fTrackList->AddElement(track); } /******************************************************************************/ -void AliEveTrackFitter::DestroyElements() -{ - // Virtual method of base class TEveElement. - // Preserves TEveTrackPropagator object for fitted helices. - TEveElement::DestroyElements(); - - gEve->AddElement(fTrackList, this); - fTrackList->DestroyElements(); - UpdateItems(); -} - -/******************************************************************************/ void AliEveTrackFitter::DrawDebugGraph() { // Draw graph of picked points and helix points. - static const TEveException eH("AliEveTrackFitter::DrawRiemanGraph "); + static const TEveException kEH("AliEveTrackFitter::DrawRiemanGraph "); - if(fRieman == 0) - throw(eH + "fitter not set."); + if (fRieman == 0) + throw(kEH + "fitter not set."); Int_t nR = fRieman->GetN(); fGraphPicked->Set(nR); diff --git a/EVE/EveBase/AliEveTrackFitter.h b/EVE/EveBase/AliEveTrackFitter.h index 1a52b927c7c..c9731b5dabe 100644 --- a/EVE/EveBase/AliEveTrackFitter.h +++ b/EVE/EveBase/AliEveTrackFitter.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TrackFitter_H -#define ALIEVE_TrackFitter_H +#ifndef AliEveTrackFitter_H +#define AliEveTrackFitter_H #include #include @@ -35,49 +35,51 @@ protected: Point_t(TEvePointSet* ps=0, Int_t i=0) : fPS(ps), fIdx(i) {} Point_t(const Point_t& p) : fPS(p.fPS), fIdx(p.fIdx) {} - Point_t& operator=(const Point_t& p) { + Point_t& operator=(const Point_t& p) + { fPS = p.fPS; fIdx = p.fIdx; return *this; } - bool operator<(const Point_t& o) const { + bool operator<(const Point_t& o) const + { if (fPS != o.fPS) return fPS < o.fPS; return fIdx < o.fIdx; } }; - typedef std::map PointMap_t; + typedef std::map PointMap_t; - Float_t fAlpha; // transformation angle to AliRieman local system (where x>>y) - AliRieman* fRieman; // rieman fitter + Float_t fAlpha; // transformation angle to AliRieman local system (where x>>y) + AliRieman* fRieman; // rieman fitter - Bool_t fConnected; // connection to the TEvePointSet signal + Bool_t fConnected; // connection to the TEvePointSet signal - PointMap_t fSPMap; // map of selected points - TEveTrackList* fTrackList; // list of tracks removed in the destructor + PointMap_t fSPMap; // map of selected points + TEveTrackList* fTrackList; // list of tracks removed in the destructor - TGraph *fGraphPicked; // graph of selected points debug info - TGraphErrors *fGraphHelix; // graph of fitted points for debug info + TGraph *fGraphPicked; // graph of selected points debug info + TGraphErrors *fGraphHelix; // graph of fitted points for debug info public: - AliEveTrackFitter(const Text_t* name = "TrackFitter", Int_t n_points=0); + AliEveTrackFitter(const Text_t* name = "TrackFitter", Int_t nPoints=0); virtual ~AliEveTrackFitter(); - virtual void AddFitPoint(TEvePointSet*,Int_t); // slot for PointCtrlClicked() signal + virtual void DestroyElements(); + + virtual void AddFitPoint(Int_t pointId); // slot for TEvePointSet::PointSelected() signal virtual void Start(); virtual void Stop(); virtual void FitTrack(); - virtual void Reset(Int_t n_points=0, Int_t n_int_ids=0); + virtual void Reset(Int_t nPoints=0, Int_t nIntIds=0); - Bool_t GetConnected(){ return fConnected; } - AliRieman* GetRieman(){ return fRieman; } + Bool_t GetConnected() const { return fConnected; } + AliRieman* GetRieman() const { return fRieman; } - TGraph* GetGraphPicked() { return fGraphPicked; } - TGraphErrors* GetGraphHelix() { return fGraphHelix; } + TGraph* GetGraphPicked() const { return fGraphPicked; } + TGraphErrors* GetGraphHelix() const { return fGraphHelix; } void DrawDebugGraph(); - virtual void DestroyElements(); // *MENU* - ClassDef(AliEveTrackFitter, 0); // Interface of TEvePointSet allowing helix fit. }; diff --git a/EVE/EveBase/AliEveTrackFitterEditor.cxx b/EVE/EveBase/AliEveTrackFitterEditor.cxx index 10dba9526a4..b9b090bdb1b 100644 --- a/EVE/EveBase/AliEveTrackFitterEditor.cxx +++ b/EVE/EveBase/AliEveTrackFitterEditor.cxx @@ -12,10 +12,14 @@ #include +//============================================================================== +//============================================================================== +// AliEveTrackFitterEditor +//============================================================================== //______________________________________________________________________________ -// AliEveTrackFitterEditor // +// GUI editor for class AliEveTrackFitter ClassImp(AliEveTrackFitterEditor) diff --git a/EVE/EveBase/AliEveTrackFitterEditor.h b/EVE/EveBase/AliEveTrackFitterEditor.h index 3de6027bd6e..8af82ecf907 100644 --- a/EVE/EveBase/AliEveTrackFitterEditor.h +++ b/EVE/EveBase/AliEveTrackFitterEditor.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TrackFitterEditor_H -#define ALIEVE_TrackFitterEditor_H +#ifndef AliEveTrackFitterEditor_H +#define AliEveTrackFitterEditor_H #include @@ -16,7 +16,6 @@ class TGCheckButton; class TGNumberEntry; class TGColorSelect; - class AliEveTrackFitter; class AliEveTrackFitterEditor : public TGedFrame diff --git a/EVE/EveBase/AliEveVSDCreator.cxx b/EVE/EveBase/AliEveVSDCreator.cxx index a8f4488f46f..4f05b67f0a2 100644 --- a/EVE/EveBase/AliEveVSDCreator.cxx +++ b/EVE/EveBase/AliEveVSDCreator.cxx @@ -9,31 +9,25 @@ #include "AliEveVSDCreator.h" -#include - #include #include #include #include #include -#include -#include #include #include #include #include -#include #include -#include #include #include #include +#include #include #include #include -#include //______________________________________________________________________________ // @@ -92,7 +86,7 @@ void AliEveVSDCreator::CreateVSD(const Text_t* dataDir, Int_t event, // // Needs to be extended to support conversion of multiple events. - static const TEveException eH("AliEveVSDCreator::CreateVSD "); + static const TEveException kEH("AliEveVSDCreator::CreateVSD "); fDataDir = dataDir; fEvent = event; @@ -100,22 +94,22 @@ void AliEveVSDCreator::CreateVSD(const Text_t* dataDir, Int_t event, string galiceFile (Form("%s/galice.root", fDataDir.Data())); if(fDebugLevel > 0) - printf("%s opening %s \n", eH.Data(), galiceFile.c_str()); + printf("%s opening %s \n", kEH.Data(), galiceFile.c_str()); if(gSystem->AccessPathName(galiceFile.c_str(), kReadPermission)) { - throw(eH + "Can not read file '" + galiceFile + "'."); + throw(kEH + "Can not read file '" + galiceFile + "'."); } fRunLoader = AliRunLoader::Open(galiceFile.c_str()); if(fRunLoader == 0) - throw(eH + "AliRunLoader::Open failed."); + throw(kEH + "AliRunLoader::Open failed."); fRunLoader->LoadgAlice(); Int_t status = fRunLoader->GetEvent(fEvent); if(status) - throw(eH + Form("GetEvent(%d) failed, exit code %s.", fEvent, status)); + throw(kEH + Form("GetEvent(%d) failed, exit code %s.", fEvent, status)); if(fDebugLevel > 0) - printf("%s open seems ok. Now loading sim data.\n", eH.Data()); + printf("%s open seems ok. Now loading sim data.\n", kEH.Data()); fRunLoader->LoadHeader(); fRunLoader->LoadKinematics(); @@ -125,18 +119,18 @@ void AliEveVSDCreator::CreateVSD(const Text_t* dataDir, Int_t event, // GledNS::PushFD(); if(fDebugLevel > 0) - printf("%s opening output TEveVSD.\n", eH.Data()); + printf("%s opening output TEveVSD.\n", kEH.Data()); TFile* file = TFile::Open(vsdFile, "RECREATE", "ALICE VisualizationDataSummary"); fDirectory = new TDirectoryFile("Event0", ""); if(fDebugLevel > 0) - printf("%s creating trees now ...\n", eH.Data()); + printf("%s creating trees now ...\n", kEH.Data()); CreateTrees(); if(fDebugLevel > 0) - printf("%s trees created, closing files.\n", eH.Data()); + printf("%s trees created, closing files.\n", kEH.Data()); file->Write(); file->Close(); @@ -163,7 +157,7 @@ void AliEveVSDCreator::CreateVSD(const Text_t* dataDir, Int_t event, fRunLoader = 0; if(fDebugLevel > 0) - printf("%s all done.\n", eH.Data()); + printf("%s all done.\n", kEH.Data()); } void AliEveVSDCreator::CreateTrees() @@ -172,32 +166,32 @@ void AliEveVSDCreator::CreateTrees() // ConvertXyzz() functions. // Exceptions from individual functions are displayed as warnings. - static const TEveException eH("AliEveVSDCreator::CreateTrees "); + static const TEveException kEH("AliEveVSDCreator::CreateTrees "); if (fDirectory == 0) - throw(eH + "output directory not set."); + throw(kEH + "output directory not set."); try { if (fDebugLevel > 1) - printf("%sConvertKinematics.\n", eH.Data()); + printf("%sConvertKinematics.\n", kEH.Data()); ConvertKinematics(); - } catch(TEveException& exc) { Warning(eH, exc); } + } catch(TEveException& exc) { Warning(kEH, exc); } try { if (fDebugLevel > 1) - printf("%sConvertHits.\n", eH.Data()); + printf("%sConvertHits.\n", kEH.Data()); ConvertHits(); - } catch(TEveException& exc) { Warning(eH, exc); } + } catch(TEveException& exc) { Warning(kEH, exc); } try { if (fDebugLevel > 1) - printf("%sConvertClusters.\n", eH.Data()); + printf("%sConvertClusters.\n", kEH.Data()); ConvertClusters(); - } catch(TEveException& exc) { Warning(eH, exc); } + } catch(TEveException& exc) { Warning(kEH, exc); } try { if (fDebugLevel > 1) - printf("%sConvertRecTracks.\n", eH.Data()); + printf("%sConvertRecTracks.\n", kEH.Data()); ConvertRecTracks(); } catch(TEveException& exc) { Warning(exc, "skipping AliEveV0 extraction."); @@ -206,23 +200,23 @@ void AliEveVSDCreator::CreateTrees() try { if (fDebugLevel > 1) - printf("%sConvertV0.\n", eH.Data()); + printf("%sConvertV0.\n", kEH.Data()); ConvertV0(); - } catch(TEveException& exc) { Warning(eH, exc); } + } catch(TEveException& exc) { Warning(kEH, exc); } try { if (fDebugLevel > 1) - printf("%sConvertKinks.\n", eH.Data()); + printf("%sConvertKinks.\n", kEH.Data()); ConvertKinks(); - } catch(TEveException& exc) { Warning(eH, exc); } + } catch(TEveException& exc) { Warning(kEH, exc); } end_esd_processing: try { if (fDebugLevel > 1) - printf("%sConvertGenInfo.\n", eH.Data()); + printf("%sConvertGenInfo.\n", kEH.Data()); ConvertGenInfo(); - } catch(TEveException& exc) { Warning(eH, exc); } + } catch(TEveException& exc) { Warning(kEH, exc); } return; } @@ -236,14 +230,14 @@ void AliEveVSDCreator::ConvertKinematics() // Convert kinematics. // Track references are not stored, they should be. - static const TEveException eH("AliEveVSDCreator::ConvertKinematics "); + static const TEveException kEH("AliEveVSDCreator::ConvertKinematics "); if(fTreeK != 0) - throw (eH + "kinematics already converted"); + throw (kEH + "kinematics already converted"); AliStack* stack = fRunLoader->Stack(); if(stack == 0) - throw(eH + "stack is null."); + throw(kEH + "stack is null."); fDirectory->cd(); fTreeK = new TTree("Kinematics", "TParticles sorted by Label"); @@ -262,7 +256,7 @@ void AliEveVSDCreator::ConvertKinematics() TTree* fTreeTR = fRunLoader->TreeTR(); if(fTreeTR == 0) { - Warning(eH, "no TrackRefs; some data will not be available."); + Warning(kEH, "no TrackRefs; some data will not be available."); } else { TClonesArray* RunArrayTR = 0; fTreeTR->SetBranchAddress("AliRun", &RunArrayTR); @@ -328,14 +322,14 @@ void AliEveVSDCreator::ConvertKinematics() namespace { - struct Detector + struct Detector_t { - const char* name; - const char* hitbranch; - unsigned char detidx; + const char* fName; // Detector name. + const char* fHitbranch; // Name of branch containing hits. + unsigned char fDetidx; // Index identifying the detector internally. }; - Detector detects[] = { + Detector_t fgDetectors[] = { { "ITS", "AliITShit", 0 }, { "TPC", "AliTPCTrackHitsV2", 1 }, { "TRD", "AliTRDhit", 2 }, @@ -353,10 +347,10 @@ void AliEveVSDCreator::ConvertHits() // TPC hits are handled specially as they are compressed - only mayor // hits are stored - static const TEveException eH("AliEveVSDCreator::ConvertHits "); + static const TEveException kEH("AliEveVSDCreator::ConvertHits "); if (fTreeH != 0) - throw(eH + "hits already converted."); + throw(kEH + "hits already converted."); fDirectory->cd(); fTreeH = new TTree("Hits", "Combined detector hits."); @@ -370,18 +364,18 @@ void AliEveVSDCreator::ConvertHits() int l=0; // load hits from the rest of detectors - while (detects[l].name != 0) + while (fgDetectors[l].fName != 0) { - Detector& det = detects[l++]; + Detector_t& det = fgDetectors[l++]; - switch(det.detidx) + switch(det.fDetidx) { case 1: { Int_t count = 0; - TTree* treeh = fRunLoader->GetTreeH(det.name, false); + TTree* treeh = fRunLoader->GetTreeH(det.fName, false); if(treeh == 0) { - Warning(eH, Form("no hits for %s.", det.name)); + Warning(kEH, Form("no hits for %s.", det.fName)); continue; } AliTPCTrackHitsV2 hv2, *hv2p = &hv2; @@ -398,7 +392,7 @@ void AliEveVSDCreator::ConvertHits() x1 = ah->X(); y1 = ah->Y(); z1 = ah->Z(); if ((x-x1)*(x-x1) + (y-y1)*(y-y1) + (z-z1)*(z-z1) > tpcSqrRes) { - fH.fDetId = det.detidx; + fH.fDetId = det.fDetidx; fH.fSubdetId = 0; fH.fLabel = ah->Track(); fH.fEvaLabel = evaIdx; @@ -415,13 +409,13 @@ void AliEveVSDCreator::ConvertHits() } default: { - TTree* treeh = fRunLoader->GetTreeH(det.name, false); + TTree* treeh = fRunLoader->GetTreeH(det.fName, false); if (treeh == 0) { - Warning(eH, Form("no hits for %s.", det.name)); + Warning(kEH, Form("no hits for %s.", det.fName)); continue; } - TClonesArray *arr = new TClonesArray(det.hitbranch); - treeh->SetBranchAddress(det.name, &arr); + TClonesArray *arr = new TClonesArray(det.fHitbranch); + treeh->SetBranchAddress(det.fName, &arr); Int_t np = treeh->GetEntries(); // in TreeH files hits are grouped in clones arrays // each eva particle has its own clone array @@ -435,12 +429,12 @@ void AliEveVSDCreator::ConvertHits() for (Int_t j = 0; j < nh; ++j) { AliHit* aliHit = (AliHit*)arr->UncheckedAt(j); - fH.fDetId = det.detidx; + fH.fDetId = det.fDetidx; fH.fSubdetId = 0; fH.fLabel = aliHit->GetTrack(); fH.fEvaLabel = evaIdx; fH.fV.Set(aliHit->X(), aliHit->Y(), aliHit->Z()); - if (det.detidx == 2) + if (det.fDetidx == 2) { x1=aliHit->X();y1=aliHit->Y();z1=aliHit->Z(); if ((x-x1)*(x-x1)+(y-y1)*(y-y1)+(z-z1)*(z-z1) < trdSqrRes) continue; @@ -478,10 +472,10 @@ void AliEveVSDCreator::ConvertClusters() // It should be possible now to do this in a general manner (with // the alignment framework). - static const TEveException eH("AliEveVSDCreator::ConvertClusters "); + static const TEveException kEH("AliEveVSDCreator::ConvertClusters "); if(fTreeC != 0) - throw(eH + "clusters already converted."); + throw(kEH + "clusters already converted."); fDirectory->cd(); fTreeC = new TTree("Clusters", "rec clusters"); @@ -489,11 +483,11 @@ void AliEveVSDCreator::ConvertClusters() try { ConvertITSClusters(); - } catch(TEveException& exc) { Warning(eH, exc); } + } catch(TEveException& exc) { Warning(kEH, exc); } try { ConvertTPCClusters(); - } catch(TEveException& exc) { Warning(eH, exc); } + } catch(TEveException& exc) { Warning(kEH, exc); } } /******************************************************************************/ @@ -502,23 +496,23 @@ void AliEveVSDCreator::ConvertTPCClusters() { // Convert TPC clusters and transform them to global coordinates. - static const TEveException eH("AliEveVSDCreator::ConvertTPCClusters "); + static const TEveException kEH("AliEveVSDCreator::ConvertTPCClusters "); auto_ptr f ( TFile::Open(Form("%s/TPC.RecPoints.root", fDataDir.Data())) ); if (!f.get()) - throw(eH + "can not open 'TPC.RecPoints.root' file."); + throw(kEH + "can not open 'TPC.RecPoints.root' file."); auto_ptr d ( (TDirectory*) f->Get(Form("Event%d", fEvent)) ); if (!d.get()) - throw(eH + Form("event directory '%d' not found.", 0)); + throw(kEH + Form("event directory '%d' not found.", 0)); auto_ptr tree( (TTree*) d->Get("TreeR") ); if (!tree.get()) - throw(eH + "'TreeR' not found."); + throw(kEH + "'TreeR' not found."); - auto_ptr par( GetTpcParam(eH) ); + auto_ptr par( GetTpcParam(kEH) ); AliTPCClustersRow clrow, *clrowp = &clrow; AliTPCclusterMI *cl; @@ -590,30 +584,30 @@ void AliEveVSDCreator::ConvertITSClusters() { // Convert ITS clusters and transform them to global coordinates. - static const TEveException eH("AliEveVSDCreator::ConvertITSClusters "); + static const TEveException kEH("AliEveVSDCreator::ConvertITSClusters "); auto_ptr f ( TFile::Open(Form("%s/ITS.RecPoints.root", fDataDir.Data())) ); if (!f.get()) - throw(eH + "can not open 'ITS.RecPoints.root' file."); + throw(kEH + "can not open 'ITS.RecPoints.root' file."); auto_ptr d ( (TDirectory*) f->Get(Form("Event%d", fEvent)) ); if (!d.get()) - throw(eH + Form("event directory '%d' not found.", 0)); + throw(kEH + Form("event directory '%d' not found.", 0)); auto_ptr tree( (TTree*) d->Get("TreeR") ); if (!tree.get()) - throw(eH + "'TreeR' not found."); + throw(kEH + "'TreeR' not found."); // - AliITSLoader* ITSld = (AliITSLoader*) fRunLoader->GetLoader("ITSLoader"); - AliITSgeom* geom = ITSld->GetITSgeom(); + AliITSLoader *itsLd = (AliITSLoader*) fRunLoader->GetLoader("ITSLoader"); + AliITSgeom *geom = itsLd->GetITSgeom(); //printf("alice ITS geom %p \n",geom ); if (!geom) - throw(eH + "can not find ITS geometry"); + throw(kEH + "can not find ITS geometry"); TClonesArray *arr = new TClonesArray("AliITSclusterV2"); tree->SetBranchAddress("Clusters", &arr); @@ -677,10 +671,10 @@ void AliEveVSDCreator::ConvertRecTracks() { // Convert reconstructed tracks. - static const TEveException eH("AliEveVSDCreator::ConvertRecTracks "); + static const TEveException kEH("AliEveVSDCreator::ConvertRecTracks "); if (fTreeR != 0) - throw(eH + "tracks already converted."); + throw(kEH + "tracks already converted."); fDirectory->cd(); fTreeR = new TTree("RecTracks", "rec tracks"); @@ -689,11 +683,11 @@ void AliEveVSDCreator::ConvertRecTracks() TFile f(Form("%s/AliESDs.root", fDataDir.Data())); if (!f.IsOpen()) - throw(eH + "no AliESDs.root file."); + throw(kEH + "no AliESDs.root file."); TTree* tree = (TTree*) f.Get("esdTree"); if (tree == 0) - throw(eH + "no esdTree."); + throw(kEH + "no esdTree."); AliESDEvent *esdEvent = new AliESDEvent(); @@ -703,19 +697,19 @@ void AliEveVSDCreator::ConvertRecTracks() // reconstructed tracks - AliESDtrack* esd_t; + AliESDtrack* esdTrack; Double_t dbuf[3]; for (Int_t n = 0; n < esdEvent->GetNumberOfTracks(); ++n) { - esd_t = esdEvent->GetTrack(n); - - fR.fLabel = esd_t->GetLabel(); - fR.fStatus = (Int_t) esd_t->GetStatus(); - fR.fSign = (Int_t) esd_t->GetSign(); - esd_t->GetXYZ(dbuf); fR.fV.Set(dbuf); - esd_t->GetPxPyPz(dbuf); fR.fP.Set(dbuf); - Double_t ep = esd_t->GetP(); - fR.fBeta = ep/TMath::Sqrt(ep*ep + TMath::C()*TMath::C()*esd_t->GetMass()*esd_t->GetMass()); + esdTrack = esdEvent->GetTrack(n); + + fR.fLabel = esdTrack->GetLabel(); + fR.fStatus = (Int_t) esdTrack->GetStatus(); + fR.fSign = (Int_t) esdTrack->GetSign(); + esdTrack->GetXYZ(dbuf); fR.fV.Set(dbuf); + esdTrack->GetPxPyPz(dbuf); fR.fP.Set(dbuf); + Double_t ep = esdTrack->GetP(); + fR.fBeta = ep/TMath::Sqrt(ep*ep + TMath::C()*TMath::C()*esdTrack->GetMass()*esdTrack->GetMass()); fTreeR->Fill(); } fTreeR->BuildIndex("label"); @@ -728,10 +722,10 @@ void AliEveVSDCreator::ConvertV0() { // Convert reconstructed V0s. - static const TEveException eH("AliEveVSDCreator::ConvertV0 "); + static const TEveException kEH("AliEveVSDCreator::ConvertV0 "); if(fTreeV0 != 0) - throw(eH + "AliEveV0 already converted."); + throw(kEH + "AliEveV0 already converted."); fDirectory->cd(); fTreeV0 = new TTree("AliEveV0", "AliEveV0 points"); @@ -740,12 +734,12 @@ void AliEveVSDCreator::ConvertV0() TFile f(Form("%s/AliESDs.root", fDataDir.Data())); if (!f.IsOpen()){ - throw(eH + "no AliESDs.root file."); + throw(kEH + "no AliESDs.root file."); } TTree* tree = (TTree*) f.Get("esdTree"); if (tree == 0) - throw(eH + "no esdTree."); + throw(kEH + "no esdTree."); AliESDEvent *esdEvent= new AliESDEvent(); esdEvent->ReadFromTree(tree); @@ -805,10 +799,10 @@ void AliEveVSDCreator::ConvertKinks() { // Convert reconstructed kinks. - static const TEveException eH("AliEveVSDCreator::ConvertKinks "); + static const TEveException kEH("AliEveVSDCreator::ConvertKinks "); if (fTreeKK != 0) - throw(eH + "Kinks already converted."); + throw(kEH + "Kinks already converted."); fDirectory->cd(); fTreeKK = new TTree("Kinks", "ESD Kinks"); @@ -817,12 +811,12 @@ void AliEveVSDCreator::ConvertKinks() TFile f(Form("%s/AliESDs.root", fDataDir.Data())); if (!f.IsOpen()){ - throw(eH + "no AliESDs.root file."); + throw(kEH + "no AliESDs.root file."); } TTree* tree = (TTree*) f.Get("esdTree"); if (tree == 0) - throw(eH + "no esdTree."); + throw(kEH + "no esdTree."); AliESDEvent *esdEvent= new AliESDEvent(); @@ -875,10 +869,10 @@ void AliEveVSDCreator::ConvertGenInfo() // Build simulation-reconstruction cross-reference table. // In a rather poor state at the moment. - static const TEveException eH("AliEveVSDCreator::ConvertGenInfo "); + static const TEveException kEH("AliEveVSDCreator::ConvertGenInfo "); if(fTreeGI != 0) - throw(eH + "GI already converted."); + throw(kEH + "GI already converted."); fDirectory->cd(); fTreeGI = new TTree("TEveMCRecCrossRef", "Objects prepared for cross querry"); diff --git a/EVE/EveBase/AliEveVSDCreator.h b/EVE/EveBase/AliEveVSDCreator.h index ca7484abc1e..163ffbba8c9 100644 --- a/EVE/EveBase/AliEveVSDCreator.h +++ b/EVE/EveBase/AliEveVSDCreator.h @@ -7,16 +7,15 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_VSDCreator_H -#define ALIEVE_VSDCreator_H +#ifndef AliEveVSDCreator_H +#define AliEveVSDCreator_H #include -class AliTPCParam; -class AliRunLoader; - #include +class AliTPCParam; +class AliRunLoader; class AliEveVSDCreator : public TEveVSD { diff --git a/EVE/EveBase/LinkDef.h b/EVE/EveBase/LinkDef.h index c57732a9a51..edf1b43a1fa 100644 --- a/EVE/EveBase/LinkDef.h +++ b/EVE/EveBase/LinkDef.h @@ -13,7 +13,7 @@ // AliEveEventManager #pragma link C++ class AliEveEventManager+; -#pragma link C++ global gEvent; +#pragma link C++ global gAliEveEvent; #pragma link C++ class AliEveKineTools+; diff --git a/EVE/EveBase/blacklisted-classes/AliEveCascade.h b/EVE/EveBase/blacklisted-classes/AliEveCascade.h index 5df1c2a9f15..79ef549348d 100644 --- a/EVE/EveBase/blacklisted-classes/AliEveCascade.h +++ b/EVE/EveBase/blacklisted-classes/AliEveCascade.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_Cascade_H -#define ALIEVE_Cascade_H +#ifndef AliEveCascade_H +#define AliEveCascade_H /*********************************************************************** * This code defines the reconstructed cascades visualized with EVE diff --git a/EVE/EveBase/blacklisted-classes/AliEveCascadeEditors.h b/EVE/EveBase/blacklisted-classes/AliEveCascadeEditors.h index 0514c4189f3..ed527220d0c 100644 --- a/EVE/EveBase/blacklisted-classes/AliEveCascadeEditors.h +++ b/EVE/EveBase/blacklisted-classes/AliEveCascadeEditors.h @@ -14,8 +14,8 @@ Ludovic Gaudichet (gaudichet@to.infn.it) ************************************************************************/ -#ifndef ALIEVE_CascadeEditors_H -#define ALIEVE_CascadeEditors_H +#ifndef AliEveCascadeEditors_H +#define AliEveCascadeEditors_H #include diff --git a/EVE/EveBase/blacklisted-classes/AliEveV0.h b/EVE/EveBase/blacklisted-classes/AliEveV0.h index 6a6243de07f..e1e57b63339 100644 --- a/EVE/EveBase/blacklisted-classes/AliEveV0.h +++ b/EVE/EveBase/blacklisted-classes/AliEveV0.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_V0_H -#define ALIEVE_V0_H +#ifndef AliEveV0_H +#define AliEveV0_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ diff --git a/EVE/EveBase/blacklisted-classes/AliEveV0Editors.h b/EVE/EveBase/blacklisted-classes/AliEveV0Editors.h index 215b44e6d8c..deadbf06d4d 100644 --- a/EVE/EveBase/blacklisted-classes/AliEveV0Editors.h +++ b/EVE/EveBase/blacklisted-classes/AliEveV0Editors.h @@ -18,8 +18,8 @@ It allows to select the v0 as a function of some useful parameters. Ludovic Gaudichet (gaudichet@to.infn.it) ************************************************************************/ -#ifndef ALIEVE_V0Editors_H -#define ALIEVE_V0Editors_H +#ifndef AliEveV0Editors_H +#define AliEveV0Editors_H #include diff --git a/EVE/EveDet/.SKEL-ged.h b/EVE/EveDet/.SKEL-ged.h index b0d930be0cd..ad2432aea07 100644 --- a/EVE/EveDet/.SKEL-ged.h +++ b/EVE/EveDet/.SKEL-ged.h @@ -1,7 +1,7 @@ // $Header$ -#ifndef ALIEVE_CLASS_H -#define ALIEVE_CLASS_H +#ifndef AliEveCLASS_H +#define AliEveCLASS_H #include diff --git a/EVE/EveDet/.SKEL-gedsubed.h b/EVE/EveDet/.SKEL-gedsubed.h index 34e6f947d24..81a322abce4 100644 --- a/EVE/EveDet/.SKEL-gedsubed.h +++ b/EVE/EveDet/.SKEL-gedsubed.h @@ -1,7 +1,7 @@ // $Header$ -#ifndef REVE_CLASS_H -#define REVE_CLASS_H +#ifndef AliEveCLASS_H +#define AliEveCLASS_H #include diff --git a/EVE/EveDet/.SKEL-gl.h b/EVE/EveDet/.SKEL-gl.h index 09d63105736..b60ed085af9 100644 --- a/EVE/EveDet/.SKEL-gl.h +++ b/EVE/EveDet/.SKEL-gl.h @@ -1,7 +1,7 @@ // $Header$ -#ifndef ALIEVE_CLASS_H -#define ALIEVE_CLASS_H +#ifndef AliEveCLASS_H +#define AliEveCLASS_H #include diff --git a/EVE/EveDet/.SKEL.h b/EVE/EveDet/.SKEL.h index 63e8a7f1b72..69a7e50d9d2 100644 --- a/EVE/EveDet/.SKEL.h +++ b/EVE/EveDet/.SKEL.h @@ -1,7 +1,7 @@ // $Header$ -#ifndef ALIEVE_CLASS_H -#define ALIEVE_CLASS_H +#ifndef AliEveCLASS_H +#define AliEveCLASS_H #include diff --git a/EVE/EveDet/AliEveITSDigitsInfo.cxx b/EVE/EveDet/AliEveITSDigitsInfo.cxx index ab238f5f8d1..2a49d26cbed 100644 --- a/EVE/EveDet/AliEveITSDigitsInfo.cxx +++ b/EVE/EveDet/AliEveITSDigitsInfo.cxx @@ -10,9 +10,6 @@ #include "AliEveITSDigitsInfo.h" #include -#include -#include - #include #include #include @@ -34,9 +31,17 @@ #include #include +#include +//#include + #include #include +//============================================================================== +//============================================================================== +// AliEveITSModuleSelection +//============================================================================== + //______________________________________________________________________________ // // Helper for selecting a range of ITS modules by type, layer, phi and @@ -56,6 +61,11 @@ AliEveITSModuleSelection::AliEveITSModuleSelection(): } +//============================================================================== +//============================================================================== +// AliEveITSDigitsInfo +//============================================================================== + //______________________________________________________________________________ // // Stores ITS geometry information and event-data in format suitable @@ -87,7 +97,7 @@ void AliEveITSDigitsInfo::InitInternals() // module-id to transformation-matrix mapping and segmentation // classes and data-structures. - static const TEveException eH("AliEveITSDigitsInfo::InitInternals "); + static const TEveException kEH("AliEveITSDigitsInfo::InitInternals "); AliEveEventManager::AssertGeometry(); diff --git a/EVE/EveDet/AliEveITSDigitsInfo.h b/EVE/EveDet/AliEveITSDigitsInfo.h index 5b4dc9123d8..e68a8fbb7a1 100644 --- a/EVE/EveDet/AliEveITSDigitsInfo.h +++ b/EVE/EveDet/AliEveITSDigitsInfo.h @@ -7,17 +7,17 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_ITSDigitsInfo_H -#define ALIEVE_ITSDigitsInfo_H +#ifndef AliEveITSDigitsInfo_H +#define AliEveITSDigitsInfo_H #include +#include #include #include -#include -#include -#include +class TClonesArray; +class TTree; //class AliITSgeom; class AliITSsegmentationSPD; @@ -69,10 +69,10 @@ public: class AliEveITSDigitsInfo : public TObject, public TEveRefCnt { +private: AliEveITSDigitsInfo(const AliEveITSDigitsInfo&); // Not implemented AliEveITSDigitsInfo& operator=(const AliEveITSDigitsInfo&); // Not implemented -private: Float_t fSPDZCoord[192]; // Precalculated z-coordinates for positions of digits. void InitInternals(); @@ -117,7 +117,7 @@ public: TClonesArray* GetDigits(Int_t moduleID, Int_t detector); - void GetSPDLocalZ(Int_t j, Float_t& z); + void GetSPDLocalZ(Int_t j, Float_t& z) const; void GetModuleIDs(AliEveITSModuleSelection* sel, std::vector& ids); @@ -127,7 +127,7 @@ public: }; // endclass AliEveITSDigitsInfo -inline void AliEveITSDigitsInfo::GetSPDLocalZ(Int_t j, Float_t& z) +inline void AliEveITSDigitsInfo::GetSPDLocalZ(Int_t j, Float_t& z) const { z = fSPDZCoord[j]; } diff --git a/EVE/EveDet/AliEveITSModule.cxx b/EVE/EveDet/AliEveITSModule.cxx index 5fa4e8c3e29..9e717d88515 100644 --- a/EVE/EveDet/AliEveITSModule.cxx +++ b/EVE/EveDet/AliEveITSModule.cxx @@ -18,6 +18,8 @@ #include #include +#include +#include #include @@ -142,16 +144,16 @@ void AliEveITSModule::SetID(Int_t gid, Bool_t trans) { // Set detector id. - static const TEveException eH("AliEveITSModule::SetID "); + static const TEveException kEH("AliEveITSModule::SetID "); if (fInfo == 0) - throw(eH + "AliEveITSDigitsInfo not set."); + throw(kEH + "AliEveITSDigitsInfo not set."); Int_t firstSPD = AliITSgeomTGeo::GetModuleIndex(1,1,1); Int_t lastSSD = AliITSgeomTGeo::GetNModules() - 1; if (gid < firstSPD || gid > lastSSD) { - throw(eH + Form("%d is not valid. ID range from %d to %d", gid, + throw(kEH + Form("%d is not valid. ID range from %d to %d", gid, firstSPD, lastSSD )); } @@ -267,6 +269,7 @@ void AliEveITSModule::SetID(Int_t gid, Bool_t trans) LoadQuads(); ComputeBBox(); + InitMainTrans(); if (trans) SetTrans(); } @@ -375,7 +378,7 @@ void AliEveITSModule::SetTrans() // Set transformation matrix based on module id (use geometry to // retrieve this information). - fHMTrans.SetFrom(*AliITSgeomTGeo::GetMatrix(fID)); + fMainTrans->SetFrom(*AliITSgeomTGeo::GetMatrix(fID)); } /******************************************************************************/ diff --git a/EVE/EveDet/AliEveITSModule.h b/EVE/EveDet/AliEveITSModule.h index 97e806bb6b1..86e4ca188a7 100644 --- a/EVE/EveDet/AliEveITSModule.h +++ b/EVE/EveDet/AliEveITSModule.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_ITSModule_H -#define ALIEVE_ITSModule_H +#ifndef AliEveITSModule_H +#define AliEveITSModule_H #include diff --git a/EVE/EveDet/AliEveITSModuleStepper.cxx b/EVE/EveDet/AliEveITSModuleStepper.cxx index 0fdab8133da..b176f282e87 100644 --- a/EVE/EveDet/AliEveITSModuleStepper.cxx +++ b/EVE/EveDet/AliEveITSModuleStepper.cxx @@ -14,24 +14,25 @@ #include #include #include -#include #include -#include #include #include -#include #include -#include #include #include #include -// #include +#include +#include #include #include +//============================================================================== +//============================================================================== +// AliEveITSModuleStepper +//============================================================================== //______________________________________________________________________________ // @@ -124,11 +125,11 @@ void AliEveITSModuleStepper::Capacity() // to store as many modules as required by the grid-stepper // configuration. - Int_t N = fStepper->GetNx()*fStepper->GetNy(); - if (N != GetNChildren()) + Int_t n = fStepper->GetNx()*fStepper->GetNy(); + if (n != GetNChildren()) { DestroyElements(); - for (Int_t m=0; m(*childit); mod->SetID(fIDs[idx], kFALSE); - TEveTrans& tr = mod->RefHMTrans(); + TEveTrans& tr = mod->RefMainTrans(); tr.UnitTrans(); tr.RotateLF(3,2,TMath::PiOver2()); tr.RotateLF(1,3,TMath::PiOver2()); @@ -413,12 +414,11 @@ void AliEveITSModuleStepper::RenderFrame(Float_t dx, Float_t dy, Int_t id) glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - UChar_t color[4]; + if (fWActive == id) - TEveUtil::TEveUtil::ColorFromIdx(fWActiveCol, color); + TGLUtil::Color(fWActiveCol); else - TEveUtil:: TEveUtil::ColorFromIdx(fWCol, color); - glColor4ubv(color); + TGLUtil::Color(fWCol); glBegin(GL_QUADS); glVertex2f(0, 0); glVertex2f(dx, 0); @@ -435,12 +435,10 @@ void AliEveITSModuleStepper::RenderSymbol(Float_t dx, Float_t dy, Int_t id) glLoadName(id); - UChar_t color[4]; if (fWActive == id) - TEveUtil::TEveUtil::ColorFromIdx(fWActiveCol, color); + TGLUtil::Color(fWActiveCol); else - TEveUtil::TEveUtil::ColorFromIdx(fWCol, color); - glColor4ubv(color); + TGLUtil::Color(fWCol); Float_t xs = dx/4, ys = dy/4; if(id == 0) { @@ -512,7 +510,7 @@ void AliEveITSModuleStepper::RenderPalette(Float_t dx, Float_t x, Float_t y) AliEveITSModule* qs = dynamic_cast(*BeginChildren()); TEveRGBAPalette* p = qs->GetPalette(); glBegin(GL_QUAD_STRIP); - glColor4ubv(p->ColorFromValue(p->GetMinVal())); + TGLUtil::Color4ubv(p->ColorFromValue(p->GetMinVal())); glVertex2f(0, 0); glVertex2f(0, y); if (p->GetMaxVal() > p->GetMinVal() + 1) @@ -521,13 +519,13 @@ void AliEveITSModuleStepper::RenderPalette(Float_t dx, Float_t x, Float_t y) Float_t x0 = xs; for(Int_t i=p->GetMinVal() + 1; iGetMaxVal(); i++) { - glColor4ubv(p->ColorFromValue(i)); + TGLUtil::Color4ubv(p->ColorFromValue(i)); glVertex2f(x0, 0); glVertex2f(x0, y); x0+=xs; } } - glColor4ubv(p->ColorFromValue(p->GetMaxVal())); + TGLUtil::Color4ubv(p->ColorFromValue(p->GetMaxVal())); glVertex2f(dx, 0); glVertex2f(dx, y); glEnd(); @@ -553,17 +551,17 @@ void AliEveITSModuleStepper::RenderMenu() // transparent bar Float_t a=0.3; - glColor4f(a, a, a, a); - Float_t H = 1.9*wh*(1+ 2*fWOff); + TGLUtil::Color4f(a, a, a, a); + Float_t h = 1.9*wh*(1+ 2*fWOff); if(1) { glBegin(GL_QUADS); - glVertex3f(-1, -1, 0.1); glVertex3f(-1, -1+H, 0.1); - glVertex3f(1 , -1+H, 0.1); glVertex3f( 1, -1 , 0.1); + glVertex3f(-1, -1, 0.1); glVertex3f(-1, -1+h, 0.1); + glVertex3f(1 , -1+h, 0.1); glVertex3f( 1, -1 , 0.1); glEnd(); } - Float_t y_base = -1 + wh*0.35; - glTranslatef(-1, y_base, 0.); + Float_t yBase = -1 + wh*0.35; + glTranslatef(-1, yBase, 0.); glPushName(0); // pager glPushMatrix(); @@ -655,7 +653,7 @@ void AliEveITSModuleStepper::RenderCellIDs() if(idx < fIDs.size()) { AliEveITSScaledModule* mod = dynamic_cast(*childit); - TEveTrans& tr = mod->RefHMTrans(); + TEveTrans& tr = mod->RefMainTrans(); TString name = Form("%d",mod->GetID()); tr.GetPos(x,y,z); x += fStepper->GetDx()*0.5; diff --git a/EVE/EveDet/AliEveITSModuleStepper.h b/EVE/EveDet/AliEveITSModuleStepper.h index 6889199a376..75fd11541e4 100644 --- a/EVE/EveDet/AliEveITSModuleStepper.h +++ b/EVE/EveDet/AliEveITSModuleStepper.h @@ -7,15 +7,14 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_ITSModuleStepper_H -#define ALIEVE_ITSModuleStepper_H - -#include -#include +#ifndef AliEveITSModuleStepper_H +#define AliEveITSModuleStepper_H #include #include +#include + #include class TGLText; @@ -66,7 +65,7 @@ protected: Float_t fWHeight; // Float_t fWOff; // Offset relative to widget size. Color_t fWCol; // - Int_t fWActiveCol; // + Color_t fWActiveCol; // Color_t fFontCol; // // wrappers @@ -103,7 +102,7 @@ public: TEveGridStepper* GetStepper() { return fStepper; } void SetStepper(TEveGridStepper* s) { fStepper = s; Apply(); } - Int_t GetCurrentPage(); + Int_t GetCurrentPage() const; Int_t GetPages(); void Start(); void Next(); @@ -113,7 +112,7 @@ public: void Capacity(); // getters/setters - Color_t GetWColor() { return fWCol; } + Color_t GetWColor() const { return fWCol; } void SetWColor(Color_t c) { fWCol = c; } TGLText* GetFont() { return fText; } void SetGLText(TGLText* t) { fText = t; } diff --git a/EVE/EveDet/AliEveITSModuleStepperEditor.cxx b/EVE/EveDet/AliEveITSModuleStepperEditor.cxx index 84e59f3f30f..5abcf6d846d 100644 --- a/EVE/EveDet/AliEveITSModuleStepperEditor.cxx +++ b/EVE/EveDet/AliEveITSModuleStepperEditor.cxx @@ -13,14 +13,11 @@ #include #include -#include - -#include -#include -#include -#include -#include +//============================================================================== +//============================================================================== +// AliEveITSModuleStepperEditor +//============================================================================== //______________________________________________________________________________ // diff --git a/EVE/EveDet/AliEveITSModuleStepperEditor.h b/EVE/EveDet/AliEveITSModuleStepperEditor.h index dfda0f4a7a5..19c558f469a 100644 --- a/EVE/EveDet/AliEveITSModuleStepperEditor.h +++ b/EVE/EveDet/AliEveITSModuleStepperEditor.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_ITSModuleStepperEditor_H -#define ALIEVE_ITSModuleStepperEditor_H +#ifndef AliEveITSModuleStepperEditor_H +#define AliEveITSModuleStepperEditor_H #include diff --git a/EVE/EveDet/AliEveITSScaledModule.cxx b/EVE/EveDet/AliEveITSScaledModule.cxx index b3938041e5a..aaa9c596e1d 100644 --- a/EVE/EveDet/AliEveITSScaledModule.cxx +++ b/EVE/EveDet/AliEveITSScaledModule.cxx @@ -9,7 +9,6 @@ #include "AliEveITSScaledModule.h" -#include #include #include #include @@ -19,16 +18,22 @@ #include #include +#include -//______________________________________________________________________________ +//============================================================================== +//============================================================================== // AliEveDigitScaleInfo +//============================================================================== + +//______________________________________________________________________________ // +// Encapsulates current state of scaling and agglomeration. ClassImp(AliEveDigitScaleInfo) AliEveDigitScaleInfo::AliEveDigitScaleInfo(): fScale(1), - fStatType (kST_Average), + fStatType (kSTAverage), fSyncPalette(kFALSE) { } @@ -57,40 +62,41 @@ void AliEveDigitScaleInfo::StatTypeChanged(Int_t t) while (i != fBackRefs.end()) { sm = dynamic_cast(*i); - if(sm) sm->SetQuadValues(); + if (sm) sm->SetQuadValues(); ++i; } } //______________________________________________________________________________ -// ScaledDigit +// ScaledDigit_t // -AliEveITSScaledModule::ScaledDigit::ScaledDigit() : +AliEveITSScaledModule::ScaledDigit_t::ScaledDigit_t() : TObject(), - N(0), - sum(0), sqr_sum(0), - min_i(-1), min_j(-1), max_i(-1), max_j(-1) + fN(0), + fSum(0), fSqrSum(0), + fMinI(-1), fMinJ(-1), fMaxI(-1), fMaxJ(-1) { } -AliEveITSScaledModule::ScaledDigit::ScaledDigit(Int_t di, Int_t dj) : +AliEveITSScaledModule::ScaledDigit_t::ScaledDigit_t(Int_t di, Int_t dj) : TObject(), - N(0), - sum(0), sqr_sum(0), - min_i(di), min_j(dj), max_i(di), max_j(dj) + fN(0), + fSum(0), fSqrSum(0), + fMinI(di), fMinJ(dj), fMaxI(di), fMaxJ(dj) { } -void AliEveITSScaledModule::ScaledDigit::Dump() const +void AliEveITSScaledModule::ScaledDigit_t::Dump() const { - printf("N %d, sum %f, sqr_sum %f",N, sum, sqr_sum); + printf("N %d, sum %f, sqr_sum %f", fN, fSum, fSqrSum); } -//______________________________________________________________________________ - +//============================================================================== +//============================================================================== // AliEveITSScaledModule +//============================================================================== //______________________________________________________________________________ // @@ -140,7 +146,7 @@ void AliEveITSScaledModule::LoadQuads() digits = fInfo->GetDigits(fID, fDetID); ndigits = digits->GetEntriesFast(); - ScaledDigit* sd; + ScaledDigit_t* sd; Int_t scale = fScaleInfo->GetScale() -1; switch(fDetID) { @@ -175,26 +181,26 @@ void AliEveITSScaledModule::LoadQuads() z = dpz*(i) - fDz; x = dpx*(j) - fDx; AddQuad(x, z, dpx, dpz); - sd = new ScaledDigit(c1, c2); + sd = new ScaledDigit_t(c1, c2); QuadId(sd); } else { - sd = dynamic_cast(GetId(miter->second)); - if(c1 < sd->min_i) - sd->min_i = c1; - else if( c1 > sd->max_i) - sd->max_i = c1; - - if(c2 < sd->min_j) - sd->min_j = c2; - else if( c2 > sd->max_j) - sd->max_j = c2; + sd = dynamic_cast(GetId(miter->second)); + if(c1 < sd->fMinI) + sd->fMinI = c1; + else if( c1 > sd->fMaxI) + sd->fMaxI = c1; + + if(c2 < sd->fMinJ) + sd->fMinJ = c2; + else if( c2 > sd->fMaxJ) + sd->fMaxJ = c2; } - sd->N++; - sd->sum += od->GetSignal(); - sd->sqr_sum += od->GetSignal()*od->GetSignal(); + sd->fN++; + sd->fSum += od->GetSignal(); + sd->fSqrSum += od->GetSignal()*od->GetSignal(); } break; } @@ -231,25 +237,25 @@ void AliEveITSScaledModule::LoadQuads() z = dpz*(i) - fDz; x = dpx*(j) - fDx; AddQuad(x, z, dpx, dpz); - sd = new ScaledDigit(od->GetCoord1(),od->GetCoord2()); + sd = new ScaledDigit_t(od->GetCoord1(),od->GetCoord2()); QuadId(sd); } else { - sd = dynamic_cast(GetId(miter->second)); - if(c1 < sd->min_i) - sd->min_i = c1; - else if( c1 > sd->max_i) - sd->max_i = c1; - - if(c2 < sd->min_j) - sd->min_j = c2; - else if( c2 > sd->max_j) - sd->max_j = c2; + sd = dynamic_cast(GetId(miter->second)); + if(c1 < sd->fMinI) + sd->fMinI = c1; + else if( c1 > sd->fMaxI) + sd->fMaxI = c1; + + if(c2 < sd->fMinJ) + sd->fMinJ = c2; + else if( c2 > sd->fMaxJ) + sd->fMaxJ = c2; } - sd->N++; - sd->sum += od->GetSignal(); - sd->sqr_sum += od->GetSignal()*od->GetSignal(); + sd->fN++; + sd->fSum += od->GetSignal(); + sd->fSqrSum += od->GetSignal()*od->GetSignal(); } break; } @@ -282,7 +288,7 @@ void AliEveITSScaledModule::LoadQuads() id = j*i; miter = dmap.find(id); - ScaledDigit* sd; + ScaledDigit_t* sd; if(miter == dmap.end()) { // printf("orig digit %d,%d scaled %d,%d \n",od->GetCoord1(),od->GetCoord2(),i,j); @@ -292,25 +298,25 @@ void AliEveITSScaledModule::LoadQuads() Float_t a = ( od->GetCoord1() == 1) ? ap : an; AddLine(x-a, -fDz, 2*a, 2*fDz); - sd = new ScaledDigit(c1, c2); + sd = new ScaledDigit_t(c1, c2); QuadId(sd); } else { - sd = dynamic_cast(GetId(miter->second)); - if(c1 < sd->min_i) - sd->min_i = c1; - else if( c1 > sd->max_i) - sd->max_i = c1; - - if(c2 < sd->min_j) - sd->min_j = c2; - else if( c2 > sd->max_j) - sd->max_j = c2; + sd = dynamic_cast(GetId(miter->second)); + if(c1 < sd->fMinI) + sd->fMinI = c1; + else if( c1 > sd->fMaxI) + sd->fMaxI = c1; + + if(c2 < sd->fMinJ) + sd->fMinJ = c2; + else if( c2 > sd->fMaxJ) + sd->fMaxJ = c2; } - sd->N++; - sd->sum += od->GetSignal(); - sd->sqr_sum += od->GetSignal()*od->GetSignal(); + sd->fN++; + sd->fSum += od->GetSignal(); + sd->fSqrSum += od->GetSignal()*od->GetSignal(); } // for digits break; } // end case 2 @@ -326,23 +332,23 @@ void AliEveITSScaledModule::SetQuadValues() { if(fScaleInfo->GetSyncPalette()) SyncPalette(); - Int_t N = fPlex.Size(); - for (Int_t i = 0 ; i< N; i++) + Int_t num = fPlex.Size(); + for (Int_t i = 0 ; i < num; i++) { - ScaledDigit* sd = dynamic_cast(GetId(i)); + ScaledDigit_t* sd = dynamic_cast(GetId(i)); Int_t v = 0; switch(fScaleInfo->GetStatType()) { using namespace TMath; - case AliEveDigitScaleInfo::kST_Occup: - v = Nint((100.0*sd->N) / (fNCx*fNCz)); + case AliEveDigitScaleInfo::kSTOccup: + v = Nint((100.0*sd->fN) / (fNCx*fNCz)); break; - case AliEveDigitScaleInfo::kST_Average: - v = Nint((Double_t) sd->sum / sd->N); + case AliEveDigitScaleInfo::kSTAverage: + v = Nint((Double_t) sd->fSum / sd->fN); break; - case AliEveDigitScaleInfo::kST_Rms: - v = Nint(Sqrt(sd->sqr_sum) / sd->N); + case AliEveDigitScaleInfo::kSTRms: + v = Nint(Sqrt(sd->fSqrSum) / sd->fN); break; } DigitBase_t* qb = GetDigit(i); @@ -355,7 +361,7 @@ void AliEveITSScaledModule::SetQuadValues() void AliEveITSScaledModule::SyncPalette() { // printf("AliEveITSScaledModule::SyncPalette()\n"); - if(fScaleInfo->GetStatType() == AliEveDigitScaleInfo::kST_Occup) + if(fScaleInfo->GetStatType() == AliEveDigitScaleInfo::kSTOccup) { // SPD AliEveITSModule::fgSPDPalette->SetLimits(0, 100); @@ -371,18 +377,18 @@ void AliEveITSScaledModule::SyncPalette() } else { - AliEveITSDigitsInfo& DI = *fInfo; + AliEveITSDigitsInfo& di = *fInfo; // SPD - AliEveITSModule::fgSPDPalette->SetLimits(0, DI.fSPDHighLim); - AliEveITSModule::fgSPDPalette->SetMinMax(DI.fSPDMinVal, DI.fSPDMaxVal); + AliEveITSModule::fgSPDPalette->SetLimits(0, di.fSPDHighLim); + AliEveITSModule::fgSPDPalette->SetMinMax(di.fSPDMinVal, di.fSPDMaxVal); // SDD - AliEveITSModule::fgSDDPalette->SetLimits(0, DI.fSDDHighLim); - AliEveITSModule::fgSDDPalette->SetMinMax(DI.fSDDMinVal, DI.fSDDMaxVal); + AliEveITSModule::fgSDDPalette->SetLimits(0, di.fSDDHighLim); + AliEveITSModule::fgSDDPalette->SetMinMax(di.fSDDMinVal, di.fSDDMaxVal); // SSD - AliEveITSModule::fgSSDPalette->SetLimits(0, DI.fSSDHighLim); - AliEveITSModule::fgSSDPalette->SetMinMax(DI.fSSDMinVal, DI.fSSDMaxVal); + AliEveITSModule::fgSSDPalette->SetLimits(0, di.fSSDHighLim); + AliEveITSModule::fgSSDPalette->SetMinMax(di.fSSDMinVal, di.fSSDMaxVal); } fScaleInfo->SetSyncPalette(kFALSE); @@ -390,10 +396,10 @@ void AliEveITSScaledModule::SyncPalette() /******************************************************************************/ -void AliEveITSScaledModule::GetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total) +void AliEveITSScaledModule::GetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total) const { - cnx =fNx; - cnz =fNz; + cnx = fNx; + cnz = fNz; total = cnx*cnz; } @@ -406,19 +412,19 @@ void AliEveITSScaledModule::DigitSelected(Int_t idx) DigitBase_t* qb = GetDigit(idx); TObject* obj = qb->fId.GetObject(); - ScaledDigit* sd = dynamic_cast(obj); + ScaledDigit_t* sd = dynamic_cast(obj); TClonesArray *digits = fInfo->GetDigits(fID, fDetID); Int_t ndigits = digits->GetEntriesFast(); - printf("%d digits in cell scaleX = %d, scaleZ = %d \n", sd->N, fNCx, fNCz); + printf("%d digits in cell scaleX = %d, scaleZ = %d \n", sd->fN, fNCx, fNCz); Int_t il = 0; for(Int_t k=0; kUncheckedAt(k); - if(d->GetCoord1()>=sd->min_i && d->GetCoord1()<=sd->max_i && - d->GetCoord2()>=sd->min_j && d->GetCoord2()<=sd->max_j) + if(d->GetCoord1()>=sd->fMinI && d->GetCoord1()<=sd->fMaxI && + d->GetCoord2()>=sd->fMinJ && d->GetCoord2()<=sd->fMaxJ) { printf("%3d, %3d: %3d", d->GetCoord1(), d->GetCoord2(), d->GetSignal()); printf(" | "); diff --git a/EVE/EveDet/AliEveITSScaledModule.h b/EVE/EveDet/AliEveITSScaledModule.h index dce43eb4187..9333dda41ab 100644 --- a/EVE/EveDet/AliEveITSScaledModule.h +++ b/EVE/EveDet/AliEveITSScaledModule.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_ITSScaledModule_H -#define ALIEVE_ITSScaledModule_H +#ifndef AliEveITSScaledModule_H +#define AliEveITSScaledModule_H #include #include @@ -23,7 +23,7 @@ class AliEveDigitScaleInfo : public TQObject, public TEveRefBackPtr { public: - enum StatType_e { kST_Occup, kST_Average, kST_Rms }; + enum StatType_e { kSTOccup, kSTAverage, kSTRms }; // Bool_t fAutoUpdatePalette; private: @@ -65,23 +65,23 @@ class AliEveITSScaledModule : public AliEveITSModule friend class ITSSDSubEditor; public: - struct ScaledDigit : public TObject + struct ScaledDigit_t : public TObject { public: - Int_t N; - Float_t sum; - Float_t sqr_sum; - Int_t min_i,min_j; - Int_t max_i,max_j; + Int_t fN; + Float_t fSum; + Float_t fSqrSum; + Int_t fMinI, fMinJ; + Int_t fMaxI, fMaxJ; - ScaledDigit(); - ScaledDigit(Int_t di, Int_t dj); + ScaledDigit_t(); + ScaledDigit_t(Int_t di, Int_t dj); void Dump() const; }; private: - std::map fDigitsMap; + std::map fDigitsMap; AliEveITSScaledModule(const AliEveITSScaledModule&); // Not implemented AliEveITSScaledModule& operator=(const AliEveITSScaledModule&); // Not implemented @@ -106,7 +106,7 @@ public: void SyncPalette(); - void GetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total); + void GetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total) const; AliEveDigitScaleInfo* GetScaleInfo() { return fScaleInfo; } ClassDef(AliEveITSScaledModule, 1); // Visualization of an ITS module with digits aggregated on a grid of pre-defined size. diff --git a/EVE/EveDet/AliEveITSScaledModuleEditor.cxx b/EVE/EveDet/AliEveITSScaledModuleEditor.cxx index 7a4d69e2c9a..ddb3d7b7b15 100644 --- a/EVE/EveDet/AliEveITSScaledModuleEditor.cxx +++ b/EVE/EveDet/AliEveITSScaledModuleEditor.cxx @@ -9,21 +9,18 @@ #include "AliEveITSScaledModuleEditor.h" #include -#include -#include #include -#include -#include - #include #include #include -#include #include -#include #include +//============================================================================== +//============================================================================== +// AliEveITSScaledModuleEditor +//============================================================================== //______________________________________________________________________________ // diff --git a/EVE/EveDet/AliEveITSScaledModuleEditor.h b/EVE/EveDet/AliEveITSScaledModuleEditor.h index 736d18d94f0..891d70b5012 100644 --- a/EVE/EveDet/AliEveITSScaledModuleEditor.h +++ b/EVE/EveDet/AliEveITSScaledModuleEditor.h @@ -7,11 +7,10 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_ITSScaledModuleEditor_H -#define ALIEVE_ITSScaledModuleEditor_H +#ifndef AliEveITSScaledModuleEditor_H +#define AliEveITSScaledModuleEditor_H #include -#include class TGNumberEntry; class TGColorSelect; @@ -21,7 +20,6 @@ class TEveGValuator; class TEveGDoubleValuator; class TEveRGBAPalette; - class AliEveDigitScaleInfo; class AliEveITSScaledModule; class AliITSsegmentation; diff --git a/EVE/EveDet/AliEveMUONChamber.cxx b/EVE/EveDet/AliEveMUONChamber.cxx index 44588eb5f21..92124708ab1 100644 --- a/EVE/EveDet/AliEveMUONChamber.cxx +++ b/EVE/EveDet/AliEveMUONChamber.cxx @@ -15,10 +15,7 @@ #include #include #include - #include -#include -#include //______________________________________________________________________________ @@ -248,26 +245,27 @@ void AliEveMUONChamber::ClearColorArray() //______________________________________________________________________________ void AliEveMUONChamber::SetDataSource(AliEveMUONData* data) { + // Set source of data. if (data == fMUONData) return; if(fMUONData) fMUONData->DecRefCount(); fMUONData = data; if(fMUONData) fMUONData->IncRefCount(); IncRTS(); - } //______________________________________________________________________________ AliEveMUONChamberData* AliEveMUONChamber::GetChamberData() const { + // Return source of data. return fMUONData ? fMUONData->GetChamberData(fChamberID) : 0; - } //______________________________________________________________________________ void AliEveMUONChamber::UpdateQuads() { + // Update digit representation. fQuadSet1.Reset(TEveQuadSet::kQT_RectangleXY, kTRUE, 32); fQuadSet2.Reset(TEveQuadSet::kQT_RectangleXY, kTRUE, 32); @@ -361,12 +359,12 @@ void AliEveMUONChamber::UpdateQuads() //______________________________________________________________________________ void AliEveMUONChamber::SetChamberID(Int_t id) { + // Set id of chamber to display. if (id < 0) id = 0; if (id > 13) id = 13; fChamberID = id; IncRTS(); - } diff --git a/EVE/EveDet/AliEveMUONChamber.h b/EVE/EveDet/AliEveMUONChamber.h index 253e7005dd5..85474bcfa83 100644 --- a/EVE/EveDet/AliEveMUONChamber.h +++ b/EVE/EveDet/AliEveMUONChamber.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_MUONChamber_H -#define ALIEVE_MUONChamber_H +#ifndef AliEveMUONChamber_H +#define AliEveMUONChamber_H #include #include @@ -31,7 +31,6 @@ class AliEveMUONChamber : public TEveElement, friend class AliEveMUONChamberGL; friend class AliEveMUONChamberEditor; -private: AliEveMUONChamber(const AliEveMUONChamber&); // Not implemented AliEveMUONChamber& operator=(const AliEveMUONChamber&); // Not implemented @@ -62,14 +61,13 @@ protected: Int_t ColorIndex(Int_t val) const; public: - AliEveMUONChamber(Int_t id, const Text_t* n = "AliEveMUONChamber", const Text_t* t = 0); virtual ~AliEveMUONChamber(); virtual void ComputeBBox(); virtual void Paint(Option_t* option = ""); virtual UInt_t IncRTS() { return ++fRTS; }; - virtual Bool_t CanEditMainColor() { return kTRUE; } + virtual Bool_t CanEditMainColor() const { return kTRUE; } void SetDataSource(AliEveMUONData *data); void SetChamberID(Int_t id); diff --git a/EVE/EveDet/AliEveMUONChamberData.cxx b/EVE/EveDet/AliEveMUONChamberData.cxx index 86e99321c92..3554c4548af 100644 --- a/EVE/EveDet/AliEveMUONChamberData.cxx +++ b/EVE/EveDet/AliEveMUONChamberData.cxx @@ -14,15 +14,10 @@ #include #include #include -#include -#include #include -#include #include -#include - #include /////////////////////////////////////////////////////////////////////////////// @@ -49,7 +44,7 @@ AliEveMUONChamberData::AliEveMUONChamberData(Int_t chamber) : // constructor // - AliEveEventManager *event = gEvent; + AliEveEventManager *event = gAliEveEvent; TString dataPath = TString(event->GetTitle()); dataPath.Append("/geometry.root"); diff --git a/EVE/EveDet/AliEveMUONChamberData.h b/EVE/EveDet/AliEveMUONChamberData.h index b8a8977f63e..df076ddd719 100644 --- a/EVE/EveDet/AliEveMUONChamberData.h +++ b/EVE/EveDet/AliEveMUONChamberData.h @@ -6,22 +6,19 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_MUONChamberData_H -#define ALIEVE_MUONChamberData_H - -#include +#ifndef AliEveMUONChamberData_H +#define AliEveMUONChamberData_H #include class AliMUONGeometryTransformer; - class AliEveMUONChamberData : public TObject { -private: AliEveMUONChamberData(const AliEveMUONChamberData&); // Not implemented AliEveMUONChamberData& operator=(const AliEveMUONChamberData&); // Not implemented +private: static AliMUONGeometryTransformer* fgTransformer; // geometry transformer protected: @@ -52,10 +49,10 @@ public: Float_t* GetFrameCoord(Int_t detElemId) { return fFrameCoord[detElemId]; }; - Int_t GetNDetElem() { return fNDetElem; }; - Int_t GetNDigits() { return fNDigits/7; }; - Int_t GetNClusters() { return fNClusters/5; }; - Int_t GetNHits() { return fNHits/3; }; + Int_t GetNDetElem() const { return fNDetElem; }; + Int_t GetNDigits() const { return fNDigits/7; }; + Int_t GetNClusters() const { return fNClusters/5; }; + Int_t GetNHits() const { return fNHits/3; }; Float_t* GetDigitBuffer(Int_t pos) { return &fDigitBuffer[7*pos]; }; Float_t* GetClusterBuffer(Int_t pos) { return &fClusterBuffer[5*pos]; }; diff --git a/EVE/EveDet/AliEveMUONChamberEditor.cxx b/EVE/EveDet/AliEveMUONChamberEditor.cxx index 3821c8c9ae1..ed51821ae75 100644 --- a/EVE/EveDet/AliEveMUONChamberEditor.cxx +++ b/EVE/EveDet/AliEveMUONChamberEditor.cxx @@ -6,19 +6,12 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ + #include "AliEveMUONChamberEditor.h" #include #include - -#include -#include - -#include -#include -#include -#include #include #include diff --git a/EVE/EveDet/AliEveMUONChamberEditor.h b/EVE/EveDet/AliEveMUONChamberEditor.h index 8c2eb7774f9..103a3844a85 100644 --- a/EVE/EveDet/AliEveMUONChamberEditor.h +++ b/EVE/EveDet/AliEveMUONChamberEditor.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_MUONChamberEditor_H -#define ALIEVE_MUONChamberEditor_H +#ifndef AliEveMUONChamberEditor_H +#define AliEveMUONChamberEditor_H #include @@ -24,12 +24,10 @@ class AliEveMUONChamber; class AliEveMUONChamberEditor : public TGedFrame { -private: AliEveMUONChamberEditor(const AliEveMUONChamberEditor&); // Not implemented AliEveMUONChamberEditor& operator=(const AliEveMUONChamberEditor&); // Not implemented protected: - AliEveMUONChamber* fM; // fModel dynamic-casted to AliEveMUONChamberEditor TEveGValuator *fThreshold; // digit ADC min @@ -38,7 +36,6 @@ protected: TEveGValuator *fHitSize; // hit point size public: - AliEveMUONChamberEditor(const TGWindow* p = 0, Int_t width = 170, Int_t height = 30, UInt_t options = kChildFrame, diff --git a/EVE/EveDet/AliEveMUONChamberGL.cxx b/EVE/EveDet/AliEveMUONChamberGL.cxx index a9538bdaee4..6be87ed05e2 100644 --- a/EVE/EveDet/AliEveMUONChamberGL.cxx +++ b/EVE/EveDet/AliEveMUONChamberGL.cxx @@ -7,16 +7,11 @@ * full copyright notice. * **************************************************************************/ -#include - -#include - #include "AliEveMUONChamberGL.h" #include #include -#include #include #include @@ -120,8 +115,6 @@ void AliEveMUONChamberGL::DrawQuads(TGLRnrCtx& rnrCtx) const glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT); glDisable(GL_LIGHTING); - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glEnable(GL_COLOR_MATERIAL); glDisable(GL_CULL_FACE); //Float_t c[4]; glGetFloatv(GL_CURRENT_COLOR, c); @@ -152,7 +145,7 @@ void AliEveMUONChamberGL::DrawPoints() const glDisable(GL_LIGHTING); glLineWidth(1.0); - glColor3f(1.0,1.0,1.0); + TGLUtil::Color3f(1.0,1.0,1.0); glBegin(GL_LINES); @@ -212,13 +205,7 @@ void AliEveMUONChamberGL::DrawChamberFrame() const Float_t *frameCoord; Float_t xOrig, yOrig, xRad, yRad, x, y, z; - UChar_t pix[4]; - pix[0] = 255; - pix[1] = 0; - pix[2] = 0; - pix[3] = 255; - - glColor4ubv(pix); + TGLUtil::Color4ub(255, 0, 0, 255); for (Int_t id = 0; id < nDetElem; id++) { diff --git a/EVE/EveDet/AliEveMUONChamberGL.h b/EVE/EveDet/AliEveMUONChamberGL.h index 0ae8604e0fe..21342c507dd 100644 --- a/EVE/EveDet/AliEveMUONChamberGL.h +++ b/EVE/EveDet/AliEveMUONChamberGL.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_MUONChamberGL_H -#define ALIEVE_MUONChamberGL_H +#ifndef AliEveMUONChamberGL_H +#define AliEveMUONChamberGL_H #include #include @@ -19,12 +19,10 @@ class AliEveMUONChamber; class AliEveMUONChamberGL : public TGLObject { - AliEveMUONChamberGL(const AliEveMUONChamberGL&); // Not implemented AliEveMUONChamberGL& operator=(const AliEveMUONChamberGL&); // Not implemented protected: - virtual void DirectDraw(TGLRnrCtx & rnrCtx) const; void DrawChamberFrame() const; void DrawQuads(TGLRnrCtx& rnrCtx) const; @@ -37,7 +35,6 @@ class AliEveMUONChamberGL : public TGLObject mutable UInt_t fRTS; // render time stamp public: - AliEveMUONChamberGL(); virtual ~AliEveMUONChamberGL(); diff --git a/EVE/EveDet/AliEveMUONData.cxx b/EVE/EveDet/AliEveMUONData.cxx index 22652740fa8..471e2bb2226 100644 --- a/EVE/EveDet/AliEveMUONData.cxx +++ b/EVE/EveDet/AliEveMUONData.cxx @@ -17,8 +17,6 @@ #include #include -#include - #include #include #include @@ -34,7 +32,6 @@ #include "TTree.h" #include "TString.h" #include "TClonesArray.h" -#include "TList.h" #include "TFile.h" @@ -273,8 +270,8 @@ void AliEveMUONData::LoadRecPointsFromESD(Char_t *fileName) Int_t detElemId, chamber, nTrackParam; Double_t clsX, clsY, clsZ, charge; - if (esdTree->GetEvent(gEvent->GetEventId()) <= 0) { - cout << "fails to read ESD object for event " << gEvent->GetEventId() << endl; + if (esdTree->GetEvent(gAliEveEvent->GetEventId()) <= 0) { + cout << "fails to read ESD object for event " << gAliEveEvent->GetEventId() << endl; return; } @@ -405,7 +402,7 @@ void AliEveMUONData::LoadRaw(TString fileName) Int_t iEvent = 0; while (fgRawReader->NextEvent()) { - if (iEvent != gEvent->GetEventId()) + if (iEvent != gAliEveEvent->GetEventId()) { iEvent++; continue; @@ -441,11 +438,10 @@ void AliEveMUONData::LoadRaw(TString fileName) fChambers[chamber]->RegisterDigit(detElemId,cathode,ix,iy,adc); } } - } //______________________________________________________________________________ -Int_t AliEveMUONData::GetTrack(Int_t index) +Int_t AliEveMUONData::GetTrack(Int_t index) const { // // return track stack number for "index"-th track with hits in the chambers @@ -456,7 +452,6 @@ Int_t AliEveMUONData::GetTrack(Int_t index) } else { return -1; } - } //______________________________________________________________________________ @@ -471,5 +466,4 @@ AliEveMUONChamberData* AliEveMUONData::GetChamberData(Int_t chamber) //if (fChambers[chamber] == 0) CreateChamber(chamber); return fChambers[chamber]; - } diff --git a/EVE/EveDet/AliEveMUONData.h b/EVE/EveDet/AliEveMUONData.h index 706e626e0f8..d540f1a0b5c 100644 --- a/EVE/EveDet/AliEveMUONData.h +++ b/EVE/EveDet/AliEveMUONData.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_MUONData_H -#define ALIEVE_MUONData_H +#ifndef AliEveMUONData_H +#define AliEveMUONData_H #include @@ -57,8 +57,8 @@ class AliEveMUONData : public TObject, public TEveRefCnt void DeleteAllChambers(); void RegisterTrack(Int_t track); - Int_t GetNTrackList() { return fNTrackList; } - Int_t GetTrack(Int_t index); + Int_t GetNTrackList() const { return fNTrackList; } + Int_t GetTrack(Int_t index) const; AliEveMUONChamberData* GetChamberData(Int_t chamber); diff --git a/EVE/EveDet/AliEveMUONTrack.cxx b/EVE/EveDet/AliEveMUONTrack.cxx index 99d443d35b7..9c2db9bf17e 100644 --- a/EVE/EveDet/AliEveMUONTrack.cxx +++ b/EVE/EveDet/AliEveMUONTrack.cxx @@ -1,4 +1,4 @@ -// $Id$ + // Main authors: Matevz Tadel & Alja Mrak-Tadel & Bogdan Vulpescu: 2006, 2007 /************************************************************************** @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -28,8 +27,6 @@ #include #include -#include -#include #include #include #include @@ -37,14 +34,17 @@ #include +//============================================================================== +// AliEveMUONTrack +//============================================================================== +//============================================================================== //______________________________________________________________________________ -// AliEveMUONTrack // Produce TEveUtil:TEveTrack from AliMUONTrack with dipole field model ClassImp(AliEveMUONTrack) -AliMagF* AliEveMUONTrack::fFieldMap = 0; +AliMagF* AliEveMUONTrack::fgFieldMap = 0; //______________________________________________________________________________ AliEveMUONTrack::AliEveMUONTrack(TEveRecTrack* t, TEveTrackPropagator* rs) : @@ -62,8 +62,8 @@ AliEveMUONTrack::AliEveMUONTrack(TEveRecTrack* t, TEveTrackPropagator* rs) : // constructor // - fFieldMap = AliEveEventManager::AssertMagField(); - + if (fgFieldMap == 0) + fgFieldMap = AliEveEventManager::AssertMagField(); } //______________________________________________________________________________ @@ -136,7 +136,7 @@ void AliEveMUONTrack::PrintMUONTrackInfo() // information about the reconstructed/reference track; at hits and at vertex // - Double_t RADDEG = 180.0/TMath::Pi(); + Double_t radDeg = 180.0/TMath::Pi(); Int_t nparam; Float_t pt, bc, nbc, zc; @@ -189,10 +189,10 @@ void AliEveMUONTrack::PrintMUONTrackInfo() mtp->GetInverseBendingMomentum() << " " << setw(8) << setprecision(3) << - mtp->GetBendingSlope()*RADDEG << " " << + mtp->GetBendingSlope()*radDeg << " " << setw(8) << setprecision(3) << - mtp->GetNonBendingSlope()*RADDEG << " " << + mtp->GetNonBendingSlope()*radDeg << " " << setw(8) << setprecision(4) << mtp->GetBendingCoor() << " " << @@ -238,10 +238,10 @@ void AliEveMUONTrack::PrintMUONTrackInfo() mtp->GetInverseBendingMomentum() << " " << setw(8) << setprecision(3) << - mtp->GetBendingSlope()*RADDEG << " " << + mtp->GetBendingSlope()*radDeg << " " << setw(8) << setprecision(3) << - mtp->GetNonBendingSlope()*RADDEG << " " << + mtp->GetNonBendingSlope()*radDeg << " " << setw(8) << setprecision(4) << bc << " " << @@ -282,7 +282,7 @@ void AliEveMUONTrack::PrintMUONTriggerTrackInfo() // information about the trigger track // - // Double_t RADDEG = 180.0/TMath::Pi(); + // Double_t radDeg = 180.0/TMath::Pi(); } @@ -293,7 +293,7 @@ void AliEveMUONTrack::PrintESDTrackInfo() // information about the reconstructed ESD track at vertex // - Double_t RADDEG = 180.0/TMath::Pi(); + Double_t radDeg = 180.0/TMath::Pi(); Float_t pt; AliMUONTrackParam *mtp = (AliMUONTrackParam*)fTrack->GetTrackParamAtVertex(); @@ -309,10 +309,10 @@ void AliEveMUONTrack::PrintESDTrackInfo() mtp->GetInverseBendingMomentum() << " " << setw(8) << setprecision(3) << - mtp->GetBendingSlope()*RADDEG << " " << + mtp->GetBendingSlope()*radDeg << " " << setw(8) << setprecision(3) << - mtp->GetNonBendingSlope()*RADDEG << " " << + mtp->GetNonBendingSlope()*radDeg << " " << setw(8) << setprecision(4) << mtp->GetBendingCoor() << " " << @@ -973,8 +973,8 @@ void AliEveMUONTrack::GetField(Double_t *position, Double_t *field) x[0] = position[0]; x[1] = position[1]; x[2] = position[2]; - if (fFieldMap) { - fFieldMap->Field(x,b); + if (fgFieldMap) { + fgFieldMap->Field(x,b); } else { AliWarning("No field map"); diff --git a/EVE/EveDet/AliEveMUONTrack.h b/EVE/EveDet/AliEveMUONTrack.h index 559dc375c43..69457832d1d 100644 --- a/EVE/EveDet/AliEveMUONTrack.h +++ b/EVE/EveDet/AliEveMUONTrack.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_MUONTrack_H -#define ALIEVE_MUONTrack_H +#ifndef AliEveMUONTrack_H +#define AliEveMUONTrack_H #include @@ -47,11 +47,11 @@ class AliEveMUONTrack: public TEveTrack Double_t* vect, Double_t* vout); Int_t ColorIndex(Float_t val); - Bool_t IsMUONTrack() { return fIsMUONTrack; }; - Bool_t IsMUONTriggerTrack() { return fIsMUONTrack; }; - Bool_t IsESDTrack() { return fIsESDTrack; }; - Bool_t IsMCTrack() { return fIsMCTrack; }; - Bool_t IsRefTrack() { return fIsRefTrack; }; + Bool_t IsMUONTrack() const { return fIsMUONTrack; } + Bool_t IsMUONTriggerTrack() const { return fIsMUONTrack; } + Bool_t IsESDTrack() const { return fIsESDTrack; } + Bool_t IsMCTrack() const { return fIsMCTrack; } + Bool_t IsRefTrack() const { return fIsRefTrack; } void PrintMCTrackInfo(); void PrintMUONTrackInfo(); @@ -72,10 +72,9 @@ class AliEveMUONTrack: public TEveTrack Bool_t fIsMCTrack; // track from Kinematics.root Bool_t fIsRefTrack; // track from TrackRefs.root - static AliMagF *fFieldMap; // pointer to the magnetic field map + static AliMagF *fgFieldMap; // pointer to the magnetic field map ClassDef(AliEveMUONTrack, 1); // Produce TEveUtil:TEveTrack from AliMUONTrack - }; #endif diff --git a/EVE/EveDet/AliEvePMDModule.cxx b/EVE/EveDet/AliEvePMDModule.cxx index a4e26edb509..829f8d11d9b 100644 --- a/EVE/EveDet/AliEvePMDModule.cxx +++ b/EVE/EveDet/AliEvePMDModule.cxx @@ -12,16 +12,19 @@ #include "AliPMDdigit.h" #include "AliPMDddldata.h" -#include +#include +#include +#include +#include const Float_t AliEvePMDModule::fgkRad = 0.25; const Float_t AliEvePMDModule::fgkSqRoot3 = 1.732050808; const Float_t AliEvePMDModule::fgkZpos = 0.; -Int_t AliEvePMDModule::fPreTotPads = 0; -Int_t AliEvePMDModule::fCpvTotPads = 0; -Int_t AliEvePMDModule::fPreTotAdc = 0; -Int_t AliEvePMDModule::fCpvTotAdc = 0; +Int_t AliEvePMDModule::fgPreTotPads = 0; +Int_t AliEvePMDModule::fgCpvTotPads = 0; +Int_t AliEvePMDModule::fgPreTotAdc = 0; +Int_t AliEvePMDModule::fgCpvTotAdc = 0; //______________________________________________________________________________ @@ -39,11 +42,21 @@ AliEvePMDModule::AliEvePMDModule(): fNPads(0), fAdc(0) { + // Constructor. +} + +AliEvePMDModule::~AliEvePMDModule() +{ + // Destructor. + delete fH1; } + // -------------------------------------------------------------------- // void AliEvePMDModule::DisplayInit(Int_t ism) { + // Initialize display parameters for module ism. + TString smodule = "Module"; smodule+= ism; @@ -71,6 +84,8 @@ void AliEvePMDModule::DisplayInit(Int_t ism) void AliEvePMDModule::DisplayDigitsData(Int_t ism, TTree *pmdt) { + // Populate internal structures with data from pmdt for module ism. + DisplayInit(ism); Int_t det, smn, irow, icol, adc; @@ -124,13 +139,13 @@ void AliEvePMDModule::DisplayDigitsData(Int_t ism, TTree *pmdt) if (det == 0) { - fPreTotAdc += (Int_t) adc; - ++fPreTotPads; + fgPreTotAdc += (Int_t) adc; + ++fgPreTotPads; } if (det == 1) { - fCpvTotAdc += (Int_t) adc; - ++fCpvTotPads; + fgCpvTotAdc += (Int_t) adc; + ++fgCpvTotPads; } fH1->Fill((Float_t)adc); @@ -138,7 +153,7 @@ void AliEvePMDModule::DisplayDigitsData(Int_t ism, TTree *pmdt) RefitPlex(); - fHMTrans.SetPos(fX, fY, fZ); + RefMainTrans().SetPos(fX, fY, fZ); delete digits; } @@ -147,6 +162,8 @@ void AliEvePMDModule::DisplayDigitsData(Int_t ism, TTree *pmdt) void AliEvePMDModule::DisplayRawData(Int_t ism, TObjArray *ddlcont) { + // Populate internal structures with data from ddlcont for module ism. + DisplayInit(ism); if (ism > 23) ism -= 24; @@ -195,13 +212,13 @@ void AliEvePMDModule::DisplayRawData(Int_t ism, TObjArray *ddlcont) if (det == 0) { - fPreTotAdc += (Int_t) adc; - ++fPreTotPads; + fgPreTotAdc += (Int_t) adc; + ++fgPreTotPads; } if (det == 1) { - fCpvTotAdc += (Int_t) adc; - ++fCpvTotPads; + fgCpvTotAdc += (Int_t) adc; + ++fgCpvTotPads; } fH1->Fill((Float_t) adc); @@ -209,7 +226,7 @@ void AliEvePMDModule::DisplayRawData(Int_t ism, TObjArray *ddlcont) RefitPlex(); - fHMTrans.SetPos(fX, fY, fZ); + RefMainTrans().SetPos(fX, fY, fZ); } @@ -307,8 +324,10 @@ void AliEvePMDModule::RectGeomCellPos(Int_t ism, Int_t xpad, Int_t ypad, // -------------------------------------------------------------------- // void AliEvePMDModule::GenerateBox(Int_t ism, Float_t &xism, Float_t &yism, - Float_t &dxism, Float_t &dyism) + Float_t &dxism, Float_t &dyism) { + // Generate bounding-box. + const Float_t kDia = 0.50; const Double_t kXcorner[24] = @@ -379,6 +398,8 @@ void AliEvePMDModule::GenerateBox(Int_t ism, Float_t &xism, Float_t &yism, void AliEvePMDModule::SetPosition(Float_t x, Float_t y, Float_t z) { + // Set position of module. + fX = x; fY = y; fZ = z; diff --git a/EVE/EveDet/AliEvePMDModule.h b/EVE/EveDet/AliEvePMDModule.h index 331761e317c..f4e848939ae 100644 --- a/EVE/EveDet/AliEvePMDModule.h +++ b/EVE/EveDet/AliEvePMDModule.h @@ -7,17 +7,13 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_PMDModule_H -#define ALIEVE_PMDModule_H +#ifndef AliEvePMDModule_H +#define AliEvePMDModule_H -#include #include -#include -#include -#include -#include - +class TH1F; +class TTree; class AliEvePMDModule : public TEveQuadSet { @@ -31,32 +27,32 @@ private: Float_t &dxism, Float_t &dyism); protected: - TH1F* fH1; - Float_t fX, fY, fZ; - Int_t fNPads; - Int_t fAdc; - - static const Float_t fgkRad; - static const Float_t fgkSqRoot3; - static const Float_t fgkZpos; + TH1F* fH1; // histogram + Float_t fX, fY, fZ; // coordinates + Int_t fNPads; // number of pads + Int_t fAdc; // ad count - static Int_t fPreTotPads; - static Int_t fCpvTotPads; - static Int_t fPreTotAdc; - static Int_t fCpvTotAdc; + static const Float_t fgkRad; // fooconst + static const Float_t fgkSqRoot3; // fooconst + static const Float_t fgkZpos; // position of PMD + static Int_t fgPreTotPads; // total pre pads + static Int_t fgCpvTotPads; // total cpv pads + static Int_t fgPreTotAdc; // total pre signal + static Int_t fgCpvTotAdc; // total cpv signal public: AliEvePMDModule(); - virtual ~AliEvePMDModule() { delete fH1; } + virtual ~AliEvePMDModule(); + + static Int_t GetPRETotPads() { return fgPreTotPads; } + static Int_t GetCPVTotPads() { return fgCpvTotPads; } + static Int_t GetPRETotAdc() { return fgPreTotAdc; } + static Int_t GetCPVTotAdc() { return fgCpvTotAdc; } - Int_t GetPRETotPads() const { return fPreTotPads; } - Int_t GetCPVTotPads() const { return fCpvTotPads; } Int_t GetNPads() const { return fNPads; } - Int_t GetPRETotAdc() const { return fPreTotAdc; } - Int_t GetCPVTotAdc() const { return fCpvTotAdc; } - Int_t GetAdc() const { return fAdc; } - TH1F *GetHisto() const { return fH1;} + Int_t GetAdc() const { return fAdc; } + TH1F *GetHisto() const { return fH1; } void DisplayInit(Int_t ism); void DisplayDigitsData(Int_t ism, TTree *pmdt); diff --git a/EVE/EveDet/AliEvePMDModuleEditor.cxx b/EVE/EveDet/AliEvePMDModuleEditor.cxx index fa667fefa29..26748e78b95 100644 --- a/EVE/EveDet/AliEvePMDModuleEditor.cxx +++ b/EVE/EveDet/AliEvePMDModuleEditor.cxx @@ -9,34 +9,27 @@ #include "AliEvePMDModuleEditor.h" #include -#include #include -#include +#include #include #include #include -#include -#include -#include - -#include -#include -#include - - -#include +//============================================================================== +//============================================================================== +// AliEvePMDModuleEditor +//============================================================================== //______________________________________________________________________________ -// AliEvePMDModuleEditor // +// GUI editor for AliEvePMDModule. ClassImp(AliEvePMDModuleEditor) AliEvePMDModuleEditor::AliEvePMDModuleEditor(const TGWindow *p, Int_t width, Int_t height, - UInt_t options, Pixel_t back) : + UInt_t options, Pixel_t back) : TGedFrame(p, width, height, options | kVerticalFrame, back), fM(0), fInfoFrame(0), @@ -46,8 +39,9 @@ AliEvePMDModuleEditor::AliEvePMDModuleEditor(const TGWindow *p, Int_t width, Int fInfoLabel3(0), fInfoLabel4(0), fInfoLabel5(0) - // Initialize widget pointers to 0 { + // Constructor. + MakeTitle("AliEvePMDModule"); CreateInfoFrame(); @@ -55,6 +49,8 @@ AliEvePMDModuleEditor::AliEvePMDModuleEditor(const TGWindow *p, Int_t width, Int void AliEvePMDModuleEditor::CreateInfoFrame() { + // Create frame holding information. + fInfoFrame = CreateEditorTabSubFrame("Info"); TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10, @@ -120,16 +116,13 @@ void AliEvePMDModuleEditor::CreateInfoFrame() } } -AliEvePMDModuleEditor::~AliEvePMDModuleEditor() -{} - /******************************************************************************/ void AliEvePMDModuleEditor::SetModel(TObject* obj) { - fM = dynamic_cast(obj); + // Set model object. - // Set values of widgets + fM = dynamic_cast(obj); fInfoLabel0->SetText(Form("Cells hit per Module : %d", fM->GetNPads())); fInfoLabel1->SetText(Form("ADC per Module : %d", fM->GetAdc())); @@ -141,6 +134,8 @@ void AliEvePMDModuleEditor::SetModel(TObject* obj) void AliEvePMDModuleEditor::DisplayHistos() { + // Slot for displaying histograms with module data. + fM->GetHisto()->Draw(); gPad->Modified(); gPad->Update(); diff --git a/EVE/EveDet/AliEvePMDModuleEditor.h b/EVE/EveDet/AliEvePMDModuleEditor.h index 8cbdb430316..a5f5d31be71 100644 --- a/EVE/EveDet/AliEvePMDModuleEditor.h +++ b/EVE/EveDet/AliEvePMDModuleEditor.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_PMDModuleEditor_H -#define ALIEVE_PMDModuleEditor_H +#ifndef AliEvePMDModuleEditor_H +#define AliEvePMDModuleEditor_H #include @@ -16,7 +16,6 @@ class TGCheckButton; class TGNumberEntry; class TGColorSelect; - class AliEvePMDModule; class AliEvePMDModuleEditor : public TGedFrame @@ -28,31 +27,25 @@ private: void CreateInfoFrame(); protected: - AliEvePMDModule* fM; // fModel dynamic-casted to AliEvePMDModuleEditor + AliEvePMDModule* fM; // Model object. - TGVerticalFrame* fInfoFrame; + TGVerticalFrame* fInfoFrame; // Top frame for info labels. - TGLabel* fInfoLabel0; - TGLabel* fInfoLabel1; - TGLabel* fInfoLabel2; - TGLabel* fInfoLabel3; - TGLabel* fInfoLabel4; - TGLabel* fInfoLabel5; + TGLabel* fInfoLabel0; // label + TGLabel* fInfoLabel1; // label + TGLabel* fInfoLabel2; // label + TGLabel* fInfoLabel3; // label + TGLabel* fInfoLabel4; // label + TGLabel* fInfoLabel5; // label public: AliEvePMDModuleEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - virtual ~AliEvePMDModuleEditor(); + virtual ~AliEvePMDModuleEditor() {} virtual void SetModel(TObject* obj); void DisplayHistos(); - // void PrintADC(); - - - - // Declare callback/slot methods - // void DoXYZZ(); ClassDef(AliEvePMDModuleEditor, 0); // Editor for AliEvePMDModule -}; // endclass AliEvePMDModuleEditor +}; #endif diff --git a/EVE/EveDet/AliEveT0Module.cxx b/EVE/EveDet/AliEveT0Module.cxx index eda245ae9ee..b38c56b7093 100644 --- a/EVE/EveDet/AliEveT0Module.cxx +++ b/EVE/EveDet/AliEveT0Module.cxx @@ -19,18 +19,17 @@ #include #include -#include -#include #include #include -#include #include +#include +#include +#include #include #include #include #include -#include ClassImp(AliEveT0Module) @@ -42,17 +41,14 @@ AliEveT0Module::AliEveT0Module(const Text_t* n, Int_t sigType, AliT0digit *digit // // Default constructor // - } /******************************************************************************/ -AliEveT0Module::~AliEveT0Module() -{ - -} void AliEveT0Module::LoadRaw(TString fileName, Int_t ievt) { + // Load raw-data from file. + AliT0digit *digits = 0; AliRawReader *reader = new AliRawReaderRoot(fileName,ievt); reader->LoadEquipmentIdsMap("T0map.txt"); @@ -63,10 +59,12 @@ void AliEveT0Module::LoadRaw(TString fileName, Int_t ievt) // cout<SetLimits(1, 3000); // Set proper raw time range. - TEveQuadSet* raw_a = new AliEveT0Module("T0_RAW_A", 2,digits, start); raw_a->SetPalette(rawPalette); - raw_a->Reset(TEveQuadSet::kQT_HexagonXY, kFALSE, 32); - TEveQuadSet* raw_c = new AliEveT0Module("T0_RAW_C", 3,digits, start); raw_c->SetPalette(rawPalette); - raw_c->Reset(TEveQuadSet::kQT_HexagonXY, kFALSE, 32); + TEveQuadSet* rawA = new AliEveT0Module("T0_RAW_A", 2, digits, start); + rawA->SetPalette(rawPalette); + rawA->Reset(TEveQuadSet::kQT_HexagonXY, kFALSE, 32); + TEveQuadSet* rawC = new AliEveT0Module("T0_RAW_C", 3, digits, start); + rawC->SetPalette(rawPalette); + rawC->Reset(TEveQuadSet::kQT_HexagonXY, kFALSE, 32); Float_t angle = 2 * TMath::Pi() / 12; start->Next(); for (Int_t i=0; i<110; i++) @@ -74,45 +72,50 @@ void AliEveT0Module::LoadRaw(TString fileName, Int_t ievt) for (Int_t iHit=0; iHit<5; iHit++) { allData[i][iHit]= start->GetData(i,iHit); - if (allData[i][iHit] != 0) cout<<"event"<AddHexagon(x, y, r.Uniform(-0.1, 0.1), 1.0); - raw_a->QuadValue(start->GetData(i+37,0)-start->GetData(0,0)); - raw_c->AddHexagon(x, y, r.Uniform(-0.1, 0.1), 1.0); - raw_c->QuadValue(start->GetData(i+25,0)-start->GetData(0,0)); + rawA->AddHexagon(x, y, r.Uniform(-0.1, 0.1), 1.0); + rawA->QuadValue(start->GetData(i+37,0)-start->GetData(0,0)); + rawC->AddHexagon(x, y, r.Uniform(-0.1, 0.1), 1.0); + rawC->QuadValue(start->GetData(i+25,0)-start->GetData(0,0)); } + rawA->RefitPlex(); + rawC->RefitPlex(); - raw_a->RefitPlex(); - raw_c->RefitPlex(); - - TEveTrans& ta_a = raw_a->RefHMTrans(); - ta_a.SetPos(0, 0, 373); - TEveTrans& tc_c = raw_c->RefHMTrans(); - tc_c.SetPos(0, 0, -69.7); + TEveTrans& taA = rawA->RefMainTrans(); + taA.SetPos(0, 0, 373); + TEveTrans& tcC = rawC->RefMainTrans(); + tcC.SetPos(0, 0, -69.7); - gEve->AddElement(raw_a); - gEve->AddElement(raw_c); + gEve->AddElement(rawA); + gEve->AddElement(rawC); gEve->Redraw3D(); } /******************************************************************************/ + void AliEveT0Module::MakeModules(AliT0digit *digits) { + // Make modules for digits. + TRandom r(0); - TArrayI ADC(24); - TArrayI TDC(24); + TArrayI adc(24); + TArrayI tdc(24); - digits->GetQT1(ADC); - digits->GetTimeCFD(TDC); + digits->GetQT1(adc); + digits->GetTimeCFD(tdc); // printf("%3d\n",besttimeright); for (Int_t i=0;i<24; i++){ - printf("%3d %3d\n ",ADC[i], TDC[i]); + printf("%3d %3d\n ",adc[i], tdc[i]); } TEveRGBAPalette* adcPalette = new TEveRGBAPalette(5, 1024); @@ -132,26 +135,24 @@ void AliEveT0Module::MakeModules(AliT0digit *digits) qat->Reset(TEveQuadSet::kQT_HexagonXY, kFALSE, 32); qct->Reset(TEveQuadSet::kQT_HexagonXY, kFALSE, 32); - - for (Int_t i=0; i<12; i++) { Float_t x = 6.5 * TMath::Sin(i * angle); Float_t y = 6.5 * TMath::Cos(i * angle); qa->AddHexagon(x, y, r.Uniform(-0.1, 0.1), 1.0); - qa->QuadValue(ADC[i+12]); + qa->QuadValue(adc[i+12]); // qa->QuadId(new TNamed(Form("PMT with idx=%d", i), "PMT's aplitude in side A.")); qat->AddHexagon(x, y, r.Uniform(-0.1, 0.1), 1.0); - qat->QuadValue(TDC[i+12]); + qat->QuadValue(tdc[i+12]); // qat->QuadId(new TNamed(Form("Quad with idx=%d", i), "PMT's time in side A.")); qc->AddHexagon(x, y, r.Uniform(-0.1, 0.1), 1.0); - qc->QuadValue(ADC[i]); + qc->QuadValue(adc[i]); // qc->QuadId(new TNamed(Form("Quad with idx=%d", i), "PMT's amplitude in side C.")); qct->AddHexagon(x, y, r.Uniform(-0.1, 0.1), 1.0); - qct->QuadValue(TDC[i]); + qct->QuadValue(tdc[i]); // qct->QuadId(new TNamed(Form("Quad with idx=%d", i), "PMT's time in side C.")); } @@ -160,14 +161,14 @@ void AliEveT0Module::MakeModules(AliT0digit *digits) qat->RefitPlex(); qct->RefitPlex(); - TEveTrans& ta = qa->RefHMTrans(); + TEveTrans& ta = qa->RefMainTrans(); ta.SetPos(0, 0, 373); - TEveTrans& tc = qc->RefHMTrans(); + TEveTrans& tc = qc->RefMainTrans(); tc.SetPos(0, 0, -69.7); - TEveTrans& tat = qat->RefHMTrans(); + TEveTrans& tat = qat->RefMainTrans(); tat.SetPos(0, 0, 373); - TEveTrans& tct = qct->RefHMTrans(); + TEveTrans& tct = qct->RefMainTrans(); tct.SetPos(0, 0, -69.7); gEve->AddElement(qa); diff --git a/EVE/EveDet/AliEveT0Module.h b/EVE/EveDet/AliEveT0Module.h index 347a376c5c2..0f6d65456ae 100644 --- a/EVE/EveDet/AliEveT0Module.h +++ b/EVE/EveDet/AliEveT0Module.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_T0Module_H -#define ALIEVE_T0Module_H +#ifndef AliEveT0Module_H +#define AliEveT0Module_H ////////////////////////////////////////////////////////////////////////// // // @@ -15,22 +15,21 @@ // // ////////////////////////////////////////////////////////////////////////// - #include -#include -#include +class AliT0digit; +class AliT0RawReader; +class TTree; class AliEveT0Module : public TEveQuadSet { - +private: AliEveT0Module(const AliEveT0Module&); AliEveT0Module& operator=(const AliEveT0Module&); public: - AliEveT0Module(const Text_t* n="AliEveT0Module", Int_t sigType=0, AliT0digit *digits=0,AliT0RawReader *start=0); - virtual ~AliEveT0Module(); + virtual ~AliEveT0Module() {} virtual void DigitSelected(Int_t idx); @@ -40,20 +39,10 @@ public: protected: Int_t fSigType; // 0 ~ ADC, 1 ~ TDC - AliT0digit *fDigits; - AliT0RawReader *fStart; + AliT0digit *fDigits; // Digits. + AliT0RawReader *fStart; // Reader. - ClassDef(AliEveT0Module,1); + ClassDef(AliEveT0Module, 0); }; -/* - class T0ModuleTDC : public AliEveT0Module - { - public: - // constructor - - virtual void QuadSelected(Int_t idx); - }; -*/ - #endif diff --git a/EVE/EveDet/AliEveTOFDigitsInfo.cxx b/EVE/EveDet/AliEveTOFDigitsInfo.cxx index 02b33b19a90..526a004d7fd 100644 --- a/EVE/EveDet/AliEveTOFDigitsInfo.cxx +++ b/EVE/EveDet/AliEveTOFDigitsInfo.cxx @@ -48,7 +48,7 @@ AliEveTOFDigitsInfo:: ~AliEveTOFDigitsInfo() void AliEveTOFDigitsInfo::SetTree(TTree* tree) { - static const TEveException eH("AliEveTOFDigitsInfo::SetTree "); + static const TEveException kEH("AliEveTOFDigitsInfo::SetTree "); if(fGeom == 0) { fGeom = new AliTOFGeometry(); diff --git a/EVE/EveDet/AliEveTOFDigitsInfo.h b/EVE/EveDet/AliEveTOFDigitsInfo.h index 1bbcfe6a083..583a5ae3b2b 100644 --- a/EVE/EveDet/AliEveTOFDigitsInfo.h +++ b/EVE/EveDet/AliEveTOFDigitsInfo.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TOFDigitsInfo_H -#define ALIEVE_TOFDigitsInfo_H +#ifndef AliEveTOFDigitsInfo_H +#define AliEveTOFDigitsInfo_H #include diff --git a/EVE/EveDet/AliEveTOFDigitsInfoEditor.h b/EVE/EveDet/AliEveTOFDigitsInfoEditor.h index 42fb75545a9..a2113402314 100644 --- a/EVE/EveDet/AliEveTOFDigitsInfoEditor.h +++ b/EVE/EveDet/AliEveTOFDigitsInfoEditor.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TOFDigitsInfoEditor_H -#define ALIEVE_TOFDigitsInfoEditor_H +#ifndef AliEveTOFDigitsInfoEditor_H +#define AliEveTOFDigitsInfoEditor_H #include diff --git a/EVE/EveDet/AliEveTOFSector.cxx b/EVE/EveDet/AliEveTOFSector.cxx index 2b758ebe7f2..ad8edb14fd9 100644 --- a/EVE/EveDet/AliEveTOFSector.cxx +++ b/EVE/EveDet/AliEveTOFSector.cxx @@ -8,11 +8,11 @@ **************************************************************************/ #include "AliEveTOFSector.h" -#include - #include #include +#include +#include #include Bool_t AliEveTOFSector::fgStaticInitDone = kFALSE; @@ -324,7 +324,8 @@ void AliEveTOFSector::LoadQuads() /* ************************************************************ */ void AliEveTOFSector::SetTrans() { - fHMTrans.UnitTrans(); + InitMainTrans(); + TEveTrans& t = RefMainTrans(); //Int_t det[5] = {fSector, -1, -1, -1, -1}; Char_t path[100]; @@ -339,11 +340,10 @@ 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); } //----------------------------------------------------- diff --git a/EVE/EveDet/AliEveTOFSector.h b/EVE/EveDet/AliEveTOFSector.h index 5980b7ea419..b60f35874a3 100644 --- a/EVE/EveDet/AliEveTOFSector.h +++ b/EVE/EveDet/AliEveTOFSector.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TOFSector_H -#define ALIEVE_TOFSector_H +#ifndef AliEveTOFSector_H +#define AliEveTOFSector_H #include #include diff --git a/EVE/EveDet/AliEveTOFSectorEditor.h b/EVE/EveDet/AliEveTOFSectorEditor.h index 5eea098f176..9912ceb83bd 100644 --- a/EVE/EveDet/AliEveTOFSectorEditor.h +++ b/EVE/EveDet/AliEveTOFSectorEditor.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TOFSectorEditor_H -#define ALIEVE_TOFSectorEditor_H +#ifndef AliEveTOFSectorEditor_H +#define AliEveTOFSectorEditor_H #include diff --git a/EVE/EveDet/AliEveTOFStrip.cxx b/EVE/EveDet/AliEveTOFStrip.cxx index 342122204b0..3b2fdd5439f 100644 --- a/EVE/EveDet/AliEveTOFStrip.cxx +++ b/EVE/EveDet/AliEveTOFStrip.cxx @@ -190,32 +190,13 @@ void AliEveTOFStrip::LoadQuads() /* ************************************************************ */ void AliEveTOFStrip::SetTrans() { - - fHMTrans.UnitTrans(); - //Int_t det[5] = {fSector, fPlate, fStrip, -1, -1}; Char_t path[100]; //fTOFgeometry->GetVolumePath(det,path); fTOFgeometry->GetVolumePath(fSector, fPlate, fStrip, path); fGeoManager->cd(path); - TGeoHMatrix global = *fGeoManager->GetCurrentMatrix(); - Double_t *rotMat = global.GetRotationMatrix(); - - /* - // ok till 19 April 2007 - fHMTrans.SetBaseVec(1, rotMat[0], rotMat[1], rotMat[2]); - fHMTrans.SetBaseVec(2, rotMat[3], rotMat[4], rotMat[5]); - fHMTrans.SetBaseVec(3, rotMat[6], rotMat[7], rotMat[8]); - */ - - 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]); - - Double_t *tr = global.GetTranslation(); - fHMTrans.SetBaseVec(4, tr); - + SetTransMatrix(*fGeoManager->GetCurrentMatrix()); } /******************************************************************************/ diff --git a/EVE/EveDet/AliEveTOFStrip.h b/EVE/EveDet/AliEveTOFStrip.h index 7819e40ed30..eb8a48509b2 100644 --- a/EVE/EveDet/AliEveTOFStrip.h +++ b/EVE/EveDet/AliEveTOFStrip.h @@ -6,8 +6,8 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TOFStrip_H -#define ALIEVE_TOFStrip_H +#ifndef AliEveTOFStrip_H +#define AliEveTOFStrip_H #include #include diff --git a/EVE/EveDet/AliEveTOFStripEditor.h b/EVE/EveDet/AliEveTOFStripEditor.h index cfd2f4f4a3f..c4c42a06e23 100644 --- a/EVE/EveDet/AliEveTOFStripEditor.h +++ b/EVE/EveDet/AliEveTOFStripEditor.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TOFStripEditor_H -#define ALIEVE_TOFStripEditor_H +#ifndef AliEveTOFStripEditor_H +#define AliEveTOFStripEditor_H #include diff --git a/EVE/EveDet/AliEveTPCData.cxx b/EVE/EveDet/AliEveTPCData.cxx index 0986d6fbec3..4442e484465 100644 --- a/EVE/EveDet/AliEveTPCData.cxx +++ b/EVE/EveDet/AliEveTPCData.cxx @@ -16,6 +16,10 @@ #include #include +//============================================================================== +//============================================================================== +// AliEveTPCData +//============================================================================== //______________________________________________________________________________ // @@ -170,7 +174,7 @@ void AliEveTPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t // via CreateSector() are loaded. // If spawnSectors is true sectors are created if data for them is encountered. - static const TEveException eH("AliEveTPCData::LoadRaw "); + static const TEveException kEH("AliEveTPCData::LoadRaw "); Int_t sector = -1, row = -1, pad = -1, rowOffset = 0; Short_t time, signal; @@ -209,7 +213,7 @@ void AliEveTPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t if (pad >= AliEveTPCSectorData::GetNPadsInRow(row)) { if (warn) { - Warning(eH.Data(), "pad out of range (row=%d, pad=%d, maxpad=%d).", + Warning(kEH.Data(), "pad out of range (row=%d, pad=%d, maxpad=%d).", row, pad, AliEveTPCSectorData::GetNPadsInRow(row)); } continue; @@ -232,7 +236,7 @@ void AliEveTPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t if (time >= lastTime) { if (lastTimeWarn == kFALSE) { if (warn) - Warning(eH.Data(), "time out of order (row=%d, pad=%d, time=%d, lastTime=%d).", + Warning(kEH.Data(), "time out of order (row=%d, pad=%d, time=%d, lastTime=%d).", row, pad, time, lastTime); lastTimeWarn = kTRUE; } diff --git a/EVE/EveDet/AliEveTPCData.h b/EVE/EveDet/AliEveTPCData.h index 9f9e548f840..d8eff5025ef 100644 --- a/EVE/EveDet/AliEveTPCData.h +++ b/EVE/EveDet/AliEveTPCData.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCData_H -#define ALIEVE_TPCData_H +#ifndef AliEveTPCData_H +#define AliEveTPCData_H #include @@ -20,11 +20,19 @@ class TTree; class AliTPCRawStream; class AliTPCRawStreamOld; - class AliEveTPCSectorData; +//------------------------------------------------------------------------------ +// AliEveTPCData +// +// Container for TPC data for all sectors. + class AliEveTPCData : public TObject, public TEveRefCnt { +private: + AliEveTPCData(const AliEveTPCData&); // Not implemented + AliEveTPCData& operator=(const AliEveTPCData&); // Not implemented + protected: std::vector fSectors; // Vector of sector-data. Int_t fSectorBlockSize; // Block-size of sector-data. diff --git a/EVE/EveDet/AliEveTPCLoader.cxx b/EVE/EveDet/AliEveTPCLoader.cxx index 6775c66349f..28f80d35175 100644 --- a/EVE/EveDet/AliEveTPCLoader.cxx +++ b/EVE/EveDet/AliEveTPCLoader.cxx @@ -19,6 +19,10 @@ #include +//============================================================================== +//============================================================================== +// AliEveTPCLoader +//============================================================================== //______________________________________________________________________________ // @@ -101,10 +105,10 @@ void AliEveTPCLoader::OpenFile() // First event is loaded and all sectors for which the data-exists // are created. - static const TEveException eH("AliEveTPCLoader::OpenFile "); + static const TEveException kEH("AliEveTPCLoader::OpenFile "); if (gSystem->AccessPathName(fFile, kReadPermission)) - throw(eH + "can not read '" + fFile + "'."); + throw(kEH + "can not read '" + fFile + "'."); fData->DeleteAllSectors(); @@ -126,10 +130,10 @@ void AliEveTPCLoader::LoadEvent() { // Load an event. - static const TEveException eH("AliEveTPCLoader::LoadEvent "); + static const TEveException kEH("AliEveTPCLoader::LoadEvent "); if (fReader == 0) - throw(eH + "data file not opened."); + throw(kEH + "data file not opened."); printf("Now loading event %d\n", fEvent); fReader->Reset(); @@ -147,23 +151,23 @@ void AliEveTPCLoader::NextEvent(Bool_t rewindOnEnd) // When the last event is reached and rewindOnEnd is true, the file // is rewound back to the first event. Otherwise an exception is thrown. - static const TEveException eH("AliEveTPCLoader::NextEvent "); + static const TEveException kEH("AliEveTPCLoader::NextEvent "); if (fReader == 0) - throw(eH + "data file not opened."); + throw(kEH + "data file not opened."); if (fReader->NextEvent() == kTRUE) { ++fEvent; } else { if (fEvent == -1) - throw(eH + "no events available."); + throw(kEH + "no events available."); if (rewindOnEnd) { printf("Reached end of stream (event=%d), rewinding to first event.\n", fEvent); fReader->RewindEvents(); fReader->NextEvent(); fEvent = 0; } else { - throw(eH + "last event reached."); + throw(kEH + "last event reached."); } } } @@ -172,10 +176,10 @@ void AliEveTPCLoader::GotoEvent(Int_t event) { // Go to specified event. - static const TEveException eH("AliEveTPCLoader::GotoEvent "); + static const TEveException kEH("AliEveTPCLoader::GotoEvent "); if (fReader == 0) - throw(eH + "data file not opened."); + throw(kEH + "data file not opened."); if (event == fEvent) return; diff --git a/EVE/EveDet/AliEveTPCLoader.h b/EVE/EveDet/AliEveTPCLoader.h index 577e2b3f359..448fe31b353 100644 --- a/EVE/EveDet/AliEveTPCLoader.h +++ b/EVE/EveDet/AliEveTPCLoader.h @@ -7,19 +7,24 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCLoader_H -#define ALIEVE_TPCLoader_H +#ifndef AliEveTPCLoader_H +#define AliEveTPCLoader_H #include #include class AliRawReaderRoot; - class AliEveTPCData; class AliEveTPCSector2D; class AliEveTPCSector3D; +//------------------------------------------------------------------------------ +// AliEveTPCLoader +// +// GUI front-end for loading and displaying of TPC data in a stand-alone mode. +// + class AliEveTPCLoader : public TEveElementList { friend class AliEveTPCLoaderEditor; diff --git a/EVE/EveDet/AliEveTPCLoaderEditor.cxx b/EVE/EveDet/AliEveTPCLoaderEditor.cxx index 05c56b325b4..ba7ccfd66d5 100644 --- a/EVE/EveDet/AliEveTPCLoaderEditor.cxx +++ b/EVE/EveDet/AliEveTPCLoaderEditor.cxx @@ -194,22 +194,20 @@ void AliEveTPCLoaderEditor::SetModel(TObject* obj) /******************************************************************************/ /******************************************************************************/ -namespace { -const char *tpcfiletypes[] = { +void AliEveTPCLoaderEditor::FileSelect() +{ + // Slot for FileSelect. + + static const char *kTPCFileTypes[] = { "Root files", "*.root", "All files", "*.*", 0, 0 }; -} - -void AliEveTPCLoaderEditor::FileSelect() -{ - // Slot for FileSelect. TGFileInfo fi; fi.fIniDir = StrDup(gSystem->DirName (fM->fFile)); fi.fFilename = StrDup(gSystem->BaseName(fM->fFile)); - fi.fFileTypes = tpcfiletypes; + fi.fFileTypes = kTPCFileTypes; new TGFileDialog(fClient->GetRoot(), gEve->GetMainWindow(), kFDOpen, &fi); if (!fi.fFilename) diff --git a/EVE/EveDet/AliEveTPCLoaderEditor.h b/EVE/EveDet/AliEveTPCLoaderEditor.h index 4a5513b208f..37a1258da64 100644 --- a/EVE/EveDet/AliEveTPCLoaderEditor.h +++ b/EVE/EveDet/AliEveTPCLoaderEditor.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCLoaderEditor_H -#define ALIEVE_TPCLoaderEditor_H +#ifndef AliEveTPCLoaderEditor_H +#define AliEveTPCLoaderEditor_H #include @@ -20,9 +20,14 @@ class TGTextEntry; class TEveGValuator; - class AliEveTPCLoader; +//------------------------------------------------------------------------------ +// AliEveTPCLoaderEditor +// +// GUI editor for AliEveTPCLoader. +// + class AliEveTPCLoaderEditor : public TGedFrame { AliEveTPCLoaderEditor(const AliEveTPCLoaderEditor&); // Not implemented @@ -50,7 +55,7 @@ protected: public: AliEveTPCLoaderEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - ~AliEveTPCLoaderEditor() {} + virtual ~AliEveTPCLoaderEditor() {} virtual void SetModel(TObject* obj); @@ -71,6 +76,6 @@ public: void DoDeleteSectors3D(); ClassDef(AliEveTPCLoaderEditor, 0); // Editor for AliEveTPCLoader. -}; // endclass AliEveTPCLoaderEditor +}; #endif diff --git a/EVE/EveDet/AliEveTPCSector2D.cxx b/EVE/EveDet/AliEveTPCSector2D.cxx index aed7fbca0f0..ec8c12d13ba 100644 --- a/EVE/EveDet/AliEveTPCSector2D.cxx +++ b/EVE/EveDet/AliEveTPCSector2D.cxx @@ -10,12 +10,9 @@ #include "AliEveTPCSector2D.h" #include "AliEveTPCSector3D.h" -#include #include -#include - -#include +#include #include #include @@ -26,10 +23,12 @@ #include #include -using namespace std; +//============================================================================== +//============================================================================== +// AliEveTPCSector2D +//============================================================================== //______________________________________________________________________________ -// AliEveTPCSector2D // // Displays TPC raw-data in 2D. // @@ -70,8 +69,8 @@ void AliEveTPCSector2D::MakeSector3D() s->SetSectorID(fSectorID); s->SetAutoTrans(fAutoTrans); s->CopyVizParams(*this); - gEve->AddElement(s, this); - gEve->Redraw3D(); + AddElement(s); + ElementChanged(kFALSE, kTRUE); } /******************************************************************************/ @@ -170,7 +169,7 @@ void AliEveTPCSector2D::Paint(Option_t* ) buffer.fID = this; buffer.fColor = 1; buffer.fTransparency = 0; - fHMTrans.SetBuffer3D(buffer); + if (HasMainTrans()) RefMainTrans().SetBuffer3D(buffer); buffer.SetSectionsValid(TBuffer3D::kCore); Int_t reqSections = gPad->GetViewer3D()->AddObject(buffer); diff --git a/EVE/EveDet/AliEveTPCSector2D.h b/EVE/EveDet/AliEveTPCSector2D.h index 82b401f9380..84befedbbda 100644 --- a/EVE/EveDet/AliEveTPCSector2D.h +++ b/EVE/EveDet/AliEveTPCSector2D.h @@ -7,15 +7,19 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCSector2D_H -#define ALIEVE_TPCSector2D_H +#ifndef AliEveTPCSector2D_H +#define AliEveTPCSector2D_H #include "AliEveTPCSectorViz.h" - class AliEveTPCSector2DEditor; class AliEveTPCSector2DGL; +//------------------------------------------------------------------------------ +// AliEveTPCSector2D +// +// Visualization of TPC raw-data in 2D. + class AliEveTPCSector2D : public AliEveTPCSectorViz { friend class AliEveTPCSector2DGL; diff --git a/EVE/EveDet/AliEveTPCSector2DEditor.h b/EVE/EveDet/AliEveTPCSector2DEditor.h index f0527e2fb59..a2e6bf75b77 100644 --- a/EVE/EveDet/AliEveTPCSector2DEditor.h +++ b/EVE/EveDet/AliEveTPCSector2DEditor.h @@ -7,17 +7,22 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCSector2DEditor_H -#define ALIEVE_TPCSector2DEditor_H +#ifndef AliEveTPCSector2DEditor_H +#define AliEveTPCSector2DEditor_H #include class TGCheckButton; class TGComboBox; - class AliEveTPCSector2D; +//------------------------------------------------------------------------------ +// AliEveTPCSector2DEditor +// +// GUI editor for AliEveTPCSector2D. +// + class AliEveTPCSector2DEditor : public TGedFrame { AliEveTPCSector2DEditor(const AliEveTPCSector2DEditor&); // Not implemented @@ -36,7 +41,7 @@ protected: public: AliEveTPCSector2DEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - ~AliEveTPCSector2DEditor() {} + virtual ~AliEveTPCSector2DEditor() {} virtual void SetModel(TObject* obj); @@ -49,6 +54,6 @@ public: void DoPickMode(Int_t mode); ClassDef(AliEveTPCSector2DEditor, 0); // Editor for AliEveTPCSector2D. -}; // endclass AliEveTPCSector2DEditor +}; #endif diff --git a/EVE/EveDet/AliEveTPCSector2DGL.cxx b/EVE/EveDet/AliEveTPCSector2DGL.cxx index 28346e64546..c7c0dafb8a9 100644 --- a/EVE/EveDet/AliEveTPCSector2DGL.cxx +++ b/EVE/EveDet/AliEveTPCSector2DGL.cxx @@ -9,7 +9,7 @@ #include "AliEveTPCSector2DGL.h" -#include +#include #include #include @@ -17,7 +17,7 @@ //______________________________________________________________________________ // -// GL renderer for TPCSector2D. +// GL renderer for AliEveTPCSector2D. ClassImp(AliEveTPCSector2DGL) @@ -106,8 +106,6 @@ void AliEveTPCSector2DGL::DirectDraw(TGLRnrCtx& rnrCtx) const GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT); glDisable(GL_LIGHTING); - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glEnable(GL_COLOR_MATERIAL); glDisable(GL_CULL_FACE); // Display digits @@ -162,7 +160,7 @@ void AliEveTPCSector2DGL::DirectDraw(TGLRnrCtx& rnrCtx) const /******************************************************************************/ void AliEveTPCSector2DGL::LoadPadrow(AliEveTPCSectorData::RowIterator& iter, - Int_t row, Int_t col_off) const + Int_t row, Int_t colOff) const { // Load data for one pad-row into the texture. @@ -173,7 +171,7 @@ void AliEveTPCSector2DGL::LoadPadrow(AliEveTPCSectorData::RowIterator& iter, Int_t maxTime = fSector->fMaxTime; Bool_t halfBorderTime = ((maxTime - minTime) % 2 == 0); - UChar_t* img_pos = GetRowCol(row, col_off); + UChar_t* imgPos = GetRowCol(row, colOff); while (iter.NextPad()) { padVal = 0; @@ -201,8 +199,8 @@ void AliEveTPCSector2DGL::LoadPadrow(AliEveTPCSectorData::RowIterator& iter, } padVal = TMath::Min(padVal, fSector->fMaxVal); if(padVal > fSector->fThreshold) - fSector->ColorFromArray(padVal, img_pos); - img_pos += 4; + fSector->ColorFromArray(padVal, imgPos); + imgPos += 4; } } @@ -231,11 +229,13 @@ void AliEveTPCSector2DGL::CreateTexture() const fSector->SetupColorArray(); // Loop over 3 main segments - for (Int_t sId = 0; sId <= 2; ++sId) { - if(isOn[sId] == kFALSE) + for (Int_t sId = 0; sId <= 2; ++sId) + { + if (isOn[sId] == kFALSE) continue; const AliEveTPCSectorData::SegmentInfo& sInfo = AliEveTPCSectorData::GetSeg(sId); - for (Int_t row=sInfo.GetFirstRow(); row<=sInfo.GetLastRow(); ++row) { + for (Int_t row = sInfo.GetFirstRow(); row <= sInfo.GetLastRow(); ++row) + { AliEveTPCSectorData::RowIterator i = fSectorData->MakeRowIterator(row); Int_t offset = (sInfo.GetNMaxPads() - AliEveTPCSectorData::GetNPadsInRow(row))/2; LoadPadrow(i, row + rowOff[sId], offset + colOff[sId]); @@ -286,28 +286,31 @@ void AliEveTPCSector2DGL::DisplayQuads(const AliEveTPCSectorData::SegmentInfo& s { // Display segment data by rendering one quad per pad. - Float_t y_d, y_u; - Float_t x_off, x; + Float_t yD, yU; + Float_t xOff, x; Float_t padW = seg.GetPadWidth(); Float_t padH = seg.GetPadHeight(); glBegin(GL_QUADS); - for (Int_t row=0; rowfPickEmpty) { + for (Int_t pad = deltaPad; pad < maxPad; pad++, pix+=4) + { + x = xOff + pad*padW; + if (pix[3] != 0 || fSector->fPickEmpty) + { glLoadName(pad - deltaPad); glBegin(GL_QUADS); - glVertex2f(x+padW, y_d); - glVertex2f(x, y_d); - glVertex2f(x, y_u); - glVertex2f(x+padW, y_u); + glVertex2f(x+padW, yD); + glVertex2f(x, yD); + glVertex2f(x, yU); + glVertex2f(x+padW, yU); glEnd(); } } @@ -364,7 +370,8 @@ void AliEveTPCSector2DGL::TraceStepsUp(const AliEveTPCSectorData::SegmentInfo& s Float_t x = -(s.GetNMaxPads()*1.0/2 - s.GetNYSteps())*s.GetPadWidth(); Float_t y = s.GetRLow(); glVertex2f(x, y); - for (Int_t i=0; i=0; --i) { + for (Int_t i = s.GetNYSteps() - 1; i >= 0; --i) + { y = s.GetYStep(i); glVertex2f(x, y); x -= s.GetPadWidth(); @@ -396,23 +404,24 @@ void AliEveTPCSector2DGL::DisplayFrame() const // Display frame of the sector. // Each segment's frame is drawn only if its data is drawn, too. - UChar_t col[4]; - TEveUtil::TEveUtil::ColorFromIdx(fSector->fFrameColor, col); - glColor4ubv(col); + TGLUtil::Color(fSector->fFrameColor); - if(fSector->fRnrInn) { + if(fSector->fRnrInn) + { glBegin(GL_POLYGON); TraceStepsUp (AliEveTPCSectorData::GetInnSeg()); TraceStepsDown(AliEveTPCSectorData::GetInnSeg()); glEnd(); } - if(fSector->fRnrOut1) { + if(fSector->fRnrOut1) + { glBegin(GL_POLYGON); TraceStepsUp (AliEveTPCSectorData::GetOut1Seg()); TraceStepsDown(AliEveTPCSectorData::GetOut1Seg()); glEnd(); } - if(fSector->fRnrOut2) { + if(fSector->fRnrOut2) + { glBegin(GL_POLYGON); TraceStepsUp (AliEveTPCSectorData::GetOut2Seg()); TraceStepsDown(AliEveTPCSectorData::GetOut2Seg()); diff --git a/EVE/EveDet/AliEveTPCSector2DGL.h b/EVE/EveDet/AliEveTPCSector2DGL.h index aac4387669f..c191a4e7e08 100644 --- a/EVE/EveDet/AliEveTPCSector2DGL.h +++ b/EVE/EveDet/AliEveTPCSector2DGL.h @@ -7,17 +7,21 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCSector2DGL_H -#define ALIEVE_TPCSector2DGL_H +#ifndef AliEveTPCSector2DGL_H +#define AliEveTPCSector2DGL_H #include - -#include -#include - class TGLViewer; class TGLScene; +#include +class AliEveTPCSector2D; + +//------------------------------------------------------------------------------ +// AliEveTPCSector2DGL +// +// GL renderer for AliEveTPCSector2D. +// class AliEveTPCSector2DGL : public TGLObject { @@ -27,7 +31,7 @@ class AliEveTPCSector2DGL : public TGLObject protected: virtual void DirectDraw(TGLRnrCtx & rnrCtx) const; - void LoadPadrow(AliEveTPCSectorData::RowIterator& iter, Int_t row, Int_t off) const; + void LoadPadrow(AliEveTPCSectorData::RowIterator& iter, Int_t row, Int_t colOff) const; void CreateTexture() const; void DisplayTexture(const AliEveTPCSectorData::SegmentInfo& seg, @@ -47,6 +51,10 @@ protected: mutable UInt_t fTexture; // Texture id. mutable UInt_t fRTS; // Render time-stamp. + static const Int_t fgkTextureWidth; // Width of the texture. + static const Int_t fgkTextureHeight; // Height of the texture. + static const Int_t fgkTextureByteSize; // Size of the texture in bytes. + public: AliEveTPCSector2DGL(); virtual ~AliEveTPCSector2DGL(); @@ -60,11 +68,7 @@ public: static void TraceStepsUp (const AliEveTPCSectorData::SegmentInfo& s); static void TraceStepsDown(const AliEveTPCSectorData::SegmentInfo& s); - static const Int_t fgkTextureWidth; // Width of the texture. - static const Int_t fgkTextureHeight; // Height of the texture. - static const Int_t fgkTextureByteSize; // Size of the texture in bytes. - - ClassDef(AliEveTPCSector2DGL, 0); // GL renderer for TPCSector2D. + ClassDef(AliEveTPCSector2DGL, 0); // GL renderer for AliEveTPCSector2D. }; diff --git a/EVE/EveDet/AliEveTPCSector3D.cxx b/EVE/EveDet/AliEveTPCSector3D.cxx index dfb94e162e1..3b5cb59543d 100644 --- a/EVE/EveDet/AliEveTPCSector3D.cxx +++ b/EVE/EveDet/AliEveTPCSector3D.cxx @@ -10,14 +10,19 @@ #include "AliEveTPCSector3D.h" #include +#include + #include #include #include #include #include -#include +//============================================================================== +//============================================================================== +// AliEveTPCSector3D +//============================================================================== //______________________________________________________________________________ // @@ -93,7 +98,7 @@ void AliEveTPCSector3D::Paint(Option_t* /*option*/) buffer.fID = this; buffer.fColor = 1; buffer.fTransparency = 0; - fHMTrans.SetBuffer3D(buffer); + if (HasMainTrans()) RefMainTrans().SetBuffer3D(buffer); buffer.SetSectionsValid(TBuffer3D::kCore); Int_t reqSections = gPad->GetViewer3D()->AddObject(buffer); @@ -191,7 +196,7 @@ void AliEveTPCSector3D::SetupPointSetArray() fPointSetOn = kTRUE; fPointSetMaxVal = fThreshold + (Int_t) TMath::Nint(fPointFrac*(fMaxVal - fThreshold)); // printf("SetupPointSetArray frac=%f nbins=%d psmv=%d (%d,%d)\n", fPointFrac, nBins, fPointSetMaxVal, fThreshold, fMaxVal); - fPointSetArray.InitBins("", nBins, fThreshold, fPointSetMaxVal, kFALSE); + fPointSetArray.InitBins("", nBins, fThreshold, fPointSetMaxVal); for (Int_t b=0; bSetMarkerColor(gStyle->GetColorPalette(b)); } diff --git a/EVE/EveDet/AliEveTPCSector3D.h b/EVE/EveDet/AliEveTPCSector3D.h index a46f5a7a8e9..8500a495107 100644 --- a/EVE/EveDet/AliEveTPCSector3D.h +++ b/EVE/EveDet/AliEveTPCSector3D.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCSector3D_H -#define ALIEVE_TPCSector3D_H +#ifndef AliEveTPCSector3D_H +#define AliEveTPCSector3D_H #include #include @@ -16,6 +16,10 @@ #include #include +//------------------------------------------------------------------------------ +// AliEveTPCSector3D +// +// Visualization of TPC raw-data in 3D. class AliEveTPCSector3D : public AliEveTPCSectorViz { diff --git a/EVE/EveDet/AliEveTPCSector3DEditor.cxx b/EVE/EveDet/AliEveTPCSector3DEditor.cxx index 5f83c8c6a53..fdeaa760148 100644 --- a/EVE/EveDet/AliEveTPCSector3DEditor.cxx +++ b/EVE/EveDet/AliEveTPCSector3DEditor.cxx @@ -12,16 +12,9 @@ #include -#include -#include - -#include #include #include -#include #include -#include - //______________________________________________________________________________ // diff --git a/EVE/EveDet/AliEveTPCSector3DEditor.h b/EVE/EveDet/AliEveTPCSector3DEditor.h index e33d4c380fc..3afed2a2d0c 100644 --- a/EVE/EveDet/AliEveTPCSector3DEditor.h +++ b/EVE/EveDet/AliEveTPCSector3DEditor.h @@ -7,10 +7,10 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCSector3DEditor_H -#define ALIEVE_TPCSector3DEditor_H +#ifndef AliEveTPCSector3DEditor_H +#define AliEveTPCSector3DEditor_H -#include +#include class TGCheckButton; class TGNumberEntry; @@ -19,9 +19,14 @@ class TGColorSelect; class TEveGValuator; class TEveGDoubleValuator; - class AliEveTPCSector3D; +//------------------------------------------------------------------------------ +// AliEveTPCSector3DEditor +// +// Editor for AliEveTPCSector3D. +// + class AliEveTPCSector3DEditor : public TGedFrame { AliEveTPCSector3DEditor(const AliEveTPCSector3DEditor&); // Not implemented diff --git a/EVE/EveDet/AliEveTPCSector3DGL.cxx b/EVE/EveDet/AliEveTPCSector3DGL.cxx index f49e8eb54fa..94782cece26 100644 --- a/EVE/EveDet/AliEveTPCSector3DGL.cxx +++ b/EVE/EveDet/AliEveTPCSector3DGL.cxx @@ -16,7 +16,6 @@ #include #include - //______________________________________________________________________________ // // GL renderer for AliEveTPCSector3D. @@ -104,7 +103,6 @@ void AliEveTPCSector3DGL::DirectDraw(TGLRnrCtx & rnrCtx) const glPushAttrib(GL_CURRENT_BIT | GL_POINT_BIT | GL_ENABLE_BIT); glDisable(GL_LIGHTING); - UChar_t col[4]; if(hasData && fSector->fPointSetOn) { @@ -121,8 +119,7 @@ void AliEveTPCSector3DGL::DirectDraw(TGLRnrCtx & rnrCtx) const TEvePointSet* ps = psa.GetBin(b); if(ps->Size() > 0) { - TEveUtil::TEveUtil::ColorFromIdx(ps->GetMarkerColor(), col); - glColor4ubv(col); + TGLUtil::Color(ps->GetMarkerColor()); if (rnrCtx.SecSelection()) glLoadName(b + 1); glVertexPointer(3, GL_FLOAT, 0, ps->GetP()); @@ -135,8 +132,7 @@ void AliEveTPCSector3DGL::DirectDraw(TGLRnrCtx & rnrCtx) const if(fSector->fRnrFrame && ! rnrCtx.SecSelection()) { - TEveUtil::TEveUtil::ColorFromIdx(fSector->fFrameColor, col); - glColor4ubv(col); + TGLUtil::Color(fSector->fFrameColor); if(fSector->fRnrInn) DrawSegmentFrame(AliEveTPCSectorData::GetInnSeg(), 0, 2); diff --git a/EVE/EveDet/AliEveTPCSector3DGL.h b/EVE/EveDet/AliEveTPCSector3DGL.h index 007ee4ef4e2..b3b5ae298cc 100644 --- a/EVE/EveDet/AliEveTPCSector3DGL.h +++ b/EVE/EveDet/AliEveTPCSector3DGL.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCSector3DGL_H -#define ALIEVE_TPCSector3DGL_H +#ifndef AliEveTPCSector3DGL_H +#define AliEveTPCSector3DGL_H #include @@ -16,9 +16,14 @@ class TEveBoxSetGL; - class AliEveTPCSector3D; +//------------------------------------------------------------------------------ +// AliEveTPCSector3DGL +// +// GL renderer for AliEveTPCSector3D. +// + class AliEveTPCSector3DGL : public TGLObject { AliEveTPCSector3DGL(const AliEveTPCSector3DGL&); // Not implemented @@ -50,6 +55,6 @@ public: virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec); ClassDef(AliEveTPCSector3DGL, 0); // GL renderer for AliEveTPCSector3D. -}; // endclass AliEveTPCSector3DGL +}; #endif diff --git a/EVE/EveDet/AliEveTPCSectorData.cxx b/EVE/EveDet/AliEveTPCSectorData.cxx index dad3ec6a229..4d9be19041f 100644 --- a/EVE/EveDet/AliEveTPCSectorData.cxx +++ b/EVE/EveDet/AliEveTPCSectorData.cxx @@ -10,7 +10,12 @@ #include "AliEveTPCSectorData.h" #include -#include +#include + +//============================================================================== +//============================================================================== +// AliEveTPCSectorData +//============================================================================== //______________________________________________________________________________ // @@ -55,11 +60,13 @@ void AliEveTPCSectorData::InitStatics() fgRowBegs = new Int_t[fgNAllRows + 1]; Int_t row = 0; - for (Int_t i=0; iGetNRowLow(); ++i, ++row) { + for (Int_t i=0; iGetNRowLow(); ++i, ++row) + { fgRowBegs[row] = fgNAllPads; fgNAllPads += fgParam->GetNPadsLow(i); } - for (Int_t i=0; iGetNRowUp(); ++i, ++row) { + for (Int_t i=0; iGetNRowUp(); ++i, ++row) + { fgRowBegs[row] = fgNAllPads; fgNAllPads += fgParam->GetNPadsUp(i); } @@ -100,8 +107,10 @@ void AliEveTPCSectorData::InitStatics() Int_t k, npads; // Inn k=0, npads = fgParam->GetNPadsLow(0); - for (int row = 0; row < fgInnSeg.fNRows; ++row) { - if (fgParam->GetNPadsLow(row) > npads) { + for (int row = 0; row < fgInnSeg.fNRows; ++row) + { + if (fgParam->GetNPadsLow(row) > npads) + { npads = fgParam->GetNPadsLow(row); fgInnSeg.fYStep[k] = row*fgInnSeg.fPadHeight + fgInnSeg.fRLow; k++; @@ -110,8 +119,10 @@ void AliEveTPCSectorData::InitStatics() fgInnSeg.fNYSteps = k; // Out1 seg k=0; npads = fgParam->GetNPadsUp(0); - for (int row = 0; row < fgOut1Seg.fNRows; ++row) { - if (fgParam->GetNPadsUp(row) > npads) { + for (int row = 0; row < fgOut1Seg.fNRows; ++row) + { + if (fgParam->GetNPadsUp(row) > npads) + { npads = fgParam->GetNPadsUp(row); fgOut1Seg.fYStep[k] = row*fgOut1Seg.fPadHeight + fgOut1Seg.fRLow ; k++; @@ -120,8 +131,10 @@ void AliEveTPCSectorData::InitStatics() fgOut1Seg.fNYSteps = k; // Out2 seg k=0; npads = fgParam->GetNPadsUp(fgOut1Seg.fNRows); - for (int row = fgOut1Seg.fNRows; row < fgParam->GetNRowUp() ;row++ ) { - if (fgParam->GetNPadsUp(row) > npads) { + for (int row = fgOut1Seg.fNRows; row < fgParam->GetNRowUp() ;row++ ) + { + if (fgParam->GetNPadsUp(row) > npads) + { npads = fgParam->GetNPadsUp(row); fgOut2Seg.fYStep[k] = (row - fgOut1Seg.fNRows)*fgOut2Seg.fPadHeight + fgOut2Seg.fRLow ; k++; @@ -134,7 +147,7 @@ Int_t AliEveTPCSectorData::GetNPadsInRow(Int_t row) { // Return number of pads in given row. - if(row < 0 || row >= fgNAllRows) return 0; + if (row < 0 || row >= fgNAllRows) return 0; return fgRowBegs[row + 1] - fgRowBegs[row]; } @@ -145,7 +158,7 @@ const AliEveTPCSectorData::SegmentInfo& AliEveTPCSectorData::GetSeg(Int_t seg) static const SegmentInfo null; - if(seg < 0 || seg > 2) + if (seg < 0 || seg > 2) return null; else return *fgSegInfoPtrs[seg]; @@ -159,25 +172,25 @@ void AliEveTPCSectorData::NewBlock() { // Create new data-block. Position is set to the beginning. - fBlocks.push_back(new Short_t[fBlockSize]); + fBlocks.push_back(new Short_t[fkBlockSize]); fBlockPos = 0; } /******************************************************************************/ AliEveTPCSectorData::AliEveTPCSectorData(Int_t sector, Int_t bsize) : - fSectorID(sector), fNPadsFilled(0), fPads(), - fBlockSize(bsize), fBlockPos(0), fBlocks(), + fSectorID(sector), fNPadsFilled(0), fPads(), + fkBlockSize(bsize), fBlockPos(0), fBlocks(), fCurrentRow(0), fCurrentPad(0), fCurrentPos(0), fCurrentStep(0), fPadRowHackSet(0) { // Constructor. - if(fgParam == 0) InitStatics(); + if (fgParam == 0) InitStatics(); fPads.assign(fgNAllPads, PadData()); fBlocks.reserve(16); - fBlockPos = fBlockSize; // Enforce creation of a new block. + fBlockPos = fkBlockSize; // Enforce creation of a new block. } @@ -185,7 +198,7 @@ AliEveTPCSectorData::~AliEveTPCSectorData() { // Destructor. - for(std::vector::iterator b=fBlocks.begin(); b!=fBlocks.end(); ++b) + for (std::vector::iterator b=fBlocks.begin(); b!=fBlocks.end(); ++b) delete [] *b; DeletePadRowHack(); } @@ -195,10 +208,10 @@ void AliEveTPCSectorData::DropData() // Drop data, deallocate data-blocks. fPads.assign(fgNAllPads, PadData()); - for(std::vector::iterator b=fBlocks.begin(); b!=fBlocks.end(); ++b) + for (std::vector::iterator b=fBlocks.begin(); b!=fBlocks.end(); ++b) delete [] *b; fBlocks.clear(); - fBlockPos = fBlockSize; // Enforce creation of a new block. + fBlockPos = fkBlockSize; // Enforce creation of a new block. } /******************************************************************************/ @@ -219,7 +232,7 @@ void AliEveTPCSectorData::BeginPad(Int_t row, Int_t pad, Bool_t reverseTime) fCurrentRow = row; fCurrentPad = pad; - if(reverseTime) { + if (reverseTime) { fCurrentPos = 2046; fCurrentStep = -2; } else { @@ -255,7 +268,7 @@ void AliEveTPCSectorData::EndPad(Bool_t autoPedestal, Short_t threshold) Short_t array[1024]; Short_t* val; val = beg + 1; - while(val <= end) { + while (val <= end) { array[(val-beg)/2] = *val; val += 2; } @@ -287,7 +300,7 @@ void AliEveTPCSectorData::EndPad(Bool_t autoPedestal, Short_t threshold) Short_t t = spos[0]; while (true) { rpos += 2; - if(rpos >= end || *rpos > t + 1 || t == 0) + if (rpos >= end || *rpos > t + 1 || t == 0) break; ++t; } @@ -311,7 +324,7 @@ void AliEveTPCSectorData::EndPad(Bool_t autoPedestal, Short_t threshold) // Copy buffer to storage, set PadData if (wpos > beg) { Short_t len = wpos - beg; - if (len > fBlockSize - fBlockPos) + if (len > fkBlockSize - fBlockPos) NewBlock(); Short_t *dest = fBlocks.back() + fBlockPos; memcpy(dest, beg, len*sizeof(Short_t)); @@ -326,24 +339,24 @@ void AliEveTPCSectorData::EndPad(Bool_t autoPedestal, Short_t threshold) /******************************************************************************/ -const AliEveTPCSectorData::PadData& AliEveTPCSectorData::GetPadData(Int_t padAddr) +const AliEveTPCSectorData::PadData& AliEveTPCSectorData::GetPadData(Int_t padAddr) const { // Get pad-data reference by absolute index. - static const PadData null; + static const PadData kNull; - if(padAddr < 0 || padAddr >= fgNAllPads) return null; + if (padAddr < 0 || padAddr >= fgNAllPads) return kNull; return fPads[padAddr]; } -const AliEveTPCSectorData::PadData& AliEveTPCSectorData::GetPadData(Int_t row, Int_t pad) +const AliEveTPCSectorData::PadData& AliEveTPCSectorData::GetPadData(Int_t row, Int_t pad) const { // Get pad-data reference by row and pad number. - static const PadData null; + static const PadData kNull; Int_t np = GetNPadsInRow(row); - if(np == 0 || pad < 0 || pad >= np) return null; + if (np == 0 || pad < 0 || pad >= np) return kNull; return GetPadData(fgRowBegs[row] + pad); } @@ -366,7 +379,7 @@ AliEveTPCSectorData::RowIterator AliEveTPCSectorData::MakeRowIterator(Int_t row, // Get row iterator. Short_t npads = GetNPadsInRow(row); - if(npads > 0) + if (npads > 0) return RowIterator(&fPads[fgRowBegs[row]], npads, thr); else return RowIterator(0, 0); @@ -381,7 +394,7 @@ void AliEveTPCSectorData::PadData::Print(Option_t* /*opt*/) // Print summary information. printf("addr=%p, len=%hd>\n", (void*)fData, fLength); - for(Int_t i=0; i*hs = static_cast*>(fPadRowHackSet); std::set::iterator i = hs->find(PadRowHack(r,p)); - if(i != hs->end()) hs->erase(i); + if (i != hs->end()) hs->erase(i); } void AliEveTPCSectorData::DeletePadRowHack() diff --git a/EVE/EveDet/AliEveTPCSectorData.h b/EVE/EveDet/AliEveTPCSectorData.h index 696cf977e7a..c0544dc7747 100644 --- a/EVE/EveDet/AliEveTPCSectorData.h +++ b/EVE/EveDet/AliEveTPCSectorData.h @@ -7,10 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCSectorData_H -#define ALIEVE_TPCSectorData_H - -#include +#ifndef AliEveTPCSectorData_H +#define AliEveTPCSectorData_H #include @@ -18,6 +16,12 @@ class AliTPCParam; +//------------------------------------------------------------------------------ +// AliEveTPCSectorData +// +// Constainer for pad-data of a single TPC sector. +// Also stores relevant geometry information in static data-members. +// class AliEveTPCSectorData : public TObject { @@ -166,7 +170,7 @@ protected: std::vector fPads; // Vector of pad-data. // Blocks of pad-data. - const Int_t fBlockSize; // Size of pad-data block. + const Int_t fkBlockSize; // Size of pad-data block. Int_t fBlockPos; // Position in current block. std::vector fBlocks; // Vector of blocks. @@ -180,7 +184,7 @@ protected: Int_t fCurrentPos; // Current position in pad-buffer. Int_t fCurrentStep; // Step, can be -2 or +2, depending on fill direction. - Int_t PadIndex(Int_t row, Int_t pad) { return fgRowBegs[row] + pad; } + Int_t PadIndex(Int_t row, Int_t pad) const { return fgRowBegs[row] + pad; } public: AliEveTPCSectorData(Int_t sector, Int_t bsize=65536); @@ -194,8 +198,8 @@ public: void RegisterData(Short_t time, Short_t signal); void EndPad(Bool_t autoPedestal=kFALSE, Short_t threshold=0); - const PadData& GetPadData(Int_t padAddr); - const PadData& GetPadData(Int_t row, Int_t pad); + const PadData& GetPadData(Int_t padAddr) const; + const PadData& GetPadData(Int_t row, Int_t pad) const; PadIterator MakePadIterator(Int_t padAddr, Short_t thr=0); PadIterator MakePadIterator(Int_t row, Int_t pad, Short_t thr=0); diff --git a/EVE/EveDet/AliEveTPCSectorViz.cxx b/EVE/EveDet/AliEveTPCSectorViz.cxx index d085a8302e4..de65bb457fc 100644 --- a/EVE/EveDet/AliEveTPCSectorViz.cxx +++ b/EVE/EveDet/AliEveTPCSectorViz.cxx @@ -11,11 +11,15 @@ #include #include -#include +#include #include -#include +#include +//============================================================================== +//============================================================================== +// AliEveTPCSectorViz +//============================================================================== //______________________________________________________________________________ // @@ -44,13 +48,14 @@ AliEveTPCSectorViz::AliEveTPCSectorViz(const Text_t* n, const Text_t* t) : fFrameColor ((Color_t) 4), fRnrFrame (kTRUE), - fHMTrans (), fAutoTrans (kFALSE), fRTS (1), fColorArray (0) { // Constructor. + + InitMainTrans(); } AliEveTPCSectorViz::~AliEveTPCSectorViz() @@ -136,9 +141,8 @@ void AliEveTPCSectorViz::SetAutoTrans(Bool_t trans) // The position is calculated immediately. fAutoTrans = trans; - if (fAutoTrans) { - fHMTrans.UnitTrans(); - + if (fAutoTrans) + { using namespace TMath; Float_t c = Cos((fSectorID + 0.5)*20*Pi()/180 - PiOver2()); Float_t s = Sin((fSectorID + 0.5)*20*Pi()/180 - PiOver2()); @@ -150,15 +154,19 @@ void AliEveTPCSectorViz::SetAutoTrans(Bool_t trans) } // column major - fHMTrans[0] = -c; - fHMTrans[1] = -s; - fHMTrans[4] = -s; - fHMTrans[5] = c; - fHMTrans[10] = d; - fHMTrans[14] = z; - fHMTrans[15] = 1; + InitMainTrans(); + TEveTrans& t = RefMainTrans(); + t[0] = -c; t[1] = -s; + t[4] = -s; t[5] = c; + t[10] = d; t[14] = z; } } +void AliEveTPCSectorViz::SetUseTrans(Bool_t t) +{ + // Set flag spcifying if transformation matrix should be applied. + + RefMainTrans().SetUseTrans(t); +} /******************************************************************************/ diff --git a/EVE/EveDet/AliEveTPCSectorViz.h b/EVE/EveDet/AliEveTPCSectorViz.h index f3824ab5f97..ab2a3bf4699 100644 --- a/EVE/EveDet/AliEveTPCSectorViz.h +++ b/EVE/EveDet/AliEveTPCSectorViz.h @@ -7,23 +7,27 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCSectorViz_H -#define ALIEVE_TPCSectorViz_H +#ifndef AliEveTPCSectorViz_H +#define AliEveTPCSectorViz_H #include -#include #include #include #include - class AliEveTPCData; class AliEveTPCSectorData; class AliEveTPCSectorVizEditor; class AliEveTPCSector2D; class AliEveTPCSector2DEditor; class AliEveTPCSector2DGL; class AliEveTPCSector3D; class AliEveTPCSector3DEditor; class AliEveTPCSector3DGL; +//------------------------------------------------------------------------------ +// AliEveTPCSectorViz +// +// Base-class for visualization of data for one TPC sector. +// + class AliEveTPCSectorViz : public TEveElement, public TNamed, public TAtt3D, @@ -55,7 +59,6 @@ protected: Color_t fFrameColor; // Color of the frame, the main color. Bool_t fRnrFrame; // Render frame. - TEveTrans fHMTrans; // Transformation matrix. Bool_t fAutoTrans; // Automatically calculate transformation based on sector id. UInt_t fRTS; //! Rendering TimeStamp @@ -73,13 +76,13 @@ public: virtual void CopyVizParams(const AliEveTPCSectorViz& v); - virtual UInt_t IncRTS() { return ++fRTS; } - virtual Bool_t CanEditMainColor() { return kTRUE; } + virtual UInt_t IncRTS() { return ++fRTS; } + virtual Bool_t CanEditMainColor() const { return kTRUE; } void SetDataSource(AliEveTPCData* data); void SetSectorID(Int_t id); - AliEveTPCData* GetData() const { return fTPCData; } + AliEveTPCData* GetData() const { return fTPCData; } Int_t GetSectorID() const { return fSectorID; } AliEveTPCSectorData* GetSectorData() const; @@ -98,12 +101,12 @@ public: virtual void SetRnrFrame(Bool_t rf) { fRnrFrame = rf; IncRTS(); } void SetAutoTrans(Bool_t t); - TEveTrans& RefHMTrans() { return fHMTrans; } - void SetUseTrans(Bool_t t) { fHMTrans.SetUseTrans(t); } + void SetUseTrans(Bool_t t); ClassDef(AliEveTPCSectorViz, 1); // Base-class for visualization of data for one TPC sector. -}; // endclass AliEveTPCSectorViz +}; +//------------------------------------------------------------------------------ inline UChar_t* AliEveTPCSectorViz::ColorFromArray(Int_t val) const { diff --git a/EVE/EveDet/AliEveTPCSectorVizEditor.cxx b/EVE/EveDet/AliEveTPCSectorVizEditor.cxx index e131e9b7755..00f8bfcf958 100644 --- a/EVE/EveDet/AliEveTPCSectorVizEditor.cxx +++ b/EVE/EveDet/AliEveTPCSectorVizEditor.cxx @@ -14,12 +14,9 @@ #include #include -#include -#include #include #include -#include #include #include @@ -129,7 +126,7 @@ void AliEveTPCSectorVizEditor::SetModel(TObject* obj) fM = dynamic_cast(obj); - fHMTrans->SetModel(&fM->fHMTrans); + fHMTrans->SetModel(fM->PtrMainTrans()); fSectorID->SetValue(fM->fSectorID); fAutoTrans->SetState(fM->fAutoTrans ? kButtonDown : kButtonUp); diff --git a/EVE/EveDet/AliEveTPCSectorVizEditor.h b/EVE/EveDet/AliEveTPCSectorVizEditor.h index 2b50f96626a..09f0cdd9321 100644 --- a/EVE/EveDet/AliEveTPCSectorVizEditor.h +++ b/EVE/EveDet/AliEveTPCSectorVizEditor.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TPCSectorVizEditor_H -#define ALIEVE_TPCSectorVizEditor_H +#ifndef AliEveTPCSectorVizEditor_H +#define AliEveTPCSectorVizEditor_H #include @@ -22,9 +22,13 @@ class TEveGValuator; class TEveGDoubleValuator; class TEveTransSubEditor; - class AliEveTPCSectorViz; +//------------------------------------------------------------------------------ +// AliEveTPCSectorVizEditor +// +// Editor for AliEveTPCSectorViz. + class AliEveTPCSectorVizEditor : public TGedFrame { AliEveTPCSectorVizEditor(const AliEveTPCSectorVizEditor&); // Not implemented @@ -50,7 +54,7 @@ protected: public: AliEveTPCSectorVizEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - ~AliEveTPCSectorVizEditor() {} + virtual ~AliEveTPCSectorVizEditor() {} virtual void SetModel(TObject* obj); @@ -67,6 +71,6 @@ public: void DoTime(); ClassDef(AliEveTPCSectorVizEditor, 0); // Editor for AliEveTPCSectorViz. -}; // endclass AliEveTPCSectorVizEditor +}; #endif diff --git a/EVE/EveDet/AliEveTRDData.cxx b/EVE/EveDet/AliEveTRDData.cxx index 019bc85e12e..c40c333a3d1 100644 --- a/EVE/EveDet/AliEveTRDData.cxx +++ b/EVE/EveDet/AliEveTRDData.cxx @@ -10,7 +10,6 @@ #include "AliEveTRDData.h" #include "AliEveTRDModuleImp.h" -#include "AliLog.h" #include "AliTRDhit.h" #include "AliTRDcluster.h" #include "AliTRDcalibDB.h" @@ -29,11 +28,14 @@ ClassImp(AliEveTRDClusters) //______________________________________________________________________________ AliEveTRDDigits::AliEveTRDDigits(AliEveTRDChamber *p) : TEveQuadSet("digits", ""), fParent(p), fBoxes(), fData() -{} +{ + // Constructor. +} //______________________________________________________________________________ void AliEveTRDDigits::SetData(AliTRDdigitsManager *digits) { + // Set data source. fData.Allocate(fParent->fRowMax, fParent->fColMax, fParent->fTimeMax); // digits->Expand(); @@ -134,6 +136,8 @@ void AliEveTRDDigits::ComputeRepresentation() //______________________________________________________________________________ void AliEveTRDDigits::Paint(Option_t *option) { + // Paint the object. + if(fParent->GetDigitsBox()) fBoxes.Paint(option); else TEveQuadSet::Paint(option); } @@ -141,6 +145,8 @@ void AliEveTRDDigits::Paint(Option_t *option) //______________________________________________________________________________ void AliEveTRDDigits::Reset() { + // Reset raw and visual data. + TEveQuadSet::Reset(TEveQuadSet::kQT_FreeQuad, kTRUE, 64); // MT fBoxes.fBoxes.clear(); fData.Reset(); @@ -153,11 +159,15 @@ void AliEveTRDDigits::Reset() //______________________________________________________________________________ AliEveTRDHits::AliEveTRDHits(AliEveTRDChamber *p) : TEvePointSet("hits", 20), fParent(p) -{} +{ + // Constructor. +} //______________________________________________________________________________ void AliEveTRDHits::PointSelected(Int_t n) { + // Handle an individual point selection from GL. + fParent->SpawnEditor(); AliTRDhit *h = dynamic_cast(GetPointId(n)); printf("\nDetector : %d\n", h->GetDetector()); @@ -170,16 +180,20 @@ void AliEveTRDHits::PointSelected(Int_t n) /////////////////////////////////////////////////////////// -///////////// AliEveTRDHits ///////////////////// +///////////// AliEveTRDHits ///////////////////// /////////////////////////////////////////////////////////// //______________________________________________________________________________ AliEveTRDClusters::AliEveTRDClusters(AliEveTRDChamber *p):AliEveTRDHits(p) -{} +{ + // Constructor. +} //______________________________________________________________________________ void AliEveTRDClusters::PointSelected(Int_t n) { + // Handle an individual point selection from GL. + fParent->SpawnEditor(); AliTRDcluster *c = dynamic_cast(GetPointId(n)); printf("\nDetector : %d\n", c->GetDetector()); @@ -200,22 +214,22 @@ void AliEveTRDClusters::PointSelected(Int_t n) } /////////////////////////////////////////////////////////// -///////////// AliEveTRDHitsEditor ///////////////////// +//////////// AliEveTRDHitsEditor /////////////////// /////////////////////////////////////////////////////////// AliEveTRDHitsEditor::AliEveTRDHitsEditor(const TGWindow* p, Int_t width, Int_t height, UInt_t options, Pixel_t back) : TGedFrame(p, width, height, options, back), fM(0) { - MakeTitle("TRD Hits"); + // Constructor. + MakeTitle("TRD Hits"); } -AliEveTRDHitsEditor::~AliEveTRDHitsEditor() -{} - void AliEveTRDHitsEditor::SetModel(TObject* obj) { + // Set model object. + fM = dynamic_cast(obj); // Float_t x, y, z; @@ -233,15 +247,15 @@ AliEveTRDDigitsEditor::AliEveTRDDigitsEditor(const TGWindow* p, Int_t width, Int TGedFrame(p, width, height, options, back), fM(0) { - MakeTitle("TRD Digits"); + // Constructor. + MakeTitle("TRD Digits"); } -AliEveTRDDigitsEditor::~AliEveTRDDigitsEditor() -{} - void AliEveTRDDigitsEditor::SetModel(TObject* obj) { + // Set model object. + fM = dynamic_cast(obj); fM->fParent->SpawnEditor(); diff --git a/EVE/EveDet/AliEveTRDData.h b/EVE/EveDet/AliEveTRDData.h index b05ccc4beff..17d561a431c 100644 --- a/EVE/EveDet/AliEveTRDData.h +++ b/EVE/EveDet/AliEveTRDData.h @@ -16,8 +16,8 @@ // by A.Bercuci (A.Bercuci@gsi.de) Fri Oct 27 2006 /////////////////////////////////////////////////////////////////////// -#ifndef ALIEVE_TRDData_H -#define ALIEVE_TRDData_H +#ifndef AliEveTRDData_H +#define AliEveTRDData_H #include #include @@ -25,13 +25,11 @@ #include - #include "AliTRDdataArrayI.h" class AliTRDdigitsManager; class AliEveTRDChamber; - class AliEveTRDHits : public TEvePointSet { private: @@ -44,7 +42,7 @@ public: void PointSelected(Int_t n); protected: - AliEveTRDChamber *fParent; + AliEveTRDChamber *fParent; // Chaber holding the hits. ClassDef(AliEveTRDHits,1); // Base class for TRD hits visualisation }; @@ -59,14 +57,14 @@ private: public: AliEveTRDHitsEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - ~AliEveTRDHitsEditor(); + virtual ~AliEveTRDHitsEditor() {} virtual void SetModel(TObject* obj); protected: - AliEveTRDHits* fM; + AliEveTRDHits* fM; // Model object. - ClassDef(AliEveTRDHitsEditor,1); // Editor for AliEveTRDHits + ClassDef(AliEveTRDHitsEditor,1); // Editor for AliEveTRDHits. }; @@ -90,8 +88,8 @@ protected: AliEveTRDChamber *fParent; private: - TEveBoxSet fBoxes; - AliTRDdataArrayI fData; + TEveBoxSet fBoxes; // Boxset for didigit representation. + AliTRDdataArrayI fData; // Raw-data array. ClassDef(AliEveTRDDigits,1); // Digits visualisation for TRD }; @@ -106,12 +104,12 @@ private: public: AliEveTRDDigitsEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - ~AliEveTRDDigitsEditor(); + virtual ~AliEveTRDDigitsEditor() {} virtual void SetModel(TObject* obj); protected: - AliEveTRDDigits* fM; + AliEveTRDDigits* fM; // Model object. ClassDef(AliEveTRDDigitsEditor,1); // Editor for AliEveTRDDigits }; diff --git a/EVE/EveDet/AliEveTRDLoader.cxx b/EVE/EveDet/AliEveTRDLoader.cxx index f6d2f520db2..2c6611b8755 100644 --- a/EVE/EveDet/AliEveTRDLoader.cxx +++ b/EVE/EveDet/AliEveTRDLoader.cxx @@ -16,23 +16,23 @@ #include "TSystem.h" #include "TFile.h" #include "TTree.h" -#include "TString.h" +//#include "TString.h" #include "TObjString.h" #include "TObjArray.h" #include #include #include -#include +//#include #include -#include -#include +//#include +//#include #include "AliLog.h" #include "AliCDBManager.h" -#include "AliTRDv1.h" -#include "AliTRDhit.h" +//#include "AliTRDv1.h" +//#include "AliTRDhit.h" #include "AliTRDcluster.h" #include "AliTRDmcmTracklet.h" #include "AliTRDdigitsManager.h" @@ -61,38 +61,39 @@ AliEveTRDLoader::AliEveTRDLoader(const Text_t* n, const Text_t* t) : fTRD (0x0), fGeo (new AliTRDgeometry()) { + // Constructor. + AliCDBManager *fCDBManager=AliCDBManager::Instance(); fCDBManager->SetDefaultStorage("local://$ALICE_ROOT"); fCDBManager->SetRun(0); } //______________________________________________________________________________ -AliEveTRDLoader::~AliEveTRDLoader() +namespace { - // if(fChambers) {fChambers->clear(); delete fChambers;} -} - -//______________________________________________________________________________ template class ID { public: - ID( int value ) : id(value) {} + ID(int value) : fkId(value) {} bool operator()(const T &t) const { - return ((dynamic_cast(t))->GetID() == id); + return ((dynamic_cast(t))->GetID() == fkId); } private: - const int id; + const int fkId; }; +} void AliEveTRDLoader::AddChambers(int sm, int stk, int ly) { - Int_t ism_start = (sm == -1) ? 0 : sm; - Int_t ism_stop = (sm == -1) ? 18 : sm+1; - Int_t istk_start= (stk == -1)? 0 : stk; - Int_t istk_stop = (stk == -1)? 5 : stk+1; - Int_t ily_start = (ly == -1) ? 0 : ly; - Int_t ily_stop = (ly == -1) ? 6 : ly+1; + // Add specified chambers. + + Int_t ismStart = (sm == -1) ? 0 : sm; + Int_t ismStop = (sm == -1) ? 18 : sm+1; + Int_t istkStart= (stk == -1)? 0 : stk; + Int_t istkStop = (stk == -1)? 5 : stk+1; + Int_t ilyStart = (ly == -1) ? 0 : ly; + Int_t ilyStop = (ly == -1) ? 6 : ly+1; List_i ichmb; ichmb = fChildren.begin(); @@ -101,35 +102,36 @@ void AliEveTRDLoader::AddChambers(int sm, int stk, int ly) ichmb++; } - AliEveTRDNode *SM=0x0, *STK=0x0; - AliEveTRDChamber *CHMB = 0x0; + AliEveTRDNode *lSM=0x0, *lSTK=0x0; + AliEveTRDChamber *lCHMB = 0x0; int det; - for(int ism=ism_start; ism(ism)); - if(ichmb != fChildren.end()){ - SM = (AliEveTRDNode*)(*ichmb); - SM->SetRnrSelf(kTRUE); - }else{ - gEve->AddElement(SM = new AliEveTRDNode("SM", ism), this); - SM->FindListTreeItem(gEve->GetListTree())->SetTipText(Form("Supermodule %2d", ism)); + if (ichmb != fChildren.end()) { + lSM = (AliEveTRDNode*)(*ichmb); + lSM->SetRnrSelf(kTRUE); + } else { + AddElement(lSM = new AliEveTRDNode("SM", ism)); + lSM->SetElementTitle(Form("Supermodule %2d", ism)); } - for(int istk=istk_start; istkbegin(), SM->end(), ID(istk)); - if(ichmb != SM->end()){ - STK = (AliEveTRDNode*)(*ichmb); - STK->SetRnrSelf(kTRUE); - }else{ - gEve->AddElement(STK = new AliEveTRDNode("Stack", istk), SM); - STK->FindListTreeItem(gEve->GetListTree())->SetTipText(Form("SM %2d Stack %1d", ism, istk)); + for (int istk=istkStart; istkbegin(), lSM->end(), ID(istk)); + if (ichmb != lSM->end()) { + lSTK = (AliEveTRDNode*)(*ichmb); + lSTK->SetRnrSelf(kTRUE); + } else { + lSM->AddElement(lSTK = new AliEveTRDNode("Stack", istk)); + lSTK->SetElementTitle(Form("SM %2d Stack %1d", ism, istk)); } - for(int ily=ily_start; ilyGetDetector(ily, istk, ism); - ichmb = find_if(STK->begin(), STK->end(), ID(det)); - if(ichmb != STK->end()) (*ichmb)->SetRnrSelf(kTRUE); - else{ - gEve->AddElement(CHMB = new AliEveTRDChamber(det), STK); - CHMB->SetGeometry(fGeo); - CHMB->FindListTreeItem(gEve->GetListTree())->SetTipText(Form("SM %2d Stack %1d Layer %1d", ism, istk, ily)); + ichmb = find_if(lSTK->begin(), lSTK->end(), ID(det)); + if(ichmb != lSTK->end()) { + (*ichmb)->SetRnrSelf(kTRUE); + } else { + lSTK->AddElement(lCHMB = new AliEveTRDChamber(det)); + lCHMB->SetGeometry(fGeo); + lCHMB->SetElementTitle(Form("SM %2d Stack %1d Layer %1d", ism, istk, ily)); } } } @@ -140,6 +142,8 @@ void AliEveTRDLoader::AddChambers(int sm, int stk, int ly) //______________________________________________________________________________ AliEveTRDChamber* AliEveTRDLoader::GetChamber(int d) { + // Get given chamber. + List_i ism, istack, ichmb; ism = find_if(fChildren.begin(), fChildren.end(), ID(fGeo->GetSector(d))); @@ -154,6 +158,8 @@ AliEveTRDChamber* AliEveTRDLoader::GetChamber(int d) //______________________________________________________________________________ Bool_t AliEveTRDLoader::GoToEvent(int ev) { + // Go to given event. + if(!fChildren.size()){ AliWarning("Please select first the chamber that you want to monitor from \"Chamber(s) selector\"."); return kFALSE; @@ -196,6 +202,8 @@ Bool_t AliEveTRDLoader::GoToEvent(int ev) //______________________________________________________________________________ Bool_t AliEveTRDLoader::LoadClusters(TTree *tC) { + // Load clusters. + AliInfo("Loading ..."); if(!fChildren.size()) return kTRUE; @@ -218,6 +226,8 @@ Bool_t AliEveTRDLoader::LoadClusters(TTree *tC) //______________________________________________________________________________ Bool_t AliEveTRDLoader::LoadDigits(TTree *tD) { + // Load digits. + AliInfo("Loading ..."); if(!fChildren.size()) return kTRUE; @@ -239,6 +249,8 @@ Bool_t AliEveTRDLoader::LoadDigits(TTree *tD) //______________________________________________________________________________ Bool_t AliEveTRDLoader::LoadTracklets(TTree *tT) { + // Load tracklets. + AliInfo("Loading ..."); if(!fChildren.size()) return kTRUE; @@ -260,6 +272,8 @@ Bool_t AliEveTRDLoader::LoadTracklets(TTree *tT) //______________________________________________________________________________ Bool_t AliEveTRDLoader::Open(const char *filename, const char *dir) { + // Open given file in given directory. + fFilename = filename; fDir = dir; Int_t count = 0; @@ -298,11 +312,11 @@ Bool_t AliEveTRDLoader::Open(const char *filename, const char *dir) return kTRUE; } - - //______________________________________________________________________________ void AliEveTRDLoader::Paint(Option_t *option) { + // Paint object. + List_i ichmb = fChildren.begin(); while(ichmb != fChildren.end()){ (dynamic_cast(*ichmb))->Paint(option); @@ -313,6 +327,8 @@ void AliEveTRDLoader::Paint(Option_t *option) //______________________________________________________________________________ void AliEveTRDLoader::SetDataType(TRDDataTypes type) { + // Set type of data. + fLoadHits = kFALSE; fLoadDigits = kFALSE; fLoadClusters = kFALSE; @@ -330,6 +346,8 @@ void AliEveTRDLoader::SetDataType(TRDDataTypes type) //______________________________________________________________________________ void AliEveTRDLoader::Unload() { + // Unload module data. + List_i ichmb = fChildren.begin(); while(ichmb != fChildren.end()){ (dynamic_cast(*ichmb))->Reset(); @@ -348,6 +366,8 @@ AliEveTRDLoaderEditor::AliEveTRDLoaderEditor(const TGWindow* p, Int_t width, Int fM(0), fFile(0), fEvent(0), fSMNumber(0), fStackNumber(0), fPlaneNumber(0) { + // Constructor. + MakeTitle("AliEveTRDLoader"); Int_t labelW = 42; @@ -434,13 +454,10 @@ AliEveTRDLoaderEditor::AliEveTRDLoaderEditor(const TGWindow* p, Int_t width, Int fTextButton2004->Connect("Clicked()", "AliEveTRDLoaderEditor", this, "Load()"); } -//______________________________________________________________________________ -AliEveTRDLoaderEditor::~AliEveTRDLoaderEditor() -{} - //______________________________________________________________________________ void AliEveTRDLoaderEditor::SetModel(TObject* obj) { + // Set model object. fM = dynamic_cast(obj); @@ -467,6 +484,8 @@ void AliEveTRDLoaderEditor::SetModel(TObject* obj) //______________________________________________________________________________ void AliEveTRDLoaderEditor::AddChambers() { + // Slot to add chambers. + fM->fSM = (int)fSMNumber->GetEntry()->GetNumber(); fM->fStack = (int)fStackNumber->GetEntry()->GetNumber(); fM->fLy = (int)fPlaneNumber->GetEntry()->GetNumber(); @@ -476,6 +495,8 @@ void AliEveTRDLoaderEditor::AddChambers() //______________________________________________________________________________ void AliEveTRDLoaderEditor::FileOpen() { + // Slot for opening of file. + TGFileInfo fi; fi.fIniDir = StrDup(gSystem->DirName (fM->fFilename.Data())); fi.fFilename = StrDup(gSystem->BaseName(fM->fFilename.Data())); @@ -494,5 +515,7 @@ void AliEveTRDLoaderEditor::FileOpen() void AliEveTRDLoaderEditor::Load() { + // Slot for loading of event. + fM->GoToEvent(fM->fEvent); } diff --git a/EVE/EveDet/AliEveTRDLoader.h b/EVE/EveDet/AliEveTRDLoader.h index b62b7fbc414..3c9ba912cfb 100644 --- a/EVE/EveDet/AliEveTRDLoader.h +++ b/EVE/EveDet/AliEveTRDLoader.h @@ -6,11 +6,11 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TRDLoader_H -#define ALIEVE_TRDLoader_H +#ifndef AliEveTRDLoader_H +#define AliEveTRDLoader_H //////////////////////////////////////////////////////////////////////// -// // - ALIEVE implementation - +// - ALIEVE implementation - // Loader for the TRD detector - base class // - AliEveTRDLoader - loader of TRD data (simulation + measured) // - AliEveTRDLoaderEditor - UI @@ -55,7 +55,8 @@ public: public: AliEveTRDLoader(const Text_t* n="AliEveTRDLoader", const Text_t* t=0); - ~AliEveTRDLoader(); + virtual ~AliEveTRDLoader() {} + virtual void Paint(Option_t *option=""); virtual void SetDataType(TRDDataTypes type); @@ -76,11 +77,10 @@ protected: TString fDir; // data directory Int_t fEvent; // current event to be displayed - AliTRDv1 *fTRD; // the TRD detector AliTRDgeometry *fGeo; // the TRD geometry - ClassDef(AliEveTRDLoader, 1); // Alieve Loader class for the TRD detector + ClassDef(AliEveTRDLoader, 1); // Alieve Loader class for the TRD detector. }; @@ -93,7 +93,7 @@ private: public: AliEveTRDLoaderEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - ~AliEveTRDLoaderEditor(); + virtual ~AliEveTRDLoaderEditor() {} virtual void AddChambers(); virtual void FileOpen(); @@ -102,12 +102,12 @@ public: virtual void SetModel(TObject* obj); protected: - AliEveTRDLoader *fM; - TGTextEntry *fFile; - TEveGValuator *fEvent; - TEveGValuator *fSMNumber, *fStackNumber, *fPlaneNumber; + AliEveTRDLoader *fM; // Model object. + TGTextEntry *fFile; // File name weed. + TEveGValuator *fEvent; // Event no weed. + TEveGValuator *fSMNumber, *fStackNumber, *fPlaneNumber; // Detector id weeds. - ClassDef(AliEveTRDLoaderEditor,1); // Editor for AliEveTRDLoader + ClassDef(AliEveTRDLoaderEditor,1); // Editor for AliEveTRDLoader. }; #endif diff --git a/EVE/EveDet/AliEveTRDLoaderImp.cxx b/EVE/EveDet/AliEveTRDLoaderImp.cxx index 88889156620..b991282c901 100644 --- a/EVE/EveDet/AliEveTRDLoaderImp.cxx +++ b/EVE/EveDet/AliEveTRDLoaderImp.cxx @@ -12,7 +12,7 @@ #include -#include "TFile.h" +//#include "TFile.h" #include "TTree.h" #include @@ -20,14 +20,14 @@ #include "AliLog.h" #include "AliRun.h" #include "AliRunLoader.h" -#include "AliLoader.h" +//#include "AliLoader.h" #include "AliTRDrawData.h" #include "AliRawReaderRoot.h" #include "AliRawReaderDate.h" #include "AliTRDv1.h" #include "AliTRDhit.h" -#include "AliTRDdigitsManager.h" +//#include "AliTRDdigitsManager.h" ClassImp(AliEveTRDLoaderSim) ClassImp(AliEveTRDLoaderRaw) @@ -43,15 +43,15 @@ ClassImp(AliEveTRDLoaderSimEditor) AliEveTRDLoaderSim::AliEveTRDLoaderSim(const Text_t* n, const Text_t* t) : AliEveTRDLoader(n, t), fRunLoader(0) -{} - -//______________________________________________________________________________ -AliEveTRDLoaderSim::~AliEveTRDLoaderSim() -{} +{ + // Constructor. +} //______________________________________________________________________________ Bool_t AliEveTRDLoaderSim::GoToEvent(int ev) { + // Go to given event. + if(!fChildren.size()){ AliWarning("Please select first the chamber that you want to monitor from \"Chamber(s) selector\"."); return kFALSE; @@ -107,6 +107,8 @@ Bool_t AliEveTRDLoaderSim::GoToEvent(int ev) //______________________________________________________________________________ Bool_t AliEveTRDLoaderSim::LoadHits(TTree *tH) { + // Load hits. + Info("LoadHits()", "Loading ..."); if(!fChildren.size()) return kTRUE; @@ -135,8 +137,7 @@ Bool_t AliEveTRDLoaderSim::LoadHits(TTree *tH) //______________________________________________________________________________ Bool_t AliEveTRDLoaderSim::Open(const char *filename, const char *dir) { - //Info("Open()", ""); - + // Open file in given dir. fFilename = filename; fDir = dir; @@ -167,7 +168,6 @@ Bool_t AliEveTRDLoaderSim::Open(const char *filename, const char *dir) } - /////////////////////////////////////////////////////////// ///////////// AliEveTRDLoaderRaw ///////////////////// /////////////////////////////////////////////////////////// @@ -181,22 +181,19 @@ AliEveTRDLoaderRaw::AliEveTRDLoaderRaw(const Text_t* n, const Text_t* t) : fRaw (0), fDataRoot (kTRUE), fEventOld (-1) -{} - -//______________________________________________________________________________ -AliEveTRDLoaderRaw::~AliEveTRDLoaderRaw() -{} - +{ + // Constructor. +} //______________________________________________________________________________ Bool_t AliEveTRDLoaderRaw::Open(const char *filename, const char *dir) { - // Info("Open()", Form("Open %s/%s", dir, filename)); + // Open file in gvenn dir. + fFilename = filename; fDir = dir; fDir += "/"; - if(fRaw) delete fRaw; fRaw = new AliTRDrawData(); @@ -214,19 +211,23 @@ Bool_t AliEveTRDLoaderRaw::Open(const char *filename, const char *dir) //______________________________________________________________________________ void AliEveTRDLoaderRaw::SetDataType(TRDDataTypes type) { + // Set data type. + fDataRoot = (type == kRawRoot) ? kTRUE : kFALSE; } //______________________________________________________________________________ Bool_t AliEveTRDLoaderRaw::GoToEvent(int ev) { + // Go to given event. + if(!fChildren.size()){ AliWarning("Please select first the chamber that you want to monitor from \"Chamber(s) selector\"."); return kFALSE; } - static const TEveException eH("AliEveTRDLoader::GotoEvent "); - if(fRawRootReader == 0x0) throw(eH + "data file not opened."); + static const TEveException kEH("AliEveTRDLoader::GotoEvent "); + if(fRawRootReader == 0x0) throw(kEH + "data file not opened."); if(ev == fEventOld) return kTRUE; @@ -240,17 +241,19 @@ Bool_t AliEveTRDLoaderRaw::GoToEvent(int ev) do NextEvent(); while(fEventOld != ev && !(checkEnd == kTRUE && fEventOld == 0)); LoadEvent(); gEve->Redraw3D(); - //gEve->EnableRedraw(); + return kTRUE; } //______________________________________________________________________________ Bool_t AliEveTRDLoaderRaw::LoadEvent() { + // Load event. + Info("LoadEvent()", "Loading ..."); - static const TEveException eH("AliEveTRDLoader::LoadEvent "); - if(fRawRootReader == 0x0) throw(eH + "data file not opened."); + static const TEveException kEH("AliEveTRDLoader::LoadEvent "); + if(fRawRootReader == 0x0) throw(kEH + "data file not opened."); fRawRootReader->Reset(); @@ -269,19 +272,21 @@ Bool_t AliEveTRDLoaderRaw::LoadEvent() //______________________________________________________________________________ void AliEveTRDLoaderRaw::NextEvent(Bool_t rewindOnEnd) { - static const TEveException eH("AliEveTRDLoader::NextEvent "); - if(fRawRootReader == 0x0) throw(eH + "data file not opened."); + // Go to next event. + + static const TEveException kEH("AliEveTRDLoader::NextEvent "); + if(fRawRootReader == 0x0) throw(kEH + "data file not opened."); if(fRawRootReader->NextEvent() == kTRUE) ++fEventOld; else { - if(fEventOld == -1) throw(eH + "no events available."); + if(fEventOld == -1) throw(kEH + "no events available."); if(rewindOnEnd) { Warning("NextEvent()", Form("Reached end of stream (event=%d), rewinding to first event.", fEventOld)); fRawRootReader->RewindEvents(); fRawRootReader->NextEvent(); fEventOld = 0; - } else throw(eH + "last event reached."); + } else throw(kEH + "last event reached."); } } @@ -297,6 +302,8 @@ AliEveTRDLoaderSimEditor::AliEveTRDLoaderSimEditor(const TGWindow* p, Int_t widt TGedFrame(p, width, height, options | kVerticalFrame, back), fM(0), fLoadHits(0), fLoadDigits(0), fLoadClusters(0), fLoadTracks(0) { + // Constructor. + MakeTitle("AliEveTRDLoaderSim"); // "Data selector" group frame @@ -322,22 +329,16 @@ AliEveTRDLoaderSimEditor::AliEveTRDLoaderSimEditor(const TGWindow* p, Int_t widt AddFrame(fGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,2,2,2,2)); } -//______________________________________________________________________________ -AliEveTRDLoaderSimEditor::~AliEveTRDLoaderSimEditor() -{} - //______________________________________________________________________________ void AliEveTRDLoaderSimEditor::SetModel(TObject* obj) { + // Set model object. + fM = dynamic_cast(obj); Bool_t kFile = kTRUE; if(fM->fFilename.CompareTo("") == 0) kFile = kFALSE; - /* printf("\thits %s\n", fM->fLoadHits ? "true" : "false"); - printf("\tdigits %s\n", fM->fLoadDigits ? "true" : "false"); - printf("\tclusters %s\n", fM->fLoadClusters ? "true" : "false"); - printf("\ttracklets %s\n", fM->fLoadTracks ? "true" : "false");*/ fLoadHits->SetEnabled(kFile); if(kFile) fLoadHits->SetState(fM->fLoadHits ? kButtonDown : kButtonUp); fLoadDigits->SetEnabled(kFile); @@ -351,6 +352,8 @@ void AliEveTRDLoaderSimEditor::SetModel(TObject* obj) //______________________________________________________________________________ void AliEveTRDLoaderSimEditor::Toggle(Int_t id) { + // Toggle given button id. + switch(id){ case 0: fM->fLoadHits = fLoadHits->IsDown() ? kTRUE : kFALSE; @@ -366,19 +369,3 @@ void AliEveTRDLoaderSimEditor::Toggle(Int_t id) break; } } - -/////////////////////////////////////////////////////////// -///////////// TRDLoaderRawEditor ///////////////////// -/////////////////////////////////////////////////////////// - -// //________________________________________________________ -// TRDLoaderRawEditor::TRDLoaderRawEditor(const TGWindow* p, Int_t width, Int_t height, UInt_t options, Pixel_t back) : TGedFrame(p, width, height, options | kVerticalFrame, back) -// { -// MakeTitle("AliEveTRDLoaderRaw"); -// } -// -// void TRDLoaderRawEditor::SetModel(TObject* obj) -// { -// Info("SetModel()", ""); -// fM = dynamic_cast(obj); -// } diff --git a/EVE/EveDet/AliEveTRDLoaderImp.h b/EVE/EveDet/AliEveTRDLoaderImp.h index 2cb7f984089..d993b8e0cd9 100644 --- a/EVE/EveDet/AliEveTRDLoaderImp.h +++ b/EVE/EveDet/AliEveTRDLoaderImp.h @@ -6,11 +6,11 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TRDLoaderImp_H -#define ALIEVE_TRDLoaderImp_H +#ifndef AliEveTRDLoaderImp_H +#define AliEveTRDLoaderImp_H //////////////////////////////////////////////////////////////////////// -// // +// // Single event loader for the TRD detector // - AliEveTRDLoaderSim - loader for simulations based on gAlice // - AliEveTRDLoaderRaw - loader for raw data @@ -35,7 +35,7 @@ private: AliEveTRDLoaderSim& operator=(const AliEveTRDLoaderSim&); // Not implemented public: AliEveTRDLoaderSim(const Text_t* n="AliEveTRDLoaderSim", const Text_t* t=0); - ~AliEveTRDLoaderSim(); + virtual ~AliEveTRDLoaderSim() {} Bool_t GoToEvent(int ev); Bool_t LoadHits(TTree *tH); @@ -56,7 +56,7 @@ private: public: AliEveTRDLoaderRaw(const Text_t* n="AliEveTRDLoaderRaw", const Text_t* t=0); - ~AliEveTRDLoaderRaw(); + virtual ~AliEveTRDLoaderRaw() {} Bool_t GoToEvent(int ev); Bool_t LoadEvent(); @@ -67,11 +67,11 @@ private: void NextEvent(Bool_t rewindOnEnd=kTRUE); private: - AliRawReaderDate *fRawDateReader; - AliRawReaderRoot *fRawRootReader; - AliTRDrawData *fRaw; - Bool_t fDataRoot; - Int_t fEventOld; + AliRawReaderDate *fRawDateReader; // raw data reader + AliRawReaderRoot *fRawRootReader; // raw root reader + AliTRDrawData *fRaw; // raw data + Bool_t fDataRoot; // data in root format + Int_t fEventOld; // old event ClassDef(AliEveTRDLoaderRaw, 1); // Alieve loader for the TRD detector (raw) }; @@ -86,14 +86,14 @@ private: public: AliEveTRDLoaderSimEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - ~AliEveTRDLoaderSimEditor(); + virtual ~AliEveTRDLoaderSimEditor() {} virtual void SetModel(TObject* obj); virtual void Toggle(Int_t id); protected: - AliEveTRDLoaderSim *fM; - TGCheckButton *fLoadHits, *fLoadDigits, *fLoadClusters, *fLoadTracks; + AliEveTRDLoaderSim *fM; // Model object. + TGCheckButton *fLoadHits, *fLoadDigits, *fLoadClusters, *fLoadTracks; // What data to load. ClassDef(AliEveTRDLoaderSimEditor,1); // Editor for AliEveTRDLoaderSim }; diff --git a/EVE/EveDet/AliEveTRDLoaderManager.cxx b/EVE/EveDet/AliEveTRDLoaderManager.cxx index 2a396f07e48..4b86fa53794 100644 --- a/EVE/EveDet/AliEveTRDLoaderManager.cxx +++ b/EVE/EveDet/AliEveTRDLoaderManager.cxx @@ -17,9 +17,9 @@ #include #include #include -#include -#include -#include +//#include +//#include +//#include #include #include "AliLog.h" @@ -31,44 +31,32 @@ ClassImp(AliEveTRDLoaderManagerEditor) ///////// AliEveTRDLoaderManager ////////////// /////////////////////////////////////////////////////////// - //______________________________________________________________________________ AliEveTRDLoaderManager::AliEveTRDLoaderManager(const Text_t* n, const Text_t* t) : TEveElementList(n, t) { - // Constructor. Noop. -} - -//______________________________________________________________________________ -AliEveTRDLoaderManager::~AliEveTRDLoaderManager() -{ - // Destructor. Noop. + // Constructor. } //______________________________________________________________________________ void AliEveTRDLoaderManager::Add(Int_t type, const Text_t *name, const Text_t *title) { - //Info("Add()", Form("type %d, name %s, title %s", type, name, title)); + // Add something. + AliEveTRDLoader *trdl = 0x0; switch(type){ case 0: - //fChildren.push_back(new AliEveTRDLoaderSim(name, title)); - gEve->AddElement(trdl = new AliEveTRDLoaderSim(name, title), this); - ((AliEveTRDLoaderSim*)trdl)->FindListTreeItem(gEve->GetListTree())->SetTipText(title); + AddElement(new AliEveTRDLoaderSim(name, title)); break; case 1: case 2: case 3: - //fChildren.push_back(new AliEveTRDLoader(name, title)); - gEve->AddElement(trdl = new AliEveTRDLoader(name, title), this); - trdl->FindListTreeItem(gEve->GetListTree())->SetTipText(title); + AddElement(trdl = new AliEveTRDLoader(name, title)); trdl->SetDataType((AliEveTRDLoader::TRDDataTypes)type); break; case 4: case 5: - //fChildren.push_back(new AliEveTRDLoaderRaw(name, title)); - gEve->AddElement(trdl = new AliEveTRDLoaderRaw(name, title), this); - ((AliEveTRDLoaderRaw*)trdl)->FindListTreeItem(gEve->GetListTree())->SetTipText(title); + AddElement(trdl = new AliEveTRDLoaderRaw(name, title)); trdl->SetDataType((AliEveTRDLoader::TRDDataTypes)type); break; } @@ -77,10 +65,11 @@ void AliEveTRDLoaderManager::Add(Int_t type, const Text_t *name, const Text_t *t } - //______________________________________________________________________________ void AliEveTRDLoaderManager::Paint(Option_t *option) { + // Paint object. + List_i ichmb = fChildren.begin(); while(ichmb != fChildren.end()){ (dynamic_cast(*ichmb))->Paint(option); @@ -91,6 +80,8 @@ void AliEveTRDLoaderManager::Paint(Option_t *option) //______________________________________________________________________________ void AliEveTRDLoaderManager::Remove(Int_t entry) { + // Remove something. + //printf("AliEveTRDLoaderManager::Remove(%d)\n", entry); List_i it = fChildren.begin(); for(int i=0; iGetSelectedEntry(); if(!entry){ AliWarning("Select first the loader type that you want to use from the drop down list."); @@ -228,6 +217,8 @@ void AliEveTRDLoaderManagerEditor::Add() //______________________________________________________________________________ void AliEveTRDLoaderManagerEditor::Remove(Int_t entry) { + // Slot to remove something. + TIterator *it = fGroupFrame->GetList()->MakeIterator(); int ientry = 0; while(/*TGFrame *f=(TGFrame*)*/it->Next()){ @@ -250,6 +241,8 @@ void AliEveTRDLoaderManagerEditor::Remove(Int_t entry) //______________________________________________________________________________ void AliEveTRDLoaderManagerEditor::SetModel(TObject* obj) { + // Set model object. + fM = dynamic_cast(obj); } diff --git a/EVE/EveDet/AliEveTRDLoaderManager.h b/EVE/EveDet/AliEveTRDLoaderManager.h index c598c96b21e..e479fc5fc61 100644 --- a/EVE/EveDet/AliEveTRDLoaderManager.h +++ b/EVE/EveDet/AliEveTRDLoaderManager.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TRDLoaderManager_H -#define ALIEVE_TRDLoaderManager_H +#ifndef AliEveTRDLoaderManager_H +#define AliEveTRDLoaderManager_H //////////////////////////////////////////////////////////////////////// // @@ -33,12 +33,14 @@ class TClonesArray; class AliEveTRDLoaderManager : public TEveElementList { friend class AliEveTRDLoaderManagerEditor; -private: + AliEveTRDLoaderManager(const AliEveTRDLoaderManager&); // Not implemented AliEveTRDLoaderManager& operator=(const AliEveTRDLoaderManager&); // Not implemented + public: AliEveTRDLoaderManager(const Text_t* name="AliEveTRDLoader", const Text_t* title=0x0); - ~AliEveTRDLoaderManager(); + virtual ~AliEveTRDLoaderManager() {} + void Paint(Option_t *option); protected: @@ -54,25 +56,26 @@ class AliEveTRDLoaderManagerEditor : public TGedFrame private: AliEveTRDLoaderManagerEditor(const AliEveTRDLoaderManagerEditor&); // Not implemented AliEveTRDLoaderManagerEditor& operator=(const AliEveTRDLoaderManagerEditor&); // Not implemented + public: AliEveTRDLoaderManagerEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - ~AliEveTRDLoaderManagerEditor(); + virtual ~AliEveTRDLoaderManagerEditor() {} virtual void Add(); virtual void Remove(Int_t entry); virtual void SetModel(TObject* obj); protected: - AliEveTRDLoaderManager* fM; + AliEveTRDLoaderManager* fM; // Model object. private: - TGComboBox *fSelector; - TGTextButton *fAdd, *fRemoveButton; - TGGroupFrame *fGroupFrame; - TClonesArray *fRemove; + TGComboBox *fSelector; // Selector weed. + TGTextButton *fAdd, *fRemoveButton; // Add/remove button. + TGGroupFrame *fGroupFrame; // Frame. + TClonesArray *fRemove; // Remove array. - ClassDef(AliEveTRDLoaderManagerEditor, 1); // Editor for AliEveTRDLoaderManager + ClassDef(AliEveTRDLoaderManagerEditor, 1); // Editor for AliEveTRDLoaderManager. }; #endif diff --git a/EVE/EveDet/AliEveTRDModule.cxx b/EVE/EveDet/AliEveTRDModule.cxx index 3a446a6ae54..218041decca 100644 --- a/EVE/EveDet/AliEveTRDModule.cxx +++ b/EVE/EveDet/AliEveTRDModule.cxx @@ -6,6 +6,7 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ + #include "AliEveTRDModule.h" #include "AliEveTRDModuleImp.h" @@ -13,12 +14,8 @@ #include "TGColorSelect.h" #include "TGNumberEntry.h" #include "TG3DLine.h" -//#include "TColor.h" -//#include "TMath.h" #include "TEveManager.h" -#include "TEveTrack.h" - ClassImp(AliEveTRDModule) ClassImp(AliEveTRDModuleEditor) @@ -47,8 +44,6 @@ AliEveTRDModule::AliEveTRDModule(const char *typ, Int_t det) : // Constructor. } - - /////////////////////////////////////////////////////////// ////////// AliEveTRDModuleEditor ////////////////// /////////////////////////////////////////////////////////// @@ -66,6 +61,8 @@ AliEveTRDModuleEditor::AliEveTRDModuleEditor(const TGWindow* p, Int_t width, Int fClustersColor(0), fDisplayTracks(0) { + // Constructor. + MakeTitle("TRD Detector"); // "Hits" group frame @@ -78,9 +75,9 @@ AliEveTRDModuleEditor::AliEveTRDModuleEditor(const TGWindow* p, Int_t width, Int "AliEveTRDModuleEditor", this, "UpdateChamber()"); // color select widget - ULong_t ColPar1; - gClient->GetColorByName("#ff00ff", ColPar1); - fHitsColor = new TGColorSelect(fGroupFrame615, ColPar1, -1); + ULong_t lColPar1; + gClient->GetColorByName("#ff00ff", lColPar1); + fHitsColor = new TGColorSelect(fGroupFrame615, lColPar1, -1); fGroupFrame615->AddFrame(fHitsColor, new TGLayoutHints(kLHintsLeft | kLHintsCenterX | kLHintsTop | kLHintsCenterY,2,2,2,2)); fHitsColor->Connect("ColorSelected(Pixel_t)", @@ -141,9 +138,9 @@ AliEveTRDModuleEditor::AliEveTRDModuleEditor(const TGWindow* p, Int_t width, Int "AliEveTRDModuleEditor", this, "UpdateChamber()"); // color select widget - ULong_t ColPar2; - gClient->GetColorByName("#ff00ff", ColPar2); - fClustersColor = new TGColorSelect(fGroupFrame649, ColPar2, -1); + ULong_t lColPar2; + gClient->GetColorByName("#ff00ff", lColPar2); + fClustersColor = new TGColorSelect(fGroupFrame649, lColPar2, -1); fGroupFrame649->AddFrame(fClustersColor, new TGLayoutHints(kLHintsLeft | kLHintsCenterX | kLHintsTop | kLHintsCenterY,2,2,2,2)); fClustersColor->Connect("ColorSelected(Pixel_t)", @@ -165,16 +162,13 @@ AliEveTRDModuleEditor::AliEveTRDModuleEditor(const TGWindow* p, Int_t width, Int AddFrame(fGroupFrame676, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,2,2,2,2)); } -//______________________________________________________________________________ -AliEveTRDModuleEditor::~AliEveTRDModuleEditor() -{} - //______________________________________________________________________________ void AliEveTRDModuleEditor::SetModel(TObject* obj) { - // Takes care to update UI state according to model state + // Set model object. fM = dynamic_cast(obj); + if(AliEveTRDNode *node = dynamic_cast(fM)) node->UpdateNode(); fDisplayHits->SetEnabled(fM->fLoadHits); @@ -205,6 +199,8 @@ void AliEveTRDModuleEditor::SetModel(TObject* obj) //______________________________________________________________________________ void AliEveTRDModuleEditor::ModifyDigitsView() { + // Slor to modify digit view. + fM->fDigitsNeedRecompute = kTRUE; UpdateChamber(); } @@ -212,6 +208,8 @@ void AliEveTRDModuleEditor::ModifyDigitsView() //______________________________________________________________________________ void AliEveTRDModuleEditor::SetThreshold(Long_t tres) { + // Slot for SetThreshold. + if(!fM->fLoadDigits) return; fM->fDigitsThreshold = (tres == 0) ? (int)fThresValue->GetNumber():tres; diff --git a/EVE/EveDet/AliEveTRDModule.h b/EVE/EveDet/AliEveTRDModule.h index c1dc3f1a72f..129cb58ba23 100644 --- a/EVE/EveDet/AliEveTRDModule.h +++ b/EVE/EveDet/AliEveTRDModule.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TRDModule_H -#define ALIEVE_TRDModule_H +#ifndef AliEveTRDModule_H +#define AliEveTRDModule_H ///////////////////////////////////////////////////////////////////////// // @@ -20,13 +20,8 @@ // by A.Bercuci (A.Bercuci@gsi.de) Fri Oct 27 2006 /////////////////////////////////////////////////////////////////////// -#ifndef ROOT_TNamed #include -#endif - -#ifndef ROOT_TGedFrame #include -#endif class TObject; class TGWindow; @@ -49,26 +44,26 @@ public: AliEveTRDModule(const char *typ="XXX", Int_t id=0); virtual ~AliEveTRDModule() {} - virtual Bool_t GetDigitsBox(){return fDigitsBox;} - virtual Bool_t GetDigitsLog(){return fDigitsLog;} - virtual UShort_t GetDigitsThreshold(){return fDigitsThreshold;} - virtual Int_t GetID(){return fDet;} + virtual Bool_t GetDigitsBox() const {return fDigitsBox;} + virtual Bool_t GetDigitsLog() const {return fDigitsLog;} + virtual UShort_t GetDigitsThreshold() const {return fDigitsThreshold;} + virtual Int_t GetID() const {return fDet;} virtual void Paint(Option_t* option="")=0; virtual void Reset()=0; protected: // UI section - Bool_t fLoadHits, fRnrHits; - Bool_t fLoadDigits, fRnrDigits, fDigitsLog, fDigitsBox; - Bool_t fDigitsNeedRecompute; + Bool_t fLoadHits, fRnrHits, fLoadDigits; // What to load. + Bool_t fRnrDigits, fDigitsLog, fDigitsBox; // What to show. + Bool_t fDigitsNeedRecompute; // Need to recompute digits. - Bool_t fLoadRecPoints, fRnrRecPoints; - Bool_t fLoadTracklets, fRnrTracklets; + Bool_t fLoadRecPoints, fRnrRecPoints; // What to do with recpoints. + Bool_t fLoadTracklets, fRnrTracklets; // What to do with tracklets. Int_t fDet; // detector number UShort_t fDigitsThreshold; // digits threshold - ClassDef(AliEveTRDModule,1); // Structure holder for TRD chamber + ClassDef(AliEveTRDModule,1); // Structure holder for TRD chamber. }; @@ -81,7 +76,7 @@ private: public: AliEveTRDModuleEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground()); - ~AliEveTRDModuleEditor(); + virtual ~AliEveTRDModuleEditor() {} virtual void SetModel(TObject* obj); @@ -92,18 +87,18 @@ public: void UpdateHits(Pixel_t); protected: - AliEveTRDModule* fM; + AliEveTRDModule* fM; // Model object. private: - TGCheckButton *fDisplayHits; - TGColorSelect *fHitsColor; - TGCheckButton *fDisplayDigits, *fToggleLog, *fToggleBox, *fThreshold; - TGNumberEntry *fThresValue; - TGCheckButton *fDisplayClusters; - TGColorSelect *fClustersColor; - TGCheckButton *fDisplayTracks; - - ClassDef(AliEveTRDModuleEditor,1); // Editor for AliEveTRDModule + TGCheckButton *fDisplayHits; // Hit control. + TGColorSelect *fHitsColor; // Hit color. + TGCheckButton *fDisplayDigits, *fToggleLog, *fToggleBox, *fThreshold; // Display toggles. + TGNumberEntry *fThresValue; // Threshold weed. + TGCheckButton *fDisplayClusters; // Cluster control. + TGColorSelect *fClustersColor; // Cluster color. + TGCheckButton *fDisplayTracks; // Track control. + + ClassDef(AliEveTRDModuleEditor,1); // Editor for AliEveTRDModule. }; #endif diff --git a/EVE/EveDet/AliEveTRDModuleImp.cxx b/EVE/EveDet/AliEveTRDModuleImp.cxx index fcd45d56816..d3bda95b311 100644 --- a/EVE/EveDet/AliEveTRDModuleImp.cxx +++ b/EVE/EveDet/AliEveTRDModuleImp.cxx @@ -10,23 +10,17 @@ #include "AliEveTRDModuleImp.h" #include "AliEveTRDData.h" -#include "TMath.h" #include #include "TEveManager.h" #include "TEveTrack.h" #include "AliLog.h" -#include "AliRun.h" -#include "AliTRDv1.h" #include "AliTRDgeometry.h" #include "AliTRDCommonParam.h" #include "AliTRDpadPlane.h" -#include "AliTRDdigit.h" #include "AliTRDhit.h" #include "AliTRDcluster.h" -#include "AliTRDcalibDB.h" -#include "AliTRDdataArrayI.h" #include "AliTRDmcmTracklet.h" ClassImp(AliEveTRDChamber) @@ -36,11 +30,14 @@ ClassImp(AliEveTRDNode) AliEveTRDNode::AliEveTRDNode(const char *typ, Int_t det) : TEveElement(), AliEveTRDModule(typ, det) { + // Xonstructor. } //______________________________________________________________________________ void AliEveTRDNode::Paint(Option_t* option) { + // Paint object. + List_i iter = fChildren.begin(); while(iter != fChildren.end()){ (dynamic_cast(*iter))->Paint(option); @@ -51,6 +48,8 @@ void AliEveTRDNode::Paint(Option_t* option) //______________________________________________________________________________ void AliEveTRDNode::Reset() { + // Reset. + List_i iter = fChildren.begin(); while(iter != fChildren.end()){ (dynamic_cast(*iter))->Reset(); @@ -61,6 +60,8 @@ void AliEveTRDNode::Reset() //______________________________________________________________________________ void AliEveTRDNode::Collapse() { + // Collapse. + TGListTree *list = gEve->GetListTree(); AliEveTRDNode *node = 0x0; List_i iter = fChildren.begin(); @@ -74,6 +75,8 @@ void AliEveTRDNode::Collapse() //______________________________________________________________________________ void AliEveTRDNode::Expand() { + // Expand. + TGListTree *list = gEve->GetListTree(); AliEveTRDNode *node = 0x0; List_i iter = fChildren.begin(); @@ -87,6 +90,8 @@ void AliEveTRDNode::Expand() //______________________________________________________________________________ void AliEveTRDNode::EnableListElements() { + // Enable list elements. + SetRnrSelf(kTRUE); AliEveTRDNode *node = 0x0; AliEveTRDChamber *chmb = 0x0; @@ -105,6 +110,8 @@ void AliEveTRDNode::EnableListElements() //______________________________________________________________________________ void AliEveTRDNode::DisableListElements() { + // Disable list elements. + SetRnrSelf(kFALSE); AliEveTRDNode *node = 0x0; AliEveTRDChamber *chmb = 0x0; @@ -123,6 +130,8 @@ void AliEveTRDNode::DisableListElements() //______________________________________________________________________________ void AliEveTRDNode::UpdateLeaves() { + // Update leaves. + AliEveTRDModule *module; List_i iter = fChildren.begin(); while(iter != fChildren.end()){ @@ -152,6 +161,8 @@ void AliEveTRDNode::UpdateLeaves() //______________________________________________________________________________ void AliEveTRDNode::UpdateNode() { + // Update node. + // Info("UpdateNode()", Form("%s", GetName())); AliEveTRDNode *node = 0x0; List_i iter = fChildren.begin(); @@ -226,6 +237,8 @@ AliEveTRDChamber::AliEveTRDChamber(Int_t det) : //______________________________________________________________________________ Int_t AliEveTRDChamber::GetSM() const { + // Get supermodule. + if(!fGeo){ AliWarning("Fail. No TRD geometry defined."); return -1; @@ -236,6 +249,8 @@ Int_t AliEveTRDChamber::GetSM() const //______________________________________________________________________________ Int_t AliEveTRDChamber::GetSTK() const { + // Get stack. + if(!fGeo){ AliWarning("Fail. No TRD geometry defined."); return -1; @@ -361,7 +376,8 @@ void AliEveTRDChamber::LoadTracklets(TObjArray *tracks) //____________________________________________________ void AliEveTRDChamber::Paint(Option_t* option) { - /* Info("Paint()", Form("%s", GetName()));*/ + // Paint object. + if(!fRnrSelf) return; if(fDigits && fRnrDigits){ if(fDigitsNeedRecompute){ @@ -380,6 +396,8 @@ void AliEveTRDChamber::Paint(Option_t* option) //______________________________________________________________________________ void AliEveTRDChamber::Reset() { + // Reset. + if(fHits){ fHits->Reset(); fLoadHits = kFALSE; @@ -401,6 +419,8 @@ void AliEveTRDChamber::Reset() //______________________________________________________________________________ void AliEveTRDChamber::SetGeometry(AliTRDgeometry *geo) { + // Set geometry. + fGeo = geo; fPla = fGeo->GetPlane(fDet); diff --git a/EVE/EveDet/AliEveTRDModuleImp.h b/EVE/EveDet/AliEveTRDModuleImp.h index cd7b7169843..7af59b08de0 100644 --- a/EVE/EveDet/AliEveTRDModuleImp.h +++ b/EVE/EveDet/AliEveTRDModuleImp.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_TRDModuleImp_H -#define ALIEVE_TRDModuleImp_H +#ifndef AliEveTRDModuleImp_H +#define AliEveTRDModuleImp_H ///////////////////////////////////////////////////////////////////////// // diff --git a/EVE/EveHLT/AliEveHOMERManager.cxx b/EVE/EveHLT/AliEveHOMERManager.cxx index 4c817860652..9086690c4a6 100644 --- a/EVE/EveHLT/AliEveHOMERManager.cxx +++ b/EVE/EveHLT/AliEveHOMERManager.cxx @@ -50,7 +50,11 @@ #include "AliTPCCalibCE.h" #include "AliTPCPreprocessorOnline.h" #include "AliTPCCalROC.h" -// ------------ + +//______________________________________________________________________________ +// +// Manage connections to HLT data-sources. + ClassImp(AliEveHOMERManager) /* @@ -191,6 +195,7 @@ Int_t AliEveHOMERManager::CreateHOMERSourcesList() { // -- New SourceList has been created --> All Sources are new --> State has changed fStateHasChanged = kTRUE; + /* TIter next(fSourceList); AliHLTHOMERSourceDesc* src = 0; while ((src = (AliHLTHOMERSourceDesc*) next())) { @@ -201,6 +206,7 @@ Int_t AliEveHOMERManager::CreateHOMERSourcesList() { "Title?\nNot."); AddElement(re); } + */ if ( iResult ) { AliWarning( Form("There have been errors, while creating the sources list.") ); @@ -745,7 +751,7 @@ Int_t AliEveHOMERManager::NextEvent(){ // -- Create BlockList CreateBlockList(); - return iResult; + return iResult; } //################################################################################## diff --git a/EVE/EveHLT/AliEveHOMERManager.h b/EVE/EveHLT/AliEveHOMERManager.h index 8792c58db57..d078ded9c3b 100644 --- a/EVE/EveHLT/AliEveHOMERManager.h +++ b/EVE/EveHLT/AliEveHOMERManager.h @@ -6,6 +6,7 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ + //-*- Mode: C++ -*- #ifndef ALIEVEHOMERMANGER_H #define ALIEVEHOMERMANGER_H @@ -297,58 +298,57 @@ private: // == XML parser == - /** XML input file */ - TString fXMLFile; // see above + /** */ + TString fXMLFile; // XML input file - /** XML parser into DOM model */ - TDOMParser* fXMLParser; //! transient + /** */ + TDOMParser* fXMLParser; //! XML parser into DOM model - /** Root node of parsed config file */ - TXMLNode * fRootNode; //! transient + /** */ + TXMLNode * fRootNode; //! Root node of parsed config file // == sources == - /** List to HOMER sources */ - TList * fSourceList; //! transient + /** */ + TList * fSourceList; //! List to HOMER sources // == connection == - /** Pointer to HOMER reader */ - AliHLTHOMERReader* fReader; //! transient + /** */ + AliHLTHOMERReader* fReader; //! Pointer to HOMER reader // == blocks == - /** List to HOMER blocks */ - TList * fBlockList; //! transient + /** */ + TList * fBlockList; //! List to HOMER blocks // == events == - /** Number of blockes in current event */ - ULong_t fNBlks; // see above + /** */ + ULong_t fNBlks; // Number of blockes in current event - /** EventID of current event */ - ULong64_t fEventID; // see above + /** */ + ULong64_t fEventID; // EventID of current event - /** Current block in current event */ - ULong_t fCurrentBlk; // see above + /** */ + ULong_t fCurrentBlk; // Current block in current event // == states == - /** Shows connection status */ - Bool_t fConnected; // see above + /** */ + Bool_t fConnected; // Shows connection status - /** Indicates, if a sources have changes, - * so that one has to reconnect . + /** . */ - Bool_t fStateHasChanged; // see above + Bool_t fStateHasChanged; // Indicates, if a sources have changes, so that one has to reconnect. //---- - AliTPCPreprocessorOnline* fTPCPre; + AliTPCPreprocessorOnline* fTPCPre; // Preprocessor for TPC calibration. - ClassDef( AliEveHOMERManager, 0 ) + ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources. }; #endif diff --git a/EVE/EveHLT/AliEveHOMERManagerEditor.h b/EVE/EveHLT/AliEveHOMERManagerEditor.h index ae627172dbf..7014d717e21 100644 --- a/EVE/EveHLT/AliEveHOMERManagerEditor.h +++ b/EVE/EveHLT/AliEveHOMERManagerEditor.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_AliEVEHOMERManagerEditor_H -#define ALIEVE_AliEVEHOMERManagerEditor_H +#ifndef AliEveAliEVEHOMERManagerEditor_H +#define AliEveAliEVEHOMERManagerEditor_H #include diff --git a/EVE/EveHLT/AliEveHOMERSource.cxx b/EVE/EveHLT/AliEveHOMERSource.cxx index 7646b29ff56..5acbb1bea18 100644 --- a/EVE/EveHLT/AliEveHOMERSource.cxx +++ b/EVE/EveHLT/AliEveHOMERSource.cxx @@ -16,14 +16,22 @@ ClassImp(AliEveHOMERSource) AliEveHOMERSource::AliEveHOMERSource(const Text_t* n, const Text_t* t) : - TEveElement(), - TNamed(n, t), - fSource(0) + TEveElement (), + TNamed (n, t), + fSrcId (0), + fSrcState (0) {} -AliEveHOMERSource::AliEveHOMERSource(AliHLTHOMERSourceDesc* src, const Text_t* n, const Text_t* t) : - TEveElement(), - TNamed(n, t), - fSource(src) -{} +/******************************************************************************/ + +//______________________________________________________________________________ +void AliEveHOMERSource::SetRnrState(Bool_t rnr) +{ + // Set render state of this element and of its children to the same + // value. + + if (fSrcState) + fSrcState->fState = rnr; + TEveElement::SetRnrState(rnr); +} diff --git a/EVE/EveHLT/AliEveHOMERSource.h b/EVE/EveHLT/AliEveHOMERSource.h index 7ac003bd9ef..19068741757 100644 --- a/EVE/EveHLT/AliEveHOMERSource.h +++ b/EVE/EveHLT/AliEveHOMERSource.h @@ -7,8 +7,8 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_AliEVEHOMERSource_H -#define ALIEVE_AliEVEHOMERSource_H +#ifndef AliEveAliEVEHOMERSource_H +#define AliEveAliEVEHOMERSource_H #include @@ -17,22 +17,72 @@ class AliHLTHOMERSourceDesc; class AliEveHOMERSource : public TEveElement, - public TNamed + public TNamed { private: AliEveHOMERSource(const AliEveHOMERSource&); // Not implemented AliEveHOMERSource& operator=(const AliEveHOMERSource&); // Not implemented +public: + struct SourceId + { + TString fDet, fSDet, fSSDet, fType; + + struct CmpByDet + { + bool operator()(const SourceId& s1, const SourceId& s2) + { + Int_t r; + if ((r = s1.fDet .CompareTo(s2.fDet) )) return r < 0; + if ((r = s1.fSDet .CompareTo(s2.fSDet) )) return r < 0; + if ((r = s1.fSSDet.CompareTo(s2.fSSDet))) return r < 0; + if ((r = s1.fType .CompareTo(s2.fType) )) return r < 0; + return false; + } + }; + + struct CmpByType + { + bool operator()(const SourceId& s1, const SourceId& s2) + { + Int_t r; + if ((r = s1.fType .CompareTo(s2.fType) )) return r < 0; + if ((r = s1.fDet .CompareTo(s2.fDet) )) return r < 0; + if ((r = s1.fSDet .CompareTo(s2.fSDet) )) return r < 0; + if ((r = s1.fSSDet.CompareTo(s2.fSSDet))) return r < 0; + return false; + } + }; + + }; + + struct SourceState + { + Bool_t fState; + AliHLTHOMERSourceDesc *fHandle; + + SourceState() : fState(kFALSE), fHandle(0) {} + SourceState(Bool_t state) : fState(state), fHandle(0) {} + }; + protected: - AliHLTHOMERSourceDesc *fSource; + const SourceId *fSrcId; + SourceState *fSrcState; public: AliEveHOMERSource(const Text_t* n="HOMER Source", const Text_t* t=""); - AliEveHOMERSource(AliHLTHOMERSourceDesc* src, const Text_t* n="HOMER Source", const Text_t* t=""); virtual ~AliEveHOMERSource() {} - AliHLTHOMERSourceDesc* GetSource() const { return fSource; } - void SetSource(AliHLTHOMERSourceDesc* src) { fSource = src; } + const SourceId* GetSourceId() const { return fSrcId; } + void SetSourceId(const SourceId* id) { fSrcId = id; } + + SourceState* GetSourceState() const { return fSrcState; } + void SetSourceState(SourceState* st) { fSrcState = st; TEveElement::SetRnrState(st->fState); } + + void SetSource(const SourceId* id, SourceState* st) { fSrcId = id; fSrcState = st; TEveElement::SetRnrState(st->fState); } + + virtual Bool_t SingleRnrState() const { return kTRUE; } + virtual void SetRnrState(Bool_t rnr); ClassDef(AliEveHOMERSource, 1); }; // endclass AliEveHOMERSource diff --git a/EVE/EveHLT/AliEveHOMERSourceList.cxx b/EVE/EveHLT/AliEveHOMERSourceList.cxx index 7f3a3b4c448..a1735bce96f 100644 --- a/EVE/EveHLT/AliEveHOMERSourceList.cxx +++ b/EVE/EveHLT/AliEveHOMERSourceList.cxx @@ -8,6 +8,8 @@ **************************************************************************/ #include "AliEveHOMERSourceList.h" +#include "AliEveHOMERSourceMap.h" +#include "AliEveHOMERManager.h" //______________________________________________________________________________ // AliEveHOMERSourceList @@ -16,11 +18,65 @@ ClassImp(AliEveHOMERSourceList) AliEveHOMERSourceList::AliEveHOMERSourceList(const Text_t* n, const Text_t* t) : - TEveElementList(n, t) + TEveElementList(n, t), + fManager (0), + fSrcMap (0) { } +AliEveHOMERSourceList::~AliEveHOMERSourceList() +{ + // !!!!! delete maps +} + +/******************************************************************************/ + +void AliEveHOMERSourceList::CreateByDet() +{ + delete fSrcMap; + fSrcMap = AliEveHOMERSourceMap::Create(AliEveHOMERSourceMap::kSG_ByDet); + RebuildSourceReps(); +} + +void AliEveHOMERSourceList::CreateByType() +{ + delete fSrcMap; + fSrcMap = AliEveHOMERSourceMap::Create(AliEveHOMERSourceMap::kSG_ByType); + RebuildSourceReps(); +} + +void AliEveHOMERSourceList::RebuildSourceReps() +{ + DestroyElements(); + // !!!! if fManager ? + // ???? fManager->CreateHOMERSourcesList(); + TList* srcList = fManager->GetSourceList(); + fSrcMap->FillMap(srcList, 1); + + List_t parentStack; + parentStack.push_back(this); + Int_t parentLvl = 1; + for (AliEveHOMERSourceMap::iterator i=fSrcMap->begin(); i!=fSrcMap->end(); ++i) + { + while (parentLvl > i.level()) { parentStack.pop_back(); --parentLvl; } + + AliEveHOMERSource* src = new AliEveHOMERSource(i.description()); + src->SetSource(&i.id(), &i.state()); + + parentStack.back()->AddElement(src); + + parentStack.push_back(src); ++parentLvl; + + printf("%*s%s [state=%d, handle=0x%lx] {ssdet='%s'}\n", 4*i.level(), "", + i.description().Data(), i.state().fState, + (ULong_t) i.state().fHandle, + i.id().fSSDet.Data()); + } +} + +/******************************************************************************/ +/* void AliEveHOMERSourceList::SelectAll() { EnableListElements(kTRUE, kTRUE); @@ -30,3 +86,4 @@ void AliEveHOMERSourceList::DeselectAll() { DisableListElements (kFALSE, kFALSE); } +*/ diff --git a/EVE/EveHLT/AliEveHOMERSourceList.h b/EVE/EveHLT/AliEveHOMERSourceList.h index fcdb1332b21..3dcc9379b46 100644 --- a/EVE/EveHLT/AliEveHOMERSourceList.h +++ b/EVE/EveHLT/AliEveHOMERSourceList.h @@ -7,13 +7,18 @@ * full copyright notice. * **************************************************************************/ -#ifndef ALIEVE_AliEVEHOMERSourceList_H -#define ALIEVE_AliEVEHOMERSourceList_H +#ifndef AliEveAliEVEHOMERSourceList_H +#define AliEveAliEVEHOMERSourceList_H #include #include +#include + +class AliEveHOMERManager; +class AliEveHOMERSourceMap; + class AliEveHOMERSourceList : public TEveElementList { private: @@ -21,13 +26,29 @@ private: AliEveHOMERSourceList& operator=(const AliEveHOMERSourceList&); // Not implemented protected: + //SourceMap_t fByType; + //ESourceGrouping_e fView; + //Bool_t fDefaultState; + + AliEveHOMERManager *fManager; + AliEveHOMERSourceMap *fSrcMap; public: AliEveHOMERSourceList(const Text_t* n="HOMER Source List", const Text_t* t=""); - virtual ~AliEveHOMERSourceList() {} + virtual ~AliEveHOMERSourceList(); + + // void InitMap(TList* srcHandles, ESourceGrouping_e + + AliEveHOMERManager* GetManager() const { return fManager; } + void SetManager(AliEveHOMERManager* m) { fManager = m; } + + void CreateByDet(); // *MENU* + void CreateByType(); // *MENU* + + void RebuildSourceReps(); - void SelectAll(); // *MENU* - void DeselectAll(); // *MENU* + //void SelectAll(); // *MENU* + //void DeselectAll(); // *MENU* ClassDef(AliEveHOMERSourceList, 1); }; // endclass AliEveHOMERSourceList diff --git a/EVE/EveHLT/AliEveHOMERSourceMap.cxx b/EVE/EveHLT/AliEveHOMERSourceMap.cxx new file mode 100644 index 00000000000..e77e18739fd --- /dev/null +++ b/EVE/EveHLT/AliEveHOMERSourceMap.cxx @@ -0,0 +1,183 @@ +// $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 "AliEveHOMERSourceMap.h" +#include + +#include + +//______________________________________________________________________ +// AliEveHOMERSourceMap +// + +ClassImp(AliEveHOMERSourceMap) + +AliEveHOMERSourceMap::AliEveHOMERSourceMap(ESourceGrouping_e grouping) : + fGrouping(grouping) +{ + +} + +AliEveHOMERSourceMap* AliEveHOMERSourceMap::Create(ESourceGrouping_e grouping) +{ + switch (grouping) + { + case kSG_ByDet: return new AliEveHOMERSourceMapByDet(grouping); + case kSG_ByType: return new AliEveHOMERSourceMapByType(grouping); + } + return 0; +} + +Int_t AliEveHOMERSourceMap::iterator::level() +{ + const AliEveHOMERSource::SourceId& sid = id(); + + Int_t lvl = 0; + if ( ! sid.fDet.IsNull()) ++lvl; + if ( ! sid.fSDet.IsNull()) ++lvl; + if ( ! sid.fSSDet.IsNull()) ++lvl; + if ( ! sid.fType.IsNull()) ++lvl; + return lvl; +} + +void AliEveHOMERSourceMap::PrintXXX() +{ + for (iterator i = begin(); i != end(); ++i) + { + printf("%*s%s [state=%d, handle=0x%lx] {ssdet='%s'}\n", 4*i.level(), "", + i.description().Data(), i.state().fState, + (ULong_t) i.state().fHandle, + i.id().fSSDet.Data()); + } +} + +/******************************************************************************/ +// AliEveHOMERSourceMapByDet +/******************************************************************************/ + +AliEveHOMERSourceMapByDet::AliEveHOMERSourceMapByDet(ESourceGrouping_e grouping) : + AliEveHOMERSourceMap(grouping) +{} + +TString AliEveHOMERSourceMapByDet::iterator_imp::description() +{ + const AliEveHOMERSource::SourceId& sid = id(); + + if ( ! sid.fType.IsNull()) return sid.fType; + if ( ! sid.fSSDet.IsNull()) return sid.fSSDet; + if ( ! sid.fSDet.IsNull()) return sid.fSDet; + if ( ! sid.fDet.IsNull()) return sid.fDet; + return ""; +} + +void AliEveHOMERSourceMapByDet::insert(AliEveHOMERSource::SourceId& sid, + AliEveHOMERSource::SourceState& sst, + Bool_t def_state) +{ + Map_i i = fMap.find(sid); + if (i == fMap.end()) + { + // Check wildcard, else + sst.fState = def_state; + fMap.insert(std::make_pair(sid, sst)); + } +} + +void AliEveHOMERSourceMapByDet::FillMap(TList* handles, Bool_t def_state) +{ + TIter next(handles); + AliHLTHOMERSourceDesc* h; + while ((h = (AliHLTHOMERSourceDesc*) next())) + { + AliEveHOMERSource::SourceId srcid; + AliEveHOMERSource::SourceState srcst; + + srcid.fDet = h->GetDetector(); + insert(srcid, srcst, def_state); + + srcid.fSDet = h->GetSubDetector(); + if ( ! srcid.fSDet.IsNull()) insert(srcid, srcst, def_state); + + srcid.fSSDet = h->GetSubSubDetector(); + if ( ! srcid.fSSDet.IsNull()) insert(srcid, srcst, def_state); + + srcid.fType = h->GetDataType(); + srcst.fHandle = h; + insert(srcid, srcst, def_state); + } +} + + +/******************************************************************************/ +// AliEveHOMERSourceMapByType +/******************************************************************************/ + +AliEveHOMERSourceMapByType::AliEveHOMERSourceMapByType(ESourceGrouping_e grouping) : + AliEveHOMERSourceMap(grouping) +{} + +TString AliEveHOMERSourceMapByType::iterator_imp::description() +{ + const AliEveHOMERSource::SourceId& sid = id(); + + if ( ! sid.fSSDet.IsNull()) return sid.fSSDet; + if ( ! sid.fSDet.IsNull()) return sid.fSDet; + if ( ! sid.fDet.IsNull()) return sid.fDet; + if ( ! sid.fType.IsNull()) return sid.fType; + return ""; +} + +void AliEveHOMERSourceMapByType::insert(AliEveHOMERSource::SourceId& sid, + AliEveHOMERSource::SourceState& sst, + Bool_t def_state) +{ + Map_i i = fMap.find(sid); + if (i == fMap.end()) + { + // Check wildcard, else + sst.fState = def_state; + fMap.insert(std::make_pair(sid, sst)); + } +} + +void AliEveHOMERSourceMapByType::FillMap(TList* handles, Bool_t def_state) +{ + TIter next(handles); + AliHLTHOMERSourceDesc* h; + while ((h = (AliHLTHOMERSourceDesc*) next())) + { + AliEveHOMERSource::SourceId srcid; + AliEveHOMERSource::SourceState srcst; + + srcid.fType = h->GetDataType(); + insert(srcid, srcst, def_state); + + srcid.fDet = h->GetDetector(); + if (h->GetSubDetector().IsNull()) + { + srcst.fHandle = h; + insert(srcid, srcst, def_state); + continue; + } + insert(srcid, srcst, def_state); + + srcid.fSDet = h->GetSubDetector(); + if (h->GetSubSubDetector().IsNull()) + { + srcst.fHandle = h; + insert(srcid, srcst, def_state); + continue; + } + insert(srcid, srcst, def_state); + + srcid.fSSDet = h->GetSubSubDetector(); + srcst.fHandle = h; + insert(srcid, srcst, def_state); + } +} diff --git a/EVE/EveHLT/AliEveHOMERSourceMap.h b/EVE/EveHLT/AliEveHOMERSourceMap.h new file mode 100644 index 00000000000..5f75d4514ec --- /dev/null +++ b/EVE/EveHLT/AliEveHOMERSourceMap.h @@ -0,0 +1,187 @@ +// $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. * + **************************************************************************/ + +#ifndef AliEveAliEveHOMERSourceMap_H +#define AliEveAliEveHOMERSourceMap_H + +#include "AliEveHOMERSource.h" + +#include + +#include + +class AliEveHOMERSourceMap : public TNamed +{ +protected: + struct iterator_imp_base + { + virtual ~iterator_imp_base() {} + + virtual const AliEveHOMERSource::SourceId& id() = 0; + virtual AliEveHOMERSource::SourceState& state() = 0; + + virtual iterator_imp_base* clone() = 0; + + virtual iterator_imp_base& operator++() = 0; + virtual bool operator!=(const iterator_imp_base& o) = 0; + + virtual TString description() = 0; + }; + +public: + struct iterator + { + iterator_imp_base* m_imp; + + iterator() : m_imp(0) {} + iterator(iterator_imp_base* imp) : m_imp(imp) {} + ~iterator() { delete m_imp; } + + iterator& operator= (const iterator& o) { delete m_imp; m_imp = o.m_imp->clone(); return *this; } + bool operator!=(const iterator& o) { return m_imp->operator!=(*o.m_imp); } + + const AliEveHOMERSource::SourceId& id() { return m_imp->id(); } + AliEveHOMERSource::SourceState& state() { return m_imp->state(); } + + Int_t level(); + TString description() { return m_imp->description(); } + + iterator& operator++() { m_imp->operator++(); return *this; } + iterator& skip_children() + { + Int_t lvl = level(); + do operator++(); while (level() > lvl); + return *this; + } + }; + + iterator begin() { return iterator(iterator_imp_begin()); } + iterator end() { return iterator(iterator_imp_end()); } + + enum ESourceGrouping_e { kSG_ByDet, kSG_ByType }; + +protected: + ESourceGrouping_e fGrouping; // Not used so far ... + + virtual iterator_imp_base* iterator_imp_new() = 0; // Not used so far ... + virtual iterator_imp_base* iterator_imp_begin() = 0; + virtual iterator_imp_base* iterator_imp_end() = 0; + +public: + AliEveHOMERSourceMap(ESourceGrouping_e grouping); + virtual ~AliEveHOMERSourceMap() {} + + static AliEveHOMERSourceMap* Create(ESourceGrouping_e grouping); + + virtual void FillMap(TList* handles, Bool_t def_state) = 0; + + void PrintXXX(); + + ClassDef(AliEveHOMERSourceMap, 0); +}; + +/******************************************************************************/ + +class AliEveHOMERSourceMapByDet : public AliEveHOMERSourceMap +{ +protected: + typedef std::map Map_t; + typedef Map_t::iterator Map_i; + + Map_t fMap; + + struct iterator_imp : public iterator_imp_base, + public Map_i + { + iterator_imp() : Map_i() {} + iterator_imp(Map_i mi) : Map_i(mi) {} + virtual ~iterator_imp() {} + + virtual const AliEveHOMERSource::SourceId& id() { return Map_i::operator*().first; } + virtual AliEveHOMERSource::SourceState& state() { return Map_i::operator*().second; } + + virtual iterator_imp* clone() + { return new iterator_imp(*this); } + + virtual iterator_imp& operator++() + { Map_i::operator++(); return *this; } + + virtual bool operator!=(const iterator_imp_base& o) + { return Map_i::operator!=(dynamic_cast(o)); } + + virtual TString description(); + }; + + void insert(AliEveHOMERSource::SourceId& sid, AliEveHOMERSource::SourceState& sst, Bool_t def_state); + + virtual iterator_imp_base* iterator_imp_new() { return new iterator_imp; } + virtual iterator_imp_base* iterator_imp_begin() { return new iterator_imp(fMap.begin()); } + virtual iterator_imp_base* iterator_imp_end() { return new iterator_imp(fMap.end()); } + +public: + AliEveHOMERSourceMapByDet(ESourceGrouping_e grouping); + virtual ~AliEveHOMERSourceMapByDet() {} + + virtual void FillMap(TList* handles, Bool_t def_state); + + // ClassDef(AliEveHOMERSourceMapByDet, 1); +}; + +/******************************************************************************/ + +class AliEveHOMERSourceMapByType : public AliEveHOMERSourceMap +{ +protected: + typedef std::map Map_t; + typedef Map_t::iterator Map_i; + + Map_t fMap; + + struct iterator_imp : public iterator_imp_base, + public Map_i + { + iterator_imp() : Map_i() {} + iterator_imp(Map_i mi) : Map_i(mi) {} + virtual ~iterator_imp() {} + + virtual const AliEveHOMERSource::SourceId& id() { return Map_i::operator*().first; } + virtual AliEveHOMERSource::SourceState& state() { return Map_i::operator*().second; } + + virtual iterator_imp* clone() + { return new iterator_imp(*this); } + + virtual iterator_imp& operator++() + { Map_i::operator++(); return *this; } + + virtual bool operator!=(const iterator_imp_base& o) + { return Map_i::operator!=(dynamic_cast(o)); } + + virtual TString description(); + }; + + void insert(AliEveHOMERSource::SourceId& sid, AliEveHOMERSource::SourceState& sst, Bool_t def_state); + + virtual iterator_imp_base* iterator_imp_new() { return new iterator_imp; } + virtual iterator_imp_base* iterator_imp_begin() { return new iterator_imp(fMap.begin()); } + virtual iterator_imp_base* iterator_imp_end() { return new iterator_imp(fMap.end()); } + +public: + AliEveHOMERSourceMapByType(ESourceGrouping_e grouping); + virtual ~AliEveHOMERSourceMapByType() {} + + virtual void FillMap(TList* handles, Bool_t def_state); + + // ClassDef(AliEveHOMERSourceMapByType, 1); +}; + +#endif diff --git a/EVE/EveHLT/LinkDef.h b/EVE/EveHLT/LinkDef.h index 97584c6211a..9aee420b6c8 100644 --- a/EVE/EveHLT/LinkDef.h +++ b/EVE/EveHLT/LinkDef.h @@ -15,3 +15,5 @@ #pragma link C++ class AliEveHOMERManagerEditor+; #pragma link C++ class AliEveHOMERSource+; #pragma link C++ class AliEveHOMERSourceList+; + +#pragma link C++ class AliEveHOMERSourceMap+; diff --git a/EVE/alice-macros/MUON_display.C b/EVE/alice-macros/MUON_display.C index 3ea25617492..22457ed1b81 100644 --- a/EVE/alice-macros/MUON_display.C +++ b/EVE/alice-macros/MUON_display.C @@ -34,29 +34,29 @@ void MUON_display(Bool_t fromRaw = kFALSE, Bool_t showTracks = kTRUE) TTree* ct = 0; TTree* ht = 0; - if (gEvent == 0) { + if (gAliEveEvent == 0) { printf("No alieve event: use alieve_init(...) \n"); return; } - if (g_currentEvent == gEvent->GetEventId()) { + if (g_currentEvent == gAliEveEvent->GetEventId()) { if (g_fromRaw == fromRaw) { printf("Same event... \n"); return; } else { if (g_fromRaw) { printf("Same event with digits.\n"); - gEvent->GotoEvent(g_currentEvent); + gAliEveEvent->GotoEvent(g_currentEvent); } else { printf("Same event with raw.\n"); - gEvent->GotoEvent(g_currentEvent); + gAliEveEvent->GotoEvent(g_currentEvent); } } } g_fromRaw = fromRaw; - TString dataPath = TString(gEvent->GetTitle()); + TString dataPath = TString(gAliEveEvent->GetTitle()); dataPath.Append("/rawmuon.root"); AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); @@ -83,7 +83,7 @@ void MUON_display(Bool_t fromRaw = kFALSE, Bool_t showTracks = kTRUE) rl->LoadRecPoints("MUON"); ct = rl->GetTreeR("MUON", false); - TString esdDataPath = TString(gEvent->GetTitle()); + TString esdDataPath = TString(gAliEveEvent->GetTitle()); esdDataPath.Append("/AliESDs.root"); g_muon_data->LoadRecPointsFromESD(esdDataPath.Data()); @@ -91,7 +91,7 @@ void MUON_display(Bool_t fromRaw = kFALSE, Bool_t showTracks = kTRUE) ht = rl->GetTreeH("MUON", false); g_muon_data->LoadHits(ht); - g_muon_last_event = gEvent; + g_muon_last_event = gAliEveEvent; g_currentEvent = g_muon_last_event->GetEventId(); @@ -262,13 +262,13 @@ void MUON_ESD_tracks() //______________________________________________________________________________ void MUON_Ref_tracks() { - TString dataPathESD = TString(gEvent->GetTitle()); + TString dataPathESD = TString(gAliEveEvent->GetTitle()); dataPathESD.Append("/AliESDs.root"); - TString dataPathSIM = TString(gEvent->GetTitle()); + TString dataPathSIM = TString(gAliEveEvent->GetTitle()); dataPathSIM.Append("/"); AliMUONRecoCheck recoCheck(dataPathESD.Data(),dataPathSIM.Data()); - AliMUONVTrackStore* trackRefStore = recoCheck.ReconstructibleTracks(gEvent->GetEventId()); + AliMUONVTrackStore* trackRefStore = recoCheck.ReconstructibleTracks(gAliEveEvent->GetEventId()); TIter next(trackRefStore->CreateIterator()); AliMUONTrack* trackRef; diff --git a/EVE/alice-macros/MUON_geom.C b/EVE/alice-macros/MUON_geom.C index efd3ee20b4b..b1bfb606531 100644 --- a/EVE/alice-macros/MUON_geom.C +++ b/EVE/alice-macros/MUON_geom.C @@ -9,7 +9,6 @@ void MUON_geom() { - gGeoManager = gEve->GetGeometry("$REVESYS/alice-data/alice_fullgeo.root"); TEveElementList* list = new TEveElementList("DiMUON"); diff --git a/EVE/alice-macros/MUON_geomAll.C b/EVE/alice-macros/MUON_geomAll.C index a95e6472e40..92eca3662eb 100644 --- a/EVE/alice-macros/MUON_geomAll.C +++ b/EVE/alice-macros/MUON_geomAll.C @@ -9,7 +9,6 @@ void MUON_geomAll() { - gGeoManager = gEve->GetGeometry("$REVESYS/alice-data/alice_fullgeo.root"); TEveGeoTopNode* topn_re = new TEveGeoTopNode diff --git a/EVE/alice-macros/NLT_test.C b/EVE/alice-macros/NLT_test.C deleted file mode 100644 index e2e176693f3..00000000000 --- a/EVE/alice-macros/NLT_test.C +++ /dev/null @@ -1,33 +0,0 @@ -// $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. * - **************************************************************************/ - -TEveProjectionManager* NLT_test(TEveElement* top=0) -{ - TEveScene* s = gEve->SpawnNewScene("Projected Event"); - gEve->GetDefViewer()->AddScene(s); - - TGLViewer* v = (TGLViewer *)gEve->GetGLViewer(); - v->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); - TGLCameraMarkupStyle* mup = v->GetCameraMarkup(); - if(mup) mup->SetShow(kFALSE); - - TEveProjectionManager* p = new TEveProjectionManager; - p->SetProjection(TEveProjection::kPT_RhoZ, 0.01); - - gEve->AddToListTree(p, kTRUE); - gEve->AddElement(p, s); - - top = gEve->GetCurrentEvent(); - if (top) - p->ImportElements(top); - - gEve->Redraw3D(kTRUE); - - return p; -} diff --git a/EVE/alice-macros/NLT_trackcount_init.C b/EVE/alice-macros/NLT_trackcount_init.C index eca2d8a6815..d527c5aeb08 100644 --- a/EVE/alice-macros/NLT_trackcount_init.C +++ b/EVE/alice-macros/NLT_trackcount_init.C @@ -11,8 +11,8 @@ class TEveProjectionManager; class TEveGeoShape; class TEveUtil; -TEveProjectionManager * proj = 0; -TEveGeoShape * geom = 0; +TEveProjectionManager *proj = 0; +TEveGeoShape *geom = 0; void NLT_trackcount_init() { @@ -37,17 +37,25 @@ void NLT_trackcount_init() TEveTrackCounter* g_trkcnt = new TEveTrackCounter("Primary Counter"); gEve->AddToListTree(g_trkcnt, kFALSE); - TEveProjectionManager* p = new TEveProjectionManager; proj = p; - gEve->AddToListTree(p, kTRUE); + TEveProjectionManager* pm = new TEveProjectionManager(); + proj = pm; + gEve->AddToListTree(proj, kTRUE); gEve->AddElement(proj, ns); + + TEveProjectionAxes* axes = new TEveProjectionAxes(proj); + axes->SetText("Projected Track-Count"); + axes->SetFontFile("comicbd"); + axes->SetFontSize(20); + gEve->AddElement(axes, ns); + gEve->AddToListTree(axes, kTRUE); // geometry TEveGeoShape* gg = geom_gentle(); geom = gg; // event - gEvent->AddNewEventCommand("on_new_event();"); - gEvent->GotoEvent(0); + gAliEveEvent->AddNewEventCommand("on_new_event();"); + gAliEveEvent->GotoEvent(0); gEve->Redraw3D(kTRUE); } @@ -77,7 +85,7 @@ void on_new_event() Int_t count = 1; TEveTrackCounter* g_trkcnt = TEveTrackCounter::fgInstance; g_trkcnt->Reset(); - g_trkcnt->SetEventId(gEvent->GetEventId()); + g_trkcnt->SetEventId(gAliEveEvent->GetEventId()); TEveElement::List_i i = cont->BeginChildren(); while (i != cont->EndChildren()) { TEveTrackList* l = dynamic_cast(*i); diff --git a/EVE/alice-macros/emcal_digits.C b/EVE/alice-macros/emcal_digits.C index b89694a9a5f..d594c82f2fa 100644 --- a/EVE/alice-macros/emcal_digits.C +++ b/EVE/alice-macros/emcal_digits.C @@ -50,7 +50,7 @@ void emcal_digits() q->SetDefWidth (geom->GetPhiTileSize()); q->SetDefHeight(geom->GetEtaTileSize()); - q->RefHMTrans().SetFrom(*node->GetDaughter(sm)->GetMatrix()); + q->RefMainTrans().SetFrom(*node->GetDaughter(sm)->GetMatrix()); q->SetFrame(sm < 10 ? frame_big : frame_sml); q->SetPalette(pal); diff --git a/EVE/alice-macros/esd_tracks.C b/EVE/alice-macros/esd_tracks.C index a6f9930dd7a..61462d2643e 100644 --- a/EVE/alice-macros/esd_tracks.C +++ b/EVE/alice-macros/esd_tracks.C @@ -8,9 +8,9 @@ **************************************************************************/ TEveTrack* esd_make_track(TEveTrackPropagator* rnrStyle, - Int_t index, - AliESDtrack* at, - AliExternalTrackParam* tp=0) + Int_t index, + AliESDtrack* at, + AliExternalTrackParam* tp=0) { // Helper function Double_t pbuf[3], vbuf[3]; @@ -53,16 +53,17 @@ void esd_track_add_param(TEveTrack* track, AliExternalTrackParam* tp) tp->GetXYZ(vbuf); tp->GetPxPyPz(pbuf); - TEvePathMark* pm = new TEvePathMark(TEvePathMark::kReference); - pm->fV.Set(vbuf); - pm->fP.Set(pbuf); + TEvePathMark pm(TEvePathMark::kReference); + pm.fV.Set(vbuf); + pm.fP.Set(pbuf); track->AddPathMark(pm); } -/******************************************************************************/ - +// Use inner-tpc track params when its refit failed. Bool_t gkFixFailedITSExtr = kFALSE; -Bool_t gkMakeTrackParamLines = kTRUE; + +// Also show lines as generated by AliESDtrack. +Bool_t gkMakeTrackParamLines = kFALSE; TEveTrackList* esd_tracks(Double_t min_pt=0.1, Double_t max_pt=100) { @@ -112,10 +113,9 @@ TEveTrackList* esd_tracks(Double_t min_pt=0.1, Double_t max_pt=100) TEveTrack* track = esd_make_track(rnrStyle, n, at, tp); track->SetAttLineAttMarker(cont); - // Needs eve development brach from ROOT. - // if (!innerTaken) { - // esd_track_add_param(track, at->GetInnerParam()); - // } + if (!innerTaken) { + esd_track_add_param(track, at->GetInnerParam()); + } // esd_track_add_param(track, at->GetOuterParam()); gEve->AddElement(track, cont); diff --git a/EVE/alice-macros/event_goto.C b/EVE/alice-macros/event_goto.C index 6116281e60f..30f3b15e707 100644 --- a/EVE/alice-macros/event_goto.C +++ b/EVE/alice-macros/event_goto.C @@ -9,9 +9,9 @@ void event_goto(Int_t event=0) { - if (gEvent == 0) { + if (gAliEveEvent == 0) { printf("AliEveEventManager is not initialized!\n"); return; } - gEvent->GotoEvent(event); + gAliEveEvent->GotoEvent(event); } diff --git a/EVE/alice-macros/event_next.C b/EVE/alice-macros/event_next.C index d25936ebf34..13a59f98fe4 100644 --- a/EVE/alice-macros/event_next.C +++ b/EVE/alice-macros/event_next.C @@ -9,9 +9,9 @@ void event_next() { - if (gEvent == 0) { + if (gAliEveEvent == 0) { printf("AliEveEventManager is not initialized!\n"); return; } - gEvent->NextEvent(); + gAliEveEvent->NextEvent(); } diff --git a/EVE/alice-macros/event_prev.C b/EVE/alice-macros/event_prev.C index 1775f575c8c..0ba6b55f38d 100644 --- a/EVE/alice-macros/event_prev.C +++ b/EVE/alice-macros/event_prev.C @@ -9,9 +9,9 @@ void event_prev() { - if (gEvent == 0) { + if (gAliEveEvent == 0) { printf("AliEveEventManager is not initialized!\n"); return; } - gEvent->PrevEvent(); + gAliEveEvent->PrevEvent(); } diff --git a/EVE/alice-macros/geom_gentle.C b/EVE/alice-macros/geom_gentle.C index 9203a5e0738..09430a5e94b 100644 --- a/EVE/alice-macros/geom_gentle.C +++ b/EVE/alice-macros/geom_gentle.C @@ -11,7 +11,8 @@ TEveGeoShape* geom_gentle() { TFile f("$REVESYS/alice-data/gentle_geo.root"); TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle"); - TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse, 0); + TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse); + gEve->AddGlobalElement(gsre); f.Close(); return gsre; diff --git a/EVE/alice-macros/geom_vzero.C b/EVE/alice-macros/geom_vzero.C index 47053f788db..05ba6166f21 100644 --- a/EVE/alice-macros/geom_vzero.C +++ b/EVE/alice-macros/geom_vzero.C @@ -9,7 +9,7 @@ void geom_vzero() { - static const TEveException eH("geom_vzero() "); + static const TEveException kEH("geom_vzero() "); gGeoManager = gEve->GetGeometry("$REVESYS/alice-data/alice_fullgeo.root"); @@ -21,14 +21,14 @@ void geom_vzero() TGeoNode* mnode = gGeoManager->GetTopVolume()->FindNode("VZERO_1"); if (!mnode) { - Error(eH, "mother node not found."); + Error(kEH, "mother node not found."); return; } node = mnode->GetVolume()->FindNode("V0RI_1"); printf("opofoih %p\n", node); if (!node) { - Error(eH, "V0R not found."); + Error(kEH, "V0R not found."); return; } re = new TEveGeoTopNode(gGeoManager, node); @@ -37,7 +37,7 @@ void geom_vzero() node = mnode->GetVolume()->FindNode("V0LE_1"); if (!node) { - Error(eH, "V0L not found."); + Error(kEH, "V0L not found."); return; } re = new TEveGeoTopNode(gGeoManager, node); diff --git a/EVE/alice-macros/primary_vertex.C b/EVE/alice-macros/primary_vertex.C index e28996ca64b..1703c2b7d4d 100644 --- a/EVE/alice-macros/primary_vertex.C +++ b/EVE/alice-macros/primary_vertex.C @@ -100,7 +100,7 @@ TEveStraightLineSet* ESDvertex_lineset(AliESDVertex* v, const Text_t* name) // centre marker ls->AddMarker(0, 0.5); - ls->RefHMTrans().SetPos(x); + ls->RefMainTrans().SetPos(x); return ls; } diff --git a/EVE/alice-macros/t0_raw.C b/EVE/alice-macros/t0_raw.C index 5db2a4100dd..8749eebb398 100644 --- a/EVE/alice-macros/t0_raw.C +++ b/EVE/alice-macros/t0_raw.C @@ -10,7 +10,7 @@ void t0_raw() { AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); - Int_t ievt = gEvent->GetEventId(); + Int_t ievt = gAliEveEvent->GetEventId(); cout<SetPalette(1, 0); diff --git a/EVE/alice-macros/tpc_digits.C b/EVE/alice-macros/tpc_digits.C index 409a254b780..d55e8c3b42c 100644 --- a/EVE/alice-macros/tpc_digits.C +++ b/EVE/alice-macros/tpc_digits.C @@ -15,7 +15,7 @@ AliEveEventManager *g_tpc_last_event = 0; void tpc_digits(Int_t mode=1) { - if (g_tpc_data == 0 || g_tpc_last_event != gEvent) + if (g_tpc_data == 0 || g_tpc_last_event != gAliEveEvent) { AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); rl->LoadDigits("TPC"); @@ -24,7 +24,7 @@ void tpc_digits(Int_t mode=1) g_tpc_data = new AliEveTPCData; g_tpc_data->LoadDigits(dt, kTRUE); // Create all present sectors. - g_tpc_last_event = gEvent; + g_tpc_last_event = gAliEveEvent; } // Viewport limits. @@ -153,7 +153,7 @@ void tpc_digits_2drange(Int_t start, Int_t end) if (start < 0) start = 0; if (end > 35) end = 35; - if (g_tpc_data == 0 || g_tpc_last_event != gEvent) { + if (g_tpc_data == 0 || g_tpc_last_event != gAliEveEvent) { AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); rl->LoadDigits("TPC"); TTree* dt = rl->GetTreeD("TPC", false); @@ -161,7 +161,7 @@ void tpc_digits_2drange(Int_t start, Int_t end) g_tpc_data = new AliEveTPCData; g_tpc_data->LoadDigits(dt, kTRUE); // Create all present sectors. - g_tpc_last_event = gEvent; + g_tpc_last_event = gAliEveEvent; } gStyle->SetPalette(1, 0); diff --git a/EVE/alice-macros/vzero_digits.C b/EVE/alice-macros/vzero_digits.C index 5f516d3c8a2..2ff7d236f85 100644 --- a/EVE/alice-macros/vzero_digits.C +++ b/EVE/alice-macros/vzero_digits.C @@ -87,8 +87,8 @@ void vzero_digits() } } - modL->RefHMTrans().SetPos(0, 0, 324); - modR->RefHMTrans().SetPos(0, 0, -84); + modL->RefMainTrans().SetPos(0, 0, 324); + modR->RefMainTrans().SetPos(0, 0, -84); gEve->AddElement(modL); gEve->AddElement(modR); diff --git a/EVE/alieve_main/alieve_main.cxx b/EVE/alieve_main/alieve_main.cxx index c71397f7c93..e8350b48286 100644 --- a/EVE/alieve_main/alieve_main.cxx +++ b/EVE/alieve_main/alieve_main.cxx @@ -20,19 +20,19 @@ int main(int argc, char **argv) { - static const TEveException eH("alieve::main"); + static const TEveException kEH("alieve::main"); if (gSystem->Getenv("REVESYS") == 0) { if (gSystem->Getenv("ALICE_ROOT") != 0) { - Info(eH.Data(), "setting REVESYS from ALICE_ROOT."); + Info(kEH.Data(), "setting REVESYS from ALICE_ROOT."); gSystem->Setenv("REVESYS", Form("%s/EVE", gSystem->Getenv("ALICE_ROOT"))); } else { - Error(eH.Data(), "REVESYS not defined, neither is ALICE_ROOT."); + Error(kEH.Data(), "REVESYS not defined, neither is ALICE_ROOT."); gSystem->Exit(1); } } if (gSystem->AccessPathName(gSystem->Getenv("REVESYS")) == kTRUE) { - Error(eH.Data(), "REVESYS '%s' does not exist.", gSystem->Getenv("REVESYS")); + Error(kEH.Data(), "REVESYS '%s' does not exist.", gSystem->Getenv("REVESYS")); gSystem->Exit(1); } diff --git a/EVE/binalieve.pkg b/EVE/binalieve.pkg index 1d1bfea0589..cce9c6a3bdd 100644 --- a/EVE/binalieve.pkg +++ b/EVE/binalieve.pkg @@ -5,8 +5,10 @@ $(BINPATH)/alieve: $(EveBaseLIB) $(EveDetLIB) $(EveHLTLIB) EINCLUDE := ELIBSDIR := + ELIBS := EveBase EveDet EveHLT \ - MUONevaluation MUONgeometry MUONrec MUONsim MUONbase MUONtrigger MUONraw MUONcalib MUONmapping MUONcore \ + MUONbase MUONevaluation MUONmapping MUONshuttle MUONcalib MUONgeometry \ + MUONraw MUONsim MUONcore MUONgraphics MUONrec MUONtrigger \ TPCbase TPCsim TPCrec TPCfast \ ITSbase ITSsim ITSrec PMDbase PMDsim PMDrec TRDbase \ TRDsim TRDrec TRDfast \ diff --git a/EVE/hlt-macros/homer_display.C b/EVE/hlt-macros/homer_display.C index 9754c3601fc..f17737551da 100644 --- a/EVE/hlt-macros/homer_display.C +++ b/EVE/hlt-macros/homer_display.C @@ -64,12 +64,13 @@ void process_tpc_clusters(AliHLTHOMERBlockDesc* b); //**************************************************************************** void homer_display() { - homerM = new AliEveHOMERManager("/local/home/hlt/TPC-SCC1-Generate.xml"); - // homerM = new AliEveHOMERManager("/local/home/hlt/sampleConfig2.xml"); + // homerM = new AliEveHOMERManager("/local/home/hlt/TPC-SCC1-Generate.xml"); + homerM = new AliEveHOMERManager("./sampleConfig.xml"); gEve->AddToListTree(homerM, kTRUE); homerM->CreateHOMERSourcesList(); + // homerM->SelectRawTPC(); homerM->SelectClusterTPC(); homerM->SelectESDTPC(); diff --git a/EVE/hlt-macros/sampleConfig.xml b/EVE/hlt-macros/sampleConfig.xml new file mode 100755 index 00000000000..7dbc3773426 --- /dev/null +++ b/EVE/hlt-macros/sampleConfig.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + TCPDumpSubscriber -port 51000 + TPC_CalibPedestal_A15 + master + + + + + TCPDumpSubscriber -port 51001 + TPC_RP_A15_02 + TPC_RP_A15_03 + TPC_RP_A15_04 + TPC_RP_A15_05 + master + + + + diff --git a/EVE/hlt-macros/test_sources.C b/EVE/hlt-macros/test_sources.C new file mode 100644 index 00000000000..b21f34379d1 --- /dev/null +++ b/EVE/hlt-macros/test_sources.C @@ -0,0 +1,31 @@ +AliEveHOMERManager* homerM = 0; + +void test_sources() +{ + homerM = new AliEveHOMERManager("./sampleConfig.xml"); + + gEve->AddToListTree(homerM, kTRUE); + + homerM->CreateHOMERSourcesList(); + + AliEveHOMERSourceList* srcL = new AliEveHOMERSourceList("Sources"); + srcL->SetManager(homerM); + homerM->AddElement(srcL); + + srcL->CreateByType(); + + /* + TList* srcList = homerM->GetSourceList(); + + AliEveHOMERSourceMap* smd = AliEveHOMERSourceMap::Create(AliEveHOMERSourceMap::kSG_ByDet); + smd->FillMap(srcList, 1); + printf(" **** ByDet XXX ****\n"); + smd->PrintXXX(); + + AliEveHOMERSourceMap* smt = AliEveHOMERSourceMap::Create(AliEveHOMERSourceMap::kSG_ByType); + smt->FillMap(srcList, 1); + printf(" **** ByType XXX ****\n"); + smt->PrintXXX(); + + */ +} diff --git a/EVE/macros/alieve_init.C b/EVE/macros/alieve_init.C index 48f5018490c..8046af138d4 100644 --- a/EVE/macros/alieve_init.C +++ b/EVE/macros/alieve_init.C @@ -34,9 +34,9 @@ void alieve_init(const Text_t* path = ".", Int_t event=0, AliEveEventManager::SetCdbUri(cdburi); AliEveEventManager::SetAssertElements(assert_runloader, assert_esd); printf("Opening event %d from '%s' ...", event, path); fflush(stdout); - gEvent = new AliEveEventManager(path, event); + gAliEveEvent = new AliEveEventManager(path, event); printf(" done.\n"); - gEve->AddEvent(gEvent); + gEve->AddEvent(gAliEveEvent); } } diff --git a/EVE/macros/trackcount_init.C b/EVE/macros/trackcount_init.C index b455da79ee2..83ad42b38f5 100644 --- a/EVE/macros/trackcount_init.C +++ b/EVE/macros/trackcount_init.C @@ -20,8 +20,8 @@ void trackcount_init() TEveTrackCounter* g_trkcnt = new TEveTrackCounter("Primary Counter"); gEve->AddGlobalElement(g_trkcnt); - gEvent->AddNewEventCommand("on_new_event();"); - gEvent->GotoEvent(0); + gAliEveEvent->AddNewEventCommand("on_new_event();"); + gAliEveEvent->GotoEvent(0); gEve->Redraw3D(kTRUE); } @@ -47,7 +47,7 @@ void on_new_event() Int_t count = 1; TEveTrackCounter* g_trkcnt = TEveTrackCounter::fgInstance; g_trkcnt->Reset(); - g_trkcnt->SetEventId(gEvent->GetEventId()); + g_trkcnt->SetEventId(gAliEveEvent->GetEventId()); TEveElement::List_i i = cont->BeginChildren(); while (i != cont->EndChildren()) { TEveTrackList* l = dynamic_cast(*i); -- 2.43.0