]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv5symm.cxx
Corrected setting of magnetic field
[u/mrichter/AliRoot.git] / ITS / AliITSv5symm.cxx
index 7e99fef93748d3b192b341d9e7a8e62d7b026f48..cc2c0391a8ec9c22f94e592a51b7b8e9eb22e79c 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.7  2001/02/13 16:53:35  nilsen
-Fixed a but when trying to use GEANT4. Needed to replace
-if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
-because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
-did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
-to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
-in the same way as in AliITSv5.cxx.
-
-Revision 1.6  2001/02/09 20:06:26  nilsen
-Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
-
-Revision 1.5  2001/02/09 00:05:31  nilsen
-Added fMajor/MinorVersion variables and made other changes to better make
-use of the new code changes in AliITSgeom related classes.
-
-Revision 1.4  2001/02/02 23:57:29  nilsen
-Added include file that are no londer included in AliITSgeom.h
-
-Revision 1.3  2001/01/30 09:23:13  hristov
-Streamers removed (R.Brun)
-
-Revision 1.2  2000/11/30 11:13:11  barbera
- Added changes suggested by Federico Carminati on nov, 30, 2000
-
-Revision 1.1  2000/10/07 15:46:29  barbera
-Version 5 of the geometry with symmetric services
-
-Revision 1.25  2000/10/05 20:50:00  nilsen
-Now using root generated streamers.
-
-Revision 1.14.4.12  2000/10/02 16:04:03  barbera
-Forward declarations added
-
-Revision 1.22  2000/07/10 16:07:19  fca
-Release version of ITS code
-
-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.
-
-Revision 1.14.4.2  2000/03/02 21:53:02  nilsen
-To make it compatable with the changes in AliRun/AliModule.
-
-Revision 1.14.4.1  2000/01/12 19:03:33  nilsen
-This is the version of the files after the merging done in December 1999.
-See the ReadMe110100.txt file for details
-
-Revision 1.14  1999/10/22 08:16:49  fca
-Correct destructors, thanks to I.Hrivnacova
-
-Revision 1.13  1999/10/06 10:15:19  fca
-Correct bug in allocation of layer name and add destructor
-
-Revision 1.12  1999/10/05 08:05:09  fca
-Minor corrections for uninitialised variables.
-
-Revision 1.11  1999/09/29 09:24:20  fca
-Introduction of the Copyright and cvs Log
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //
@@ -88,34 +25,35 @@ Introduction of the Copyright and cvs Log
 // Created October 7 2000.
 //
 ///////////////////////////////////////////////////////////////////////////////
-#include <iostream.h>
-#include <iomanip.h>
+#include <Riostream.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <TMath.h>
+
+#include <TBRIK.h>
+#include <TCanvas.h>
+#include <TClonesArray.h>
+#include <TFile.h>    // only required for Tracking function?
 #include <TGeometry.h>
+#include <TLorentzVector.h>
+#include <TMath.h>
 #include <TNode.h>
-#include <TTUBE.h>
-#include <TFile.h>    // only required for Tracking function?
-#include <TCanvas.h>
 #include <TObjArray.h>
-#include <TLorentzVector.h>
 #include <TObjString.h>
-#include <TClonesArray.h>
-#include <TBRIK.h>
 #include <TSystem.h>
+#include <TTUBE.h>
+#include <TVirtualMC.h>
 
-#include "AliMC.h"
 #include "AliRun.h"
-#include "../TGeant3/TGeant3.h"
 #include "AliITShit.h"
 #include "AliITSGeant3Geometry.h"
-#include "AliITS.h"
-#include "AliITSv5symm.h"
 #include "AliITSgeom.h"
-#include "AliITSgeomSPD.h"
 #include "AliITSgeomSDD.h"
+#include "AliITSgeomSPD.h"
 #include "AliITSgeomSSD.h"
+#include "AliITShit.h"
+#include "AliITSv5symm.h"
+#include "AliRun.h"
+#include "AliMC.h"
 
 ClassImp(AliITSv5symm)
  
@@ -172,7 +110,7 @@ AliITSv5symm::AliITSv5symm(const char *name, const char *title) : AliITS(name, t
     strncpy(fWrite,fEuclidGeomDet,60);
 }
 //____________________________________________________________________________
-AliITSv5symm::AliITSv5symm(const AliITSv5symm &source){
+AliITSv5symm::AliITSv5symm(const AliITSv5symm &source) : AliITS(source){
 ////////////////////////////////////////////////////////////////////////
 //     Copy Constructor for ITS version 5.
 ////////////////////////////////////////////////////////////////////////
@@ -632,7 +570,8 @@ void AliITSv5symm::InitAliITSgeom(){
 //     Based on the geometry tree defined in Geant 3.21, this
 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
 // sturture.
-    if(!(dynamic_cast<TGeant3*>(gMC))) {
+//    if(gMC->IsA()!=TGeant3::Class()) {
+    if(strcmp(gMC->GetName(),"TGeant3")) {
        Error("InitAliITSgeom",
                "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
        return;
@@ -666,8 +605,9 @@ void AliITSv5symm::InitAliITSgeom(){
     // tree its self.
     cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
     for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
-    for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++) 
-       itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
+    for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
+        strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4); 
+    // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
     mod = 0;
     for(i=0;i<nlayers;i++){
        k = 1;
@@ -678,7 +618,7 @@ void AliITSv5symm::InitAliITSgeom(){
 
     if(fITSgeom!=0) delete fITSgeom;
     nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
-    ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=22;ndet[5]=25;
+    ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=23;ndet[5]=26;
     fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
     mod = -1;
     for(lay=1;lay<=nlayers;lay++){
@@ -702,9 +642,16 @@ void AliITSv5symm::InitAliITSgeom(){
                            if(fMinorVersion==1){
                              fITSgeom->ReSetShape(kSPD,
                                                  new AliITSgeomSPD300());
-                           } else if(fMinorVersion==2)
+                           } else if(fMinorVersion==2){
+                             fITSgeom->ReSetShape(kSPD,
+                                                 new AliITSgeomSPD300());
+                           }else if(fMinorVersion==3){
+                             fITSgeom->ReSetShape(kSPD,
+                                                 new AliITSgeomSPD425Long());
+                           }else{
                              fITSgeom->ReSetShape(kSPD,
                                                  new AliITSgeomSPD300());
+                           } // end if
                    } // end for det
                } // end for k
             } // end for j
@@ -861,6 +808,6 @@ void AliITSv5symm::StepManager(){
   hits[6]=gMC->Edep();
   hits[7]=gMC->TrackTime();
   // Fill hit structure with this new hit.
-  new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+  new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
   return;
 }