]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONv0.cxx
Global transformation correction (ivana)
[u/mrichter/AliRoot.git] / MUON / AliMUONv0.cxx
index d8d5b851c637eea44e73e270bff78193aa41d8ed..05468bf2165b228facdcef366832edc7e51b72b1 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.18  2001/04/06 11:24:43  morsch
-Dependency on implementations of AliSegmentation and AliMUONResponse moved to AliMUONFactory class.
-Static method Build() builds the MUON system out of chambers, segmentation and response.
-
-Revision 1.17  2001/03/17 10:07:20  morsch
-Correct inconsistent variable name / method name / comments.
-
-Revision 1.16  2001/01/27 08:50:50  morsch
-Call non default constructors of segmentation classes.
-
-Revision 1.15  2001/01/17 20:57:45  hristov
-Unused variable removed
-
-Revision 1.14  2000/12/21 22:42:55  morsch
-Constructor contains default set-up for segmentation.
-Record charged particles only.
-
-Revision 1.13  2000/10/06 10:03:38  morsch
-Call to gMC->VolId() moved to Init()
-
-Revision 1.12  2000/10/02 21:28:09  fca
-Removal of useless dependecies via forward declarations
-
-Revision 1.11  2000/06/27 07:31:07  morsch
-fChambers = 0; deleted from constructor.
-
-Revision 1.10  2000/06/26 14:02:38  morsch
-Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
-
-Revision 1.9  2000/06/15 07:58:49  morsch
-Code from MUON-dev joined
-
-Revision 1.8.4.9  2000/06/12 19:20:49  morsch
-Constructor sets default geometry, segmentation and response parameters.
-
-Revision 1.8.4.8  2000/06/09 21:55:28  morsch
-Most coding rule violations corrected.
-
-Revision 1.8.4.7  2000/05/02 13:15:18  morsch
-Coding rule violations RS3, RN13 corected
-
-Revision 1.8.4.6  2000/05/02 10:24:26  morsch
-Public access to fdGas and fdAlu of AliMUONChamber replaced by getters.
-
-Revision 1.8.4.5  2000/04/26 19:58:47  morsch
-Obsolete reference to trig_ removed.
-
-Revision 1.8.4.4  2000/04/19 19:42:47  morsch
-change NCH to kNCH
-
-Revision 1.8.4.3  2000/02/17 08:17:43  morsch
-Gammas and neutrons are also scored in the stepmanager
-*/
+/* $Id$ */
 
 /////////////////////////////////////////////////////////
 //  Manager and hits classes for set:MUON version 0    //
 /////////////////////////////////////////////////////////
 
-#include <TTUBE.h>
-#include <TNode.h> 
-#include <TRandom.h> 
 #include <TLorentzVector.h> 
-#include <iostream.h>
+#include <TVirtualMC.h>
 
-#include "AliMUONv0.h"
-#include "AliMUONChamber.h"
-#include "AliRun.h"
-#include "AliMC.h"
-#include "AliMagF.h"
-#include "AliMUONHit.h"
-#include "AliMUONPadHit.h"
-#include "AliCallf77.h"
 #include "AliConst.h" 
+#include "AliMUONChamber.h"
+#include "AliMUONGeometryModule.h"
 #include "AliMUONConstants.h"
 #include "AliMUONFactory.h"
+#include "AliMUONHit.h"
+#include "AliMUONv0.h"
+#include "AliMagF.h"
+#include "AliRun.h"
+#include "AliMC.h"
+#include "AliLog.h"
+
 ClassImp(AliMUONv0)
  
 //___________________________________________
-AliMUONv0::AliMUONv0() : AliMUON()
+AliMUONv0::AliMUONv0() 
+  : AliMUON()
 {
 // Constructor
     fChambers = 0;
@@ -101,12 +46,14 @@ AliMUONv0::AliMUONv0() : AliMUON()
  
 //___________________________________________
 AliMUONv0::AliMUONv0(const char *name, const char *title)
-       : AliMUON(name,title)
+  : AliMUON(name,title)
 {
 // Constructor
-    AliMUONFactory::Build(this, "default");
+    AliMUONFactory factory;
+    factory.Build(this, title);
 }
 
+//___________________________________________
 void AliMUONv0::CreateGeometry()
 {
 // Creates coarse geometry for hit density simulations
@@ -128,12 +75,12 @@ void AliMUONv0::CreateGeometry()
         dAlu=iChamber->DAlu();
         if (ch < AliMUONConstants::NTrackingCh()) {
           // tracking chambers
-            sprintf(alu,"CA0%1d",ch);
-            sprintf(gas,"CG0%1d",ch);   
+            sprintf(alu,"SA0%1d",ch);
+            sprintf(gas,"SG0%1d",ch);   
         } else {
           // trigger chambers
-            sprintf(alu,"CA%2d",ch);
-            sprintf(gas,"CG%2d",ch);    
+            sprintf(alu,"SA%2d",ch);
+            sprintf(gas,"SG%2d",ch);    
         }
 //
         tpar[0] = iChamber->RInner(); 
@@ -150,7 +97,11 @@ void AliMUONv0::CreateGeometry()
         }
         gMC->Gspos(gas, 1, alu,  0., 0., 0., 0, "ONLY");
         if (ch == 4 || ch ==5) {
-            gMC->Gspos(alu, 1, "DDIP", 0., 0., zpos, 0, "ONLY");
+            if (gMC->VolId("DDIP")) {
+                gMC->Gspos(alu, 1, "DDIP", 0., 0., zpos, 0, "ONLY");
+            } else {
+                gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY");
+            }
         } else {
             gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY");
         }
@@ -161,23 +112,29 @@ void AliMUONv0::CreateGeometry()
 void AliMUONv0::CreateMaterials()
 {
 // Creates materials for coarse geometry
-    AliMaterial(15, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
-    AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-
-    Float_t epsil  = .001; // Tracking precision, 
-    Float_t stemax = -1.;  // Maximum displacement for multiple scat 
-    Float_t tmaxfd = -20.; // Maximum angle due to field deflection 
-    Float_t deemax = -.3;  // Maximum fractional energy loss, DLS 
-    Float_t stmin  = -.8;
-    Int_t isxfld   = gAlice->Field()->Integ();
-    Float_t sxmgmx = gAlice->Field()->Max();
-
-    //
-    //    Air 
-    AliMedium(1, "AIR_CH_US         ", 15, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
-    AliMedium(4, "ALU_CH_US          ", 9, 0, isxfld, sxmgmx, tmaxfd, fMaxStepAlu, 
+// Air
+  Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
+  Float_t zAir[4]={6.,7.,8.,18.};
+  Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
+  Float_t dAir = 1.20479E-3;
+  AliMixture(15, "AIR$      ", aAir,  zAir, dAir,4, wAir);
+  //  AliMaterial(15, "AIR$      ", 14.61,  7.3, .001205, 30423.24, 67500);
+  AliMaterial( 9, "ALUMINIUM$", 26.98, 13. , 2.7, 8.9, 37.2);
+
+  Float_t epsil  = .001; // Tracking precision, 
+  Float_t stemax = -1.;  // Maximum displacement for multiple scat 
+  Float_t tmaxfd = -20.; // Maximum angle due to field deflection 
+  Float_t deemax = -.3;  // Maximum fractional energy loss, DLS 
+  Float_t stmin  = -.8;
+  Int_t isxfld   = gAlice->Field()->Integ();
+  Float_t sxmgmx = gAlice->Field()->Max();
+  
+  //
+  //    Air 
+  AliMedium(1, "AIR_CH_US         ", 15, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(4, "ALU_CH_US         ",  9, 0, isxfld, sxmgmx, tmaxfd, fMaxStepAlu, 
            fMaxDestepAlu, epsil, stmin);
-
+  
 }
 
 void AliMUONv0::Init()
@@ -186,82 +143,22 @@ void AliMUONv0::Init()
    // Initialize Tracking Chambers
    //
     char vName[8];
-    printf("\n\n\n Start Init for version 0 - CPC chamber type\n\n\n");
+    AliInfo("\n\n\n Start Init for version 0 - CPC chamber type\n\n\n");
     for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
 // Initialise chamber
        ((AliMUONChamber*) (*fChambers)[i])->Init();
 // Set sensitive volume Id
        if (i < AliMUONConstants::NTrackingCh()) {
            // tracking chambers
-           sprintf(vName,"CG0%1d",i);   
+           sprintf(vName,"SG0%1d",i);   
        } else {
            // trigger chambers
-           sprintf(vName,"CG%2d",i);    
+           sprintf(vName,"SG%2d",i);    
        }
-       ((AliMUONChamber*) (*fChambers)[i])->SetGid(gMC->VolId(vName));
-    }
-}
-
-void AliMUONv0::StepManager()
-{
-//
-// Step manager for hit density simulations
-  Int_t          copy, id;
-  static Int_t   idvol;
-  static Int_t   vol[2];
-  Int_t          ipart;
-  TLorentzVector pos;
-  TLorentzVector mom;
-  Float_t        theta,phi;
-  
-  //  modifs perso
-  static Float_t hits[15];
-
-  TClonesArray &lhits = *fHits;
-  //
-  // Only gas gap inside chamber
-  // Tag chambers and record hits when track enters 
-  idvol=-1;
-  id=gMC->CurrentVolID(copy);
-  
-    for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
-      if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){ 
-         vol[0]=i; 
-         idvol=i-1;
-      }
+       //((AliMUONChamber*) (*fChambers)[i])->SetGid(gMC->VolId(vName));
+       ((AliMUONChamber*) (*fChambers)[i])
+          ->GetGeometry()->SetSensitiveVolume(gMC->VolId(vName));
     }
-    if (idvol == -1) return;
-  //
-  // Get current particle id (ipart), track position (pos)  and momentum (mom) 
-  gMC->TrackPosition(pos);
-  gMC->TrackMomentum(mom);
-
-  ipart  = gMC->TrackPid();
-  //
-  // record hits when track enters ...
-  if( !(gMC->TrackCharge()) ) return; 
-  if( gMC->IsTrackEntering()) {
-      Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
-      Double_t rt = TMath::Sqrt(tc);
-      theta   = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
-      phi     = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
-      hits[0] = Float_t(ipart);             // Geant3 particle type
-      hits[1] = pos[0];                     // X-position for hit
-      hits[2] = pos[1];                     // Y-position for hit
-      hits[3] = pos[2];                     // Z-position for hit
-      hits[4] = theta;                      // theta angle of incidence
-      hits[5] = phi;                        // phi angle of incidence 
-      hits[8] = -1;                         // first padhit
-      hits[9] = -1;                         // last pad hit
-      hits[10] = mom[3];                    // hit Energy
-      hits[11] = mom[0];                    // Px
-      hits[12] = mom[1];                    // Py
-      hits[13] = mom[2];                    // Pz
-      hits[14] = gMC->TrackTime();          // time of flight
-      new(lhits[fNhits++]) 
-         AliMUONHit(fIshunt,gAlice->CurrentTrack(),vol,hits);
-
-  }
 }