]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCSensorTemp.cxx
Remove for the moment the QA analysis from the PartCorr wagon and move it to its...
[u/mrichter/AliRoot.git] / TPC / AliTPCSensorTemp.cxx
index 66ef6413877d69224ddf91d25c60590da636f7e3..7f52bf0d44ad12c49609dfe85e8bcc8b418efa1c 100644 (file)
 
 // Running instructions:
 /*
-  TClonesArray * arr = AliTPCSensorTemp::ReadList("TempSensor.txt");
+  TClonesArray * arr = AliTPCSensorTemp::ReadList("TempSensor.txt","tpc_PT_%d.Temperature");
   TFile f("TempSensors.root","RECREATE");
   TTree * tree = new TTree("TempSensor", "TempSensor");
   tree->Branch("Temp",&arr);
   tree->Fill();
   tree->Write();
   
- */
-//
+*/
 
+//
 
+#include <strings.h>
 #include "AliTPCSensorTemp.h"
 ClassImp(AliTPCSensorTemp)
 
 
+
 const Float_t kASideX[18][5]={
         { 99.56,  117.59,  160.82,  186.92,  213.11},
        { 87.56,  103.4,   141.42,  164.37,  187.41},
@@ -72,7 +74,7 @@ const Float_t kASideY[18][5]={
        {-50.55,  -59.7,  -81.65,  -94.9, -108.2},
        {-77.45,  -91.47, -125.1, -145.4, -165.77},
        {-95.0, -112.2, -153.45, -178.35, -203.35},
-       {-101.1, -119.4, -163.3,  -189.8, -216.4},
+        {-101.1, -119.4, -163.3,  -189.8, -216.4},
         {-95.0, -112.2, -153.45, -178.35, -203.35},
        {-77.45,  -91.47, -125.1, -145.4, -165.77},
        {-50.55,  -59.7,  -81.65,  -94.9, -108.2},
@@ -112,7 +114,7 @@ const Float_t kCSideY[18][5]={
        {-50.55,  -59.7,   -81.56,  -94.9,  -108.2},
        {-77.45,  -91.47, -125.1,  -145.4,  -165.77},
        {-95.0,  -112.2,  -153.45, -178.35, -203.35},
-       {-101.1, -119.4, -163.3, -189.8, -216.4},
+        {-101.1, -119.4, -163.3, -189.8, -216.4},
         {-95.0, -112.2, -153.45, -178.35, -203.35},
        {-77.45,  -91.47, -125.1, -145.4, -165.77},
        {-50.55,  -59.7,  -81.65,  -94.9, -108.2},
@@ -123,6 +125,7 @@ const Float_t kIFCrad[5] = {67.2, 64.4, 60.7, 64.4, 67.2};
 const Float_t kTSrad[4] =  {67.2, 61.5, 67.2, 61.5}; 
 const Float_t kTSz[4] =  {240.0, 90.0, 240.0, 90.0}; 
 
+//______________________________________________________________________________________________
 
 AliTPCSensorTemp::AliTPCSensorTemp(): AliDCSSensor(),
   fType(0),
@@ -134,6 +137,7 @@ AliTPCSensorTemp::AliTPCSensorTemp(): AliDCSSensor(),
   //  Standard constructor
   //
 }
+//______________________________________________________________________________________________
 
 AliTPCSensorTemp::AliTPCSensorTemp(const AliTPCSensorTemp& source) :
   AliDCSSensor(source),
@@ -146,6 +150,7 @@ AliTPCSensorTemp::AliTPCSensorTemp(const AliTPCSensorTemp& source) :
 //  Copy constructor
 //
 { }
+//______________________________________________________________________________________________
 
 AliTPCSensorTemp& AliTPCSensorTemp::operator=(const AliTPCSensorTemp& source){
 //
@@ -156,15 +161,24 @@ AliTPCSensorTemp& AliTPCSensorTemp::operator=(const AliTPCSensorTemp& source){
   
   return *this;  
 }
+//______________________________________________________________________________________________
 
-   
-
-TClonesArray * AliTPCSensorTemp::ReadList(const char *fname) {
+TClonesArray * AliTPCSensorTemp::ReadList(const char *fname,
+                                          const TString& amandaString) {
   //
   // read values from ascii file
   //
   TTree * tree = new TTree("asci","asci");
   tree->ReadFile(fname,"");
+  TClonesArray *arr = ReadTree(tree, amandaString);
+  delete tree;
+  return arr;
+}
+     
+//______________________________________________________________________________________________
+
+TClonesArray * AliTPCSensorTemp::ReadTree(TTree *tree, 
+                                          const TString& amandaString) {
   
   Int_t nentries = tree->GetEntries();
   Int_t sensor=0;
@@ -198,6 +212,8 @@ TClonesArray * AliTPCSensorTemp::ReadList(const char *fname) {
     tree->GetEntry(isensor);
     temp->SetId(sensor);
     temp->SetIdDCS(echa);
+    TString stringID = Form (amandaString.Data(),echa);
+    temp->SetStringID(stringID);
     if (side[0]=='C') temp->SetSide(1);
     temp->SetSector(sector);
     temp->SetNum(num);
@@ -322,6 +338,5 @@ TClonesArray * AliTPCSensorTemp::ReadList(const char *fname) {
 
 
   }
-  delete tree;  
   return array;
 }