fix TRD digits display
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveTRDLoader.cxx
CommitLineData
d810d0de 1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
707b281a 9
d810d0de 10#include "AliEveTRDLoader.h"
11#include "AliEveTRDModuleImp.h"
6983e87a 12#include "EveBase/AliEveEventManager.h"
a282bf09 13
84aff7a4 14#include <TEveManager.h>
15#include <TEveGValuators.h>
a282bf09 16
6983e87a 17#include "TGeoManager.h"
edf0c4a0 18#include "TSystem.h"
19#include "TFile.h"
20#include "TTree.h"
edf0c4a0 21#include "TObjString.h"
22#include "TObjArray.h"
6983e87a 23#include "TClonesArray.h"
edf0c4a0 24
a282bf09 25#include <TGLabel.h>
26#include <TGButton.h>
27#include <TGTextEntry.h>
a282bf09 28#include <TGFileDialog.h>
a282bf09 29
edf0c4a0 30#include "AliLog.h"
a282bf09 31#include "AliCDBManager.h"
32
6983e87a 33#include "AliTRDhit.h"
a282bf09 34#include "AliTRDcluster.h"
a282bf09 35#include "AliTRDdigitsManager.h"
36#include "AliTRDgeometry.h"
37
d810d0de 38ClassImp(AliEveTRDLoader)
39ClassImp(AliEveTRDLoaderEditor)
a282bf09 40
41///////////////////////////////////////////////////////////
fd31e9de 42///////////// AliEveTRDLoader /////////////////////
a282bf09 43///////////////////////////////////////////////////////////
44
45
fd31e9de 46//______________________________________________________________________________
6983e87a 47AliEveTRDLoader::AliEveTRDLoader(const Text_t* n, const Text_t* t) : TEveElementList(n, t)
48 ,fDataType(0)
49 ,fSM(-1)
50 ,fStack(-1)
51 ,fLy(-1)
52 ,fEvent(-1)
53 ,fGeo(0x0)
54 ,fFilename("")
55 ,fDir(".")
51346b82 56{
a15e6d7d 57 // Constructor.
58
b642f9a5 59 AliEveEventManager::AssertGeometry();
6983e87a 60
61 fGeo = new AliTRDgeometry();
62 //fGeo->CreateClusterMatrixArray();
a15e6d7d 63}
fd31e9de 64
6983e87a 65//______________________________________________________________________________
fd31e9de 66void AliEveTRDLoader::AddChambers(int sm, int stk, int ly)
a282bf09 67{
a15e6d7d 68 // Add specified chambers.
69
6983e87a 70 fSM=sm; fStack=stk; fLy=ly;
a15e6d7d 71 Int_t ismStart = (sm == -1) ? 0 : sm;
72 Int_t ismStop = (sm == -1) ? 18 : sm+1;
73 Int_t istkStart= (stk == -1)? 0 : stk;
74 Int_t istkStop = (stk == -1)? 5 : stk+1;
75 Int_t ilyStart = (ly == -1) ? 0 : ly;
76 Int_t ilyStop = (ly == -1) ? 6 : ly+1;
fd31e9de 77
78 List_i ichmb;
79 ichmb = fChildren.begin();
80 while(ichmb != fChildren.end()){
81 (*ichmb)->SetRnrSelf(kFALSE);
82 ichmb++;
83 }
84
a15e6d7d 85 AliEveTRDNode *lSM=0x0, *lSTK=0x0;
86 AliEveTRDChamber *lCHMB = 0x0;
fd31e9de 87 int det;
a15e6d7d 88 for (int ism=ismStart; ism<ismStop; ism++){
6983e87a 89 if(!(lSM = (AliEveTRDNode*)FindChild(Form("SM%03d", ism)))){
a15e6d7d 90 AddElement(lSM = new AliEveTRDNode("SM", ism));
91 lSM->SetElementTitle(Form("Supermodule %2d", ism));
fd31e9de 92 }
6983e87a 93 lSM->SetRnrSelf(kTRUE);
94
a15e6d7d 95 for (int istk=istkStart; istk<istkStop; istk++) {
6983e87a 96 if(!(lSTK = (AliEveTRDNode*)lSM->FindChild("Stack%03d"))){
a15e6d7d 97 lSM->AddElement(lSTK = new AliEveTRDNode("Stack", istk));
98 lSTK->SetElementTitle(Form("SM %2d Stack %1d", ism, istk));
fd31e9de 99 }
6983e87a 100 lSTK->SetRnrSelf(kTRUE);
101
a15e6d7d 102 for (int ily=ilyStart; ily<ilyStop; ily++) {
fd31e9de 103 det = fGeo->GetDetector(ily, istk, ism);
6983e87a 104 if(!(lCHMB = (AliEveTRDChamber*)lSTK->FindChild(Form("Chmb%03d", det)))){
a15e6d7d 105 lSTK->AddElement(lCHMB = new AliEveTRDChamber(det));
106 lCHMB->SetGeometry(fGeo);
107 lCHMB->SetElementTitle(Form("SM %2d Stack %1d Layer %1d", ism, istk, ily));
fd31e9de 108 }
6983e87a 109 lCHMB->SetRnrSelf(kTRUE);
fd31e9de 110 }
111 }
112 }
113 gEve->Redraw3D();
a282bf09 114}
115
fd31e9de 116//______________________________________________________________________________
117AliEveTRDChamber* AliEveTRDLoader::GetChamber(int d)
a282bf09 118{
a15e6d7d 119 // Get given chamber.
120
6983e87a 121 Int_t ism = fGeo->GetSector(d),
7bc3159a 122 istk = fGeo->GetStack(d);
6983e87a 123
124 AliEveTRDNode *node = 0x0;
125 if(!(node = (AliEveTRDNode*)FindChild(Form("SM%03d", ism)))) return 0x0;
126 if(!(node = (AliEveTRDNode*)node->FindChild(Form("Stack%03d", istk)))) return 0x0;
127 return (AliEveTRDChamber*)node->FindChild(Form("Chmb%03d", d));
a282bf09 128}
129
fd31e9de 130//______________________________________________________________________________
131Bool_t AliEveTRDLoader::GoToEvent(int ev)
a282bf09 132{
a15e6d7d 133 // Go to given event.
134
fd31e9de 135 if(!fChildren.size()){
136 AliWarning("Please select first the chamber that you want to monitor from \"Chamber(s) selector\".");
137 return kFALSE;
138 }
139
140 fEvent = ev;
141
142 Unload();
143
144 TTree *t = 0x0;
6983e87a 145 TFile *f = TFile::Open(Form("%s/%s", fDir.Data(), fFilename.Data()));
16718cdc 146 if(! f->cd(Form("Event%d", ev))){
fd31e9de 147 AliError(Form("Couldn't find event %d in file \"%s/%s\".", ev, fDir.Data(), fFilename.Data()));
6983e87a 148 f->Close(); //delete f;
fd31e9de 149 return kFALSE;
150 }
151
6983e87a 152 if(fDataType&kTRDHits){
153 t = (TTree*)gDirectory->Get("TreeH");
154 if(!t) return kFALSE;
155 if(!LoadHits(t)) return kFALSE;
156 } else if(fDataType&kTRDDigits){
fd31e9de 157 t = (TTree*)gDirectory->Get("TreeD");
158 if(!t) return kFALSE;
159 if(!LoadDigits(t)) return kFALSE;
6983e87a 160 } else if(fDataType&kTRDClusters){
fd31e9de 161 t = (TTree*)gDirectory->Get("TreeR");
162 if(!t) return kFALSE;
163 if(!LoadClusters(t)) return kFALSE;
6983e87a 164 } else if(fDataType&kTRDTracklets){
a879a24a 165 t = (TTree*)gDirectory->Get("tracklets");
fd31e9de 166 if(!t) return kFALSE;
167 if(!LoadTracklets(t)) return kFALSE;
168 } else AliWarning("Please select first the type of data that you want to monitor and then hit the \"Load\" button.");
169
6983e87a 170 f->Close(); //delete f;
fd31e9de 171
172 gEve->Redraw3D();
173
174 return kTRUE;
a282bf09 175}
176
177
6983e87a 178//______________________________________________________________________________
179Bool_t AliEveTRDLoader::LoadHits(TTree *tH)
180{
181 // Load hits.
182
183 AliInfo("Loading ...");
184 if(!fChildren.size()) return kFALSE;
185
186 AliEveTRDChamber *chmb = 0x0;
187 TClonesArray *hits = new TClonesArray("AliTRDhit", 100);
188 tH->SetBranchAddress("TRD", &hits);
189 Int_t idx, nhits;
190 for(int iTrack=0; iTrack<tH->GetEntries(); iTrack++){
191 if(!tH->GetEvent(iTrack)) continue;
192 if(!(nhits = hits->GetEntriesFast())) continue;
193
194 idx = 0;
195 while(idx < nhits){
196 Int_t det = ((AliTRDhit*)hits->UncheckedAt(idx))->GetDetector();
197 chmb = GetChamber(det);
198 if(chmb) chmb->LoadHits(hits, idx);
199 else{
200 AliTRDhit *hit = 0x0;
201 while(idx < nhits){
202 hit = (AliTRDhit*)hits->UncheckedAt(idx);
203 if(hit->GetDetector() != det) break;
204 idx++;
205 }
206 }
207 }
208 hits->Delete();
209 }
210 return kTRUE;
211}
212
213
fd31e9de 214//______________________________________________________________________________
215Bool_t AliEveTRDLoader::LoadClusters(TTree *tC)
a282bf09 216{
a15e6d7d 217 // Load clusters.
218
fd31e9de 219 AliInfo("Loading ...");
3f797131 220 if(!fChildren.size()) return kFALSE;
fd31e9de 221
222 TObjArray *clusters = new TObjArray();
223 tC->SetBranchAddress("TRDcluster", &clusters);
224
225 AliEveTRDChamber *chmb = 0x0;
226 AliTRDcluster *c=0x0;
227 for(int idet=0; idet<540; idet++){
228 tC->GetEntry(idet);
229 if(!clusters->GetEntriesFast()) continue;
230 c = (AliTRDcluster*)clusters->UncheckedAt(0);
231 if(!c) continue;
232 if((chmb = GetChamber(c->GetDetector()))) chmb->LoadClusters(clusters);
233 }
234 return kTRUE;
a282bf09 235}
236
237
fd31e9de 238//______________________________________________________________________________
239Bool_t AliEveTRDLoader::LoadDigits(TTree *tD)
a282bf09 240{
a15e6d7d 241 // Load digits.
242
fd31e9de 243 AliInfo("Loading ...");
244
3f797131 245 if(!fChildren.size()) return kFALSE;
fd31e9de 246
247 AliEveTRDChamber *chmb;
248 AliTRDdigitsManager dm;
249 dm.ReadDigits(tD);
250 for(int idet=0; idet<540; idet++){
251 if(!(chmb=GetChamber(idet))) continue;
252 // digits = dm.GetDigits(idet);
253 // if(!digits) continue;
254 // chmb->LoadDigits(digits);
255 chmb->LoadDigits(&dm);
256 }
257 return kTRUE;
a282bf09 258}
259
260
fd31e9de 261//______________________________________________________________________________
a879a24a 262Bool_t AliEveTRDLoader::LoadTracklets(TTree *trklTree)
a282bf09 263{
a15e6d7d 264 // Load tracklets.
265
fd31e9de 266 AliInfo("Loading ...");
3f797131 267 if(!fChildren.size()) return kFALSE;
a282bf09 268
51346b82 269
fd31e9de 270 AliEveTRDChamber *chmb = 0x0;
a879a24a 271
fd31e9de 272 for(int idet=0; idet<540; idet++){
a879a24a 273 if((chmb = GetChamber(idet)))
274 chmb->LoadTracklets(trklTree);
fd31e9de 275 }
51346b82 276
fd31e9de 277 return kTRUE;
a282bf09 278}
51346b82 279
edf0c4a0 280
fd31e9de 281//______________________________________________________________________________
282Bool_t AliEveTRDLoader::Open(const char *filename, const char *dir)
a282bf09 283{
a15e6d7d 284 // Open given file in given directory.
285
fd31e9de 286 fFilename = filename;
287 fDir = dir;
288 Int_t count = 0;
6983e87a 289 count += fDataType&kTRDHits;
290 count += fDataType&kTRDDigits;
291 count += fDataType&kTRDClusters;
292 count += fDataType&kTRDTracklets;
fd31e9de 293
294 TObjArray *so = fFilename.Tokenize(".");
295
296 if(((TObjString*)(*so)[0])->GetString().CompareTo("TRD") != 0){
6983e87a 297 AliError("Filename didn't fulfill naming conventions. No TRD data will be loaded.");
298 return kFALSE;
fd31e9de 299 }
6983e87a 300
301 if(((TObjString*)(*so)[1])->GetString().CompareTo("Hits") == 0){
302 if(count && !fDataType&kTRDHits){
303 AliWarning("Data type set to HITS according to file name. Previous settings will be overwritten.");
304 fDataType = 0;
305 }
306 fDataType|=kTRDHits;
307 } else if(((TObjString*)(*so)[1])->GetString().CompareTo("Digits") == 0){
308 if(count && !fDataType&kTRDDigits){
309 AliWarning("Data type set to DIGITS according to file name. Previous settings will be overwritten.");
310 fDataType = 0;
311 }
312 fDataType|=kTRDDigits;
fd31e9de 313 } else if(((TObjString*)(*so)[1])->GetString().CompareTo("RecPoints") == 0){
6983e87a 314 if(count && !fDataType&kTRDClusters){
315 AliWarning("Data type set to CLUSTERS according to file name. Previous settings will be overwritten.");
316 fDataType = 0;
317 }
318 fDataType|=kTRDClusters;
a879a24a 319 } else if(((TObjString*)(*so)[1])->GetString().CompareTo("Tracklets") == 0){
6983e87a 320 if(count && !fDataType&kTRDTracklets){
321 AliWarning("Data type set to TRACKLETS according to file name. Previous settings will be overwritten.");
322 fDataType = 0;
323 }
324 fDataType|=kTRDTracklets;
fd31e9de 325 } else {
326 AliError("Filename didn't fulfill naming conventions. No data will be loaded.");
327 return kFALSE;
328 }
329
6983e87a 330 SetDataLinked();
fd31e9de 331 return kTRUE;
a282bf09 332}
333
fd31e9de 334//______________________________________________________________________________
d810d0de 335void AliEveTRDLoader::Paint(Option_t *option)
edf0c4a0 336{
a15e6d7d 337 // Paint object.
338
fd31e9de 339 List_i ichmb = fChildren.begin();
340 while(ichmb != fChildren.end()){
341 (dynamic_cast<AliEveTRDModule*>(*ichmb))->Paint(option);
342 ichmb++;
343 }
edf0c4a0 344}
345
edf0c4a0 346
fd31e9de 347//______________________________________________________________________________
d810d0de 348void AliEveTRDLoader::Unload()
a282bf09 349{
a15e6d7d 350 // Unload module data.
351
fd31e9de 352 List_i ichmb = fChildren.begin();
353 while(ichmb != fChildren.end()){
527ceac3 354 //(dynamic_cast<AliEveTRDModule*>(*ichmb))->Reset();
fd31e9de 355 ichmb++;
356 }
a282bf09 357}
358
359///////////////////////////////////////////////////////////
d810d0de 360///////////// AliEveTRDLoaderEditor /////////////////////
a282bf09 361///////////////////////////////////////////////////////////
362
fd31e9de 363//______________________________________________________________________________
364AliEveTRDLoaderEditor::AliEveTRDLoaderEditor(const TGWindow* p, Int_t width, Int_t height,
365 UInt_t options, Pixel_t back) :
366 TGedFrame(p, width, height, options | kVerticalFrame, back),
6983e87a 367 fM(0), fFile(0), fBrowse(0x0), fEvent(0),
fd31e9de 368 fSMNumber(0), fStackNumber(0), fPlaneNumber(0)
a282bf09 369{
a15e6d7d 370 // Constructor.
371
fd31e9de 372 MakeTitle("AliEveTRDLoader");
51346b82 373
6983e87a 374 // file browser frame
fd31e9de 375 Int_t labelW = 42;
fd31e9de 376 TGHorizontalFrame* f = new TGHorizontalFrame(this);
377 TGHorizontalFrame* g = new TGHorizontalFrame(f, labelW, 0, kFixedWidth);
378 TGLabel* l = new TGLabel(g, "File: ");
379 g->AddFrame(l, new TGLayoutHints(kLHintsLeft, 0,0,4,0));
380 f->AddFrame(g);
381 fFile = new TGTextEntry(f);
382 fFile->SetToolTipText("Select TRD data file or galice.root");
383 fFile->SetWidth(140);
384 fFile->Connect("DoubleClicked()", "AliEveTRDLoaderEditor", this, "FileOpen()");
385 f->AddFrame(fFile);
51346b82 386
6983e87a 387 fBrowse = new TGTextButton(f, "Browse");
388 f->AddFrame(fBrowse);
389 fBrowse->Connect("Clicked()", "AliEveTRDLoaderEditor", this, "FileOpen()");
390 AddFrame(f, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,5,5,5,5));
a282bf09 391
392
fd31e9de 393 // "Chamber(s) selector" group frame
394 TGGroupFrame *fGroupFrame1974 = new TGGroupFrame(this,"Chamber(s) selector");
395 TGVerticalFrame *fVerticalFrame1974 = new TGVerticalFrame(fGroupFrame1974, 150, 50,kVerticalFrame);
51346b82 396
fd31e9de 397 fSMNumber = new TEveGValuator(fVerticalFrame1974, "SM:", 0, 0);
14217b5f 398 fSMNumber->SetShowSlider(kFALSE);
399 fSMNumber->SetLabelWidth(labelW);
400 fSMNumber->SetNELength(6);
401 fSMNumber->Build();
402 fSMNumber->SetLimits(-1, 17);
403 fSMNumber->SetToolTip("Supermodule id [-1 for all]");
fd31e9de 404 fVerticalFrame1974->AddFrame(fSMNumber, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterX | kLHintsExpandY,2,2,2,2));
14217b5f 405
fd31e9de 406 fStackNumber = new TEveGValuator(fVerticalFrame1974, "Stack:", 0, 0);
14217b5f 407 fStackNumber->SetShowSlider(kFALSE);
408 fStackNumber->SetLabelWidth(labelW);
409 fStackNumber->SetNELength(6);
410 fStackNumber->Build();
411 fStackNumber->SetLimits(-1, 4);
412 fStackNumber->SetToolTip("Stack id [-1 for all in this SM]");
fd31e9de 413 fVerticalFrame1974->AddFrame(fStackNumber, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterX | kLHintsExpandY,2,2,2,2));
14217b5f 414
fd31e9de 415 fPlaneNumber = new TEveGValuator(fVerticalFrame1974, "Plane:", 0, 0);
14217b5f 416 fPlaneNumber->SetShowSlider(kFALSE);
417 fPlaneNumber->SetLabelWidth(labelW);
418 fPlaneNumber->SetNELength(6);
419 fPlaneNumber->Build();
420 fPlaneNumber->SetLimits(-1, 5);
421 fPlaneNumber->SetToolTip("Plane id [-1 for all in this stack]");
422
fd31e9de 423 fVerticalFrame1974->AddFrame(fPlaneNumber, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterX | kLHintsExpandY,2,2,2,2));
51346b82 424
fd31e9de 425 fGroupFrame1974->AddFrame(fVerticalFrame1974, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandY | kLHintsCenterX,2,2,2,2));
a282bf09 426
fd31e9de 427 TGTextButton *fTextButton2037 = new TGTextButton(fGroupFrame1974,"Select");
428 fTextButton2037->SetTextJustify(36);
429 fGroupFrame1974->AddFrame(fTextButton2037, new TGLayoutHints(kLHintsExpandY | kLHintsCenterX,2,2,2,2));
edf0c4a0 430 fTextButton2037->SetToolTipText("Apply selection", 400);
fd31e9de 431 fTextButton2037->Connect("Clicked()",
432 "AliEveTRDLoaderEditor", this, "AddChambers()");
a282bf09 433
fd31e9de 434 fGroupFrame1974->SetLayoutManager(new TGHorizontalLayout(fGroupFrame1974));
6983e87a 435 AddFrame(fGroupFrame1974, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,5,5,5,5));
436
437
438 // Event steering frame
439 f = new TGHorizontalFrame(this);
440 TGTextButton *fGoTo = new TGTextButton(f, "GoTo");
441 fGoTo->SetTextJustify(36);
442 fGoTo->Resize(164,22);
443 f->AddFrame(fGoTo, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,2,2,2,2));
444 fGoTo->SetToolTipText("Skip to event", 400);
445 fGoTo->Connect("Clicked()", "AliEveTRDLoaderEditor", this, "GoTo()");
446
447 fEvent = new TEveGValuator(f, "Event:", 110, 0);
448 fEvent->SetShowSlider(kFALSE);
449 fEvent->SetLabelWidth(labelW);
450 fEvent->SetNELength(6);
451 fEvent->Build();
452 fEvent->SetLimits(-1, 1000);
453 fEvent->SetToolTip("Set event number to be monitored");
454 fEvent->Connect("ValueSet(Double_t)",
455 "AliEveTRDLoaderEditor", this, "SetEvent(Double_t)");
456 f->AddFrame(fEvent, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2,2,2,2));
a282bf09 457
6983e87a 458 TGTextButton *fNext = new TGTextButton(f, "Next");
459 fNext->SetTextJustify(36);
460 fNext->Resize(164,22);
461 f->AddFrame(fNext, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,2,2,2,2));
462 fNext->SetToolTipText("Next event", 400);
463 fNext->Connect("Clicked()", "AliEveTRDLoaderEditor", this, "Next()");
464
465 AddFrame(f,new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,5,5,5,5));
a282bf09 466
a282bf09 467}
468
fd31e9de 469//______________________________________________________________________________
d810d0de 470void AliEveTRDLoaderEditor::SetModel(TObject* obj)
a282bf09 471{
a15e6d7d 472 // Set model object.
edf0c4a0 473
fd31e9de 474 fM = dynamic_cast<AliEveTRDLoader*>(obj);
14217b5f 475
6983e87a 476 fFile->SetEnabled(!fM->IsDataLinked());
fd31e9de 477 fFile->SetText(gSystem->BaseName(fM->fFilename.Data()));
6983e87a 478 fBrowse->SetEnabled(!fM->IsDataLinked());
14217b5f 479
6983e87a 480 fEvent->SetEnabled(fM->IsDataLinked());
fd31e9de 481 fEvent->GetEntry()->SetIntNumber(fM->fEvent);
51346b82 482
6983e87a 483 fSMNumber->SetEnabled(fM->IsDataLinked());
fd31e9de 484 fSMNumber->GetEntry()->SetIntNumber(fM->fSM);
edf0c4a0 485
486
6983e87a 487 fStackNumber->SetEnabled(fM->IsDataLinked());
fd31e9de 488 fStackNumber->GetEntry()->SetIntNumber(fM->fStack);
edf0c4a0 489
490
6983e87a 491 fPlaneNumber->SetEnabled(fM->IsDataLinked());
fd31e9de 492 fPlaneNumber->GetEntry()->SetIntNumber(fM->fLy);
a282bf09 493}
494
fd31e9de 495//______________________________________________________________________________
d810d0de 496void AliEveTRDLoaderEditor::AddChambers()
a282bf09 497{
a15e6d7d 498 // Slot to add chambers.
499
fd31e9de 500 fM->fSM = (int)fSMNumber->GetEntry()->GetNumber();
501 fM->fStack = (int)fStackNumber->GetEntry()->GetNumber();
502 fM->fLy = (int)fPlaneNumber->GetEntry()->GetNumber();
503 fM->AddChambers(fM->fSM, fM->fStack, fM->fLy);
a282bf09 504}
505
fd31e9de 506//______________________________________________________________________________
d810d0de 507void AliEveTRDLoaderEditor::FileOpen()
a282bf09 508{
a15e6d7d 509 // Slot for opening of file.
510
a282bf09 511 TGFileInfo fi;
14217b5f 512 fi.fIniDir = StrDup(gSystem->DirName (fM->fFilename.Data()));
513 fi.fFilename = StrDup(gSystem->BaseName(fM->fFilename.Data()));
fd31e9de 514 // fi.fFileTypes = tpcfiletypes;
14217b5f 515
84aff7a4 516 new TGFileDialog(fClient->GetRoot(), gEve->GetMainWindow(), kFDOpen, &fi);
a282bf09 517 if (!fi.fFilename) return;
518
6983e87a 519 if(fM->Open(gSystem->BaseName(fi.fFilename), gSystem->DirName (fi.fFilename))){
520 fFile->SetToolTipText(gSystem->DirName (fi.fFilename));
521 fFile->SetText (gSystem->BaseName(fi.fFilename));
522 } else fFile->Clear();
edf0c4a0 523
fd31e9de 524 this->SetModel(fM);
a282bf09 525}
526
6983e87a 527void AliEveTRDLoaderEditor::GoTo()
a282bf09 528{
a15e6d7d 529 // Slot for loading of event.
530
fd31e9de 531 fM->GoToEvent(fM->fEvent);
a282bf09 532}
6983e87a 533
534void AliEveTRDLoaderEditor::Next()
535{
536 // Slot for loading of event.
537
538 fM->NextEvent();
539}