]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSDigitMaker.h
Update of the QA reference histogram, we use the data from Run 87055
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSDigitMaker.h
CommitLineData
1b41ab20 1//-*- Mode: C++ -*-
2// $Id$
3
209a4703 4
ab38011b 5/**************************************************************************
6 * This file is property of and copyright by the ALICE HLT Project *
7 * All rights reserved. *
8 * *
9 * Primary Authors: Oystein Djuvsland *
10 * *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
209a4703 19#ifndef ALIHLTPHOSDIGITMAKER_H
20#define ALIHLTPHOSDIGITMAKER_H
21
2374af72 22/**
23 * Class makes digits from information from raw data
24 *
25 * @file AliHLTPHOSDigitMaker.h
26 * @author Oystein Djuvsland
27 * @date
28 * @brief Digit maker for PHOS HLT
29 */
30
31// see below for class documentation
32// or
33// refer to README to build package
34// or
35// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
36
227e2399 37//#include "AliHLTPHOSBase.h"
209a4703 38#include "AliHLTPHOSConstants.h"
e304ea31 39#include "AliHLTPHOSDigitDataStruct.h"
40#include "AliHLTPHOSChannelDataStruct.h"
227e2399 41#include "AliHLTDataTypes.h"
209a4703 42
2374af72 43/**
44 * @class AliHLTPHOSDigitMaker
45 * Digit maker for PHOS HLT. Takes input from AliHLTPHOSRawAnalyzer, and
e304ea31 46 * outputs a block of AliHLTPHOSDigitDataStruct container
2374af72 47 * @ingroup alihlt_phos
48 */
209a4703 49
7ce40e5c 50class TH2F;
94594220 51class AliHLTPHOSSharedMemoryInterfacev2; // added by PTH
52class AliHLTPHOSChannelDataHeaderStruct;
e304ea31 53class AliHLTPHOSMapper;
209a4703 54
55using namespace PhosHLTConst;
56
227e2399 57//class AliHLTPHOSDigitMaker : public AliHLTPHOSBase
58class AliHLTPHOSDigitMaker
209a4703 59{
60public:
2374af72 61
62 /** Constructor */
209a4703 63 AliHLTPHOSDigitMaker();
2374af72 64
65 /** Destructor */
ab38011b 66 virtual ~AliHLTPHOSDigitMaker();
25b7f84c 67
68 /** Copy constructor */
69 AliHLTPHOSDigitMaker(const AliHLTPHOSDigitMaker &) :
227e2399 70 // AliHLTPHOSBase(),
7ce40e5c 71 fShmPtr(0),
25b7f84c 72 fDigitStructPtr(0),
94594220 73 fDigitCount(0),
e304ea31 74 fOrdered(true),
75 fMapperPtr(0)
25b7f84c 76 {
77 //Copy constructor not implemented
78 }
79
80 /** Assignment */
81 AliHLTPHOSDigitMaker & operator = (const AliHLTPHOSDigitMaker)
82 {
83 //Assignment
84 return *this;
85 }
86
2374af72 87 /**
e304ea31 88 * Sets the pointer to the output
89 * @param the output pointer
2374af72 90 */
e304ea31 91 void SetDigitDataPtr(AliHLTPHOSDigitDataStruct *digitDataPtr)
92 { fDigitStructPtr = digitDataPtr; }
d949e02e 93
94 /**
95 * Set the global high gain conversion factory
96 * @param factor is the conversion factor
97 */
98 void SetGlobalHighGainFactor(Float_t factor);
99
100 /**
101 * Set the global low gain conversion factory
102 * @param factor is the conversion factor
103 */
104 void SetGlobalLowGainFactor(Float_t factor);
2374af72 105
106 /**
107 * Make the digits for one event.
94594220 108 * @param channelDataHeader is the data header from the AliHLTPHOSRawAnalyzer
2374af72 109 * @return the number of digits found
110 */
e304ea31 111 Int_t MakeDigits(AliHLTPHOSChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize);
112
2374af72 113
7ce40e5c 114 /**
115 * Set the mask for dead channels
116 * @param badChannelHGHist is a pointer to a high gain bad channel histogram
117 * @param badChannelLGHist is a pointer to a low gain bad channel histogram
118 * @param qCut is the cut
119 */
120 void SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut);
121
94594220 122 /**
123 * Set ordering of gains or not
124 */
125 void SetOrdered(bool val) { fOrdered = val; }
e304ea31 126
127 void Reset() { fDigitCount = 0; }
209a4703 128
129private:
130
e304ea31 131 /**
132 * Add a new digit
133 * @param channelData is the channel data
134 * @param coordinates is the coordinates of the channel, including gain and module
135 */
87434909 136 void AddDigit(AliHLTPHOSChannelDataStruct* channelData, UShort_t* channelCoordinates, Float_t* localCoordinates)
e304ea31 137 {
227e2399 138 fDigitStructPtr->fX = localCoordinates[0];
139 fDigitStructPtr->fZ = localCoordinates[1];
87434909 140 if(channelCoordinates[2] == HIGHGAIN)
141 {
142 fDigitStructPtr->fEnergy = channelData->fEnergy*fHighGainFactors[channelCoordinates[0]][channelCoordinates[1]];
947064ec 143 // printf("HG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f \n", channelCoordinates[0], channelCoordinates[1], channelData->fEnergy, fDigitStructPtr->fEnergy);
87434909 144 }
e304ea31 145 else
87434909 146 {
147 fDigitStructPtr->fEnergy = channelData->fEnergy*fLowGainFactors[channelCoordinates[0]][channelCoordinates[1]];
947064ec 148 // printf("LG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f\n", channelCoordinates[0], channelCoordinates[1], channelData->fEnergy, fDigitStructPtr->fEnergy);
87434909 149 }
150 fDigitStructPtr->fTime = channelData->fTime * 0.0000001; //TODO
e304ea31 151 fDigitStructPtr->fCrazyness = channelData->fCrazyness;
87434909 152 fDigitStructPtr->fModule = channelCoordinates[3];
e304ea31 153 fDigitStructPtr++;
154 }
2374af72 155
7ce40e5c 156 /** Pointer to shared memory interface */
94594220 157 AliHLTPHOSSharedMemoryInterfacev2* fShmPtr; //! transient
7ce40e5c 158
e304ea31 159 /** Pointer to the AliHLTPHOSDigitDataStruct */
2374af72 160 AliHLTPHOSDigitDataStruct *fDigitStructPtr; //! transient
161
162 /** Digit count */
d949e02e 163 Int_t fDigitCount; //COMMENT
164
e304ea31 165 /** Are the gains ordered? */
94594220 166 bool fOrdered; //COMMENT
167
e304ea31 168 /** Mapper */
169 AliHLTPHOSMapper* fMapperPtr; //COMMENT
7ce40e5c 170
d949e02e 171 /** High gain energy conversion factors */
27029341 172 Float_t fHighGainFactors[NXCOLUMNSMOD][NZROWSMOD]; //COMMENT
d949e02e 173
174 /** Low gain energy conversion factors */
27029341 175 Float_t fLowGainFactors[NXCOLUMNSMOD][NZROWSMOD]; //COMMENT
2374af72 176
7ce40e5c 177 /** Bad channel mask */
27029341 178 Float_t fBadChannelMask[NXCOLUMNSMOD][NZROWSMOD][NGAINS]; //COMMENT
7ce40e5c 179
87434909 180
181 ClassDef(AliHLTPHOSDigitMaker, 0);
e304ea31 182
209a4703 183};
184
185
186#endif
187