From 41c979ea0a8a5b17d30ec032da2803fb65a33814 Mon Sep 17 00:00:00 2001 From: haavard Date: Fri, 14 Nov 2014 13:58:09 +0100 Subject: [PATCH 1/1] Updated TPC preprocessor to include gas composition entries --- TPC/Base/AliTPCPreprocessor.cxx | 77 ++++++++++++++++++++++++++++++++- TPC/Base/AliTPCPreprocessor.h | 2 + 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/TPC/Base/AliTPCPreprocessor.cxx b/TPC/Base/AliTPCPreprocessor.cxx index 9e873903d69..9c2cf0368e8 100644 --- a/TPC/Base/AliTPCPreprocessor.cxx +++ b/TPC/Base/AliTPCPreprocessor.cxx @@ -43,6 +43,9 @@ const Int_t kDiffCutTemp = 5; // discard temperature differences > const Double_t kHighVoltageDifference = 1e-4; // don't record High Voltage points // differing by less than 1e-4 from // previous point. +const Double_t kGasCompositionDifference = 1e-3; // don't record Gas Composition points + // differing by less than 1e-3 from + // previous point const TString kPedestalRunType = "PEDESTAL"; // pedestal run identifier const TString kPulserRunType = "PULSER"; // pulser run identifier const TString kPhysicsRunType = "PHYSICS"; // physics run identifier @@ -74,7 +77,7 @@ ClassImp(AliTPCPreprocessor) AliTPCPreprocessor::AliTPCPreprocessor(AliShuttleInterface* shuttle) : AliPreprocessor("TPC",shuttle), fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fGoofie(0), - fPressure(0), fConfigOK(kTRUE), fROC(0) + fPressure(0), fGasComposition(0), fConfigOK(kTRUE), fROC(0) { // constructor fROC = AliTPCROC::Instance(); @@ -93,7 +96,7 @@ AliTPCPreprocessor::AliTPCPreprocessor(AliShuttleInterface* shuttle) : AliTPCPreprocessor::AliTPCPreprocessor(const AliTPCPreprocessor& ) : AliPreprocessor("TPC",0), fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fGoofie(0), - fPressure(0), fConfigOK(kTRUE), fROC(0) + fPressure(0), fGasComposition(0), fConfigOK(kTRUE), fROC(0) { Fatal("AliTPCPreprocessor", "copy constructor not implemented"); @@ -214,6 +217,26 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime, fGoofie = new AliDCSSensorArray(startTime, endTime, confTree); } + + // Gas composition measurements + + TString gasConf = fConfEnv->GetValue("GasComposition","OFF"); + gasConf.ToUpper(); + if (gasConf != "OFF" ) { + confTree=0; + entry=0; + entry = GetFromOCDB("Config", "GasComposition"); + if (entry) confTree = (TTree*) entry->GetObject(); + if ( confTree==0 ) { + Log("AliTPCPreprocsessor: Gas Composition Config OCDB entry missing.\n"); + fConfigOK = kFALSE; + return; + } + time_t timeStart = (time_t)(((TString)GetRunParameter("DAQ_time_start")).Atoi()); + time_t timeEnd = (time_t)(((TString)GetRunParameter("DAQ_time_end")).Atoi()); + fGasComposition = new AliDCSSensorArray (UInt_t(timeStart), + UInt_t(timeEnd), confTree); + } // Pressure values TString runType = GetRunType(); @@ -297,6 +320,19 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap) resultArray->Add(status); } + + // Gas composition recordings + + + TString gasConf = fConfEnv->GetValue("GasComposition","ON"); + gasConf.ToUpper(); + if (gasConf != "OFF" ) { + UInt_t gasResult = MapGasComposition(dcsAliasMap); + if (gasConf != "TRY") result+=gasResult; + status = new TParameter("gasResult",gasResult); + resultArray->Add(status); + } + // Pressure values if( runType == kPhysicsRunType || @@ -647,6 +683,43 @@ UInt_t AliTPCPreprocessor::MapGoofie(TMap* dcsAliasMap) } +//______________________________________________________________________________________________ +UInt_t AliTPCPreprocessor::MapGasComposition(TMap* dcsAliasMap) +{ + + // extract DCS HV maps. Perform fits to save space + + UInt_t result=0; + TMap *map = fGasComposition->ExtractDCS(dcsAliasMap); + if (map) { + fHighVoltage->ClearFit(); + fHighVoltage->RemoveGraphDuplicates(kGasCompositionDifference); + // don't keep new point if too similar to previous one + fHighVoltage->SetGraph(map); + } else { + Log("No gas composition recordings extracted. \n"); + result=9; + } + delete map; + + // Now store the final CDB file + + if ( result == 0 ) { + AliCDBMetaData metaData; + metaData.SetBeamPeriod(0); + metaData.SetResponsible("Haavard Helstrup"); + metaData.SetAliRootVersion(ALIROOT_BRANCH); + metaData.SetComment("Preprocessor AliTPC data base entries."); + + Bool_t storeOK = Store("Calib", "GasComposition", fGasComposition, &metaData, 0, kFALSE); + if ( !storeOK ) result=1; + + } + + return result; + +} + //______________________________________________________________________________________________ diff --git a/TPC/Base/AliTPCPreprocessor.h b/TPC/Base/AliTPCPreprocessor.h index 12ea85771bb..0df9c032426 100644 --- a/TPC/Base/AliTPCPreprocessor.h +++ b/TPC/Base/AliTPCPreprocessor.h @@ -25,6 +25,7 @@ class AliTPCPreprocessor : public AliPreprocessor virtual UInt_t Process(TMap* dcsAliasMap); UInt_t MapTemperature(TMap* dcsAliasMap); UInt_t MapHighVoltage(TMap* dcsAliasMap); + UInt_t MapGasComposition(TMap* dcsAliasMap); UInt_t MapGoofie(TMap* dcsAliasMap); UInt_t MapPressure(TMap* dcsAliasMap); UInt_t ExtractPedestals(Int_t sourceFXS); @@ -42,6 +43,7 @@ class AliTPCPreprocessor : public AliPreprocessor AliDCSSensorArray *fHighVoltageStat; // DCS high voltage status AliDCSSensorArray *fGoofie; // Goofie values from DCS AliDCSSensorArray *fPressure; // Pressure values from DCS + AliDCSSensorArray *fGasComposition; // Gas composition values from DCS Bool_t fConfigOK; // Identify succesful reading of OCDB Config AliTPCROC *fROC; // TPC Read-Out configuration -- 2.43.0