3 /**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * for The ALICE HLT Project. *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
18 // @file AliHLTTRDCluster.cxx
19 // @author Theodor Rascanu
21 // @brief A datacontainer for clusters fitting component for the HLT.
24 #include "AliHLTTRDCluster.h"
30 //============================================================================
31 AliHLTTRDCluster::AliHLTTRDCluster():
43 //============================================================================
44 AliHLTTRDCluster::AliHLTTRDCluster(const AliTRDcluster* const inCluster):
46 fPadCol(inCluster->fPadCol),
47 fPadRow(inCluster->fPadRow),
48 fPadTime(inCluster->fPadTime),
52 fSignals = inCluster->fSignals[2];
53 fSignals|= inCluster->fSignals[3]<<10;
54 fSignals|= inCluster->fSignals[4]<<21;
56 fBits = UInt_t(inCluster->TestBits(-1)) >> 14;
60 * Copy data to the output TRDcluster
62 //============================================================================
63 void AliHLTTRDCluster::ExportTRDCluster(AliTRDcluster* const outCluster) const
65 outCluster->fPadCol=fPadCol;
66 outCluster->fPadRow=fPadRow;
67 outCluster->fPadTime=fPadTime;
69 outCluster->fSignals[2] = 0x3ff & fSignals;
70 outCluster->fSignals[3] = 0x7ff & fSignals>>10;
71 outCluster->fSignals[4] = 0x3ff & fSignals>>21;
73 for(int i=2; i<5; i++){
74 outCluster->fQ+=outCluster->fSignals[i];
77 outCluster->SetBit(UInt_t(fBits)<<14);
84 //============================================================================
85 AliHLTTRDExtCluster::AliHLTTRDExtCluster():
96 //============================================================================
97 AliHLTTRDExtCluster::AliHLTTRDExtCluster(const AliTRDcluster* const inCluster):
98 AliHLTTRDCluster(inCluster),
99 fX(inCluster->GetX()),
100 fY(inCluster->GetY()),
101 fZ(inCluster->GetZ())
107 * Copy data to the output TRDcluster
109 //============================================================================
110 void AliHLTTRDExtCluster::ExportTRDCluster(AliTRDcluster* const outCluster) const
112 AliHLTTRDCluster::ExportTRDCluster(outCluster);
113 outCluster->SetX(fX);
114 outCluster->SetY(fY);
115 outCluster->SetZ(fZ);
119 * Prints main info about cluster
121 //============================================================================
122 void AliHLTTRDExtCluster::Print() const
124 printf(" --hltCluster-- addr %p; sizeof(*this) %i\n", (void*)this, (int)sizeof(*this));
125 printf(" fX %f; fY %f; fZ %f\n",fX,fY,fZ);
129 * Save cluster at block position
131 //============================================================================
132 AliHLTUInt32_t AliHLTTRDCluster::SaveAt(AliHLTUInt8_t *const block, const AliTRDcluster* const inClust)
134 AliHLTUInt32_t size=0;
136 memcpy(block,inClust,sizeof(AliTRDcluster));
137 size+=sizeof(AliTRDcluster);
143 * Read cluster from block
145 //============================================================================
146 AliHLTUInt32_t AliHLTTRDCluster::LoadFrom(AliTRDcluster *const outClust, const AliHLTUInt8_t *const block)
148 AliHLTUInt32_t size=0;
150 memcpy(((AliHLTUInt8_t*)outClust)+sizeof(void*),block+sizeof(void*),sizeof(AliTRDcluster)-sizeof(void*));
151 size+=sizeof(AliTRDcluster);