]>
Commit | Line | Data |
---|---|---|
1b41ab20 | 1 | // $Id$ |
2 | ||
6a76e30e | 3 | |
4 | #include "AliHLTPHOSRcuCalibrationProcessorComponent.h" | |
5 | #include "AliHLTPHOSRcuCellEnergyDataStruct.h" | |
6 | #include "AliHLTPHOSValidCellDataStruct.h" | |
7 | #include "AliHLTPHOSConstants.h" | |
8 | #include "AliHLTPHOSDefinitions.h" | |
9 | #include "AliHLTPHOSEmcCalibData.h" | |
10 | #include "AliHLTPHOSRcuCalibrationProcessor.h" | |
11 | #include "AliHLTPHOSSharedMemoryInterface.h" | |
12 | #include "TObjArray.h" | |
13 | ||
14 | using namespace std; | |
15 | ||
16 | AliHLTPHOSRcuCalibrationProcessorComponent gAliHLTPHOSRcuCalibrationProcessorComponent; | |
17 | ||
18 | AliHLTPHOSRcuCalibrationProcessorComponent::AliHLTPHOSRcuCalibrationProcessorComponent() : | |
19 | AliHLTCalibrationProcessor(), | |
25b7f84c | 20 | fCalibDataPtr(0), |
6a76e30e | 21 | fRcuCalibProcessorPtr(0), |
25b7f84c | 22 | fShmPtr(0) |
6a76e30e | 23 | { |
b444d727 | 24 | |
6a76e30e | 25 | } |
26 | ||
b444d727 | 27 | |
6a76e30e | 28 | AliHLTPHOSRcuCalibrationProcessorComponent::~AliHLTPHOSRcuCalibrationProcessorComponent() |
29 | { | |
b444d727 | 30 | |
6a76e30e | 31 | } |
32 | ||
b444d727 | 33 | |
34 | /* | |
25b7f84c | 35 | AliHLTPHOSRcuCalibrationProcessorComponent::AliHLTPHOSRcuCalibrationProcessorComponent(const AliHLTPHOSRcuCalibrationProcessorComponent&) : |
36 | AliHLTCalibrationProcessor(), | |
37 | fCalibDataPtr(0), | |
38 | fRcuCalibProcessorPtr(0), | |
39 | fShmPtr(0) | |
6a76e30e | 40 | { |
41 | HLTFatal("copy constructor untested"); | |
42 | } | |
b444d727 | 43 | */ |
6a76e30e | 44 | |
b444d727 | 45 | /* |
6a76e30e | 46 | AliHLTPHOSRcuCalibrationProcessorComponent& AliHLTPHOSRcuCalibrationProcessorComponent::operator=(const AliHLTPHOSRcuCalibrationProcessorComponent&) |
47 | { | |
48 | HLTFatal("assignement operator untested"); | |
49 | } | |
50 | ||
51 | const char* AliHLTPHOSRcuCalibrationProcessorComponent::GetComponentID() | |
52 | { | |
53 | return "PhosRcuCalibrationProcessor"; | |
54 | } | |
b444d727 | 55 | */ |
6a76e30e | 56 | |
57 | void AliHLTPHOSRcuCalibrationProcessorComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list) | |
58 | { | |
59 | list.clear(); | |
60 | list.push_back(AliHLTPHOSDefinitions::fgkCellEnergyDataType); | |
61 | /* | |
62 | list.push_back(AliHLTPHOSDefinitions::fgkCellEnergyHistogramDataType); | |
63 | list.push_back(AliHLTPHOSDefinitions::fgkCellAverageEnergyDataType); | |
64 | list.push_back(AliHLTPHOSDefinitions::fgkCellAccumulatedEnergyDataType); | |
65 | list.push_back(AliHLTPHOSDefinitions::fgkCellTimingHistogramDataType); | |
66 | list.push_back(AliHLTPHOSDefinitions::fgkCellTimingAverageDataType); | |
67 | */ | |
68 | } | |
69 | ||
8efbf5fe | 70 | |
6a76e30e | 71 | AliHLTComponentDataType AliHLTPHOSRcuCalibrationProcessorComponent::GetOutputDataType() |
72 | { | |
73 | return AliHLTPHOSDefinitions::fgkEmcCalibDataType; | |
74 | } | |
8efbf5fe | 75 | |
6a76e30e | 76 | |
77 | void AliHLTPHOSRcuCalibrationProcessorComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier) | |
78 | { | |
79 | constBase = 0; | |
80 | inputMultiplier = 2; | |
81 | } | |
82 | ||
8efbf5fe | 83 | |
84 | AliHLTComponent* | |
85 | AliHLTPHOSRcuCalibrationProcessorComponent::Spawn() | |
6a76e30e | 86 | { |
87 | return new AliHLTPHOSRcuCalibrationProcessorComponent(); | |
88 | } | |
89 | ||
90 | ||
8efbf5fe | 91 | const char* |
92 | AliHLTPHOSRcuCalibrationProcessorComponent::GetComponentID() | |
93 | { | |
94 | return "PhosCalibrationProcessor"; | |
95 | } | |
96 | ||
97 | ||
98 | Int_t | |
99 | AliHLTPHOSRcuCalibrationProcessorComponent::ScanArgument( Int_t argc, const char** argv) | |
6a76e30e | 100 | { |
b444d727 | 101 | const char **c = argv; |
102 | Int_t t= argc; | |
103 | c++; | |
104 | t++; | |
105 | ||
6a76e30e | 106 | return 0; |
107 | } | |
108 | ||
109 | Int_t AliHLTPHOSRcuCalibrationProcessorComponent::InitCalibration() | |
110 | { | |
111 | fCalibDataPtr = new TObjArray(); | |
112 | fRcuCalibProcessorPtr = new AliHLTPHOSRcuCalibrationProcessor(2, 0, 0); | |
113 | fShmPtr = new AliHLTPHOSSharedMemoryInterface(); | |
114 | return 0; | |
115 | } | |
116 | ||
117 | Int_t AliHLTPHOSRcuCalibrationProcessorComponent::DeinitCalibration() | |
118 | { | |
119 | return 0; | |
120 | } | |
121 | ||
122 | Int_t AliHLTPHOSRcuCalibrationProcessorComponent::ProcessCalibration(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData) | |
123 | { | |
b444d727 | 124 | const AliHLTComponentEventData eDta = evtData; |
125 | AliHLTComponentTriggerData tDta = trigData; | |
6a76e30e | 126 | |
127 | UInt_t specification = 0; | |
6a76e30e | 128 | const AliHLTComponentBlockData* iter = 0; |
6a76e30e | 129 | iter = GetFirstInputBlock( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC); |
6a76e30e | 130 | AliHLTPHOSRcuCellEnergyDataStruct* cellDataPtr = 0; |
6a76e30e | 131 | AliHLTPHOSValidCellDataStruct* currentChannel = 0; |
6a76e30e | 132 | int totalSamples = 1; |
133 | ||
134 | while(iter != 0) | |
135 | { | |
136 | specification = specification|iter->fSpecification; | |
137 | ||
138 | cellDataPtr = (AliHLTPHOSRcuCellEnergyDataStruct*)( iter->fPtr); | |
139 | fShmPtr->SetMemory(cellDataPtr); | |
140 | currentChannel = fShmPtr->NextChannel(); | |
141 | ||
7ce40e5c | 142 | Int_t* tmpDataPtr = 0; |
143 | Int_t nSamples = 0; | |
144 | ||
6a76e30e | 145 | while(currentChannel != 0) |
146 | { | |
7ce40e5c | 147 | tmpDataPtr = fShmPtr->GetRawData(nSamples); |
6a76e30e | 148 | fRcuCalibProcessorPtr->FillEnergy(currentChannel->fX, currentChannel->fZ, currentChannel->fGain, currentChannel->fEnergy); |
7ce40e5c | 149 | fRcuCalibProcessorPtr->FillLiveChannels(tmpDataPtr, totalSamples, currentChannel->fX, currentChannel->fZ,currentChannel->fGain); |
6a76e30e | 150 | currentChannel = fShmPtr->NextChannel(); |
151 | } | |
152 | ||
153 | iter = GetNextInputBlock(); | |
154 | } | |
155 | ||
156 | PushBack((TObject*) fCalibDataPtr, AliHLTPHOSDefinitions::fgkEmcCalibDataType, specification); | |
157 | ||
158 | return 0; | |
159 | } | |
160 | ||
161 | Int_t AliHLTPHOSRcuCalibrationProcessorComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ ) { | |
162 | // see header file for class documentation | |
163 | ||
164 | // ** PushBack data to FXS ... | |
165 | PushToFXS( (TObject*) fCalibDataPtr, "PHOS", "calibHistoHLT" ) ; | |
166 | ||
167 | return 0; | |
168 | } |