- fInputFile = (TFile*) gROOT->GetListOfFiles()->FindObject(name);
- if (!fInputFile) {
- printf("AliTRDclusterizer::Open -- ");
- printf("Open the ALIROOT-file %s.\n",name);
- fInputFile = new TFile(name,"UPDATE");
+ if (fRunLoader->GetAliRun() == 0x0) fRunLoader->LoadgAlice();
+ gAlice = fRunLoader->GetAliRun();
+
+ if (!(gAlice)) {
+ fRunLoader->LoadgAlice();
+ gAlice = fRunLoader->GetAliRun();
+ if (!(gAlice)) {
+ printf("AliTRDclusterizer::OpenInput -- ");
+ printf("Could not find AliRun object.\n");
+ return kFALSE;
+ }
+ }
+
+ // Import the Trees for the event nEvent in the file
+ fRunLoader->GetEvent(nEvent);
+
+ return kTRUE;
+
+}
+
+//_____________________________________________________________________________
+Bool_t AliTRDclusterizer::WriteClusters(Int_t det)
+{
+ //
+ // Fills TRDcluster branch in the tree with the clusters
+ // found in detector = det. For det=-1 writes the tree.
+ //
+
+ if ((det < -1) || (det >= AliTRDgeometry::Ndet())) {
+ printf("AliTRDclusterizer::WriteClusters -- ");
+ printf("Unexpected detector index %d.\n",det);
+ return kFALSE;