]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv5.cxx
Release version of ITS code
[u/mrichter/AliRoot.git] / ITS / AliITSv5.cxx
index 8686d553503c249cc6c70195ae3311ac506d7237..443033fb8a7c51688d75f3c2c8a65d5a0d2c3440 100644 (file)
 
 /*
 $Log$
-Revision 1.18  2000/05/19 09:45:40  nilsen
-Fix for HP Unix and Sun systems.
-
-Revision 1.17  2000/05/10 19:57:26  nilsen
-Fixed problem with display.C and ITS versions v1 and v3.
-
-Revision 1.16  2000/03/05 00:11:03  nilsen
-Fixed merge error.
-
-Revision 1.15  2000/02/23 16:25:21  fca
-AliVMC and AliGeant3 classes introduced
-ReadEuclid moved from AliRun to AliModule
+Revision 1.14.4.4  2000/05/19 10:10:21  nilsen
+fix for bug with HP and Sun unix + fix for event display in ITS-working branch
 
 Revision 1.14.4.3  2000/03/04 23:46:38  nilsen
 Fixed up the comments/documentation.
@@ -73,6 +63,10 @@ Introduction of the Copyright and cvs Log
 #include <TGeometry.h>
 #include <TNode.h>
 #include <TTUBE.h>
+#include <TFile.h>    // only required for Tracking function?
+#include <TCanvas.h>
+#include <TObjArray.h>
+#include <TClonesArray.h>
 
 #include "AliRun.h"
 #include "TSystem.h"
@@ -91,53 +85,82 @@ AliITSv5::AliITSv5() {
 ////////////////////////////////////////////////////////////////////////
 //    Standard default constructor for the ITS version 5.
 ////////////////////////////////////////////////////////////////////////
-    fId5N = 6;
-    fId5Name = new char*[fId5N];
-    fId5Name[0] = "ITS1";
-    fId5Name[1] = "ITS2";
-    fId5Name[2] = "ITS3";
-    fId5Name[3] = "ITS4";
-    fId5Name[4] = "ITS5";
-    fId5Name[5] = "ITS6";
+
+    fIdN = 6;
+    fIdName = new TString[fIdN];
+    fIdName[0] = "ITS1";
+    fIdName[1] = "ITS2";
+    fIdName[2] = "ITS3";
+    fIdName[3] = "ITS4";
+    fIdName[4] = "ITS5";
+    fIdName[5] = "ITS6";
+    fIdSens    = new Int_t[fIdN];
+    for (Int_t i=0;i<fIdN;i++) fIdSens[i]=fIdName[i].Length();
+    fMajorVersion = 5;
+}
+//____________________________________________________________________________
+AliITSv5::AliITSv5(const AliITSv5 &source){
+////////////////////////////////////////////////////////////////////////
+//     Copy Constructor for ITS version 5.
+////////////////////////////////////////////////////////////////////////
+    if(&source == this) return;
+    printf("Not allowed to copy AliITSv5\n");
+    return;
+}
+//_____________________________________________________________________________
+AliITSv5& AliITSv5::operator=(const AliITSv5 &source){
+////////////////////////////////////////////////////////////////////////
+//    Assignment operator for the ITS version 1.
+////////////////////////////////////////////////////////////////////////
+
+    if(&source == this) return *this;
+    printf("Not allowed to copy AliITSv3\n");
+    return *this;
+
 }
 //_____________________________________________________________________________
 AliITSv5::~AliITSv5() {
 ////////////////////////////////////////////////////////////////////////
 //    Standard destructor for the ITS version 5.
 ////////////////////////////////////////////////////////////////////////
-  delete [] fId5Name;
 }
 //_____________________________________________________________________________
 AliITSv5::AliITSv5(const char *name, const char *title) : AliITS(name, title){
 ////////////////////////////////////////////////////////////////////////
 //    Standard constructor for the ITS version 5.
 ////////////////////////////////////////////////////////////////////////
-    fId5N = 6;
-    fId5Name = new char*[fId5N];
-    fId5Name[0] = "ITS1";
-    fId5Name[1] = "ITS2";
-    fId5Name[2] = "ITS3";
-    fId5Name[3] = "ITS4";
-    fId5Name[4] = "ITS5";
-    fId5Name[5] = "ITS6";
+    fIdN = 6;
+    fIdName = new TString[fIdN];
+    fIdName[0] = "ITS1";
+    fIdName[1] = "ITS2";
+    fIdName[2] = "ITS3";
+    fIdName[3] = "ITS4";
+    fIdName[4] = "ITS5";
+    fIdName[5] = "ITS6";
+    fIdSens    = new Int_t[fIdN];
+    for (Int_t i=0;i<fIdN;i++) fIdSens[i]=fIdName[i].Length();
+    fMajorVersion = 5;
 
     fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5.tme";
     fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5.euc";
 }
 //_____________________________________________________________________________
 void AliITSv5::BuildGeometry(){
+////////////////////////////////////////////////////////////////////////
+//    Geometry builder for the ITS version 5.
+////////////////////////////////////////////////////////////////////////
   //
   // Build ITS TNODE geometry for event display using detailed geometry.
   // This function builds a simple ITS geometry used by the ROOT macro
   // ITSdisplay.C.
 
-  TNode *Top;
+  TNode *top;
   TNode *nd;
-  //const int kColorITS_SPD=kRed;
-  //const int kColorITS_SDD=kGreen;
-  const int kColorITS_SSD=kBlue;
+  //const int kColorITSSPD=kRed;
+  //const int kColorITSSDD=kGreen;
+  const int kColorITSSSD=kBlue;
   //
-  Top=gAlice->GetGeometry()->GetNode("alice");
+  top=gAlice->GetGeometry()->GetNode("alice");
   AliITSgeom  *gm = this->GetITSgeom();
 
   Int_t       lay,lad,det,i;
@@ -169,7 +192,7 @@ void AliITSv5::BuildGeometry(){
                cout << "EXCEPTION in   new TRotMatrix" << endl;
                 return;
           }
-         Top->cd();
+         top->cd();
          //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det); 
          try {
               nd  = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
@@ -177,7 +200,7 @@ void AliITSv5::BuildGeometry(){
               cout << "EXCEPTION in new TNode" << endl;
               return;
          }
-         nd->SetLineColor(kColorITS_SSD);
+         nd->SetLineColor(kColorITSSSD);
          fNodes->Add(nd);
     }
 
@@ -201,7 +224,7 @@ void AliITSv5::BuildGeometry(){
                cout << "EXCEPTION in   new TRotMatrix" << endl;
                 return;
           }
-         Top->cd();
+         top->cd();
          //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det); 
          try {
               nd  = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
@@ -209,7 +232,7 @@ void AliITSv5::BuildGeometry(){
               cout << "EXCEPTION in new TNode" << endl;
               return;
          }
-         nd->SetLineColor(kColorITS_SSD);
+         nd->SetLineColor(kColorITSSSD);
          fNodes->Add(nd);
     }
 
@@ -233,7 +256,7 @@ void AliITSv5::BuildGeometry(){
                cout << "EXCEPTION in   new TRotMatrix" << endl;
                 return;
           }
-         Top->cd();
+         top->cd();
          //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det); 
          try {
               nd  = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
@@ -241,7 +264,7 @@ void AliITSv5::BuildGeometry(){
               cout << "EXCEPTION in new TNode" << endl;
               return;
          }
-         nd->SetLineColor(kColorITS_SSD);
+         nd->SetLineColor(kColorITSSSD);
          fNodes->Add(nd);
     }
  for(lay=5;lay<=5;lay++)
@@ -264,7 +287,7 @@ void AliITSv5::BuildGeometry(){
                cout << "EXCEPTION in   new TRotMatrix" << endl;
                 return;
           }
-         Top->cd();
+         top->cd();
          //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det); 
          try {
               nd  = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
@@ -272,7 +295,7 @@ void AliITSv5::BuildGeometry(){
               cout << "EXCEPTION in new TNode" << endl;
               return;
          }
-         nd->SetLineColor(kColorITS_SSD);
+         nd->SetLineColor(kColorITSSSD);
          fNodes->Add(nd);
     }
 
@@ -297,7 +320,7 @@ void AliITSv5::BuildGeometry(){
                cout << "EXCEPTION in   new TRotMatrix" << endl;
                 return;
           }
-         Top->cd();
+         top->cd();
           //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det); 
          try {
               nd  = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
@@ -305,12 +328,12 @@ void AliITSv5::BuildGeometry(){
               cout << "EXCEPTION in new TNode" << endl;
               return;
          }
-         nd->SetLineColor(kColorITS_SSD);
+         nd->SetLineColor(kColorITSSSD);
          fNodes->Add(nd);
     }
 
 
-}
+} 
 //_____________________________________________________________________________
 void AliITSv5::CreateMaterials(){
 ////////////////////////////////////////////////////////////////////////
@@ -547,17 +570,6 @@ void AliITSv5::Init(){
 ////////////////////////////////////////////////////////////////////////
 //     Initialise the ITS after it has been created.
 ////////////////////////////////////////////////////////////////////////
-    Int_t i,j,l;
-
-    fIdN    = fId5N;
-    fIdName = new char*[fId5N];
-    fIdSens = new Int_t[fId5N];
-    for(i=0;i<fId5N;i++) {
-       l = strlen(fId5Name[i]);
-       fIdName[i] = new char[l+1];
-       for(j=0;j<l;j++) fIdName[i][j] = fId5Name[i][j];
-       fIdName[i][l] = '\0'; // Null terminate this string.
-    } // end for i
 
     AliITS::Init();
     fMajorVersion = 5;
@@ -732,23 +744,16 @@ void AliITSv5::Streamer(TBuffer &R__b){
 // only streams the AliITS class as it is required. Since this class
 // dosen't contain any "real" data to be saved, it doesn't.
 ////////////////////////////////////////////////////////////////////////
+
    if (R__b.IsReading()) {
       Version_t R__v = R__b.ReadVersion(); 
       if (R__v==1) {
          AliITS::Streamer(R__b);
-         // This information does not need to be read. It is "hard wired"
-         // into this class via its creators.
-         //R__b >> fId5N;
-         //R__b.ReadArray(fId5Name);
       }else{
+         AliITS::Streamer(R__b);
       } // end if R__v==1
    } else {
       R__b.WriteVersion(AliITSv5::IsA());
       AliITS::Streamer(R__b);
-      // This information does not need to be saved. It is "hard wired"
-      // into this class via its creators.
-      //R__b << fId5N;
-      //R__b.WriteArray(fId5Name, __COUNTER__);
    } // end if R__b.IsReading()
 }
-