Skip to content

Commit

Permalink
o add Reset function to CalPad and CalROC o Add functionality to AliT…
Browse files Browse the repository at this point in the history
…PCdataQA - ResetData function - Setter for minium charge in cluster - Setter for requiring a neighbouring pad
  • Loading branch information
wiechula authored and miranov25 committed Nov 22, 2014
1 parent 2290e44 commit 55e4f54
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 128 deletions.
15 changes: 14 additions & 1 deletion TPC/Base/AliTPCCalPad.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ AliTPCCalPad::AliTPCCalPad(const AliTPCCalPad &c):TNamed(c)
}

//_____________________________________________________________________________
AliTPCCalPad::AliTPCCalPad(TObjArray * array):TNamed()
AliTPCCalPad::AliTPCCalPad(TObjArray * array):TNamed(array->GetName(),array->GetName())
{
//
// AliTPCCalPad default constructor
Expand Down Expand Up @@ -271,6 +271,19 @@ void AliTPCCalPad::Divide(const AliTPCCalPad * pad)
}
}

//_____________________________________________________________________________
void AliTPCCalPad::Reset()
{
//
// Reset all cal Rocs
//
for (Int_t isec = 0; isec < kNsec; isec++) {
if (fROC[isec]){
fROC[isec]->Reset();
}
}
}

//_____________________________________________________________________________
TGraph * AliTPCCalPad::MakeGraph(Int_t type, Float_t ratio){
//
Expand Down
1 change: 1 addition & 0 deletions TPC/Base/AliTPCCalPad.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class AliTPCCalPad : public TNamed {
void Add(const AliTPCCalPad * roc, Double_t c1 = 1); // multiply AliTPCCalPad 'pad' by c1 and add each channel to the coresponing channel in all ROCs
void Multiply(const AliTPCCalPad * pad); // multiply each channel of all ROCs with the coresponding channel of 'pad'
void Divide(const AliTPCCalPad * pad); // divide each channel of all ROCs by the coresponding channel of 'pad'
void Reset();
//
Double_t GetMeanRMS(Double_t &rms); // Calculates mean and RMS of all ROCs
Double_t GetMean(AliTPCCalPad* outlierPad = 0); // return mean of the mean of all ROCs
Expand Down
14 changes: 13 additions & 1 deletion TPC/Base/AliTPCCalROC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ AliTPCCalROC::AliTPCCalROC(UInt_t sector)
fNRows = AliTPCROC::Instance()->GetNRows(fSector);
fkIndexes = AliTPCROC::Instance()->GetRowIndexes(fSector);
fData = new Float_t[fNChannels];
for (UInt_t idata = 0; idata< fNChannels; idata++) fData[idata] = 0.;
Reset();
// for (UInt_t idata = 0; idata< fNChannels; idata++) fData[idata] = 0.;
}

//_____________________________________________________________________________
Expand Down Expand Up @@ -326,6 +327,7 @@ void AliTPCCalROC::Add(const AliTPCCalROC * roc, Double_t c1){
// multiply AliTPCCalROC roc by c1 and add each channel to the coresponing channel in the ROC
// - pad by pad
//
if (!roc) return;
for (UInt_t idata = 0; idata< fNChannels; idata++){
fData[idata]+=roc->fData[idata]*c1;
}
Expand All @@ -337,6 +339,7 @@ void AliTPCCalROC::Multiply(const AliTPCCalROC* roc) {
// multiply each channel of the ROC with the coresponding channel of 'roc'
// - pad by pad -
//
if (!roc) return;
for (UInt_t idata = 0; idata< fNChannels; idata++){
fData[idata]*=roc->fData[idata];
}
Expand All @@ -348,13 +351,22 @@ void AliTPCCalROC::Divide(const AliTPCCalROC* roc) {
// divide each channel of the ROC by the coresponding channel of 'roc'
// - pad by pad -
//
if (!roc) return;
Float_t kEpsilon=0.00000000000000001;
for (UInt_t idata = 0; idata< fNChannels; idata++){
if (TMath::Abs(roc->fData[idata])>kEpsilon)
fData[idata]/=roc->fData[idata];
}
}

void AliTPCCalROC::Reset()
{
//
// reset to ZERO
//
memset(fData,0,sizeof(Float_t)*fNChannels); // set all values to 0
}

Double_t AliTPCCalROC::GetMean(AliTPCCalROC *const outlierROC) const {
//
// returns the mean value of the ROC
Expand Down
5 changes: 3 additions & 2 deletions TPC/Base/AliTPCCalROC.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ class AliTPCCalROC : public TNamed {
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]; };
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 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();
virtual void Draw(Option_t* option = "");
//
Bool_t MedianFilter(Int_t deltaRow, Int_t deltaPad, AliTPCCalROC*outlierROC=0, Bool_t doEdge=kTRUE);
Expand Down
Loading

0 comments on commit 55e4f54

Please sign in to comment.