]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0v1.cxx
CSP registers depend of FEE firmware, not RCU firmware
[u/mrichter/AliRoot.git] / T0 / AliT0v1.cxx
index 06a5d037997d588f20ba5a66a4aa359ab34180e9..5c1f0ac4ba616636e67920e82bea8a8346b4a8f0 100644 (file)
 #include <Riostream.h>
 #include <stdlib.h>
 
-#include <TGeometry.h>
-#include <TLorentzVector.h>
-#include <TMath.h>
-#include <TNode.h>
-#include <TTUBE.h>
-#include <TVirtualMC.h>
+#include "TGeoCompositeShape.h"
 #include "TGeoManager.h"
 #include "TGeoMatrix.h"
 #include "TGeoPcon.h"
 #include "TGeoTube.h"
-#include "TGeoCompositeShape.h"
+#include <TGeoGlobalMagField.h>
 #include <TGraph.h>
+#include <TLorentzVector.h>
+#include <TMath.h>
+#include <TVirtualMC.h>
 
 #include "AliLog.h"
 #include "AliMagF.h"
@@ -57,6 +55,7 @@
 #include "AliCDBStorage.h"
 #include "AliCDBManager.h"
 #include "AliCDBEntry.h"
+#include "AliTrackReference.h"
 
 ClassImp(AliT0v1)
 
@@ -142,7 +141,7 @@ void AliT0v1::CreateGeometry()
   Float_t psteel[3]={0.9,1.1,0.15};
   Float_t psupport1[3] = {4.51,4.52,4.0};//C kozhuh vnutri
   Float_t psupport2[3] = {9.5,9.6,4.0};// snaruzhi  C
-  Float_t psupport3[3] = {4.51,9.5, 0.05};//kryshki  C
+  Float_t psupport3[3] = {4.52,9.5, 0.05};//kryshki  C
   Float_t psupport5[3] = {1.44,1.45,6.5}; // stakanchik dlai feu  C
   Float_t psupport6[3] = {0,1.4,0.04}; //kryshechka stakanchika  Al
   Float_t psupport7[3] = {1.44,1.45,0.4}; //kolechko snaruzhu stakanchika Al
@@ -353,7 +352,7 @@ void AliT0v1::CreateGeometry()
    gMC->Gspos("0SU7",1,"0INS",0,0,z,0,"ONLY"); //Al kryshechka 
    
    z=pinstart[2]-psupport7[2];
-   gMC->Gspos("0SU8",1,"0INS",0,0,z,0,"ONLY"); //Al kolechko
+   gMC->Gspos("0SU8",1,"0SU6",0,0,z,0,"ONLY"); //Al kolechko
    
    
    Float_t par[3];
@@ -464,35 +463,12 @@ void AliT0v1::AddAlignableVolumes() const
        AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",
 symName.Data(),volPath.Data()));
    }
-  /*
-  for (Int_t imod=0; imod<24; imod++)
-    {
-       if (imod < 12)
-         { volPath  = vpC; sn="T0/C/PMT";}
-        else
-          { volPath  = vpA; sn="T0/A/PMT";}
-      volPath += imod+1;
-      volPath += vpInside;
-      symName = sn;
-      symName += imod+1;
-    
-
-      AliDebug(2,"--------------------------------------------");
-      AliDebug(2,Form("Alignable object %d", imod));
-      AliDebug(2,Form("volPath=%s\n",volPath.Data()));
-      AliDebug(2,Form("symName=%s\n",symName.Data()));
-      AliDebug(2,"--------------------------------------------");
-      if(!gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data()))
-       AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",
-symName.Data(),volPath.Data()));
-   }
-  */
 }   
 //------------------------------------------------------------------------
 void AliT0v1::CreateMaterials()
 {
-   Int_t isxfld   = gAlice->Field()->Integ();
-   Float_t sxmgmx = gAlice->Field()->Max();
+   Int_t isxfld   = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+   Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
    //   Float_t a,z,d,radl,absl,buf[1];
    // Int_t nbuf;
 // AIR
@@ -698,46 +674,47 @@ void AliT0v1::StepManager()
   static Float_t hits[6];
   static Int_t vol[2];
   TLorentzVector pos;
+  TLorentzVector mom;
   
   //   TClonesArray &lhits = *fHits;
   
   if(!gMC->IsTrackAlive()) return; // particle has disappeared
   
+  id=gMC->CurrentVolID(copy);
   
-    // If particles is photon then ...
-  
- if (gMC->TrackPid() == 50000050)
-  {
-      id=gMC->CurrentVolID(copy);
+  // Check the sensetive volume
+  if(id==fIdSens1 ) { 
+    if(gMC->IsTrackEntering()) {
+      gMC->CurrentVolOffID(2,copy);
+      vol[1]=copy;
+      gMC->CurrentVolOffID(3,copy1);
+      vol[0]=copy1;
+      gMC->TrackPosition(pos);
+      hits[0] = pos[0];
+      hits[1] = pos[1];
+      hits[2] = pos[2];
+      if(pos[2]<0) vol[0] = 2;
+      if(pos[2]>=0) vol[0] = 1; 
       
+      Float_t etot=gMC->Etot();
+      hits[3]=etot;
+      Int_t iPart= gMC->TrackPid();
+      Int_t partID=gMC->IdFromPDG(iPart);
+      hits[4]=partID;
+      Float_t ttime=gMC->TrackTime();
+      hits[5]=ttime*1e12;
+      if (gMC->TrackPid() == 50000050)   // If particles is photon then ...
+       {
+         if(RegisterPhotoE(vol[1]-1,hits[3])) {
+           AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
+           // Create a track reference at the exit of photocatode
+         }         
+       }
+
+      //charge particle 
+      if ( gMC->TrackCharge() )
+       AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kT0);
       
-      // Check the sensetive volume
-      if(id==fIdSens1 ) { 
-       if(gMC->IsTrackEntering()) {
-           gMC->CurrentVolOffID(2,copy);
-           vol[1]=copy;
-           gMC->CurrentVolOffID(3,copy1);
-           vol[0]=copy1;
-           gMC->TrackPosition(pos);
-           hits[0] = pos[0];
-           hits[1] = pos[1];
-           hits[2] = pos[2];
-           if(pos[2]<0) vol[0]=2;
-           if(pos[2]>=0) vol[0]=1; 
-           
-           Float_t etot=gMC->Etot();
-           hits[3]=etot;
-           Int_t iPart= gMC->TrackPid();
-           Int_t partID=gMC->IdFromPDG(iPart);
-           hits[4]=partID;
-           Float_t ttime=gMC->TrackTime();
-           hits[5]=ttime*1e12;
-           if(RegisterPhotoE(vol[1]-1,hits[3])) 
-             AddHit(fIshunt,vol,hits);
-           
-         }
-         //  cout<< gAlice->GetMCApp()->GetCurrentTrackNumber()<<" hit added "<<endl;
-       
        /*              
                printf("track(%i) alive(%i) disap(%i) enter(%i) exit(%i) inside(%i) out(%i) stop(%i) new(%i) \n",
                       gAlice->GetMCApp()->GetCurrentTrackNumber(),
@@ -749,9 +726,10 @@ void AliT0v1::StepManager()
               gMC->IsTrackOut(),
               gMC->IsTrackStop(),
               gMC->IsNewTrack());
-       */              
-      } //sensitive
-  } //photon
+       */
+    }// trck entering          
+  } //sensitive
+  
 }