]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSClusterFinder.cxx
Functions for bitio. Taken as is from The Data Compression Book
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinder.cxx
CommitLineData
b0f5e3fc 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
b0f5e3fc 16#include "AliITSClusterFinder.h"
b0f5e3fc 17#include "AliRun.h"
e8189707 18#include "AliITS.h"
b0f5e3fc 19
b0f5e3fc 20ClassImp(AliITSClusterFinder)
21
9de0700b 22//----------------------------------------------------------------------
23AliITSClusterFinder::AliITSClusterFinder(){
24 // default cluster finder
25
26 fSegmentation = 0;
27 fResponse = 0;
28 fMap = 0;
29 fDigits = 0;
30 fNdigits = 0;
31 fNRawClusters = 0;
32 fNperMax = 0;
33 fDeclusterFlag= 0;
34 fClusterSize = 0;
35 fNPeaks = 0;
36}
37//----------------------------------------------------------------------
38AliITSClusterFinder::AliITSClusterFinder(AliITSsegmentation *seg,
39 AliITSresponse *response,
40 TClonesArray *digits){
b0f5e3fc 41 // cluster finder
42 fSegmentation=seg;
43 fResponse=response;
44 fMap = 0;
45
46 fDigits=digits;
47 fNdigits = fDigits->GetEntriesFast();
48
49 fNRawClusters=0;
50
51 SetNperMax();
52 SetClusterSize();
53 SetDeclusterFlag();
54
55 fNPeaks=-1;
56}
9de0700b 57//----------------------------------------------------------------------
58AliITSClusterFinder::~AliITSClusterFinder(){
59 // destructor cluster finder
b0f5e3fc 60
9de0700b 61 // Zero local pointers. Other classes own these pointers.
55cd883f 62 fSegmentation = 0;
9de0700b 63 fResponse = 0;
64 fMap = 0;
65 fDigits = 0;
66 fNdigits = 0;
67 fNRawClusters = 0;
68 fNperMax = 0;
69 fDeclusterFlag= 0;
70 fClusterSize = 0;
71 fNPeaks = 0;
b0f5e3fc 72}
b0f5e3fc 73//__________________________________________________________________________
74AliITSClusterFinder::AliITSClusterFinder(const AliITSClusterFinder &source){
9de0700b 75 // Copy Constructor
76 if(&source == this) return;
77 this->fDigits = source.fDigits;
78 this->fNdigits = source.fNdigits;
79 this->fResponse = source.fResponse;
80 this->fSegmentation = source.fSegmentation;
81 this->fNRawClusters = source.fNRawClusters;
82 this->fMap = source.fMap;
83 this->fNperMax = source.fNperMax;
84 this->fDeclusterFlag = source.fDeclusterFlag;
85 this->fClusterSize = source.fClusterSize;
86 this->fNPeaks = source.fNPeaks;
87 return;
b0f5e3fc 88}
9de0700b 89//______________________________________________________________________
90AliITSClusterFinder& AliITSClusterFinder::operator=(const AliITSClusterFinder &source) {
91 // Assignment operator
92
93 if(&source == this) return *this;
94 this->fDigits = source.fDigits;
95 this->fNdigits = source.fNdigits;
96 this->fResponse = source.fResponse;
97 this->fSegmentation = source.fSegmentation;
98 this->fNRawClusters = source.fNRawClusters;
99 this->fMap = source.fMap;
100 this->fNperMax = source.fNperMax;
101 this->fDeclusterFlag = source.fDeclusterFlag;
102 this->fClusterSize = source.fClusterSize;
103 this->fNPeaks = source.fNPeaks;
104 return *this;
b0f5e3fc 105}
9de0700b 106//----------------------------------------------------------------------
107void AliITSClusterFinder::AddCluster(Int_t branch, AliITSRawCluster *c){
108 // Add a raw cluster copy to the list
b0f5e3fc 109
b0f5e3fc 110 AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
111 iTS->AddCluster(branch,c);
112 fNRawClusters++;
9355b256 113}
9de0700b 114//----------------------------------------------------------------------
115void AliITSClusterFinder::AddCluster(Int_t branch, AliITSRawCluster *c,
116 AliITSRecPoint &rp){
117 // Add a raw cluster copy to the list
9355b256 118
9355b256 119 AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
120 iTS->AddCluster(branch,c);
121 fNRawClusters++;
122 iTS->AddRecPoint(rp);
b0f5e3fc 123}