fAdcMin(0),
fAdcMax(20),
fDetector(-1),
+ fNumberOfTimeBins(0),
fCalArrayEntries(540),
fCalArrayMean(540),
fCalArraySquares(540),
fAdcMin(ped.GetAdcMin()),
fAdcMax(ped.GetAdcMax()),
fDetector(ped.fDetector),
+ fNumberOfTimeBins(ped.fNumberOfTimeBins),
fCalArrayEntries(540),
fCalArrayMean(540),
fCalArraySquares(540),
return 0;
}
//_____________________________________________________________________
-Bool_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStream *rawStream)
+Bool_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStream *rawStream, Bool_t nocheck)
{
//
// Event Processing loop - AliTRDRawStream
Bool_t withInput = kFALSE;
- while (rawStream->Next()) {
-
- Int_t rawversion = rawStream->GetRawVersion(); // current raw version
- if(rawversion != 2) return kFALSE;
-
- Int_t idetector = rawStream->GetDet(); // current detector
- Int_t iRow = rawStream->GetRow(); // current row
- Int_t iRowMax = rawStream->GetMaxRow(); // current rowmax
- Int_t iCol = rawStream->GetCol(); // current col
- Int_t iTimeBin = rawStream->GetTimeBin(); // current time bin
- Int_t *signal = rawStream->GetSignals(); // current ADC signal
- Int_t nbtimebin = rawStream->GetNumberOfTimeBins(); // number of time bins read from data
-
- Int_t fin = TMath::Min(nbtimebin,(iTimeBin+3));
- Int_t n = 0;
-
- for(Int_t k = iTimeBin; k < fin; k++){
- if(signal[n]>0) UpdateHisto(idetector,iRow,iCol,signal[n],iRowMax);
- n++;
+ if(!nocheck) {
+ while (rawStream->Next()) {
+ Int_t rawversion = rawStream->GetRawVersion(); // current raw version
+ if(rawversion != 2) return kFALSE;
+ Int_t idetector = rawStream->GetDet(); // current detector
+ Int_t iRow = rawStream->GetRow(); // current row
+ Int_t iRowMax = rawStream->GetMaxRow(); // current rowmax
+ Int_t iCol = rawStream->GetCol(); // current col
+ Int_t iTimeBin = rawStream->GetTimeBin(); // current time bin
+ Int_t *signal = rawStream->GetSignals(); // current ADC signal
+ Int_t nbtimebin = rawStream->GetNumberOfTimeBins(); // number of time bins read from data
+
+ if((fDetector != -1) && (nbtimebin != fNumberOfTimeBins)) return kFALSE;
+ fNumberOfTimeBins = nbtimebin;
+
+ Int_t fin = TMath::Min(nbtimebin,(iTimeBin+3));
+ Int_t n = 0;
+
+ for(Int_t k = iTimeBin; k < fin; k++){
+ if(signal[n]>0) UpdateHisto(idetector,iRow,iCol,signal[n],iRowMax);
+ n++;
+ }
+
+ withInput = kTRUE;
+ }
+ }
+ else {
+ while (rawStream->Next()) {
+ Int_t idetector = rawStream->GetDet(); // current detector
+ Int_t iRow = rawStream->GetRow(); // current row
+ Int_t iRowMax = rawStream->GetMaxRow(); // current rowmax
+ Int_t iCol = rawStream->GetCol(); // current col
+ Int_t iTimeBin = rawStream->GetTimeBin(); // current time bin
+ Int_t *signal = rawStream->GetSignals(); // current ADC signal
+ Int_t nbtimebin = rawStream->GetNumberOfTimeBins(); // number of time bins read from data
+
+ Int_t fin = TMath::Min(nbtimebin,(iTimeBin+3));
+ Int_t n = 0;
+
+ for(Int_t k = iTimeBin; k < fin; k++){
+ if(signal[n]>0) UpdateHisto(idetector,iRow,iCol,signal[n],iRowMax);
+ n++;
+ }
+
+ withInput = kTRUE;
}
-
- withInput = kTRUE;
}
return withInput;
}
//_____________________________________________________________________
-Bool_t AliTRDCalibPadStatus::ProcessEvent(AliRawReader *rawReader)
+Bool_t AliTRDCalibPadStatus::ProcessEvent(AliRawReader *rawReader, Bool_t nocheck)
{
//
// Event processing loop - AliRawReader
rawReader->Select("TRD");
- return ProcessEvent(&rawStream);
+ return ProcessEvent(&rawStream, nocheck);
}
//_________________________________________________________________________
Bool_t AliTRDCalibPadStatus::ProcessEvent(
#ifdef ALI_DATE
- eventHeaderStruct *event
+ eventHeaderStruct *event,
+ Bool_t nocheck
#else
- eventHeaderStruct* /*event*/
+ eventHeaderStruct* /*event*/,
+ Bool_t /*nocheck*/
#endif
- )
+ )
{
//
// process date event
//
#ifdef ALI_DATE
AliRawReader *rawReader = new AliRawReaderDate((void*)event);
- Bool_t result=ProcessEvent(rawReader);
+ Bool_t result=ProcessEvent(rawReader, nocheck);
delete rawReader;
return result;
#else
return GetHisto(det, arr, fAdcMax-fAdcMin, fAdcMin, fAdcMax, "Pedestal", force);
}
//_____________________________________________________________________
-AliTRDarrayF* AliTRDCalibPadStatus::GetCalEntries(Int_t det, TObjArray* arr, Bool_t force) /*FOLD00*/
+AliTRDarrayF* AliTRDCalibPadStatus::GetCal(Int_t det, TObjArray* arr, Bool_t force) /*FOLD00*/
{
//
// return pointer to ROC Calibration
return croc;
}
//_____________________________________________________________________
-AliTRDarrayF* AliTRDCalibPadStatus::GetCalMean(Int_t det, TObjArray* arr, Bool_t force) /*FOLD00*/
-{
- //
- // return pointer to ROC Calibration
- // if force is true create a new AliTRDarrayF if it doesn't exist allready
- //
- if ( !force || arr->UncheckedAt(det) )
- return (AliTRDarrayF*)arr->UncheckedAt(det);
-
- // if we are forced and histogram doesn't yes exist create it
- AliTRDarrayF *croc = new AliTRDarrayF();
- AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
- if (!comParam) {
- return croc;
- }
- Int_t nbpad = comParam->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))*comParam->GetColMax(GetPlane(det));
-
- // new AliTRDCalROC. One value for each pad!
- croc->Expand(nbpad);
- for(Int_t k = 0; k < nbpad; k++){
- croc->AddAt(0.0,k);
- }
- arr->AddAt(croc,det);
- return croc;
-}
-//_____________________________________________________________________
-AliTRDarrayF* AliTRDCalibPadStatus::GetCalSquares(Int_t det, TObjArray* arr, Bool_t force) /*FOLD00*/
-{
- //
- // return pointer to ROC Calibration
- // if force is true create a new AliTRDarrayF if it doesn't exist allready
- //
- if ( !force || arr->UncheckedAt(det) )
- return (AliTRDarrayF*)arr->UncheckedAt(det);
-
- // if we are forced and histogram doesn't yes exist create it
- AliTRDarrayF *croc = new AliTRDarrayF();
- AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
- if (!comParam) {
- return croc;
- }
- Int_t nbpad = comParam->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))*comParam->GetColMax(GetPlane(det));
-
- // new AliTRDCalROC. One value for each pad!
- croc->Expand(nbpad);
- for(Int_t k = 0; k < nbpad; k++){
- croc->AddAt(0.0,k);
- }
- arr->AddAt(croc,det);
- return croc;
-}
-//_____________________________________________________________________
-AliTRDCalROC* AliTRDCalibPadStatus::GetCalRocMean(Int_t det, TObjArray* arr, Bool_t force) /*FOLD00*/
-{
- //
- // return pointer to ROC Calibration
- // if force is true create a new AliTRDCalROC if it doesn't exist allready
- //
- if ( !force || arr->UncheckedAt(det) )
- return (AliTRDCalROC*)arr->UncheckedAt(det);
-
- // if we are forced and histogram doesn't yes exist create it
-
- // new AliTRDCalROC. One value for each pad!
- AliTRDCalROC *croc = new AliTRDCalROC(GetPlane(det),GetChamber(det));
- arr->AddAt(croc,det);
- return croc;
-}
-//_____________________________________________________________________
-AliTRDCalROC* AliTRDCalibPadStatus::GetCalRocRMS(Int_t det, TObjArray* arr, Bool_t force) /*FOLD00*/
+AliTRDCalROC* AliTRDCalibPadStatus::GetCalRoc(Int_t det, TObjArray* arr, Bool_t force) /*FOLD00*/
{
//
// return pointer to ROC Calibration
return croc;
}
//_____________________________________________________________________
-AliTRDarrayF* AliTRDCalibPadStatus::GetCalEntries(Int_t sector, Bool_t force) /*FOLD00*/
+AliTRDarrayF* AliTRDCalibPadStatus::GetCalEntries(Int_t det, Bool_t force) /*FOLD00*/
{
//
// return pointer to Carge ROC Calibration
// if force is true create a new histogram if it doesn't exist allready
//
TObjArray *arr = &fCalArrayEntries;
- return GetCalEntries(sector, arr, force);
+ return GetCal(det, arr, force);
}
//_____________________________________________________________________
-AliTRDarrayF* AliTRDCalibPadStatus::GetCalMean(Int_t sector, Bool_t force) /*FOLD00*/
+AliTRDarrayF* AliTRDCalibPadStatus::GetCalMean(Int_t det, Bool_t force) /*FOLD00*/
{
//
// return pointer to Carge ROC Calibration
// if force is true create a new histogram if it doesn't exist allready
//
TObjArray *arr = &fCalArrayMean;
- return GetCalMean(sector, arr, force);
+ return GetCal(det, arr, force);
}
//_____________________________________________________________________
-AliTRDarrayF* AliTRDCalibPadStatus::GetCalSquares(Int_t sector, Bool_t force) /*FOLD00*/
+AliTRDarrayF* AliTRDCalibPadStatus::GetCalSquares(Int_t det, Bool_t force) /*FOLD00*/
{
//
// return pointer to Carge ROC Calibration
// if force is true create a new histogram if it doesn't exist allready
//
TObjArray *arr = &fCalArraySquares;
- return GetCalSquares(sector, arr, force);
+ return GetCal(det, arr, force);
}
//_____________________________________________________________________
-AliTRDCalROC* AliTRDCalibPadStatus::GetCalRocMean(Int_t sector, Bool_t force) /*FOLD00*/
+AliTRDCalROC* AliTRDCalibPadStatus::GetCalRocMean(Int_t det, Bool_t force) /*FOLD00*/
{
//
// return pointer to Carge ROC Calibration
// if force is true create a new histogram if it doesn't exist allready
//
TObjArray *arr = &fCalRocArrayMean;
- return GetCalRocMean(sector, arr, force);
+ return GetCalRoc(det, arr, force);
}
//_____________________________________________________________________
-AliTRDCalROC* AliTRDCalibPadStatus::GetCalRocRMS(Int_t sector, Bool_t force) /*FOLD00*/
+AliTRDCalROC* AliTRDCalibPadStatus::GetCalRocRMS(Int_t det, Bool_t force) /*FOLD00*/
{
//
// return pointer to Carge ROC Calibration
// if force is true create a new histogram if it doesn't exist allready
//
TObjArray *arr = &fCalRocArrayRMS;
- return GetCalRocRMS(sector, arr, force);
+ return GetCalRoc(det, arr, force);
}
//_________________________________________________________________________
void AliTRDCalibPadStatus::Analyse() /*FOLD00*/
-#ifndef ALITPCCALIBPEDESTAL_H
+#ifndef ALITRDCALIBPADSTATUS_H
#define ALITRDCALIBPADSTATUS_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
AliTRDCalibPadStatus& operator = (const AliTRDCalibPadStatus &source);
- Bool_t ProcessEvent(AliTRDRawStream *rawStream);
- Bool_t ProcessEvent(AliRawReader *rawReader);
- Bool_t ProcessEvent(eventHeaderStruct *event);
+ Bool_t ProcessEvent(AliTRDRawStream *rawStream, Bool_t nocheck = kFALSE);
+ Bool_t ProcessEvent(AliRawReader *rawReader, Bool_t nocheck = kFALSE);
+ Bool_t ProcessEvent(eventHeaderStruct *event, Bool_t nocheck = kFALSE);
Int_t Update(const Int_t idet, const Int_t iRow, const Int_t iCol,
const Int_t signal, const Int_t rowMax);
Int_t fAdcMin; // min adc channel of pedestal value
Int_t fAdcMax; // max adc channel of pedestal value
Int_t fDetector; // Current detector
+ Int_t fNumberOfTimeBins; // Current number of time bins
TObjArray fCalArrayEntries; // Array of AliTRDarrayF class calibration
TObjArray fCalArrayMean; // Array of AliTRDarrayF class calibration
AliTRDarrayF *fCalMean; // Current AliTRDArrayF Mean
AliTRDarrayF *fCalSquares; // Current AliTRDArrayF Squares
- AliTRDarrayF* GetCalEntries(Int_t det, TObjArray* arr, Bool_t force);
- AliTRDarrayF* GetCalMean(Int_t det, TObjArray* arr, Bool_t force);
- AliTRDarrayF* GetCalSquares(Int_t det, TObjArray* arr, Bool_t force);
- AliTRDCalROC* GetCalRocMean(Int_t det, TObjArray* arr, Bool_t force);
- AliTRDCalROC* GetCalRocRMS(Int_t det, TObjArray* arr, Bool_t force);
-
+ AliTRDarrayF* GetCal(Int_t det, TObjArray* arr, Bool_t force);
+ AliTRDCalROC* GetCalRoc(Int_t det, TObjArray* arr, Bool_t force);
+
TH2F* GetHisto(Int_t det, TObjArray *arr,
Int_t nbinsY, Float_t ymin, Float_t ymax,
Char_t *type, Bool_t force);