**************************************************************************/
#include "AliEveEventManager.h"
-#include <TEveUtil.h>
#include <TEveManager.h>
#include <AliRunLoader.h>
#include <TFile.h>
#include <TTree.h>
-#include <TError.h>
-
-#include <TROOT.h>
#include <TSystem.h>
+//==============================================================================
+//==============================================================================
+// AliEveEventManager
+//==============================================================================
//______________________________________________________________________________
-// AliEveEventManager
//
// Provide interface for loading and navigating standard AliRoot data
// (AliRunLoader) and ESDs.
// 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;
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()
// 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] != '/')
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)
{
}
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();
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);
}
// 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)
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);
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);
// 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()
// 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()
// 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()
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);
}
// !!!! Should we set gGeoManager here?
- static const TEveException eH("AliEveEventManager::AssertGeometry ");
+ static const TEveException kEH("AliEveEventManager::AssertGeometry ");
if (AliGeomManager::GetGeometry() == 0)
{
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.");
}
}
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_EventAlieve_H
-#define ALIEVE_EventAlieve_H
+#ifndef AliEveEventManaget_H
+#define AliEveEventManager_H
#include <TEveEventManager.h>
class TTree;
class TGeoManager;
+//==============================================================================
+//
+// AliEveEventManager
+//
+// Interface to ALICE event-data (RunLoader, ESD), magnetic field and
+// geometry.
+//
+
class AliEveEventManager : public TEveEventManager
{
AliEveEventManager();
AliEveEventManager(TString path, Int_t ev=0);
+ virtual ~AliEveEventManager();
+
virtual void Open();
virtual void GotoEvent(Int_t event);
ClassDef(AliEveEventManager, 1);
}; // endclass AliEveEventManager
-extern AliEveEventManager* gEvent;
+extern AliEveEventManager* gAliEveEvent;
#endif
**************************************************************************/
#include "AliEveJetPlane.h"
-#include <TString.h>
+
+#include <TEveTrans.h>
+
#include <TBuffer3D.h>
#include <TBuffer3DTypes.h>
#include <TVirtualPad.h>
//______________________________________________________________________________
//
// Show jets and tracks in eta-phi plane.
+//
+//
ClassImp(AliEveJetPlane)
fGridColor(5),
- fHMTrans(),
fJets(),
fTracks(),
fSelectionFlag (1)
{
SetMainColorPtr(&fGridColor);
+ InitMainTrans();
}
/******************************************************************************/
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);
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_JetPlane_H
-#define ALIEVE_JetPlane_H
+#ifndef AliEveJetPlane_H
+#define AliEveJetPlane_H
-#include <TEveUtil.h>
#include <TEveElement.h>
-#include <TEveTrans.h>
#include <TAtt3D.h>
#include <TAttBBox.h>
#include <vector>
+//==============================================================================
+//
+// AliEveJetPlane
+//
+// Class for display of jets and tracks in eta-phi plane.
class AliEveJetPlane : public TEveElementList,
public TAtt3D,
Color_t fGridColor; // Color of coordinate grid.
- TEveTrans fHMTrans;// Transformation matrix.
-
std::vector<AliAODJet> fJets; // Jets to display.
std::vector<AliAODTrack> fTracks; // Tracks to display.
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
#include <TEveGValuators.h>
-#include <TVirtualPad.h>
-#include <TColor.h>
-#include <TROOT.h>
-#include <TGLabel.h>
#include <TGButton.h>
#include <TGNumberEntry.h>
-#include <TGColorSelect.h>
-#include <TGDoubleSlider.h>
#include <TGFrame.h>
#include <TGTab.h>
+//==============================================================================
+//==============================================================================
+// AliEveJetPlaneEditor
+//==============================================================================
//______________________________________________________________________________
-// AliEveJetPlaneEditor
//
+// GUI editor for AliEveJetPlane class.
AliEveJetPlaneEditor::StaticDataWindow* AliEveJetPlaneEditor::fgStaticWindow = 0;
}
-/******************************************************************************/
-/******************************************************************************/
+//==============================================================================
+//==============================================================================
+// AliEveJetPlaneEditor::StaticDataWindow
+//==============================================================================
//______________________________________________________________________________
//
// Common settings for all AliEveJetPlane objects.
+// Used as a pop-up from AliEveJetPlaneEditor.
ClassImp(AliEveJetPlaneEditor::StaticDataWindow)
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_JetPlaneEditor_H
-#define ALIEVE_JetPlaneEditor_H
+#ifndef AliEveJetPlaneEditor_H
+#define AliEveJetPlaneEditor_H
#include <TGedFrame.h>
-#include <RQ_OBJECT.h>
class TGButton;
class TGCheckButton;
class TGNumberEntry;
class TGColorSelect;
-
class TEveGValuator;
-
-// class TEveGValuator;
-
class AliEveJetPlane;
class AliEveJetPlaneEditor : public TGedFrame
#include "AliEveJetPlaneGL.h"
#include "AliEveJetPlane.h"
-#include <TGLRnrCtx.h>
#include <TGLSelectRecord.h>
#include <TGLIncludes.h>
#include <TStyle.h>
#include <TROOT.h>
+//==============================================================================
+//==============================================================================
+// AliEveJetPlaneGL
+//==============================================================================
//______________________________________________________________________________
//
// 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
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);
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);
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_JetPlaneGL_H
-#define ALIEVE_JetPlaneGL_H
+#ifndef AliEveJetPlaneGL_H
+#define AliEveJetPlaneGL_H
#include <TGLObject.h>
class TGLViewer;
class TGLScene;
-
class AliEveJetPlane;
+//==============================================================================
+//
+// AliEveJetPlaneGL
+//
+// GL rendering code for AliEveJetPlane class.
+
class AliEveJetPlaneGL : public TGLObject
{
private:
// Tools for import of kinematics. Preliminary version.
//
-using namespace std;
-
ClassImp(AliEveKineTools)
-
namespace {
typedef std::map<Int_t, TEveTrack*> TrackMap_t;
{
TEveTrack* track = dynamic_cast<TEveTrack*>(*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);
{
// 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);
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
{
// Sort path-marks for all tracks by time.
+ // !!!!! MT ... this is one level deep only!
+
TEveTrack* track = dynamic_cast<TEveTrack*>(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<TEveTrack*>(el);
if (track) track->SortPathMarksByTime();
- i++;
+ ++i;
}
}
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_KineTools_H
-#define ALIEVE_KineTools_H
+#ifndef AliEveKineTools_H
+#define AliEveKineTools_H
#include <TEveUtil.h>
#include <TObject.h>
#include "TCanvas.h"
#include "TGraph.h"
#include "TGraphErrors.h"
+#include "TQObject.h"
-#include "AliCluster.h"
#include "AliRieman.h"
#include "AliExternalTrackParam.h"
#include <TEveManager.h>
-//______________________________________________________________________________
+//==============================================================================
+//==============================================================================
// 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),
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();
{
// 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;
}
}
{
// 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<TEvePointSet*>((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();
using namespace TMath;
- if(fRieman) delete fRieman;
+ if (fRieman) delete fRieman;
fRieman = new AliRieman(Size());
Float_t x, y, z;
// 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);
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TrackFitter_H
-#define ALIEVE_TrackFitter_H
+#ifndef AliEveTrackFitter_H
+#define AliEveTrackFitter_H
#include <TEvePointSet.h>
#include <map>
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<Point_t, Int_t> PointMap_t;
+ typedef std::map<Point_t, Int_t> 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.
};
#include <TGButton.h>
+//==============================================================================
+//==============================================================================
+// AliEveTrackFitterEditor
+//==============================================================================
//______________________________________________________________________________
-// AliEveTrackFitterEditor
//
+// GUI editor for class AliEveTrackFitter
ClassImp(AliEveTrackFitterEditor)
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TrackFitterEditor_H
-#define ALIEVE_TrackFitterEditor_H
+#ifndef AliEveTrackFitterEditor_H
+#define AliEveTrackFitterEditor_H
#include <TGedFrame.h>
class TGNumberEntry;
class TGColorSelect;
-
class AliEveTrackFitter;
class AliEveTrackFitterEditor : public TGedFrame
#include "AliEveVSDCreator.h"
-#include <TEveTreeTools.h>
-
#include <AliStack.h>
#include <AliITSLoader.h>
#include <AliTPCTrackHitsV2.h>
#include <AliPDG.h>
#include <AliHit.h>
-#include <AliSimDigits.h>
-#include <AliKalmanTrack.h>
#include <AliESDEvent.h>
#include <AliESDv0.h>
#include <AliTPCclusterMI.h>
#include <AliTPCClustersRow.h>
-#include <AliITS.h>
#include <AliITSclusterV2.h>
-#include <AliTrackReference.h>
#include <AliESDkink.h>
#include <AliESDtrack.h>
#include <AliRun.h>
+#include <AliRunLoader.h>
#include <AliTPCParam.h>
#include <TSystem.h>
#include <TFile.h>
-#include <TError.h>
//______________________________________________________________________________
//
//
// 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;
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();
// 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();
fRunLoader = 0;
if(fDebugLevel > 0)
- printf("%s all done.\n", eH.Data());
+ printf("%s all done.\n", kEH.Data());
}
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.");
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;
}
// 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");
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);
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 },
// 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.");
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;
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;
}
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
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;
// 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");
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); }
}
/******************************************************************************/
{
// Convert TPC clusters and transform them to global coordinates.
- static const TEveException eH("AliEveVSDCreator::ConvertTPCClusters ");
+ static const TEveException kEH("AliEveVSDCreator::ConvertTPCClusters ");
auto_ptr<TFile> 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<TDirectory> 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<TTree> tree( (TTree*) d->Get("TreeR") );
if (!tree.get())
- throw(eH + "'TreeR' not found.");
+ throw(kEH + "'TreeR' not found.");
- auto_ptr<AliTPCParam> par( GetTpcParam(eH) );
+ auto_ptr<AliTPCParam> par( GetTpcParam(kEH) );
AliTPCClustersRow clrow, *clrowp = &clrow;
AliTPCclusterMI *cl;
{
// Convert ITS clusters and transform them to global coordinates.
- static const TEveException eH("AliEveVSDCreator::ConvertITSClusters ");
+ static const TEveException kEH("AliEveVSDCreator::ConvertITSClusters ");
auto_ptr<TFile> 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<TDirectory> 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<TTree> 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);
{
// 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");
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();
// 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");
{
// 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");
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);
{
// 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");
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();
// 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");
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_VSDCreator_H
-#define ALIEVE_VSDCreator_H
+#ifndef AliEveVSDCreator_H
+#define AliEveVSDCreator_H
#include <TEveVSD.h>
-class AliTPCParam;
-class AliRunLoader;
-
#include <map>
+class AliTPCParam;
+class AliRunLoader;
class AliEveVSDCreator : public TEveVSD
{
// AliEveEventManager
#pragma link C++ class AliEveEventManager+;
-#pragma link C++ global gEvent;
+#pragma link C++ global gAliEveEvent;
#pragma link C++ class AliEveKineTools+;
* 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
************************************************************************/
-#ifndef ALIEVE_CascadeEditors_H
-#define ALIEVE_CascadeEditors_H
+#ifndef AliEveCascadeEditors_H
+#define AliEveCascadeEditors_H
#include <TGedFrame.h>
* 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 */
Ludovic Gaudichet (gaudichet@to.infn.it)
************************************************************************/
-#ifndef ALIEVE_V0Editors_H
-#define ALIEVE_V0Editors_H
+#ifndef AliEveV0Editors_H
+#define AliEveV0Editors_H
#include <TGedFrame.h>
// $Header$
-#ifndef ALIEVE_CLASS_H
-#define ALIEVE_CLASS_H
+#ifndef AliEveCLASS_H
+#define AliEveCLASS_H
#include <TGedFrame.h>
// $Header$
-#ifndef REVE_CLASS_H
-#define REVE_CLASS_H
+#ifndef AliEveCLASS_H
+#define AliEveCLASS_H
#include <TGedFrame.h>
// $Header$
-#ifndef ALIEVE_CLASS_H
-#define ALIEVE_CLASS_H
+#ifndef AliEveCLASS_H
+#define AliEveCLASS_H
#include <TGLObject.h>
// $Header$
-#ifndef ALIEVE_CLASS_H
-#define ALIEVE_CLASS_H
+#ifndef AliEveCLASS_H
+#define AliEveCLASS_H
#include <Reve/Reve.h>
#include "AliEveITSDigitsInfo.h"
#include <EveBase/AliEveEventManager.h>
-#include <TEveTreeTools.h>
-#include <TEveTrans.h>
-
#include <AliITS.h>
#include <AliITSInitGeometry.h>
#include <AliITSgeomTGeo.h>
#include <AliITSRawStreamSSD.h>
#include <TGeoMatrix.h>
+#include <TEveTrans.h>
+//#include <TClonesArray.h>
+
#include <TMath.h>
#include <TVector3.h>
+//==============================================================================
+//==============================================================================
+// AliEveITSModuleSelection
+//==============================================================================
+
//______________________________________________________________________________
//
// Helper for selecting a range of ITS modules by type, layer, phi and
}
+//==============================================================================
+//==============================================================================
+// AliEveITSDigitsInfo
+//==============================================================================
+
//______________________________________________________________________________
//
// Stores ITS geometry information and event-data in format suitable
// 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();
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_ITSDigitsInfo_H
-#define ALIEVE_ITSDigitsInfo_H
+#ifndef AliEveITSDigitsInfo_H
+#define AliEveITSDigitsInfo_H
#include <TEveUtil.h>
+#include <TObject.h>
#include <map>
#include <vector>
-#include <TObject.h>
-#include <TClonesArray.h>
-#include <TTree.h>
+class TClonesArray;
+class TTree;
//class AliITSgeom;
class AliITSsegmentationSPD;
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();
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<UInt_t>& ids);
}; // 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];
}
#include <AliITSdigitSDD.h>
#include <AliITSdigitSSD.h>
+#include <TEveTrans.h>
+#include <TClonesArray.h>
#include <TStyle.h>
{
// 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 ));
}
LoadQuads();
ComputeBBox();
+ InitMainTrans();
if (trans)
SetTrans();
}
// Set transformation matrix based on module id (use geometry to
// retrieve this information).
- fHMTrans.SetFrom(*AliITSgeomTGeo::GetMatrix(fID));
+ fMainTrans->SetFrom(*AliITSgeomTGeo::GetMatrix(fID));
}
/******************************************************************************/
* 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 <TEveQuadSet.h>
#include <TEveManager.h>
#include <TEveGedEditor.h>
#include <TEveGridStepper.h>
-#include <TEveGLText.h>
#include <TEveTrans.h>
-#include <TObject.h>
#include <TMath.h>
#include <TBuffer3D.h>
-#include <TBuffer3DTypes.h>
#include <TVirtualPad.h>
-#include <TVirtualViewer3D.h>
#include <TGLRnrCtx.h>
#include <TGLSelectRecord.h>
#include <TGLText.h>
-// #include <FTFont.h>
+#include <TGLUtil.h>
+#include <TGLIncludes.h>
#include <TGLAxis.h>
#include <TGLViewer.h>
+//==============================================================================
+//==============================================================================
+// AliEveITSModuleStepper
+//==============================================================================
//______________________________________________________________________________
//
// 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<N; m++)
+ for (Int_t m=0; m<n; ++m)
{
AddElement(new AliEveITSScaledModule(m, fDigitsInfo, fScaleInfo));
}
/******************************************************************************/
-Int_t AliEveITSModuleStepper::GetCurrentPage()
+Int_t AliEveITSModuleStepper::GetCurrentPage() const
{
// Get number of current page.
{
AliEveITSScaledModule* mod = dynamic_cast<AliEveITSScaledModule*>(*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());
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);
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) {
AliEveITSModule* qs = dynamic_cast<AliEveITSModule*>(*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)
Float_t x0 = xs;
for(Int_t i=p->GetMinVal() + 1; i<p->GetMaxVal(); 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();
// 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();
if(idx < fIDs.size())
{
AliEveITSScaledModule* mod = dynamic_cast<AliEveITSScaledModule*>(*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;
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_ITSModuleStepper_H
-#define ALIEVE_ITSModuleStepper_H
-
-#include <TNamed.h>
-#include <TGLOverlay.h>
+#ifndef AliEveITSModuleStepper_H
+#define AliEveITSModuleStepper_H
#include <TEveElement.h>
#include <TEveGridStepper.h>
+#include <TGLOverlay.h>
+
#include <vector>
class TGLText;
Float_t fWHeight; //
Float_t fWOff; // Offset relative to widget size.
Color_t fWCol; //
- Int_t fWActiveCol; //
+ Color_t fWActiveCol; //
Color_t fFontCol; //
// wrappers
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();
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; }
#include <TEveManager.h>
#include <TVirtualPad.h>
-#include <TColor.h>
-
-#include <TGLabel.h>
-#include <TGButton.h>
-#include <TGNumberEntry.h>
-#include <TGColorSelect.h>
-#include <TGDoubleSlider.h>
+//==============================================================================
+//==============================================================================
+// AliEveITSModuleStepperEditor
+//==============================================================================
//______________________________________________________________________________
//
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_ITSModuleStepperEditor_H
-#define ALIEVE_ITSModuleStepperEditor_H
+#ifndef AliEveITSModuleStepperEditor_H
+#define AliEveITSModuleStepperEditor_H
#include <TGedFrame.h>
#include "AliEveITSScaledModule.h"
-#include <AliITSgeom.h>
#include <AliITSsegmentationSPD.h>
#include <AliITSsegmentationSDD.h>
#include <AliITSsegmentationSSD.h>
#include <AliITSdigitSSD.h>
#include <TMath.h>
+#include <TClonesArray.h>
-//______________________________________________________________________________
+//==============================================================================
+//==============================================================================
// AliEveDigitScaleInfo
+//==============================================================================
+
+//______________________________________________________________________________
//
+// Encapsulates current state of scaling and agglomeration.
ClassImp(AliEveDigitScaleInfo)
AliEveDigitScaleInfo::AliEveDigitScaleInfo():
fScale(1),
- fStatType (kST_Average),
+ fStatType (kSTAverage),
fSyncPalette(kFALSE)
{
}
while (i != fBackRefs.end())
{
sm = dynamic_cast<AliEveITSScaledModule*>(*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
+//==============================================================================
//______________________________________________________________________________
//
digits = fInfo->GetDigits(fID, fDetID);
ndigits = digits->GetEntriesFast();
- ScaledDigit* sd;
+ ScaledDigit_t* sd;
Int_t scale = fScaleInfo->GetScale() -1;
switch(fDetID)
{
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<ScaledDigit*>(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<ScaledDigit_t*>(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;
}
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<ScaledDigit*>(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<ScaledDigit_t*>(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;
}
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);
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<ScaledDigit*>(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<ScaledDigit_t*>(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
{
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<ScaledDigit*>(GetId(i));
+ ScaledDigit_t* sd = dynamic_cast<ScaledDigit_t*>(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);
void AliEveITSScaledModule::SyncPalette()
{
// printf("AliEveITSScaledModule::SyncPalette()\n");
- if(fScaleInfo->GetStatType() == AliEveDigitScaleInfo::kST_Occup)
+ if(fScaleInfo->GetStatType() == AliEveDigitScaleInfo::kSTOccup)
{
// SPD
AliEveITSModule::fgSPDPalette->SetLimits(0, 100);
}
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);
/******************************************************************************/
-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;
}
DigitBase_t* qb = GetDigit(idx);
TObject* obj = qb->fId.GetObject();
- ScaledDigit* sd = dynamic_cast<ScaledDigit*>(obj);
+ ScaledDigit_t* sd = dynamic_cast<ScaledDigit_t*>(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; k<ndigits; k++)
{
AliITSdigit *d = (AliITSdigit*) digits->UncheckedAt(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(" | ");
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_ITSScaledModule_H
-#define ALIEVE_ITSScaledModule_H
+#ifndef AliEveITSScaledModule_H
+#define AliEveITSScaledModule_H
#include <TEveUtil.h>
#include <EveDet/AliEveITSModule.h>
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:
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<Int_t, ScaledDigit> fDigitsMap;
+ std::map<Int_t, ScaledDigit_t> fDigitsMap;
AliEveITSScaledModule(const AliEveITSScaledModule&); // Not implemented
AliEveITSScaledModule& operator=(const AliEveITSScaledModule&); // Not implemented
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.
#include "AliEveITSScaledModuleEditor.h"
#include <EveDet/AliEveITSScaledModule.h>
-#include <TEveTransEditor.h>
-#include <TEveGValuators.h>
#include <TVirtualPad.h>
-#include <TColor.h>
-#include <TMath.h>
-
#include <TGedEditor.h>
#include <TGLabel.h>
#include <TG3DLine.h>
-#include <TGButton.h>
#include <TGNumberEntry.h>
-#include <TGColorSelect.h>
#include <TGComboBox.h>
+//==============================================================================
+//==============================================================================
+// AliEveITSScaledModuleEditor
+//==============================================================================
//______________________________________________________________________________
//
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_ITSScaledModuleEditor_H
-#define ALIEVE_ITSScaledModuleEditor_H
+#ifndef AliEveITSScaledModuleEditor_H
+#define AliEveITSScaledModuleEditor_H
#include <TGedFrame.h>
-#include <TEveRGBAPaletteEditor.h>
class TGNumberEntry;
class TGColorSelect;
class TEveGDoubleValuator;
class TEveRGBAPalette;
-
class AliEveDigitScaleInfo;
class AliEveITSScaledModule;
class AliITSsegmentation;
#include <TBuffer3DTypes.h>
#include <TVirtualPad.h>
#include <TVirtualViewer3D.h>
-
#include <TStyle.h>
-#include <TColor.h>
-#include <TMath.h>
//______________________________________________________________________________
//______________________________________________________________________________
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);
//______________________________________________________________________________
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();
-
}
* 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 <TEveElement.h>
#include <TEveQuadSet.h>
friend class AliEveMUONChamberGL;
friend class AliEveMUONChamberEditor;
-private:
AliEveMUONChamber(const AliEveMUONChamber&); // Not implemented
AliEveMUONChamber& operator=(const AliEveMUONChamber&); // Not implemented
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);
#include <mapping/AliMpSectorSegmentation.h>
#include <mapping/AliMpSector.h>
#include <mapping/AliMpPad.h>
-#include <mapping/AliMpStationType.h>
-#include <mapping/AliMpDEManager.h>
#include <mapping/AliMpSegmentation.h>
-#include <TMath.h>
#include <TVector2.h>
-#include <Riostream.h>
-
#include <EveBase/AliEveEventManager.h>
///////////////////////////////////////////////////////////////////////////////
// constructor
//
- AliEveEventManager *event = gEvent;
+ AliEveEventManager *event = gAliEveEvent;
TString dataPath = TString(event->GetTitle());
dataPath.Append("/geometry.root");
* See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_MUONChamberData_H
-#define ALIEVE_MUONChamberData_H
-
-#include <TEveUtil.h>
+#ifndef AliEveMUONChamberData_H
+#define AliEveMUONChamberData_H
#include <TObject.h>
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:
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]; };
* See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
* full copyright notice. *
**************************************************************************/
+
#include "AliEveMUONChamberEditor.h"
#include <EveDet/AliEveMUONChamber.h>
#include <TEveGValuators.h>
-
-#include <TVirtualPad.h>
-#include <TColor.h>
-
-#include <TGLabel.h>
-#include <TGButton.h>
-#include <TGNumberEntry.h>
-#include <TGColorSelect.h>
#include <TGSlider.h>
#include <TGDoubleSlider.h>
* 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 <TGedFrame.h>
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
TEveGValuator *fHitSize; // hit point size
public:
-
AliEveMUONChamberEditor(const TGWindow* p = 0,
Int_t width = 170, Int_t height = 30,
UInt_t options = kChildFrame,
* full copyright notice. *
**************************************************************************/
-#include <Riostream.h>
-
-#include <TMath.h>
-
#include "AliEveMUONChamberGL.h"
#include <EveDet/AliEveMUONChamber.h>
#include <EveDet/AliEveMUONChamberData.h>
-#include <TEveQuadSetGL.h>
#include <TGLRnrCtx.h>
#include <TGLIncludes.h>
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);
glDisable(GL_LIGHTING);
glLineWidth(1.0);
- glColor3f(1.0,1.0,1.0);
+ TGLUtil::Color3f(1.0,1.0,1.0);
glBegin(GL_LINES);
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++) {
* 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 <TGLObject.h>
#include <TEveQuadSetGL.h>
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;
mutable UInt_t fRTS; // render time stamp
public:
-
AliEveMUONChamberGL();
virtual ~AliEveMUONChamberGL();
#include <AliRawReaderDate.h>
#include <AliRawReaderRoot.h>
-#include <AliLog.h>
-
#include <AliMUONDigitMaker.h>
#include <AliMUONHit.h>
#include <AliMUONVCluster.h>
#include "TTree.h"
#include "TString.h"
#include "TClonesArray.h"
-#include "TList.h"
#include "TFile.h"
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;
}
Int_t iEvent = 0;
while (fgRawReader->NextEvent())
{
- if (iEvent != gEvent->GetEventId())
+ if (iEvent != gAliEveEvent->GetEventId())
{
iEvent++;
continue;
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
} else {
return -1;
}
-
}
//______________________________________________________________________________
//if (fChambers[chamber] == 0) CreateChamber(chamber);
return fChambers[chamber];
-
}
* 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 <TEveUtil.h>
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);
-// $Id$
+
// Main authors: Matevz Tadel & Alja Mrak-Tadel & Bogdan Vulpescu: 2006, 2007
/**************************************************************************
#include <AliMagFMaps.h>
#include <AliLog.h>
#include <AliESDMuonTrack.h>
-#include <AliTrackReference.h>
#include <AliESDEvent.h>
#include <AliESDVertex.h>
#include <AliRunLoader.h>
#include <AliMUONESDInterface.h>
#include <TClonesArray.h>
-#include <TMath.h>
-#include <TMatrixD.h>
#include <TStyle.h>
#include <TROOT.h>
#include <TParticle.h>
#include <Riostream.h>
+//==============================================================================
+// 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) :
// constructor
//
- fFieldMap = AliEveEventManager::AssertMagField();
-
+ if (fgFieldMap == 0)
+ fgFieldMap = AliEveEventManager::AssertMagField();
}
//______________________________________________________________________________
// 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;
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() << " " <<
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 << " " <<
// information about the trigger track
//
- // Double_t RADDEG = 180.0/TMath::Pi();
+ // Double_t radDeg = 180.0/TMath::Pi();
}
// 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();
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() << " " <<
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");
* 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 <TEveTrack.h>
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();
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
#include "AliPMDdigit.h"
#include "AliPMDddldata.h"
-#include <TClonesArray.h>
+#include <TEveTrans.h>
+#include <TClonesArray.h>
+#include <TTree.h>
+#include <TH1F.h>
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;
//______________________________________________________________________________
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;
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;
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);
RefitPlex();
- fHMTrans.SetPos(fX, fY, fZ);
+ RefMainTrans().SetPos(fX, fY, fZ);
delete digits;
}
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;
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);
RefitPlex();
- fHMTrans.SetPos(fX, fY, fZ);
+ RefMainTrans().SetPos(fX, fY, fZ);
}
// -------------------------------------------------------------------- //
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] =
void AliEvePMDModule::SetPosition(Float_t x, Float_t y, Float_t z)
{
+ // Set position of module.
+
fX = x;
fY = y;
fZ = z;
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_PMDModule_H
-#define ALIEVE_PMDModule_H
+#ifndef AliEvePMDModule_H
+#define AliEvePMDModule_H
-#include <TEveUtil.h>
#include <TEveQuadSet.h>
-#include <TObject.h>
-#include <TObjArray.h>
-#include <TTree.h>
-#include <TH1F.h>
-
+class TH1F;
+class TTree;
class AliEvePMDModule : public TEveQuadSet
{
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);
#include "AliEvePMDModuleEditor.h"
#include <EveDet/AliEvePMDModule.h>
-#include <TEveGedEditor.h>
#include <TVirtualPad.h>
-#include <TColor.h>
+#include <TH1F.h>
#include <TGLabel.h>
#include <TG3DLine.h>
#include <TGButton.h>
-#include <TGNumberEntry.h>
-#include <TGColorSelect.h>
-#include <TGDoubleSlider.h>
-
-#include <TCanvas.h>
-#include <TGLViewer.h>
-#include <TEveManager.h>
-
-
-#include <TH1F.h>
+//==============================================================================
+//==============================================================================
+// 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),
fInfoLabel3(0),
fInfoLabel4(0),
fInfoLabel5(0)
- // Initialize widget pointers to 0
{
+ // Constructor.
+
MakeTitle("AliEvePMDModule");
CreateInfoFrame();
void AliEvePMDModuleEditor::CreateInfoFrame()
{
+ // Create frame holding information.
+
fInfoFrame = CreateEditorTabSubFrame("Info");
TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10,
}
}
-AliEvePMDModuleEditor::~AliEvePMDModuleEditor()
-{}
-
/******************************************************************************/
void AliEvePMDModuleEditor::SetModel(TObject* obj)
{
- fM = dynamic_cast<AliEvePMDModule*>(obj);
+ // Set model object.
- // Set values of widgets
+ fM = dynamic_cast<AliEvePMDModule*>(obj);
fInfoLabel0->SetText(Form("Cells hit per Module : %d", fM->GetNPads()));
fInfoLabel1->SetText(Form("ADC per Module : %d", fM->GetAdc()));
void AliEvePMDModuleEditor::DisplayHistos()
{
+ // Slot for displaying histograms with module data.
+
fM->GetHisto()->Draw();
gPad->Modified();
gPad->Update();
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_PMDModuleEditor_H
-#define ALIEVE_PMDModuleEditor_H
+#ifndef AliEvePMDModuleEditor_H
+#define AliEvePMDModuleEditor_H
#include <TGedFrame.h>
class TGNumberEntry;
class TGColorSelect;
-
class AliEvePMDModule;
class AliEvePMDModuleEditor : public TGedFrame
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
#include <AliT0digit.h>
#include <AliRawReader.h>
-#include <AliRawReaderFile.h>
-#include <AliRawReaderDate.h>
#include <AliRawReaderRoot.h>
#include <AliT0RawReader.h>
-#include <AliCDBManager.h>
#include <AliCDBStorage.h>
+#include <TEveTrans.h>
+#include <TEveManager.h>
+#include <TTree.h>
#include <TArrayI.h>
#include <TStyle.h>
#include <TMath.h>
#include <TRandom.h>
-#include <TEveManager.h>
ClassImp(AliEveT0Module)
//
// 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");
// cout<<ievt<<endl;
TEveRGBAPalette* rawPalette = new TEveRGBAPalette(0, 3000);
rawPalette->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++)
for (Int_t iHit=0; iHit<5; iHit++)
{
allData[i][iHit]= start->GetData(i,iHit);
- if (allData[i][iHit] != 0) cout<<"event"<<ievt<<" i "<< i<<" "<<allData[i][iHit] - allData[0][0]<<endl;
+ if (allData[i][iHit] != 0) {
+ using namespace std;
+ cout <<"event"<< ievt <<" i "<< i <<" "<< allData[i][iHit] - allData[0][0] <<endl;
+ }
}
}
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);
- raw_a->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);
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."));
}
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);
* 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
//////////////////////////////////////////////////////////////////////////
// //
// //
//////////////////////////////////////////////////////////////////////////
-
#include <TEveQuadSet.h>
-#include <AliT0digit.h>
-#include <AliT0RawReader.h>
+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);
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
void AliEveTOFDigitsInfo::SetTree(TTree* tree)
{
- static const TEveException eH("AliEveTOFDigitsInfo::SetTree ");
+ static const TEveException kEH("AliEveTOFDigitsInfo::SetTree ");
if(fGeom == 0) {
fGeom = new AliTOFGeometry();
* 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 <TEveVSD.h>
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TOFDigitsInfoEditor_H
-#define ALIEVE_TOFDigitsInfoEditor_H
+#ifndef AliEveTOFDigitsInfoEditor_H
+#define AliEveTOFDigitsInfoEditor_H
#include <TGedFrame.h>
**************************************************************************/
#include "AliEveTOFSector.h"
-#include <TEveManager.h>
-
#include <AliTOFdigit.h>
#include <AliTOFGeometry.h>
+#include <TEveTrans.h>
+#include <TEveManager.h>
#include <TStyle.h>
Bool_t AliEveTOFSector::fgStaticInitDone = kFALSE;
/* ************************************************************ */
void AliEveTOFSector::SetTrans()
{
- fHMTrans.UnitTrans();
+ InitMainTrans();
+ TEveTrans& t = RefMainTrans();
//Int_t det[5] = {fSector, -1, -1, -1, -1};
Char_t path[100];
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);
}
//-----------------------------------------------------
* 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 <TEveQuadSet.h>
#include <TEveElement.h>
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TOFSectorEditor_H
-#define ALIEVE_TOFSectorEditor_H
+#ifndef AliEveTOFSectorEditor_H
+#define AliEveTOFSectorEditor_H
#include <TGedFrame.h>
/* ************************************************************ */
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());
}
/******************************************************************************/
* 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 <TEveQuadSet.h>
#include <TEveElement.h>
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TOFStripEditor_H
-#define ALIEVE_TOFStripEditor_H
+#ifndef AliEveTOFStripEditor_H
+#define AliEveTOFStripEditor_H
#include <TGedFrame.h>
#include <AliTPCRawStream.h>
#include <TTree.h>
+//==============================================================================
+//==============================================================================
+// AliEveTPCData
+//==============================================================================
//______________________________________________________________________________
//
// 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;
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;
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;
}
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCData_H
-#define ALIEVE_TPCData_H
+#ifndef AliEveTPCData_H
+#define AliEveTPCData_H
#include <TEveUtil.h>
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<AliEveTPCSectorData*> fSectors; // Vector of sector-data.
Int_t fSectorBlockSize; // Block-size of sector-data.
#include <TSystem.h>
+//==============================================================================
+//==============================================================================
+// AliEveTPCLoader
+//==============================================================================
//______________________________________________________________________________
//
// 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();
{
// 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();
// 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.");
}
}
}
{
// 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;
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCLoader_H
-#define ALIEVE_TPCLoader_H
+#ifndef AliEveTPCLoader_H
+#define AliEveTPCLoader_H
#include <TEveElement.h>
#include <vector>
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;
/******************************************************************************/
/******************************************************************************/
-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)
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCLoaderEditor_H
-#define ALIEVE_TPCLoaderEditor_H
+#ifndef AliEveTPCLoaderEditor_H
+#define AliEveTPCLoaderEditor_H
#include <TGedFrame.h>
class TEveGValuator;
-
class AliEveTPCLoader;
+//------------------------------------------------------------------------------
+// AliEveTPCLoaderEditor
+//
+// GUI editor for AliEveTPCLoader.
+//
+
class AliEveTPCLoaderEditor : public TGedFrame
{
AliEveTPCLoaderEditor(const AliEveTPCLoaderEditor&); // Not implemented
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);
void DoDeleteSectors3D();
ClassDef(AliEveTPCLoaderEditor, 0); // Editor for AliEveTPCLoader.
-}; // endclass AliEveTPCLoaderEditor
+};
#endif
#include "AliEveTPCSector2D.h"
#include "AliEveTPCSector3D.h"
-#include <EveDet/AliEveTPCData.h>
#include <EveDet/AliEveTPCSectorData.h>
-#include <TEveManager.h>
-
-#include <AliTPCParam.h>
+#include <TEveTrans.h>
#include <TBuffer3D.h>
#include <TBuffer3DTypes.h>
#include <TH2S.h>
#include <TVirtualPad.h>
-using namespace std;
+//==============================================================================
+//==============================================================================
+// AliEveTPCSector2D
+//==============================================================================
//______________________________________________________________________________
-// AliEveTPCSector2D
//
// Displays TPC raw-data in 2D.
//
s->SetSectorID(fSectorID);
s->SetAutoTrans(fAutoTrans);
s->CopyVizParams(*this);
- gEve->AddElement(s, this);
- gEve->Redraw3D();
+ AddElement(s);
+ ElementChanged(kFALSE, kTRUE);
}
/******************************************************************************/
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);
* 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;
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCSector2DEditor_H
-#define ALIEVE_TPCSector2DEditor_H
+#ifndef AliEveTPCSector2DEditor_H
+#define AliEveTPCSector2DEditor_H
#include <TGedFrame.h>
class TGCheckButton;
class TGComboBox;
-
class AliEveTPCSector2D;
+//------------------------------------------------------------------------------
+// AliEveTPCSector2DEditor
+//
+// GUI editor for AliEveTPCSector2D.
+//
+
class AliEveTPCSector2DEditor : public TGedFrame
{
AliEveTPCSector2DEditor(const AliEveTPCSector2DEditor&); // Not implemented
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);
void DoPickMode(Int_t mode);
ClassDef(AliEveTPCSector2DEditor, 0); // Editor for AliEveTPCSector2D.
-}; // endclass AliEveTPCSector2DEditor
+};
#endif
#include "AliEveTPCSector2DGL.h"
-#include <EveDet/AliEveTPCData.h>
+#include <EveDet/AliEveTPCSector2D.h>
#include <TGLRnrCtx.h>
#include <TGLSelectRecord.h>
//______________________________________________________________________________
//
-// GL renderer for TPCSector2D.
+// GL renderer for AliEveTPCSector2D.
ClassImp(AliEveTPCSector2DGL)
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
/******************************************************************************/
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.
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;
}
padVal = TMath::Min(padVal, fSector->fMaxVal);
if(padVal > fSector->fThreshold)
- fSector->ColorFromArray(padVal, img_pos);
- img_pos += 4;
+ fSector->ColorFromArray(padVal, imgPos);
+ imgPos += 4;
}
}
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]);
{
// 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; row<seg.GetNRows(); row++) {
- y_d = seg.GetRLow() + row*padH;
- y_u = y_d + padH;
- x_off = -seg.GetNMaxPads()*padW/2;
+ for (Int_t row = 0; row < seg.GetNRows(); row++)
+ {
+ yD = seg.GetRLow() + row*padH;
+ yU = yD + padH;
+ xOff = -seg.GetNMaxPads()*padW/2;
Int_t tpcRow = row + seg.GetFirstRow();
Int_t deltaPad = (seg.GetNMaxPads() - AliEveTPCSectorData::GetNPadsInRow(tpcRow))/2;
Int_t maxPad = seg.GetNMaxPads() - deltaPad;
UChar_t *pix = GetRowCol(row + startRow, startCol + deltaPad);
- for (Int_t pad=deltaPad; pad<maxPad; pad++, pix+=4) {
- x = x_off + pad*padW;
- if (pix[3] != 0) {
- glColor4ubv(pix);
- glVertex2f(x+padW, y_d);
- glVertex2f(x, y_d);
- glVertex2f(x, y_u);
- glVertex2f(x+padW, y_u);
+ for (Int_t pad = deltaPad; pad < maxPad; pad++, pix+=4)
+ {
+ x = xOff + pad*padW;
+ if (pix[3] != 0)
+ {
+ TGLUtil::Color4ubv(pix);
+ glVertex2f(x+padW, yD);
+ glVertex2f(x, yD);
+ glVertex2f(x, yU);
+ glVertex2f(x+padW, yU);
}
}
}
// Display segmen data as one quad per pad.
// Tag the rows and pads for selection.
- 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();
glPushName(0);
- for (Int_t row=0; row<seg.GetNRows(); row++) {
- y_d = seg.GetRLow() + row*padH;
- y_u = y_d + padH;
- x_off = -seg.GetNMaxPads()*padW/2;
+ for (Int_t row = 0; row < seg.GetNRows(); row++)
+ {
+ yD = seg.GetRLow() + row*padH;
+ yU = yD + padH;
+ xOff = -seg.GetNMaxPads()*padW/2;
Int_t tpcRow = row + seg.GetFirstRow();
glLoadName(tpcRow);
Int_t deltaPad = (seg.GetNMaxPads() - AliEveTPCSectorData::GetNPadsInRow(tpcRow))/2;
Int_t maxPad = seg.GetNMaxPads() - deltaPad;
UChar_t *pix = GetRowCol(row + startRow, startCol + deltaPad);
glPushName(0);
- for (Int_t pad=deltaPad; pad<maxPad; pad++, pix+=4) {
- x = x_off + pad*padW;
- if (pix[3] != 0 || fSector->fPickEmpty) {
+ 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();
}
}
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<s.GetNYSteps(); ++i) {
+ for (Int_t i = 0; i < s.GetNYSteps(); ++i)
+ {
y = s.GetYStep(i);
glVertex2f(x, y);
x -= s.GetPadWidth();
Float_t x = s.GetNMaxPads()*s.GetPadWidth()/2;
Float_t y = s.GetRLow() + s.GetNRows()*s.GetPadHeight();
glVertex2f(x, y);
- for (Int_t i=s.GetNYSteps() - 1; i>=0; --i) {
+ for (Int_t i = s.GetNYSteps() - 1; i >= 0; --i)
+ {
y = s.GetYStep(i);
glVertex2f(x, y);
x -= s.GetPadWidth();
// 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());
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCSector2DGL_H
-#define ALIEVE_TPCSector2DGL_H
+#ifndef AliEveTPCSector2DGL_H
+#define AliEveTPCSector2DGL_H
#include <TGLObject.h>
-
-#include <EveDet/AliEveTPCSector2D.h>
-#include <EveDet/AliEveTPCSectorData.h>
-
class TGLViewer;
class TGLScene;
+#include <EveDet/AliEveTPCSectorData.h>
+class AliEveTPCSector2D;
+
+//------------------------------------------------------------------------------
+// AliEveTPCSector2DGL
+//
+// GL renderer for AliEveTPCSector2D.
+//
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,
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();
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.
};
#include "AliEveTPCSector3D.h"
#include <EveDet/AliEveTPCSectorData.h>
+#include <TEveTrans.h>
+
#include <TBuffer3D.h>
#include <TBuffer3DTypes.h>
#include <TVirtualPad.h>
#include <TVirtualViewer3D.h>
#include <TStyle.h>
-#include <TColor.h>
+//==============================================================================
+//==============================================================================
+// AliEveTPCSector3D
+//==============================================================================
//______________________________________________________________________________
//
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);
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; b<nBins; ++b) {
fPointSetArray.GetBin(b)->SetMarkerColor(gStyle->GetColorPalette(b));
}
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCSector3D_H
-#define ALIEVE_TPCSector3D_H
+#ifndef AliEveTPCSector3D_H
+#define AliEveTPCSector3D_H
#include <EveDet/AliEveTPCSectorViz.h>
#include <EveDet/AliEveTPCSectorData.h>
#include <TEveBoxSet.h>
#include <TEvePointSet.h>
+//------------------------------------------------------------------------------
+// AliEveTPCSector3D
+//
+// Visualization of TPC raw-data in 3D.
class AliEveTPCSector3D : public AliEveTPCSectorViz
{
#include <TEveGValuators.h>
-#include <TVirtualPad.h>
-#include <TColor.h>
-
-#include <TGLabel.h>
#include <TGButton.h>
#include <TGNumberEntry.h>
-#include <TGColorSelect.h>
#include <TGSlider.h>
-#include <TGDoubleSlider.h>
-
//______________________________________________________________________________
//
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCSector3DEditor_H
-#define ALIEVE_TPCSector3DEditor_H
+#ifndef AliEveTPCSector3DEditor_H
+#define AliEveTPCSector3DEditor_H
-#include <EveDet/AliEveTPCSector2DEditor.h>
+#include <TGedFrame.h>
class TGCheckButton;
class TGNumberEntry;
class TEveGValuator;
class TEveGDoubleValuator;
-
class AliEveTPCSector3D;
+//------------------------------------------------------------------------------
+// AliEveTPCSector3DEditor
+//
+// Editor for AliEveTPCSector3D.
+//
+
class AliEveTPCSector3DEditor : public TGedFrame
{
AliEveTPCSector3DEditor(const AliEveTPCSector3DEditor&); // Not implemented
#include <TGLRnrCtx.h>
#include <TGLSelectRecord.h>
-
//______________________________________________________________________________
//
// GL renderer for AliEveTPCSector3D.
glPushAttrib(GL_CURRENT_BIT | GL_POINT_BIT | GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
- UChar_t col[4];
if(hasData && fSector->fPointSetOn)
{
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());
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);
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCSector3DGL_H
-#define ALIEVE_TPCSector3DGL_H
+#ifndef AliEveTPCSector3DGL_H
+#define AliEveTPCSector3DGL_H
#include <TGLObject.h>
class TEveBoxSetGL;
-
class AliEveTPCSector3D;
+//------------------------------------------------------------------------------
+// AliEveTPCSector3DGL
+//
+// GL renderer for AliEveTPCSector3D.
+//
+
class AliEveTPCSector3DGL : public TGLObject
{
AliEveTPCSector3DGL(const AliEveTPCSector3DGL&); // Not implemented
virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
ClassDef(AliEveTPCSector3DGL, 0); // GL renderer for AliEveTPCSector3D.
-}; // endclass AliEveTPCSector3DGL
+};
#endif
#include "AliEveTPCSectorData.h"
#include <AliTPCParamSR.h>
-#include <string.h>
+#include <set>
+
+//==============================================================================
+//==============================================================================
+// AliEveTPCSectorData
+//==============================================================================
//______________________________________________________________________________
//
fgRowBegs = new Int_t[fgNAllRows + 1];
Int_t row = 0;
- for (Int_t i=0; i<fgParam->GetNRowLow(); ++i, ++row) {
+ for (Int_t i=0; i<fgParam->GetNRowLow(); ++i, ++row)
+ {
fgRowBegs[row] = fgNAllPads;
fgNAllPads += fgParam->GetNPadsLow(i);
}
- for (Int_t i=0; i<fgParam->GetNRowUp(); ++i, ++row) {
+ for (Int_t i=0; i<fgParam->GetNRowUp(); ++i, ++row)
+ {
fgRowBegs[row] = fgNAllPads;
fgNAllPads += fgParam->GetNPadsUp(i);
}
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++;
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++;
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++;
{
// 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];
}
static const SegmentInfo null;
- if(seg < 0 || seg > 2)
+ if (seg < 0 || seg > 2)
return null;
else
return *fgSegInfoPtrs[seg];
{
// 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.
}
{
// Destructor.
- for(std::vector<Short_t*>::iterator b=fBlocks.begin(); b!=fBlocks.end(); ++b)
+ for (std::vector<Short_t*>::iterator b=fBlocks.begin(); b!=fBlocks.end(); ++b)
delete [] *b;
DeletePadRowHack();
}
// Drop data, deallocate data-blocks.
fPads.assign(fgNAllPads, PadData());
- for(std::vector<Short_t*>::iterator b=fBlocks.begin(); b!=fBlocks.end(); ++b)
+ for (std::vector<Short_t*>::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.
}
/******************************************************************************/
fCurrentRow = row;
fCurrentPad = pad;
- if(reverseTime) {
+ if (reverseTime) {
fCurrentPos = 2046;
fCurrentStep = -2;
} else {
Short_t array[1024];
Short_t* val;
val = beg + 1;
- while(val <= end) {
+ while (val <= end) {
array[(val-beg)/2] = *val;
val += 2;
}
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;
}
// 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));
/******************************************************************************/
-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);
}
// 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);
// Print summary information.
printf("addr=%p, len=%hd>\n", (void*)fData, fLength);
- for(Int_t i=0; i<fLength; ++i)
+ for (Int_t i=0; i<fLength; ++i)
printf(" %3d %hd\n", i, fData[i]);
}
void AliEveTPCSectorData::PadIterator::Test()
{
- while(Next())
+ while (Next())
printf(" %3d %d\n", fTime, fSignal);
}
if (fPadRowHackSet == 0) return;
std::set<PadRowHack>*hs = static_cast<std::set<PadRowHack>*>(fPadRowHackSet);
std::set<PadRowHack>::iterator i = hs->find(PadRowHack(r,p));
- if(i != hs->end()) hs->erase(i);
+ if (i != hs->end()) hs->erase(i);
}
void AliEveTPCSectorData::DeletePadRowHack()
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCSectorData_H
-#define ALIEVE_TPCSectorData_H
-
-#include <TEveUtil.h>
+#ifndef AliEveTPCSectorData_H
+#define AliEveTPCSectorData_H
#include <TObject.h>
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
{
std::vector<PadData> 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<Short_t*> fBlocks; // Vector of blocks.
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);
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);
#include <EveDet/AliEveTPCData.h>
#include <EveDet/AliEveTPCSectorData.h>
-#include <AliTPCParam.h>
+#include <TEveTrans.h>
#include <TStyle.h>
-#include <TColor.h>
+#include <TMath.h>
+//==============================================================================
+//==============================================================================
+// AliEveTPCSectorViz
+//==============================================================================
//______________________________________________________________________________
//
fFrameColor ((Color_t) 4),
fRnrFrame (kTRUE),
- fHMTrans (),
fAutoTrans (kFALSE),
fRTS (1),
fColorArray (0)
{
// Constructor.
+
+ InitMainTrans();
}
AliEveTPCSectorViz::~AliEveTPCSectorViz()
// 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());
}
// 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);
+}
/******************************************************************************/
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCSectorViz_H
-#define ALIEVE_TPCSectorViz_H
+#ifndef AliEveTPCSectorViz_H
+#define AliEveTPCSectorViz_H
#include <TEveElement.h>
-#include <TEveTrans.h>
#include <TNamed.h>
#include <TAtt3D.h>
#include <TAttBBox.h>
-
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,
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
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;
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
{
#include <TEveTransEditor.h>
#include <TVirtualPad.h>
-#include <TColor.h>
-#include <TGLabel.h>
#include <TGButton.h>
#include <TGNumberEntry.h>
-#include <TGColorSelect.h>
#include <TGSlider.h>
#include <TGDoubleSlider.h>
fM = dynamic_cast<AliEveTPCSectorViz*>(obj);
- fHMTrans->SetModel(&fM->fHMTrans);
+ fHMTrans->SetModel(fM->PtrMainTrans());
fSectorID->SetValue(fM->fSectorID);
fAutoTrans->SetState(fM->fAutoTrans ? kButtonDown : kButtonUp);
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TPCSectorVizEditor_H
-#define ALIEVE_TPCSectorVizEditor_H
+#ifndef AliEveTPCSectorVizEditor_H
+#define AliEveTPCSectorVizEditor_H
#include <TGedFrame.h>
class TEveGDoubleValuator;
class TEveTransSubEditor;
-
class AliEveTPCSectorViz;
+//------------------------------------------------------------------------------
+// AliEveTPCSectorVizEditor
+//
+// Editor for AliEveTPCSectorViz.
+
class AliEveTPCSectorVizEditor : public TGedFrame
{
AliEveTPCSectorVizEditor(const AliEveTPCSectorVizEditor&); // Not implemented
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);
void DoTime();
ClassDef(AliEveTPCSectorVizEditor, 0); // Editor for AliEveTPCSectorViz.
-}; // endclass AliEveTPCSectorVizEditor
+};
#endif
#include "AliEveTRDData.h"
#include "AliEveTRDModuleImp.h"
-#include "AliLog.h"
#include "AliTRDhit.h"
#include "AliTRDcluster.h"
#include "AliTRDcalibDB.h"
//______________________________________________________________________________
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();
//______________________________________________________________________________
void AliEveTRDDigits::Paint(Option_t *option)
{
+ // Paint the object.
+
if(fParent->GetDigitsBox()) fBoxes.Paint(option);
else TEveQuadSet::Paint(option);
}
//______________________________________________________________________________
void AliEveTRDDigits::Reset()
{
+ // Reset raw and visual data.
+
TEveQuadSet::Reset(TEveQuadSet::kQT_FreeQuad, kTRUE, 64);
// MT fBoxes.fBoxes.clear();
fData.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<AliTRDhit*>(GetPointId(n));
printf("\nDetector : %d\n", h->GetDetector());
///////////////////////////////////////////////////////////
-///////////// 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<AliTRDcluster*>(GetPointId(n));
printf("\nDetector : %d\n", c->GetDetector());
}
///////////////////////////////////////////////////////////
-///////////// 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<AliEveTRDHits*>(obj);
// Float_t x, y, z;
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<AliEveTRDDigits*>(obj);
fM->fParent->SpawnEditor();
// 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 <TEveQuadSet.h>
#include <TEveBoxSet.h>
#include <TGedFrame.h>
-
#include "AliTRDdataArrayI.h"
class AliTRDdigitsManager;
class AliEveTRDChamber;
-
class AliEveTRDHits : public TEvePointSet
{
private:
void PointSelected(Int_t n);
protected:
- AliEveTRDChamber *fParent;
+ AliEveTRDChamber *fParent; // Chaber holding the hits.
ClassDef(AliEveTRDHits,1); // Base class for TRD hits visualisation
};
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.
};
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
};
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
};
#include "TSystem.h"
#include "TFile.h"
#include "TTree.h"
-#include "TString.h"
+//#include "TString.h"
#include "TObjString.h"
#include "TObjArray.h"
#include <TGLabel.h>
#include <TGButton.h>
#include <TGTextEntry.h>
-#include <TGNumberEntry.h>
+//#include <TGNumberEntry.h>
#include <TGFileDialog.h>
-#include <TGListTree.h>
-#include <TGToolTip.h>
+//#include <TGListTree.h>
+//#include <TGToolTip.h>
#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"
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 T>
class ID
{
public:
- ID( int value ) : id(value) {}
+ ID(int value) : fkId(value) {}
bool operator()(const T &t) const {
- return ((dynamic_cast<AliEveTRDModule*>(t))->GetID() == id);
+ return ((dynamic_cast<AliEveTRDModule*>(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();
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_stop; ism++){
+ for (int ism=ismStart; ism<ismStop; ism++){
ichmb = find_if(fChildren.begin(), fChildren.end(), ID<TEveElement*>(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; istk<istk_stop; istk++){
- ichmb = find_if(SM->begin(), SM->end(), ID<TEveElement*>(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; istk<istkStop; istk++) {
+ ichmb = find_if(lSM->begin(), lSM->end(), ID<TEveElement*>(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; ily<ily_stop; ily++){
+ for (int ily=ilyStart; ily<ilyStop; ily++) {
det = fGeo->GetDetector(ily, istk, ism);
- ichmb = find_if(STK->begin(), STK->end(), ID<TEveElement*>(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<TEveElement*>(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));
}
}
}
//______________________________________________________________________________
AliEveTRDChamber* AliEveTRDLoader::GetChamber(int d)
{
+ // Get given chamber.
+
List_i ism, istack, ichmb;
ism = find_if(fChildren.begin(), fChildren.end(), ID<TEveElement*>(fGeo->GetSector(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;
//______________________________________________________________________________
Bool_t AliEveTRDLoader::LoadClusters(TTree *tC)
{
+ // Load clusters.
+
AliInfo("Loading ...");
if(!fChildren.size()) return kTRUE;
//______________________________________________________________________________
Bool_t AliEveTRDLoader::LoadDigits(TTree *tD)
{
+ // Load digits.
+
AliInfo("Loading ...");
if(!fChildren.size()) return kTRUE;
//______________________________________________________________________________
Bool_t AliEveTRDLoader::LoadTracklets(TTree *tT)
{
+ // Load tracklets.
+
AliInfo("Loading ...");
if(!fChildren.size()) return kTRUE;
//______________________________________________________________________________
Bool_t AliEveTRDLoader::Open(const char *filename, const char *dir)
{
+ // Open given file in given directory.
+
fFilename = filename;
fDir = dir;
Int_t count = 0;
return kTRUE;
}
-
-
//______________________________________________________________________________
void AliEveTRDLoader::Paint(Option_t *option)
{
+ // Paint object.
+
List_i ichmb = fChildren.begin();
while(ichmb != fChildren.end()){
(dynamic_cast<AliEveTRDModule*>(*ichmb))->Paint(option);
//______________________________________________________________________________
void AliEveTRDLoader::SetDataType(TRDDataTypes type)
{
+ // Set type of data.
+
fLoadHits = kFALSE;
fLoadDigits = kFALSE;
fLoadClusters = kFALSE;
//______________________________________________________________________________
void AliEveTRDLoader::Unload()
{
+ // Unload module data.
+
List_i ichmb = fChildren.begin();
while(ichmb != fChildren.end()){
(dynamic_cast<AliEveTRDModule*>(*ichmb))->Reset();
fM(0), fFile(0), fEvent(0),
fSMNumber(0), fStackNumber(0), fPlaneNumber(0)
{
+ // Constructor.
+
MakeTitle("AliEveTRDLoader");
Int_t labelW = 42;
fTextButton2004->Connect("Clicked()", "AliEveTRDLoaderEditor", this, "Load()");
}
-//______________________________________________________________________________
-AliEveTRDLoaderEditor::~AliEveTRDLoaderEditor()
-{}
-
//______________________________________________________________________________
void AliEveTRDLoaderEditor::SetModel(TObject* obj)
{
+ // Set model object.
fM = dynamic_cast<AliEveTRDLoader*>(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();
//______________________________________________________________________________
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()));
void AliEveTRDLoaderEditor::Load()
{
+ // Slot for loading of event.
+
fM->GoToEvent(fM->fEvent);
}
* 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
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);
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.
};
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();
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
#include <TEveManager.h>
-#include "TFile.h"
+//#include "TFile.h"
#include "TTree.h"
#include <TGButton.h>
#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)
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;
//______________________________________________________________________________
Bool_t AliEveTRDLoaderSim::LoadHits(TTree *tH)
{
+ // Load hits.
+
Info("LoadHits()", "Loading ...");
if(!fChildren.size()) return kTRUE;
//______________________________________________________________________________
Bool_t AliEveTRDLoaderSim::Open(const char *filename, const char *dir)
{
- //Info("Open()", "");
-
+ // Open file in given dir.
fFilename = filename;
fDir = dir;
}
-
///////////////////////////////////////////////////////////
///////////// AliEveTRDLoaderRaw /////////////////////
///////////////////////////////////////////////////////////
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();
//______________________________________________________________________________
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;
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();
//______________________________________________________________________________
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.");
}
}
TGedFrame(p, width, height, options | kVerticalFrame, back),
fM(0), fLoadHits(0), fLoadDigits(0), fLoadClusters(0), fLoadTracks(0)
{
+ // Constructor.
+
MakeTitle("AliEveTRDLoaderSim");
// "Data selector" group frame
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<AliEveTRDLoaderSim*>(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);
//______________________________________________________________________________
void AliEveTRDLoaderSimEditor::Toggle(Int_t id)
{
+ // Toggle given button id.
+
switch(id){
case 0:
fM->fLoadHits = fLoadHits->IsDown() ? kTRUE : kFALSE;
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<AliEveTRDLoaderRaw*>(obj);
-// }
* 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
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);
public:
AliEveTRDLoaderRaw(const Text_t* n="AliEveTRDLoaderRaw", const Text_t* t=0);
- ~AliEveTRDLoaderRaw();
+ virtual ~AliEveTRDLoaderRaw() {}
Bool_t GoToEvent(int ev);
Bool_t LoadEvent();
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)
};
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
};
#include <TGButton.h>
#include <TGComboBox.h>
#include <TGListBox.h>
-#include <TGListTree.h>
-#include <TGString.h>
-#include <TGToolTip.h>
+//#include <TGListTree.h>
+//#include <TGString.h>
+//#include <TGToolTip.h>
#include <TClonesArray.h>
#include "AliLog.h"
///////// 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;
}
}
-
//______________________________________________________________________________
void AliEveTRDLoaderManager::Paint(Option_t *option)
{
+ // Paint object.
+
List_i ichmb = fChildren.begin();
while(ichmb != fChildren.end()){
(dynamic_cast<AliEveTRDLoader*>(*ichmb))->Paint(option);
//______________________________________________________________________________
void AliEveTRDLoaderManager::Remove(Int_t entry)
{
+ // Remove something.
+
//printf("AliEveTRDLoaderManager::Remove(%d)\n", entry);
List_i it = fChildren.begin();
for(int i=0; i<entry; i++) it++;
TGedFrame(p, width, height, options | kVerticalFrame, back),
fM(0), fSelector(0), fAdd(0), fRemoveButton(0), fGroupFrame(0), fRemove(0)
{
+ // Constructor.
+
MakeTitle("AliEveTRDLoaderManager");
// control frame - always there
fRemove = 0;
}
-//______________________________________________________________________________
-AliEveTRDLoaderManagerEditor::~AliEveTRDLoaderManagerEditor()
-{
-
-}
-
//______________________________________________________________________________
void AliEveTRDLoaderManagerEditor::Add()
{
+ // Slot to add something.
+
TGTextLBEntry *entry = (TGTextLBEntry*)fSelector->GetSelectedEntry();
if(!entry){
AliWarning("Select first the loader type that you want to use from the drop down list.");
//______________________________________________________________________________
void AliEveTRDLoaderManagerEditor::Remove(Int_t entry)
{
+ // Slot to remove something.
+
TIterator *it = fGroupFrame->GetList()->MakeIterator();
int ientry = 0;
while(/*TGFrame *f=(TGFrame*)*/it->Next()){
//______________________________________________________________________________
void AliEveTRDLoaderManagerEditor::SetModel(TObject* obj)
{
+ // Set model object.
+
fM = dynamic_cast<AliEveTRDLoaderManager*>(obj);
}
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TRDLoaderManager_H
-#define ALIEVE_TRDLoaderManager_H
+#ifndef AliEveTRDLoaderManager_H
+#define AliEveTRDLoaderManager_H
////////////////////////////////////////////////////////////////////////
//
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:
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
* See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
* full copyright notice. *
**************************************************************************/
+
#include "AliEveTRDModule.h"
#include "AliEveTRDModuleImp.h"
#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)
// Constructor.
}
-
-
///////////////////////////////////////////////////////////
////////// AliEveTRDModuleEditor //////////////////
///////////////////////////////////////////////////////////
fClustersColor(0),
fDisplayTracks(0)
{
+ // Constructor.
+
MakeTitle("TRD Detector");
// "Hits" group frame
"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)",
"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)",
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<AliEveTRDModule*>(obj);
+
if(AliEveTRDNode *node = dynamic_cast<AliEveTRDNode*>(fM)) node->UpdateNode();
fDisplayHits->SetEnabled(fM->fLoadHits);
//______________________________________________________________________________
void AliEveTRDModuleEditor::ModifyDigitsView()
{
+ // Slor to modify digit view.
+
fM->fDigitsNeedRecompute = kTRUE;
UpdateChamber();
}
//______________________________________________________________________________
void AliEveTRDModuleEditor::SetThreshold(Long_t tres)
{
+ // Slot for SetThreshold.
+
if(!fM->fLoadDigits) return;
fM->fDigitsThreshold = (tres == 0) ? (int)fThresValue->GetNumber():tres;
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TRDModule_H
-#define ALIEVE_TRDModule_H
+#ifndef AliEveTRDModule_H
+#define AliEveTRDModule_H
/////////////////////////////////////////////////////////////////////////
//
// by A.Bercuci (A.Bercuci@gsi.de) Fri Oct 27 2006
///////////////////////////////////////////////////////////////////////
-#ifndef ROOT_TNamed
#include <TNamed.h>
-#endif
-
-#ifndef ROOT_TGedFrame
#include <TGedFrame.h>
-#endif
class TObject;
class TGWindow;
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.
};
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);
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
#include "AliEveTRDModuleImp.h"
#include "AliEveTRDData.h"
-#include "TMath.h"
#include <TGListTree.h>
#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)
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<AliEveTRDModule*>(*iter))->Paint(option);
//______________________________________________________________________________
void AliEveTRDNode::Reset()
{
+ // Reset.
+
List_i iter = fChildren.begin();
while(iter != fChildren.end()){
(dynamic_cast<AliEveTRDModule*>(*iter))->Reset();
//______________________________________________________________________________
void AliEveTRDNode::Collapse()
{
+ // Collapse.
+
TGListTree *list = gEve->GetListTree();
AliEveTRDNode *node = 0x0;
List_i iter = fChildren.begin();
//______________________________________________________________________________
void AliEveTRDNode::Expand()
{
+ // Expand.
+
TGListTree *list = gEve->GetListTree();
AliEveTRDNode *node = 0x0;
List_i iter = fChildren.begin();
//______________________________________________________________________________
void AliEveTRDNode::EnableListElements()
{
+ // Enable list elements.
+
SetRnrSelf(kTRUE);
AliEveTRDNode *node = 0x0;
AliEveTRDChamber *chmb = 0x0;
//______________________________________________________________________________
void AliEveTRDNode::DisableListElements()
{
+ // Disable list elements.
+
SetRnrSelf(kFALSE);
AliEveTRDNode *node = 0x0;
AliEveTRDChamber *chmb = 0x0;
//______________________________________________________________________________
void AliEveTRDNode::UpdateLeaves()
{
+ // Update leaves.
+
AliEveTRDModule *module;
List_i iter = fChildren.begin();
while(iter != fChildren.end()){
//______________________________________________________________________________
void AliEveTRDNode::UpdateNode()
{
+ // Update node.
+
// Info("UpdateNode()", Form("%s", GetName()));
AliEveTRDNode *node = 0x0;
List_i iter = fChildren.begin();
//______________________________________________________________________________
Int_t AliEveTRDChamber::GetSM() const
{
+ // Get supermodule.
+
if(!fGeo){
AliWarning("Fail. No TRD geometry defined.");
return -1;
//______________________________________________________________________________
Int_t AliEveTRDChamber::GetSTK() const
{
+ // Get stack.
+
if(!fGeo){
AliWarning("Fail. No TRD geometry defined.");
return -1;
//____________________________________________________
void AliEveTRDChamber::Paint(Option_t* option)
{
- /* Info("Paint()", Form("%s", GetName()));*/
+ // Paint object.
+
if(!fRnrSelf) return;
if(fDigits && fRnrDigits){
if(fDigitsNeedRecompute){
//______________________________________________________________________________
void AliEveTRDChamber::Reset()
{
+ // Reset.
+
if(fHits){
fHits->Reset();
fLoadHits = kFALSE;
//______________________________________________________________________________
void AliEveTRDChamber::SetGeometry(AliTRDgeometry *geo)
{
+ // Set geometry.
+
fGeo = geo;
fPla = fGeo->GetPlane(fDet);
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_TRDModuleImp_H
-#define ALIEVE_TRDModuleImp_H
+#ifndef AliEveTRDModuleImp_H
+#define AliEveTRDModuleImp_H
/////////////////////////////////////////////////////////////////////////
//
#include "AliTPCCalibCE.h"
#include "AliTPCPreprocessorOnline.h"
#include "AliTPCCalROC.h"
-// ------------
+
+//______________________________________________________________________________
+//
+// Manage connections to HLT data-sources.
+
ClassImp(AliEveHOMERManager)
/*
// -- New SourceList has been created --> All Sources are new --> State has changed
fStateHasChanged = kTRUE;
+ /*
TIter next(fSourceList);
AliHLTHOMERSourceDesc* src = 0;
while ((src = (AliHLTHOMERSourceDesc*) next())) {
"Title?\nNot.");
AddElement(re);
}
+ */
if ( iResult ) {
AliWarning( Form("There have been errors, while creating the sources list.") );
// -- Create BlockList
CreateBlockList();
- return iResult;
+ return iResult;
}
//##################################################################################
* See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
* full copyright notice. *
**************************************************************************/
+
//-*- Mode: C++ -*-
#ifndef ALIEVEHOMERMANGER_H
#define ALIEVEHOMERMANGER_H
// == 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
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_AliEVEHOMERManagerEditor_H
-#define ALIEVE_AliEVEHOMERManagerEditor_H
+#ifndef AliEveAliEVEHOMERManagerEditor_H
+#define AliEveAliEVEHOMERManagerEditor_H
#include <TGedFrame.h>
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);
+}
* full copyright notice. *
**************************************************************************/
-#ifndef ALIEVE_AliEVEHOMERSource_H
-#define ALIEVE_AliEVEHOMERSource_H
+#ifndef AliEveAliEVEHOMERSource_H
+#define AliEveAliEVEHOMERSource_H
#include <TEveElement.h>
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
**************************************************************************/
#include "AliEveHOMERSourceList.h"
+#include "AliEveHOMERSourceMap.h"
+#include "AliEveHOMERManager.h"
//______________________________________________________________________________
// AliEveHOMERSourceList
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();
+}
+