CMake: removing qpythia from the depedencies
[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"
b9df0156 12#include "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
883dc828 144 Int_t ndt(0);
a2125de9 145 const Char_t *tn[] = {"TreeH", "TreeD", "TreeR", "tracklets-raw"};
883dc828 146 const Char_t *fn[] = {"Hits", "Digits", "RecPoints", "Tracklets"};
09487f16 147 TTree *t(NULL); TFile *f(NULL);
883dc828 148 for(Int_t idt(0); idt<4; idt++){
149 if(idt==0 && !(fDataType&kTRDHits)) continue;
150 else if(idt==1 && !(fDataType&kTRDDigits)) continue;
151 else if(idt==2 && !(fDataType&kTRDClusters)) continue;
152 else if(idt==3 && !(fDataType&kTRDTracklets)) continue;
153
154 if(!(f = TFile::Open(Form("%s/TRD.%s.root", fDir.Data(), fn[idt])))){
155 AliWarning(Form("File not found \"%s/TRD.%s.root\".", fDir.Data(), fn[idt]));
156 continue;
09487f16 157 }
883dc828 158 if(!f->cd(Form("Event%d", ev))){
159 AliError(Form("Event[%d] not found in file \"%s/TRD.%s.root\".", ev, fDir.Data(), fn[idt]));
160 f->Close(); //delete f;
161 continue;
09487f16 162 }
883dc828 163
164 if(!(t = (TTree*)gDirectory->Get(tn[idt]))) AliError(Form("Tree[%s] not found for Event[%d].", tn[idt], ev));
165 else{
166 switch(idt){
167 case 0:
168 if(LoadHits(t)) ndt++;
169 break;
170 case 1:
171 if(LoadDigits(t)) ndt++;
172 break;
173 case 2:
174 if(LoadClusters(t)) ndt++;
175 break;
176 case 3:
177 if(LoadTracklets(t)) ndt++;
178 break;
179 }
09487f16 180 }
883dc828 181 f->Close(); //delete f;
09487f16 182 }
fd31e9de 183 gEve->Redraw3D();
184
883dc828 185 return Bool_t(ndt);
a282bf09 186}
187
188
fd31e9de 189//______________________________________________________________________________
6983e87a 190Bool_t AliEveTRDLoader::LoadHits(TTree *tH)
191{
192 // Load hits.
193
194 AliInfo("Loading ...");
195 if(!fChildren.size()) return kFALSE;
196
883dc828 197 AliEveTRDChamber *chmb(NULL);
6983e87a 198 TClonesArray *hits = new TClonesArray("AliTRDhit", 100);
199 tH->SetBranchAddress("TRD", &hits);
200 Int_t idx, nhits;
201 for(int iTrack=0; iTrack<tH->GetEntries(); iTrack++){
202 if(!tH->GetEvent(iTrack)) continue;
203 if(!(nhits = hits->GetEntriesFast())) continue;
204
205 idx = 0;
206 while(idx < nhits){
207 Int_t det = ((AliTRDhit*)hits->UncheckedAt(idx))->GetDetector();
208 chmb = GetChamber(det);
209 if(chmb) chmb->LoadHits(hits, idx);
210 else{
883dc828 211 AliTRDhit *hit(NULL);
6983e87a 212 while(idx < nhits){
213 hit = (AliTRDhit*)hits->UncheckedAt(idx);
214 if(hit->GetDetector() != det) break;
215 idx++;
216 }
217 }
218 }
219 hits->Delete();
220 }
221 return kTRUE;
222}
223
224
225//______________________________________________________________________________
fd31e9de 226Bool_t AliEveTRDLoader::LoadClusters(TTree *tC)
a282bf09 227{
a15e6d7d 228 // Load clusters.
229
fd31e9de 230 AliInfo("Loading ...");
3f797131 231 if(!fChildren.size()) return kFALSE;
fd31e9de 232
883dc828 233 TObjArray *clusters(NULL);
fd31e9de 234 tC->SetBranchAddress("TRDcluster", &clusters);
235
09487f16 236 AliEveTRDChamber *chmb(NULL);
237 AliTRDcluster *c(NULL);
238 for(int idet=0; idet<AliTRDgeometry::kNdet; idet++){
fd31e9de 239 tC->GetEntry(idet);
240 if(!clusters->GetEntriesFast()) continue;
09487f16 241 if(!(c = (AliTRDcluster*)clusters->UncheckedAt(0))) continue;
fd31e9de 242 if((chmb = GetChamber(c->GetDetector()))) chmb->LoadClusters(clusters);
243 }
244 return kTRUE;
a282bf09 245}
246
247
fd31e9de 248//______________________________________________________________________________
249Bool_t AliEveTRDLoader::LoadDigits(TTree *tD)
a282bf09 250{
a15e6d7d 251 // Load digits.
252
fd31e9de 253 AliInfo("Loading ...");
254
3f797131 255 if(!fChildren.size()) return kFALSE;
fd31e9de 256
883dc828 257 AliEveTRDChamber *chmb(NULL);
fd31e9de 258 AliTRDdigitsManager dm;
259 dm.ReadDigits(tD);
09487f16 260 for(int idet=0; idet<AliTRDgeometry::kNdet; idet++){
fd31e9de 261 if(!(chmb=GetChamber(idet))) continue;
fd31e9de 262 chmb->LoadDigits(&dm);
263 }
264 return kTRUE;
a282bf09 265}
266
267
fd31e9de 268//______________________________________________________________________________
a879a24a 269Bool_t AliEveTRDLoader::LoadTracklets(TTree *trklTree)
a282bf09 270{
a15e6d7d 271 // Load tracklets.
272
fd31e9de 273 AliInfo("Loading ...");
3f797131 274 if(!fChildren.size()) return kFALSE;
a282bf09 275
51346b82 276
883dc828 277 AliEveTRDChamber *chmb(NULL);
a879a24a 278
883dc828 279 for(int idet=0; idet<AliTRDgeometry::kNdet; idet++){
a879a24a 280 if((chmb = GetChamber(idet)))
281 chmb->LoadTracklets(trklTree);
fd31e9de 282 }
51346b82 283
fd31e9de 284 return kTRUE;
a282bf09 285}
51346b82 286
edf0c4a0 287
fd31e9de 288//______________________________________________________________________________
289Bool_t AliEveTRDLoader::Open(const char *filename, const char *dir)
a282bf09 290{
a15e6d7d 291 // Open given file in given directory.
292
fd31e9de 293 fFilename = filename;
294 fDir = dir;
fd31e9de 295 TObjArray *so = fFilename.Tokenize(".");
296
297 if(((TObjString*)(*so)[0])->GetString().CompareTo("TRD") != 0){
883dc828 298 AliError(Form("Filename %s do not fulfill AliRoot naming conventions.", filename));
09d5920f 299 delete so;
883dc828 300 return kFALSE;
301 }
302 if(gSystem->AccessPathName(Form("%s/%s", dir, filename))){
303 AliError(Form("Missing file %s/%s", dir, filename));
09d5920f 304 delete so;
6983e87a 305 return kFALSE;
fd31e9de 306 }
6983e87a 307 if(((TObjString*)(*so)[1])->GetString().CompareTo("Hits") == 0){
883dc828 308 if(!(fDataType&kTRDHits)){
309 AliInfo("Data type set to HITS according to file name.");
310 fDataType|=kTRDHits;
6983e87a 311 }
6983e87a 312 } else if(((TObjString*)(*so)[1])->GetString().CompareTo("Digits") == 0){
883dc828 313 if(!(fDataType&kTRDDigits)){
314 AliInfo("Data type set to DIGITS according to file name.");
315 fDataType|=kTRDDigits;
6983e87a 316 }
fd31e9de 317 } else if(((TObjString*)(*so)[1])->GetString().CompareTo("RecPoints") == 0){
883dc828 318 if(!(fDataType&kTRDClusters)){
319 AliInfo("Data type set to CLUSTERS according to file name.");
320 fDataType|=kTRDClusters;
6983e87a 321 }
a879a24a 322 } else if(((TObjString*)(*so)[1])->GetString().CompareTo("Tracklets") == 0){
883dc828 323 if(!(fDataType&kTRDTracklets)){
324 AliInfo("Data type set to TRACKLETS according to file name.");
325 fDataType|=kTRDTracklets;
6983e87a 326 }
fd31e9de 327 } else {
328 AliError("Filename didn't fulfill naming conventions. No data will be loaded.");
09d5920f 329 delete so;
fd31e9de 330 return kFALSE;
331 }
09d5920f 332 delete so;
6983e87a 333 SetDataLinked();
fd31e9de 334 return kTRUE;
a282bf09 335}
336
fd31e9de 337//______________________________________________________________________________
d810d0de 338void AliEveTRDLoader::Paint(Option_t *option)
edf0c4a0 339{
a15e6d7d 340 // Paint object.
341
90ae0503 342 AliEveTRDModule *module(NULL);
fd31e9de 343 List_i ichmb = fChildren.begin();
344 while(ichmb != fChildren.end()){
90ae0503 345 if((module = dynamic_cast<AliEveTRDModule*>(*ichmb))) module->Paint(option);
fd31e9de 346 ichmb++;
347 }
edf0c4a0 348}
349
edf0c4a0 350
fd31e9de 351//______________________________________________________________________________
d810d0de 352void AliEveTRDLoader::Unload()
a282bf09 353{
a15e6d7d 354 // Unload module data.
355
fd31e9de 356 List_i ichmb = fChildren.begin();
357 while(ichmb != fChildren.end()){
527ceac3 358 //(dynamic_cast<AliEveTRDModule*>(*ichmb))->Reset();
fd31e9de 359 ichmb++;
360 }
a282bf09 361}
362
363///////////////////////////////////////////////////////////
d810d0de 364///////////// AliEveTRDLoaderEditor /////////////////////
a282bf09 365///////////////////////////////////////////////////////////
366
fd31e9de 367//______________________________________________________________________________
368AliEveTRDLoaderEditor::AliEveTRDLoaderEditor(const TGWindow* p, Int_t width, Int_t height,
369 UInt_t options, Pixel_t back) :
370 TGedFrame(p, width, height, options | kVerticalFrame, back),
6983e87a 371 fM(0), fFile(0), fBrowse(0x0), fEvent(0),
fd31e9de 372 fSMNumber(0), fStackNumber(0), fPlaneNumber(0)
a282bf09 373{
a15e6d7d 374 // Constructor.
375
fd31e9de 376 MakeTitle("AliEveTRDLoader");
51346b82 377
6983e87a 378 // file browser frame
fd31e9de 379 Int_t labelW = 42;
fd31e9de 380 TGHorizontalFrame* f = new TGHorizontalFrame(this);
381 TGHorizontalFrame* g = new TGHorizontalFrame(f, labelW, 0, kFixedWidth);
382 TGLabel* l = new TGLabel(g, "File: ");
383 g->AddFrame(l, new TGLayoutHints(kLHintsLeft, 0,0,4,0));
384 f->AddFrame(g);
385 fFile = new TGTextEntry(f);
386 fFile->SetToolTipText("Select TRD data file or galice.root");
387 fFile->SetWidth(140);
388 fFile->Connect("DoubleClicked()", "AliEveTRDLoaderEditor", this, "FileOpen()");
389 f->AddFrame(fFile);
51346b82 390
6983e87a 391 fBrowse = new TGTextButton(f, "Browse");
392 f->AddFrame(fBrowse);
393 fBrowse->Connect("Clicked()", "AliEveTRDLoaderEditor", this, "FileOpen()");
394 AddFrame(f, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,5,5,5,5));
a282bf09 395
396
fd31e9de 397 // "Chamber(s) selector" group frame
398 TGGroupFrame *fGroupFrame1974 = new TGGroupFrame(this,"Chamber(s) selector");
399 TGVerticalFrame *fVerticalFrame1974 = new TGVerticalFrame(fGroupFrame1974, 150, 50,kVerticalFrame);
51346b82 400
fd31e9de 401 fSMNumber = new TEveGValuator(fVerticalFrame1974, "SM:", 0, 0);
14217b5f 402 fSMNumber->SetShowSlider(kFALSE);
403 fSMNumber->SetLabelWidth(labelW);
404 fSMNumber->SetNELength(6);
405 fSMNumber->Build();
406 fSMNumber->SetLimits(-1, 17);
407 fSMNumber->SetToolTip("Supermodule id [-1 for all]");
fd31e9de 408 fVerticalFrame1974->AddFrame(fSMNumber, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterX | kLHintsExpandY,2,2,2,2));
14217b5f 409
fd31e9de 410 fStackNumber = new TEveGValuator(fVerticalFrame1974, "Stack:", 0, 0);
14217b5f 411 fStackNumber->SetShowSlider(kFALSE);
412 fStackNumber->SetLabelWidth(labelW);
413 fStackNumber->SetNELength(6);
414 fStackNumber->Build();
415 fStackNumber->SetLimits(-1, 4);
416 fStackNumber->SetToolTip("Stack id [-1 for all in this SM]");
fd31e9de 417 fVerticalFrame1974->AddFrame(fStackNumber, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterX | kLHintsExpandY,2,2,2,2));
14217b5f 418
fd31e9de 419 fPlaneNumber = new TEveGValuator(fVerticalFrame1974, "Plane:", 0, 0);
14217b5f 420 fPlaneNumber->SetShowSlider(kFALSE);
421 fPlaneNumber->SetLabelWidth(labelW);
422 fPlaneNumber->SetNELength(6);
423 fPlaneNumber->Build();
424 fPlaneNumber->SetLimits(-1, 5);
425 fPlaneNumber->SetToolTip("Plane id [-1 for all in this stack]");
426
fd31e9de 427 fVerticalFrame1974->AddFrame(fPlaneNumber, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterX | kLHintsExpandY,2,2,2,2));
51346b82 428
fd31e9de 429 fGroupFrame1974->AddFrame(fVerticalFrame1974, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandY | kLHintsCenterX,2,2,2,2));
a282bf09 430
fd31e9de 431 TGTextButton *fTextButton2037 = new TGTextButton(fGroupFrame1974,"Select");
432 fTextButton2037->SetTextJustify(36);
433 fGroupFrame1974->AddFrame(fTextButton2037, new TGLayoutHints(kLHintsExpandY | kLHintsCenterX,2,2,2,2));
edf0c4a0 434 fTextButton2037->SetToolTipText("Apply selection", 400);
fd31e9de 435 fTextButton2037->Connect("Clicked()",
436 "AliEveTRDLoaderEditor", this, "AddChambers()");
a282bf09 437
fd31e9de 438 fGroupFrame1974->SetLayoutManager(new TGHorizontalLayout(fGroupFrame1974));
6983e87a 439 AddFrame(fGroupFrame1974, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,5,5,5,5));
440
441
442 // Event steering frame
443 f = new TGHorizontalFrame(this);
444 TGTextButton *fGoTo = new TGTextButton(f, "GoTo");
445 fGoTo->SetTextJustify(36);
446 fGoTo->Resize(164,22);
447 f->AddFrame(fGoTo, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,2,2,2,2));
448 fGoTo->SetToolTipText("Skip to event", 400);
449 fGoTo->Connect("Clicked()", "AliEveTRDLoaderEditor", this, "GoTo()");
450
451 fEvent = new TEveGValuator(f, "Event:", 110, 0);
452 fEvent->SetShowSlider(kFALSE);
453 fEvent->SetLabelWidth(labelW);
454 fEvent->SetNELength(6);
455 fEvent->Build();
456 fEvent->SetLimits(-1, 1000);
457 fEvent->SetToolTip("Set event number to be monitored");
458 fEvent->Connect("ValueSet(Double_t)",
459 "AliEveTRDLoaderEditor", this, "SetEvent(Double_t)");
460 f->AddFrame(fEvent, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2,2,2,2));
a282bf09 461
6983e87a 462 TGTextButton *fNext = new TGTextButton(f, "Next");
463 fNext->SetTextJustify(36);
464 fNext->Resize(164,22);
465 f->AddFrame(fNext, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,2,2,2,2));
466 fNext->SetToolTipText("Next event", 400);
467 fNext->Connect("Clicked()", "AliEveTRDLoaderEditor", this, "Next()");
468
469 AddFrame(f,new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY | kLHintsExpandX,5,5,5,5));
a282bf09 470
a282bf09 471}
472
fd31e9de 473//______________________________________________________________________________
d810d0de 474void AliEveTRDLoaderEditor::SetModel(TObject* obj)
a282bf09 475{
a15e6d7d 476 // Set model object.
edf0c4a0 477
90ae0503 478 if(!(fM = dynamic_cast<AliEveTRDLoader*>(obj))) return;
14217b5f 479
6983e87a 480 fFile->SetEnabled(!fM->IsDataLinked());
fd31e9de 481 fFile->SetText(gSystem->BaseName(fM->fFilename.Data()));
6983e87a 482 fBrowse->SetEnabled(!fM->IsDataLinked());
14217b5f 483
6983e87a 484 fEvent->SetEnabled(fM->IsDataLinked());
fd31e9de 485 fEvent->GetEntry()->SetIntNumber(fM->fEvent);
51346b82 486
6983e87a 487 fSMNumber->SetEnabled(fM->IsDataLinked());
fd31e9de 488 fSMNumber->GetEntry()->SetIntNumber(fM->fSM);
edf0c4a0 489
490
6983e87a 491 fStackNumber->SetEnabled(fM->IsDataLinked());
fd31e9de 492 fStackNumber->GetEntry()->SetIntNumber(fM->fStack);
edf0c4a0 493
494
6983e87a 495 fPlaneNumber->SetEnabled(fM->IsDataLinked());
fd31e9de 496 fPlaneNumber->GetEntry()->SetIntNumber(fM->fLy);
a282bf09 497}
498
fd31e9de 499//______________________________________________________________________________
d810d0de 500void AliEveTRDLoaderEditor::AddChambers()
a282bf09 501{
a15e6d7d 502 // Slot to add chambers.
503
fd31e9de 504 fM->fSM = (int)fSMNumber->GetEntry()->GetNumber();
505 fM->fStack = (int)fStackNumber->GetEntry()->GetNumber();
506 fM->fLy = (int)fPlaneNumber->GetEntry()->GetNumber();
507 fM->AddChambers(fM->fSM, fM->fStack, fM->fLy);
a282bf09 508}
509
fd31e9de 510//______________________________________________________________________________
d810d0de 511void AliEveTRDLoaderEditor::FileOpen()
a282bf09 512{
a15e6d7d 513 // Slot for opening of file.
514
a282bf09 515 TGFileInfo fi;
14217b5f 516 fi.fIniDir = StrDup(gSystem->DirName (fM->fFilename.Data()));
517 fi.fFilename = StrDup(gSystem->BaseName(fM->fFilename.Data()));
fd31e9de 518 // fi.fFileTypes = tpcfiletypes;
14217b5f 519
84aff7a4 520 new TGFileDialog(fClient->GetRoot(), gEve->GetMainWindow(), kFDOpen, &fi);
a282bf09 521 if (!fi.fFilename) return;
522
6983e87a 523 if(fM->Open(gSystem->BaseName(fi.fFilename), gSystem->DirName (fi.fFilename))){
524 fFile->SetToolTipText(gSystem->DirName (fi.fFilename));
525 fFile->SetText (gSystem->BaseName(fi.fFilename));
526 } else fFile->Clear();
edf0c4a0 527
fd31e9de 528 this->SetModel(fM);
a282bf09 529}
530
6983e87a 531void AliEveTRDLoaderEditor::GoTo()
a282bf09 532{
a15e6d7d 533 // Slot for loading of event.
534
fd31e9de 535 fM->GoToEvent(fM->fEvent);
a282bf09 536}
6983e87a 537
538void AliEveTRDLoaderEditor::Next()
539{
540 // Slot for loading of event.
541
542 fM->NextEvent();
543}