]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Preprocessor related update (mainly from Jiri) to pick up TRU config info from DCS...
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Apr 2011 13:20:11 +0000 (13:20 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Apr 2011 13:20:11 +0000 (13:20 +0000)
EMCAL/AliEMCALPreprocessor.cxx
EMCAL/AliEMCALPreprocessor.h
EMCAL/AliEMCALTriggerTRUDCSConfig.cxx
EMCAL/AliEMCALTriggerTRUDCSConfig.h

index 4f7056292fadaa204b2c66b79745c18095427a5c..081ce1400c0c1d4af06817a988e09836a273bbb1 100644 (file)
 #include "AliShuttleInterface.h"
 #include "AliEMCALPreprocessor.h"
 #include "AliLog.h"
+#include "AliDCSValue.h"
 #include "AliCDBMetaData.h"
+#include "AliEMCALTriggerTRUDCSConfig.h"
+#include "AliEMCALTriggerDCSConfig.h"
 #include "AliCaloCalibPedestal.h"
 #include "AliCaloCalibSignal.h"
 #include "AliEMCALSensorTempArray.h"
@@ -57,6 +60,8 @@ const int kReturnCodeNoInfo = 9;
 const int kReturnCodeNoObject = 2;
 const int kReturnCodeNoEntries = 1;
 
+const int kNTRU = 30; // From 2011; 10 SuperModules (SM) * 3 TRU per SM
+
 ClassImp(AliEMCALPreprocessor)
   
 //_______________________________________________________________________________________
@@ -188,6 +193,15 @@ UInt_t AliEMCALPreprocessor::Process(TMap* dcsAliasMap)
     status = new TParameter<int>("tempResult",tempResult);
     resultArray->Add(status);
   }
+  // Trigger configuration processing
+  TString triggerConf = fConfEnv->GetValue("Trigger","ON");
+  triggerConf.ToUpper();
+  if (triggerConf != "OFF" && dcsAliasMap ) {
+    UInt_t triggerResult = MapTriggerConfig(dcsAliasMap);
+    result=triggerResult;
+    status = new TParameter<int>("triggerResult",triggerResult);
+    resultArray->Add(status);
+  }
   
   // Other calibration information will be retrieved through FXS files
   //  examples:
@@ -270,8 +284,7 @@ UInt_t AliEMCALPreprocessor::Process(TMap* dcsAliasMap)
 }
 //______________________________________________________________________________________________
 UInt_t AliEMCALPreprocessor::MapTemperature(TMap* dcsAliasMap)
-{
-  // extract DCS temperature maps. Perform fits to save space
+{ // extract DCS temperature maps. Perform fits to save space
   UInt_t result=0;
 
   TMap *map = fTemp->ExtractDCS(dcsAliasMap);
@@ -306,14 +319,102 @@ UInt_t AliEMCALPreprocessor::MapTemperature(TMap* dcsAliasMap)
   return result;
 }
 
+//______________________________________________________________________________________________
+UInt_t AliEMCALPreprocessor::MapTriggerConfig(TMap* dcsAliasMap)
+{ // extract DCS trigger info
+  Int_t i, iTRU;
+  char buf[100];
+
+  AliDCSValue *dcsVal;
+  TObjArray *arrL0ALGSEL, *arrPEAKFINDER, *arrGLOBALTHRESH, *arrCOSMTHRESH;
+  TObjArray *arrMASK[6];
+
+  // overall object to hold STU and DCS config info
+  // DS comment: for now only holds TRU info, i.e. only partially filled
+  // (STU info only in raw data header; unfortunately not also picked up via DCS DPs)
+  AliEMCALTriggerDCSConfig *trigConfig = new AliEMCALTriggerDCSConfig();
+
+  // loop through all TRUs
+  for( iTRU = 0; iTRU < kNTRU; iTRU++){
+
+    // get the shuttled values
+    sprintf( buf, "EMC_TRU%02d_L0ALGSEL", iTRU );
+    arrL0ALGSEL = (TObjArray*) dcsAliasMap->GetValue( buf );
+    sprintf( buf, "EMC_TRU%02d_PEAKFINDER", iTRU );
+    arrPEAKFINDER = (TObjArray*) dcsAliasMap->GetValue( buf );
+    sprintf( buf, "EMC_TRU%02d_GLOBALTHRESH", iTRU );
+    arrGLOBALTHRESH = (TObjArray*) dcsAliasMap->GetValue( buf );
+    sprintf( buf, "EMC_TRU%02d_COSMTHRESH", iTRU );
+    arrCOSMTHRESH = (TObjArray*) dcsAliasMap->GetValue( buf );
+    
+    for( i = 0; i < 6; i++ ){
+      sprintf( buf, "EMC_TRU%02d_MASK%d", iTRU, i );
+      arrMASK[i] = (TObjArray*) dcsAliasMap->GetValue( buf );
+    }
+    
+    // fill the objects
+    AliEMCALTriggerTRUDCSConfig* truConfig = trigConfig->GetTRUDCSConfig(iTRU);
+    
+    // get last entries. fill the TRU object
+    if( ! arrL0ALGSEL ){
+      AliWarning( Form("EMC DCS TRU%02d L0ALGSEL alias not found!\n", iTRU ));
+    }
+    else{
+      dcsVal = (AliDCSValue *) arrL0ALGSEL->At( arrL0ALGSEL->GetEntries() - 1 );
+      truConfig->SetL0SEL( dcsVal->GetUInt() );
+    }
+    if( ! arrPEAKFINDER ){
+      AliWarning( Form("EMC DCS TRU%02d PEAKFINDER alias not found!\n", iTRU ));
+    }
+    else{
+      dcsVal = (AliDCSValue *) arrPEAKFINDER->At( arrPEAKFINDER->GetEntries() - 1 );
+      truConfig->SetSELPF( dcsVal->GetUInt() );
+    }
+    if( ! arrGLOBALTHRESH ){
+      AliWarning( Form("EMC DCS TRU%02d GLOBALTHRESH alias not found!\n", iTRU ));
+    }
+    else{
+      dcsVal = (AliDCSValue *) arrGLOBALTHRESH->At( arrGLOBALTHRESH->GetEntries() - 1 );
+      truConfig->SetGTHRL0( dcsVal->GetUInt() );
+    }
+    if( ! arrCOSMTHRESH ){
+      AliWarning( Form("EMC DCS TRU%02d COSMTHRESH alias not found!\n", iTRU ));
+    }
+    else{
+      dcsVal = (AliDCSValue *) arrCOSMTHRESH->At( arrCOSMTHRESH->GetEntries() - 1 );
+      truConfig->SetL0COSM( dcsVal->GetUInt() );
+    }
+    
+    for( i = 0; i < 6; i++ ){
+      if( ! arrMASK[i] ){
+       AliWarning( Form("EMC DCS TRU%02d MASK%d alias not found!\n", iTRU, i ));
+      }
+      else{
+       dcsVal = (AliDCSValue *) arrMASK[i]->At( arrMASK[i]->GetEntries() - 1 );
+       truConfig->SetMaskReg( dcsVal->GetUInt(), i );
+      }
+    }
+    
+  } // TRUs
+  
+  // save the objects
+  AliCDBMetaData metaData;
+  metaData.SetBeamPeriod(0);
+  metaData.SetResponsible(kMetaResponsible);
+  metaData.SetComment(kMetaComment); 
+      
+  Bool_t retCode = Store("Calib", "LED", trigConfig, &metaData, 0, kFALSE);
+  return retCode;
+}
+
 //______________________________________________________________________________________________
 UInt_t AliEMCALPreprocessor::ExtractPedestals(Int_t sourceFXS)
 {
-  UInt_t result=0;
-  //
   //  Read pedestal file from file exchange server
   //  Only store if new pedestal info is available
   //
+  UInt_t result=0;
+
   AliCaloCalibPedestal *calibPed = new AliCaloCalibPedestal(AliCaloCalibPedestal::kEmCal);
   calibPed->Init();
 
@@ -377,12 +478,10 @@ UInt_t AliEMCALPreprocessor::ExtractPedestals(Int_t sourceFXS)
 
 //______________________________________________________________________________________________
 UInt_t AliEMCALPreprocessor::ExtractSignal(Int_t sourceFXS)
-{
-  UInt_t result=0;
-  //
-  //  Read signal file from file exchange server
+{ //  Read signal file from file exchange server
   //  Only store if new signal info is available
   //
+  UInt_t result=0;
   AliCaloCalibSignal *calibSig = new AliCaloCalibSignal(AliCaloCalibSignal::kEmCal); 
   
   TList* list = GetFileSources(sourceFXS,"signal");
index 888affe260f593ffff002d96d21e22d8d4822ea2..3fccb5a0a234239f4dd5c4efa5afabc8017732ef 100644 (file)
@@ -29,7 +29,8 @@ class AliEMCALPreprocessor : public AliPreprocessor {
   virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);//!
   virtual UInt_t Process(TMap* dcsAliasMap);//!
   UInt_t  MapTemperature(TMap* dcsAliasMap);//!
-  UInt_t  ExtractPedestals(Int_t sourceFXS);
+  UInt_t  MapTriggerConfig(TMap* dcsAliasMap);//!
+  UInt_t  ExtractPedestals(Int_t sourceFXS);//!
   UInt_t  ExtractSignal(Int_t sourceFXS);//!
 
  private:
index 46635b5039aa88c9203963c3a0910ff7d6738c14..ce57c0d7c8b39f9d93c4da3e44ad1894f4013425 100644 (file)
@@ -19,6 +19,7 @@
  
  
  Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
+ Author: Jiri Kral, JYU
 */
 
 #include "AliEMCALTriggerTRUDCSConfig.h"
@@ -35,7 +36,7 @@ AliEMCALTriggerTRUDCSConfig::AliEMCALTriggerTRUDCSConfig() : TObject()
        //
        // AliEMCALTriggerTRUDCSConfig default constructor
        //
-       for (Int_t i=0;i<5;i++) fMaskReg[i] = 0;
+       for (Int_t i=0;i<6;i++) fMaskReg[i] = 0;
 }
 
 
index e62079a3b3e48b62c1e612703bab31df385f39b4..bc696532d56c0e68d6759754d6586cf92d760046 100644 (file)
@@ -9,6 +9,7 @@
  
  
  Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
+ Author: Jiri Kral, JYU
 */
 
 #include "TObject.h"
@@ -20,17 +21,17 @@ public:
        AliEMCALTriggerTRUDCSConfig();
        virtual ~AliEMCALTriggerTRUDCSConfig() {}
 
-       void    SetSELPF( Int_t pf)              { fSELPF  = pf; }  
-       void    SetL0SEL( Int_t la)              { fL0SEL  = la; }  
-       void    SetL0COSM(Int_t lc)              { fL0COSM = lc; }
-       void    SetGTHRL0(Int_t lg)              { fGTHRL0 = lg; }
-       void    SetMaskReg(Int_t arr[], Int_t n) { for (Int_t i=0;i<n;i++) fMaskReg[i] = arr[i]; }
-
-       Int_t   GetSELPF()                       const { return fSELPF;  }
-       Int_t   GetL0SEL()                       const { return fL0SEL;  }
-       Int_t   GetL0COSM()                      const { return fL0COSM; }
-       Int_t   GetGTHRL0()                      const { return fGTHRL0; }
-       void    GetMaskReg(Int_t arr[], Int_t n) const { for (Int_t i=0;i<n;i++) arr[i] = fMaskReg[i]; }
+       void    SetSELPF( UInt_t pf)              { fSELPF  = pf; }  
+       void    SetL0SEL( UInt_t la)              { fL0SEL  = la; }  
+       void    SetL0COSM(UInt_t lc)              { fL0COSM = lc; }
+       void    SetGTHRL0(UInt_t lg)              { fGTHRL0 = lg; }
+       void    SetMaskReg(UInt_t msk, Int_t pos) { fMaskReg[pos] = msk; }
+
+       UInt_t   GetSELPF()                       const { return fSELPF;  }
+       UInt_t   GetL0SEL()                       const { return fL0SEL;  }
+       UInt_t   GetL0COSM()                      const { return fL0COSM; }
+       UInt_t   GetGTHRL0()                      const { return fGTHRL0; }
+       UInt_t   GetMaskReg(Int_t pos) const { return fMaskReg[pos]; }
        
 protected:
 
@@ -39,12 +40,12 @@ protected:
 
 private:
        
-       Int_t   fSELPF;                          // 
-       Int_t   fL0SEL;                          // 
-       Int_t   fL0COSM;                         // 
-       Int_t   fGTHRL0;                         // 
-       Int_t   fMaskReg[5];                     //
+       UInt_t   fSELPF;                         // PeakFinder setup
+       UInt_t   fL0SEL;                         // L0 Algo selection
+       UInt_t   fL0COSM;                        // 2x2
+       UInt_t   fGTHRL0;                        // 4x4
+       UInt_t   fMaskReg[6];                    // 6*16 = 96 mask bits per TRU
        
-       ClassDef(AliEMCALTriggerTRUDCSConfig,1)  //
+       ClassDef(AliEMCALTriggerTRUDCSConfig,2)  //
 };
 #endif