X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCTempMap.cxx;h=67108ab8a313ddffa1a6f1d1f4268fd0b0c73d35;hb=98cb7773723491372283f4e6218dfe5a8ff7d2d6;hp=97d01b6cce1dfbe399bae4febde4b52f2c9eaa01;hpb=b479e2530d092bf5581bfcd4e86bb6eeb52ac7b6;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCTempMap.cxx b/TPC/AliTPCTempMap.cxx index 97d01b6cce1..67108ab8a31 100644 --- a/TPC/AliTPCTempMap.cxx +++ b/TPC/AliTPCTempMap.cxx @@ -21,12 +21,15 @@ // // // Authors: Stefan Rossegger, Haavard Helstrup // // // +// Note: Obvioulsy some changes by Marian, but when ??? // +// // /////////////////////////////////////////////////////////////////////////////// #include "AliTPCSensorTempArray.h" #include "TLinearFitter.h" #include "TString.h" #include "TGraph2D.h" +#include "TTimeStamp.h" #include "AliTPCTempMap.h" @@ -38,21 +41,21 @@ ClassImp(AliTPCTempMap) //_____________________________________________________________________________ AliTPCTempMap::AliTPCTempMap(AliTPCSensorTempArray *sensorDCS): TNamed(), - ft(0), + fTempArray(0), fStringFEsimulation(kStringFEsimulation) { // // AliTPCTempMap default constructor // - ft = sensorDCS; + fTempArray = sensorDCS; } //_____________________________________________________________________________ AliTPCTempMap::AliTPCTempMap(const AliTPCTempMap &c): TNamed(c), - ft(c.ft), + fTempArray(c.fTempArray), fStringFEsimulation(c.fStringFEsimulation) { // @@ -110,17 +113,17 @@ Double_t AliTPCTempMap::GetTempGradientY(UInt_t timeSec, Int_t side){ TVectorD param(3); Int_t i = 0; - Int_t nsensors = ft->NumSensors(); + Int_t nsensors = fTempArray->NumSensors(); for (Int_t isensor=0; isensorGetSensorNum(isensor); + AliTPCSensorTemp *entry = (AliTPCSensorTemp*)fTempArray->GetSensorNum(isensor); if (entry->GetType()==3 && entry->GetSide()==side) { // take SensorType:TPC Double_t x[3]; x[0]=1; x[1]=entry->GetX(); x[2]=entry->GetY(); - Double_t y = entry->GetValue(timeSec); // get temperature value - fitter->AddPoint(x,y,1); // add values to LinearFitter + Double_t y = fTempArray->GetValue(timeSec,isensor); // get temperature value + if (IsOK(y)) fitter->AddPoint(x,y,1); // add values to LinearFitter i++; } @@ -135,7 +138,17 @@ Double_t AliTPCTempMap::GetTempGradientY(UInt_t timeSec, Int_t side){ } //_____________________________________________________________________________ +TLinearFitter *AliTPCTempMap::GetLinearFitter(Int_t type, Int_t side, TTimeStamp &stamp) +{ + // + // absolute time stamp used + // see AliTPCTempMap::GetLinearFitter(Int_t type, Int_t side, UInt_t timeSec) for details + // + Int_t timeSec = stamp.GetSec()-fTempArray->GetStartTime().GetSec(); + return GetLinearFitter(type,side,timeSec); +} +//_____________________________________________________________________________ TLinearFitter *AliTPCTempMap::GetLinearFitter(Int_t type, Int_t side, UInt_t timeSec) { // @@ -146,6 +159,7 @@ TLinearFitter *AliTPCTempMap::GetLinearFitter(Int_t type, Int_t side, UInt_t tim // 1 ... OuterContainmentVessel (OFC) // 2 ... InnerContainmentVessel (IFC) + ThermalScreener (TS) // 3 ... Within the TPC (DriftVolume) (TPC) + // 4 ... Only InnerContainmentVessel (IFC) // side: Can be choosen for type 0 and 3 (otherwise it will be ignored in // in order to get all temperature sensors of interest) // 0 ... Shaft Side (A) @@ -155,25 +169,42 @@ TLinearFitter *AliTPCTempMap::GetLinearFitter(Int_t type, Int_t side, UInt_t tim TLinearFitter *fitter = new TLinearFitter(3); Double_t *x = new Double_t[3]; Double_t y = 0; - - if (type == 1 || type == 2) { + const Float_t kMaxDelta=0.5; + + if (type == 1 || type == 2 || type == 4) { fitter->SetFormula("x0++x1++TMath::Sin(x2)"); // returns Z,Y gradient } else { fitter->SetFormula("x0++x1++x2"); // returns X,Y gradient } Int_t i = 0; - Int_t nsensors = ft->NumSensors(); + Int_t nsensors = fTempArray->NumSensors(); + + Float_t temps[1000]; for (Int_t isensor=0; isensorGetSensorNum(isensor); + AliTPCSensorTemp *entry = (AliTPCSensorTemp*)fTempArray->GetSensorNum(isensor); + if (entry->GetType()==type && entry->GetSide()==side){ + Float_t temperature= fTempArray->GetValue(timeSec,isensor); // get temperature value + if (IsOK(temperature)) {temps[i]=temperature; i++;} + } + } + Float_t medianTemp = TMath::Median(i, temps); + if (i<3) return 0; + Float_t rmsTemp = TMath::RMS(i, temps); + + i=0; + + for (Int_t isensor=0; isensorGetSensorNum(isensor); if (type==0 || type==3) { // 'side' information used if (entry->GetType()==type && entry->GetSide()==side) { x[0]=1; x[1]=entry->GetX(); x[2]=entry->GetY(); - y = entry->GetValue(timeSec); // get temperature value - fitter->AddPoint(x,y,1); // add values to LinearFitter + y = fTempArray->GetValue(timeSec,isensor); // get temperature value + if (TMath::Abs(y-medianTemp)>kMaxDelta+4.*rmsTemp) continue; + if (IsOK(y)) fitter->AddPoint(x,y,1); // add values to LinearFitter i++; } } else if (type==2) { // in case of IFC also usage of TS values @@ -181,8 +212,9 @@ TLinearFitter *AliTPCTempMap::GetLinearFitter(Int_t type, Int_t side, UInt_t tim x[0]=1; x[1]=entry->GetZ(); x[2]=entry->GetPhi(); - y = entry->GetValue(timeSec); - fitter->AddPoint(x,y,1); + y = fTempArray->GetValue(timeSec,isensor); + if (TMath::Abs(y-medianTemp)>kMaxDelta+4.*rmsTemp) continue; + if (IsOK(y)) fitter->AddPoint(x,y,1); i++; } } else if (type==1){ @@ -190,13 +222,25 @@ TLinearFitter *AliTPCTempMap::GetLinearFitter(Int_t type, Int_t side, UInt_t tim x[0]=1; x[1]=entry->GetZ(); x[2]=entry->GetPhi(); - y = entry->GetValue(timeSec); - fitter->AddPoint(x,y,1); + y = fTempArray->GetValue(timeSec,isensor); + if (TMath::Abs(y-medianTemp)>kMaxDelta+4.*rmsTemp) continue; + if (IsOK(y)) fitter->AddPoint(x,y,1); i++; } + } else if (type==4) { // ONLY IFC + if (entry->GetType()==2) { + x[0]=1; + x[1]=entry->GetZ(); + x[2]=entry->GetPhi(); + y = fTempArray->GetValue(timeSec,isensor); + if (TMath::Abs(y-medianTemp)>kMaxDelta+4.*rmsTemp) continue; + if (IsOK(y)) fitter->AddPoint(x,y,1); + i++; + } } } - fitter->Eval(); // Evaluates fitter + fitter->Eval(); + //fitter->EvalRobust(0.9); // Evaluates fitter delete [] x; @@ -224,20 +268,17 @@ TGraph2D *AliTPCTempMap::GetTempMapsViaSensors(Int_t type, Int_t side, UInt_t ti // 3 ... Within the TPC (DriftVolume) (TPC) // side: Can be choosen for type 0 and 3 (otherwise it will be ignored in // in order to get all temperature sensors of interest) - // 0 ... Shaft Side (A) - // 1 ... Muon Side (C) + // 0 ... A - side + // 1 ... C - side // TGraph2D *graph2D = new TGraph2D(); Int_t i = 0; - - Int_t nsensors = ft->NumSensors(); - - + Int_t nsensors = fTempArray->NumSensors(); for (Int_t isensor=0; isensorGetSensorNum(isensor); + AliTPCSensorTemp *entry = (AliTPCSensorTemp*)fTempArray->GetSensorNum(isensor); Double_t x, y, z, r, phi, tempValue; x = entry->GetX(); @@ -245,8 +286,8 @@ TGraph2D *AliTPCTempMap::GetTempMapsViaSensors(Int_t type, Int_t side, UInt_t ti z = entry->GetZ(); r = entry->GetR(); phi = entry->GetPhi(); - tempValue = entry->GetValue(timeSec); - + tempValue = fTempArray->GetValue(timeSec,isensor); + // printf("%d type %d: x=%lf y=%lf temp=%lf\n",isensor,entry->GetType(),x,y, tempValue); if (type==0 || type==3) { // 'side' information used if (entry->GetType()==type && entry->GetSide()==side) { graph2D->SetPoint(i,x,y,tempValue); @@ -269,13 +310,13 @@ TGraph2D *AliTPCTempMap::GetTempMapsViaSensors(Int_t type, Int_t side, UInt_t ti graph2D->GetXaxis()->SetTitle("X[cm]"); graph2D->GetYaxis()->SetTitle("Y[cm]"); if (type==0 && side==0) { - graph2D->SetTitle("ROC A - Endplate Shaft Side"); + graph2D->SetTitle("ROC A side"); } else if (type==0 && side==1) { - graph2D->SetTitle("ROC C - Endplate Muon Side"); + graph2D->SetTitle("ROC C side"); } else if (type==3 && side==0) { - graph2D->SetTitle("TPC A - Inside the TPC Shaft Side"); + graph2D->SetTitle("TPC A side (Inside the TPC)"); } else if (type==3 && side==1) { - graph2D->SetTitle("TPC C - Inside the TPC Muon Side"); + graph2D->SetTitle("TPC C side (Inside the TPC)"); } } else if (type==1 || type==2) { graph2D->GetXaxis()->SetTitle("Z[cm]"); @@ -283,7 +324,7 @@ TGraph2D *AliTPCTempMap::GetTempMapsViaSensors(Int_t type, Int_t side, UInt_t ti if (type==1) { graph2D->SetTitle("Outer Containment Vessel"); } else if (type==2) { - graph2D->SetTitle("InnerContainmentVessel + ThermalScreeners"); + graph2D->SetTitle("Inner Containment Vessel"); } } @@ -321,8 +362,8 @@ TGraph *AliTPCTempMap::MakeGraphGradient(Int_t axis, Int_t side, Int_t nPoints) TVectorD param(3); TLinearFitter *fitter = new TLinearFitter(3); - UInt_t fStartTime = ft->AliTPCSensorTempArray::GetStartTime(); - UInt_t fEndTime = ft->AliTPCSensorTempArray::GetEndTime(); + UInt_t fStartTime = fTempArray->AliTPCSensorTempArray::GetStartTime(); + UInt_t fEndTime = fTempArray->AliTPCSensorTempArray::GetEndTime(); UInt_t stepTime = (fEndTime-fStartTime)/nPoints; @@ -358,12 +399,25 @@ TGraph *AliTPCTempMap::MakeGraphGradient(Int_t axis, Int_t side, Int_t nPoints) return graph; } + +//_____________________________________________________________________________ +Double_t AliTPCTempMap::GetTemperature(Double_t x, Double_t y, Double_t z, TTimeStamp &stamp) +{ + // + // absolute time stamp used + // see also Double_t AliTPCTempMap::GetTemperature(Double_t x, Double_t y, Double_t z, UInt_t timeSec) for details + // + + Int_t timeSec = stamp.GetSec()-fTempArray->GetStartTime().GetSec(); + return GetTemperature(x, y, z, timeSec); +} + //_____________________________________________________________________________ Double_t AliTPCTempMap::GetTemperature(Double_t x, Double_t y, Double_t z, UInt_t timeSec) { // - // Returns estimated Temperature at given position (x,y,z) at given time + // Returns estimated Temperature at given position (x,y,z[cm]) at given time // (timeSec) after starttime // Method: so far just a linear interpolation between Linar fits of // the TPC temperature sensors @@ -390,5 +444,15 @@ Double_t AliTPCTempMap::GetTemperature(Double_t x, Double_t y, Double_t z, UInt_ fitterC->~TLinearFitter(); return tempValue; + } + +Bool_t AliTPCTempMap::IsOK(Float_t value){ + // + // checks if value is within a certain range + // + const Float_t kMinT=15; + const Float_t kMaxT=25; + return (value>kMinT && value