]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFv5T0.cxx
Excluding from the combined PID the cases of apparent mismatching and particle specie...
[u/mrichter/AliRoot.git] / TOF / AliTOFv5T0.cxx
index 3599714122b93fd2e3b28f50ade2db0b9e9582f8..45d5a7b4d73e7236185b715261978aa46d046ca1 100644 (file)
 
 /*
 $Log$
+Revision 1.22  2007/10/07 19:40:46  decaro
+right handling of l2t matrices and alignable entries in case of TOF staging geometry
+
+Revision 1.21  2007/10/04 13:15:30  arcelli
+updates to comply with AliTOFGeometryV5 becoming AliTOFGeometry
+
+Revision 1.20  2007/10/03 18:07:22  arcelli
+right handling of l2t matrices and alignable entries in case of TOF holes (Annalisa)
+
+Revision 1.19  2007/10/03 10:41:12  arcelli
+adding tracking-to-local matrices for new AliTOFcluster
+
+Revision 1.18  2007/07/27 08:14:48  morsch
+Write all track references into the same branch.
+
+Revision 1.17  2007/05/14 14:41:13  decaro
+Fix a bug in FTOA volume positionig inside BTOF13,14,15,16,17 in case of holes in 11th and 12th sectors
+
+Revision 1.16  2007/05/04 12:59:26  arcelli
+Change the TOF SM paths for misalignment (one layer up)
+
+Revision 1.15  2007/02/19 15:41:55  decaro
+Coding convention: few corrections
+
+Revision 1.14  2006/10/17 15:33:14  arcelli
+Moving some printout from Info to Debug level
+
 Revision 1.13  2006/10/12 16:35:43  arcelli
 definition of the alignable volumes symbolic names added
 
@@ -91,19 +118,23 @@ Revision 0.1 2004 November G. Cara Romeo and A. De Caro
 #include "TNode.h"
 #include "TVirtualMC.h"
 #include "TGeoManager.h"
+#include <TGeoMatrix.h>
+#include <TGeoPhysicalNode.h>
+#include <TGeoVolume.h>
 
 #include "AliConst.h"
 #include "AliLog.h"
 #include "AliMagF.h"
 #include "AliMC.h"
 #include "AliRun.h"
+#include "AliTrackReference.h"
 
 #include "AliTOFGeometry.h"
-#include "AliTOFGeometryV5.h"
 #include "AliTOFv5T0.h"
 
 extern TDirectory *gDirectory;
 extern TVirtualMC *gMC;
+extern TGeoManager *gGeoManager;
 
 extern AliRun *gAlice;
 
@@ -149,7 +180,7 @@ AliTOFv5T0::AliTOFv5T0(const char *name, const char *title):
   } else{
     
     if (fTOFGeometry) delete fTOFGeometry;
-    fTOFGeometry = new AliTOFGeometryV5();
+    fTOFGeometry = new AliTOFGeometry();
 
     if(frame->IsVersion()==1) {
       AliDebug(1,Form("Frame version %d", frame->IsVersion())); 
@@ -208,7 +239,25 @@ void AliTOFv5T0::AddAlignableVolumes() const
 
   for (Int_t isect = 0; isect < nSectors; isect++) {
     for (Int_t istr = 1; istr <= nStrips; istr++) {
-      
+
+      //if (fTOFSectors[isect]==-1) continue;
+
+      if (fTOFHoles && (isect==13 || isect==14 || isect==15)) {
+       if (istr<39) {
+         vpL3 = "/FTOB_0";
+         vpL4 = "/FLTB_0/FSTR_";
+       }
+       else if (istr>53) {
+         vpL3 = "/FTOC_0";
+         vpL4 = "/FLTC_0/FSTR_";
+       }
+       else continue;
+      }
+      else {
+       vpL3 = "/FTOA_0";
+       vpL4 = "/FLTA_0/FSTR_";
+      }
+
       volPath  = vpL0;
       volPath += isect;
       volPath += vpL1;
@@ -231,6 +280,24 @@ void AliTOFv5T0::AddAlignableVolumes() const
       AliDebug(2,"--------------------------------------------"); 
              
       gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+
+      //T2L matrices for alignment
+      TGeoPNEntry *e = gGeoManager->GetAlignableEntry(symName.Data());
+      if (e) {
+       const char *path = e->GetTitle();
+       if (!gGeoManager->cd(path)) {
+         AliFatal(Form("Volume path %s not valid!",path));
+       }
+       TGeoHMatrix *globMatrix = gGeoManager->GetCurrentMatrix();
+       Double_t phi = 20.0 * (isect % 18) + 10.0;
+       TGeoHMatrix *t2l  = new TGeoHMatrix();
+       t2l->RotateZ(phi);
+       t2l->MultiplyLeft(&(globMatrix->Inverse()));
+       e->SetMatrix(t2l);
+      }
+      else {
+       AliError(Form("Alignable entry %s is not valid!",symName.Data()));
+      }
       imod++;
     }
   }
@@ -249,7 +316,6 @@ void AliTOFv5T0::AddAlignableVolumes() const
     volPath += vpL1;
     volPath += isect;
     volPath += vpL2;
-    volPath += vpL3;
 
     symName  = snSM;
     symName += Form("%02d",isect);
@@ -430,7 +496,7 @@ void AliTOFv5T0::TOFpc(Float_t xtof,  Float_t ytof, Float_t zlenA,
     if(fTOFSectors[isec]==-1)continue;
     char name[16];
     sprintf(name, "BTOF%d",isec);
-    if (fTOFHoles && (isec==11||isec==12)) {
+    if (fTOFHoles && (isec==13 || isec==14 || isec==15)) {
     //    if (fTOFHoles && (isec==16||isec==17)) { \\Old 6h convention
       xcoor = 0.;
       ycoor = (zlenA*0.5 + kInterCentrModBorder1)*0.5;
@@ -438,7 +504,13 @@ void AliTOFv5T0::TOFpc(Float_t xtof,  Float_t ytof, Float_t zlenA,
       gMC->Gspos("FTOB", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
       gMC->Gspos("FTOC", 0, name, xcoor,-ycoor, zcoor, idrotm[0], "ONLY");
     }
-    else gMC->Gspos("FTOA", 0,name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
+    else {
+      xcoor = 0.;
+      ycoor = 0.;
+      zcoor = 0.;
+      gMC->Gspos("FTOA", 0,name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
+    }
+
   }
   // Large not sensitive volumes with Insensitive Freon (FLTA, FLTB and FLTC)
   
@@ -1517,7 +1589,7 @@ void AliTOFv5T0::StepManager()
 
     AliMC *mcApplication = (AliMC*)gAlice->GetMCApp();
 
-    AddTrackReference(mcApplication->GetCurrentTrackNumber());
+    AddTrackReference(mcApplication->GetCurrentTrackNumber(), AliTrackReference::kTOF);
     //AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
 
     // getting information about hit volumes