if ( fDebugStreamer) delete fDebugStreamer;
// if ( fHTime0 ) delete fHTime0;
- delete fROC;
+// delete fROC;
delete fParam;
}
//_____________________________________________________________________
//
// Find local maxima on the pad signal and Histogram them
//
- Float_t ceThreshold = 5.*fPadNoise; // threshold for the signal
+ Float_t ceThreshold = 5.*TMath::Max(fPadNoise,Float_t(1.)); // threshold for the signal
Int_t count = 0;
Int_t tminus = 2;
Int_t tplus = 3;
FindLocalMaxima(maxima);
if ( (fNevents == 0) || (fOldRunNumber!=fRunNumber) ) return; // return because we don't have Time0 info for the CE yet
-
-
TVectorD param(3);
Float_t qSum;
FindCESignal(param, qSum, maxima);
arrPol2->Expand(fNevents+nCEevents);
}
if ( vMeanTimeCE && vMeanQCE ){
- vMeanTime = GetTMeanEvents(iSec);
- vMeanQCE = GetQMeanEvents(iSec);
+ vMeanTime = GetTMeanEvents(iSec,kTRUE);
+ vMeanQ = GetQMeanEvents(iSec,kTRUE);
vMeanTime->ResizeTo(fNevents+nCEevents);
vMeanQ->ResizeTo(fNevents+nCEevents);
}
#include "AliTPCCalibPulser.h"
#include "AliTPCcalibDB.h"
#include "AliMathBase.h"
+#include "AliLog.h"
#include "TTreeStream.h"
//date
fParam(new AliTPCParam),
fPedestalTPC(0x0),
fPadNoiseTPC(0x0),
+ fOutliers(0x0),
fPedestalROC(0x0),
fPadNoiseROC(0x0),
fCalRocArrayT0(72),
fParam(new AliTPCParam),
fPedestalTPC(0x0),
fPadNoiseTPC(0x0),
+ fOutliers(0x0),
fPedestalROC(0x0),
fPadNoiseROC(0x0),
fCalRocArrayT0(72),
// destructor
//
+ Reset();
+
+ if ( fDebugStreamer) delete fDebugStreamer;
+ delete fROC;
+ delete fParam;
+}
+void AliTPCCalibPulser::Reset()
+{
+ //
+ // Delete all information: Arrays, Histograms, CalRoc objects
+ //
fCalRocArrayT0.Delete();
fCalRocArrayQ.Delete();
fCalRocArrayRMS.Delete();
fPadQArrayEvent.Delete();
fPadRMSArrayEvent.Delete();
fPadPedestalArrayEvent.Delete();
-
- if ( fDebugStreamer) delete fDebugStreamer;
- delete fROC;
- delete fParam;
}
//_____________________________________________________________________
Int_t AliTPCCalibPulser::Update(const Int_t icsector,
//
if ( (icTimeBin>fLastTimeBin) || (icTimeBin<fFirstTimeBin) ) return 0;
+ if ( icRow<0 || icPad<0 ){
+ AliWarning("Wrong Pad or Row number, skipping!");
+ return 0;
+ }
+
Int_t iChannel = fROC->GetRowIndexes(icsector)[icRow]+icPad; // global pad position in sector
//init first pad and sector in this event
}
// truncated mean
//
+ // what if by chance histo[median] == 0 ?!?
Float_t count=histo[median] ,mean=histo[median]*median, rms=histo[median]*median*median ;
//
for (Int_t idelta=1; idelta<10; ++idelta){
Float_t ceQmax =0, ceQsum=0, ceTime=0, ceRMS=0;
Int_t cemaxpos = fMaxTimeBin;
- Float_t ceSumThreshold = 8.*fPadNoise; // threshold for the signal sum
+ Float_t ceSumThreshold = 10.*TMath::Max(fPadNoise,Float_t(1.)); // threshold for the signal sum
+ Float_t ceMaxThreshold = 5.*TMath::Max(fPadNoise,Float_t(1.)); // threshold for the signal max
const Int_t kCemin = 2; // range for the analysis of the ce signal +- channels from the peak
const Int_t kCemax = 7;
+ param[0] = ceQmax;
+ param[1] = ceTime;
+ param[2] = ceRMS;
+ qSum = ceQsum;
- if (cemaxpos!=0){
- ceQmax = fPadSignal.GetMatrixArray()[cemaxpos]-fPadPedestal;
+ if (cemaxpos>0){
+ ceQmax = fPadSignal.GetMatrixArray()[cemaxpos]-fPadPedestal;
+ if ( ceQmax<ceMaxThreshold ) return;
for (Int_t i=cemaxpos-kCemin; i<cemaxpos+kCemax; ++i){
Float_t signal = fPadSignal.GetMatrixArray()[i]-fPadPedestal;
if ( (i>fFirstTimeBin) && (i<fLastTimeBin) && (signal>0) ){
}
}
}
- if (ceQmax&&ceQsum>ceSumThreshold) {
+ if (ceQsum>ceSumThreshold) {
ceTime/=ceQsum;
ceRMS = TMath::Sqrt(TMath::Abs(ceRMS/ceQsum-ceTime*ceTime));
- fVTime0Offset.GetMatrixArray()[fCurrentSector]+=ceTime; // mean time for each sector
- fVTime0OffsetCounter.GetMatrixArray()[fCurrentSector]++;
+ //only fill the Time0Offset if pad was not marked as an outlier!
+ if ( !fOutliers ){
+ fVTime0Offset.GetMatrixArray()[fCurrentSector]+=ceTime; // mean time for each sector
+ fVTime0OffsetCounter.GetMatrixArray()[fCurrentSector]++;
+ } else {
+ if ( !(fOutliers->GetCalROC(fCurrentSector)->GetValue(fCurrentChannel)) ){
+ fVTime0Offset.GetMatrixArray()[fCurrentSector]+=ceTime; // mean time for each sector
+ fVTime0OffsetCounter.GetMatrixArray()[fCurrentSector]++;
+ }
+ }
//Normalise Q to the pad area
Float_t norm = fParam->GetPadPitchWidth(fCurrentSector)*fParam->GetPadPitchLength(fCurrentSector,fCurrentRow);
Double_t meanT = param[1];
Double_t sigmaT = param[2];
+
//Fill Event T0 counter
(*GetPadTimesEvent(fCurrentSector,kTRUE)).GetMatrixArray()[fCurrentChannel] = meanT;
Float_t time = (*vTimes).GetMatrixArray()[iChannel];
GetHistoT0(iSec,kTRUE)->Fill( time-time0,iChannel );
+ //GetHistoT0(iSec,kTRUE)->Fill( time,iChannel );
//Debug start
AliTPCCalibPulser(const AliTPCCalibPulser &sig);
virtual ~AliTPCCalibPulser();
+ void Reset();
+
AliTPCCalibPulser& operator = (const AliTPCCalibPulser &source);
Bool_t ProcessEventFast(AliTPCRawStreamFast *rawStreamFast);
void SetDebugLevel(Short_t debug=1){ fDebugLevel = debug;}
void SetPedestalDatabase(AliTPCCalPad *pedestalTPC, AliTPCCalPad *padNoiseTPC) {fPedestalTPC = pedestalTPC; fPadNoiseTPC = padNoiseTPC;}
+ void SetOutliers(AliTPCCalPad *outliers) {fOutliers = outliers;}
Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
Int_t GetLastTimeBin() const { return fLastTimeBin; }
AliTPCCalPad *fPedestalTPC; //! Pedestal Information
AliTPCCalPad *fPadNoiseTPC; //! Pad noise Information whole TPC
+ AliTPCCalPad *fOutliers; //! Outlier information. Those will not be used for calculating the T0
AliTPCCalROC *fPedestalROC; //! Pedestal Information for current ROC
AliTPCCalROC *fPadNoiseROC; //! Pad noise Information for current ROC
// Bool_t fBpedestal; //! are we running with pedestal substraction