]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSDigitMaker.cxx
Coding conventions and removal of obsolete files
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSDigitMaker.cxx
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
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"
40 #include "AliHLTPHOSDigitDataStruct.h"
41 #include "AliHLTPHOSDigitContainerDataStruct.h"
42
43
44 ClassImp(AliHLTPHOSDigitMaker);
45
46 using namespace PhosHLTConst;
47
48 AliHLTPHOSDigitMaker::AliHLTPHOSDigitMaker() :
49   AliHLTPHOSBase(),
50   fCellDataPtr(0),
51   // fDigitContainerStructPtr(0),
52   fDigitArrayPtr(0),
53   fDigitPtr(0),
54   // fDigitStructPtr(0),
55   fDigitCount(0), 
56   fNrPresamples(10),
57   fDigitThreshold(0)
58 {
59   // See header file for documentation
60 }
61   
62 AliHLTPHOSDigitMaker::~AliHLTPHOSDigitMaker() 
63 {
64   //See header file for documentation
65 }
66
67 Int_t
68 AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuData)
69 {
70   //See header file for documentation
71   Int_t i = 0;
72   Int_t j = 0;
73   Int_t x = -1;
74   Int_t z = -1;
75   Float_t amplitude = 0;
76   for ( i = 0; i < rcuData->fCnt; i++ )
77   {
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 )
83       {
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;
93         j++;
94       }
95   }
96   fDigitCount += j;
97   return fDigitCount; 
98 }
99 /*
100 Int_t
101 AliHLTPHOSDigitMaker::SetDigitsTree(TTree *tree)
102 {
103   TBranch * digBranch = tree->Branch("digits","TClonesArray",fDebugDigitArrayPtr); 
104 }
105 */
106
107 void
108 AliHLTPHOSDigitMaker::Reset()
109
110   //fDigitArrayPtr->Clear();
111   fDigitCount = 0;
112 }
113
114   
115
116  
117