]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - CRT/AliCRT.cxx
Remove for merge.
[u/mrichter/AliRoot.git] / CRT / AliCRT.cxx
index d05855f719009d5683c64d4221a2e07258c6643b..87a430d8e243b18e8d7a066cac777b9e65372a8c 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.6  2002/10/14 14:55:34  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.4.2.2  2002/10/10 14:40:31  hristov
-Updating VirtualMC to v3-09-02
-
-Revision 1.5  2002/10/07 11:12:26  gamez
-Cleaned up version
-
-Revision 1.4  2002/07/12 12:56:18  gamez
-Material numbers, correction
-
-Revision 1.3.2.1  2002/07/12 12:31:30  gamez
-Material numbers, correction
-
-Revision 1.3  2002/07/10 15:53:10  gamez
-Molasse redefinition
-
-Revision 1.2  2002/07/09 08:45:35  hristov
-Old style include files needed on HP (aCC)
-
-Revision 1.1  2002/06/16 17:08:19  hristov
-First version of CRT
-
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -64,156 +37,70 @@ First version of CRT
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include "AliCRT.h"
+
 #include <TTree.h>
+#include <TVirtualMC.h>
 
 #include "AliRun.h"
 #include "AliMagF.h"
+//#include "AliMC.h"
 
-#include "AliCRT.h"
-#include "AliCRTConstants.h"
-#include "AliCRThit.h"
+//#include "AliCRThit.h"
+#include "AliCRTModule.h"
 
 ClassImp(AliCRT)
 
 //_____________________________________________________________________________
 AliCRT::AliCRT()
+  : AliDetector(),
+    fModule(0)
 {
   //
-  // Default constructor for the CRT
+  // Default constructor
   //
-
-  fIshunt   = 0;
-  fHits     = 0;
-
 }
  
 //_____________________________________________________________________________
 AliCRT::AliCRT(const char *name, const char *title)
-  : AliDetector(name,title)
+  : AliDetector(name, title),
+    fModule(0)
 {
   //
-  // Standard constructor for the CRT module
+  // Standard constructor
   //
-
-  fIshunt       =  1; // All hits are associated with primary particles  
-
-  fHits         =  new TClonesArray("AliCRThit",400) ; 
-
-  gAlice->AddHitList(fHits);
-
-  SetMarkerColor(7);
-  SetMarkerStyle(2);
-  SetMarkerSize(0.4);
-
+  //fHits =  new TClonesArray("AliCRThit", 400);
+  //gAlice->GetMCApp()->AddHitList(fHits);
 }
 
 //_____________________________________________________________________________
 AliCRT::AliCRT(const AliCRT& crt)
+  : AliDetector(crt),
+    fModule(crt.fModule)
 {
   //
-  // Copy ctor.
-  //
-  crt.Copy(*this);
-}
-
-//_____________________________________________________________________________
-AliCRT& AliCRT::operator= (const AliCRT& crt)
-{
-  //
-  // Asingment operator.
+  // Copy constructor
   //
   crt.Copy(*this);
-  return *this;
 }
 
 //_____________________________________________________________________________
 AliCRT::~AliCRT()
 {
   //
-  // Standar destructor.
+  // Default destructor
   //
-  if (fHits) {
-    fHits->Delete();
-    delete fHits;
-  }
+  if ( fModule ) { delete fModule; fModule = 0; }
 }
 
 //_____________________________________________________________________________
-void AliCRT::AddHit(Int_t track, Int_t *vol, Float_t *hits)
+AliCRT& AliCRT::operator=(const AliCRT& crt)
 {
   //
-  // Add a CRT hit
-  //
-  TClonesArray &lhits = *fHits;
-  new(lhits[fNhits++]) AliCRThit(fIshunt,track,vol,hits);
-}
-
-//_____________________________________________________________________________
-void AliCRT::AddDigit(Int_t *tracks,Int_t *digits)
-{
-  // 
-  //  Add a CRT digit to the list. Dummy function.
-  //
-}
-
-//_____________________________________________________________________________
-void AliCRT::Init() const
-{
-  //
-  // Initialise ...
-  //
-
-  Int_t i;
-  //
-  if(fDebug) {
-    printf("\n%s: ",ClassName());
-    for(i=0;i<35;i++) printf("*");
-    printf(" CRT_INIT ");
-    for(i=0;i<35;i++) printf("*");
-    printf("\n%s: ",ClassName());
-    //
-    // Here the CRT initialisation code (if any!)
-    for(i=0;i<80;i++) printf("*");
-    printf("\n");
-  }
-}
-
-//_____________________________________________________________________________
-void AliCRT::ResetHits()
-{
-  // Reset number of clusters and the cluster array for this detector
-  AliDetector::ResetHits();
-}
-
-//_____________________________________________________________________________
-void AliCRT::ResetDigits()
-{
-  //
-  // Reset number of digits and the digits array for this detector
-  AliDetector::ResetDigits();
-} 
-
-//____________________________________________________________________________
-void AliCRT::FinishEvent()
-{
-// do nothing
-}
-
-//_____________________________________________________________________________
-void AliCRT::BuildGeometry()
-{
-  //
-  // Build simple ROOT TNode geometry for event display
-  //
-}
-
-//_____________________________________________________________________________
-void AliCRT::CreateGeometry()
-{
-  //
-  // Build simple ROOT TNode geometry for GEANT simulations
+  // Asingment operator.
   //
+  crt.Copy(*this);
+  return *this;
 }
 
 //_____________________________________________________________________________
@@ -232,21 +119,21 @@ void AliCRT::CreateMaterials()
   Float_t epsil, stmin, tmaxfd, deemax, stemax;
   //
   //     Aluminum 
-  AliMaterial(9,  "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-  AliMaterial(29, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-  AliMaterial(49, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(9,  "ALUMINIUM0$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(29, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(49, "ALUMINIUM2$", 26.98, 13., 2.7, 8.9, 37.2);
   //
   //     Iron 
-  AliMaterial(10, "IRON    ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(30, "IRON    ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(50, "IRON    ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(10, "IRON0$    ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(30, "IRON1$    ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(50, "IRON2$    ", 55.85, 26., 7.87, 1.76, 17.1);
   //
   //     Air 
-  AliMaterial(15, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
-  AliMaterial(35, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
-  AliMaterial(55, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
-  AliMaterial(75, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
-  AliMaterial(95, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(15, "AIR0$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(35, "AIR1$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(55, "AIR2$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(75, "AIR3$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(95, "AIR4$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
 
 
   // Scintillator material polystyrene 
@@ -261,7 +148,7 @@ void AliCRT::CreateMaterials()
   Float_t wMolasse[10] = {0.008, 0.043, 0.485, 0.007, 0.042, 0.037, 0.215, 0.023, 0.1, 0.04};
   Float_t dMolasse = 2.40;
   AliMixture(24, "Molasse$", aMolasse, zMolasse, dMolasse, 10, wMolasse);
-  
+
   // **************** 
   //     Defines tracking media parameters. 
   //     Les valeurs sont commentees pour laisser le defaut 
@@ -294,14 +181,16 @@ void AliCRT::CreateMaterials()
   AliMedium(35, "AIR_C1          ", 35, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
   AliMedium(55, "AIR_C2          ", 55, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
   AliMedium(75, "AIR_C4          ", 75, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
-  AliMedium(75, "AIR_C5          ", 95, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
+  AliMedium(95, "AIR_C5          ", 95, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
 
 
 
   // The scintillator of the CPV made of Polystyrene 
   // scintillator -> idtmed[1112]
-  AliMedium(13 , "CPV scint.      ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
-  
+  AliMedium(12 , "CPV scint.0     ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
+  AliMedium(13 , "CPV scint.1     ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
+  AliMedium(14 , "CPV scint.2     ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
+
   //     Molasse -> idtmed[1123]
   AliMedium(24 , "Molasse         ", 24, 0, xfield, xfieldm, tmaxfd, stemax, deemax, xepsil, stmin);
 
@@ -310,36 +199,16 @@ void AliCRT::CreateMaterials()
   Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
   Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
   Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
-  
+
   AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
   //    Concrete 
   AliMedium(17, "CC_C0            ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(27, "CC_C1            ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // MX24
+  AliMedium(37, "CC_C2            ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // PM25
+  AliMedium(47, "CC_C3            ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // PGC2
 
 }
-/*
-//_____________________________________________________________________________
-void AliCRT::MakeBranch(Option_t* option, const char *file)
-{
-  //
-  // Specific CRT branches
-  //
-  // Create Tree branches for the CRT.
-  Int_t buffersize = 400;
-  char branchname[10];
-  sprintf(branchname,"%s",GetName());
-
-  AliDetector::MakeBranch(option,file);
-
-  const char *cD = strstr(option,"D");
-  
-  if (cD) {
-    digits = new AliCRTdigit();
-    MakeBranchInTree(gAlice->TreeD(), branchname, "AliCRTdigit", 
-                    digits, buffersize, 1, file);
-  } 
 
-}
-*/
 //_____________________________________________________________________________
 void AliCRT::SetTreeAddress()
 {
@@ -347,12 +216,25 @@ void AliCRT::SetTreeAddress()
   TBranch *branch;
   char branchname[20];
   sprintf(branchname,"%s",GetName());
-  
   // Branch address for hit tree
-  TTree *treeH = gAlice->TreeH();
-  if (treeH && fHits) {
+  TTree *treeH = fLoader->TreeH();
+  if (treeH ) {
     branch = treeH->GetBranch(branchname);
     if (branch) branch->SetAddress(&fHits);
   }
+}
 
+//_____________________________________________________________________________
+void AliCRT::MakeBranch(Option_t* opt)
+{
+  //
+  // Initializes the branches of the CRT inside the trees written
+  // for each event.
+  //
+  const char* oH = strstr(opt, "H");
+  if ( fLoader->TreeH() && oH && (fHits == 0x0) ) {
+    fHits = new TClonesArray("AliCRThit", 1000);
+    fNhits = 0;
+  }
+  AliDetector::MakeBranch(opt);
 }