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.4 2000/06/09 11:10:07 cblume
19 Compiler warnings and coding conventions, next round
21 Revision 1.3 2000/06/08 18:32:58 cblume
22 Make code compliant to coding conventions
24 Revision 1.2 2000/05/08 16:17:27 cblume
27 Revision 1.1.4.1 2000/05/08 15:08:03 cblume
28 Remove the class AliTRDcluster
30 Revision 1.1 2000/02/28 18:57:58 cblume
35 ///////////////////////////////////////////////////////////////////////////////
37 // TRD cluster finder base class //
39 ///////////////////////////////////////////////////////////////////////////////
46 #include "AliTRDclusterizer.h"
48 ClassImp(AliTRDclusterizer)
50 //_____________________________________________________________________________
51 AliTRDclusterizer::AliTRDclusterizer():TNamed()
54 // AliTRDclusterizer default constructor
62 //_____________________________________________________________________________
63 AliTRDclusterizer::AliTRDclusterizer(const Text_t* name, const Text_t* title)
67 // AliTRDclusterizer default constructor
77 //_____________________________________________________________________________
78 AliTRDclusterizer::AliTRDclusterizer(const AliTRDclusterizer &c)
81 // AliTRDclusterizer copy constructor
84 ((AliTRDclusterizer &) c).Copy(*this);
88 //_____________________________________________________________________________
89 AliTRDclusterizer::~AliTRDclusterizer()
92 // AliTRDclusterizer destructor
102 //_____________________________________________________________________________
103 AliTRDclusterizer &AliTRDclusterizer::operator=(const AliTRDclusterizer &c)
106 // Assignment operator
109 if (this != &c) ((AliTRDclusterizer &) c).Copy(*this);
114 //_____________________________________________________________________________
115 void AliTRDclusterizer::Copy(TObject &c)
121 ((AliTRDclusterizer &) c).fInputFile = NULL;
122 ((AliTRDclusterizer &) c).fEvent = 0;
126 //_____________________________________________________________________________
127 void AliTRDclusterizer::Init()
130 // Initializes the cluster finder
135 //_____________________________________________________________________________
136 Bool_t AliTRDclusterizer::Open(const Char_t *name, Int_t nEvent)
139 // Opens a ROOT-file with TRD-hits and reads in the digits-tree
142 // Connect the AliRoot file containing Geometry, Kine, and Hits
143 fInputFile = (TFile*) gROOT->GetListOfFiles()->FindObject(name);
145 printf("AliTRDclusterizer::Open -- ");
146 printf("Open the ALIROOT-file %s.\n",name);
147 fInputFile = new TFile(name,"UPDATE");
150 printf("AliTRDclusterizer::Open -- ");
151 printf("%s is already open.\n",name);
154 // Get AliRun object from file or create it if not on file
156 gAlice = (AliRun*) fInputFile->Get("gAlice");
158 printf("AliTRDclusterizer::Open -- ");
159 printf("AliRun object found on file.\n");
162 printf("AliTRDclusterizer::Open -- ");
163 printf("Could not find AliRun object.\n");
170 // Import the Trees for the event nEvent in the file
171 Int_t nparticles = gAlice->GetEvent(fEvent);
172 if (nparticles <= 0) {
173 printf("AliTRDclusterizer::Open -- ");
174 printf("No entries in the trees for event %d.\n",fEvent);
182 //_____________________________________________________________________________
183 Bool_t AliTRDclusterizer::WriteCluster()
186 // Writes out the TRD-cluster
189 // Write the new tree into the input file (use overwrite option)
191 sprintf(treeName,"TreeR%d",fEvent);
192 printf("AliTRDclusterizer::WriteCluster -- ");
193 printf("Write the cluster tree %s for event %d.\n"
195 gAlice->TreeR()->Write(treeName,2);