Fixing (most of) compiler warnings
[u/mrichter/AliRoot.git] / HLT / ITS / AliHLTITSclusterer.cxx
CommitLineData
3136129d 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16//-------------------------------------------------------------------------
17// Implementation of the HLT ITS clusterer class
18// The class derives from AliITSclustererV2.
19// There is one new method added which allows to read ITS raw data
20// and store the clusters in a tree without using runloaders.
21// In this case, the labels filling is skipped.
22// Origin: Cvetan Cheshkov, CERN, Cvetan.Cheshkov@cern.ch
23//-------------------------------------------------------------------------
24
4aa41877 25#include "AliHLTITSclusterer.h"
79c75366 26#include "AliITSgeomTGeo.h"
3136129d 27#include "AliRawReader.h"
e9c5ca17 28#include "AliITSRawStreamSPD.h"
29#include "AliITSRawStreamSDD.h"
30#include "AliITSRawStreamSSD.h"
3136129d 31#include <TTree.h>
32#include <TClonesArray.h>
33
4aa41877 34ClassImp(AliHLTITSclusterer)
3136129d 35
79c75366 36AliHLTITSclusterer::AliHLTITSclusterer(const Char_t *geom):AliITSclustererV2(geom)
3136129d 37{
79c75366 38fNModule = AliITSgeomTGeo::GetNModules();
3136129d 39}
40
4aa41877 41void AliHLTITSclusterer::Digits2Clusters(AliRawReader* rawReader,TTree *cTree)
3136129d 42{
43
44 TClonesArray *array=new TClonesArray("AliITSclusterV2",1000);
45 cTree->Branch("Clusters",&array);
46 delete array;
47
48 TClonesArray** clusters = new TClonesArray*[fNModule];
49 for (Int_t iModule = 0; iModule < fNModule; iModule++) {
50 clusters[iModule] = NULL;
51 }
52
53 rawReader->Reset();
54 AliITSRawStreamSPD inputSPD(rawReader);
55 FindClustersSPD(&inputSPD, clusters);
56
57 rawReader->Reset();
58 AliITSRawStreamSDD inputSDD(rawReader);
59 FindClustersSDD(&inputSDD, clusters);
60
61 rawReader->Reset();
62 AliITSRawStreamSSD inputSSD(rawReader);
63 FindClustersSSD(&inputSSD, clusters);
64
65 // write all clusters to the tree
66 Int_t nClusters = 0;
67 for (Int_t iModule = 0; iModule < fNModule; iModule++) {
68 array = clusters[iModule];
69 if (!array) {
70 Error("Digits2Clusters", "data for module %d missing!", iModule);
71 array = new TClonesArray("AliITSclusterV2");
72 }
73 cTree->SetBranchAddress("Clusters", &array);
74 cTree->Fill();
75 nClusters += array->GetEntriesFast();
76 delete array;
77 }
78
79 delete[] clusters;
80
81 Info("Digits2Clusters", "total number of found clusters in ITS: %d\n",
82 nClusters);
83}