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