]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSDigitMaker.cxx
completely re-worked TPC CA tracking code (Sergey/Ivan)
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSDigitMaker.cxx
CommitLineData
2374af72 1/**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
4 * *
5 * Primary Authors: Oystein Djuvsland *
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 * @file AliHLTPHOSClusterizer.cxx
17 * @author Oystein Djuvsland
18 * @date
19 * @brief Clusterizer for PHOS HLT
20 */
21
22
23// see header file for class documentation
24// or
25// refer to README to build package
26// or
27// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
209a4703 28
29#include "AliHLTPHOSDigitMaker.h"
30#include "AliHLTPHOSDigit.h"
31#include "AliHLTPHOSConstants.h"
32#include "AliHLTPHOSBaseline.h"
33#include "TTree.h"
34#include "TBranch.h"
35#include "TClonesArray.h"
36#include "TFile.h"
37
38#include "AliHLTPHOSValidCellDataStruct.h"
39#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
209a4703 40#include "AliHLTPHOSDigitDataStruct.h"
41#include "AliHLTPHOSDigitContainerDataStruct.h"
14ff16ed 42#include "AliHLTPHOSSharedMemoryInterface.h" // added by PTH
2374af72 43
44ClassImp(AliHLTPHOSDigitMaker);
209a4703 45
46using namespace PhosHLTConst;
47
48AliHLTPHOSDigitMaker::AliHLTPHOSDigitMaker() :
49 AliHLTPHOSBase(),
50 fCellDataPtr(0),
51 // fDigitContainerStructPtr(0),
52 fDigitArrayPtr(0),
53 fDigitPtr(0),
54 // fDigitStructPtr(0),
55 fDigitCount(0),
1804b020 56 fNrPresamples(10),
14ff16ed 57 fDigitThreshold(0),
58 fShmPtr(0)
209a4703 59{
14ff16ed 60 fShmPtr = new AliHLTPHOSSharedMemoryInterface();
2374af72 61 // See header file for documentation
209a4703 62}
63
64AliHLTPHOSDigitMaker::~AliHLTPHOSDigitMaker()
65{
2374af72 66 //See header file for documentation
209a4703 67}
68
14ff16ed 69
70/*
71 *modified by PTH to use new interface too shared memory
72 */
209a4703 73Int_t
74AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuData)
75{
2374af72 76 //See header file for documentation
209a4703 77 Int_t i = 0;
78 Int_t j = 0;
79 Int_t x = -1;
80 Int_t z = -1;
81 Float_t amplitude = 0;
14ff16ed 82
83 fShmPtr->SetMemory(rcuData);
84 // for ( i = 0; i < rcuData->fCnt; i++ )
85 // {
86 fCellDataPtr = fShmPtr->NextChannel();
87
88 while(fCellDataPtr != 0)
89 {
90
91 fCellDataPtr = & ( rcuData->fValidData[i] );
92 x = fCellDataPtr->fX + rcuData->fRcuX * N_XCOLUMNS_RCU;
93 z = fCellDataPtr->fZ + rcuData->fRcuZ * N_ZROWS_RCU;
94 amplitude = fCellDataPtr->fEnergy;
95
96 if ( amplitude > fDigitThreshold )
97 {
98 fDigitStructPtr = & ( fDigitContainerStructPtr->fDigitDataStruct[j + fDigitCount] );
99 fDigitStructPtr->fX = ( fCellDataPtr->fX + rcuData->fRcuX * N_XCOLUMNS_RCU );
100 fDigitStructPtr->fZ = ( fCellDataPtr->fZ + rcuData->fRcuZ * N_ZROWS_RCU );
101 fDigitStructPtr->fAmplitude = ( amplitude );
102 fDigitStructPtr->fTime = ( fCellDataPtr->fTime );
103 fDigitStructPtr->fGain = ( fCellDataPtr->fGain );
104 fDigitStructPtr->SetRawData ( fCellDataPtr->fData );
105 fDigitStructPtr->fCrazyness = ( fCellDataPtr->fCrazyness );
106 fDigitStructPtr->fBaseline = -1;
107 j++;
108 }
109
110 fCellDataPtr = fShmPtr->NextChannel();
111 }
112 // }
113 fDigitCount += j;
114 return fDigitCount;
115}
116
117
118/*
119Int_t
120AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuData)
121{
122
123 //See header file for documentation
124 Int_t i = 0;
125 Int_t j = 0;
126 Int_t x = -1;
127 Int_t z = -1;
128 Float_t amplitude = 0;
209a4703 129 for ( i = 0; i < rcuData->fCnt; i++ )
130 {
131 fCellDataPtr = & ( rcuData->fValidData[i] );
132 x = fCellDataPtr->fX + rcuData->fRcuX * N_XCOLUMNS_RCU;
133 z = fCellDataPtr->fZ + rcuData->fRcuZ * N_ZROWS_RCU;
134 amplitude = fCellDataPtr->fEnergy;
135 if ( amplitude > fDigitThreshold )
136 {
137 fDigitStructPtr = & ( fDigitContainerStructPtr->fDigitDataStruct[j + fDigitCount] );
138 fDigitStructPtr->fX = ( fCellDataPtr->fX + rcuData->fRcuX * N_XCOLUMNS_RCU );
139 fDigitStructPtr->fZ = ( fCellDataPtr->fZ + rcuData->fRcuZ * N_ZROWS_RCU );
140 fDigitStructPtr->fAmplitude = ( amplitude );
141 fDigitStructPtr->fTime = ( fCellDataPtr->fTime );
142 fDigitStructPtr->fGain = ( fCellDataPtr->fGain );
143 fDigitStructPtr->SetRawData ( fCellDataPtr->fData );
144 fDigitStructPtr->fCrazyness = ( fCellDataPtr->fCrazyness );
145 fDigitStructPtr->fBaseline = -1;
146 j++;
147 }
148 }
149 fDigitCount += j;
150 return fDigitCount;
151}
14ff16ed 152*/
153
209a4703 154/*
155Int_t
156AliHLTPHOSDigitMaker::SetDigitsTree(TTree *tree)
157{
158 TBranch * digBranch = tree->Branch("digits","TClonesArray",fDebugDigitArrayPtr);
159}
160*/
161
162void
163AliHLTPHOSDigitMaker::Reset()
164{
2374af72 165 //fDigitArrayPtr->Clear();
209a4703 166 fDigitCount = 0;
167}
168
169
170
171
172