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.3 2000/06/08 18:32:58 cblume
19 Make code compliant to coding conventions
21 Revision 1.2 2000/05/08 16:17:27 cblume
24 Revision 1.1.4.1 2000/05/08 15:08:03 cblume
25 Remove the class AliTRDcluster
27 Revision 1.1 2000/02/28 18:57:58 cblume
32 ///////////////////////////////////////////////////////////////////////////////
34 // TRD cluster finder base class //
36 ///////////////////////////////////////////////////////////////////////////////
41 #include "AliTRDclusterizer.h"
43 ClassImp(AliTRDclusterizer)
45 //_____________________________________________________________________________
46 AliTRDclusterizer::AliTRDclusterizer():TNamed()
49 // AliTRDclusterizer default constructor
57 //_____________________________________________________________________________
58 AliTRDclusterizer::AliTRDclusterizer(const Text_t* name, const Text_t* title)
62 // AliTRDclusterizer default constructor
72 //_____________________________________________________________________________
73 AliTRDclusterizer::AliTRDclusterizer(const AliTRDclusterizer &c)
76 // AliTRDclusterizer copy constructor
79 ((AliTRDclusterizer &) c).Copy(*this);
83 //_____________________________________________________________________________
84 AliTRDclusterizer::~AliTRDclusterizer()
87 // AliTRDclusterizer destructor
97 //_____________________________________________________________________________
98 AliTRDclusterizer &AliTRDclusterizer::operator=(const AliTRDclusterizer &c)
101 // Assignment operator
104 if (this != &c) ((AliTRDclusterizer &) c).Copy(*this);
109 //_____________________________________________________________________________
110 void AliTRDclusterizer::Copy(TObject &c)
116 ((AliTRDclusterizer &) c).fInputFile = NULL;
117 ((AliTRDclusterizer &) c).fEvent = 0;
121 //_____________________________________________________________________________
122 void AliTRDclusterizer::Init()
125 // Initializes the cluster finder
130 //_____________________________________________________________________________
131 Bool_t AliTRDclusterizer::Open(const Char_t *name, Int_t nEvent)
134 // Opens a ROOT-file with TRD-hits and reads in the digits-tree
137 // Connect the AliRoot file containing Geometry, Kine, and Hits
138 fInputFile = (TFile*) gROOT->GetListOfFiles()->FindObject(name);
140 printf("AliTRDclusterizer::Open -- ");
141 printf("Open the ALIROOT-file %s.\n",name);
142 fInputFile = new TFile(name,"UPDATE");
145 printf("AliTRDclusterizer::Open -- ");
146 printf("%s is already open.\n",name);
149 // Get AliRun object from file or create it if not on file
151 gAlice = (AliRun*) fInputFile->Get("gAlice");
153 printf("AliTRDclusterizer::Open -- ");
154 printf("AliRun object found on file.\n");
157 printf("AliTRDclusterizer::Open -- ");
158 printf("Could not find AliRun object.\n");
165 // Import the Trees for the event nEvent in the file
166 Int_t nparticles = gAlice->GetEvent(fEvent);
167 if (nparticles <= 0) {
168 printf("AliTRDclusterizer::Open -- ");
169 printf("No entries in the trees for event %d.\n",fEvent);
177 //_____________________________________________________________________________
178 Bool_t AliTRDclusterizer::WriteCluster()
181 // Writes out the TRD-cluster
184 // Write the new tree into the input file (use overwrite option)
186 sprintf(treeName,"TreeR%d",fEvent);
187 printf("AliTRDclusterizer::WriteCluster -- ");
188 printf("Write the cluster tree %s for event %d.\n"
190 gAlice->TreeR()->Write(treeName,2);