27 #include "TLinearFitter.h" 30 #include "TTimeStamp.h" 49 fTempArray = sensorDCS;
56 fTempArray(c.fTempArray),
57 fStringFEsimulation(c.fStringFEsimulation)
101 TLinearFitter *fitter =
new TLinearFitter(3,
"x0++x1++x2");
106 for (Int_t isensor=0; isensor<nsensors; isensor++) {
115 if (
IsOK(y)) fitter->AddPoint(x,y,1);
121 fitter->GetParameters(param);
123 fitter->~TLinearFitter();
155 TLinearFitter *fitter =
new TLinearFitter(3);
158 const Float_t kMaxDelta=0.5;
160 if (type == 1 || type == 2 || type == 4) {
161 fitter->SetFormula(
"x0++x1++TMath::Sin(x2)");
163 fitter->SetFormula(
"x0++x1++x2");
170 for (Int_t isensor=0; isensor<nsensors; isensor++) {
174 if (
IsOK(temperature)) {temps[i]=temperature; i++;}
177 Float_t medianTemp = TMath::Median(i, temps);
179 Float_t rmsTemp = TMath::RMS(i, temps);
183 for (Int_t isensor=0; isensor<nsensors; isensor++) {
186 if (type==0 || type==3) {
192 if (TMath::Abs(y-medianTemp)>kMaxDelta+4.*rmsTemp)
continue;
193 if (
IsOK(y)) fitter->AddPoint(x,y,1);
196 }
else if (type==2) {
202 if (TMath::Abs(y-medianTemp)>kMaxDelta+4.*rmsTemp)
continue;
203 if (
IsOK(y)) fitter->AddPoint(x,y,1);
212 if (TMath::Abs(y-medianTemp)>kMaxDelta+4.*rmsTemp)
continue;
213 if (
IsOK(y)) fitter->AddPoint(x,y,1);
216 }
else if (type==4) {
222 if (TMath::Abs(y-medianTemp)>kMaxDelta+4.*rmsTemp)
continue;
223 if (
IsOK(y)) fitter->AddPoint(x,y,1);
258 TGraph2D *graph2D =
new TGraph2D();
263 for (Int_t isensor=0; isensor<nsensors; isensor++) {
266 Double_t x, y, z, r, phi, tempValue;
274 if (type==0 || type==3) {
276 graph2D->SetPoint(i,x,y,tempValue);
279 }
else if (type==2) {
281 graph2D->SetPoint(i,z,phi,tempValue);
286 graph2D->SetPoint(i,z,phi,tempValue);
292 if (type==0 || type==3) {
293 graph2D->GetXaxis()->SetTitle(
"X[cm]");
294 graph2D->GetYaxis()->SetTitle(
"Y[cm]");
295 if (type==0 && side==0) {
296 graph2D->SetTitle(
"ROC A side");
297 }
else if (type==0 && side==1) {
298 graph2D->SetTitle(
"ROC C side");
299 }
else if (type==3 && side==0) {
300 graph2D->SetTitle(
"TPC A side (Inside the TPC)");
301 }
else if (type==3 && side==1) {
302 graph2D->SetTitle(
"TPC C side (Inside the TPC)");
304 }
else if (type==1 || type==2) {
305 graph2D->GetXaxis()->SetTitle(
"Z[cm]");
306 graph2D->GetYaxis()->SetTitle(
"Phi[RAD]");
308 graph2D->SetTitle(
"Outer Containment Vessel");
309 }
else if (type==2) {
310 graph2D->SetTitle(
"Inner Containment Vessel");
314 if (!graph2D->GetN()) {
315 printf(
"Returned TGraph2D is empty: check type and side values\n");
318 graph2D->GetXaxis()->SetLabelOffset(0.0);
319 graph2D->GetYaxis()->SetLabelOffset(0.005);
320 graph2D->GetZaxis()->SetLabelOffset(-0.04);
344 TLinearFitter *fitter =
new TLinearFitter(3);
346 UInt_t fStartTime =
fTempArray->AliTPCSensorTempArray::GetStartTime();
347 UInt_t fEndTime =
fTempArray->AliTPCSensorTempArray::GetEndTime();
349 UInt_t stepTime = (fEndTime-fStartTime)/nPoints;
351 Double_t *x =
new Double_t[nPoints];
352 Double_t *y =
new Double_t[nPoints];
353 for (Int_t ip=0; ip<nPoints; ip++) {
354 x[ip] = fStartTime+ip*stepTime;
360 fitter->GetParameters(param);
364 y[ip] = param[2]*500;
366 y[ip] = param[1]*500;
370 TGraph *graph =
new TGraph(nPoints,x,y);
372 fitter->~TLinearFitter();
376 graph->GetXaxis()->SetTimeDisplay(1);
377 graph->GetXaxis()->SetLabelOffset(0.02);
378 graph->GetXaxis()->SetTimeFormat(
"#splitline{%d/%m}{%H:%M}");
405 TVectorD paramA(3), paramC(3);
406 TLinearFitter *fitterA = 0;
407 TLinearFitter *fitterC = 0;
410 fitterA->GetParameters(paramA);
412 fitterC->GetParameters(paramC);
414 Double_t fvalA = paramA[0]+paramA[1]*x+paramA[2]*y;
415 Double_t fvalC = paramC[0]+paramC[1]*x+paramC[2]*y;
417 Double_t k = (fvalA-fvalC)/(2*247);
418 Double_t tempValue = fvalC+(fvalA-fvalC)/2+k*z;
431 const Float_t kMinT=15;
432 const Float_t kMaxT=25;
433 return (value>kMinT && value<kMaxT);
TGraph2D * GetTempMapsViaSensors(Int_t type, Int_t side, UInt_t timeSec)
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
AliTPCSensorTempArray * fTempArray
Array of Sensors (initialized in Constructor)
AliTPCTempMap & operator=(const AliTPCTempMap &c)
virtual void Copy(TObject &c) const
Class describing TPC temperature sensors (including pointers to graphs/fits.
TPC calibration class for temperature maps and tendencies.
Double_t GetTemperature(Double_t x, Double_t y, Double_t z, UInt_t timeSec)
TGraph * MakeGraphGradient(Int_t axis, Int_t side, Int_t nPoints)
TLinearFitter * GetLinearFitter(Int_t type, Int_t side, UInt_t timeSec)
Double_t GetValue(UInt_t timeSec, Int_t sensor)
TPC calibration class for parameters which saved per pad.
Bool_t IsOK(Float_t value)
TTimeStamp GetStartTime() const
AliTPCTempMap(AliTPCSensorTempArray *SensorsDCS)
AliDCSSensor * GetSensorNum(Int_t ind)
const char kStringFEsimulation[]
Double_t GetTempGradientY(UInt_t timeSec, Int_t side)