]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Small update by Raphaelle AliTRDCalibPadStatus (some functions less
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Jun 2007 17:02:38 +0000 (17:02 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Jun 2007 17:02:38 +0000 (17:02 +0000)
TRD/AliTRDCalibPadStatus.cxx
TRD/AliTRDCalibPadStatus.h
TRD/AliTRDCalibraFillHisto.h
TRD/AliTRDCalibraMode.cxx
TRD/AliTRDgeometry.cxx

index c76eaea4ab222b7c7b991a6e244dac467755488f..09f1d032c7b544cddbe956bb7c5be0448f8a0973 100644 (file)
@@ -93,6 +93,7 @@ AliTRDCalibPadStatus::AliTRDCalibPadStatus() : /*FOLD00*/
   fAdcMin(0),
   fAdcMax(20),
   fDetector(-1),
+  fNumberOfTimeBins(0),
   fCalArrayEntries(540),
   fCalArrayMean(540),
   fCalArraySquares(540),
@@ -114,6 +115,7 @@ AliTRDCalibPadStatus::AliTRDCalibPadStatus(const AliTRDCalibPadStatus &ped) : /*
   fAdcMin(ped.GetAdcMin()),
   fAdcMax(ped.GetAdcMax()),
   fDetector(ped.fDetector),
+  fNumberOfTimeBins(ped.fNumberOfTimeBins),
   fCalArrayEntries(540),
   fCalArrayMean(540),
   fCalArraySquares(540),
@@ -227,7 +229,7 @@ Int_t AliTRDCalibPadStatus::UpdateHisto(const Int_t icdet, /*FOLD00*/
   return 0;
 }
 //_____________________________________________________________________
-Bool_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStream *rawStream)
+Bool_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStream *rawStream, Bool_t nocheck)
 {
   //
   // Event Processing loop - AliTRDRawStream
@@ -236,34 +238,58 @@ Bool_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStream *rawStream)
 
   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
@@ -274,24 +300,26 @@ Bool_t AliTRDCalibPadStatus::ProcessEvent(AliRawReader *rawReader)
 
   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
@@ -404,7 +432,7 @@ TH2F* AliTRDCalibPadStatus::GetHisto(Int_t det, Bool_t force) /*FOLD00*/
     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
@@ -430,76 +458,7 @@ AliTRDarrayF* AliTRDCalibPadStatus::GetCalEntries(Int_t det, TObjArray* arr, Boo
     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
@@ -516,54 +475,54 @@ AliTRDCalROC* AliTRDCalibPadStatus::GetCalRocRMS(Int_t det, TObjArray* arr, Bool
     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*/
index 5c36ff423805b7d8f150316b760f05f599bb8418..cfa1cb73a3856515efba6d9d19296fdc23a55ac1 100644 (file)
@@ -1,4 +1,4 @@
-#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                               */
@@ -31,9 +31,9 @@ public:
 
   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);
@@ -67,6 +67,7 @@ private:
   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
@@ -80,12 +81,9 @@ private:
   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);
index 06740baa78f94998cd8a23671ca484d637a5284f..67a44f552ea0556bbc3834ef08612ff9ee667428 100644 (file)
@@ -250,7 +250,6 @@ AliTRDCalibraVector *GetCalibraVector() const                                { r
           void     FillTheInfoOfTheTrackPH();
           void     FillTheInfoOfTheTrackCH();
          void     FillCH2d(Int_t x, Float_t y);
-         void     FillCHSm(Int_t supermodule, Float_t y);
          Bool_t   FindP1TrackPH();
           void     ResetfVariables();
           Bool_t   LocalisationDetectorXbins(Int_t detector);
index c067a0f22c472b84316effd0b3f78bf99e2f213b..1dfada6c9b400daae93ee6e2cf59f6eb41620887 100644 (file)
@@ -100,8 +100,23 @@ AliTRDCalibraMode::AliTRDCalibraMode(const AliTRDCalibraMode &c)
   // Copy constructor
   //
 
-}
+  for(Int_t k = 0; k < 3; k++){
+    fNz[k]        = c.fNz[k];
+    fNrphi[k]     = c.fNrphi[k];
+    fNnZ[k]       = c.fNnZ[k];
+    fNnRphi[k]    = c.fNnRphi[k];
+    fNfragZ[k]    = c.fNfragZ[k];
+    fNfragRphi[k] = c.fNfragRphi[k];
+    fRowMin[k]    = c.fRowMin[k];
+    fRowMax[k]    = c.fRowMax[k];
+    fColMin[k]    = c.fColMin[k];
+    fColMax[k]    = c.fColMax[k];
+    fXbins[k]     = c.fXbins[k];
+    fDetChamb0[k] = c.fDetChamb0[k];
+    fDetChamb2[k] = c.fDetChamb2[k];
+  }
 
+}
 //____________________________________________________________________________________
 AliTRDCalibraMode::~AliTRDCalibraMode()
 {
index 9c583bfc31527eef62bcc6a432d61a9db633e700..c09f0d07ddfbe523878ca30ce1b5413fed25a055 100644 (file)
@@ -1145,14 +1145,24 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
   // The MCMs
   //
 
-  const Float_t kMCMx    = 3.0;
-  const Float_t kMCMy    = 3.0;
-  const Float_t kMCMz    = 0.3;
+  //const Float_t kMCMx    = 3.0;
+  //const Float_t kMCMy    = 3.0;
+  //const Float_t kMCMz    = 0.3;
+  //
+  //const Float_t kMCMpcTh = 0.1;
+  //const Float_t kMCMcuTh = 0.0215;
+  //const Float_t kMCMsiTh = 0.003;
+  //const Float_t kMCMcoTh = 0.1549;
+
+  // New 
+  const Float_t kMCMx    = 6.0;
+  const Float_t kMCMy    = 6.0;
+  const Float_t kMCMz    = 0.075;
 
-  const Float_t kMCMpcTh = 0.1;
-  const Float_t kMCMcuTh = 0.0215;
-  const Float_t kMCMsiTh = 0.003;
-  const Float_t kMCMcoTh = 0.1549;
+  const Float_t kMCMpcTh = 0.025;
+  const Float_t kMCMcuTh = 0.005;
+  const Float_t kMCMsiTh = 0.00075;
+  const Float_t kMCMcoTh = 0.03873;
 
   // The mother volume for the MCMs (air)
   const Int_t kNparMCM = 3;
@@ -1211,7 +1221,10 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
         for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
           xpos   = (0.5 + iMCMcol) * xSize + 1.0 
                  - fCwidth[iplan]/2.0;
-          ypos   = (0.5 + iMCMrow) * ySize + 1.0 
+          //ypos   = (0.5 + iMCMrow) * ySize + 1.0 
+          //       - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
+         // New!
+          ypos   = (0.5 + iMCMrow) * ySize
                  - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
           zpos   = -0.4 + 0.742/2.0;
           par[0] = 0.0;