HPTDC latency window information propagated to OCDB through AliTOFChannelOnlineStatus...
authorrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Dec 2009 11:41:15 +0000 (11:41 +0000)
committerrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Dec 2009 11:41:15 +0000 (11:41 +0000)
TOF/AliTOFChannelOnlineStatusArray.cxx
TOF/AliTOFChannelOnlineStatusArray.h
TOF/AliTOFPreprocessor.cxx
TOF/AliTOFPreprocessor.h

index d9e4fab..730cc38 100644 (file)
@@ -31,7 +31,8 @@ ClassImp(AliTOFChannelOnlineStatusArray)
 AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray():
        TObject(),
        fSize(0),
-       fArray(0x0)
+       fArray(0x0),
+       fLatencyWindow(0x0)
 {
        //default constructor
 }
@@ -40,23 +41,27 @@ AliTOFChannelOnlineStatusArray::~AliTOFChannelOnlineStatusArray()
 {
        //distructor
        delete [] fArray;
+       delete [] fLatencyWindow;
 }
 //________________________________________________________________
 AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(Int_t size):
        TObject(),
        fSize(size),
-       fArray(new UChar_t[size])
+       fArray(new UChar_t[size]),
+       fLatencyWindow(new Int_t[size])
 {
        // ctor with size
        for (Int_t ich = 0; ich<size; ich ++){
          SetStatus(ich,kTOFOnlineUnknown);
+         SetLatencyWindow(ich, -1);
        }
 }
 //________________________________________________________________
 AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(const AliTOFChannelOnlineStatusArray & source):
       TObject(),
       fSize(source.fSize),
-      fArray(source.fArray)
+      fArray(source.fArray),
+      fLatencyWindow(source.fLatencyWindow)
 { 
        // copy constructor
 }
@@ -71,6 +76,7 @@ AliTOFChannelOnlineStatusArray &AliTOFChannelOnlineStatusArray::operator=(const
   TObject::operator=(source);
   fSize= source.fSize;
   fArray= source.fArray;
+  fLatencyWindow= source.fLatencyWindow;
   return *this;
 }
 //________________________________________________________________
@@ -115,6 +121,16 @@ void AliTOFChannelOnlineStatusArray::SetNoiseStatus(Int_t pos, UChar_t parr)
        AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
 }
 //________________________________________________________________
+void AliTOFChannelOnlineStatusArray::SetLatencyWindow(Int_t pos, Int_t parr)
+{
+       // setting latency window for channel at position = pos
+       AliDebug(2,Form("Latency window = %d",parr));
+       if (pos>-1 && pos < fSize){
+         fLatencyWindow[pos] = parr;
+       }
+       AliDebug(2,Form("fLatencyWindow[%d] = %d",pos,fLatencyWindow[pos]));
+}
+//________________________________________________________________
 UChar_t AliTOFChannelOnlineStatusArray::GetStatus(Int_t pos) const 
 {
        // getting the status for channel at position = pos 
@@ -155,3 +171,12 @@ UChar_t AliTOFChannelOnlineStatusArray::GetNoiseStatus(Int_t pos) const
        //      UChar_t noiseSt = parr & 0x30;
        return noiseSt; 
 }
+//________________________________________________________________
+Int_t AliTOFChannelOnlineStatusArray::GetLatencyWindow(Int_t pos) const 
+{
+       // getting the latency window for channel at position = pos 
+  Int_t lw = -1; 
+  if  (pos>-1 && pos < fSize)lw = fLatencyWindow[pos];
+  AliDebug(2,Form("lw = %d ",lw));
+  return lw;
+}
index c557e34..0036ee3 100644 (file)
@@ -38,16 +38,19 @@ public:
   void  SetHWStatus(Int_t pos, UChar_t parr);
   void  SetPulserStatus(Int_t pos, UChar_t parr);
   void  SetNoiseStatus(Int_t pos, UChar_t parr);
+  void SetLatencyWindow(Int_t pos, Int_t parr);
   UChar_t  GetStatus(Int_t pos) const;
   UChar_t  GetHWStatus(Int_t pos) const;
   UChar_t  GetPulserStatus(Int_t pos) const;
   UChar_t  GetNoiseStatus(Int_t pos) const;
+  Int_t GetLatencyWindow(Int_t pos) const;
 
 private:
   Int_t fSize;      // Size of the array of UChar_t
   UChar_t * fArray; //[fSize]
+  Int_t *fLatencyWindow; //[fSize]
 
-  ClassDef(AliTOFChannelOnlineStatusArray,1)    // TOF Sensor Online Calibration object
+  ClassDef(AliTOFChannelOnlineStatusArray,2)    // TOF Sensor Online Calibration object
 };
 
 #endif
index 2ad2a7d..0078c95 100644 (file)
@@ -87,7 +87,8 @@ AliTOFPreprocessor::AliTOFPreprocessor(AliShuttleInterface* shuttle) :
   fStoreRefData(kTRUE),
   fFDRFlag(kFALSE),
   fStatus(0),
-  fMatchingWindow(0)
+  fMatchingWindow(0),
+  fLatencyWindow(0)
 {
   // constructor
   AddRunType("PHYSICS");
@@ -1004,7 +1005,8 @@ UInt_t AliTOFPreprocessor::ProcessFEEData()
    * if there is no stored FEE in OCDB set update flag */
   
   fMatchingWindow = new Int_t[fNChannels];
-
+  fLatencyWindow = new Int_t[fNChannels];
+  
   AliCDBEntry *cdbEntry = GetFromOCDB("Calib","Status");
   if (!cdbEntry) {
          /* no CDB entry found. set update flag */
@@ -1027,6 +1029,7 @@ UInt_t AliTOFPreprocessor::ProcessFEEData()
           * if different set update flag and break loop */
          //AliDebug(2,Form( " channel %i status before FEE = %i",iChannel,(Int_t)fStatus->GetHWStatus(iChannel)));
          fMatchingWindow[iChannel] = feeReader.GetMatchingWindow(iChannel);
+         fLatencyWindow[iChannel] = feeReader.GetLatencyWindow(iChannel);
          if (feeReader.IsChannelEnabled(iChannel)) {
                  hCurrentFEE.SetBinContent(iChannel + 1, 1);
                  if (fStatus->GetHWStatus(iChannel)!=AliTOFChannelOnlineStatusArray::kTOFHWOk){
@@ -1034,6 +1037,11 @@ UInt_t AliTOFPreprocessor::ProcessFEEData()
                          fStatus->SetHWStatus(iChannel,AliTOFChannelOnlineStatusArray::kTOFHWOk);
                          AliDebug(3,Form( " changed into enabled: channel %i status after FEE = %i",iChannel,(Int_t)fStatus->GetHWStatus(iChannel)));
                  }
+                 if (fStatus->GetLatencyWindow(iChannel)!=fLatencyWindow[iChannel]){
+                         updateOCDB = kTRUE;
+                         fStatus->SetLatencyWindow(iChannel,fLatencyWindow[iChannel]);
+                         AliDebug(3,Form( " changed latency window: channel %i latency window after FEE = %i",iChannel,fStatus->GetLatencyWindow(iChannel)));
+                 }
          }
          else {
                  if (fStatus->GetHWStatus(iChannel)!=AliTOFChannelOnlineStatusArray::kTOFHWBad){
index 919a8cb..0e833d3 100644 (file)
@@ -58,6 +58,8 @@ class AliTOFPreprocessor : public AliPreprocessor
     AliTOFChannelOnlineStatusArray *fStatus; // Array with TOF channels' status
     Int_t *fMatchingWindow;                  //[fNChannels]
                                              // Array of matching windows (one per channel) - to be used in noise runs
+    Int_t *fLatencyWindow;                   //[fNChannels]
+                                             // Array of latency windows (one per channel)
     ClassDef(AliTOFPreprocessor, 0);         
 };
 #endif