added TrackReference
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Feb 2009 07:17:08 +0000 (07:17 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Feb 2009 07:17:08 +0000 (07:17 +0000)
T0/AliT0v1.cxx

index cb45824..d0cea6f 100644 (file)
@@ -55,6 +55,7 @@
 #include "AliCDBStorage.h"
 #include "AliCDBManager.h"
 #include "AliCDBEntry.h"
+#include "AliTrackReference.h"
 
 ClassImp(AliT0v1)
 
@@ -462,29 +463,6 @@ 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()
@@ -696,6 +674,7 @@ void AliT0v1::StepManager()
   static Float_t hits[6];
   static Int_t vol[2];
   TLorentzVector pos;
+  TLorentzVector mom;
   
   //   TClonesArray &lhits = *fHits;
   
@@ -720,8 +699,8 @@ void AliT0v1::StepManager()
            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; 
+           if(pos[2]<0) vol[0] = 2;
+           if(pos[2]>=0) vol[0] = 1; 
            
            Float_t etot=gMC->Etot();
            hits[3]=etot;
@@ -730,9 +709,13 @@ void AliT0v1::StepManager()
            hits[4]=partID;
            Float_t ttime=gMC->TrackTime();
            hits[5]=ttime*1e12;
-           if(RegisterPhotoE(vol[1]-1,hits[3])) 
+           if(RegisterPhotoE(vol[1]-1,hits[3])) {
              AddHit(fIshunt,vol,hits);
-           
+       // Create a track reference at the exit of photocatode
+        
+             gMC->TrackMomentum(mom);
+             AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kT0);
+           }       
          }
          //  cout<< gAlice->GetMCApp()->GetCurrentTrackNumber()<<" hit added "<<endl;