]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/ITS/AliHLTITSclusterer.cxx
Removing AliITSgeom dependencies from the old ITS clusterer V2 and the corresponding...
[u/mrichter/AliRoot.git] / HLT / ITS / AliHLTITSclusterer.cxx
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
25 #include "AliHLTITSclusterer.h"
26 #include "AliITSgeomTGeo.h"
27 #include "AliRawReader.h"
28 #include "AliITSRawStreamSPD.h"
29 #include "AliITSRawStreamSDD.h"
30 #include "AliITSRawStreamSSD.h"
31 #include <TTree.h>
32 #include <TClonesArray.h>
33
34 ClassImp(AliHLTITSclusterer)
35
36 AliHLTITSclusterer::AliHLTITSclusterer(const Char_t *geom):AliITSclustererV2(geom)
37 {
38 fNModule = AliITSgeomTGeo::GetNModules();
39 }
40
41 void AliHLTITSclusterer::Digits2Clusters(AliRawReader* rawReader,TTree *cTree)
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 }