]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCPreprocessor.cxx
Updates to include new run types CALIBRATION_PULSER and STANDALONE_PULSER
[u/mrichter/AliRoot.git] / TPC / AliTPCPreprocessor.cxx
index e96eff0469c287990778fb5bb255bffda14803a3..9691fea169d1dbae90c247804b0996fdafe8d0e6 100644 (file)
 const Int_t kValCutTemp = 100;               // discard temperatures > 100 degrees
 const Int_t kDiffCutTemp = 5;               // discard temperature differences > 5 degrees
 const TString kPedestalRunType = "PEDESTAL";  // pedestal run identifier
-const TString kPulserRunType = "PULSER";   // pulser run identifier
+const TString kPulserRunType = "CALIBRATION_PULSER";   // pulser run identifier
 const TString kPhysicsRunType = "PHYSICS";   // physics run identifier
 const TString kStandAloneRunType = "STANDALONE"; // standalone run identifier
+const TString kStandAlonePulserRunType = "STANDALONE_PULSER"; // standalone run identifier
 const TString kCosmicRunType = "COSMIC"; // cosmic run identifier
 const TString kLaserRunType = "LASER";   // laser run identifier
 const TString kDaqRunType = "DAQ"; // DAQ run identifier
-const TString kAmandaTemp = "tpc_PT_%d.Temperature"; // Amanda string for temperature entries
+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 
 
@@ -57,23 +58,33 @@ ClassImp(AliTPCPreprocessor)
 //______________________________________________________________________________________________
 AliTPCPreprocessor::AliTPCPreprocessor(AliShuttleInterface* shuttle) :
   AliPreprocessor("TPC",shuttle),
-  fConfEnv(0), fTemp(0), fHighVoltage(0), fConfigOK(kTRUE), fROC(0)
+  fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fConfigOK(kTRUE), fROC(0)
 {
   // constructor
   fROC = AliTPCROC::Instance();
+
+  // define run types to be processed
+  
+  AddRunType(kPedestalRunType);
+  AddRunType(kPulserRunType);
+  AddRunType(kPhysicsRunType);
+  AddRunType(kStandAloneRunType);
+  AddRunType(kStandAlonePulserRunType);
+  AddRunType(kCosmicRunType);
+  AddRunType(kLaserRunType);
+  AddRunType(kDaqRunType);
+  
 }
 //______________________________________________________________________________________________
-// AliTPCPreprocessor::AliTPCPreprocessor(const AliTPCPreprocessor& org) :
-//   AliPreprocessor(org),
-//   fConfEnv(0), fTemp(0), fHighVoltage(0), fConfigOK(kTRUE)
-// {
-//   // copy constructor not implemented
-//   //   -- missing underlying copy constructor in AliPreprocessor
-//
-//   Fatal("AliTPCPreprocessor", "copy constructor not implemented");
+ AliTPCPreprocessor::AliTPCPreprocessor(const AliTPCPreprocessor&  ) :
+   AliPreprocessor("TPC",0),
+   fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fConfigOK(kTRUE), fROC(0)
+ {
+
+   Fatal("AliTPCPreprocessor", "copy constructor not implemented");
 //
 // //  fTemp = new AliTPCSensorTempArray(*(org.fTemp));
-// }
+ }
 
 //______________________________________________________________________________________________
 AliTPCPreprocessor::~AliTPCPreprocessor()
@@ -102,8 +113,8 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
   AliPreprocessor::Initialize(run, startTimeLocal, endTime);
 
        AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
-               TTimeStamp(startTime).AsString(),
-               TTimeStamp(endTime).AsString()));
+               TTimeStamp((time_t)startTime,0).AsString(),
+               TTimeStamp((time_t)endTime,0).AsString()));
 
   // Preprocessor configuration
 
@@ -150,6 +161,23 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
         }
         fHighVoltage = new AliDCSSensorArray(startTimeLocal, fEndTime, confTree);
       }
+
+   // High voltage status values
+     
+      TString hvStatConf = fConfEnv->GetValue("HighVoltageStat","ON");
+      hvStatConf.ToUpper();
+      if (hvStatConf != "OFF" ) { 
+        confTree=0;
+        entry=0;
+        entry = GetFromOCDB("Config", "HighVoltageStat");
+        if (entry) confTree = (TTree*) entry->GetObject();
+        if ( confTree==0 ) {
+           Log("AliTPCPreprocsessor: High Voltage Status Config OCDB entry missing.\n");
+           fConfigOK = kFALSE;
+           return;
+        }
+        fHighVoltageStat = new AliDCSSensorArray(startTimeLocal, fEndTime, confTree);
+      }
 }
 
 //______________________________________________________________________________________________
@@ -232,7 +260,7 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
      if (source == "DAQHLT" ) numSources=2;
      UInt_t pedestalResult=0;
      for (Int_t i=0; i<numSources; i++ ) {     
-       UInt_t pedestalResult = ExtractPedestals(pedestalSource[i]);
+       pedestalResult = ExtractPedestals(pedestalSource[i]);
        if ( pedestalResult == 0 ) break;
      }
      result += pedestalResult;
@@ -272,10 +300,10 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
 
   // Central Electrode processing
 
-//  if( runType == kPhysicsRunType || runType == kStandAloneRunType || 
-//      runType == kDaqRunType ) {    
+  if( runType == kPhysicsRunType || runType == kStandAloneRunType || 
+      runType == kDaqRunType ) {    
 
-   if (true) {                 // do CE processing for all run types
+//   if (true) {                 // do CE processing for all run types
     Int_t numSources = 1;
     Int_t ceSource[2] = {AliShuttleInterface::kDAQ,AliShuttleInterface::kHLT} ;
     TString source = fConfEnv->GetValue("CE","DAQ");
@@ -373,6 +401,23 @@ UInt_t AliTPCPreprocessor::MapHighVoltage(TMap* dcsAliasMap)
     result=9;
   }
   delete map;
+
+  TString hvStatConf = fConfEnv->GetValue("HighVoltageStat","ON");
+  hvStatConf.ToUpper();
+  if (hvStatConf != "OFF" ) { 
+    TMap *map2 = fHighVoltageStat->ExtractDCS(dcsAliasMap);
+    if (map2) {
+      fHighVoltageStat->StoreGraph(map2);
+    } else {
+       Log("No high voltage status recordings extracted. \n");
+      result=9;
+    }
+    delete map2;
+
+    // add status maps to high voltage sensor array
+
+    fHighVoltage->AddSensors(fHighVoltageStat);
+   }
   // Now store the final CDB file
 
   if ( result == 0 ) {
@@ -455,6 +500,8 @@ UInt_t AliTPCPreprocessor::ExtractPedestals(Int_t sourceFXS)
            AliTPCCalROC *rocRMS=calPed->GetCalRocRMS(sector, kFALSE);
            if ( rocRMS )  calPadRMS->SetCalROC(rocRMS,sector);
         }
+        delete calPed; 
+        f->Close();
       }
      ++index;
     }  // while(list)
@@ -558,6 +605,8 @@ UInt_t AliTPCPreprocessor::ExtractPulser(Int_t sourceFXS)
            AliTPCCalROC *rocQmean=calPulser->GetCalRocQ(sector);
            if ( rocQmean )  pulserQmean->SetCalROC(rocQmean,sector);
         }
+       delete calPulser;
+       f->Close();
       }
      ++index;
     }  // while(list)
@@ -671,6 +720,8 @@ UInt_t AliTPCPreprocessor::ExtractCE(Int_t sourceFXS)
           TGraph *grQ=calCE->MakeGraphTimeCE(sector,0,3); // Q time graph
            if ( grQ ) rocTtime->AddAt(grQ,sector);         
         }
+       delete calCE;
+       f->Close();
       }
      ++index;
     }  // while(list)