1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.2 2000/05/08 16:17:27 cblume
21 Revision 1.1.4.1 2000/05/08 15:08:03 cblume
22 Remove the class AliTRDcluster
24 Revision 1.1 2000/02/28 18:57:58 cblume
29 ///////////////////////////////////////////////////////////////////////////////
31 // TRD cluster finder base class //
33 ///////////////////////////////////////////////////////////////////////////////
38 #include "AliTRDclusterizer.h"
40 ClassImp(AliTRDclusterizer)
42 //_____________________________________________________________________________
43 AliTRDclusterizer::AliTRDclusterizer():TNamed()
46 // AliTRDclusterizer default constructor
54 //_____________________________________________________________________________
55 AliTRDclusterizer::AliTRDclusterizer(const Text_t* name, const Text_t* title)
59 // AliTRDclusterizer default constructor
69 //_____________________________________________________________________________
70 AliTRDclusterizer::AliTRDclusterizer(AliTRDclusterizer &c)
73 // AliTRDclusterizer copy constructor
80 //_____________________________________________________________________________
81 AliTRDclusterizer::~AliTRDclusterizer()
84 // AliTRDclusterizer destructor
94 //_____________________________________________________________________________
95 void AliTRDclusterizer::Copy(AliTRDclusterizer &c)
106 //_____________________________________________________________________________
107 void AliTRDclusterizer::Init()
110 // Initializes the cluster finder
115 //_____________________________________________________________________________
116 Bool_t AliTRDclusterizer::Open(const Char_t *name, Int_t nEvent)
119 // Opens a ROOT-file with TRD-hits and reads in the digits-tree
122 // Connect the AliRoot file containing Geometry, Kine, and Hits
123 fInputFile = (TFile*) gROOT->GetListOfFiles()->FindObject(name);
125 printf("AliTRDclusterizer::Open -- ");
126 printf("Open the ALIROOT-file %s.\n",name);
127 fInputFile = new TFile(name,"UPDATE");
130 printf("AliTRDclusterizer::Open -- ");
131 printf("%s is already open.\n",name);
134 // Get AliRun object from file or create it if not on file
136 gAlice = (AliRun*) fInputFile->Get("gAlice");
138 printf("AliTRDclusterizer::Open -- ");
139 printf("AliRun object found on file.\n");
142 printf("AliTRDclusterizer::Open -- ");
143 printf("Could not find AliRun object.\n");
150 // Import the Trees for the event nEvent in the file
151 Int_t nparticles = gAlice->GetEvent(fEvent);
152 if (nparticles <= 0) {
153 printf("AliTRDclusterizer::Open -- ");
154 printf("No entries in the trees for event %d.\n",fEvent);
162 //_____________________________________________________________________________
163 Bool_t AliTRDclusterizer::WriteCluster()
166 // Writes out the TRD-cluster
169 // Write the new tree into the input file (use overwrite option)
171 sprintf(treeName,"TreeR%d",fEvent);
172 printf("AliTRDclusterizer::WriteCluster -- ");
173 printf("Write the cluster tree %s for event %d.\n"
175 gAlice->TreeR()->Write(treeName,2);