5 /**************************************************************************
6 * This file is property of and copyright by the ALICE HLT Project *
7 * All rights reserved. *
9 * Primary Authors: Oystein Djuvsland *
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 **************************************************************************/
19 #ifndef ALIHLTPHOSDIGITMAKER_H
20 #define ALIHLTPHOSDIGITMAKER_H
23 * Class makes digits from information from raw data
25 * @file AliHLTPHOSDigitMaker.h
26 * @author Oystein Djuvsland
28 * @brief Digit maker for PHOS HLT
31 // see below for class documentation
33 // refer to README to build package
35 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
37 #include "AliHLTPHOSBase.h"
38 #include "AliHLTPHOSConstants.h"
39 #include "AliHLTPHOSDigitDataStruct.h"
40 #include "AliHLTPHOSChannelDataStruct.h"
43 * @class AliHLTPHOSDigitMaker
44 * Digit maker for PHOS HLT. Takes input from AliHLTPHOSRawAnalyzer, and
45 * outputs a block of AliHLTPHOSDigitDataStruct container
46 * @ingroup alihlt_phos
50 class AliHLTPHOSSharedMemoryInterfacev2; // added by PTH
51 class AliHLTPHOSChannelDataHeaderStruct;
52 class AliHLTPHOSMapper;
54 using namespace PhosHLTConst;
56 class AliHLTPHOSDigitMaker : public AliHLTPHOSBase
61 AliHLTPHOSDigitMaker();
64 virtual ~AliHLTPHOSDigitMaker();
66 /** Copy constructor */
67 AliHLTPHOSDigitMaker(const AliHLTPHOSDigitMaker &) :
75 //Copy constructor not implemented
79 AliHLTPHOSDigitMaker & operator = (const AliHLTPHOSDigitMaker)
86 * Sets the pointer to the output
87 * @param the output pointer
89 void SetDigitDataPtr(AliHLTPHOSDigitDataStruct *digitDataPtr)
90 { fDigitStructPtr = digitDataPtr; }
93 * Set the global high gain conversion factory
94 * @param factor is the conversion factor
96 void SetGlobalHighGainFactor(Float_t factor);
99 * Set the global low gain conversion factory
100 * @param factor is the conversion factor
102 void SetGlobalLowGainFactor(Float_t factor);
105 * Make the digits for one event.
106 * @param channelDataHeader is the data header from the AliHLTPHOSRawAnalyzer
107 * @return the number of digits found
109 Int_t MakeDigits(AliHLTPHOSChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize);
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
118 void SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut);
121 * Set ordering of gains or not
123 void SetOrdered(bool val) { fOrdered = val; }
125 void Reset() { fDigitCount = 0; }
131 * @param channelData is the channel data
132 * @param coordinates is the coordinates of the channel, including gain and module
134 void AddDigit(AliHLTPHOSChannelDataStruct* channelData, UShort_t* coordinates)
136 fDigitStructPtr->fX = coordinates[0];
137 fDigitStructPtr->fZ = coordinates[1];
138 if(coordinates[2] == HIGH_GAIN)
139 fDigitStructPtr->fAmplitude = channelData->fEnergy*fHighGainFactors[coordinates[0]][coordinates[1]];
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];
148 /** Pointer to shared memory interface */
149 AliHLTPHOSSharedMemoryInterfacev2* fShmPtr; //! transient
151 /** Pointer to the AliHLTPHOSDigitDataStruct */
152 AliHLTPHOSDigitDataStruct *fDigitStructPtr; //! transient
155 Int_t fDigitCount; //COMMENT
157 /** Are the gains ordered? */
158 bool fOrdered; //COMMENT
161 AliHLTPHOSMapper* fMapperPtr; //COMMENT
163 /** High gain energy conversion factors */
164 Float_t fHighGainFactors[N_XCOLUMNS_MOD][N_ZROWS_MOD]; //COMMENT
166 /** Low gain energy conversion factors */
167 Float_t fLowGainFactors[N_XCOLUMNS_MOD][N_ZROWS_MOD]; //COMMENT
169 /** Bad channel mask */
170 Float_t fBadChannelMask[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]; //COMMENT
172 ClassDef(AliHLTPHOSDigitMaker, 1);