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
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();
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");
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();
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<int>("gasResult",gasResult);
+ resultArray->Add(status);
+ }
+
// Pressure values
if( runType == kPhysicsRunType ||
}
+//______________________________________________________________________________________________
+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;
+
+}
+
//______________________________________________________________________________________________