X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCcalibDB.cxx;h=10320259f61026858acc79424059328163f295a4;hb=c64cb1f6cd31fa3ab76e0e1c702572a3bcc8528f;hp=bf348407fa506bdc436bbd092d087d25754b5555;hpb=817766d592506123e9d5f3ab7b72964a7d6d841c;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCcalibDB.cxx b/TPC/AliTPCcalibDB.cxx index bf348407fa5..10320259f61 100644 --- a/TPC/AliTPCcalibDB.cxx +++ b/TPC/AliTPCcalibDB.cxx @@ -48,7 +48,7 @@ // Simulation: applied in the AliTPC::MakeSector - adding offset // Reconstruction: AliTPCTransform::Transform() - remove offset // AliTPCTransform::Transform() - to be called -// in AliTPCtracker::Transform() +// in AliTPCtrackerMI::Transform() // // // 2.) Space points transformation: @@ -82,11 +82,14 @@ #include #include +#include #include #include #include +#include #include "AliTPCcalibDB.h" +#include "AliTPCdataQA.h" #include "AliTPCcalibDButil.h" #include "AliTPCAltroMapping.h" #include "AliTPCExB.h" @@ -96,6 +99,7 @@ #include "AliTPCSensorTempArray.h" #include "AliGRPObject.h" #include "AliTPCTransform.h" +#include "AliTPCmapper.h" class AliCDBStorage; class AliTPCCalDet; @@ -110,6 +114,7 @@ class AliTPCCalDet; #include "TObjString.h" #include "TString.h" #include "TDirectory.h" +#include "TArrayI.h" #include "AliTPCCalPad.h" #include "AliTPCCalibPulser.h" #include "AliTPCCalibPedestal.h" @@ -119,7 +124,8 @@ class AliTPCCalDet; #include "AliTPCCalibVdrift.h" #include "AliTPCCalibRaw.h" #include "AliTPCParam.h" - +#include "AliTPCCorrection.h" +#include "AliTPCComposedCorrection.h" #include "AliTPCPreprocessorOnline.h" @@ -135,7 +141,7 @@ AliTPCcalibDB* AliTPCcalibDB::Instance() { // // Singleton implementation - // Returns an instance of this class, it is created if neccessary + // Returns an instance of this class, it is created if necessary // if (fgTerminated != kFALSE) @@ -171,11 +177,16 @@ AliTPCcalibDB::AliTPCcalibDB(): fTransform(0), fExB(0), fPadGainFactor(0), + fActiveChannelMap(0), fDedxGainFactor(0), fPadTime0(0), + fDistortionMap(0), + fComposedCorrection(0), + fComposedCorrectionArray(0), fPadNoise(0), fPedestals(0), fCalibRaw(0), + fDataQA(0), fALTROConfigData(0), fPulserData(0), fCEData(0), @@ -184,22 +195,34 @@ AliTPCcalibDB::AliTPCcalibDB(): fParam(0), fClusterParam(0), fTimeGainSplines(0), - fTimeGainSplinesArray(100000), - fGRPArray(100000), //! array of GRPs - per run - JUST for calibration studies - fGRPMaps(100000), //! array of GRPs - per run - JUST for calibration studies - fGoofieArray(100000), //! array of GOOFIE values -per run - Just for calibration studies - fVoltageArray(100000), - fTemperatureArray(100000), //! array of temperature sensors - per run - Just for calibration studies - fVdriftArray(100000), //! array of v drift interfaces - fDriftCorrectionArray(100000), //! array of drift correction - fRunList(100000) //! run list - indicates try to get the run param - + fTimeGainSplinesArray(1), + fGRPArray(1), //! array of GRPs - per run - JUST for calibration studies + fGRPMaps(1), //! array of GRPs - per run - JUST for calibration studies + fGoofieArray(1), //! array of GOOFIE values -per run - Just for calibration studies + fVoltageArray(1), + fTemperatureArray(1), //! array of temperature sensors - per run - Just for calibration studies + fVdriftArray(1), //! array of v drift interfaces + fDriftCorrectionArray(1), //! array of drift correction + fRunList(1), //! run list - indicates try to get the run param + fBHasAlignmentOCDB(kFALSE), // Flag - has the alignment on the composed correction ? + fDButil(0), + fCTPTimeParams(0), + fMode(-1) { // // constructor // // + fgInstance=this; Update(); // temporary + fTimeGainSplinesArray.SetOwner(); //own the keys + fGRPArray.SetOwner(); //own the keys + fGRPMaps.SetOwner(); //own the keys + fGoofieArray.SetOwner(); //own the keys + fVoltageArray.SetOwner(); //own the keys + fTemperatureArray.SetOwner(); //own the keys + fVdriftArray.SetOwner(); //own the keys + fDriftCorrectionArray.SetOwner(); //own the keys } AliTPCcalibDB::AliTPCcalibDB(const AliTPCcalibDB& ): @@ -208,11 +231,16 @@ AliTPCcalibDB::AliTPCcalibDB(const AliTPCcalibDB& ): fTransform(0), fExB(0), fPadGainFactor(0), + fActiveChannelMap(0), fDedxGainFactor(0), fPadTime0(0), + fDistortionMap(0), + fComposedCorrection(0), + fComposedCorrectionArray(0), fPadNoise(0), fPedestals(0), fCalibRaw(0), + fDataQA(0), fALTROConfigData(0), fPulserData(0), fCEData(0), @@ -221,20 +249,32 @@ AliTPCcalibDB::AliTPCcalibDB(const AliTPCcalibDB& ): fParam(0), fClusterParam(0), fTimeGainSplines(0), - fTimeGainSplinesArray(100000), + fTimeGainSplinesArray(1), fGRPArray(0), //! array of GRPs - per run - JUST for calibration studies fGRPMaps(0), //! array of GRPs - per run - JUST for calibration studies fGoofieArray(0), //! array of GOOFIE values -per run - Just for calibration studies fVoltageArray(0), fTemperatureArray(0), //! array of temperature sensors - per run - Just for calibration studies fVdriftArray(0), //! array of v drift interfaces - fDriftCorrectionArray(0), //! array of v drift interfaces - fRunList(0) //! run list - indicates try to get the run param + fDriftCorrectionArray(0), //! array of v drift corrections + fRunList(0), //! run list - indicates try to get the run param + fBHasAlignmentOCDB(kFALSE), // Flag - has the alignment on the composed correction ? + fDButil(0), + fCTPTimeParams(0), + fMode(-1) { // // Copy constructor invalid -- singleton implementation // Error("copy constructor","invalid -- singleton implementation"); + fTimeGainSplinesArray.SetOwner(); //own the keys + fGRPArray.SetOwner(); //own the keys + fGRPMaps.SetOwner(); //own the keys + fGoofieArray.SetOwner(); //own the keys + fVoltageArray.SetOwner(); //own the keys + fTemperatureArray.SetOwner(); //own the keys + fVdriftArray.SetOwner(); //own the keys + fDriftCorrectionArray.SetOwner(); //own the keys } AliTPCcalibDB& AliTPCcalibDB::operator= (const AliTPCcalibDB& ) @@ -255,12 +295,14 @@ AliTPCcalibDB::~AliTPCcalibDB() // destructor // - // don't delete anything, CDB cache is active! - //if (fPadGainFactor) delete fPadGainFactor; - //if (fPadTime0) delete fPadTime0; - //if (fPadNoise) delete fPadNoise; + delete fActiveChannelMap; +} +AliTPCCalPad* AliTPCcalibDB::GetDistortionMap(Int_t i) const { + // + // get distortion map - due E field distortions + // + return (fDistortionMap) ? (AliTPCCalPad*)fDistortionMap->At(i):0; } - //_____________________________________________________________________________ AliCDBEntry* AliTPCcalibDB::GetCDBEntry(const char* cdbPath) @@ -273,7 +315,7 @@ AliCDBEntry* AliTPCcalibDB::GetCDBEntry(const char* cdbPath) AliCDBEntry* entry = AliCDBManager::Instance()->Get(cdbPath, fRun); if (!entry) { - sprintf(chinfo,"AliTPCcalibDB: Failed to get entry:\t%s ", cdbPath); + snprintf(chinfo,1000,"AliTPCcalibDB: Failed to get entry:\t%s ", cdbPath); AliError(chinfo); return 0; } @@ -296,17 +338,23 @@ void AliTPCcalibDB::SetRun(Long64_t run) void AliTPCcalibDB::Update(){ - // + // + // cache the OCDB entries for simulation, reconstruction, calibration + // + // AliCDBEntry * entry=0; Bool_t cdbCache = AliCDBManager::Instance()->GetCacheFlag(); // save cache status AliCDBManager::Instance()->SetCacheFlag(kTRUE); // activate CDB cache - + fDButil = new AliTPCcalibDButil; // + entry = GetCDBEntry("TPC/Calib/PadGainFactor"); if (entry){ //if (fPadGainFactor) delete fPadGainFactor; entry->SetOwner(kTRUE); fPadGainFactor = (AliTPCCalPad*)entry->GetObject(); + }else{ + AliFatal("TPC - Missing calibration entry TPC/Calib/PadGainFactor"); } // entry = GetCDBEntry("TPC/Calib/TimeGain"); @@ -314,12 +362,16 @@ void AliTPCcalibDB::Update(){ //if (fTimeGainSplines) delete fTimeGainSplines; entry->SetOwner(kTRUE); fTimeGainSplines = (TObjArray*)entry->GetObject(); + }else{ + AliFatal("TPC - Missing calibration entry TPC/Calib/Timegain"); } // entry = GetCDBEntry("TPC/Calib/GainFactorDedx"); if (entry){ entry->SetOwner(kTRUE); fDedxGainFactor = (AliTPCCalPad*)entry->GetObject(); + }else{ + AliFatal("TPC - Missing calibration entry TPC/Calib/gainFactordEdx"); } // entry = GetCDBEntry("TPC/Calib/PadTime0"); @@ -327,7 +379,20 @@ void AliTPCcalibDB::Update(){ //if (fPadTime0) delete fPadTime0; entry->SetOwner(kTRUE); fPadTime0 = (AliTPCCalPad*)entry->GetObject(); + }else{ + AliFatal("TPC - Missing calibration entry"); + } + + entry = GetCDBEntry("TPC/Calib/Distortion"); + if (entry){ + //if (fPadTime0) delete fPadTime0; + entry->SetOwner(kTRUE); + fDistortionMap =dynamic_cast(entry->GetObject()); + }else{ + //AliFatal("TPC - Missing calibration entry") } + + // // entry = GetCDBEntry("TPC/Calib/PadNoise"); @@ -335,6 +400,8 @@ void AliTPCcalibDB::Update(){ //if (fPadNoise) delete fPadNoise; entry->SetOwner(kTRUE); fPadNoise = (AliTPCCalPad*)entry->GetObject(); + }else{ + AliFatal("TPC - Missing calibration entry"); } entry = GetCDBEntry("TPC/Calib/Pedestals"); @@ -355,13 +422,17 @@ void AliTPCcalibDB::Update(){ if (entry){ //if (fPadNoise) delete fPadNoise; entry->SetOwner(kTRUE); - fParam = (AliTPCParam*)(entry->GetObject()->Clone()); + fParam = (AliTPCParam*)(entry->GetObject()); + }else{ + AliFatal("TPC - Missing calibration entry TPC/Calib/Parameters"); } entry = GetCDBEntry("TPC/Calib/ClusterParam"); if (entry){ entry->SetOwner(kTRUE); - fClusterParam = (AliTPCClusterParam*)(entry->GetObject()->Clone()); + fClusterParam = (AliTPCClusterParam*)(entry->GetObject()); + }else{ + AliFatal("TPC - Missing calibration entry"); } //ALTRO configuration data @@ -369,6 +440,8 @@ void AliTPCcalibDB::Update(){ if (entry){ entry->SetOwner(kTRUE); fALTROConfigData=(TObjArray*)(entry->GetObject()); + }else{ + AliFatal("TPC - Missing calibration entry"); } //Calibration Pulser data @@ -385,13 +458,8 @@ void AliTPCcalibDB::Update(){ fCEData=(TObjArray*)(entry->GetObject()); } //RAW calibration data - entry = GetCDBEntry("TPC/Calib/Raw"); - if (entry){ - entry->SetOwner(kTRUE); - TObjArray *arr=(TObjArray*)(entry->GetObject()); - if (arr) fCalibRaw=(AliTPCCalibRaw*)arr->At(0); - } - + // entry = GetCDBEntry("TPC/Calib/Raw"); + entry = GetCDBEntry("TPC/Calib/Mapping"); if (entry){ //if (fPadNoise) delete fPadNoise; @@ -405,27 +473,81 @@ void AliTPCcalibDB::Update(){ } } - - - //entry = GetCDBEntry("TPC/Calib/ExB"); - //if (entry) { - // entry->SetOwner(kTRUE); - // fExB=dynamic_cast(entry->GetObject()->Clone()); - //} + //CTP calibration data + entry = GetCDBEntry("GRP/CTP/CTPtiming"); + if (entry){ + //entry->SetOwner(kTRUE); + fCTPTimeParams=dynamic_cast(entry->GetObject()); + }else{ + AliError("TPC - Missing calibration entry"); + } + //TPC space point correction data + entry = GetCDBEntry("TPC/Calib/Correction"); + if (entry){ + //entry->SetOwner(kTRUE); + fComposedCorrection=dynamic_cast(entry->GetObject()); + if (fComposedCorrection) fComposedCorrection->Init(); + fComposedCorrectionArray=dynamic_cast(entry->GetObject()); + if (fComposedCorrectionArray){ + for (Int_t i=0; iGetEntries(); i++){ + AliTPCComposedCorrection* composedCorrection= dynamic_cast(fComposedCorrectionArray->At(i)); + if (composedCorrection) { + composedCorrection->Init(); + if (composedCorrection->GetCorrections()){ + if (composedCorrection->GetCorrections()->FindObject("FitAlignTPC")){ + fBHasAlignmentOCDB=kTRUE; + } + } + } + } + } + }else{ + AliError("TPC - Missing calibration entry- TPC/Calib/Correction"); + } + //RCU trigger config mode + fMode=GetRCUTriggerConfig(); // - // ExB - calculate during initialization - in simulation /reconstruction - // - not invoked here anymore - //fExB = GetExB(-5,kTRUE); - // if (!fTransform) { fTransform=new AliTPCTransform(); fTransform->SetCurrentRun(AliCDBManager::Instance()->GetRun()); } + // Create Dead Channel Map + InitDeadMap(); + // AliCDBManager::Instance()->SetCacheFlag(cdbCache); // reset original CDB cache } +void AliTPCcalibDB::UpdateNonRec(){ + // + // Update/Load the parameters which are important for QA studies + // and not used yet for the reconstruction + // + //RAW calibration data + AliCDBEntry * entry=0; + entry = GetCDBEntry("TPC/Calib/Raw"); + if (entry){ + entry->SetOwner(kTRUE); + TObjArray *arr=(TObjArray*)(entry->GetObject()); + if (arr) fCalibRaw=(AliTPCCalibRaw*)arr->At(0); + } + //QA calibration data + entry = GetCDBEntry("TPC/Calib/QA"); + if (entry){ + entry->SetOwner(kTRUE); + fDataQA=dynamic_cast(entry->GetObject()); + } + // High voltage + if (fRun>=0 && !fVoltageArray.GetValue(Form("%i",fRun))){ + entry = AliCDBManager::Instance()->Get("TPC/Calib/HighVoltage",fRun); + if (entry) { + fVoltageArray.Add(new TObjString(Form("%i",fRun)),entry->GetObject()); + } + } + +} + void AliTPCcalibDB::CreateObjectList(const Char_t *filename, TObjArray *calibObjects) @@ -520,7 +642,153 @@ void AliTPCcalibDB::CreateObjectList(const Char_t *filename, TObjArray *calibObj } } +Int_t AliTPCcalibDB::InitDeadMap() { + // Initialize DeadChannel Map + // Source of information: + // - HV < HVnominal -delta + // - Altro disabled channels. Noisy channels. + // - DDL list + + // check necessary information + Int_t run=AliCDBManager::Instance()->GetRun(); + if (run<0){ + AliError("run not set in CDB manager. Cannot create active channel map"); + return 0; + } + AliDCSSensorArray* voltageArray = AliTPCcalibDB::Instance()->GetVoltageSensors(run); + AliTPCCalPad* altroMap = GetALTROMasked(); + TMap* mapddl = GetDDLMap(); + + if (!voltageArray && !altroMap && !mapddl) { + AliError("All necessary information to create the activate channel are map missing."); + return 0; + } + + if (!fActiveChannelMap) fActiveChannelMap=new AliTPCCalPad("ActiveChannelMap","ActiveChannelMap"); + + //============================================================= + //get map of bad ROCs from VOLTAGE deviations + // + Bool_t badVoltage[AliTPCCalPad::kNsec]={kFALSE}; + Double_t maxVdiff=100.; + + if (voltageArray){ + //1. get median of median of all chambers + Double_t chamberMedian[AliTPCCalPad::kNsec]={0.}; + for (Int_t iROC=0;iROCGetSensor(sensorName); + if (!sensor) continue; + + chamberMedian[iROC]=0; + TGraph *gr=sensor->GetGraph(); + AliSplineFit *fit=sensor->GetFit(); + if ( gr && gr->GetN()>0 ){ + chamberMedian[iROC]=TMath::Median(gr->GetN(),gr->GetY()); + } else if (fit && fit->GetKnots()>0) { + chamberMedian[iROC]=TMath::Median(fit->GetKnots(), fit->GetY0()); + } + } + Double_t medianIROC=TMath::Median( 36, chamberMedian ); + Double_t medianOROC=TMath::Median( 36, chamberMedian+36 ); + + //2. check if 90% of the knots (points) are out of a given threshold + for (Int_t iROC=0;iROCGetSensor(sensorName); + if (!sensor) continue; + + chamberMedian[iROC]=0; + TGraph *gr=sensor->GetGraph(); + AliSplineFit *fit=sensor->GetFit(); + Int_t nmax=1; + Int_t nout=0; + if ( gr && gr->GetN()>0 ){ + nmax=gr->GetN(); + for (Int_t i=0; iGetN(); ++i) + if ( TMath::Abs( gr->GetY()[i]-median ) > maxVdiff ) ++nout; + } else if (fit && fit->GetKnots()>0) { + nmax=fit->GetKnots(); + for (Int_t i=0; iGetKnots(); ++i) + if ( TMath::Abs( fit->GetY0()[i]-median ) > maxVdiff ) ++nout; + } + if ( (Double_t)nout/(Double_t)nmax > 0.9 ) badVoltage[iROC]=kTRUE; + // printf("%d, %d, %d, %f\n",iROC, nout, nmax, median); + } + + } else { + AliError("Voltage Array missing. ActiveChannelMap can only be created with parts of the information."); + } + // Voltage map is done + //============================================================= + //============================================================= + // Setup DDL map + + Bool_t ddlMap[216]={0}; + for (Int_t iddl=0; iddl<216; ++iddl) ddlMap[iddl]=1; + if (mapddl){ + TObjString *s = (TObjString*)mapddl->GetValue("DDLArray"); + if (s){ + for (Int_t iddl=0; iddl<216; ++iddl) ddlMap[iddl]=TString(s->GetString()(iddl))!="0"; + } + } else { + AliError("DDL map missing. ActiveChannelMap can only be created with parts of the information."); + } + // Setup DDL map done + // ============================================================ + + //============================================================= + // Setup active chnnel map + // + + AliTPCmapper map(gSystem->ExpandPathName("$ALICE_ROOT/TPC/mapping/")); + + if (!altroMap) AliError("ALTRO dead channel map missing. ActiveChannelMap can only be created with parts of the information."); + + for (Int_t iROC=0;iROCGetCalROC(iROC); + if (!roc){ + AliError(Form("No ROC %d in active channel map",iROC)); + continue; + } + + // check for bad voltage + if (badVoltage[iROC]){ + roc->Multiply(0.); + continue; + } + + AliTPCCalROC *masked=0x0; + if (altroMap) masked=altroMap->GetCalROC(iROC); + + for (UInt_t irow=0; irowGetNrows(); ++irow){ + for (UInt_t ipad=0; ipadGetNPads(irow); ++ipad){ + //per default the channel is on + roc->SetValue(irow,ipad,1); + // apply altro dead channel mask (inverse logik, it is not active, but inactive channles) + if (masked && masked->GetValue(irow, ipad)) roc->SetValue(irow, ipad ,0); + // mask channels if a DDL is inactive + Int_t ddlId=map.GetEquipmentID(iROC, irow, ipad)-768; + if (ddlId>=0 && !ddlMap[ddlId]) roc->SetValue(irow, ipad ,0); + } + } + } + + return 1; +} void AliTPCcalibDB::MakeTree(const char * fileName, TObjArray * array, const char * mapFileName, AliTPCCalPad* outlierPad, Float_t ltmFraction) { // @@ -730,7 +998,42 @@ void AliTPCcalibDB::MakeTree(const char * fileName, TObjArray * array, const cha } } +Int_t AliTPCcalibDB::GetRCUTriggerConfig() const +{ + // + // return the RCU trigger configuration register + // + TMap *map=GetRCUconfig(); + if (!map) return -1; + TVectorF *v=(TVectorF*)map->GetValue("TRGCONF_TRG_MODE"); + Float_t mode=-1; + for (Int_t i=0; iGetNrows(); ++i){ + Float_t newmode=v->GetMatrixArray()[i]; + if (newmode>-1){ + if (mode>-1&&newmode!=mode) AliWarning("Found different RCU trigger configurations!!!"); + mode=newmode; + } + } + return (Int_t)mode; +} +Bool_t AliTPCcalibDB::IsTrgL0() +{ + // + // return if the FEE readout was triggered on L0 + // + if (fMode<0) return kFALSE; + return (fMode==1); +} + +Bool_t AliTPCcalibDB::IsTrgL1() +{ + // + // return if the FEE readout was triggered on L1 + // + if (fMode<0) return kFALSE; + return (fMode==0); +} void AliTPCcalibDB::RegisterExB(Int_t index, Float_t bz, Bool_t bdelete){ // @@ -788,25 +1091,28 @@ void AliTPCcalibDB::SetExBField(const AliMagF* bmap){ - - void AliTPCcalibDB::UpdateRunInformations( Int_t run, Bool_t force){ // // - > Don't use it for reconstruction - Only for Calibration studies // + if (run<=0) return; + TObjString runstr(Form("%i",run)); + fRun=run; AliCDBEntry * entry = 0; - if (run>= fRunList.GetSize()){ + if (run>= fRunList.fN){ fRunList.Set(run*2+1); - fGRPArray.Expand(run*2+1); - fGRPMaps.Expand(run*2+1); - fGoofieArray.Expand(run*2+1); - fVoltageArray.Expand(run*2+1); - fTemperatureArray.Expand(run*2+1); - fVdriftArray.Expand(run*2+1); - fDriftCorrectionArray.Expand(run*2+1); - fTimeGainSplinesArray.Expand(run*2+1); + // + // + fALTROConfigData->Expand(run*2+1); // ALTRO configuration data + fPulserData->Expand(run*2+1); // Calibration Pulser data + fCEData->Expand(run*2+1); // CE data + if (!fTimeGainSplines) fTimeGainSplines = new TObjArray(run*2+1); + fTimeGainSplines->Expand(run*2+1); // Array of AliSplineFits: at 0 MIP position in } if (fRunList[run]>0 &&force==kFALSE) return; + + fRunList[run]=1; // sign as used + // entry = AliCDBManager::Instance()->Get("GRP/GRP/Data",run); if (entry) { @@ -818,48 +1124,84 @@ void AliTPCcalibDB::UpdateRunInformations( Int_t run, Bool_t force){ //grpRun->ReadValuesFromMap(map); grpRun = MakeGRPObjectFromMap(map); - fGRPMaps.AddAt(map,run); + fGRPMaps.Add(new TObjString(runstr),map); } } - fGRPArray.AddAt(grpRun,run); + fGRPArray.Add(new TObjString(runstr),grpRun); } entry = AliCDBManager::Instance()->Get("TPC/Calib/Goofie",run); if (entry){ - fGoofieArray.AddAt(entry->GetObject(),run); + fGoofieArray.Add(new TObjString(runstr),entry->GetObject()); } // - entry = AliCDBManager::Instance()->Get("TPC/Calib/HighVoltage",run); - if (entry) { - fVoltageArray.AddAt(entry->GetObject(),run); - } + // entry = AliCDBManager::Instance()->Get("TPC/Calib/TimeGain",run); if (entry) { - fTimeGainSplinesArray.AddAt(entry->GetObject(),run); + fTimeGainSplinesArray.Add(new TObjString(runstr),entry->GetObject()); + }else{ + AliFatal("TPC - Missing calibration entry TimeGain"); } // entry = AliCDBManager::Instance()->Get("TPC/Calib/TimeDrift",run); if (entry) { - fDriftCorrectionArray.AddAt(entry->GetObject(),run); + TObjArray * timeArray = (TObjArray*)entry->GetObject(); + fDriftCorrectionArray.Add(new TObjString(runstr),entry->GetObject()); + AliTPCCorrection * correctionTime = (AliTPCCorrection *)timeArray->FindObject("FitCorrectionTime"); + if (correctionTime && fComposedCorrectionArray){ + correctionTime->Init(); + if (fComposedCorrectionArray->GetEntriesFast()<4) fComposedCorrectionArray->Expand(40); + fComposedCorrectionArray->AddAt(correctionTime,4); //add time dependent correction to the list of available corrections + } + }else{ + AliFatal("TPC - Missing calibration entry TimeDrift"); } // entry = AliCDBManager::Instance()->Get("TPC/Calib/Temperature",run); if (entry) { - fTemperatureArray.AddAt(entry->GetObject(),run); + fTemperatureArray.Add(new TObjString(runstr),entry->GetObject()); + } + + // High voltage + entry = AliCDBManager::Instance()->Get("TPC/Calib/HighVoltage",run); + if (!fVoltageArray.GetValue(runstr.GetName()) && entry) { + fVoltageArray.Add(new TObjString(runstr),entry->GetObject()); } - fRunList[run]=1; // sign as used + + //apply fDButil filters + + fDButil->UpdateFromCalibDB(); + if (fTemperature) fDButil->FilterTemperature(fTemperature); AliDCSSensor * press = GetPressureSensor(run,0); AliTPCSensorTempArray * temp = GetTemperatureSensor(run); - if (press && temp){ + Bool_t accept=kTRUE; + if (temp) { + accept = fDButil->FilterTemperature(temp)>0.1; + } + if (press) { + const Double_t kMinP=900.; + const Double_t kMaxP=1050.; + const Double_t kMaxdP=10.; + const Double_t kSigmaCut=4.; + fDButil->FilterSensor(press,kMinP,kMaxP,kMaxdP,kSigmaCut); + if (press->GetFit()==0) accept=kFALSE; + } + + if (press && temp &&accept){ AliTPCCalibVdrift * vdrift = new AliTPCCalibVdrift(temp, press,0); - fVdriftArray.AddAt(vdrift,run); + fVdriftArray.Add(new TObjString(runstr),vdrift); } + + fDButil->FilterCE(120., 3., 4.,0); + fDButil->FilterTracks(run, 10.,0); + } Float_t AliTPCcalibDB::GetGain(Int_t sector, Int_t row, Int_t pad){ // + // Get Gain factor for given pad // AliTPCCalPad *calPad = Instance()->fDedxGainFactor;; if (!calPad) return 0; @@ -868,7 +1210,7 @@ Float_t AliTPCcalibDB::GetGain(Int_t sector, Int_t row, Int_t pad){ AliSplineFit* AliTPCcalibDB::GetVdriftSplineFit(const char* name, Int_t run){ // - // + // GetDrift velocity spline fit // TObjArray *arr=GetTimeVdriftSplineRun(run); if (!arr) return 0; @@ -895,10 +1237,10 @@ AliGRPObject *AliTPCcalibDB::GetGRP(Int_t run){ // // Get GRP object for given run // - AliGRPObject * grpRun = dynamic_cast((Instance()->fGRPArray).At(run)); + AliGRPObject * grpRun = dynamic_cast((Instance()->fGRPArray).GetValue(Form("%i",run))); if (!grpRun) { Instance()->UpdateRunInformations(run); - grpRun = dynamic_cast(Instance()->fGRPArray.At(run)); + grpRun = dynamic_cast(Instance()->fGRPArray.GetValue(Form("%i",run))); if (!grpRun) return 0; } return grpRun; @@ -906,12 +1248,12 @@ AliGRPObject *AliTPCcalibDB::GetGRP(Int_t run){ TMap * AliTPCcalibDB::GetGRPMap(Int_t run){ // + // Get GRP map for given run // - // - TMap * grpRun = dynamic_cast((Instance()->fGRPMaps).At(run)); + TMap * grpRun = dynamic_cast((Instance()->fGRPMaps).GetValue(Form("%i",run))); if (!grpRun) { Instance()->UpdateRunInformations(run); - grpRun = dynamic_cast(Instance()->fGRPMaps.At(run)); + grpRun = dynamic_cast(Instance()->fGRPMaps.GetValue(Form("%i",run))); if (!grpRun) return 0; } return grpRun; @@ -940,10 +1282,10 @@ AliDCSSensor * AliTPCcalibDB::GetPressureSensor(Int_t run, Int_t type){ // // If not map try to get it from the GRPObject // - AliGRPObject * grpRun = dynamic_cast(fGRPArray.At(run)); + AliGRPObject * grpRun = dynamic_cast(fGRPArray.GetValue(Form("%i",run))); if (!grpRun) { UpdateRunInformations(run); - grpRun = dynamic_cast(fGRPArray.At(run)); + grpRun = dynamic_cast(fGRPArray.GetValue(Form("%i",run))); if (!grpRun) return 0; } AliDCSSensor * sensor = grpRun->GetCavernAtmosPressure(); @@ -955,10 +1297,10 @@ AliTPCSensorTempArray * AliTPCcalibDB::GetTemperatureSensor(Int_t run){ // // Get temperature sensor array // - AliTPCSensorTempArray * tempArray = (AliTPCSensorTempArray *)fTemperatureArray.At(run); + AliTPCSensorTempArray * tempArray = (AliTPCSensorTempArray *)fTemperatureArray.GetValue(Form("%i",run)); if (!tempArray) { UpdateRunInformations(run); - tempArray = (AliTPCSensorTempArray *)fTemperatureArray.At(run); + tempArray = (AliTPCSensorTempArray *)fTemperatureArray.GetValue(Form("%i",run)); } return tempArray; } @@ -968,10 +1310,10 @@ TObjArray * AliTPCcalibDB::GetTimeGainSplinesRun(Int_t run){ // // Get temperature sensor array // - TObjArray * gainSplines = (TObjArray *)fTimeGainSplinesArray.At(run); + TObjArray * gainSplines = (TObjArray *)fTimeGainSplinesArray.GetValue(Form("%i",run)); if (!gainSplines) { UpdateRunInformations(run); - gainSplines = (TObjArray *)fTimeGainSplinesArray.At(run); + gainSplines = (TObjArray *)fTimeGainSplinesArray.GetValue(Form("%i",run)); } return gainSplines; } @@ -980,10 +1322,10 @@ TObjArray * AliTPCcalibDB::GetTimeVdriftSplineRun(Int_t run){ // // Get drift spline array // - TObjArray * driftSplines = (TObjArray *)fDriftCorrectionArray.At(run); + TObjArray * driftSplines = (TObjArray *)fDriftCorrectionArray.GetValue(Form("%i",run)); if (!driftSplines) { UpdateRunInformations(run); - driftSplines = (TObjArray *)fDriftCorrectionArray.At(run); + driftSplines = (TObjArray *)fDriftCorrectionArray.GetValue(Form("%i",run)); } return driftSplines; } @@ -992,10 +1334,10 @@ AliDCSSensorArray * AliTPCcalibDB::GetVoltageSensors(Int_t run){ // // Get temperature sensor array // - AliDCSSensorArray * voltageArray = (AliDCSSensorArray *)fVoltageArray.At(run); + AliDCSSensorArray * voltageArray = (AliDCSSensorArray *)fVoltageArray.GetValue(Form("%i",run)); if (!voltageArray) { UpdateRunInformations(run); - voltageArray = (AliDCSSensorArray *)fVoltageArray.At(run); + voltageArray = (AliDCSSensorArray *)fVoltageArray.GetValue(Form("%i",run)); } return voltageArray; } @@ -1004,10 +1346,10 @@ AliDCSSensorArray * AliTPCcalibDB::GetGoofieSensors(Int_t run){ // // Get temperature sensor array // - AliDCSSensorArray * goofieArray = (AliDCSSensorArray *)fGoofieArray.At(run); + AliDCSSensorArray * goofieArray = (AliDCSSensorArray *)fGoofieArray.GetValue(Form("%i",run)); if (!goofieArray) { UpdateRunInformations(run); - goofieArray = (AliDCSSensorArray *)fGoofieArray.At(run); + goofieArray = (AliDCSSensorArray *)fGoofieArray.GetValue(Form("%i",run)); } return goofieArray; } @@ -1018,10 +1360,10 @@ AliTPCCalibVdrift * AliTPCcalibDB::GetVdrift(Int_t run){ // // Get the interface to the the vdrift // - AliTPCCalibVdrift * vdrift = (AliTPCCalibVdrift*)fVdriftArray.At(run); + AliTPCCalibVdrift * vdrift = (AliTPCCalibVdrift*)fVdriftArray.GetValue(Form("%i",run)); if (!vdrift) { UpdateRunInformations(run); - vdrift= (AliTPCCalibVdrift*)fVdriftArray.At(run); + vdrift= (AliTPCCalibVdrift*)fVdriftArray.GetValue(Form("%i",run)); } return vdrift; } @@ -1154,14 +1496,14 @@ Float_t AliTPCcalibDB::GetDCSSensorMeanValue(AliDCSSensorArray *arr, const char } } if (sigDigits>=0){ - val/=10; + // val/=10; val=(Float_t)TMath::Floor(val * TMath::Power(10., sigDigits) + .5) / TMath::Power(10., sigDigits); - val*=10; + // val*=10; } return val; } -Float_t AliTPCcalibDB::GetChamberHighVoltage(Int_t run, Int_t sector, Int_t timeStamp, Int_t sigDigits) { +Float_t AliTPCcalibDB::GetChamberHighVoltage(Int_t run, Int_t sector, Int_t timeStamp, Int_t sigDigits, Bool_t current) { // // return the chamber HV for given run and time: 0-35 IROC, 36-72 OROC // if timeStamp==-1 return mean value @@ -1180,6 +1522,16 @@ Float_t AliTPCcalibDB::GetChamberHighVoltage(Int_t run, Int_t sector, Int_t time //OROC sensorName=Form("TPC_ANODE_O_%c%02d_0_VMEAS",sideName,sector%18); } + if (current){ + if (sector<36){ + //IROC + sensorName=Form("TPC_ANODE_I_%c%02d_IMEAS",sideName,sector%18); + }else{ + //OROC + sensorName=Form("TPC_ANODE_O_%c%02d_0_IMEAS",sideName,sector%18); + } + + } if (timeStamp==-1){ val=AliTPCcalibDB::GetDCSSensorMeanValue(voltageArray, sensorName.Data(),sigDigits); } else { @@ -1396,7 +1748,7 @@ Float_t AliTPCcalibDB::GetValueGoofie(Int_t timeStamp, Int_t run, Int_t type){ Bool_t AliTPCcalibDB::GetTemperatureFit(Int_t timeStamp, Int_t run, Int_t side,TVectorD& fit){ // - // + // GetTmeparature fit at parameter for given time stamp // TTimeStamp tstamp(timeStamp); AliTPCSensorTempArray* tempArray = Instance()->GetTemperatureSensor(run); @@ -1415,8 +1767,8 @@ Bool_t AliTPCcalibDB::GetTemperatureFit(Int_t timeStamp, Int_t run, Int_t side, Float_t AliTPCcalibDB::GetTemperature(Int_t timeStamp, Int_t run, Int_t side){ // - // - // + // Get mean temperature + // TVectorD vec(5); if (side==0) { GetTemperatureFit(timeStamp,run,0,vec); @@ -1468,6 +1820,7 @@ AliGRPObject * AliTPCcalibDB::MakeGRPObjectFromMap(TMap *map){ AliGRPObject *grpRun = new AliGRPObject; grpRun->ReadValuesFromMap(map); grpRun->SetCavernAtmosPressure(sensor2); + grpRun->SetCavernAtmosPressure(sensor2); grpRun->SetSurfaceAtmosPressure(sensor); return grpRun; } @@ -1487,27 +1840,60 @@ Bool_t AliTPCcalibDB::CreateGUITree(Int_t run, const char* filename) AliTPCcalibDB *db=AliTPCcalibDB::Instance(); // retrieve cal pad objects db->SetRun(run); + db->CreateGUITree(filename); + return kTRUE; +} + +Bool_t AliTPCcalibDB::CreateGUITree(const char* filename){ + // + // + // + if (!AliCDBManager::Instance()->GetDefaultStorage()){ + AliError("Default Storage not set. Cannot create calibration Tree!"); + return kFALSE; + } + UpdateNonRec(); // load all infromation now + AliTPCPreprocessorOnline prep; //noise and pedestals - prep.AddComponent(db->GetPedestals()); - prep.AddComponent(db->GetPadNoise()); + if (GetPedestals()) prep.AddComponent(new AliTPCCalPad(*(GetPedestals()))); + if (GetPadNoise() ) prep.AddComponent(new AliTPCCalPad(*(GetPadNoise()))); //pulser data - prep.AddComponent(db->GetPulserTmean()); - prep.AddComponent(db->GetPulserTrms()); - prep.AddComponent(db->GetPulserQmean()); + if (GetPulserTmean()) prep.AddComponent(new AliTPCCalPad(*(GetPulserTmean()))); + if (GetPulserTrms() ) prep.AddComponent(new AliTPCCalPad(*(GetPulserTrms()))); + if (GetPulserQmean()) prep.AddComponent(new AliTPCCalPad(*(GetPulserQmean()))); //CE data - prep.AddComponent(db->GetCETmean()); - prep.AddComponent(db->GetCETrms()); - prep.AddComponent(db->GetCEQmean()); + if (GetCETmean()) prep.AddComponent(new AliTPCCalPad(*(GetCETmean()))); + if (GetCETrms() ) prep.AddComponent(new AliTPCCalPad(*(GetCETrms()))); + if (GetCEQmean()) prep.AddComponent(new AliTPCCalPad(*(GetCEQmean()))); //Altro data - prep.AddComponent(db->GetALTROAcqStart() ); - prep.AddComponent(db->GetALTROZsThr() ); - prep.AddComponent(db->GetALTROFPED() ); - prep.AddComponent(db->GetALTROAcqStop() ); - prep.AddComponent(db->GetALTROMasked() ); + if (GetALTROAcqStart() ) prep.AddComponent(new AliTPCCalPad(*(GetALTROAcqStart() ))); + if (GetALTROZsThr() ) prep.AddComponent(new AliTPCCalPad(*(GetALTROZsThr() ))); + if (GetALTROFPED() ) prep.AddComponent(new AliTPCCalPad(*(GetALTROFPED() ))); + if (GetALTROAcqStop() ) prep.AddComponent(new AliTPCCalPad(*(GetALTROAcqStop() ))); + if (GetALTROMasked() ) prep.AddComponent(new AliTPCCalPad(*(GetALTROMasked() ))); + //QA + AliTPCdataQA *dataQA=GetDataQA(); + if (dataQA) { + if (dataQA->GetNLocalMaxima()) + prep.AddComponent(new AliTPCCalPad(*(dataQA->GetNLocalMaxima()))); + if (dataQA->GetMaxCharge()) + prep.AddComponent(new AliTPCCalPad(*(dataQA->GetMaxCharge()))); + if (dataQA->GetMeanCharge()) + prep.AddComponent(new AliTPCCalPad(*(dataQA->GetMeanCharge()))); + if (dataQA->GetNoThreshold()) + prep.AddComponent(new AliTPCCalPad(*(dataQA->GetNoThreshold()))); + if (dataQA->GetNTimeBins()) + prep.AddComponent(new AliTPCCalPad(*(dataQA->GetNTimeBins()))); + if (dataQA->GetNPads()) + prep.AddComponent(new AliTPCCalPad(*(dataQA->GetNPads()))); + if (dataQA->GetTimePosition()) + prep.AddComponent(new AliTPCCalPad(*(dataQA->GetTimePosition()))); + } + // TString file(filename); - if (file.IsNull()) file=Form("guiTreeRun_%d.root",run); + if (file.IsNull()) file=Form("guiTreeRun_%i.root",fRun); prep.DumpToFile(file.Data()); return kTRUE; } @@ -1569,11 +1955,42 @@ Double_t AliTPCcalibDB::GetVDriftCorrectionTime(Int_t timeStamp, Int_t run, Int_ // // Notice - Extrapolation outside of calibration range - using constant function // - Double_t result; - // mode TPC crossing and laser + Double_t result=0; + // mode 1 automatic mode - according to the distance to the valid calibration + // - + Double_t deltaP=0, driftP=0, wP = 0.; + Double_t deltaITS=0,driftITS=0, wITS= 0.; + Double_t deltaLT=0, driftLT=0, wLT = 0.; + Double_t deltaCE=0, driftCE=0, wCE = 0.; + driftP = fDButil->GetVDriftTPC(deltaP,run,timeStamp); + driftITS= fDButil->GetVDriftTPCITS(deltaITS,run,timeStamp); + driftCE = fDButil->GetVDriftTPCCE(deltaCE, run,timeStamp,36000,2); + driftLT = fDButil->GetVDriftTPCLaserTracks(deltaLT,run,timeStamp,36000,2); + deltaITS = TMath::Abs(deltaITS); + deltaP = TMath::Abs(deltaP); + deltaLT = TMath::Abs(deltaLT); + deltaCE = TMath::Abs(deltaCE); if (mode==1) { - result=AliTPCcalibDButil::GetVDriftTPC(run,timeStamp); - + const Double_t kEpsilon=0.00000000001; + const Double_t kdeltaT=360.; // 10 minutes + if(TMath::Abs(deltaITS) < 12*kdeltaT) { + result = driftITS; + } else { + wITS = 64.*kdeltaT/(deltaITS +kdeltaT); + wLT = 16.*kdeltaT/(deltaLT +kdeltaT); + wP = 0. *kdeltaT/(deltaP +kdeltaT); + wCE = 1. *kdeltaT/(deltaCE +kdeltaT); + // + // + if (TMath::Abs(driftP)GetZLength(); - + if (mode==2) { + // TPC-TPC mode + result=fDButil->GetTriggerOffsetTPC(run,timeStamp); + result *=fParam->GetZLength(); + } + if (mode==1){ + // TPC-ITS mode + Double_t dist=0; + result= -fDButil->GetTime0TPCITS(dist, run, timeStamp)*fParam->GetDriftV()/1000000.; + } return result; } @@ -1607,9 +2031,9 @@ Double_t AliTPCcalibDB::GetVDriftCorrectionGy(Int_t timeStamp, Int_t run, Int_t // // Get global y correction drift velocity correction factor // additive factor vd = vdnom*(1+GetVDriftCorrectionGy *gy) - // Value etracted combining the vdrift correction using laser tracks and CE + // Value etracted combining the vdrift correction using laser tracks and CE or TPC-ITS // Arguments: - // mode determines the algorith how to combine the Laser Track, LaserCE + // mode determines the algorith how to combine the Laser Track, LaserCE or TPC-ITS // timestamp - timestamp // run - run number // side - the drift velocity gy correction per side (CE and Laser tracks) @@ -1620,10 +2044,25 @@ Double_t AliTPCcalibDB::GetVDriftCorrectionGy(Int_t timeStamp, Int_t run, Int_t UpdateRunInformations(run,kFALSE); TObjArray *array =AliTPCcalibDB::Instance()->GetTimeVdriftSplineRun(run); if (!array) return 0; + Double_t result=0; + + // use TPC-ITS if present + TGraphErrors *gr= (TGraphErrors*)array->FindObject("ALIGN_ITSB_TPC_VDGY"); + if(gr) { + result = AliTPCcalibDButil::EvalGraphConst(gr,timeStamp); + + // transform from [(cm/mus)/ m] to [1/cm] + result /= (fParam->GetDriftV()/1000000.); + result /= 100.; + + //printf("result %e \n", result); + return result; + } + + // use laser if ITS-TPC not present TGraphErrors *laserA= (TGraphErrors*)array->FindObject("GRAPH_MEAN_GLOBALYGRADIENT_LASER_ALL_A"); TGraphErrors *laserC= (TGraphErrors*)array->FindObject("GRAPH_MEAN_GLOBALYGRADIENT_LASER_ALL_C"); - Double_t result=0; if (laserA && laserC){ result= (laserA->Eval(timeStamp)+laserC->Eval(timeStamp))*0.5; } @@ -1633,5 +2072,126 @@ Double_t AliTPCcalibDB::GetVDriftCorrectionGy(Int_t timeStamp, Int_t run, Int_t if (laserC &&side==1){ result = (laserC->Eval(timeStamp)); } + //printf("laser result %e \n", -result/250.); + return -result/250.; //normalized before } + +AliTPCCalPad* AliTPCcalibDB::MakeDeadMap(Double_t notInMap, const char* nameMappingFile) { +// +// Read list of active DDLs from OCDB entry +// Generate and return AliTPCCalPad containing 1 for all pads in active DDLs, +// 0 for all pads in non-active DDLs. +// For DDLs with missing status information (no DCS input point to Shuttle), +// the value of the AliTPCCalPad entry is determined by the parameter +// notInMap (default value 1) +// + char chinfo[1000]; + + TFile *fileMapping = new TFile(nameMappingFile, "read"); + AliTPCmapper *mapping = (AliTPCmapper*) fileMapping->Get("tpcMapping"); + if (!mapping) { + snprintf(chinfo,1000,"Failed to get mapping object from %s. ...\n", nameMappingFile); + AliError (chinfo); + return 0; + } + + AliTPCCalPad *deadMap = new AliTPCCalPad("deadMap","deadMap"); + if (!deadMap) { + AliError("Failed to allocate dead map AliTPCCalPad"); + return 0; + } + + /// get list of active DDLs from OCDB entry + Int_t idDDL=0; + if (!fALTROConfigData ) { + AliError("No ALTRO config OCDB entry available"); + return 0; + } + TMap *activeDDL = (TMap*)fALTROConfigData->FindObject("DDLArray"); + TObjString *ddlArray=0; + if (activeDDL) { + ddlArray = (TObjString*)activeDDL->GetValue("DDLArray"); + if (!ddlArray) { + AliError("Empty list of active DDLs in OCDB entry"); + return 0; + } + } else { + AliError("List of active DDLs not available in OCDB entry"); + return 0; + } + TString arrDDL=ddlArray->GetString(); + Int_t offset = mapping->GetTpcDdlOffset(); + Double_t active; + for (Int_t i=0; iGetNumDdl(); i++) { + idDDL= i+offset; + if (idDDL<0) continue; + Int_t patch = mapping->GetPatchFromEquipmentID(idDDL); + if (patch<0) continue; + Int_t roc=mapping->GetRocFromEquipmentID(idDDL); + if (roc<0) continue; + AliTPCCalROC *calRoc=deadMap->GetCalROC(roc); + if (calRoc) { + for ( Int_t branch = 0; branch < 2; branch++ ) { + for ( Int_t fec = 0; fec < mapping->GetNfec(patch, branch); fec++ ) { + for ( Int_t altro = 0; altro < 8; altro++ ) { + for ( Int_t channel = 0; channel < 16; channel++ ) { + Int_t hwadd = mapping->CodeHWAddress(branch, fec, altro, channel); + Int_t row = mapping->GetPadRow(patch, hwadd); // row in a ROC (IROC or OROC) +// Int_t globalrow = mapping.GetGlobalPadRow(patch, hwadd); // row in full sector (IROC plus OROC) + Int_t pad = mapping->GetPad(patch, hwadd); + if (!TString(arrDDL[i]).IsDigit()) { + active = notInMap; + } else { + active=TString(arrDDL[i]).Atof(); + } + calRoc->SetValue(row,pad,active); + } // end channel for loop + } // end altro for loop + } // end fec for loop + } // end branch for loop + } // valid calROC + } // end loop on active DDLs + return deadMap; +} + + + +AliTPCCorrection * AliTPCcalibDB::GetTPCComposedCorrection(Float_t field) const{ + // + // GetComposed correction for given field setting + // If not specific correction for field used return correction for all field + // - Complication needed to gaurantee OCDB back compatibility + // - Not neeeded for the new space point correction + if (!fComposedCorrectionArray) return 0; + if (field>0.1 && fComposedCorrectionArray->At(1)) { + return (AliTPCCorrection *)fComposedCorrectionArray->At(1); + } + if (field<-0.1 &&fComposedCorrectionArray->At(2)) { + return (AliTPCCorrection *)fComposedCorrectionArray->At(2); + } + return (AliTPCCorrection *)fComposedCorrectionArray->At(0); + +} + + +AliTPCCorrection * AliTPCcalibDB::GetTPCComposedCorrectionDelta() const{ + // + // GetComposedCorrection delta + // Delta is time dependent - taken form the CalibTime OCDB entry + // + if (!fComposedCorrectionArray) return 0; + if (fRun<0) return 0; + if (fDriftCorrectionArray.GetValue(Form("%i",fRun))==0) return 0; + if (fComposedCorrectionArray->GetEntriesFast()<=4) { + fComposedCorrectionArray->Expand(5); + TObjArray * timeArray =(TObjArray*)(fDriftCorrectionArray.GetValue(Form("%i",fRun))); + AliTPCCorrection * correctionTime = (AliTPCCorrection *)timeArray->FindObject("FitCorrectionTime"); + if (correctionTime){ + correctionTime->Init(); + fComposedCorrectionArray->AddAt(correctionTime,4); //add time dependent c + } + } + return (AliTPCCorrection *)fComposedCorrectionArray->At(4); // +} +