93 #include "StFtpcParamReader.hh"
94 #include "PhysicalConstants.h"
95 #include "SystemOfUnits.h"
98 #include "StMessMgr.h"
101 StFtpcParamReader::StFtpcParamReader(St_ftpcClusterPars *det,
102 St_ftpcFastSimGas *gaspar,
103 St_ftpcFastSimPars *param)
106 mStandardPressure = atmosphere/(100*pascal);
109 returnCode += FtpcClusterPars(det);
110 returnCode += FtpcFastSimGas(gaspar);
111 returnCode += FtpcFastSimPars(param);
114 mNumberOfFssGasValues = 0;
115 mFssGasEField =
new Float_t[1];
116 mFssGasVDrift =
new Float_t[1];
117 mFssGasDiffusionX =
new Float_t[1];
118 mFssGasDiffusionY =
new Float_t[1];
119 mFssGasDiffusionZ =
new Float_t[1];
120 mFssGasLorentzAngle =
new Float_t[1];
122 LOG_DEBUG <<
"StFtpcParamReader constructed from StFtpcClusterMaker tables" << endm;
126 StFtpcParamReader::StFtpcParamReader(St_ftpcClusterPars *det,
127 St_ftpcSlowSimGas *gas,
128 St_ftpcSlowSimPars *param)
131 mStandardPressure = atmosphere/(100*pascal);
134 returnCode += FtpcClusterPars(det);
135 returnCode += FtpcSlowSimGas(gas);
136 returnCode += FtpcSlowSimPars(param);
138 LOG_DEBUG <<
"StFtpcParamReader constructed from StFtpcSlowSimMaker tables" << endm;
142 StFtpcParamReader::StFtpcParamReader(St_ftpcClusterPars *det)
146 returnCode += FtpcClusterPars(det);
149 mNumberOfFssGasValues = 0;
150 mFssGasEField =
new Float_t[1];
151 mFssGasVDrift =
new Float_t[1];
152 mFssGasDiffusionX =
new Float_t[1];
153 mFssGasDiffusionY =
new Float_t[1];
154 mFssGasDiffusionZ =
new Float_t[1];
155 mFssGasLorentzAngle =
new Float_t[1];
159 StFtpcParamReader::~StFtpcParamReader()
163 mClusterParsTable->normalizedNowPressure = mNormalizedNowPressure;
164 mClusterParsTable->adjustedAirPressureWest = mAdjustedAirPressureWest;
165 mClusterParsTable->adjustedAirPressureEast = mAdjustedAirPressureEast;
166 mClusterParsTable->gasTemperatureWest = mGasTemperatureWest;
167 mClusterParsTable->gasTemperatureEast = mGasTemperatureEast;
170 delete[] mFssGasEField;
171 delete[] mFssGasVDrift;
172 delete[] mFssGasDiffusionX;
173 delete[] mFssGasDiffusionY;
174 delete[] mFssGasDiffusionZ;
175 delete[] mFssGasLorentzAngle;
177 LOG_DEBUG <<
"StFtpcParamReader destructed" << endm;
182 Int_t StFtpcParamReader::FtpcClusterPars(St_ftpcClusterPars *det)
186 ftpcClusterPars_st *detTable = det->GetTable();
188 mClusterParsTable = detTable;
189 mGaussFittingFlags = detTable->gaussFittingFlags;
190 mMinimumClusterMaxADC = detTable->minimumClusterMaxADC;
191 mNumberOfDriftSteps = detTable->numberOfDriftSteps;
192 mOrderOfDiffusionErrors = detTable->orderOfDiffusionErrors;
193 mPadDiffusionErrors = (Float_t *) detTable->padDiffusionErrors;
194 mTimeDiffusionErrors = (Float_t *) detTable->timeDiffusionErrors;
195 mLorentzAngleFactor = detTable->lorentzAngleFactor;
196 mPadBadFitError = detTable->padBadFitError;
197 mTimeBadFitError = detTable->timeBadFitError;
198 mPadUnfoldError = detTable->padUnfoldError;
199 mTimeUnfoldError = detTable->timeUnfoldError;
200 mPadFailedFitError = detTable->padFailedFitError;
201 mTimeFailedFitError = detTable->timeFailedFitError;
202 mPadCutoffClusterError = detTable->padCutoffClusterError;
203 mTimeCutoffClusterError = detTable->timeCutoffClusterError;
204 mPadSaturatedClusterError = detTable->padSaturatedClusterError;
205 mTimeSaturatedClusterError = detTable->timeSaturatedClusterError;
206 m2PadWeightedError = detTable->twoPadWeightedError;
207 m2PadGaussError = detTable->twoPadGaussError;
208 m3PadWeightedError = detTable->threePadWeightedError;
209 m3PadGaussError = detTable->threePadGaussError;
210 mZDirectionError = detTable->zDirectionError;
211 mNormalizedNowPressure = detTable->normalizedNowPressure;
212 mAdjustedAirPressureWest = detTable->adjustedAirPressureWest;
213 mAdjustedAirPressureEast = detTable->adjustedAirPressureEast;
214 mGasTemperatureWest = detTable->gasTemperatureWest;
215 mGasTemperatureEast = detTable->gasTemperatureEast;
216 mMaxNumSequences = detTable->maxNumSequences ;
217 mMaxNumSeqPeaks = detTable->maxNumSeqPeaks;
218 mMaxNumPeaks = detTable->maxNumPeaks;
219 mMaxNumCUC = detTable->maxNumCUC;
220 mMaxLoops = detTable->maxLoops;
221 mMaxFastLoops = detTable->maxFastLoops;
222 mUnfoldLimit = detTable->unfoldLimit;
223 mUnfoldFailedLimit = detTable->unfoldFailedLimit;
226 LOG_ERROR <<
"No data in table class St_ftpcClusterPars" << endm;
233 Int_t StFtpcParamReader::FtpcFastSimGas(St_ftpcFastSimGas *gaspar)
236 ftpcFastSimGas_st *gasTable = gaspar->GetTable();
238 mOrderOfFastEstimates = gasTable->orderOfFastEstimates;
239 mVDriftEstimates = (Float_t *) &(gaspar->GetTable()->driftVelocityEstimates);
240 mTDriftEstimates = (Float_t *) &(gaspar->GetTable()->driftTimeEstimates);
241 mSigmaRadialEstimates = (Float_t *) &(gaspar->GetTable()->sigmaRadialEstimates);
242 mSigmaAzimuthalEstimates = (Float_t *) &(gaspar->GetTable()->sigmaAzimuthalEstimates);
243 mErrorRadialEstimates = (Float_t *) &(gaspar->GetTable()->errorRadialEstimates);
244 mErrorAzimuthalEstimates = (Float_t *) &(gaspar->GetTable()->errorAzimuthalEstimates);
247 LOG_ERROR <<
"No data in table class St_ftpcFastSimGas" << endm;
254 Int_t StFtpcParamReader::FtpcFastSimPars(St_ftpcFastSimPars *param)
257 ftpcFastSimPars_st *paramTable = param->GetTable();
259 mUnfoldedClusterFlag = paramTable->unfoldedClusterFlag;
260 mBadShapeClusterFlag = paramTable->badShapeClusterFlag;
261 mMergedClusterFlag = paramTable->mergedClusterFlag;
262 mNumberOfPadsDedxSmearing = paramTable->numberOfPadsDedxSmearing;
263 mNumberOfBinsDedxSmearing = paramTable->numberOfBinsDedxSmearing;
264 mRadiusTolerance = paramTable->radiusTolerance;
265 mSigmaSpacingFactor = paramTable->sigmaSpacingFactor;
266 mAdcConversionFactor = paramTable->adcConversionFactor;
267 mClusterChargeConversionFactor = paramTable->clusterChargeConversionFactor;
270 LOG_ERROR <<
"No data in table class St_ftpcFastSimPars" << endm;
277 Int_t StFtpcParamReader::FtpcSlowSimGas(St_ftpcSlowSimGas *gas)
280 mNumberOfFssGasValues = gas->GetNRows();
281 mFssGasEField =
new Float_t[mNumberOfFssGasValues];
282 mFssGasVDrift =
new Float_t[mNumberOfFssGasValues];
283 mFssGasDiffusionX =
new Float_t[mNumberOfFssGasValues];
284 mFssGasDiffusionY =
new Float_t[mNumberOfFssGasValues];
285 mFssGasDiffusionZ =
new Float_t[mNumberOfFssGasValues];
286 mFssGasLorentzAngle =
new Float_t[mNumberOfFssGasValues];
288 ftpcSlowSimGas_st *gasTable = gas->GetTable();
290 for(i=0; i<mNumberOfFssGasValues; i++)
292 mFssGasEField[i] = gasTable[i].electricField;
293 mFssGasVDrift[i] = gasTable[i].driftVelocity;
294 mFssGasDiffusionX[i] = gasTable[i].diffusionX;
295 mFssGasDiffusionY[i] = gasTable[i].diffusionY;
296 mFssGasDiffusionZ[i] = gasTable[i].diffusionZ;
297 mFssGasLorentzAngle[i] = gasTable[i].lorentzAngle;
302 LOG_ERROR <<
"No data in table class St_ftpcSlowSimGas" << endm;
309 Int_t StFtpcParamReader::FtpcSlowSimPars(St_ftpcSlowSimPars *param)
312 ftpcSlowSimPars_st *paramTable = param->GetTable();
314 mRandomNumberGenerator = paramTable->randomNumberGenerator;
315 mZeroSuppressThreshold = paramTable->zeroSuppressThreshold;
316 mNumSlowSimGridPoints = paramTable->numSlowSimGridPoints;
317 mMaxAdc = paramTable->maxAdc;
318 mGaussIntegrationSteps = paramTable->numGaussIntSteps;
319 mDiffusionCoarseness = paramTable->diffusionCoarseness;
320 mAdcConversion = paramTable->adcConversion;
321 mChamberCathodeVoltage = paramTable->chamberCathodeVoltage;
322 mSigmaPadResponseFuntion = paramTable->sigmaPadResponseFuntion;
323 mReadoutShaperTime = paramTable->shaperTime;
324 mSlowSimPressure = paramTable->slowSimPressure;
327 LOG_ERROR <<
"No data in table class St_ftpcSlowSimPars" << endm;
335 Float_t StFtpcParamReader::padDiffusionErrors(Int_t i)
337 if(i>=0 && i<mOrderOfDiffusionErrors)
339 return mPadDiffusionErrors[i];
343 LOG_WARN <<
"StFtpcParamReader: padDiffusionErrors index out of range, using 0" << endm;
344 return mPadDiffusionErrors[0];
350 Float_t StFtpcParamReader::timeDiffusionErrors(Int_t i)
352 if(i>=0 && i<mOrderOfDiffusionErrors)
354 return mTimeDiffusionErrors[i];
358 LOG_WARN <<
"StFtpcParamReader: timeDiffusionErrors index out of range, using 0" << endm;
359 return mTimeDiffusionErrors[0];
365 Float_t StFtpcParamReader::vDriftEstimates(Int_t i)
367 if(i>=0 && i<mOrderOfFastEstimates)
369 return mVDriftEstimates[i];
373 LOG_WARN <<
"StFtpcParamReader: vDriftEstimates index out of range, using 0" << endm;
374 return mVDriftEstimates[0];
380 Float_t StFtpcParamReader::tDriftEstimates(Int_t i)
382 if(i>=0 && i<mOrderOfFastEstimates)
384 return mTDriftEstimates[i];
388 LOG_WARN <<
"StFtpcParamReader: tDriftEstimates index out of range, using 0" << endm;
389 return mTDriftEstimates[0];
395 Float_t StFtpcParamReader::sigmaRadialEstimates(Int_t i)
397 if(i>=0 && i<mOrderOfFastEstimates)
399 return mSigmaRadialEstimates[i];
403 LOG_WARN <<
"StFtpcParamReader: sigmaRadialEstimates index out of range, using 0" << endm;
404 return mSigmaRadialEstimates[0];
410 Float_t StFtpcParamReader::sigmaAzimuthalEstimates(Int_t i)
412 if(i>=0 && i<mOrderOfFastEstimates)
414 return mSigmaAzimuthalEstimates[i];
418 LOG_WARN <<
"StFtpcParamReader: sigmaAzimuthalEstimates index out of range, using 0" << endm;
419 return mSigmaAzimuthalEstimates[0];
425 Float_t StFtpcParamReader::errorRadialEstimates(Int_t i)
427 if(i>=0 && i<mOrderOfFastEstimates)
429 return mErrorRadialEstimates[i];
433 LOG_WARN <<
"StFtpcParamReader: errorRadialEstimates index out of range, using 0" << endm;
434 return mErrorRadialEstimates[0];
440 Float_t StFtpcParamReader::errorAzimuthalEstimates(Int_t i)
442 if(i>=0 && i<mOrderOfFastEstimates)
444 return mErrorAzimuthalEstimates[i];
448 LOG_WARN <<
"StFtpcParamReader: errorAzimuthalEstimates index out of range, using 0" << endm;
449 return mErrorAzimuthalEstimates[0];
455 Float_t StFtpcParamReader::fssGasEField(Int_t i)
457 if(i>=0 && i<mNumberOfFssGasValues)
459 return mFssGasEField[i];
463 LOG_WARN <<
"StFtpcParamReader: fssGasEField index out of range, using 0" << endm;
464 return mFssGasEField[0];
470 Float_t StFtpcParamReader::fssGasVDrift(Int_t i)
472 if(i>=0 && i<mNumberOfFssGasValues)
474 return mFssGasVDrift[i];
478 LOG_WARN <<
"StFtpcParamReader: fssGasVDrift index out of range, using 0" << endm;
479 return mFssGasVDrift[0];
485 Float_t StFtpcParamReader::fssGasDiffusionX(Int_t i)
487 if(i>=0 && i<mNumberOfFssGasValues)
489 return mFssGasDiffusionX[i];
493 LOG_WARN <<
"StFtpcParamReader: fssGasDiffusionX index out of range, using 0" << endm;
494 return mFssGasDiffusionX[0];
500 Float_t StFtpcParamReader::fssGasDiffusionY(Int_t i)
502 if(i>=0 && i<mNumberOfFssGasValues)
504 return mFssGasDiffusionY[i];
508 LOG_WARN <<
"StFtpcParamReader: fssGasDiffusionY index out of range, using 0" << endm;
509 return mFssGasDiffusionY[0];
515 Float_t StFtpcParamReader::fssGasDiffusionZ(Int_t i)
517 if(i>=0 && i<mNumberOfFssGasValues)
519 return mFssGasDiffusionZ[i];
523 LOG_WARN <<
"StFtpcParamReader: fssGasDiffusionZ index out of range, using 0" << endm;
524 return mFssGasDiffusionZ[0];
530 Float_t StFtpcParamReader::fssGasLorentzAngle(Int_t i)
532 if(i>=0 && i<mNumberOfFssGasValues)
534 return mFssGasLorentzAngle[i];
538 LOG_WARN <<
"StFtpcParamReader: fssGasLorentzAngle index out of range, using 0" << endm;
539 return mFssGasLorentzAngle[0];