]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSvPPRcoarseasymm.cxx
Updates concerning the geometry: versioning system, new V11hybrid version, bug fixes...
[u/mrichter/AliRoot.git] / ITS / AliITSvPPRcoarseasymm.cxx
index 12ff29b85cf17a14fd9d657f6e1f6c79f629bd06..8befa6e4c7e542388acbf3de1824fb525b458dbc 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.27  2001/10/18 12:26:38  barbera
-Six cylinders definition in BuildGeometry() improved by comparison with CreateGeometry()
-
-Revision 1.26  2001/05/25 15:59:59  morsch
-Overlaps corrected. (R. Barbera)
-
-Revision 1.25  2001/05/03 08:40:15  barbera
-Volume ITSD slightly modified to be consistent with v5. Some improvement in the printouts. The last commit did not complete successfully.
-
-Revision 1.23  2001/04/04 07:02:16  barbera
-Position of the cylinders holding rails corrected
-
-Revision 1.22  2001/03/29 22:01:53  barbera
-New flag added to change the material for some service supports as asked by the PMD people. Some changes to the services due to the new drawings from the engineers
-
-Revision 1.21  2001/03/29 05:28:56  barbera
-Rails material changed from aluminum to carbon fiber according with the decision of the last Technical Board
-
-Revision 1.20  2001/03/28 06:40:21  barbera
-Central and services mother volumes made consistenf for detailed and coarse geometry. Switch for rails added to the coarse geometries
-
-Revision 1.19  2001/03/13 18:13:30  barbera
-Some mother volumes sligthly modified to eliminate an overlap with the absorber
-
-Revision 1.18  2001/02/19 09:44:16  barbera
-Copy no.2 of volume ICO2 re-inserted
-
-Revision 1.17  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.16  2001/01/30 09:23:13  hristov
-Streamers removed (R.Brun)
-
-Revision 1.15  2001/01/17 07:41:29  barbera
-Some media parameters modified
-
-Revision 1.14  2001/01/15 13:13:53  barbera
-Some comments added
-
-Revision 1.13  2000/12/10 16:00:45  barbera
-Added last definition of special media like end-ladder boxes and cones
-
-Revision 1.12  2000/11/02 15:44:23  barbera
-Services on the opposite side w.r.t the absorber modified to make room for rails
-
-Revision 1.10  2000/10/27 17:19:50  barbera
-Position of rails w.r.t. the interaction point corrected.
-
-Revision 1.9  2000/10/27 13:31:29  barbera
-Rails between ITS and TPC added.
-
-Revision 1.8  2000/10/27 13:03:08  barbera
-Small changes in the SPD volumes and materials
-
-Revision 1.6  2000/10/16 14:45:37  barbera
-Mother volume ITSD modified to avoid some overlaps
-
-Revision 1.5  2000/10/16 13:49:15  barbera
-Services volumes slightly modified and material added following Pierluigi Barberis' information
-
-Revision 1.4  2000/10/07 15:33:07  barbera
-Small corrections to the ITSV mother volume
-
-Revision 1.3  2000/10/07 13:06:50  barbera
-Some new materials and media defined
-
-Revision 1.2  2000/10/07 10:58:15  barbera
-Mother volume ITSV corrected
-
-Revision 1.1  2000/10/06 23:09:24  barbera
-New coarse geometry (asymmetric services
-
-Revision 1.20  2000/10/02 21:28:08  fca
-Removal of useless dependecies via forward declarations
-
-Revision 1.19  2000/07/10 16:07:19  fca
-Release version of ITS code
-
-Revision 1.14.2.2  2000/05/19 10:09:21  nilsen
-fix for bug with HP and Sun unix + fix for event display in ITS-working branch
-
-Revision 1.14.2.1  2000/03/04 23:45:19  nilsen
-Fixed up the comments/documentation.
-
-Revision 1.14  1999/11/25 06:52:56  fca
-Correct value of drca
-
-Revision 1.13.2.1  1999/11/25 06:52:21  fca
-Correct value of drca
-
-Revision 1.13  1999/10/27 11:16:26  fca
-Correction of problem in geometry
-
-Revision 1.12  1999/10/22 08:25:25  fca
-remove double definition of destructors
-
-Revision 1.11  1999/10/22 08:16:49  fca
-Correct destructors, thanks to I.Hrivnacova
-
-Revision 1.10  1999/10/06 19:56:50  fca
-Add destructor
-
-Revision 1.9  1999/10/05 08:05:09  fca
-Minor corrections for uninitialised variables.
-
-Revision 1.8  1999/09/29 09:24:20  fca
-Introduction of the Copyright and cvs Log
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -143,30 +32,32 @@ Introduction of the Copyright and cvs Log
 ///////////////////////////////////////////////////////////////////////////////
 #include <Riostream.h> 
 #include <TMath.h>
+#include <TNode.h>
+#include <TObjArray.h>
 #include <TRandom.h>
+#include <TTUBE.h>
 #include <TVector.h>
+#include <TVirtualMC.h>
 #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 <TGeoManager.h>
 
-#include "AliMC.h"
 #include "AliMagF.h"
 #include "AliConst.h"
-
 #include "AliITShit.h"
 #include "AliITSvPPRcoarseasymm.h"
+#include "AliMagF.h"
 #include "AliRun.h"
 
-
 ClassImp(AliITSvPPRcoarseasymm)
  
 //_____________________________________________________________________________
-AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm() {
+AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm():
+AliITS(),
+fMajorVersion(IsVersion()),
+fMinorVersion(0),
+fRails(0),
+fSuppMat(0),
+fIgm(kvPPRcourseasymm) {
 ////////////////////////////////////////////////////////////////////////
 //    Standard default constructor for the ITS version 6.
 ////////////////////////////////////////////////////////////////////////
@@ -174,11 +65,15 @@ AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm() {
     fIdN = 0;
     fIdName = 0;
     fIdSens    = 0;
-    fMajorVersion = 9;
-    fMinorVersion = 0;
 }
 //_____________________________________________________________________________
-AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const char *name, const char *title) : AliITS(name, title){
+AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const char *name, const char *title) : 
+AliITS(name, title),
+fMajorVersion(IsVersion()),
+fMinorVersion(0),
+fRails(0),
+fSuppMat(0),
+fIgm(kvPPRcourseasymm) {
 ////////////////////////////////////////////////////////////////////////
 //    Standard constructor for the ITS version 6.
 ////////////////////////////////////////////////////////////////////////
@@ -193,26 +88,6 @@ AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const char *name, const char *title
     fIdName[5] = "ITS6";
     fIdSens    = new Int_t[fIdN];
     for (Int_t i=0;i<fIdN;i++) fIdSens[i]=0;
-    fMajorVersion = 9;
-    fMinorVersion = 0;
-}
-//____________________________________________________________________________
-AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const AliITSvPPRcoarseasymm &source){
-////////////////////////////////////////////////////////////////////////
-//     Copy Constructor for ITS version 6.
-////////////////////////////////////////////////////////////////////////
-    if(&source == this) return;
-    Warning("Copy Constructor","Not allowed to copy AliITSvPPRcoarseasymm");
-    return;
-}
-//_____________________________________________________________________________
-AliITSvPPRcoarseasymm& AliITSvPPRcoarseasymm::operator=(const AliITSvPPRcoarseasymm &source){
-////////////////////////////////////////////////////////////////////////
-//    Assignment operator for the ITS version 6.
-////////////////////////////////////////////////////////////////////////
-  if(&source == this) return *this;
-    Warning("= operator","Not allowed to copy AliITSvPPRcoarseasymm");
-  return *this;
 }
 //_____________________________________________________________________________
 AliITSvPPRcoarseasymm::~AliITSvPPRcoarseasymm() {
@@ -269,137 +144,161 @@ void AliITSvPPRcoarseasymm::BuildGeometry(){
 }
 //_____________________________________________________________________________
 void AliITSvPPRcoarseasymm::CreateGeometry(){
-////////////////////////////////////////////////////////////////////////
-//    This routine defines and Creates the geometry for version 6 of the ITS.
-////////////////////////////////////////////////////////////////////////
-  
-  //INNER RADII OF THE SILICON LAYERS 
-  Float_t rl[6]    = { 3.8095,7.,15.,24.,38.5,43.5765 };   
-  //THICKNESSES OF LAYERS (in % radiation length)
-  Float_t drl[6]   = { 1.03,1.03,0.94,0.95,0.91,0.87 };   
-  //HALF LENGTHS OF LAYERS  
-  Float_t dzl[6]   = { 14.35,14.35,25.1,32.1,49.405,55.27 };
-  //LENGTHS OF END-LADDER BOXES (ALL INCLUDED)
-  Float_t dzb[6]   = { 12.4,12.4,13.5,15.,7.5,7.5 };   
-  //THICKNESSES OF END-LADDER BOXES (ALL INCLUDED)
-  Float_t drb[6]   = { rl[1]-rl[0],0.2,5.,5.,4.,4. };        
+    ////////////////////////////////////////////////////////////////////////
+    // This routine defines and Creates the geometry for version 6 of the ITS.
+    ////////////////////////////////////////////////////////////////////////
+  
+    //INNER RADII OF THE SILICON LAYERS 
+    Float_t rl[6]    = { 3.8095,7.,15.,24.,38.5,43.5765 };   
+    //THICKNESSES OF LAYERS (in % radiation length)
+    Float_t drl[6]   = { 1.03,1.03,0.94,0.95,0.91,0.87 };   
+    //HALF LENGTHS OF LAYERS  
+    Float_t dzl[6]   = { 14.35,14.35,25.1,32.1,49.405,55.27 };
+    //LENGTHS OF END-LADDER BOXES (ALL INCLUDED)
+    Float_t dzb[6]   = { 12.4,12.4,13.5,15.,7.5,7.5 };   
+    //THICKNESSES OF END-LADDER BOXES (ALL INCLUDED)
+    Float_t drb[6]   = { rl[1]-rl[0],0.2,5.,5.,4.,4. };        
 
  
-  Float_t dits[3], rlim, zmax;
-  Float_t zpos;
-  Float_t pcits[100], ztpc;
-  Int_t idrotm[1999], i;
-  Float_t dgh[100];
-  
-  Int_t rails = 1;       // flag for rails (1 --> rails in; 0 --> rails out)
-  Int_t suppmat = 0;     // flag to change the material of the services
-                         // supports (=0 copper, =1 aluminum, =2 carbon)  
-  rails = GetRails();
-  
-  if(rails != 0 && rails != 1) {
-     cout << "ITS - WARNING: the switch for rails is not set neither to 0 (rails out) nor to 1 (rails in)." 
-     " The default value of 1 (rails in) will be used." << endl;
-  }  
-  
-  if (rails == 0 ) {
-     cout << "ITS: Rails are out." << endl; 
-  } else {
-     cout << "ITS: Rails are in." << endl;
-  }      
-  
-  suppmat = GetSupportMaterial();   
-  
-  if (suppmat != 0 && suppmat != 1 && suppmat != 2) {
-     cout << "ITS - WARNING: the flag for the material of services supports is not set neither to 0 (copper) nor to 1 (aluminum) nor to 2 (carbon)." 
-     " The default value of 0 (copper) will be used." << endl;
-  }  
-  
-  if (suppmat == 0) {
-     cout << "ITS: The material of the services supports is copper." << endl; 
-  } else if (suppmat == 1){
-     cout << "ITS: The material of the services supports is aluminum." << endl;
-  } else {
-     cout << "ITS: The material of the services supports is carbon." << endl;
-  }      
+    Float_t dits[3], rlim, zmax;
+    Float_t zpos;
+    Float_t pcits[100], ztpc;
+    Int_t idrotm[1999], i;
+    Float_t dgh[100];
+  
+    Int_t rails = 1;       // flag for rails (1 --> rails in; 0 --> rails out)
+    Int_t suppmat = 0;     // flag to change the material of the services
+                           // supports (=0 copper, =1 aluminum, =2 carbon)
+    // These constant character strings are set by cvs during commit
+    // do not change them unless you know what you are doing!
+    const Char_t *cvsDate="$Date$";
+    const Char_t *cvsRevision="$Revision$";
+    rails = GetRails();
+  
+    if(rails != 0 && rails != 1) {
+        cout << "ITS - WARNING: the switch for rails is not set "
+            "neither to 0 (rails out) nor to 1 (rails in)." 
+            " The default value of 1 (rails in) will be used." << endl;
+    }  // end if
+  
+    if (rails == 0 ) {
+        cout << "ITS: Rails are out." << endl; 
+    } else {
+        cout << "ITS: Rails are in." << endl;
+    } // end if 
+    suppmat = GetSupportMaterial();   
+  
+    if (suppmat != 0 && suppmat != 1 && suppmat != 2) {
+        cout << "ITS - WARNING: the flag for the material of "
+            "services supports is not set neither to 0 (copper) "
+            "nor to 1 (aluminum) nor to 2 (carbon)." 
+            " The default value of 0 (copper) will be used." << endl;
+    }   // end if
+  
+    if (suppmat == 0) {
+        cout << "ITS: The material of the services supports is copper." 
+             << endl; 
+    } else if (suppmat == 1){
+        cout << "ITS: The material of the services supports is aluminum." 
+             << endl;
+    } else {
+        cout << "ITS: The material of the services supports is carbon." 
+             << endl;
+    } // end if
       
 
-  Int_t *idtmed = fIdtmed->GetArray()-199;
+    Int_t *idtmed = fIdtmed->GetArray()-199;
   
-  //     CONVERT INTO CM (RL(SI)=9.36 CM) 
-  for (i = 0; i < 6; ++i) {
-    drl[i] = drl[i] / 100. * 9.36;
-  }
+    //     CONVERT INTO CM (RL(SI)=9.36 CM) 
+    for (i = 0; i < 6; ++i) {
+        drl[i] = drl[i] / 100. * 9.36;
+    } // end if
     
-  //     FIELD CAGE HALF LENGTH 
-  
-  rlim  = 50.;
-  zmax  = 74.;
-  ztpc = 284.;
-  
-  // --- Define ghost volume containing the whole ITS (including services) 
-  //     and fill it with air 
-  
-  dgh[0] = 0.;
-  dgh[1] = 360.;
-  dgh[2] = 16.;
-  dgh[3] = -ztpc-5.-0.1;
-  dgh[4] = 46;   
-  dgh[5] = 85.;
-  dgh[6] = -ztpc;
-  dgh[7] = 46;   
-  dgh[8] = 85.;
-  dgh[9] = -ztpc;
-  dgh[10] = 46;  
-  dgh[11] = rlim+6;
-  dgh[12] = -97.5;
-  dgh[13] = 46;  
-  dgh[14] = rlim+6;
-  dgh[15] = -zmax;
-  dgh[16] = 46;  
-  dgh[17] = rlim+6;
-  dgh[18] = -48;   
-  dgh[19] = 6;
-  dgh[20] = rlim+6;
-  dgh[21] = -28.6;   
-  dgh[22] = 6;
-  dgh[23] = rlim+6;    
-  dgh[24] = -27.6;  
-  dgh[25] = 3.295;
-  dgh[26] = rlim+6; 
-  dgh[27] = 27.6;   
-  dgh[28] = 3.295;
-  dgh[29] = rlim+6;
-  dgh[30] = 28.6;   
-  dgh[31] = 6;
-  dgh[32] = rlim+6;
-  dgh[33] = 48;   
-  dgh[34] = 6;
-  dgh[35] = rlim+6;  
-  dgh[36] = zmax;
-  dgh[37] = 46;
-  dgh[38] = rlim+6;
-  dgh[39] = 97.5;
-  dgh[40] = 46;  
-  dgh[41] = rlim+6;
-  dgh[42] = ztpc;
-  dgh[43] = 62;     
-  dgh[44] = 62+4.;  
-  dgh[45] = ztpc;
-  dgh[46] = 62;     
-  dgh[47] = 85.;
-  dgh[48] = ztpc+4.+0.1;
-  dgh[49] = 62.4;
-  dgh[50] = 85.;
-  gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 51);
-  
-  // --- Place the ghost volume in its mother volume (ALIC) and make it 
-  //     invisible 
-  
-  gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
-  //gMC->Gsatt("ITSV", "SEEN", 0); 
-
-
-  // --- Define ghost volume containing the six layers and fill it with air 
+    //     FIELD CAGE HALF LENGTH 
+  
+    rlim  = 50.;
+    zmax  = 74.;
+    ztpc = 284.;
+  
+    // --- Define ghost volume containing the whole ITS (including services) 
+    //     and fill it with air 
+    /*
+    dgh[0] = 0.;
+    dgh[1] = 360.;
+    dgh[2] = 16.;
+    dgh[3] = -ztpc-5.-0.1;
+    dgh[4] = 46;   
+    dgh[5] = 85.;
+    dgh[6] = -ztpc;
+    dgh[7] = 46;   
+    dgh[8] = 85.;
+    dgh[9] = -ztpc;
+    dgh[10] = 46;  
+    dgh[11] = rlim+6;
+    dgh[12] = -97.5;
+    dgh[13] = 46;  
+    dgh[14] = rlim+6;
+    dgh[15] = -zmax;
+    dgh[16] = 46;  
+    dgh[17] = rlim+6;
+    dgh[18] = -48;   
+    dgh[19] = 6;
+    dgh[20] = rlim+6;
+    dgh[21] = -28.6;   
+    dgh[22] = 6;
+    dgh[23] = rlim+6;    
+    dgh[24] = -27.6;  
+    dgh[25] = 3.295;
+    dgh[26] = rlim+6; 
+    dgh[27] = 27.6;   
+    dgh[28] = 3.295;
+    dgh[29] = rlim+6;
+    dgh[30] = 28.6;   
+    dgh[31] = 6;
+    dgh[32] = rlim+6;
+    dgh[33] = 48;   
+    dgh[34] = 6;
+    dgh[35] = rlim+6;  
+    dgh[36] = zmax;
+    dgh[37] = 46;
+    dgh[38] = rlim+6;
+    dgh[39] = 97.5;
+    dgh[40] = 46;  
+    dgh[41] = rlim+6;
+    dgh[42] = ztpc;
+    dgh[43] = 62;     
+    dgh[44] = 62+4.;  
+    dgh[45] = ztpc;
+    dgh[46] = 62;     
+    dgh[47] = 85.;
+    dgh[48] = ztpc+4.+0.1;
+    dgh[49] = 62.4;
+    dgh[50] = 85.;
+    gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 51);
+  
+    // --- Place the ghost volume in its mother volume (ALIC) and make it 
+    //     invisible 
+  
+    gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
+    //gMC->Gsatt("ITSV", "SEEN", 0);
+    */
+    TGeoVolumeAssembly *itsV = gGeoManager->MakeVolumeAssembly("ITSV");
+    const Int_t length=100;
+    Char_t vstrng[length];
+    if(fIgm.WriteVersionString(vstrng,length,(AliITSVersion_t)IsVersion(),
+                               fMinorVersion,cvsDate,cvsRevision))
+        itsV->SetTitle(vstrng);
+
+    TGeoVolume *alic = gGeoManager->GetVolume("ALIC");
+    if(alic==0) {
+        Error("CreateGeometry","alic=0");
+        return;
+    } // end if
+    // See idrotm[199] for angle definitions.
+    //alic->AddNode(itsV,1,new TGeoRotation("", 90.,180., 90.,90., 180.,0.));
+    alic->AddNode(itsV,1,0);
+
+    // --- Define ghost volume containing the six layers and fill it with air 
   
   dgh[0] = 0.;
   dgh[1] = 360.;
@@ -1007,7 +906,7 @@ void AliITSvPPRcoarseasymm::CreateMaterials(){
   // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
   // AliITSvPPRcoarseasymm.
   // In general it is automatically replaced by
-  // the CreatMaterials routine defined in AliITSv?. Should the function
+  // the CreateMaterials routine defined in AliITSv?. Should the function
   // CreateMaterials not exist for the geometry version you are using this
   // one is used. See the definition found in AliITSv5 or the other routine
   // for a complete definition.
@@ -1237,7 +1136,7 @@ void AliITSvPPRcoarseasymm::Init(){
 }  
  
 //_____________________________________________________________________________
-void AliITSvPPRcoarseasymm::DrawModule(){
+void AliITSvPPRcoarseasymm::DrawModule() const {
 ////////////////////////////////////////////////////////////////////////
 //     Draw a shaded view of the FMD version 6.
 ////////////////////////////////////////////////////////////////////////
@@ -1360,7 +1259,7 @@ void AliITSvPPRcoarseasymm::StepManager(){
     hits[5]=momentum[2];
     hits[6]=gMC->Edep();
     hits[7]=gMC->TrackTime();
-//    new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+//    new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
 //
 // no hits for this coarse asymmetric version.
 //