]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STRUCT/AliHALLv3.cxx
nvartrk=7 in ESE task
[u/mrichter/AliRoot.git] / STRUCT / AliHALLv3.cxx
index d1c5422a23a1ecf949a2da75e639a429465457e3..cf348da3cd1dbb3b0ac90f5315d02ef95ffae1fb 100644 (file)
@@ -32,6 +32,8 @@
 #include "AliMagF.h"
 #include "AliRun.h"
 #include "AliLog.h"
+#include "AliMC.h"
+#include "AliTrackReference.h"
 #include <TGeoVolume.h>
 #include <TGeoManager.h>
 #include <TGeoMatrix.h>
@@ -47,7 +49,7 @@
 ClassImp(AliHALL)
  
 //_____________________________________________________________________________
-AliHALLv3::AliHALLv3() : fNewShield24(0)
+AliHALLv3::AliHALLv3() : fNewShield24(0), fRefVolumeId(-1), fScoring(0), fRackShield(0)
 {
   //
   // Default constructor for the experimental Hall
@@ -56,7 +58,7 @@ AliHALLv3::AliHALLv3() : fNewShield24(0)
  
 //_____________________________________________________________________________
 AliHALLv3::AliHALLv3(const char *name, const char *title)
-  : AliHALL(name,title), fNewShield24(0)
+  : AliHALL(name,title), fNewShield24(0), fRefVolumeId(-1), fScoring(0), fRackShield(0)
 {
   //
   // Standard constructor for the experimental Hall
@@ -90,6 +92,7 @@ void AliHALLv3::CreateGeometry()
   TGeoMedium* kMedCC     = gGeoManager->GetMedium("HALL_CC_C2");
   TGeoMedium* kMedST     = gGeoManager->GetMedium("HALL_STST_C2");
   TGeoMedium* kMedAir    = gGeoManager->GetMedium("HALL_AIR_C2");
+  TGeoMedium* kMedFe     = gGeoManager->GetMedium("HALL_FE_C2");
   
   // Floor thickness 
   Float_t dyFloor  =  190.;
@@ -476,8 +479,66 @@ void AliHALLv3::CreateGeometry()
   TGeoVolume* voPx24Pl = new TGeoVolume("Px24Pl", shPx24Pl, kMedST);
   asShPx24->AddNode(voPx24Pl, 1, new TGeoTranslation(55., 0., -1205./2. + 40.));
   asHall->AddNode(asFMS, 1, new TGeoTranslation(0.,  0., 0.));
-  
+
+  //
+  // Scoring plane for beam background simulations
+  //
+  TGeoVolume* voRB24Scoring = new TGeoVolume("RB24Scoring", new TGeoTube(4.3, 300., 1.), kMedAir);
+  asHall->AddNode(voRB24Scoring, 1, new TGeoTranslation(0., 0., 735.));
+  //
+  // Extra shielding in front of racks
+  //
+  if (fRackShield) {
+    TGeoVolume* voRackShield = new TGeoVolume("RackShield", new TGeoBBox(30., 125., 50.), kMedFe);
+    asHall->AddNode(voRackShield, 1, new TGeoTranslation(85., -495., 1726.));
+  }
   //
   top->AddNode(asHall, 1, gGeoIdentity);
   
 }
+
+void AliHALLv3::Init()
+{
+  //
+  // Initialise the module after the geometry has been defined
+  //
+    if(AliLog::GetGlobalDebugLevel()>0) {
+       printf("%s: **************************************"
+              " HALL "
+              "**************************************\n",ClassName());
+       printf("\n%s:      Version 3 of HALL initialised\n\n",ClassName());
+       printf("%s: **************************************"
+              " HALL "
+              "**************************************\n",ClassName());
+    }
+//
+// The reference volume id
+    fRefVolumeId = TVirtualMC::GetMC()->VolId("RB24Scoring");
+}
+
+void AliHALLv3::StepManager()
+{
+//
+// Stepmanager of AliHALLv2
+// Used for recording of reference tracks entering scoring plane
+//
+  if (!fScoring) return;
+  Int_t   copy, id;
+  
+  //
+  // Only charged tracks
+  if( !(TVirtualMC::GetMC()->TrackCharge()) ) return; 
+  //
+  // Only tracks entering mother volume
+  // 
+
+  id=TVirtualMC::GetMC()->CurrentVolID(copy);
+
+  if ((id != fRefVolumeId))   return;
+  if(!TVirtualMC::GetMC()->IsTrackEntering()) return;
+  //
+  // Add the reference track
+  //
+  AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kHALL);
+}
+