Line data Source code
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 : // //
18 : // HLT TRD cluster finder //
19 : // //
20 : ///////////////////////////////////////////////////////////////////////////////
21 :
22 : #include "AliHLTTRDClusterizer.h"
23 : #include "AliHLTTRDCluster.h"
24 : #include "AliTRDgeometry.h"
25 : #include "AliTRDcluster.h"
26 : #include "AliTRDReconstructor.h"
27 : #include <TClonesArray.h>
28 :
29 6 : ClassImp(AliHLTTRDClusterizer)
30 :
31 : //_____________________________________________________________________________
32 : AliHLTTRDClusterizer::AliHLTTRDClusterizer(const AliTRDReconstructor *const rec)
33 0 : :AliTRDclusterizer(rec)
34 0 : ,fClMemBlock(NULL)
35 0 : ,fTrMemBlock(NULL)
36 0 : ,fTrMemCurrPtr(NULL)
37 0 : ,fLastDet(-1)
38 0 : ,fClusters(NULL)
39 0 : ,fAddedSize(0)
40 0 : {
41 : //
42 : // AliHLTTRDClusterizer default constructor
43 : //
44 0 : }
45 :
46 : //_____________________________________________________________________________
47 : AliHLTTRDClusterizer::AliHLTTRDClusterizer(const Text_t *const name, const Text_t *const title, const AliTRDReconstructor *const rec)
48 0 : : AliTRDclusterizer(name,title,rec)
49 0 : ,fClMemBlock(NULL)
50 0 : ,fTrMemBlock(NULL)
51 0 : ,fTrMemCurrPtr(NULL)
52 0 : ,fLastDet(-1)
53 0 : ,fClusters(NULL)
54 0 : ,fAddedSize(0)
55 0 : {
56 : //
57 : // AliHLTTRDClusterizer constructor
58 : //
59 0 : }
60 :
61 : //_____________________________________________________________________________
62 : AliHLTTRDClusterizer::AliHLTTRDClusterizer(const AliHLTTRDClusterizer& c)
63 0 : : AliTRDclusterizer(c)
64 0 : ,fClMemBlock(NULL)
65 0 : ,fTrMemBlock(NULL)
66 0 : ,fTrMemCurrPtr(NULL)
67 0 : ,fLastDet(-1)
68 0 : ,fClusters(NULL)
69 0 : ,fAddedSize(0)
70 0 : {
71 : //
72 : // AliHLTTRDClusterizer copy constructor
73 : //
74 0 : }
75 :
76 : //_____________________________________________________________________________
77 : AliHLTTRDClusterizer& AliHLTTRDClusterizer::operator=(const AliHLTTRDClusterizer& c)
78 : {
79 : //
80 : // Assignment operator
81 : //
82 :
83 0 : if(this!=&c)
84 0 : c.Copy(*this);
85 0 : return *this;
86 : }
87 :
88 : //_____________________________________________________________________________
89 : void AliHLTTRDClusterizer::Copy(TObject& c) const
90 : {
91 : //
92 : // Copy function
93 : //
94 :
95 0 : ((AliHLTTRDClusterizer&)c).fClMemBlock = NULL;
96 0 : ((AliHLTTRDClusterizer&)c).fTrMemBlock = NULL;
97 0 : ((AliHLTTRDClusterizer&)c).fTrMemCurrPtr = NULL;
98 0 : }
99 :
100 : //_____________________________________________________________________________
101 : void AliHLTTRDClusterizer::AddClusterToArray(AliTRDcluster* cluster)
102 : {
103 : //
104 : // Add a cluster to the array
105 : //
106 :
107 0 : if(fLastDet!=cluster->GetDetector()){
108 0 : fLastDet = cluster->GetDetector();
109 0 : fClusters = new(GetClMemBlock()+fAddedSize) AliHLTTRDClustersArray(fLastDet);
110 0 : fAddedSize += sizeof(AliHLTTRDClustersArray);
111 0 : }
112 0 : new(&fClusters->fCluster[fClusters->fCount]) AliHLTTRDClustersArray::cluster_type(cluster);
113 0 : fClusters->fCount++;
114 0 : fAddedSize += sizeof(AliHLTTRDClustersArray::cluster_type);
115 0 : }
116 :
117 : //_____________________________________________________________________________
118 : void AliHLTTRDClusterizer::AddTrackletsToArray()
119 : {
120 : //
121 : // Add the online tracklets of this chamber to the array
122 : //
123 :
124 : // memcpy(&(((UInt_t*)GetTrMemBlock())[fNoOfTracklets]),fTrackletContainer[0],256*sizeof(UInt_t));
125 : // memcpy(&(((UInt_t*)GetTrMemBlock())[fNoOfTracklets+256]),fTrackletContainer[1],256*sizeof(UInt_t));
126 :
127 : // fNoOfTracklets += 512;
128 :
129 : /*
130 : // this way of accessing tracklets is obsolete
131 : // and did not give any results since long time
132 : // removing it now to allow for removal of useless
133 : // legacy code in the clusterizer
134 : //
135 : // if tracklets are needed here, they should be taken
136 : // from TrackletsArray()
137 : //
138 : // jkl
139 :
140 : UInt_t* trackletword;
141 : AliHLTTRDTrackletWordArray* trklArr = new(fTrMemCurrPtr) AliHLTTRDTrackletWordArray(fDet);
142 : fTrMemCurrPtr += sizeof(AliHLTTRDTrackletWordArray);
143 : for(Int_t side=0; side<2; side++)
144 : {
145 : Int_t trkl=0;
146 : trackletword=fTrackletContainer[side];
147 : while(trackletword[trkl]>0){
148 : trkl++;
149 : }
150 : memcpy(fTrMemCurrPtr,fTrackletContainer[side],trkl*sizeof(UInt_t));
151 : fTrMemCurrPtr += trkl*sizeof(UInt_t);
152 : trklArr->fCount += trkl;
153 : }
154 : */
155 :
156 : // fTrackletContainer[0]+=256;
157 : // fTrackletContainer[1]+=256;
158 : // fNoOfTracklets += 512;
159 :
160 0 : }
|