1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // HLT TRD cluster finder //
20 ///////////////////////////////////////////////////////////////////////////////
22 #include "AliHLTTRDClusterizer.h"
23 #include "AliHLTTRDCluster.h"
24 #include "AliTRDgeometry.h"
25 #include "AliTRDcluster.h"
26 #include "AliTRDReconstructor.h"
27 #include <TClonesArray.h>
29 ClassImp(AliHLTTRDClusterizer)
31 //_____________________________________________________________________________
32 AliHLTTRDClusterizer::AliHLTTRDClusterizer(const AliTRDReconstructor *const rec)
33 :AliTRDclusterizer(rec)
42 // AliHLTTRDClusterizer default constructor
46 //_____________________________________________________________________________
47 AliHLTTRDClusterizer::AliHLTTRDClusterizer(const Text_t *const name, const Text_t *const title, const AliTRDReconstructor *const rec)
48 : AliTRDclusterizer(name,title,rec)
57 // AliHLTTRDClusterizer constructor
61 //_____________________________________________________________________________
62 AliHLTTRDClusterizer::AliHLTTRDClusterizer(const AliHLTTRDClusterizer& c)
63 : AliTRDclusterizer(c)
72 // AliHLTTRDClusterizer copy constructor
76 //_____________________________________________________________________________
77 AliHLTTRDClusterizer& AliHLTTRDClusterizer::operator=(const AliHLTTRDClusterizer& c)
80 // Assignment operator
88 //_____________________________________________________________________________
89 void AliHLTTRDClusterizer::Copy(TObject& c) const
95 ((AliHLTTRDClusterizer&)c).fClMemBlock = NULL;
96 ((AliHLTTRDClusterizer&)c).fTrMemBlock = NULL;
97 ((AliHLTTRDClusterizer&)c).fTrMemCurrPtr = NULL;
100 //_____________________________________________________________________________
101 void AliHLTTRDClusterizer::AddClusterToArray(AliTRDcluster* cluster)
104 // Add a cluster to the array
107 if(fLastDet!=cluster->GetDetector()){
108 fLastDet = cluster->GetDetector();
109 fClusters = new(GetClMemBlock()+fAddedSize) AliHLTTRDClustersArray(fLastDet);
110 fAddedSize += sizeof(AliHLTTRDClustersArray);
112 new(&fClusters->fCluster[fClusters->fCount]) AliHLTTRDClustersArray::cluster_type(cluster);
114 fAddedSize += sizeof(AliHLTTRDClustersArray::cluster_type);
117 //_____________________________________________________________________________
118 void AliHLTTRDClusterizer::AddTrackletsToArray()
121 // Add the online tracklets of this chamber to the array
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));
127 // fNoOfTracklets += 512;
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
135 // if tracklets are needed here, they should be taken
136 // from TrackletsArray()
140 UInt_t* trackletword;
141 AliHLTTRDTrackletWordArray* trklArr = new(fTrMemCurrPtr) AliHLTTRDTrackletWordArray(fDet);
142 fTrMemCurrPtr += sizeof(AliHLTTRDTrackletWordArray);
143 for(Int_t side=0; side<2; side++)
146 trackletword=fTrackletContainer[side];
147 while(trackletword[trkl]>0){
150 memcpy(fTrMemCurrPtr,fTrackletContainer[side],trkl*sizeof(UInt_t));
151 fTrMemCurrPtr += trkl*sizeof(UInt_t);
152 trklArr->fCount += trkl;
156 // fTrackletContainer[0]+=256;
157 // fTrackletContainer[1]+=256;
158 // fNoOfTracklets += 512;