#include "AliTRDfeeParam.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDSignalIndex.h"
-#include "AliTRDrawFastStream.h"
#include "AliTRDpadPlane.h"
#include "./Cal/AliTRDCalChamberStatus.h"
#include "./Cal/AliTRDCalDCS.h"
}
//_____________________________________________________________________
void AliTRDCalibChamberStatus::ProcessEvent(AliRawReader * rawReader, Int_t nevents_physics)
-{
- //
- // Event Processing loop
- //
- //
-
- Bool_t notEmpty = kFALSE;
-
- AliTRDrawFastStream *rawStream = new AliTRDrawFastStream(rawReader);
- if (!rawStream) return;
- rawStream->SetNoErrorWarning();
- rawStream->SetSharedPadReadout(kFALSE);
-
- AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager(kTRUE);
- if (!digitsManager) return;
- digitsManager->CreateArrays();
-
- Int_t det = 0;
- while ((det = rawStream->NextChamber(digitsManager, NULL, NULL)) >= 0) {
-
- //nextchamber loop
-
- // do the QA analysis
- if (digitsManager->GetIndexes(det)->HasEntry()) {//QA
- // printf("there is ADC data on this chamber!\n");
-
- AliTRDSignalIndex *indexes = digitsManager->GetIndexes(det);
- if (indexes->IsAllocated() == kFALSE) {
- // AliError("Indexes do not exist!");
- break;
- }
-
- Int_t iRow = 0;
- Int_t iCol = 0;
- indexes->ResetCounters();
-
- while (indexes->NextRCIndex(iRow, iCol)){
- Int_t iMcm = (Int_t)(iCol/18); // current group of 18 col pads
-
- Int_t layer = AliTRDgeometry::GetLayer(det);
- Int_t sm = AliTRDgeometry::GetSector(det);
- Int_t stac = AliTRDgeometry::GetStack(det);
- Double_t rphi = 0.5;
- if(iMcm > 3) rphi = 1.5;
-
- Double_t val[4] = {sm,layer,stac,rphi};
- fHnSparseI->Fill(&val[0]);
- notEmpty = kTRUE;
-
- //---------//
- // Debug //
- if(fDebugLevel > 0) {
- Int_t detector = AliTRDgeometry::GetDetector(layer,stac,sm);
- Double_t valu[3] = {nevents_physics,detector,rphi};
- fHnSparseEvtDet->Fill(&valu[0]);
- }
- // Debug //
- //---------//
- }
-
- }
- digitsManager->ClearArrays(det);
- }
-
- if(notEmpty) fCounterEventNotEmpty++;
-
- delete digitsManager;
- delete rawStream;
-
-}//_____________________________________________________________________
-void AliTRDCalibChamberStatus::ProcessEvent3(AliRawReader * rawReader, Int_t nevents_physics)
{
//
// Event Processing loop with AliTRDrawStream
AliTRDCalibChamberStatus& operator = (const AliTRDCalibChamberStatus &source);
void ProcessEvent(AliRawReader *rawReader, Int_t nevents_physics);
- void ProcessEvent3(AliRawReader *rawReader, Int_t nevents_physics);
-
+
void Init();
void AnalyseHisto();
void CheckEORStatus(AliTRDCalDCS *calDCS);
};
#endif
+
#include "./Cal/AliTRDCalPad.h"
#include "./Cal/AliTRDCalSingleChamberStatus.h"
-#include "AliTRDrawFastStream.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDdigitsParam.h"
#include "AliTRDSignalIndex.h"
}
//_____________________________________________________________________
-Int_t AliTRDCalibPadStatus::ProcessEvent2(AliRawReader *rawReader)
-{
- //
- // 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;
- AliTRDrawFastStream *rawStream = new AliTRDrawFastStream(rawReader);
- rawStream->SetNoErrorWarning();
- rawStream->SetSharedPadReadout(kTRUE);
-
- AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager(kTRUE);
- digitsManager->CreateArrays();
-
- AliTRDfeeParam *feeParam = AliTRDfeeParam::Instance();
-
- Int_t det = 0;
- while ((det = rawStream->NextChamber(digitsManager, NULL, NULL)) >= 0) { //idetector
- if (digitsManager->GetIndexes(det)->HasEntry()) {//QA
- // printf("there is ADC data on this chamber!\n");
-
- AliTRDarrayADC *digits = (AliTRDarrayADC *) digitsManager->GetDigits(det); //mod
- if (digits->HasData()) { //array
-
- AliTRDSignalIndex *indexes = digitsManager->GetIndexes(det);
- if (indexes->IsAllocated() == kFALSE) {
- AliError("Indexes do not exist!");
- break;
- }
- Int_t iRow = 0;
- Int_t iCol = 0;
- indexes->ResetCounters();
-
- while (indexes->NextRCIndex(iRow, iCol)) { //column,row
-
-
- AliTRDdigitsParam *digitParam = (AliTRDdigitsParam *)digitsManager->GetDigitsParam();
-
- Int_t mcm = 0; // MCM from AliTRDfeeParam
- Int_t rob = 0; // ROB from AliTRDfeeParam
- Int_t extCol = 0; // extended column from AliTRDfeeParam
- mcm = feeParam->GetMCMfromPad(iRow,iCol);
- rob = feeParam->GetROBfromPad(iRow,iCol);
-
- Int_t idetector = det; // current detector
- Int_t iRowMax = rawStream->GetMaxRow(); // current rowmax
-
- Int_t adc = 20 - (iCol%18) -1; // current adc
- Int_t col = 0; // col!=0 ->Shared Pad
- extCol = feeParam->GetExtendedPadColFromADC(rob,mcm,adc);
- //printf(" iCol %d iRow %d iRowMax %d rob %d mcm %d adc %d extCol %d\n",iCol,iRow,iRowMax,rob,mcm,adc,extCol);
-
- // Signal for regular pads
- Int_t nbtimebin = digitParam->GetNTimeBins(idetector); // number of time bins read from data
- for(Int_t k = 0; k < nbtimebin; k++){
- Short_t signal = 0;
- signal = digits->GetData(iRow,iCol,k);
-
- if(signal>0) {
- UpdateHisto2(idetector,iRow,iCol,signal,iRowMax,col,mcm,rob);
- }
- }
-
-
-
- if((adc==3-1 || adc==20-1 || adc==19-1) && (iCol > 1 && iCol <142) /* && fSharedPadsOn*/ ) { //SHARED PADS
-
- switch(adc) {
- case 2:
- adc = 20; //shared Pad adc
- mcm = feeParam->GetMCMfromSharedPad(iRow,iCol); //shared Pad mcm
- col = 1;
- break;
- case 19:
- adc = 1; //shared Pad adc
- mcm = feeParam->GetMCMfromSharedPad(iRow,iCol); //shared Pad mcm
- col = 2;
- break;
- case 18:
- adc = 0; //shared Pad adc
- mcm = feeParam->GetMCMfromSharedPad(iRow,iCol); //shared Pad mcm
- col = 3;
- break;
- }
- rob = feeParam->GetROBfromSharedPad(iRow,iCol); //shared Pad rob
-
-
- extCol = feeParam->GetExtendedPadColFromADC(rob,mcm,adc); //extended pad col via the shared pad rob,mcm and adc
-
- //printf("SHARED PAD --- iCol %d iRow %d rob %d mcm %d adc %d extCol %d col %d\n",iCol,iRow,rob,mcm,adc,extCol,col);
- for(Int_t k = 0; k < nbtimebin; k++){
- Short_t signal = 0;
- signal = digits->GetDataByAdcCol(iRow,extCol,k);
-
- if(signal>0) {
- UpdateHisto2(idetector,iRow,iCol,signal,iRowMax,col,mcm,rob);
- }
- }
- } //shared pads end
-
-
- withInput = 2;
- }//column,row
-
- }//array
- }//QA
- digitsManager->ClearArrays(det);
- }//idetector
- delete digitsManager;
- delete rawStream;
- return withInput;
-}
-
-//_____________________________________________________________________
-
-Int_t AliTRDCalibPadStatus::ProcessEvent3(AliRawReader *rawReader)
+Int_t AliTRDCalibPadStatus::ProcessEvent2(AliRawReader *rawReader)
{
//
// RawReader = AliTRDrawStream (Jochen Klein)
return ((Int_t) (d / 30));
}
+
+
class AliTRDrawStreamBase;
class AliTRDgeometry;
-class AliTRDrawFastStream;
class AliTRDdigitsManager;
class AliTRDSignalIndex;
Int_t ProcessEvent(AliRawReader *rawReader, Bool_t nocheck = kFALSE);
Int_t ProcessEvent(const eventHeaderStruct *event, Bool_t nocheck = kFALSE);
Int_t ProcessEvent2(AliRawReader *rawReader);
- Int_t ProcessEvent3(AliRawReader *rawReader);
void Destroy();
Int_t UpdateHisto(const Int_t idet, const Int_t iRow, const Int_t iCol,
};
#endif
+
+
#include "./Cal/AliTRDCalPad.h"
#include "./Cal/AliTRDCalDet.h"
-#include "AliTRDrawFastStream.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDdigitsParam.h"
#include "AliTRDSignalIndex.h"
}
//_____________________________________________________________________
Int_t AliTRDCalibraFillHisto::ProcessEventDAQ2(AliRawReader *rawReader)
- { //main
- //
- // Event Processing loop - AliTRDrawFastStream
- //
- // 0 timebin problem
- // 1 no input
- // 2 input
- // Same algorithm as TestBeam but different reader
- //
-
- // AliTRDrawFastStream *rawStream = AliTRDrawFastStream::GetRawStream(rawReader);
- AliTRDrawFastStream *rawStream = new AliTRDrawFastStream(rawReader);
- rawStream->SetNoErrorWarning();
- rawStream->SetSharedPadReadout(kFALSE);
-
- AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager(kTRUE);
- digitsManager->CreateArrays();
-
- Int_t withInput = 1;
-
- Double_t phvalue[16][144][36];
- for(Int_t k = 0; k < 36; k++){
- for(Int_t j = 0; j < 16; j++){
- for(Int_t c = 0; c < 144; c++){
- phvalue[j][c][k] = 0.0;
- }
- }
- }
-
- fDetectorPreviousTrack = -1;
- fMCMPrevious = -1;
- fROBPrevious = -1;
-
- Int_t nbtimebin = 0;
- Int_t baseline = 10;
-
-
- fTimeMax = 0;
-
- Int_t det = 0;
- while ((det = rawStream->NextChamber(digitsManager, NULL, NULL)) >= 0) { //idetector
-
- if (digitsManager->GetIndexes(det)->HasEntry()) {//QA
- // printf("there is ADC data on this chamber!\n");
-
- AliTRDarrayADC *digits = (AliTRDarrayADC *) digitsManager->GetDigits(det); //mod
- if (digits->HasData()) { //array
-
- AliTRDSignalIndex *indexes = digitsManager->GetIndexes(det);
- if (indexes->IsAllocated() == kFALSE) {
- AliError("Indexes do not exist!");
- break;
- }
- Int_t iRow = 0;
- Int_t iCol = 0;
- indexes->ResetCounters();
-
- while (indexes->NextRCIndex(iRow, iCol)) { //column,row
- //printf(" det %d \t row %d \t col %d \t digit\n",det,iRow,iCol);
- //while (rawStream->Next()) {
-
- Int_t idetector = det; // current detector
- //Int_t imcm = rawStream->GetMCM(); // current MCM
- //Int_t irob = rawStream->GetROB(); // current ROB
-
-
- if((fDetectorPreviousTrack != idetector) && (fDetectorPreviousTrack != -1)) {
- // Fill
- withInput = TMath::Max(FillDAQ(phvalue),withInput);
-
- // reset
- for(Int_t k = 0; k < 36; k++){
- for(Int_t j = 0; j < 16; j++){
- for(Int_t c = 0; c < 144; c++){
- phvalue[j][c][k] = 0.0;
- }
- }
- }
- }
-
- fDetectorPreviousTrack = idetector;
- //fMCMPrevious = imcm;
- //fROBPrevious = irob;
-
- // nbtimebin = rawStream->GetNumberOfTimeBins(); // number of time bins read from data
- AliTRDdigitsParam *digitParam = (AliTRDdigitsParam *)digitsManager->GetDigitsParam();
- nbtimebin = digitParam->GetNTimeBins(det); // number of time bins read from data
- baseline = digitParam->GetADCbaseline(det); // baseline
-
- if(nbtimebin == 0) return 0;
- if((fTimeMax != 0) && (nbtimebin != fTimeMax)) return 0;
- fTimeMax = nbtimebin;
-
- fNumberClustersf = fTimeMax;
- fNumberClusters = (Int_t)(fNumberClustersProcent*fTimeMax);
-
-
- for(Int_t itime = 0; itime < nbtimebin; itime++) {
- // phvalue[row][col][itime] = signal[itime]-baseline;
- phvalue[iRow][iCol][itime] = (Short_t)(digits->GetData(iRow,iCol,itime) - baseline);
- /*if(phvalue[iRow][iCol][itime] >= 20) {
- printf("----------> phvalue[%d][%d][%d] %d baseline %d \n",
- iRow,
- iCol,
- itime,
- (Short_t)(digits->GetData(iRow,iCol,itime)),
- baseline);
- }*/
- }
-
- }//column,row
-
- // fill the last one
- if(fDetectorPreviousTrack != -1){
-
- // Fill
- withInput = TMath::Max(FillDAQ(phvalue),withInput);
- // printf("\n ---> withinput %d\n\n",withInput);
- // reset
- for(Int_t k = 0; k < 36; k++){
- for(Int_t j = 0; j < 16; j++){
- for(Int_t c = 0; c < 144; c++){
- phvalue[j][c][k] = 0.0;
- }
- }
- }
- }
-
- }//array
- }//QA
- digitsManager->ClearArrays(det);
- }//idetector
- delete digitsManager;
-
- delete rawStream;
- return withInput;
- }//main
-//_____________________________________________________________________
-Int_t AliTRDCalibraFillHisto::ProcessEventDAQ3(AliRawReader *rawReader)
{ //main
//
// Event Processing loop - AliTRDrawStream
class AliTRDCalROC;
class AliTRDcalibDB;
-class AliTRDrawFastStream;
class AliTRDdigitsManager;
class AliTRDSignalIndex;
Int_t ProcessEventDAQ(AliRawReader *rawReader, Bool_t nocheck = kFALSE);
Int_t ProcessEventDAQ(const eventHeaderStruct *event, Bool_t nocheck = kFALSE);
Int_t ProcessEventDAQ2(AliRawReader *rawReader);
- Int_t ProcessEventDAQ3(AliRawReader *rawReader);
// Is Pad on
Bool_t IsPadOn(Int_t detector, Int_t row, Int_t col) const;
#endif
+
AliRawReader *rawReader = new AliRawReaderDate((void*)event);
rawReader->Select("TRD");
- calipad.ProcessEvent3((AliRawReader *) rawReader,nevents);
+ calipad.ProcessEvent((AliRawReader *) rawReader,nevents);
nevents++;
delete rawReader;
printf("TRDQAda: Waring: Failed to write one of the calib objects to the AMORE database\n");
// reset env var
if (amoreDANameorig) gSystem->Setenv("AMORE_DA_NAME",amoreDANameorig);
-}
\ No newline at end of file
+}
+
+
// for debug
//rawReader->SelectEquipment(-1,1024,1025);
- Int_t result = calipad.ProcessEvent3((AliRawReader *) rawReader);
+ Int_t result = calipad.ProcessEvent2((AliRawReader *) rawReader);
// 0 error, 1 no input, 2 output
if(result == 2) nevents++;
if(result == 0) passpadstatus = kFALSE;
AliRawReader *rawReader = new AliRawReaderDate((void*)event);
rawReader->Select("TRD");
- Int_t result = calibra->ProcessEventDAQ3((AliRawReader *)rawReader);
+ Int_t result = calibra->ProcessEventDAQ2((AliRawReader *)rawReader);
if(!result) passvdrift = kFALSE;
else nbvdrift += (Int_t) result/2;
if (amoreDANameorig) gSystem->Setenv("AMORE_DA_NAME",amoreDANameorig);
}
*/
+
+