+//_____________________________________________________________________________
+TGraph* AliDCSSensor::MakeGraph(Int_t nPoints) const
+{
+ //
+ // Make graph from start time to end time of DCS values
+ //
+
+ UInt_t stepTime = (fEndTime-fStartTime)/nPoints;
+
+ if ( !fFit ) return 0;
+
+ Double_t *x = new Double_t[nPoints+1];
+ Double_t *y = new Double_t[nPoints+1];
+ for (Int_t ip=0; ip<nPoints; ip++) {
+ x[ip] = fStartTime+ip*stepTime;
+ y[ip] = fFit->Eval(ip*stepTime/kSecInHour);
+ }
+
+ TGraph *graph = new TGraph(nPoints,x,y);
+ delete [] x;
+ delete [] y;
+
+ graph->GetXaxis()->SetTimeDisplay(1);
+ graph->GetXaxis()->SetLabelOffset(0.02);
+ graph->GetXaxis()->SetTimeFormat("#splitline{%d/%m}{%H:%M}");
+
+ return graph;
+}
+
+//_____________________________________________________________________________
+
+TClonesArray * AliDCSSensor::ReadTree(TTree* tree) {
+ //
+ // read values from ascii file
+ //
+
+ Int_t nentries = tree->GetEntries();
+
+ char stringId[100];
+ Int_t num=0;
+ Int_t idDCS=0;
+ Double_t x=0;
+ Double_t y=0;
+ Double_t z=0;
+
+ tree->SetBranchAddress("StringID",&stringId);
+ tree->SetBranchAddress("IdDCS",&idDCS);
+ tree->SetBranchAddress("Num",&num);
+ tree->SetBranchAddress("X",&x);
+ tree->SetBranchAddress("Y",&y);
+ tree->SetBranchAddress("Z",&z);
+
+ // firstSensor = (Int_t)tree->GetMinimum("ECha");
+ // lastSensor = (Int_t)tree->GetMaximum("ECha");
+
+ TClonesArray * array = new TClonesArray("AliDCSSensor",nentries);
+ printf ("nentries = %d\n",nentries);
+
+ for (Int_t isensor=0; isensor<nentries; isensor++){
+ AliDCSSensor * sens = new ((*array)[isensor])AliDCSSensor;
+ tree->GetEntry(isensor);
+ sens->SetId(isensor);
+ sens->SetIdDCS(idDCS);
+ sens->SetStringID(TString(stringId));
+ sens->SetX(x);
+ sens->SetY(y);
+ sens->SetZ(z);
+
+ }
+ return array;
+}