1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
5 * Primary Authors: Oystein Djuvsland *
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 * @file AliHLTPHOSClusterizer.cxx
17 * @author Oystein Djuvsland
19 * @brief Clusterizer for PHOS HLT
23 // see header file for class documentation
25 // refer to README to build package
27 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
29 #include "AliHLTPHOSDigitMaker.h"
30 #include "AliHLTPHOSDigit.h"
31 #include "AliHLTPHOSConstants.h"
32 #include "AliHLTPHOSBaseline.h"
35 #include "TClonesArray.h"
38 #include "AliHLTPHOSValidCellDataStruct.h"
39 #include "AliHLTPHOSRcuCellEnergyDataStruct.h"
40 #include "AliHLTPHOSDigitDataStruct.h"
41 #include "AliHLTPHOSDigitContainerDataStruct.h"
44 ClassImp(AliHLTPHOSDigitMaker);
46 using namespace PhosHLTConst;
48 AliHLTPHOSDigitMaker::AliHLTPHOSDigitMaker() :
51 // fDigitContainerStructPtr(0),
54 // fDigitStructPtr(0),
59 // See header file for documentation
62 AliHLTPHOSDigitMaker::~AliHLTPHOSDigitMaker()
64 //See header file for documentation
68 AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuData)
70 //See header file for documentation
75 Float_t amplitude = 0;
76 for ( i = 0; i < rcuData->fCnt; i++ )
78 fCellDataPtr = & ( rcuData->fValidData[i] );
79 x = fCellDataPtr->fX + rcuData->fRcuX * N_XCOLUMNS_RCU;
80 z = fCellDataPtr->fZ + rcuData->fRcuZ * N_ZROWS_RCU;
81 amplitude = fCellDataPtr->fEnergy;
82 if ( amplitude > fDigitThreshold )
84 fDigitStructPtr = & ( fDigitContainerStructPtr->fDigitDataStruct[j + fDigitCount] );
85 fDigitStructPtr->fX = ( fCellDataPtr->fX + rcuData->fRcuX * N_XCOLUMNS_RCU );
86 fDigitStructPtr->fZ = ( fCellDataPtr->fZ + rcuData->fRcuZ * N_ZROWS_RCU );
87 fDigitStructPtr->fAmplitude = ( amplitude );
88 fDigitStructPtr->fTime = ( fCellDataPtr->fTime );
89 fDigitStructPtr->fGain = ( fCellDataPtr->fGain );
90 fDigitStructPtr->SetRawData ( fCellDataPtr->fData );
91 fDigitStructPtr->fCrazyness = ( fCellDataPtr->fCrazyness );
92 fDigitStructPtr->fBaseline = -1;
101 AliHLTPHOSDigitMaker::SetDigitsTree(TTree *tree)
103 TBranch * digBranch = tree->Branch("digits","TClonesArray",fDebugDigitArrayPtr);
108 AliHLTPHOSDigitMaker::Reset()
110 //fDigitArrayPtr->Clear();