Skip to content

Commit

Permalink
Protect AliTPCCalROC::GetValue by IsNaN, suppress similar protection …
Browse files Browse the repository at this point in the history
…in AliTPC
  • Loading branch information
shahor02 authored and chiarazampolli committed Mar 5, 2021
1 parent d6396c7 commit f5f9db2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 3 additions & 2 deletions TPC/TPCbase/AliTPCCalROC.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <TMath.h>
#include <AliTPCROC.h>
#include "TLinearFitter.h"
#include <TMath.h>

class TH1F;
class TH2F;
Expand All @@ -35,8 +36,8 @@ class AliTPCCalROC : public TNamed {
UInt_t GetNchannelsMedium() const { return (fSector<36)? 0: fkIndexes[64];};
Bool_t IsInRange(UInt_t row, UInt_t pad) { return (row<fNRows)? (fkIndexes[row]+pad)<fNChannels:kFALSE;}
UInt_t GetNPads(UInt_t row) const { return (row<fNRows)? AliTPCROC::Instance()->GetNPads(fSector,row):0;};
Float_t GetValue(UInt_t row, UInt_t pad) const { return ( (row<fNRows) && (fkIndexes[row]+pad)<fNChannels)? fData[fkIndexes[row]+pad]: 0; };
Float_t GetValue(UInt_t channel) const { return fData[channel]; };
Float_t GetValue(UInt_t channel) const { return TMath::IsNaN(fData[channel]) ? 0. : fData[channel]; };
Float_t GetValue(UInt_t row, UInt_t pad) const { return ( (row<fNRows) && (fkIndexes[row]+pad)<fNChannels)? GetValue(fkIndexes[row]+pad): 0; };
void SetValue(UInt_t row, UInt_t pad, Float_t vd) { if ( row<fNRows && (fkIndexes[row]+pad)<fNChannels)fData[fkIndexes[row]+pad]= vd; }
void SetValue(UInt_t channel, Float_t vd) {fData[channel]= vd; }
void Reset();
Expand Down
5 changes: 0 additions & 5 deletions TPC/TPCsim/AliTPC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1938,11 +1938,6 @@ void AliTPC::DigitizeRow(Int_t irow,Int_t isec,TObjArray **rows)
if(fDigitsSwitch == 0){
Float_t gain = gainROC->GetValue(irow,ip); // get gain for given - pad-row pad
Float_t noisePad = noiseROC->GetValue(irow,ip);
//protection for nan
if ( TMath::IsNaN(noisePad) ){
noisePad=0.;
}

//
q*=gain;
q+=GetNoise()*noisePad;
Expand Down

0 comments on commit f5f9db2

Please sign in to comment.