]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFv5T0.cxx
Compilation warning
[u/mrichter/AliRoot.git] / TOF / AliTOFv5T0.cxx
index cdca394a570c6d816cabca6c37c6dc7b14298492..a77223aadbf5cb072a5e0875a916ec087fb6e1bd 100644 (file)
 
 /*
 $Log$
+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
+
+Revision 1.12  2006/08/22 13:34:46  arcelli
+removal of effective c++ warnings (C.Zampolli)
+
+Revision 1.11  2006/07/12 16:03:44  arcelli
+updates to match the new numbering of the TOF/TRD mother volumes in FRAME (ALICE convention)
+
+Revision 1.10  2006/05/10 18:40:17  hristov
+Larger strings for the names
+
+Revision 1.9  2006/05/04 19:41:42  hristov
+Possibility for partial TOF geometry (S.Arcelli)
+
 Revision 1.8  2006/04/20 22:30:50  hristov
 Coding conventions (Annalisa)
 
@@ -75,6 +99,7 @@ Revision 0.1 2004 November G. Cara Romeo and A. De Caro
 #include "TLorentzVector.h"
 #include "TNode.h"
 #include "TVirtualMC.h"
+#include "TGeoManager.h"
 
 #include "AliConst.h"
 #include "AliLog.h"
@@ -88,13 +113,21 @@ Revision 0.1 2004 November G. Cara Romeo and A. De Caro
 
 extern TDirectory *gDirectory;
 extern TVirtualMC *gMC;
+extern TGeoManager *gGeoManager;
 
 extern AliRun *gAlice;
 
 ClassImp(AliTOFv5T0)
 
 //_____________________________________________________________________________
-AliTOFv5T0::AliTOFv5T0()
+  AliTOFv5T0::AliTOFv5T0():
+  fIdFTOA(-1),
+  fIdFTOB(-1),
+  fIdFTOC(-1),
+  fIdFLTA(-1),
+  fIdFLTB(-1),
+  fIdFLTC(-1),
+  fTOFHoles(kFALSE)
 {
   //
   // Default constructor
@@ -102,8 +135,15 @@ AliTOFv5T0::AliTOFv5T0()
 }
  
 //_____________________________________________________________________________
-AliTOFv5T0::AliTOFv5T0(const char *name, const char *title)
-        : AliTOF(name,title,"tzero")
+AliTOFv5T0::AliTOFv5T0(const char *name, const char *title):
+  AliTOF(name,title,"tzero"),
+  fIdFTOA(-1),
+  fIdFTOB(-1),
+  fIdFTOC(-1),
+  fIdFLTA(-1),
+  fIdFLTB(-1),
+  fIdFLTC(-1),
+  fTOFHoles(kFALSE)
 {
   //
   // Standard constructor
@@ -122,12 +162,12 @@ AliTOFv5T0::AliTOFv5T0(const char *name, const char *title)
     fTOFGeometry = new AliTOFGeometryV5();
 
     if(frame->IsVersion()==1) {
-      AliInfo(Form("Frame version %d", frame->IsVersion())); 
-      AliInfo("Full Coverage for TOF");
+      AliDebug(1,Form("Frame version %d", frame->IsVersion())); 
+      AliDebug(1,"Full Coverage for TOF");
       fTOFHoles=false;}    
     else {
-      AliInfo(Form("Frame version %d", frame->IsVersion())); 
-      AliInfo("TOF with Holes for PHOS");
+      AliDebug(1,Form("Frame version %d", frame->IsVersion())); 
+      AliDebug(1,"TOF with Holes for PHOS");
       fTOFHoles=true;}      
   }
   fTOFGeometry->SetHoles(fTOFHoles);
@@ -142,6 +182,98 @@ AliTOFv5T0::AliTOFv5T0(const char *name, const char *title)
 
 } 
 
+//_____________________________________________________________________________
+void AliTOFv5T0::AddAlignableVolumes() const
+{
+  //
+  // Create entries for alignable volumes associating the symbolic volume
+  // name with the corresponding volume path. Needs to be syncronized with
+  // eventual changes in the geometry.
+  //
+
+  TString volPath;
+  TString symName;
+
+  TString vpL0  = "ALIC_1/B077_1/BSEGMO";
+  TString vpL1 = "_1/BTOF";
+  TString vpL2 = "_1";
+  TString vpL3 = "/FTOA_0";
+  TString vpL4 = "/FLTA_0/FSTR_";
+
+  TString snSM  = "TOF/sm";
+  TString snSTRIP = "/strip";
+
+  Int_t nSectors=fTOFGeometry->NSectors();
+  Int_t nStrips =fTOFGeometry->NStripA()+
+                 2*fTOFGeometry->NStripB()+
+                 2*fTOFGeometry->NStripC();
+
+  //
+  // The TOF MRPC Strips
+  // The symbolic names are: TOF/sm00/strip01
+  //                           ...
+  //                         TOF/sm17/strip91
+  Int_t imod=0;
+
+  for (Int_t isect = 0; isect < nSectors; isect++) {
+    for (Int_t istr = 1; istr <= nStrips; istr++) {
+      
+      volPath  = vpL0;
+      volPath += isect;
+      volPath += vpL1;
+      volPath += isect;
+      volPath += vpL2;
+      volPath += vpL3;
+      volPath += vpL4;
+      volPath += istr;
+
+      
+      symName  = snSM;
+      symName += Form("%02d",isect);
+      symName += snSTRIP;
+      symName += Form("%02d",istr);
+            
+      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,"--------------------------------------------"); 
+             
+      gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+      imod++;
+    }
+  }
+
+
+  //
+  // The TOF supermodules
+  // The symbolic names are: TOF/sm00
+  //                           ...
+  //                         TOF/sm17
+  //
+  for (Int_t isect = 0; isect < nSectors; isect++) {
+
+    volPath  = vpL0;
+    volPath += isect;
+    volPath += vpL1;
+    volPath += isect;
+    volPath += vpL2;
+
+    symName  = snSM;
+    symName += Form("%02d",isect);
+
+      AliDebug(2,"--------------------------------------------"); 
+      AliDebug(2,Form("Alignable object %d", isect+imod)); 
+      AliDebug(2,Form("volPath=%s\n",volPath.Data()));
+      AliDebug(2,Form("symName=%s\n",symName.Data()));
+      AliDebug(2,"--------------------------------------------"); 
+             
+    gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+
+  }
+  
+}
 //____________________________________________________________________________
 void AliTOFv5T0::BuildGeometry()
 {
@@ -172,8 +304,8 @@ void AliTOFv5T0::BuildGeometry()
   Float_t zOffsetA = 0.;
   // Define TOF basic volume
   
-  char nodeName0[7], nodeName1[7], nodeName2[7];
-  char nodeName3[7], nodeName4[7], rotMatNum[7];
+  char nodeName0[16], nodeName1[16], nodeName2[16];
+  char nodeName3[16], nodeName4[16], rotMatNum[16];
 
   if (fTOFHoles) {
     new TBRIK("S_TOF_B","TOF box","void",
@@ -305,16 +437,23 @@ void AliTOFv5T0::TOFpc(Float_t xtof,  Float_t ytof, Float_t zlenA,
   zcoor = 0.;
   for(Int_t isec=0;isec<18;isec++){
     if(fTOFSectors[isec]==-1)continue;
-    char name[6];
+    char name[16];
     sprintf(name, "BTOF%d",isec);
-    if (fTOFHoles && (isec==16||isec==17)) {
+    if (fTOFHoles && (isec==11||isec==12)) {
+    //    if (fTOFHoles && (isec==16||isec==17)) { \\Old 6h convention
       xcoor = 0.;
       ycoor = (zlenA*0.5 + kInterCentrModBorder1)*0.5;
       zcoor = 0.;
       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)
   
@@ -1463,13 +1602,15 @@ void AliTOFv5T0::StepManager()
     volpath=gMC->CurrentVolOffName(7);
     index=atoi(&volpath[4]);
     sector=-1;
-  
-    if(index<5){
-      sector=index+13;
-       }
-    else{
-      sector=index-5;
-    } 
+    sector=index;
+
+    //Old 6h convention
+    // if(index<5){
+    //   sector=index+13;
+    // }
+    // else{
+    //   sector=index-5;
+    // } 
  
     for(i=0;i<3;++i) {
       hits[i]   = pos[i];