-Int_t AliTRDCalibPadStatus::ProcessEvent(AliTRDrawStreamBase *rawStream, Bool_t nocheck)
-{
- //
- // Event Processing loop - AliTRDRawStreamCosmic
- // 0 time bin problem or zero suppression
- // 1 no input
- // 2 input
- //
-
- //
- // Raw version number:
- // [3,31] non zero suppressed
- // 2,4 and [32,63] zero suppressed
- //
-
- Int_t withInput = 1;
-
- rawStream->SetSharedPadReadout(kTRUE);
-
- if(!nocheck) {
-
- // Check the raw version and if all have the same number of timebins.
-
- while (rawStream->Next()) {
-
- Int_t rawversion = rawStream->GetRawVersion(); // current raw version
- //printf("Raw version is %d\n",rawversion);
-
- // Could eventually change, have to check with time
- if((rawversion < 3) || (rawversion > 31)) {
- AliInfo(Form("this is not no-zero-suppressed data, the version is %d",rawversion));
- 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 iCol = rawStream->GetCol(); // current col
- Int_t iADC = 21-rawStream->GetADC(); // current ADC
-
- // It goes in the opposite direction
- Int_t col = 0;
- if(iADC == 1) col = 1;
- else {
- col = TMath::Max(0,(Int_t)(iADC-19));
- if(col > 0) col++;
- }
- Int_t mcm = (Int_t)(iCol/18); // current group of 18 col pads
- if(col > 1) mcm -= 1;
- if(col ==1) mcm += 1;
-
- // printf to check
- //Bool_t shared = rawStream->IsCurrentPadShared();
- //printf("ADC %d, iCol %d, col %d, mcm %d, shared %d\n",iADC,iCol,col,mcm,(Int_t)shared);
-
- // Take the signal
- 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)) {
- AliInfo(Form("the number of time bins is %d, is different from the previous one %d",nbtimebin,fNumberOfTimeBins));
- return 0;
- }
- fNumberOfTimeBins = nbtimebin;
- fDetector = idetector;
-
- for(Int_t k = 0; k < fNumberOfTimeBins; k++){
- if(signal[k]>0 && iCol != -1) UpdateHisto(idetector,iRow,iCol,signal[k],iRowMax,col,mcm);
- }
-
- withInput = 2;
- }
- }
- 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 iADC = 21-rawStream->GetADC(); // current ADC
-
- // It goes in the opposite direction
- Int_t col = 0;
- if(iADC == 1) col = 1;
- else {
- col = TMath::Max(0,(Int_t)(iADC-19));
- if(col > 0) col++;
- }
- Int_t mcm = (Int_t)(iCol/18); // current group of 18 col pads
- if(col > 1) mcm -= 1;
- if(col ==1) mcm += 1;
-
- // Take the signal
- Int_t *signal = rawStream->GetSignals(); // current ADC signal
- Int_t nbtimebin = rawStream->GetNumberOfTimeBins(); // number of time bins read from data
-
-
- //printf("det %d, row %d, signal[0] %d, signal[1] %d, signal [2] %d\n", idetector, iRow, signal[0], signal[1], signal[2]);
-
- for(Int_t k = 0; k < nbtimebin; k++){
- if(signal[k]>0 && iCol != -1) {
- UpdateHisto(idetector,iRow,iCol,signal[k],iRowMax,col,mcm);
- //printf("Update with det %d, row %d, col %d, signal %d, rowmax %d, col %d, mcm %d\n",idetector,iRow,iCol,signal[n],iRowMax,col,mcm);
- }
- }
-
- withInput = 2;
- }
- }
-
- return withInput;
-}
-//_____________________________________________________________________
-Int_t AliTRDCalibPadStatus::ProcessEvent(AliRawReader *rawReader, Bool_t nocheck)
-{
- //
- // Event processing loop - AliRawReader
- //
-
- Int_t result;
-
- rawReader->Select("TRD");
-
- AliTRDrawStreamBase *pstream = AliTRDrawStreamBase::GetRawStream(rawReader);
-
- result = ProcessEvent(pstream, nocheck);
-
- delete pstream;
-
- return result;
-}
-
-//_________________________________________________________________________
-Int_t AliTRDCalibPadStatus::ProcessEvent(
-#ifdef ALI_DATE
- const eventHeaderStruct *event,
- Bool_t nocheck
-#else
- const eventHeaderStruct* /*event*/,
- Bool_t /*nocheck*/
-
-#endif
- )
-{
- //
- // process date event
- //
-#ifdef ALI_DATE
- AliRawReader *rawReader = new AliRawReaderDate((void*)event);
- Bool_t result=ProcessEvent(rawReader, nocheck);
- delete rawReader;
- return result;
-#else
- Fatal("AliTRDCalibPadStatus", "this class was compiled without DATE");
- return 0;
-#endif
-
-}
-
-//_____________________________________________________________________
-
-Int_t AliTRDCalibPadStatus::ProcessEvent2(AliRawReader *rawReader)