]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSRawClusterSPD.cxx
Restoring backward compatibility of the SSD calibration objects + output of the SSD...
[u/mrichter/AliRoot.git] / ITS / AliITSRawClusterSPD.cxx
CommitLineData
41b19549 1/**************************************************************************
2 * Copyright(c) 2000-2004, 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#include <Riostream.h>
16
17#include "AliITSRawClusterSPD.h"
18
19////////////////////////////////////////////////////
20// Cluster classes for set:ITS //
21// Raw Clusters for SPD //
22// //
23////////////////////////////////////////////////////
24
25ClassImp(AliITSRawClusterSPD)
26
27//______________________________________________________________________
a8d73343 28AliITSRawClusterSPD::AliITSRawClusterSPD():
29fX(0.0),
30fZ(0.0),
31fQ(0.0),
32fNClZ(0),
33fNClX(0),
34fXStart(0),
35fXStop(0),
36fZStart(0.0),
37fZStop(0.0),
38fZend(0),
39fNTracks(0),
40fModule(0)
41{
41b19549 42 // Default constructor
a8d73343 43 fTracks[0]=fTracks[1]=fTracks[2]=-3;
41b19549 44}
45
46//______________________________________________________________________
47AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx,
48 Float_t Charge,Int_t ClusterSizeZ,
49 Int_t ClusterSizeX,Int_t xstart,
50 Int_t xstop,
51 Float_t zstart,Float_t zstop,
a8d73343 52 Int_t zend,Int_t module):
53fX(clx),
54fZ(clz),
55fQ(Charge),
56fNClZ(ClusterSizeZ),
57fNClX(ClusterSizeX),
58fXStart(xstart),
59fXStop(xstop),
60fZStart(zstart),
61fZStop(zstop),
62fZend(zend),
63fNTracks(0),
64fModule(module) {
41b19549 65 // constructor
66
41b19549 67}
68//______________________________________________________________________
69void AliITSRawClusterSPD::Add(AliITSRawClusterSPD* clJ) {
70 // Recolculate the new center of gravity coordinate and cluster sizes
71 // in both directions after grouping of clusters
72
73 if(this->fZStop < clJ->ZStop()) this->fZStop = clJ->ZStop();
74 this->fZ = this->fZ + clJ->Z();
75 this->fX = (this->fX + clJ->X())/2.;
76 this->fQ = this->fQ + clJ->Q();
77 this->fXStart = clJ->XStart(); // for a comparison with the next
78 this->fXStop = clJ->XStop(); // z column
79 if(this->fZend < clJ->Zend()) this->fZend = clJ->Zend();
80 this->fNClX = this->fXStop - this->fXStart + 1;
81 (this->fNClZ)++;
82
83 return;
84}
85//______________________________________________________________________
86Bool_t AliITSRawClusterSPD::Brother(AliITSRawClusterSPD* cluster,
87 Float_t dz,Float_t dx) const {
88 // fXStart, fXstop and fZend information is used now instead of dz and dx
89 // to check an absent (or a present) of the gap between two pixels in
90 // both x and z directions. The increasing order of fZend is used.
91 Bool_t brother = kFALSE;
92 Bool_t test2 = kFALSE;
93 Bool_t test3 = kFALSE;
94
95 dx = dz = 0; // to remove unused variable warning.
96 // Diagonal clusters are included:
97 if(fXStop >= (cluster->XStart() -1) &&
98 fXStart <= (cluster->XStop()+1)) test2 = kTRUE;
99
100 // Diagonal clusters are excluded:
101 // if(fXStop >= cluster->XStart() &&
102 // fXStart <= cluster->XStop()) test2 = kTRUE;
103 if(cluster->Zend() == (fZend + 1)) test3 = kTRUE;
104 if(test2 && test3) {
105 // cout<<"test 2,3 0k, brother = true "<<endl;
106 return brother = kTRUE;
107 } // end if
108 return brother;
109}
110//______________________________________________________________________
111void AliITSRawClusterSPD::PrintInfo() const{
112 // print
113
114 cout << ", Z: " << fZ << ", X: " << fX << ", Charge: " << fQ<<endl;
115 cout << " Z cluster size: " << fNClZ <<", X cluster size "<< fNClX <<endl;
116 cout <<" XStart, XStop,Zend, Module ="<<fXStart<<","
117 <<fXStop<<","<<fZend << "," << fModule<<endl;
118}
119
120//______________________________________________________________________
121void AliITSRawClusterSPD::SetTracks(Int_t track0, Int_t track1, Int_t track2) {
122 // set tracks in cluster (no more than three ones)
123 fTracks[0]=track0;
124 fTracks[1]=track1;
125 fTracks[2]=track2;
126}