]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCPreprocessor.cxx
Correct memory leak in ExtractCE (double deletion of pressure sensors)
[u/mrichter/AliRoot.git] / TPC / AliTPCPreprocessor.cxx
index 11b2b025dc76a6d93c4ff447873c6c7b0b51081a..8e8df564ca4133045dd30d09bb629f440d2815b2 100644 (file)
@@ -49,6 +49,12 @@ const TString kDaqRunType = "DAQ"; // DAQ run identifier
 const TString kAmandaTemp = "TPC_PT_%d_TEMPERATURE"; // Amanda string for temperature entries
 //const Double_t kFitFraction = 0.7;                 // Fraction of DCS sensor fits required              
 const Double_t kFitFraction = -1.0;          // Don't require minimum number of fits in commissioning run 
+const Int_t   kNumPressureSensors = 3;    // number of pressure sensors
+const char* kPressureSensorNames[kNumPressureSensors] = {
+                   "CavernAtmosPressure",
+                   "CavernAtmosPressure2",
+                   "SurfaceAtmosPressure" };
+      
 
 //
 // This class is the SHUTTLE preprocessor for the TPC detector.
@@ -59,7 +65,8 @@ ClassImp(AliTPCPreprocessor)
 //______________________________________________________________________________________________
 AliTPCPreprocessor::AliTPCPreprocessor(AliShuttleInterface* shuttle) :
   AliPreprocessor("TPC",shuttle),
-  fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fGoofie(0), fConfigOK(kTRUE), fROC(0)
+  fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fGoofie(0),
+  fPressure(0), fConfigOK(kTRUE), fROC(0)
 {
   // constructor
   fROC = AliTPCROC::Instance();
@@ -77,7 +84,8 @@ AliTPCPreprocessor::AliTPCPreprocessor(AliShuttleInterface* shuttle) :
 //______________________________________________________________________________________________
  AliTPCPreprocessor::AliTPCPreprocessor(const AliTPCPreprocessor&  ) :
    AliPreprocessor("TPC",0),
-   fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fGoofie(0), fConfigOK(kTRUE), fROC(0)
+   fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fGoofie(0),
+   fPressure(0), fConfigOK(kTRUE), fROC(0)
  {
 
    Fatal("AliTPCPreprocessor", "copy constructor not implemented");
@@ -92,6 +100,9 @@ AliTPCPreprocessor::~AliTPCPreprocessor()
 
   delete fTemp;
   delete fHighVoltage;
+  delete fHighVoltageStat;
+  delete fGoofie;
+  delete fPressure;
 }
 //______________________________________________________________________________________________
 AliTPCPreprocessor& AliTPCPreprocessor::operator = (const AliTPCPreprocessor& )
@@ -105,12 +116,8 @@ AliTPCPreprocessor& AliTPCPreprocessor::operator = (const AliTPCPreprocessor& )
 void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
        UInt_t endTime)
 {
-  // Creates AliTestDataDCS object -- start maps half an hour beforre actual run start
 
-  UInt_t startTimeLocal = startTime-3600;
-  UInt_t endTimeLocal = endTime+1800;
-
-  AliPreprocessor::Initialize(run, startTimeLocal, endTimeLocal);
+  AliPreprocessor::Initialize(run, startTime, endTime);
 
        AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
                TTimeStamp((time_t)startTime,0).AsString(),
@@ -140,7 +147,7 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
           fConfigOK = kFALSE;
           return;
         }
-        fTemp = new AliTPCSensorTempArray(startTimeLocal, endTimeLocal, confTree, kAmandaTemp);
+        fTemp = new AliTPCSensorTempArray(startTime, endTime, confTree, kAmandaTemp);
        fTemp->SetValCut(kValCutTemp);
        fTemp->SetDiffCut(kDiffCutTemp);
        }
@@ -159,7 +166,10 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
            fConfigOK = kFALSE;
            return;
         }
-        fHighVoltage = new AliDCSSensorArray(startTimeLocal, endTimeLocal, confTree);
+        time_t timeStart = (time_t)(((TString)GetRunParameter("DAQ_time_start")).Atoi());
+       time_t timeEnd = (time_t)(((TString)GetRunParameter("DAQ_time_end")).Atoi());
+        fHighVoltage = new AliDCSSensorArray (UInt_t(timeStart), 
+                                           UInt_t(timeEnd), confTree);
       }
 
    // High voltage status values
@@ -176,7 +186,7 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
            fConfigOK = kFALSE;
            return;
         }
-        fHighVoltageStat = new AliDCSSensorArray(startTimeLocal, endTimeLocal, confTree);
+        fHighVoltageStat = new AliDCSSensorArray(startTime, endTime, confTree);
       }
 
    // Goofie values
@@ -193,10 +203,26 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
            fConfigOK = kFALSE;
            return;
         }
-        fGoofie = new AliDCSSensorArray(startTimeLocal, endTimeLocal, confTree);
+        fGoofie = new AliDCSSensorArray(startTime, endTime, confTree);
       }
 
-
+   // Pressure values
+     
+       TString runType = GetRunType();
+
+       if( runType == kPhysicsRunType || 
+        runType == kLaserRunType ) {    
+       TString pressureConf = fConfEnv->GetValue("Pressure","ON");
+       pressureConf.ToUpper();
+       if (pressureConf != "OFF" ) { 
+         TClonesArray * array = new TClonesArray("AliDCSSensor",kNumPressureSensors); 
+         for(Int_t j = 0; j < kNumPressureSensors; j++) {
+           AliDCSSensor * sens = new ((*array)[j])AliDCSSensor;
+           sens->SetStringID(kPressureSensorNames[j]);
+         }
+         fPressure = new AliDCSSensorArray(startTime, endTime, array);
+       }
+     }
 }
 
 //______________________________________________________________________________________________
@@ -215,56 +241,65 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
   TObject * status;
 
   UInt_t dcsResult=0;
-  if (errorHandling == "OFF" ) {
-    if (!dcsAliasMap) dcsResult=1;
-    if (dcsAliasMap->GetEntries() == 0 ) dcsResult=1;  
-    status = new TParameter<int>("dcsResult",dcsResult);
-    resultArray->Add(status);
-  } else {
-    if (!dcsAliasMap) return 9;
-    if (dcsAliasMap->GetEntries() == 0 ) return 9;
-  }
+  if (!dcsAliasMap) dcsResult=1;
+  if (dcsAliasMap->GetEntries() == 0 ) dcsResult=1;  
+  status = new TParameter<int>("dcsResult",dcsResult);
+  resultArray->Add(status);
 
 
-  
-
   TString runType = GetRunType();
 
+  if ( dcsResult == 0 ) {
+
   // Temperature sensors are processed by AliTPCCalTemp
 
-  TString tempConf = fConfEnv->GetValue("Temperature","ON");
-  tempConf.ToUpper();
-  if (tempConf != "OFF" ) {
-    UInt_t tempResult = MapTemperature(dcsAliasMap);
-    result=tempResult;
-    status = new TParameter<int>("tempResult",tempResult);
-    resultArray->Add(status);
-  }
+    TString tempConf = fConfEnv->GetValue("Temperature","ON");
+    tempConf.ToUpper();
+    if (tempConf != "OFF" ) {
+      UInt_t tempResult = MapTemperature(dcsAliasMap);
+      if ( tempConf != "TRY") result+=tempResult;
+      status = new TParameter<int>("tempResult",tempResult);
+      resultArray->Add(status);
+    }
 
   // High Voltage recordings
 
 
-  TString hvConf = fConfEnv->GetValue("HighVoltage","ON");
-  hvConf.ToUpper();
-  if (hvConf != "OFF" ) { 
-   UInt_t hvResult = MapHighVoltage(dcsAliasMap);
-   result+=hvResult;
-   status = new TParameter<int>("hvResult",hvResult);
-   resultArray->Add(status);
- }
+    TString hvConf = fConfEnv->GetValue("HighVoltage","ON");
+    hvConf.ToUpper();
+    if (hvConf != "OFF" ) { 
+     UInt_t hvResult = MapHighVoltage(dcsAliasMap);
+     if (hvConf != "TRY") result+=hvResult;
+     status = new TParameter<int>("hvResult",hvResult);
+     resultArray->Add(status);
   }
 
-  // Goofie values
+    // Goofie values
 
 
-  TString goofieConf = fConfEnv->GetValue("Goofie","ON");
-  goofieConf.ToUpper();
-  if (goofieConf != "OFF" ) { 
-   UInt_t goofieResult = MapGoofie(dcsAliasMap);
-   result+=goofieResult;
-   status = new TParameter<int>("goofieResult",goofieResult);
-   resultArray->Add(status);
- }
+    TString goofieConf = fConfEnv->GetValue("Goofie","ON");
+    goofieConf.ToUpper();
+    if (goofieConf != "OFF" ) { 
+     UInt_t goofieResult = MapGoofie(dcsAliasMap);
+     if (goofieConf != "TRY") result+=goofieResult;
+     status = new TParameter<int>("goofieResult",goofieResult);
+     resultArray->Add(status);
   }
 
+    // Pressure values
+
+    if( runType == kPhysicsRunType || 
+      runType == kLaserRunType ) {    
+
+      TString pressureConf = fConfEnv->GetValue("Pressure","ON");
+      pressureConf.ToUpper();
+      if (pressureConf != "OFF" ) { 
+       UInt_t pressureResult = MapPressure(dcsAliasMap);
+       status = new TParameter<int>("pressureResult",pressureResult);
+       resultArray->Add(status);
+      }
+    }
+  }
   // Other calibration information will be retrieved through FXS files
   //  examples:
   //    TList* fileSourcesDAQ = GetFile(AliShuttleInterface::kDAQ, "pedestals");
@@ -316,12 +351,13 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
         pulserSource[1] = AliShuttleInterface::kDAQ;
      }
      if (source == "DAQHLT" ) numSources=2;
+     if (source == "TRY" ) numSources=2;
      UInt_t pulserResult=0;
      for (Int_t i=0; i<numSources; i++ ) {     
        pulserResult = ExtractPulser(pulserSource[i]);
        if ( pulserResult == 0 ) break;
      }
-     result += pulserResult;
+     if (source != "TRY") result += pulserResult;
      status = new TParameter<int>("pulserResult",pulserResult);
      resultArray->Add(status);
     }
@@ -344,12 +380,13 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
         rawSource[1] = AliShuttleInterface::kDAQ;
      }
      if (source == "DAQHLT" ) numSources=2;
+     if (source == "TRY" ) numSources=2;
      UInt_t rawResult=0;
      for (Int_t i=0; i<numSources; i++ ) {     
        rawResult = ExtractRaw(rawSource[i]);
        if ( rawResult == 0 ) break;
      }
-     result += rawResult;
+     if (source != "TRY" )result += rawResult;
      status = new TParameter<int>("rawResult",rawResult);
      resultArray->Add(status);
     }
@@ -360,10 +397,10 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
 
 
   TString altroConf = fConfEnv->GetValue("AltroConf","ON");
-  goofieConf.ToUpper();
+  altroConf.ToUpper();
   if (altroConf != "OFF" ) { 
    UInt_t altroResult = ExtractAltro(AliShuttleInterface::kDCS);
-   result+=altroResult;
+   if (altroConf != "TRY" ) result+=altroResult;
    status = new TParameter<int>("altroResult",altroResult);
    resultArray->Add(status);
  }
@@ -387,6 +424,7 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
        ceSource[1] = AliShuttleInterface::kDAQ;
      }
      if (source == "DAQHLT" ) numSources=2;
+     if (source == "TRY" ) numSources=2;
      UInt_t ceResult=0;
      for (Int_t i=0; i<numSources; i++ ) {     
        ceResult = ExtractCE(ceSource[i]);
@@ -396,7 +434,7 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
    // only flag error if CE result is missing from LASER runs
    //    -- for PHYSICS run do CE processing if data available
    
-     if ( runType == kLaserRunType ) result += ceResult;
+     if ( runType == kLaserRunType && source != "TRY" ) result += ceResult;
      status = new TParameter<int>("ceResult",ceResult);
      resultArray->Add(status);
 
@@ -413,6 +451,7 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
        qaSource[1] = AliShuttleInterface::kDAQ;
      }
      if (source == "DAQHLT" ) numSources=2;
+     if (source == "TRY" ) numSources=2;
      UInt_t qaResult=0;
      for (Int_t i=0; i<numSources; i++ ) {     
        qaResult = ExtractQA(qaSource[i]);
@@ -426,18 +465,20 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
    }
   }
   
-  if (errorHandling == "OFF" ) {
-    AliCDBMetaData metaData;
-    metaData.SetBeamPeriod(0);
-    metaData.SetResponsible("Haavard Helstrup");
-    metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH);
-    metaData.SetComment("Preprocessor AliTPC status.");
-    Store("Calib", "PreprocStatus", resultArray, &metaData, 0, kFALSE);
-    resultArray->Delete();
-    return 0;
-  } else { 
-    return result;
-  }
+// Store component status to OCDB
+
+  AliCDBMetaData metaData;
+  metaData.SetBeamPeriod(0);
+  metaData.SetResponsible("Haavard Helstrup");
+  metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH);
+  metaData.SetComment("Preprocessor AliTPC status.");
+  Store("Calib", "PreprocStatus", resultArray, &metaData, 0, kFALSE);
+  resultArray->Delete();
+  delete resultArray;
+
+  if (errorHandling == "OFF" ) return 0;
+  return result;
+  
 }
 //______________________________________________________________________________________________
 UInt_t AliTPCPreprocessor::MapTemperature(TMap* dcsAliasMap)
@@ -478,6 +519,30 @@ UInt_t AliTPCPreprocessor::MapTemperature(TMap* dcsAliasMap)
    return result;
 
 }
+//______________________________________________________________________________________________
+UInt_t AliTPCPreprocessor::MapPressure(TMap* dcsAliasMap)
+{
+
+   // extract DCS pressure maps. Perform fits to save space
+
+  UInt_t result=0;
+  TMap *map = fPressure->ExtractDCS(dcsAliasMap);
+  if (map) {
+    fPressure->MakeSplineFit(map);
+    Double_t fitFraction = 1.0*fPressure->NumFits()/fPressure->NumSensors(); 
+    if (fitFraction > kFitFraction ) {
+      AliInfo(Form("Pressure values extracted, fits performed.\n"));
+    } else { 
+      Log ("Too few pressure maps fitted. \n");
+      result = 9;
+    }
+  } else {
+    Log("No pressure map extracted. \n");
+    result=9;
+  }
+  delete map;
+  return result;
+}
 
 //______________________________________________________________________________________________
 UInt_t AliTPCPreprocessor::MapHighVoltage(TMap* dcsAliasMap)
@@ -488,7 +553,7 @@ UInt_t AliTPCPreprocessor::MapHighVoltage(TMap* dcsAliasMap)
   UInt_t result=0;
   TMap *map = fHighVoltage->ExtractDCS(dcsAliasMap);
   if (map) {
-    fHighVoltage->MakeSplineFit(map);
+    fHighVoltage->MakeSplineFit(map, kTRUE);   // keep both spline fits and original maps
     Double_t fitFraction = 1.0*fHighVoltage->NumFits()/fHighVoltage->NumSensors(); 
     if (fitFraction > kFitFraction ) {
       AliInfo(Form("High voltage recordings extracted, fits performed.\n"));
@@ -659,10 +724,13 @@ UInt_t AliTPCPreprocessor::ExtractPedestals(Int_t sourceFXS)
      if ( !storeOK ) ++result;
     }
   } else {
-    Log ("Error: no entries in input file list!");
+    Log ("Error: no entries in pedestal file list!");
     result = 1;
   }
 
+  delete calPadPed;
+  delete calPadRMS;
+
   return result;
 }
 
@@ -763,9 +831,11 @@ UInt_t AliTPCPreprocessor::ExtractPulser(Int_t sourceFXS)
      if ( !storeOK ) ++result;
     }  
   } else {
-    Log ("Error: no entries in input file list!");
+    Log ("Error: no entries in pulser file list!");
     result = 1;
   }
+  pulserObjects->Delete();
+  delete pulserObjects;
 
   return result;
 }
@@ -808,7 +878,6 @@ UInt_t AliTPCPreprocessor::ExtractRaw(Int_t sourceFXS)
          break;
        }
        rawArray->Add(calRaw);
-       delete calRaw;
        f->Close();
       }
      ++index;
@@ -825,9 +894,12 @@ UInt_t AliTPCPreprocessor::ExtractRaw(Int_t sourceFXS)
      Bool_t storeOK = Store("Calib", "Raw", rawArray, &metaData, 0, kTRUE);
      if ( !storeOK ) ++result;
   } else {
-    Log ("Error: no entries in input file list!");
+    Log ("Error: no entries in raw file list!");
     result = 1;
   }
+  
+  rawArray->Delete();
+  delete rawArray;
 
   return result;
 }
@@ -866,7 +938,28 @@ UInt_t AliTPCPreprocessor::ExtractCE(Int_t sourceFXS)
  rocQtime = new TObjArray(nSectors);
  rocQtime->SetName("rocQtime");
  ceObjects->Add(rocQtime);
+
+// Temperature maps 
+
+ if (fTemp) {
+    AliTPCSensorTempArray *tempMap = new AliTPCSensorTempArray(*fTemp);
+    tempMap->SetNameTitle("TempMap","TempMap");
+    ceObjects->Add(tempMap);
+ }
+
+// Pressure maps
+
+ if (fPressure) {
+   AliDCSSensor *sensor=0, *sensorCopy=0;
+   for (Int_t isensor=0; isensor<kNumPressureSensors; ++isensor ) {
+      sensor = fPressure->GetSensor(kPressureSensorNames[isensor]);
+      if (sensor) {
+       sensorCopy = new AliDCSSensor(*sensor);
+       sensorCopy->SetNameTitle(kPressureSensorNames[isensor],kPressureSensorNames[isensor]);       
+       ceObjects->Add(sensorCopy);
+      }
+   }
+ }   
 
  UInt_t result=0;
 
@@ -908,7 +1001,7 @@ UInt_t AliTPCPreprocessor::ExtractCE(Int_t sourceFXS)
           TGraph *grT=calCE->MakeGraphTimeCE(sector,0,2); // T time graph
            if ( grT ) rocTtime->AddAt(grT,sector);         
           TGraph *grQ=calCE->MakeGraphTimeCE(sector,0,3); // Q time graph
-           if ( grQ ) rocTtime->AddAt(grQ,sector);         
+           if ( grQ ) rocQtime->AddAt(grQ,sector);         
         }
 
        TGraph *grT=calCE->MakeGraphTimeCE(-1,0,2); // A side average
@@ -935,10 +1028,13 @@ UInt_t AliTPCPreprocessor::ExtractCE(Int_t sourceFXS)
     if ( !storeOK ) ++result;
     
   } else {
-    Log ("Error: no entries!");
+    Log ("Error: no CE entries available from FXS!");
     result = 1;
   }
 
+  ceObjects->Delete();
+  delete ceObjects;
+  
   return result;
 }
 //______________________________________________________________________________________________
@@ -982,8 +1078,10 @@ UInt_t AliTPCPreprocessor::ExtractQA(Int_t sourceFXS)
           metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH);
            metaData.SetComment("Preprocessor AliTPC data base entries.");
 
-           Bool_t storeOK = Store("Calib", "QA", calQA, &metaData, 0, kTRUE);
+           Bool_t storeOK = Store("Calib", "QA", calQA, &metaData, 0, kFALSE);
            if ( !storeOK ) ++result;
+
+           delete calQA;
          }
         }
     } else {
@@ -1012,8 +1110,11 @@ UInt_t AliTPCPreprocessor::ExtractAltro(Int_t sourceFXS)
  AliTPCCalPad *acqStop=0;
  AliTPCCalPad *FPED=0;
  AliTPCCalPad *masked=0;
+ AliTPCCalPad *k1=0, *k2=0, *k3=0;
+ AliTPCCalPad *l1=0, *l2=0, *l3=0;
+ TMap *mapRCUconfig=0;
 
- AliCDBEntry* entry = GetFromOCDB("Calib", "Altro");
+ AliCDBEntry* entry = GetFromOCDB("Calib", "AltroConfig");
  if (entry) altroObjects = (TObjArray*)entry->GetObject();
  if ( altroObjects==NULL ) {
      Log("AliTPCPreprocsessor: No previous TPC altro calibration entry available.\n");
@@ -1045,7 +1146,42 @@ UInt_t AliTPCPreprocessor::ExtractAltro(Int_t sourceFXS)
     masked = new AliTPCCalPad("Masked","Masked");
     altroObjects->Add(masked);
  }
-
+ k1 = (AliTPCCalPad*)altroObjects->FindObject("K1");
+ if ( !k1 )  { 
+    k1 = new AliTPCCalPad("K1","K1");
+    altroObjects->Add(k1);
+ }
+ k2 = (AliTPCCalPad*)altroObjects->FindObject("K2");
+ if ( !k2 )  { 
+    k2 = new AliTPCCalPad("K2","K2");
+    altroObjects->Add(k2);
+ }
+ k3 = (AliTPCCalPad*)altroObjects->FindObject("K3");
+ if ( !k3 )  { 
+    k3 = new AliTPCCalPad("K3","K3");
+    altroObjects->Add(k3);
+ }
+ l1 = (AliTPCCalPad*)altroObjects->FindObject("L1");
+ if ( !l1 )  { 
+    l1 = new AliTPCCalPad("L1","L1");
+    altroObjects->Add(l1);
+ }
+ l2 = (AliTPCCalPad*)altroObjects->FindObject("L2");
+ if ( !l2 )  { 
+    l2 = new AliTPCCalPad("L2","L2");
+    altroObjects->Add(l2);
+ }
+ l3 = (AliTPCCalPad*)altroObjects->FindObject("L3");
+ if ( !l3 )  { 
+    l3 = new AliTPCCalPad("L3","L3");
+    altroObjects->Add(l3);
+ }
+ mapRCUconfig = (TMap*)altroObjects->FindObject("RCUconfig");
+ if (!mapRCUconfig) {
+    mapRCUconfig = new TMap();
+    mapRCUconfig->SetName("RCUconfig");
+    altroObjects->Add(mapRCUconfig);
+ }
 
 
  UInt_t result=0;
@@ -1089,7 +1225,15 @@ UInt_t AliTPCPreprocessor::ExtractAltro(Int_t sourceFXS)
         AliTPCCalPad *acqStopFXS=(AliTPCCalPad*)altroFXS->FindObject("AcqStop");
         AliTPCCalPad *FPEDFXS=(AliTPCCalPad*)altroFXS->FindObject("FPED");
         AliTPCCalPad *maskedFXS=(AliTPCCalPad*)altroFXS->FindObject("Masked");
-
+        AliTPCCalPad *k1FXS=(AliTPCCalPad*)altroFXS->FindObject("K1");
+        AliTPCCalPad *k2FXS=(AliTPCCalPad*)altroFXS->FindObject("K2");
+        AliTPCCalPad *k3FXS=(AliTPCCalPad*)altroFXS->FindObject("K3");
+        AliTPCCalPad *l1FXS=(AliTPCCalPad*)altroFXS->FindObject("L1");
+        AliTPCCalPad *l2FXS=(AliTPCCalPad*)altroFXS->FindObject("L2");
+        AliTPCCalPad *l3FXS=(AliTPCCalPad*)altroFXS->FindObject("L3");
+        TMap *mapRCUconfigFXS = (TMap*)altroFXS->FindObject("RCUconfig");
+        TIterator *mapFXSiter = mapRCUconfigFXS->MakeIterator();
+       
         changed=true;
         for (Int_t sector=0; sector<nSectors; sector++) {
             
@@ -1113,6 +1257,56 @@ UInt_t AliTPCPreprocessor::ExtractAltro(Int_t sourceFXS)
               AliTPCCalROC *rocMasked=maskedFXS->GetCalROC(sector);
               if ( rocMasked )  masked->SetCalROC(rocMasked,sector);
           }
+          if (k1FXS) {
+              AliTPCCalROC *rocK1=k1FXS->GetCalROC(sector);
+              if ( rocK1 )  k1->SetCalROC(rocK1,sector);
+          }
+          if (k2FXS) {
+              AliTPCCalROC *rocK2=k2FXS->GetCalROC(sector);
+              if ( rocK2 )  k2->SetCalROC(rocK2,sector);
+          }
+          if (k3FXS) {
+              AliTPCCalROC *rocK3=k3FXS->GetCalROC(sector);
+              if ( rocK3 )  k3->SetCalROC(rocK3,sector);
+          }
+          if (l1FXS) {
+              AliTPCCalROC *rocL1=l1FXS->GetCalROC(sector);
+              if ( rocL1 )  l1->SetCalROC(rocL1,sector);
+          }
+          if (l2FXS) {
+              AliTPCCalROC *rocL2=l2FXS->GetCalROC(sector);
+              if ( rocL2 )  l2->SetCalROC(rocL2,sector);
+          }
+          if (l3FXS) {
+              AliTPCCalROC *rocL3=l3FXS->GetCalROC(sector);
+              if ( rocL3 )  l3->SetCalROC(rocL3,sector);
+          }
+        }
+        if (mapRCUconfigFXS) {
+          Int_t mapEntries = mapRCUconfigFXS->GetEntries();
+          TObjString* keyFXS;
+         TVectorF* vecFXS;
+         TVectorF* vec;              // nSectors = 72  (total number of inner/outer sectors)
+         for (Int_t i=0; i<mapEntries; ++i) {
+           keyFXS=(TObjString*)mapFXSiter->Next();
+            vecFXS=(TVectorF*)mapRCUconfigFXS->GetValue(keyFXS);
+            vec=(TVectorF*)mapRCUconfig->GetValue(keyFXS);
+           if (!vec) {
+             vec = new TVectorF(3*nSectors);
+             *vec = -1;
+             mapRCUconfig->Add(keyFXS,vec);
+           }
+           if (vec->GetNoElements() != 3*nSectors ) {
+             vec->ResizeTo(3*nSectors);
+            }
+           if (id==0) {                        // A side
+             vec->SetSub(0,vecFXS->GetSub(0,nSectors/2-1));
+             vec->SetSub(nSectors,vecFXS->GetSub(nSectors,2*nSectors-1));
+           } else {                             // C side
+             vec->SetSub(nSectors/2,vecFXS->GetSub(nSectors/2,nSectors-1));
+             vec->SetSub(2*nSectors,vecFXS->GetSub(2*nSectors,3*nSectors-1));
+           }
+         }
         }
        delete altroFXS;
        f->Close();
@@ -1120,7 +1314,7 @@ UInt_t AliTPCPreprocessor::ExtractAltro(Int_t sourceFXS)
      ++index;
      }  // while(list)
     } else {
-      Log ("Error: no entries in input file list!");
+      Log ("Error: no entries in AltroConfig file list!");
       result = 1;
     }
 
@@ -1135,9 +1329,12 @@ UInt_t AliTPCPreprocessor::ExtractAltro(Int_t sourceFXS)
      metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH);
      metaData.SetComment("Preprocessor AliTPC data base entries.");
 
-     Bool_t storeOK = Store("Calib", "AltroConfig", altroObjects, &metaData, 0, kTRUE);
+     Bool_t storeOK = Store("Calib", "AltroConfig", altroObjects, &metaData, 0, kFALSE);
      if ( !storeOK ) ++result;
     }  
 
+  altroObjects->Delete();
+  delete altroObjects;
+  
   return result;
 }