/* $Id$ */
/*
- example: fill pedestal with gausschen noise
+ example: fill pedestal with Gaussian noise
AliTRDCalibPadStatus ped;
ped.TestEvent(numberofevent);
// Method without histo
#include <TRandom.h>
#include <TDirectory.h>
#include <TFile.h>
-#include <AliMathBase.h>
-#include "TTreeStream.h"
+#include <TTreeStream.h>
//AliRoot includes
+#include <AliMathBase.h>
#include "AliRawReader.h"
#include "AliRawReaderRoot.h"
#include "AliRawReaderDate.h"
+//header file
+#include "AliTRDCalibPadStatus.h"
#include "AliTRDRawStream.h"
#include "AliTRDarrayF.h"
#include "AliTRDgeometry.h"
+#include "AliTRDCommonParam.h"
#include "./Cal/AliTRDCalROC.h"
#include "./Cal/AliTRDCalPadStatus.h"
#include "./Cal/AliTRDCalSingleChamberStatus.h"
#include "event.h"
#endif
-//header file
-#include "AliTRDCalibPadStatus.h"
-
ClassImp(AliTRDCalibPadStatus) /*FOLD00*/
//_____________________________________________________________________
}
}
-
if (fGeo) {
delete fGeo;
}
fGeo = new AliTRDgeometry();
-
}
//_____________________________________________________________________
//
// destructor
//
-
if (fGeo) {
delete fGeo;
}
-
}
//_____________________________________________________________________
return 0;
}
+
//_____________________________________________________________________
Int_t AliTRDCalibPadStatus::UpdateHisto(const Int_t icdet, /*FOLD00*/
const Int_t icRow,
return 0;
}
+
//_____________________________________________________________________
-Bool_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStream *rawStream, Bool_t nocheck)
+Int_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStream *rawStream, Bool_t nocheck)
{
//
// Event Processing loop - AliTRDRawStream
- //
-
+ // 0 time bin problem or zero suppression
+ // 1 no input
+ // 2 input
+ //
- Bool_t withInput = kFALSE;
+ Int_t withInput = 1;
if(!nocheck) {
while (rawStream->Next()) {
Int_t rawversion = rawStream->GetRawVersion(); // current raw version
- if(rawversion != 2) return kFALSE;
+ if(rawversion != 2) return 0;
Int_t idetector = rawStream->GetDet(); // current detector
Int_t iRow = rawStream->GetRow(); // current row
Int_t iRowMax = rawStream->GetMaxRow(); // current rowmax
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;
+ if((fDetector != -1) && (nbtimebin != fNumberOfTimeBins)) return 0;
fNumberOfTimeBins = nbtimebin;
Int_t fin = TMath::Min(nbtimebin,(iTimeBin+3));
n++;
}
- withInput = kTRUE;
+ withInput = 2;
}
}
else {
n++;
}
- withInput = kTRUE;
+ withInput = 2;
}
}
return withInput;
}
+
//_____________________________________________________________________
-Bool_t AliTRDCalibPadStatus::ProcessEvent(AliRawReader *rawReader, Bool_t nocheck)
+Int_t AliTRDCalibPadStatus::ProcessEvent(AliRawReader *rawReader, Bool_t nocheck)
{
//
// Event processing loop - AliRawReader
return ProcessEvent(&rawStream, nocheck);
}
+
//_________________________________________________________________________
-Bool_t AliTRDCalibPadStatus::ProcessEvent(
+Int_t AliTRDCalibPadStatus::ProcessEvent(
#ifdef ALI_DATE
eventHeaderStruct *event,
Bool_t nocheck
#endif
}
+
//_____________________________________________________________________
Bool_t AliTRDCalibPadStatus::TestEvent(Int_t nevent) /*FOLD00*/
{
}
return kTRUE;
}
+
//_____________________________________________________________________
Bool_t AliTRDCalibPadStatus::TestEventHisto(Int_t nevent) /*FOLD00*/
{
}
return kTRUE;
}
+
//_____________________________________________________________________
TH2F* AliTRDCalibPadStatus::GetHisto(Int_t det, TObjArray *arr, /*FOLD00*/
Int_t nbinsY, Float_t ymin, Float_t ymax,
sprintf(name,"hCalib%s%.2d",type,det);
sprintf(title,"%s calibration histogram detector %.2d;ADC channel;Channel (pad)",type,det);
- Int_t nbchannels = fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))
- * fGeo->GetColMax(GetPlane(det));
+
+ Int_t nbchannels = fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))*fGeo->GetColMax(GetPlane(det));
// new histogram with calib information. One value for each pad!
TH2F* hist = new TH2F(name,title,
arr->AddAt(hist,det);
return hist;
}
+
//_____________________________________________________________________
TH2F* AliTRDCalibPadStatus::GetHisto(Int_t det, Bool_t force) /*FOLD00*/
{
TObjArray *arr = &fHistoArray;
return GetHisto(det, arr, fAdcMax-fAdcMin, fAdcMin, fAdcMax, "Pedestal", force);
}
+
//_____________________________________________________________________
AliTRDarrayF* AliTRDCalibPadStatus::GetCal(Int_t det, TObjArray* arr, Bool_t force) /*FOLD00*/
{
// if we are forced and histogram doesn't yes exist create it
AliTRDarrayF *croc = new AliTRDarrayF();
- Int_t nbpad = fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))
- * fGeo->GetColMax(GetPlane(det));
+
+ Int_t nbpad = fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))*fGeo->GetColMax(GetPlane(det));
// new AliTRDCalROC. One value for each pad!
croc->Expand(nbpad);
arr->AddAt(croc,det);
return croc;
}
+
//_____________________________________________________________________
AliTRDCalROC* AliTRDCalibPadStatus::GetCalRoc(Int_t det, TObjArray* arr, Bool_t force) /*FOLD00*/
{
arr->AddAt(croc,det);
return croc;
}
+
//_____________________________________________________________________
AliTRDarrayF* AliTRDCalibPadStatus::GetCalEntries(Int_t det, Bool_t force) /*FOLD00*/
{
TObjArray *arr = &fCalArrayEntries;
return GetCal(det, arr, force);
}
+
//_____________________________________________________________________
AliTRDarrayF* AliTRDCalibPadStatus::GetCalMean(Int_t det, Bool_t force) /*FOLD00*/
{
TObjArray *arr = &fCalArrayMean;
return GetCal(det, arr, force);
}
+
//_____________________________________________________________________
AliTRDarrayF* AliTRDCalibPadStatus::GetCalSquares(Int_t det, Bool_t force) /*FOLD00*/
{
TObjArray *arr = &fCalArraySquares;
return GetCal(det, arr, force);
}
+
//_____________________________________________________________________
AliTRDCalROC* AliTRDCalibPadStatus::GetCalRocMean(Int_t det, Bool_t force) /*FOLD00*/
{
TObjArray *arr = &fCalRocArrayMean;
return GetCalRoc(det, arr, force);
}
+
//_____________________________________________________________________
AliTRDCalROC* AliTRDCalibPadStatus::GetCalRocRMS(Int_t det, Bool_t force) /*FOLD00*/
{
TObjArray *arr = &fCalRocArrayRMS;
return GetCalRoc(det, arr, force);
}
+
//_________________________________________________________________________
void AliTRDCalibPadStatus::Analyse() /*FOLD00*/
{
}
}
}
+
//_____________________________________________________________________
void AliTRDCalibPadStatus::AnalyseHisto() /*FOLD00*/
{
}
}
+
//_______________________________________________________________________________________
AliTRDCalPadStatus* AliTRDCalibPadStatus::CreateCalPadStatus()
{
else entries = fCalEntries->At(ich);
//Float_t mean = calRocMean->GetValue(ich)*10.0;
Float_t rms = calRocRMS->GetValue(ich)*10.0;
- if(ich > 1720) printf("rms %f\n",rms);
+ //if(ich > 1720) printf("rms %f\n",rms);
//if((entries < 0.3*meanentries) || (TMath::Abs(rms-meansquares) > ((Float_t)(fAdcMax-fAdcMin)/2.0)) || (rms == 0.0)) calROC->SetStatus(ich, AliTRDCalPadStatus::kMasked);
- if(rms <= 0.01) calROC->SetStatus(ich, AliTRDCalPadStatus::kMasked);
+ if(rms <= 0.0001) calROC->SetStatus(ich, AliTRDCalPadStatus::kMasked);
}
}
return obj;
}
+
//_____________________________________________________________________
void AliTRDCalibPadStatus::DumpToFile(const Char_t *filename, const Char_t *dir, Bool_t append) /*FOLD00*/
{
f.Close();
if ( backup ) backup->cd();
-}//_____________________________________________________________________________
+}
+
+//_____________________________________________________________________________
Int_t AliTRDCalibPadStatus::GetPlane(Int_t d) const
{
//
return ((Int_t) (d % 30) / 6);
}
+
//_____________________________________________________________________________
Int_t AliTRDCalibPadStatus::GetSector(Int_t d) const
{