|
ATLAS Offline Software
|
Go to the documentation of this file.
19 m_minSignalHeight (30),
23 m_layer (LAYER_NOT_SET),
26 m_currentFullDelayData (0),
88 return StatusCode::SUCCESS;
105 return StatusCode::SUCCESS;
116 for(
unsigned int timeSlice = 0;timeSlice <
adc.size();++timeSlice){
129 return StatusCode::SUCCESS;
147 signalCut += pedestal;
157 return StatusCode::SUCCESS;
161 const unsigned short int saturationLevel = 1020;
164 if(signalIsSaturated){
176 std::string rawFitName =
"raw_";
198 std::string processedFitName =
"processed_";
210 return StatusCode::SUCCESS;
219 if(peakValue < histo->GetBinContent(
bin)){
220 peakValue =
histo->GetBinContent(
bin);
231 const unsigned int fitRangeWidth = 13;
232 const unsigned int minFitRange = maxPeakBin - fitRangeWidth - 1;
233 const unsigned int maxFitRange = maxPeakBin + fitRangeWidth - 1;
238 TF1*
fit =
new TF1(fitName.c_str(),fitFunc,minFitRange,maxFitRange,5);
240 fit->FixParameter(4,pedestal);
246 const unsigned int xmax_init = maxPeakBin-1;
247 fit->SetParameter(0,xmax_init);
253 const float amp_init = (maxPeakValue-pedestal)*
exp(0.5);
254 fit->SetParameter(1,amp_init);
260 const unsigned int gSigma_init = 25;
261 fit->SetParameter(2,gSigma_init);
267 const unsigned int lSigma_init = 15;
268 fit->SetParameter(3,lSigma_init);
275 const float ampl =
fit->GetParameter(1);
280 fitPeakValue = ampl*
exp(-0.5)+pedestal;
284 fitPeakBin =
histo->FindBin(
fit->GetParameter(0));
295 ATH_MSG_WARNING(
"[CalculatePedestal] Could not calculate pedestal due to lack of bins in " <<
histo->GetName());
299 float pedSum=0,pedSum2=0;
302 pedSum +=
histo->GetBinContent(
bin);
307 pedMean = pedSum/(
float)pedN;
308 pedSigma = sqrt( (1.0/(
float)pedN)*pedSum2 - pedMean*pedMean);
362 const int dt = idealPeakPosition - truePeakPosition;
364 const int newFullDelayData = (baseDelay +
dt);
365 if(newFullDelayData < 0){
366 ATH_MSG_WARNING(
"[CalculateFullDelayData]: New Full Delay data was calculated as zero. Should only be greater than zero. Returning 0 for safety. Channel 0x" <<
CoolIdToString(
m_coolId) <<
". Peak position passed was: " << truePeakPosition <<
" and the idealPeakPosition is: " << idealPeakPosition);
370 return (
unsigned int)newFullDelayData;
376 if(!signalIsPresent){
389 if(signalIsSaturated){
452 if(
histo->GetBinContent(
bin) >= saturationPoint){
465 const float peakValue10percent = peakValue*0.10;
466 const float peakValue90percent = peakValue*0.90;
467 unsigned int peakBin10percent = 0;
468 unsigned int peakBin90percent = 0;
469 for(
unsigned int bin=peakBin;
bin>0;--
bin){
470 if(
histo->GetBinContent(
bin) < peakValue10percent && peakBin10percent == 0){
471 peakBin10percent =
bin;
474 if(
histo->GetBinContent(
bin) < peakValue90percent && peakBin90percent == 0){
475 peakBin90percent =
bin;
483 for(
unsigned int bin=peakBin10percent+1;
bin<=peakBin90percent;++
bin){
510 sprintf(temp,
"%08x",coolId.
id());
511 std::string tempStr = temp;
unsigned int m_processed_maxFullDelayData
bool phos4ScanSignalSaturated() const
unsigned int m_raw_maxFullDelayData
void FillErrorCode(bool signalIsPresent, bool signalIsSaturated)
bool m_processSignalShape
bool phos4ScanNoSignal() const
unsigned int m_processed_maxPeakBin
unsigned int m_minSignalHeight
TH1F * m_processed_signalShape
unsigned int m_l1aFadcSlice
L1CaloCoolChannelId m_coolId
bool phos4ScanBadSignal() const
StatusCode Fill(const unsigned int ns_step, const unsigned int adc)
Fill the profile with the ADC values at each nanosecond step.
unsigned int m_currentFullDelayData
static const unsigned int NANOSEC_PER_LHC_CLOCK_TICK
float m_processed_maxPeakValue
void CalculatePedCorrection(void)
void CheckRisingSlope(TH1 *histo, unsigned int peakBin, float peakValue)
bool IsSignalPresent(TH1 *histo, const unsigned int threshold) const
bool IsSignalSaturated(TH1 *histo, const unsigned int saturationPoint) const
TProfile * m_raw_signalShape
def TProfile(*args, **kwargs)
unsigned int m_raw_maxPeakBin
::StatusCode StatusCode
StatusCode definition for legacy code.
TF1 * FitSignalPeak(TH1 *histo, const float maxPeakValue, const unsigned int maxPeakBin, const unsigned int pedestal, float &fitPeakValue, unsigned int &fitPeakBin)
Given a signal profile, this finds the maximum value and it's corresponding bin.
Class to provide easy MsgStream access and capabilities.
static const unsigned int MAX_PEDESTAL_SIGMA
ChanCalibErrorCode m_errorCode
bool m_processed_fitPerformed
void SetBinContent(int, double)
std::vector< float > m_pedCorrectionMean
std::string GetPlotTitle(const std::string &base, const L1CaloCoolChannelId &coolId) const
float m_processed_fitPeakValue
StatusCode Finalize(void)
In finalize I want the profile to be processed and extract some useful characteristics like the peak ...
void FindBinWithMaxValue(TH1 *histo, float &peakValue, unsigned int &peakBin)
Given a signal profile, this finds the maximum value and it's corresponding bin.
std::string CoolIdToString(const L1CaloCoolChannelId &coolId) const
#define ATH_MSG_WARNING(x)
unsigned int CalculateFullDelayData(const int truePeakPosition)
void CalculatePedestal(TH1 *histo, float &pedMean, float &pedSigma)
void CorrectRawPedestal(void)
unsigned int m_raw_fitFullDelayData
unsigned int m_raw_fitPeakBin
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
std::vector< unsigned int > m_pedCorrectionN
unsigned int m_processed_fitPeakBin
std::vector< unsigned int > m_pedCorrectionSum2
std::vector< float > m_pedCorrectionSigma
static const unsigned int MAX_ADC_TIME_SLICES
unsigned int m_processed_fitFullDelayData
std::string GetPlotName(const std::string &base, const L1CaloCoolChannelId &coolId) const
std::vector< unsigned int > m_pedCorrectionSum
double GetBinContent(int) const