code cleanup: remove unused data in HLTTRDTracklet (clusters indexes) (Theo)
[u/mrichter/AliRoot.git] / HLT / TRD / AliHLTTRDTracklet.cxx
CommitLineData
d679dd6c 1#include "AliHLTTRDTracklet.h"
d679dd6c 2/**
3 * Default Constructor
4 */
5//============================================================================
6AliHLTTRDTracklet::AliHLTTRDTracklet():
93ce7d1b 7 fN(0),
93ce7d1b 8 fdX(-1),
9 fS2Y(-1),
e44c0591 10 fPt(-1),
d679dd6c 11 fX0(-1),
d679dd6c 12 fC(-1),
d679dd6c 13 fChi2(-1),
9630a0b8 14 fDet(-1),
15 fCount(0),
93ce7d1b 16#if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC)
d55e8c51 17 fSize(sizeof(AliHLTTRDTracklet)-sizeof(AliHLTTRDCluster)),
93ce7d1b 18#else
9630a0b8 19 fSize(sizeof(AliHLTTRDTracklet))
93ce7d1b 20#endif
d679dd6c 21{
22 InitArrays();
d679dd6c 23}
24
25/**
93ce7d1b 26 * Main Constructor
d679dd6c 27 */
28//============================================================================
93ce7d1b 29AliHLTTRDTracklet::AliHLTTRDTracklet(const AliTRDseedV1* const inTracklet):
30 fN(inTracklet->fN),
93ce7d1b 31 fdX(inTracklet->fdX),
32 fS2Y(inTracklet->fS2Y),
33 fPt(inTracklet->fPt),
93ce7d1b 34 fX0(inTracklet->fX0),
35 fC(inTracklet->fC),
36 fChi2(inTracklet->fChi2),
9630a0b8 37 fDet(inTracklet->fDet),
38 fCount(0),
93ce7d1b 39#if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC)
d55e8c51 40 fSize(sizeof(AliHLTTRDTracklet)-sizeof(AliHLTTRDCluster)),
93ce7d1b 41#else
9630a0b8 42 fSize(sizeof(AliHLTTRDTracklet))
93ce7d1b 43#endif
d679dd6c 44{
93ce7d1b 45 CopyDataMembers(inTracklet);
d679dd6c 46}
47
48/**
49 * Copy simple (non-pointer) data members from TRDTracklet to HLTTRDTracklet
50 */
51//============================================================================
93ce7d1b 52void AliHLTTRDTracklet::CopyDataMembers(const AliTRDseedV1* const inTracklet)
d679dd6c 53{
93ce7d1b 54 //fChi2Z = inTracklet->GetChi2Z();
55
d679dd6c 56 for (Int_t i=0; i < 2; i++){
93ce7d1b 57 fYref[i] = inTracklet->fYref[i];
58 fZref[i] = inTracklet->fZref[i];
59 fYfit[i] = inTracklet->fYfit[i];
60 fZfit[i] = inTracklet->fZfit[i];
d679dd6c 61 }
9630a0b8 62
63 for (Int_t i=0; i < 3; i++){
64 fPad[i] = inTracklet->fPad[i];
65 }
d679dd6c 66
93ce7d1b 67 for (Int_t i=0; i < AliPID::kSPECIES; i++){
68 fProb[i] = inTracklet->fProb[i];
d679dd6c 69 }
70
93ce7d1b 71 for (Int_t iTimeBin = 0; iTimeBin < AliTRDseedV1::kNclusters; iTimeBin++)
72 {
73 AliTRDcluster* trdCluster = inTracklet->GetClusters(iTimeBin);
74 if (trdCluster){
d55e8c51 75 new (&fClusters[fCount]) AliHLTTRDCluster(trdCluster);
93ce7d1b 76 fCount++;
d55e8c51 77 fSize += sizeof(AliHLTTRDCluster);
93ce7d1b 78 }
79 }
d679dd6c 80
93ce7d1b 81 //if((void*)&fClusters[fCount].Index!=(void*)GetEndPointer()){printf("ERRR");return;}
d679dd6c 82}
83
84/**
85 * Copy data to the output TRDseedV1
86 */
87//============================================================================
93ce7d1b 88void AliHLTTRDTracklet::ExportTRDTracklet(AliTRDseedV1* const outTracklet) const
d679dd6c 89{
93ce7d1b 90 //outTracklet->Reset(); we always use a fresh trdtracklet as input, so this is useless
d8731936 91 outTracklet->SetBit(AliTRDseedV1::kOwner);
93ce7d1b 92
93 outTracklet->fN = fN;
94 outTracklet->fDet = fDet;
93ce7d1b 95 outTracklet->fdX = fdX;
96 outTracklet->fX0 = fX0;
97 outTracklet->fS2Y = fS2Y;
98 outTracklet->fPt = fPt;
99 outTracklet->fC = fC;
100 outTracklet->fChi2 = fChi2;
101
d679dd6c 102 for (Int_t i=0; i < 2; i++){
93ce7d1b 103 outTracklet->fYref[i] = fYref[i];
104 outTracklet->fZref[i] = fZref[i];
105 outTracklet->fYfit[i] = fYfit[i];
106 outTracklet->fZfit[i] = fZfit[i];
d679dd6c 107 }
d679dd6c 108
9630a0b8 109 for (Int_t i=0; i < 3; i++){
110 outTracklet->fPad[i] = fPad[i];
111 }
112
93ce7d1b 113 for (Int_t i=0; i < AliPID::kSPECIES; i++){
114 outTracklet->fProb[i] = fProb[i];
d679dd6c 115 }
e3cf3d02 116
93ce7d1b 117 for (UInt_t iCluster=0; iCluster < fCount; iCluster++){
118 AliTRDcluster *trdCluster = new AliTRDcluster();
d55e8c51 119 fClusters[iCluster].ExportTRDCluster(trdCluster);
93ce7d1b 120 outTracklet->fClusters[iCluster] = trdCluster;
d55e8c51 121 outTracklet->fIndexes[iCluster] = iCluster;
d679dd6c 122 }
d679dd6c 123}
124
125
126/**
127 * Init arrays
128 */
129//============================================================================
130void AliHLTTRDTracklet::InitArrays()
131{
d679dd6c 132 for (Int_t i=0; i < 2; i++){
133 fYref[i] = -1;
134 fZref[i] = -1;
d679dd6c 135 fYfit[i] = -1;
136 fZfit[i] = -1;
d679dd6c 137 }
93ce7d1b 138 for (Int_t i=0; i < AliPID::kSPECIES; i++)
139 fProb[i]=0;
d679dd6c 140}
141
142/**
143 * Prints main info about tracklet
144 */
145//============================================================================
93ce7d1b 146void AliHLTTRDTracklet::Print(Bool_t printClusters) const
d679dd6c 147{
148 //printf("--hltTracklet-- addr 0x%p(%i); fSize %i\n", this, (int)this, fSize);
93ce7d1b 149 printf(" fDet %i; fPt %f; fdX %f fN %i\n", fDet, fPt, fdX, fN);
d679dd6c 150
e3cf3d02 151 if(!printClusters) return;
d55e8c51 152 for (UInt_t iCluster = 0; iCluster < fCount; iCluster++){
153 printf(" [%i] ",iCluster);
154 fClusters[iCluster].Print();
d679dd6c 155 }
d679dd6c 156}
157
158/**
159 * Read clusters to TRDtracklet from the memory
160 */
161//============================================================================
93ce7d1b 162// void AliHLTTRDTracklet::ReadClustersFromMemory(void *input)
163// {
164// AliHLTUInt8_t *iterPtr = (AliHLTUInt8_t*) input;
165// AliHLTTRDCluster* hltCluster = NULL;
d679dd6c 166
93ce7d1b 167// for (Int_t iCluster = 0; iCluster < AliTRDseedV1::kNclusters; iCluster++){
168// // if we had something in the fClusters[iCluster] before copying,
169// // then this entry in the array should not be empty. Fill it.
170// if (fClusters[iCluster]){
171// hltCluster = (AliHLTTRDCluster*) iterPtr;
172// fClusters[iCluster] = hltCluster;
173// iterPtr += hltCluster->GetSize();
174// //hltCluster->Print();
175// }
d679dd6c 176
93ce7d1b 177// }
178// }
d8731936 179