]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STRUCT/AliFRAMEv2.cxx
Moving to the new VMC naming convention
[u/mrichter/AliRoot.git] / STRUCT / AliFRAMEv2.cxx
index 0e65d3623c69c79259e67e6ad4e016dd212c79fd..f7549aa20ab47f5a320a9bbdb3e175154fc62668 100644 (file)
 //  Author: A.Morsch
 //------------------------------------------------------------------------
 
+#include <TSystem.h>
+
 #include "AliFRAMEv2.h"
 #include "AliMagF.h"
 #include "AliRun.h"
-#include "TSystem.h"
  
 ClassImp(AliFRAMEv2)
  
@@ -103,7 +104,6 @@ void AliFRAMEv2::CreateGeometry()
   ppgon[2] =  18.;
   
   ppgon[3] =   2.;
-
   ppgon[4] = -376.;
   ppgon[5] =  280.;
   ppgon[6] =  421.;
@@ -117,6 +117,13 @@ void AliFRAMEv2::CreateGeometry()
 //  gMC->Gsvolu("B077", "TUBE", kAir, ptube, 3);
   gMC->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
 //
+// Reference plane for TRD
+//
+  ppgon[6] = ppgon[5] + 0.1;
+  ppgon[9] = ppgon[6];
+  gMC->Gsvolu("BREF", "PGON", kAir, ppgon, 10);
+  gMC->Gspos("BREF", 1, "B077", 0., 0., 0., 0, "ONLY");
+//
 //  The outer Frame
 //
 
@@ -404,18 +411,12 @@ void AliFRAMEv2::CreateGeometry()
   dx = rd * TMath::Sin(phi*kdeg2rad);
   dy = rd * TMath::Cos(phi*kdeg2rad);
   
-//  gMC->Gspos("B047", 1, "B076", -dx,  dy,  dz, idrotm[2004], "ONLY");
-//  gMC->Gspos("B047", 2, "B076", -dx,  dy, -dz, idrotm[2003], "ONLY");
-//  gMC->Gspos("B047", 3, "B076",  dx,  dy,  dz, idrotm[2017], "ONLY");
-//  gMC->Gspos("B047", 4, "B076",  dx,  dy, -dz, idrotm[2018], "ONLY");
 
   gMC->Gspos("B045", 1, "B076", -dx,  dy,  dz2, idrotm[2019], "ONLY");
   gMC->Gspos("B045", 2, "B076", -dx,  dy, -dz2, idrotm[2003], "ONLY"); // ?
   gMC->Gspos("B045", 3, "B076",  dx,  dy,  dz2, idrotm[2020], "ONLY");
   gMC->Gspos("B045", 4, "B076",  dx,  dy, -dz2, idrotm[2027], "ONLY");
 
-//  gMC->Gspos("BM49", 1, "B076",  dx,  dy,  0., idrotm[2020], "ONLY");
-//  gMC->Gspos("BM49", 2, "B076", -dx,  dy,  0., idrotm[2019], "ONLY");
 
 //
 //  phi = 60
@@ -424,18 +425,12 @@ void AliFRAMEv2::CreateGeometry()
   phi = 60;
   dx = rd * TMath::Sin(phi*kdeg2rad);
   dy = rd * TMath::Cos(phi*kdeg2rad);
-//  gMC->Gspos("B047", 5, "B076", -dx,  dy,  dz, idrotm[2005], "ONLY");
-//  gMC->Gspos("B047", 6, "B076", -dx,  dy, -dz, idrotm[2006], "ONLY");
-//  gMC->Gspos("B047", 7, "B076",  dx,  dy,  dz, idrotm[2016], "ONLY");
-//  gMC->Gspos("B047", 8, "B076",  dx,  dy, -dz, idrotm[2015], "ONLY");
 
   gMC->Gspos("B045", 5, "B076", -dx,  dy,  dz2, idrotm[2021], "ONLY");
   gMC->Gspos("B045", 6, "B076", -dx,  dy, -dz2, idrotm[2028], "ONLY");
   gMC->Gspos("B045", 7, "B076",  dx,  dy,  dz2, idrotm[2022], "ONLY");
   gMC->Gspos("B045", 8, "B076",  dx,  dy, -dz2, idrotm[2029], "ONLY");
 
-//  gMC->Gspos("BM49", 3, "B076",  dx,  dy,  0., idrotm[2022], "ONLY");
-//  gMC->Gspos("BM49", 4, "B076", -dx,  dy,  0., idrotm[2021], "ONLY");
 //
 //  phi = 80
 //
@@ -443,10 +438,6 @@ void AliFRAMEv2::CreateGeometry()
   phi = 80;
   dx = rd * TMath::Sin(phi*kdeg2rad);
   dy = rd * TMath::Cos(phi*kdeg2rad);
-//  gMC->Gspos("B047",  9, "B076", -dx,  dy,  dz, idrotm[2009], "ONLY");
-//  gMC->Gspos("B047", 10, "B076", -dx,  dy, -dz, idrotm[2007], "ONLY");
-//  gMC->Gspos("B047", 11, "B076",  dx,  dy,  dz, idrotm[2013], "ONLY");
-//  gMC->Gspos("B047", 12, "B076",  dx,  dy, -dz, idrotm[2014], "ONLY");
 
   gMC->Gspos("B047", 13, "B076", -dx, -dy,  dz, idrotm[2008], "ONLY");
   gMC->Gspos("B047", 14, "B076", -dx, -dy, -dz, idrotm[2010], "ONLY");
@@ -463,8 +454,6 @@ void AliFRAMEv2::CreateGeometry()
   gMC->Gspos("B045", 15, "B076",  dx, -dy,  dz2, idrotm[2025], "ONLY");
   gMC->Gspos("B045", 16, "B076",  dx, -dy, -dz2, idrotm[2033], "ONLY");
 
-//  gMC->Gspos("BM49", 5, "B076",  dx,  dy,  0., idrotm[2026], "ONLY");
-//  gMC->Gspos("BM49", 6, "B076", -dx,  dy,  0., idrotm[2023], "ONLY");
   gMC->Gspos("BM49", 7, "B076",  dx, -dy,  0., idrotm[2025], "ONLY");
   gMC->Gspos("BM49", 8, "B076", -dx, -dy,  0., idrotm[2024], "ONLY");
 
@@ -1024,6 +1013,9 @@ void AliFRAMEv2::Init()
               " FRAME "
               "**************************************\n",ClassName());
     }
+//
+// The reference volume id
+    fRefVolumeId = gMC->VolId("BREF");
 }
 
 Int_t AliFRAMEv2::IsVersion() const 
@@ -1034,7 +1026,32 @@ Int_t AliFRAMEv2::IsVersion() const
     return version;
 }
 
+void AliFRAMEv2::StepManager()
+{
+//
+// Stepmanager of AliFRAMEv2.cxx
+// Used for recording of reference tracks entering the spaceframe mother volume
+//
+  Int_t   copy, id;
+  
+  //
+  // Only charged tracks
+  if( !(gMC->TrackCharge()) ) return; 
+  //
+  // Only tracks entering mother volume
+  // 
+
+  id=gMC->CurrentVolID(copy);
+
+  if (id != fRefVolumeId)  return;
+  if(!gMC->IsTrackEntering()) return;
+  //
+  // Add the reference track
+  //
+  AddTrackReference(gAlice->GetCurrentTrackNumber());
+}
 
+