]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCSensorTemp.cxx
Update variable description file
[u/mrichter/AliRoot.git] / TPC / AliTPCSensorTemp.cxx
index 42565a839bef275a32c2c5ef70ca4463ce3e6446..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.6,  117.7,  161.2,  187.3,  213.5},
-       { 87.6,  103.7,  142.6,  165.6,  188.6},
-       { 65.0,   77.3,  106.8,  123.8,  140.9},
-       { 34.6,   41.5,   58.1,   67.2,   76.3},
-       {    0,    0.7,    2.4,    2.4,    2.4},
-       {-34.6,  -40.2,  -53.6,  -62.7,  -71.7},
-       {-65.0,  -76.2, -103.1, -120.2, -137.2},
-       {-87.6, -103.1, -140.2, -163.2, -186.2},
-       {-99.6, -117.5, -160.4, -186.5, -212.6},
-       {-99.6, -117.7, -161.2, -187.3, -213.5},
-       {-87.6, -103.7, -142.6, -165.6, -188.6},
-       {-65.0,  -77.3, -106.8, -123.8, -140.9},
-       {-34.6,  -41.5,  -58.1,  -67.2,  -76.3},
-       {    0,   -0.7,   -2.4,   -2.4,   -2.4},
-       { 34.6,   40.2,   53.6,   62.7,   71.7},
-       { 65.0,   76.2,  103.1,  120.2,  137.2},
-       { 87.6,  103.1,  140.2,  163.2,  186.2},
-       { 99.6,  117.5,  160.4,  186.5,  212.6}};
+        { 99.56,  117.59,  160.82,  186.92,  213.11},
+       { 87.56,  103.4,   141.42,  164.37,  187.41},
+       { 64.99,   76.75,  104.97,  122.00,  139.1},
+       { 34.58,   40.84,   55.85,   64.92,  74.01},
+       {    0,    0,    0,    0,    0},
+       {-34.58,  -40.84,  -55.85,  -64.92,  -74.01},
+       {-64.99,  -76.75, -104.97, -122.0,  -139.1},
+       {-87.56, -103.4,  -141.42, -164.37, -187.41},
+       {-99.56, -117.59, -160.82, -186.92, -213.11},
+       {-99.56, -117.59, -160.82, -186.92, -213.11},
+       {-87.56, -103.4,  -141.42, -164.37, -187.41},
+       {-64.99,  -76.75, -104.97, -122,    -139.1},
+       {-34.58,  -40.84,  -55.85,  -64.92,  -74.01},
+       {    0,    0,    0,   0,   0},
+       { 34.58,   40.84,   55.85,   64.92,   74.01},
+       { 64.99,   76.75,  104.97,  122,     139.1},
+       { 87.56,  103.4,   141.42,  164.37,  187.41},
+       { 99.56,  117.59,  160.82,  186.92,  213.11}};
        
 const Float_t kASideY[18][5]={
-        { 17.6,   20.1,   26.0,   30.6,   35.2},
-       { 50.6,   59.1,   79.5,   92.8,  106.1},
-       { 77.4,   91.0,  123.5,  143.9,  164.2},
-       { 95.0,  112.0,  152.6,  177.5,  202.5},
+        { 17.56,   20.73,   28.36,   32.96,   37.58},
+       { 50.55,   59.7,    81.65,   94.9,   108.2},
+       { 77.45,   91.47,  125.1,   145.4,   165.77},
+       { 95.0,  112.3,    153.45,  178.35,  203.35},
        {101.1,  119.4,  163.3,  189.8,  216.4},
-       { 95.0,  112.4,  154.2,  179.2,  204.1},
-       { 77.4,   91.9,  126.6,  146.9,  167.3},
-       { 50.6,   60.3,   83.7,   97.0,  110.3},
-       { 17.6,   21.4,   30.7,   35.3,   39.9},
-       {-17.6,  -20.1,  -26.0,  -30.6,  -35.2},
-       {-50.6,  -59.1,  -79.5,  -92.8, -106.1},
-       {-77.4,  -91.0, -123.5, -143.9, -164.2},
-       {-95.0, -112.0, -152.6, -177.5, -202.5},
-       {-101.1, -119.4, -163.3, -189.8, -216.4},
-        {-95.0, -112.4, -154.2, -179.2, -204.1},
-       {-77.4,  -91.9, -126.6, -146.9, -167.3},
-       {-50.6,  -60.3,  -83.7,  -97.0, -110.3},
-       {-17.6,  -21.4,  -30.7,  -35.3,  -39.9}};  
+       { 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},
+       { 17.56,   20.73,  28.36,   32.96,  37.58},
+       {-17.56,  -20.73, -28.36,  -32.96, -37.58},
+       {-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},
+        {-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},
+       {-17.56,  -20.73, -28.36,  -32.96, -37.58}};  
        
 const Float_t kCSideX[18][5]={
-        { 99.6,  117.5,  160.4,  186.5,  212.6},
-       { 87.6,  103.1,  140.2,  163.2,  186.2},
-       { 65.0,   76.2,  103.1,  120.2,  137.2},
-       { 34.6,   40.2,   53.6,   62.7,   71.7},
-       {    0,   -0.7,   -2.4,   -2.4,   -2.4},
-       {-34.6,  -41.5,  -58.1,  -67.2,  -76.3},
-       {-65.0,  -77.3, -106.8, -123.8, -140.9},
-       {-87.6, -103.7, -142.6, -165.6, -188.6},
-       {-99.6, -117.7, -161.2, -187.3, -213.5},
-       {-99.6, -117.5, -160.4, -186.5, -212.6},
-       {-87.6, -103.1, -140.2, -163.2, -186.2},
-       {-65.0,  -76.2, -103.1, -120.2, -137.2},
-       {-34.6,  -40.2,  -53.6,  -62.7,  -71.7},
-       {    0,    0.7,    2.4,    2.4,    2.4},
-       { 34.6,   41.5,   58.1,   67.2,   76.3},
-       { 65.0,   77.3,  106.8,  123.8,  140.9},
-       { 87.6,  103.7,  142.6,  165.6,  188.6},
-       { 99.6,  117.7,  161.2,  187.3,  213.5}};
+        { 99.56,  117.59,  160.82,  186.92,  213.11},
+       { 87.56,  103.4,   141.42,  164.37,  187.41},
+       { 64.99,   76.75,  104.97,  122,     139.1},
+       { 34.58,   40.84,   55.85,   64.92,   74.01},
+       {    0,    0,    0,   0,   0},
+       {-34.58,  -40.84,  -55.85,  -64.92,  -74.01},
+       {-64.99,  -76.75, -104.97, -122,    -139.1},
+       {-87.56, -103.4,  -141.42, -164.37, -187.41},
+       {-99.56, -117.59, -160.82, -186.92, -213.11},
+       {-99.56, -117.59, -160.82, -186.92, -213.11},
+       {-87.56, -103.4,  -141.42, -164.37, -187.41},
+       {-64.99,  -76.75, -104.97, -122,    -139.1},
+       {-34.58,  -40.84,  -55.85,  -64.92,  -74.01},
+       {    0,    0,    0,    0,    0},
+       { 34.58,   40.84,   55.85,   64.92,   74.01},
+       { 64.99,   76.75,  104.97,  122,     139.1},
+       { 87.56,  103.4,   141.42,  164.37,  187.41},
+       { 99.56,  117.59,  160.82,  186.92,  213.11}};
 
 const Float_t kCSideY[18][5]={
-        { 17.6,   21.4,   30.7,   35.3,   39.9},
-       { 50.6,   60.3,   83.7,   97.0,  110.3},
-       { 77.4,   91.9,  126.6,  146.9,  167.3},
-       { 95.0,  112.4,  154.2,  179.2,  204.1},
+        { 17.56,   20.73,   28.36,   32.96,   37.58},
+       { 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.54,  178.35,  203.35},
        {101.1,  119.4,  163.3,  189.8,  216.4},
-       { 95.0,  112.0,  152.6,  177.5,  202.5},
-       { 77.4,   91.0,  123.5,  143.9,  164.2},
-       { 50.6,   59.1,   79.5,   92.8,  106.1},
-       { 17.6,   20.1,   26.0,   30.6,   35.2},
-       {-17.6,  -21.4,  -30.7,  -35.3,  -39.9},
-       {-50.6,  -60.3,  -83.7,  -97.0, -110.3},
-       {-77.4,  -91.9, -126.6, -146.9, -167.3},
-       {-95.0, -112.4, -154.2, -179.2, -204.1},
-       {-101.1, -119.4, -163.3, -189.8, -216.4},
-        {-95.0, -112.0, -152.6, -177.5, -202.5},
-       {-77.4,  -91.0, -123.5, -143.9, -164.2},
-       {-50.6,  -59.1,  -79.5,  -92.8, -106.1},
-       {-17.6,  -20.1,  -26.0,  -30.6,  -35.2}};  
+       { 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},
+       { 17.56,   20.73,   28.36,   32.96,   37.58},
+       {-17.56,  -20.73,  -28.36,  -32.96,  -37.58},
+       {-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},
+        {-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},
+       {-17.56,  -20.73, -28.36,  -32.96,  -37.58}};  
 
 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),
@@ -132,6 +137,7 @@ AliTPCSensorTemp::AliTPCSensorTemp(): AliDCSSensor(),
   //  Standard constructor
   //
 }
+//______________________________________________________________________________________________
 
 AliTPCSensorTemp::AliTPCSensorTemp(const AliTPCSensorTemp& source) :
   AliDCSSensor(source),
@@ -144,6 +150,7 @@ AliTPCSensorTemp::AliTPCSensorTemp(const AliTPCSensorTemp& source) :
 //  Copy constructor
 //
 { }
+//______________________________________________________________________________________________
 
 AliTPCSensorTemp& AliTPCSensorTemp::operator=(const AliTPCSensorTemp& source){
 //
@@ -154,21 +161,24 @@ AliTPCSensorTemp& AliTPCSensorTemp::operator=(const AliTPCSensorTemp& source){
   
   return *this;  
 }
+//______________________________________________________________________________________________
 
-TClonesArray * AliTPCSensorTemp::ReadList(const char *fname) {
-   
-   Int_t firstSensor, lastSensor;
-   return ReadListInd(fname,firstSensor,lastSensor);
-}  
-
-TClonesArray * AliTPCSensorTemp::ReadListInd(const char *fname, 
-                                          Int_t& firstSensor,
-                                         Int_t& lastSensor) {
+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;
@@ -192,8 +202,8 @@ TClonesArray * AliTPCSensorTemp::ReadListInd(const char *fname,
   //tree->SetBranchAddress("Y",&y);
   //tree->SetBranchAddress("Z",&z);
 
-  firstSensor = (Int_t)tree->GetMinimum("ECha");
-  lastSensor = (Int_t)tree->GetMaximum("ECha");
+  // firstSensor = (Int_t)tree->GetMinimum("ECha");
+  // lastSensor = (Int_t)tree->GetMaximum("ECha");
 
   TClonesArray * array = new TClonesArray("AliTPCSensorTemp",nentries);
 
@@ -202,6 +212,8 @@ TClonesArray * AliTPCSensorTemp::ReadListInd(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);
@@ -226,10 +238,20 @@ TClonesArray * AliTPCSensorTemp::ReadListInd(const char *fname,
     if ((temp->GetType()==1) || (temp->GetType()==4)){
       temp->SetX(TMath::Cos((2*sector+1)*0.1745)*278);
     }
-    if ((temp->GetType()==2) || (temp->GetType()==3)){
-      temp->SetX(TMath::Cos((2*sector+1)*0.1745)*kIFCrad[num]);
+    if (temp->GetType()==2) {
+      temp->SetX(TMath::Cos((2*sector+1)*0.1745)*60.7);
     }
-    if ((temp->GetType()==5) || (temp->GetType()==6)){
+    if (temp->GetType()==3) {
+      if (num==0) {
+        temp->SetX(TMath::Cos((2*sector+1)*0.1745)*87.5);
+      } else {
+        temp->SetX(TMath::Cos((2*sector+1)*0.1745)*241.8);
+      }
+    } 
+    if (temp->GetType()==5){
+      temp->SetX(TMath::Cos(sector*0.524+(num+1)*0.131)*kTSrad[num]);
+    }
+    if (temp->GetType()==6){
       temp->SetX(0);
     }
     
@@ -245,38 +267,76 @@ TClonesArray * AliTPCSensorTemp::ReadListInd(const char *fname,
     if ((temp->GetType()==1) || (temp->GetType()==4)){
       temp->SetY(TMath::Sin((2*sector+1)*0.1745)*278);
     }
-    if ((temp->GetType()==2) || (temp->GetType()==3)){
-      temp->SetY(TMath::Sin((2*sector+1)*0.1745)*kIFCrad[num]);
+    if (temp->GetType()==2){
+      temp->SetY(TMath::Sin((2*sector+1)*0.1745)*60.7);
+    }
+    if (temp->GetType()==3) {
+      if (num==0) {
+        temp->SetY(TMath::Sin((2*sector+1)*0.1745)*87.5);
+      } else {
+        temp->SetY(TMath::Sin((2*sector+1)*0.1745)*241.8);
+      }
+    } 
+
+    if (temp->GetType()==5){
+      temp->SetY(TMath::Sin(sector*0.524+(num+1)*0.131)*kTSrad[num]);
     }
-    if ((temp->GetType()==5) || (temp->GetType()==6)){
+
+    if (temp->GetType()==6){
       temp->SetY(0);
     }
+
     //temp->SetZ(z);
-    if ((temp->GetType()==0 || temp->GetType()==3 || temp->GetType()==4 || temp->GetType()==5 || temp->GetType()==6) && temp->GetSide()==0) {
-      temp->SetZ(250);
+    if ((temp->GetType()==0 || 
+         temp->GetType()==4 || temp->GetType()==6) && 
+        temp->GetSide()==0) {
+             temp->SetZ(250);
+      }
+    if ((temp->GetType()==0 || temp->GetType()==4 ||
+         temp->GetType()==6) && temp->GetSide()==1){
+             temp->SetZ(-250);
+      }
+    if(temp->GetType()==2 && temp->GetSide()==0) {
+         temp->SetZ(52.4);
+      }
+    if(temp->GetType()==2 && temp->GetSide()==1) {
+         temp->SetZ(-52.4);
+      }
+
+    if(temp->GetType()==3 && temp->GetSide()==0) {
+         temp->SetZ(247);
       }
-    if ((temp->GetType()==0 || temp->GetType()==3 || temp->GetType()==4 || temp->GetType()==5 || temp->GetType()==6) && temp->GetSide()==1){
-      temp->SetZ(-250);
+    if(temp->GetType()==3 && temp->GetSide()==1) {
+         temp->SetZ(-247);
       }
-    if((temp->GetType()==1 || temp->GetType()==2) && (num==0)) {
+
+    if((temp->GetType()==1 ) && (num==0)) {
       temp->SetZ(240);
       }
-    if((temp->GetType()==1 || temp->GetType()==2) && (num==1)) {
+    if((temp->GetType()==1 ) && (num==1)) {
       temp->SetZ(168.4);
       }
-    if((temp->GetType()==1 || temp->GetType()==2) && (num==2)) {
+    if((temp->GetType()==1 ) && (num==2)) {
       temp->SetZ(51);
       }
-    if((temp->GetType()==1 || temp->GetType()==2) && (num==3)) {
+    if((temp->GetType()==1 ) && (num==3)) {
       temp->SetZ(-51);
       }
-    if((temp->GetType()==1 || temp->GetType()==2) && (num==4)) {
+    if((temp->GetType()==1 ) && (num==4)) {
       temp->SetZ(-168.4);
       }
-    if((temp->GetType()==1 || temp->GetType()==2) && (num==5)) {
+    if((temp->GetType()==1 ) && (num==5)) {
       temp->SetZ(-240);
       }
+
+    if(temp->GetType()==5 && temp->GetSide()==0) {
+         temp->SetZ(kTSz[num]);
+      }
+    if(temp->GetType()==5 && temp->GetSide()==1) {
+         temp->SetZ(-kTSz[num]);
+      }
+
+
   }
-  delete tree;  
   return array;
 }