]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSDigitMaker.h
New production macros (Yves)
[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
209a4703 37#include "AliHLTPHOSBase.h"
38#include "AliHLTPHOSConstants.h"
e304ea31 39#include "AliHLTPHOSDigitDataStruct.h"
40#include "AliHLTPHOSChannelDataStruct.h"
209a4703 41
2374af72 42/**
43 * @class AliHLTPHOSDigitMaker
44 * Digit maker for PHOS HLT. Takes input from AliHLTPHOSRawAnalyzer, and
e304ea31 45 * outputs a block of AliHLTPHOSDigitDataStruct container
2374af72 46 * @ingroup alihlt_phos
47 */
209a4703 48
7ce40e5c 49class TH2F;
94594220 50class AliHLTPHOSSharedMemoryInterfacev2; // added by PTH
51class AliHLTPHOSChannelDataHeaderStruct;
e304ea31 52class AliHLTPHOSMapper;
209a4703 53
54using namespace PhosHLTConst;
55
56class AliHLTPHOSDigitMaker : public AliHLTPHOSBase
57{
58public:
2374af72 59
60 /** Constructor */
209a4703 61 AliHLTPHOSDigitMaker();
2374af72 62
63 /** Destructor */
ab38011b 64 virtual ~AliHLTPHOSDigitMaker();
25b7f84c 65
66 /** Copy constructor */
67 AliHLTPHOSDigitMaker(const AliHLTPHOSDigitMaker &) :
68 AliHLTPHOSBase(),
7ce40e5c 69 fShmPtr(0),
25b7f84c 70 fDigitStructPtr(0),
94594220 71 fDigitCount(0),
e304ea31 72 fOrdered(true),
73 fMapperPtr(0)
25b7f84c 74 {
75 //Copy constructor not implemented
76 }
77
78 /** Assignment */
79 AliHLTPHOSDigitMaker & operator = (const AliHLTPHOSDigitMaker)
80 {
81 //Assignment
82 return *this;
83 }
84
2374af72 85 /**
e304ea31 86 * Sets the pointer to the output
87 * @param the output pointer
2374af72 88 */
e304ea31 89 void SetDigitDataPtr(AliHLTPHOSDigitDataStruct *digitDataPtr)
90 { fDigitStructPtr = digitDataPtr; }
d949e02e 91
92 /**
93 * Set the global high gain conversion factory
94 * @param factor is the conversion factor
95 */
96 void SetGlobalHighGainFactor(Float_t factor);
97
98 /**
99 * Set the global low gain conversion factory
100 * @param factor is the conversion factor
101 */
102 void SetGlobalLowGainFactor(Float_t factor);
2374af72 103
104 /**
105 * Make the digits for one event.
94594220 106 * @param channelDataHeader is the data header from the AliHLTPHOSRawAnalyzer
2374af72 107 * @return the number of digits found
108 */
e304ea31 109 Int_t MakeDigits(AliHLTPHOSChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize);
110
2374af72 111
7ce40e5c 112 /**
113 * Set the mask for dead channels
114 * @param badChannelHGHist is a pointer to a high gain bad channel histogram
115 * @param badChannelLGHist is a pointer to a low gain bad channel histogram
116 * @param qCut is the cut
117 */
118 void SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut);
119
94594220 120 /**
121 * Set ordering of gains or not
122 */
123 void SetOrdered(bool val) { fOrdered = val; }
e304ea31 124
125 void Reset() { fDigitCount = 0; }
209a4703 126
127private:
128
e304ea31 129 /**
130 * Add a new digit
131 * @param channelData is the channel data
132 * @param coordinates is the coordinates of the channel, including gain and module
133 */
134 void AddDigit(AliHLTPHOSChannelDataStruct* channelData, UShort_t* coordinates)
135 {
136 fDigitStructPtr->fX = coordinates[0];
137 fDigitStructPtr->fZ = coordinates[1];
27029341 138 if(coordinates[2] == HIGHGAIN)
e304ea31 139 fDigitStructPtr->fAmplitude = channelData->fEnergy*fHighGainFactors[coordinates[0]][coordinates[1]];
140 else
141 fDigitStructPtr->fAmplitude = channelData->fEnergy*fLowGainFactors[coordinates[0]][coordinates[1]];
142 fDigitStructPtr->fTime = channelData->fTime * 0.0000001; //CRAP
143 fDigitStructPtr->fCrazyness = channelData->fCrazyness;
144 fDigitStructPtr->fModule = coordinates[3];
145 fDigitStructPtr++;
146 }
2374af72 147
7ce40e5c 148 /** Pointer to shared memory interface */
94594220 149 AliHLTPHOSSharedMemoryInterfacev2* fShmPtr; //! transient
7ce40e5c 150
e304ea31 151 /** Pointer to the AliHLTPHOSDigitDataStruct */
2374af72 152 AliHLTPHOSDigitDataStruct *fDigitStructPtr; //! transient
153
154 /** Digit count */
d949e02e 155 Int_t fDigitCount; //COMMENT
156
e304ea31 157 /** Are the gains ordered? */
94594220 158 bool fOrdered; //COMMENT
159
e304ea31 160 /** Mapper */
161 AliHLTPHOSMapper* fMapperPtr; //COMMENT
7ce40e5c 162
d949e02e 163 /** High gain energy conversion factors */
27029341 164 Float_t fHighGainFactors[NXCOLUMNSMOD][NZROWSMOD]; //COMMENT
d949e02e 165
166 /** Low gain energy conversion factors */
27029341 167 Float_t fLowGainFactors[NXCOLUMNSMOD][NZROWSMOD]; //COMMENT
2374af72 168
7ce40e5c 169 /** Bad channel mask */
27029341 170 Float_t fBadChannelMask[NXCOLUMNSMOD][NZROWSMOD][NGAINS]; //COMMENT
7ce40e5c 171
2374af72 172 ClassDef(AliHLTPHOSDigitMaker, 1);
e304ea31 173
209a4703 174};
175
176
177#endif
178