New version for frame1099 with and without holes
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Oct 1999 15:35:20 +0000 (15:35 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Oct 1999 15:35:20 +0000 (15:35 +0000)
21 files changed:
TOF/AliTOF.cxx
TOF/AliTOF.h
TOF/AliTOFv0.cxx
TOF/AliTOFv0.h
TOF/AliTOFv1.cxx
TOF/AliTOFv1.h
TOF/AliTOFv2.cxx
TOF/AliTOFv2.h
TOF/AliTOFv3.cxx
TOF/AliTOFv3.h
TOF/AliTOFv4.cxx [new file with mode: 0644]
TOF/AliTOFv4.h [new file with mode: 0644]
TOF/AliTOFv5.cxx [new file with mode: 0644]
TOF/AliTOFv5.h [new file with mode: 0644]
TOF/AliTOFv6.cxx [new file with mode: 0644]
TOF/AliTOFv6.h [new file with mode: 0644]
TOF/DrawTOF.C
TOF/Makefile
TOF/TOFLinkDef.h
TOF/ViewTOF.C
TOF/tofanal.C [new file with mode: 0644]

index 7137149..00d93ec 100644 (file)
 
 /*
 $Log$
-*/
+Revision 1.9  1999/09/29 09:24:33  fca
+Introduction of the Copyright and cvs Log
 
+*/
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  Time Of Flight                                                           //
+//  Time Of Flight                               FCA                         //
 //  This class contains the basic functions for the Time Of Flight           //
 //  detector. Functions specific to one particular geometry are              //
 //  contained in the derived classes                                         //
-//                                                                           //
-//Begin_Html
+//
+//  VERSIONE WITH 5 SYMMETRIC MODULES ALONG Z AXIS
+//  ==============================================
+//  
+//  VERSION WITH HOLES FOR PHOS AND TRD IN SPACEFRAME WITH HOLES
+//
+//  Volume sensibile : FPAD
+//
+//
+//
+// Begin_Html
 /*
 <img src="picts/AliTOFClass.gif">
 */
 //End_Html
-//                                                                           //
+//             
+//
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -121,235 +133,457 @@ void AliTOF::BuildGeometry()
   // Position the different copies
   const Float_t rtof=(399+370)/2;
   const Int_t ntof=18;
-  const Float_t angle=2*kPI/ntof;
+  const Float_t kPi = TMath::Pi();
+  const Float_t angle=2*kPi/ntof;
   Float_t ang;
   //
   // Define TOF basic volume
-  new TBRIK("S_TOF1","TOF box","void",130/2,29/2,190.);
+  
+  Float_t zlen1 = 152.5;
+  Float_t zlen2 = 147.0;
+  Float_t zlen3 = 117.0;
+  
+  new TBRIK("S_TOF1","TOF box","void",130/2,29/2,zlen1/2);
   //
   // Position it
+  //
   Top->cd();
-  ang=2.5*angle;
-  Node = new TNode("FTO002","FTO02","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot502");
+  ang=3.5*angle;
+  Node = new TNode("FTO001","FTO001","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot501");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO102","FTO102","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot502");
+  Node = new TNode("FTO101","FTO101","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot501");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  ang=2.5*angle;
+  Node = new TNode("FTO002","FTO002","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot502");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();
-  ang=1.5*angle;
-  Node = new TNode("FTO003","FTO003","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot503");
+  Node = new TNode("FTO102","FTO102","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot502");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO103","FTO103","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot503");
+  ang=1.5*angle;
+  Node = new TNode("FTO003","FTO003","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot503");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  Node = new TNode("FTO103","FTO103","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot503");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();  
   ang=0.5*angle;
-  Node = new TNode("FTO004","FTO004","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot504");
+  Node = new TNode("FTO004","FTO004","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot504");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node);
   //
   Top->cd();
-  Node = new TNode("FTO104","FTO104","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot504");
+  Node = new TNode("FTO104","FTO104","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot504");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
-  //
   Top->cd();
   ang=-0.5*angle;
-  Node = new TNode("FTO005","FTO005","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot505");
+  Node = new TNode("FTO005","FTO005","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot505");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO105","FTO105","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot505");
+  Node = new TNode("FTO105","FTO105","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot505");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
-  //
   Top->cd();
   ang=-1.5*angle;
-  Node = new TNode("FTO006","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot506");
+  Node = new TNode("FTO006","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot506");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO106","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot506");
+  Node = new TNode("FTO106","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot506");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  ang=-2.5*angle;
+  Node = new TNode("FTO007","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot507");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
-  Top->cd();  
-  ang=kPI+1.5*angle;
-  Node = new TNode("FTO012","FTO012","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot512");
+  Top->cd();
+  Node = new TNode("FTO107","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot507");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO112","FTO112","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot512");
+  ang=-3.5*angle;
+  Node = new TNode("FTO008","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot508");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  Node = new TNode("FTO108","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot508");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();
-  ang=kPI+0.5*angle;
-  Node = new TNode("FTO013","FTO013","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot513");
+  ang=-4.5*angle;
+  Node = new TNode("FTO009","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot509");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO113","FTO113","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot513");
+  Node = new TNode("FTO109","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot509");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  ang=-5.5*angle;
+  Node = new TNode("FTO010","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot510");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();
-  ang=kPI-0.5*angle;
-  Node = new TNode("FTO014","FTO04","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot514");
+  Node = new TNode("FTO110","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot510");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO114","FTO114","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot514");
+  ang=-6.5*angle;
+  Node = new TNode("FTO011","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot511");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  Node = new TNode("FTO111","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot511");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();  
+  ang=-7.5*angle;
+  Node = new TNode("FTO012","FTO012","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot512");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();
-  ang=kPI-1.5*angle;
-  Node = new TNode("FTO015","FTO015","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot515");
+  Node = new TNode("FTO112","FTO112","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot512");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=-8.5*angle;
+  Node = new TNode("FTO013","FTO013","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot513");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO115","FTO115","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot515");
+  Node = new TNode("FTO113","FTO113","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot513");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  ang=kPI-0.5*angle;
+  Node = new TNode("FTO014","FTO04","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot514");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO114","FTO114","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot514");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=kPI-1.5*angle;
+  Node = new TNode("FTO015","FTO015","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot515");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO115","FTO115","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot515");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();
   ang=kPI-2.5*angle;
-  Node = new TNode("FTO016","FTO016","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot516");
+  Node = new TNode("FTO016","FTO016","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot516");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO116","FTO116","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot516");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=kPi-3.5*angle;
+  Node = new TNode("FTO017","FTO017","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot517");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO117","FTO117","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot517");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=kPi/2;
+  Node = new TNode("FTO018","FTO018","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot518");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO116","FTO116","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot516");
+  Node = new TNode("FTO118","FTO118","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot518");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   //
   // Define second TOF volume
-  new TBRIK("S_TOF2","TOF box","void",130/2,29/2,170.);
+  new TBRIK("S_TOF2","TOF box","void",130/2,29/2,zlen2/2);
   //
   // Position the volume
+  //
+  Top->cd();
+  ang=2.5*angle;
+  Node = new TNode("FTO202","FTO202","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot502");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO402","FTO402","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot502");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=1.5*angle;
+  Node = new TNode("FTO203","FTO203","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot503");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO403","FTO403","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot503");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=0.5*angle;
+  Node = new TNode("FTO204","FTO204","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot504");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO404","FTO404","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot504");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=-0.5*angle;
+  Node = new TNode("FTO205","FTO205","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot505");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO405","FTO405","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot505");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=-1.5*angle;
+  Node = new TNode("FTO206","FTO206","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot506");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO406","FTO406","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot506");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
   Top->cd();
   ang=-2.5*angle;
-  Node = new TNode("FTO007","FTO007","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot507");
+  Node = new TNode("FTO207","FTO207","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot507");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO107","FTO107","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot507");
+  Node = new TNode("FTO407","FTO407","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot507");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   //
   Top->cd();
   ang=-3.5*angle;
-  Node = new TNode("FTO008","FTO008","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot508");
+  Node = new TNode("FTO208","FTO208","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot508");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO408","FTO408","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot508");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO108","FTO108","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot508");
+  ang=-kPi/2;
+  Node = new TNode("FTO209","FTO209","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot509");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  Node = new TNode("FTO409","FTO409","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot509");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();
-  ang=-kPI/2;
-  Node = new TNode("FTO009","FTO009","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot509");
+  ang=-kPi/2-angle;
+  Node = new TNode("FTO210","FTO210","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot510");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO109","FTO109","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot509");
+  Node = new TNode("FTO410","FTO410","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot510");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  ang=-kPi/2-2*angle;
+  Node = new TNode("FTO211","FTO211","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot511");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();
-  ang=kPI+3.5*angle;
-  Node = new TNode("FTO010","FTO010","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot510");
+  Node = new TNode("FTO411","FTO411","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot511");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO110","FTO110","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot510");
+  ang=-kPi/2-3*angle;
+  Node = new TNode("FTO212","FTO212","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot512");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  Node = new TNode("FTO412","FTO412","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot512");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  //
+  Top->cd();
+  ang=-kPi/2-4*angle;
+  Node = new TNode("FTO213","FTO213","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot513");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO413","FTO413","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot513");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=kPi-0.5*angle;
+  Node = new TNode("FTO214","FTO214","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot514");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  Node = new TNode("FTO414","FTO414","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot514");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();
-  ang=kPI+2.5*angle;
-  Node = new TNode("FTO011","FTO011","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot511");
+  ang=kPi-1.5*angle;
+  Node = new TNode("FTO215","FTO215","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot515");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO111","FTO111","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot511");
+  Node = new TNode("FTO415","FTO415","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot515");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  ang=kPi-2.5*angle;
+  Node = new TNode("FTO216","FTO216","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot516");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
+  Top->cd();
+  Node = new TNode("FTO416","FTO416","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot516");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+
   // Define third TOF volume
-  new TBRIK("S_TOF3","TOF box","void",130/2.,29/2,75.);
+  new TBRIK("S_TOF3","TOF box","void",130/2.,29/2,zlen3/2.);
   //
   // Position it
+  //
   Top->cd();
-  ang=3.5*angle;
-  Node = new TNode("FTO001","FTO001","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-75),"rot501");
+  ang=2.5*angle;
+  Node = new TNode("FTO302","FTO302","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot502");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=1.5*angle;
+  Node = new TNode("FTO303","FTO303","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot503");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=0.5*angle;
+  Node = new TNode("FTO304","FTO304","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot504");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
+  //
+  Top->cd();
+  ang=-0.5*angle;
+  Node = new TNode("FTO305","FTO305","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot505");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO101","FTO101","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-75),"rot501");
+  ang=-1.5*angle;
+  Node = new TNode("FTO306","FTO306","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot506");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   //
   Top->cd();
-  ang=kPI-3.5*angle;
-  Node = new TNode("FTO017","FTO017","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-75),"rot517");
+  ang=kPi+1.5*angle;
+  Node = new TNode("FTO312","FTO312","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot512");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO117","FTO117","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-75),"rot517");
+  ang=kPi+0.5*angle;
+  Node = new TNode("FTO313","FTO313","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot513");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
+  Top->cd();
+  ang=kPi-0.5*angle;
+  Node = new TNode("FTO314","FTO314","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot514");
+  Node->SetLineColor(kColorTOF);
+  fNodes->Add(Node); 
   //
   Top->cd();
-  ang=kPI/2;
-  Node = new TNode("FTO018","FTO018","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-75),"rot518");
+  ang=kPi-1.5*angle;
+  Node = new TNode("FTO315","FTO315","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot515");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
   //
   Top->cd();
-  Node = new TNode("FTO118","FTO118","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-75),"rot518");
+  ang=kPi-2.5*angle;
+  Node = new TNode("FTO316","FTO316","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot516");
   Node->SetLineColor(kColorTOF);
   fNodes->Add(Node); 
+
 }
 
 //_____________________________________________________________________________
@@ -368,133 +602,30 @@ void AliTOF::CreateGeometry()
   const Double_t kPi=TMath::Pi();
   const Double_t kDegrad=kPi/180;
   //
-  Int_t lmax;
-  Float_t xtof, ytof, fil_step;
-  Float_t zcor1, zcor2, zcor3;
-  Float_t ztof0, ztof1, ztof2;
-  Float_t zl, rmin, rmax, xm, ym, dwall;
-  Int_t idrotm[18];
-  Float_t zm0, zm1, zm2;
-  Float_t par[10];
-  //
-  Int_t *idtmed = fIdtmed->GetArray()-499;
-  //
+  Float_t xtof, ytof;
+  Float_t ztof0;
+  Float_t rmin, rmax, dwall;
+
   // barrel iner radius 
-  rmin = 370.;
+  rmin = 370.;//cm
   // barrel outer radius 
   rmax = rmin+29;
-  // barrel length along Z axis
-  zl = (rmin+2/*distance to sencetive layer*/+7/2)*2;
-  //
+  
   // frame inbetween TOF modules
-  dwall = 4.;
+  dwall = 4.;//cm
   // Sizes of TOF module with its support etc..
-  xtof = 2 * (rmin*TMath::Tan(10*kDegrad)-dwall/2-.5);
+  xtof = 2.*(rmin*TMath::Tan(10*kDegrad)-dwall/2-.5);
   ytof = rmax-rmin;
-  ztof0 = zl/2;
-  // Is it full coverage version (3) or not
-  if (IsVersion() != 3) {
-  ztof1 = ztof0-rmax*TMath::Tan(7.8*kDegrad); // minus Z size of PHOS
-  ztof2 = ztof0-rmax*TMath::Tan(54.34/2*kDegrad); // minus Z size of HMPID;
-  } else {
-  ztof1 = ztof0;
-  ztof2 = ztof0;
-  }
-   // Number of TOF-modules 
-  lmax = 18;
-  //
-/*
-  //Some imitation of TRD
-  par[0] = 281;
-  par[1] = 350.282;
-  par[2] = zl/2;
-  gMC->Gsvolu("FTRD", "TUBE", idtmed[510], par, 3);
-  gMC->Gspos("FTRD", 1, "ALIC", 0., 0., 0., 0, "ONLY");
+  ztof0 = 375.5;//cm
 
-  par[0] = 0.;
-  par[1] = 360.;
-  par[2] = lmax;
-  par[3] = 2.;
-  par[4] = -zl/2;
-  par[5] = rmin;
-  par[6] = rmax;
-  par[7] = zl/2;
-  par[8] = rmin;
-  par[9] = rmax;
-  gMC->Gsvolu("FBAR", "PGON", idtmed[500], par, 10);
-  gMC->Gspos("FBAR", 1, "ALIC", 0., 0., 0., 0, "ONLY");
-*/
-  //
-  // TOF size  (CO2)
-  par[0] = xtof / 2.;
-  par[1] = ytof / 2.;
-  par[2] = ztof0 / 2.;
-  gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
-  par[2] = ztof1 / 2.;
-  gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
-  par[2] = ztof2 / 2.;
-  gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
-/*
-  // Frame wall
-  par[0]=dwall/2.;
-  par[1]=(rmax-rmin)/2.;
-  par[2]=ztof0/2.;
-  gMC->Gsvolu("FFR1", "BOX ", idtmed[508], par, 3);
-  gMC->Gsatt("FFR1", "SEEN", -2);
-  par[2]=ztof1/2.;
-  gMC->Gsvolu("FFR2", "BOX ", idtmed[508], par, 3);
-  gMC->Gsatt("FFR2", "SEEN", -2);
-  par[2]=ztof2/2.;
-  gMC->Gsvolu("FFR2", "BOX ", idtmed[508], par, 3);
-  gMC->Gsatt("FFR2", "SEEN", -2);
-*/  
-  //
-  // Subtraction the distanse to TOF module boundaries 
-  xm = xtof -(.5 +.5)*2;
-  ym = ytof;
-  zm0 = ztof0;
-  zm1 = ztof1;
-  zm2 = ztof2;
-  //  
-/////////////// TOF module internal definitions //////////////
-  TOFpc(xm, ym, zm0, zm1, zm2);
-/////////////////////////////////////////////////////////////
-  //
-  // Position of modules
-  fil_step = 360./lmax;
-  zcor1 = ztof0/2;
-  zcor2 = ztof0 - ztof1 / 2.;
-  zcor3 = ztof0 - ztof2 / 2.;
-/*
-  for (i = 1; i <= lmax; ++i) {
-    fil1 = fil_step * i;
-    xcor2 = (rmin+rmax)/2 * TMath::Sin(fil1 * kDegrad);
-    ycor2 = (rmin+rmax)/2 * TMath::Cos(fil1 * kDegrad);
-    lmax1 = i + lmax;
-    AliMatrix(idrotm[i], 90., -fil1, 90., 90. -fil1, 0., 0.);
-    if (i>=7 && i<=11) { // free space for PHOS
-      //    if (fil1 >= 180-50  && fil1 <= 180+50) {
-      gMC->Gspos("FTO2", i, "FBAR", xcor2, ycor2, zcor2, idrotm[i], "ONLY");
-      gMC->Gspos("FTO2", lmax1, "FBAR", xcor2, ycor2, -zcor2, idrotm[i], "ONLY");
-    } else if (i>=17 || i==1) { // free space for RICH
-      //    } else if (fil1 <= 30 || fil1 >= 360. - 30) {
-      gMC->Gspos("FTO3", i, "FBAR", xcor2, ycor2, zcor3, idrotm[i], "ONLY");
-      gMC->Gspos("FTO3", lmax1, "FBAR", xcor2, ycor2, -zcor3, idrotm[i], "ONLY");
-    } else {
-      gMC->Gspos("FTO1", i, "FBAR", xcor2, ycor2, zcor1, idrotm[i], "ONLY");
-      gMC->Gspos("FTO1", lmax1, "FBAR", xcor2, ycor2, -zcor1, idrotm[i], "ONLY");
-    }
-  }
-*/
-      AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
-      gMC->Gspos("FTO2", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
-      gMC->Gspos("FTO2", 2, "BTO2", 0, -zcor2, 0, idrotm[0], "ONLY");
+// TOF size  (CO2)
 
-      gMC->Gspos("FTO3", 1, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
-      gMC->Gspos("FTO3", 2, "BTO3", 0, -zcor3, 0, idrotm[0], "ONLY");
+  Float_t zlen1 = 159.5;//cm
+  Float_t zlen2 = 154.0;//cm
+  Float_t zlen3 = 124.0;//cm
 
-      gMC->Gspos("FTO1", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
-      gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[0], "ONLY");
+//  TOF module internal definitions 
+  TOFpc(xtof, ytof, zlen1, zlen2, zlen3, ztof0);
 }
 
 //_____________________________________________________________________________
@@ -600,7 +731,6 @@ void AliTOF::CreateMaterials()
   Float_t dwa    = 1.0;
   Int_t nwa = -2;
   //
-  //
   //AliMaterial(0, "Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
   AliMaterial(1, "Air$",14.61,7.3,0.001205,30423.24,67500.);
   AliMaterial(2, "Cu $",  63.54, 29.0, 8.96, 1.43, 14.8);
@@ -611,10 +741,7 @@ void AliTOF::CreateMaterials()
   AliMixture(7, "CO2$", ac, zc, dc, nc, wc);
   AliMixture(8, "ALUMINA$", aal, zal, densal, nlmatal, wmatal);
   AliMaterial(9, "Al $", 26.98, 13., 2.7, 8.9, 37.2);
-  // (TRD simulation) thickness = 69.282cm/18.8cm = 3.685 X/X0
-  //  AliMaterial(10, "C-TRD$", 12.01, 6., 2.265*18.8/69.282*10.2/100, 18.8, 74.4); // for 10.2% 
   AliMaterial(10, "C-TRD$", 12.01, 6., 2.265*18.8/69.282*15./100, 18.8, 74.4); // for 15%
-  //  AliMaterial(10, "C-TRD$", 12.01, 6., 2.265*18.8/69.282*20./100, 18.8, 74.4); // for 20%
   AliMixture(11, "Mylar$",  amy, zmy, dmy, nmy, wmy);
   AliMixture(12, "Freon$",  afre, zfre, densfre, nfre, wfre);
   AliMixture(13, "Quartz$", aq, zq, dq, nq, wq);
@@ -631,7 +758,7 @@ void AliTOF::CreateMaterials()
   stemax = -1.;
   deemax = -.3;
   stmin  = -.8;
-  //  AliMedium(0, "Vacuum  $", 0, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
+
   AliMedium(1, "Air$", 1, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
   AliMedium(2, "Cu $", 2, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
   AliMedium(3, "C  $", 3, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
@@ -675,7 +802,7 @@ void AliTOF::Init()
   cout << "TOF version " << IsVersion() <<" initialized" << endl;
   //
   // Set id of TOF sensitive volume
-  if (IsVersion() !=0) fIdSens=gMC->VolId("FPG0");
+  if (IsVersion() !=0) fIdSens=gMC->VolId("FPAD");
   //
   for(i=0;i<80;i++) printf("*");
   printf("\n");
@@ -708,5 +835,4 @@ AliTOFhit::AliTOFhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
   // Time Of Flight
   fTof=hits[7];
 }
+
index 349169c..d46df1e 100644 (file)
@@ -30,7 +30,7 @@ public:
   virtual Int_t   IsVersion() const =0;
   Int_t           DistancetoPrimitive(Int_t px, Int_t py);
   virtual void    StepManager()=0;
-  virtual void    TOFpc(Float_t, Float_t, Float_t, Float_t, Float_t) {}
+  virtual void    TOFpc(Float_t, Float_t, Float_t, Float_t, Float_t,Float_t) {}
   virtual void    DrawModule();
   
   ClassDef(AliTOF,1)  // Time Of Flight base class
index 09bd3bf..7688f65 100644 (file)
 
 /*
 $Log$
+Revision 1.9  1999/09/29 09:24:33  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  Time Of Flight: as for version 1 but not sensitive                       //
-//  This class contains the functions for version 0 of the Time Of Flight    //
+//  Time Of Flight: design of C.Williams                FCA                  //
+//  This class contains the functions for version 1 of the Time Of Flight    //
 //  detector.                                                                //
-//                                                                           //
+//
+//  VERSION WITH 5 MODULES AND TILTED STRIPS 
+//  
+//   WITH HOLES FOR PHOS AND HMPID inside the 
+//   SPACE FRAME WITH HOLES
+//
+//
+//   Authors:
+//  
+//   Alessio Seganti
+//   Domenico Vicinanza
+//
+//   University of Salerno - Italy
+//
+//
 //Begin_Html
 /*
 <img src="picts/AliTOFv0Class.gif">
@@ -66,92 +83,112 @@ void AliTOFv0::CreateGeometry()
   */
   //End_Html
   //
-  //
-  // Create common geometry
+  // Creates common geometry
   //
   AliTOF::CreateGeometry();
 }
  
 //_____________________________________________________________________________
-void AliTOFv0::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
-                    Float_t zm1, Float_t zm2)
+void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
+                    Float_t zlen2, Float_t zlen3, Float_t ztof0)
 {
   //
   // Definition of the Time Of Fligh Resistive Plate Chambers
-  // xm, ym, zm - sizes of TOF modules (large)
+  // xFLT, yFLT, zFLT - sizes of TOF modules (large)
   
   Float_t  ycoor;
-  Float_t zazor, xp, yp, zp;
   Float_t par[10];
+  Int_t idrotm[100];
+  Int_t nrot = 0;
   
   Int_t *idtmed = fIdtmed->GetArray()-499;
+
+
+  par[0] =  xtof / 2.;
+  par[1] =  ytof / 2.;
+  par[2] = zlen1 / 2.;
+  gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen2 / 2.;
+  gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen3 / 2.;
+  gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
+
+
+// Positioning of modules
+
+   Float_t zcoor;
+
+   Float_t zcor1 = ztof0 - zlen1/2;
+   Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
+   Float_t zcor3 = 0.;
+
+   AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
+   AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
+   gMC->Gspos("FTO1", 1, "BTO1", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
+   zcoor = (zlen1/2.);
+   gMC->Gspos("FTO1", 1, "BTO2", 0,  zcoor, 0, idrotm[0], "ONLY");
+   zcoor = 0.;
+   gMC->Gspos("FTO1", 1, "BTO3", 0,  zcoor, 0, idrotm[0], "ONLY");
+   
+   gMC->Gspos("FTO2", 1, "BTO1", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
+   zcoor = -zlen2/2.;
+   gMC->Gspos("FTO2", 0, "BTO2", 0,  zcoor, 0, idrotm[0], "ONLY");
+
+   gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3,  0, idrotm[0], "ONLY");
+
+// Subtraction the distance to TOF module boundaries 
+
+  Float_t db = 7.;
+  Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
+
+  xFLT = xtof -(.5 +.5)*2;
+  yFLT = ytof;
+  zFLT1 = zlen1 - db;
+  zFLT2 = zlen2 - db;
+  zFLT3 = zlen3 - db;
+    
+// Sizes of MRPC pads
+
+  Float_t yPad = 0.505; 
   
-  // gap in RPC chamber 
-  zazor = .03;
-  // Sizes of RPC chamber 
-  xp = 3.0; //small pixel
-//xp = 3.9; //large pixel 
-  yp = 12.3*0.05; // 5% X0 of glass 
-  zp = 3.0; //small pixel
-//zp = 4.1; //large pixel
-  // Large not sensitive volumes with CO2 
-  par[0] = xm/2;
-  par[1] = ym/2;
-  par[2] = zm0/2;
-  gMC->Gsvolu("FBT1", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
-  gMC->Gsdvn("FDT1", "FBT1", 2, 3); // 2 large modules along Z
-  par[2] = zm1 / 2;
-  gMC->Gsvolu("FBT2", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
-  gMC->Gsdvn("FDT2", "FBT2", 2, 3); // 2 (PHOS) modules along Z
-  par[2] = zm2 / 2;
-  gMC->Gsvolu("FBT3", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
-  gMC->Gsdvn("FDT3", "FBT3", 1, 3); // 1 (RICH) module along Z
-  //
-  //  subtraction of dead boundaries in X=2 cm and Z=7/2 cm 
-  par[0] = par[0]-2.;
-  Int_t nz0, nz1, nz2, nx; //- numbers of pixels
-  nx = Int_t (par[0]*2/xp);
+// Large not sensitive volumes with CO2 
+  par[0] = xFLT/2;
+  par[1] = yFLT/2;
+
   cout <<"************************* TOF geometry **************************"<<endl;
-  cout<< "nx = "<< nx << " x size = "<< par[0]*2/nx << endl;
-  par[1] = -1;
-  par[2] = (zm0 / 2.)/2.; //this is half size of module after division by 2
-  par[2]=par[2]-7/2.;
-  nz0 = Int_t (par[2]*2/zp);
-cout<< "nz0 = "<< nz0 << " z0 size = "<< par[2]*2/nz0 << endl;
+
+  par[2] = (zFLT1 / 2.);
   gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FLT1", 0, "FDT1", 0., 0., 0., 0, "ONLY");
-  par[2] = (zm1 / 2.)/2.; //this is half size of module after division by 2
-  par[2]=par[2]-7/2.;
-  nz1 = Int_t (par[2]*2/zp);
-cout<< "nz1 = "<< nz1 << " z1 size = "<< par[2]*2/nz1 << endl;
+  gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
+
+  par[2] = (zFLT2 / 2.);
   gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FLT2", 0, "FDT2", 0., 0., 0., 0, "ONLY");
-  par[2] = (zm2 / 2.); //this is half size of module after division by 1
-  par[2]=par[2]-7/2.;
-  nz2 = Int_t (par[2]*2/zp);
-cout<< "nz2 = "<< nz2 << " z2 size = "<< par[2]*2/nz2 << endl;
+  gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
+
+  par[2] = (zFLT3 / 2.); 
   gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FLT3", 0, "FDT3", 0., 0., 0., 0, "ONLY");
-  //
+  gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
+
 ////////// Layers before detector ////////////////////
-// Mylar layer in front 0.5mm thick at the beginning
+
+// Alluminium layer in front 1.0 mm thick at the beginning
   par[0] = -1;
-  par[1] = 0.05 / 2;
+  par[1] = 0.1;
   par[2] = -1;
-  ycoor = -ym/2 + par[1];
-  gMC->Gsvolu("FMY1", "BOX ", idtmed[511], par, 3); // Mylar
+  ycoor = -yFLT/2 + par[1];
+  gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
   gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FMY2", "BOX ", idtmed[511], par, 3); // Mylar
+  gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
   gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FMY3", "BOX ", idtmed[511], par, 3); // Mylar
+  gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium 
   gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-// Honeycomb layer (1cm of special!!! polyethilene)
+
+// Honeycomb layer (1cm of special polyethilene)
   ycoor = ycoor + par[1];
   par[0] = -1;
-  par[1] = 1. / 2;
+  par[1] = 0.5;
   par[2] = -1;
   ycoor = ycoor + par[1];
   gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
@@ -160,80 +197,205 @@ cout<< "nz2 = "<< nz2 << " z2 size = "<< par[2]*2/nz2 << endl;
   gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  //
+
 ///////////////// Detector itself //////////////////////
+
+  const Float_t StripWidth = 7.81;//cm
+  const Float_t DeadBound = 1.;//cm non-sensitive between the pad edge and the boundary of the strip
+  const Int_t nx = 40; // number of pads along x
+  const Int_t nz = 2;  // number of pads along z
+  const Float_t Gap=4.; //cm  distance between the strip axis
+  const Float_t Space = 5.5; //cm distance from the front plate of the box
+
+  Float_t zSenStrip;
+  zSenStrip = StripWidth-2*DeadBound;//cm
+
   par[0] = -1;
-  par[1] = yp/2; // 5 %X0 thick of glass  
-  par[2] = -1;
-  ycoor = -ym/2 + 2;
-  gMC->Gsvolu("FLD1", "BOX ", idtmed[514], par, 3); // Glass
-  gMC->Gspos("FLD1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FLD2", "BOX ", idtmed[514], par, 3); // Glass
-  gMC->Gspos("FLD2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FLD3", "BOX ", idtmed[514], par, 3); // Glass
-  gMC->Gspos("FLD3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  //
-  gMC->Gsdvn("FLZ1", "FLD1", nz0, 3); //pixel size xp=zp=3
-  gMC->Gsdvn("FLZ2", "FLD2", nz1, 3); 
-  gMC->Gsdvn("FLZ3", "FLD3", nz2, 3); 
-  gMC->Gsdvn("FLX1", "FLZ1", nx, 1); 
-  gMC->Gsdvn("FLX2", "FLZ2", nx, 1); 
-  gMC->Gsdvn("FLX3", "FLZ3", nx, 1); 
-  // RPC pixel itself 
-  par[0] = -1;//xp/2;
-  par[1] = -1;//yp/2; // 5 %X0 thick of glass  
-  par[2] = -1;//zp/2;
-  gMC->Gsvolu("FPA0", "BOX ", idtmed[514], par, 3);// Glass
-  gMC->Gspos("FPA0", 1, "FLX1", 0., 0., 0., 0, "ONLY");
-  gMC->Gspos("FPA0", 2, "FLX2", 0., 0., 0., 0, "ONLY");
-  gMC->Gspos("FPA0", 3, "FLX3", 0., 0., 0., 0, "ONLY");
-  // Freon gas sencitive volume
+  par[1] = yPad/2; 
+  par[2] = StripWidth/2.;
+  
+  // Glass Layer of detector
+  gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
+
+  // Freon for non-sesitive boundaries
   par[0] = -1;
-  par[1] = zazor/2;
+  par[1] = 0.110/2;
   par[2] = -1;
-  gMC->Gsvolu("FPG0", "BOX ", idtmed[513], par, 3);// Freon 
-  gMC->Gspos("FPG0", 0, "FPA0", 0., 0., 0., 0, "ONLY");
-  //
-////////// Layers after detector ////////////////////
-  // Honeycomb layer after (3cm)
+  gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
+  gMC->Gspos("FNSF",0,"FSTR",0.,0.,0.,0,"ONLY");
+  // Mylar for non-sesitive boundaries
+  par[1] = 0.025;
+  gMC->Gsvolu("FMYI","BOX",idtmed[510],par,3); 
+  gMC->Gspos("FMYI",0,"FNSF",0.,0.,0.,0,"ONLY");
+
+  // Mylar for outer layers
+  par[1] = 0.035/2;
+  ycoor = -yPad/2.+par[1];
+  gMC->Gsvolu("FMYX","BOX",idtmed[510],par,3);
+  gMC->Gspos("FMYX",1,"FSTR",0.,ycoor,0.,0,"ONLY");
+  gMC->Gspos("FMYX",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
+  ycoor += par[1];
+  // Graphyte layers
+  par[1] = 0.003/2;
+  ycoor += par[1];
+  gMC->Gsvolu("FGRL","BOX",idtmed[502],par,3);
+  gMC->Gspos("FGRL",1,"FSTR",0.,ycoor,0.,0,"ONLY");
+  gMC->Gspos("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
+
+  // Freon sensitive layer
   par[0] = -1;
-  par[1] = 1.2 / 2.;
+  par[1] = 0.110/2.;
+  par[2] = zSenStrip/2.;
+  gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
+  gMC->Gspos("FCFC",0,"FNSF",0.,0.,0.,0,"ONLY");
+  
+  // Pad definition x & z
+  gMC->Gsdvn("FLZ","FCFC", nz, 3); 
+  gMC->Gsdvn("FLX","FLZ" , nx, 1); 
+
+  // MRPC pixel itself 
+//  par[0] = -1;
+//  par[1] = -1; 
+//  par[2] = -1;
+//  gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);
+//  gMC->Gspos("FPAD", 0, "FLX", 0., 0., 0., 0, "ONLY");
+
+
+////  Positioning the Strips  (FSTR) in the FLT volumes  /////
+
+  // 3 (Central) Plate 
+  Float_t t = zFLT1+zFLT2+zFLT3/2.+7.*2.5;//Half Width of Barrel
+  Float_t zpos = 0;
+  Float_t ang;
+  Float_t Offset;  
+  Float_t last;
+  nrot = 0;
+  Int_t i=1,j=1;
+  zcoor=0;
+  Int_t UpDown=-1; // UpDown=-1 -> Upper strip, UpDown=+1 -> Lower strip
+  do{
+     ang = atan(zcoor/t);
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     AliMatrix (idrotm[nrot+1], 90., 180., 90.+ang,90.,ang, 0);
+     ycoor = -14.5+ Space; //2 cm over front plate
+     ycoor += (1-(UpDown+1)/2)*Gap;
+     gMC->Gspos("FSTR",j  ,"FLT3",0.,ycoor, zcoor,idrotm[nrot],  "ONLY");
+     gMC->Gspos("FSTR",j+1,"FLT3",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
+     ang  = ang*3.141592654/180;
+     
+     zcoor=zcoor-(zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
+     UpDown*= -1; // Alternate strips 
+     i++;
+     j+=2;
+  } while (zcoor-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+zFLT2+7*2.5);
+  
+  ycoor = -29./2.+ Space; //2 cm over front plate
+
+  // Plate  2
+  zpos = -zFLT3/2-7.;
+  ang  = atan(zpos/sqrt(2*t*t-zpos*zpos));
+  Offset = StripWidth*TMath::Cos(ang)/2;
+  zpos -= Offset;
+  nrot = 0;
+  i=1;
+  // UpDown has not to be reinitialized, so that the arrangement of the strips can continue coherently
+
+  do {
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     ycoor = -29./2.+ Space ; //2 cm over front plate
+     ycoor += (1-(UpDown+1)/2)*Gap;
+     zcoor = zpos+(zFLT3/2.+7+zFLT2/2); // Moves to the system of the centre of the modulus FLT2
+     gMC->Gspos("FSTR",i, "FLT2", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+     ang  = ang*3.141592654/180;
+     zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
+     last = StripWidth*TMath::Cos(ang)/2;
+     UpDown*=-1;
+     i++; 
+  } while (zpos-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+7);
+
+  // Plate  1
+  zpos = -t+zFLT1+3.5;
+  ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+  Offset = StripWidth*TMath::Cos(ang)/2.;
+  zpos -= Offset;
+  nrot = 0;
+  i=0;
+  ycoor= -29./2.+Space+Gap/2;
+
+ do {
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     i++;
+     zcoor = zpos+(zFLT1/2+zFLT2+zFLT3/2+7.*2.);
+     gMC->Gspos("FSTR",i, "FLT1", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+     ang  = ang *3.141592654/180;
+     zpos = zpos - zSenStrip/TMath::Cos(ang);
+     last = StripWidth*TMath::Cos(ang)/2.;
+  }  while (zpos>-t+7.+last);
+
+printf("#######################################################\n");
+printf("     Distance from the bound of the FLT3: zFLT3- %f cm \n", zpos+(zSenStrip/2)/TMath::Cos(ang));
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     zpos = zpos - zSenStrip/TMath::Cos(ang);
+printf("NEXT Distance from the bound of the FLT3: zFLT3- %f cm \n", zpos+(zSenStrip/2)/TMath::Cos(ang));
+printf("#######################################################\n");
+
+////////// Layers after detector /////////////////
+
+// Honeycomb layer after (3cm)
+
+  Float_t OverSpace = Space + 7.3;
+///  StripWidth*TMath::Sin(ang) + 1.3;
+
+  par[0] = -1;
+  par[1] = 0.6;
   par[2] = -1;
-  ycoor = -ym/2 + 6. - par[1];
+  ycoor = -yFLT/2 + OverSpace + par[1];
   gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  // Electronics (Cu) after
+
+// Electronics (Cu) after
+  ycoor += par[1];
   par[0] = -1;
   par[1] = 1.43*0.05 / 2.; // 5% of X0
   par[2] = -1;
-  ycoor = -ym/2 + 6.+par[1];
+  ycoor += par[1];
   gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
   gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
   gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
   gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
- // Cooling water after
-  ycoor = ycoor+par[1];
+
+// Cooling water after
+  ycoor += par[1];
   par[0] = -1;
   par[1] = 36.1*0.02 / 2.; // 2% of X0
   par[2] = -1;
-  ycoor = ycoor+par[1];
+  ycoor += par[1];
   gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
   gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
   gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
   gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  //back plate honycomb (2cm)
+
+//back plate honycomb (2cm)
   par[0] = -1;
   par[1] = 2 / 2.;
   par[2] = -1;
-  ycoor = ym/2 - par[1];
+  ycoor = yFLT/2 - par[1];
   gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
@@ -246,7 +408,7 @@ cout<< "nz2 = "<< nz2 << " z2 size = "<< par[2]*2/nz2 << endl;
 void AliTOFv0::DrawModule()
 {
   //
-  // Draw a shaded view of the Time Of Flight version 0
+  // Draw a shaded view of the Time Of Flight version 1
   //
   // Set everything unseen
   gMC->Gsatt("*", "seen", -1);
@@ -269,6 +431,19 @@ void AliTOFv0::DrawModule()
   gMC->Gsatt("FLT1","SEEN",1);
   gMC->Gsatt("FLT2","SEEN",1);
   gMC->Gsatt("FLT3","SEEN",1);
+  gMC->Gsatt("FPL1","SEEN",1);
+  gMC->Gsatt("FPL2","SEEN",1);
+  gMC->Gsatt("FPL3","SEEN",1);
+  gMC->Gsatt("FLD1","SEEN",1);
+  gMC->Gsatt("FLD2","SEEN",1);
+  gMC->Gsatt("FLD3","SEEN",1);
+  gMC->Gsatt("FLZ1","SEEN",1);
+  gMC->Gsatt("FLZ2","SEEN",1);
+  gMC->Gsatt("FLZ3","SEEN",1);
+  gMC->Gsatt("FLX1","SEEN",1);
+  gMC->Gsatt("FLX2","SEEN",1);
+  gMC->Gsatt("FLX3","SEEN",1);
+  gMC->Gsatt("FPA0","SEEN",1);
   //
   gMC->Gdopt("hide", "on");
   gMC->Gdopt("shad", "on");
@@ -354,3 +529,4 @@ void AliTOFv0::StepManager()
     new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
 }
+
index 106c2d0..8d6dbfe 100644 (file)
@@ -6,7 +6,7 @@
 /* $Id$ */
 
 ///////////////////////////////////////////////////////
-//  Manager and hits classes for set:TOF  version 0  //
+//  Manager and hits classes for set:TOF  version 1  //
 ///////////////////////////////////////////////////////
  
 #include "AliTOF.h"
@@ -30,11 +30,11 @@ public:
   virtual void   CreateMaterials();
   virtual void   Init();
   virtual Int_t  IsVersion() const {return 0;}
-  virtual void   TOFpc(Float_t, Float_t, Float_t, Float_t, Float_t);
+  virtual void   TOFpc(Float_t,Float_t,Float_t,Float_t,Float_t,Float_t);
   virtual void   StepManager();
   virtual void   DrawModule();
  
-   ClassDef(AliTOFv0,1)  //Time Of Flight version 0
+   ClassDef(AliTOFv0,1)  //Time Of Flight version 1
 };
  
 #endif
index 98688d2..d0baf01 100644 (file)
 
 /*
 $Log$
+Revision 1.9  1999/09/29 09:24:33  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  Time Of Flight: design of C.Williams                                     //
+//  Time Of Flight: design of C.Williams                FCA                  //
 //  This class contains the functions for version 1 of the Time Of Flight    //
 //  detector.                                                                //
-//                                                                           //
+//
+//  VERSION WITH 5 MODULES AND TILTED STRIPS 
+//  
+//   WITH HOLES FOR PHOS AND HMPID inside the 
+//   SPACE FRAME WITH HOLES
+//
+//
+//   Authors:
+//  
+//   Alessio Seganti
+//   Domenico Vicinanza
+//
+//   University of Salerno - Italy
+//
+//
 //Begin_Html
 /*
 <img src="picts/AliTOFv1Class.gif">
@@ -66,92 +83,112 @@ void AliTOFv1::CreateGeometry()
   */
   //End_Html
   //
-  //
-  // Create common geometry
+  // Creates common geometry
   //
   AliTOF::CreateGeometry();
 }
  
 //_____________________________________________________________________________
-void AliTOFv1::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
-                    Float_t zm1, Float_t zm2)
+void AliTOFv1::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
+                    Float_t zlen2, Float_t zlen3, Float_t ztof0)
 {
   //
   // Definition of the Time Of Fligh Resistive Plate Chambers
-  // xm, ym, zm - sizes of TOF modules (large)
+  // xFLT, yFLT, zFLT - sizes of TOF modules (large)
   
   Float_t  ycoor;
-  Float_t zazor, xp, yp, zp;
   Float_t par[10];
+  Int_t idrotm[100];
+  Int_t nrot = 0;
   
   Int_t *idtmed = fIdtmed->GetArray()-499;
+
+
+  par[0] =  xtof / 2.;
+  par[1] =  ytof / 2.;
+  par[2] = zlen1 / 2.;
+  gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen2 / 2.;
+  gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen3 / 2.;
+  gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
+
+
+// Positioning of modules
+
+   Float_t zcoor;
+
+   Float_t zcor1 = ztof0 - zlen1/2;
+   Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
+   Float_t zcor3 = 0.;
+
+   AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
+   AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
+   gMC->Gspos("FTO1", 1, "BTO1", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
+   zcoor = (zlen1/2.);
+   gMC->Gspos("FTO1", 1, "BTO2", 0,  zcoor, 0, idrotm[0], "ONLY");
+   zcoor = 0.;
+   gMC->Gspos("FTO1", 1, "BTO3", 0,  zcoor, 0, idrotm[0], "ONLY");
+   
+   gMC->Gspos("FTO2", 1, "BTO1", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
+   zcoor = -zlen2/2.;
+   gMC->Gspos("FTO2", 0, "BTO2", 0,  zcoor, 0, idrotm[0], "ONLY");
+
+   gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3,  0, idrotm[0], "ONLY");
+
+// Subtraction the distance to TOF module boundaries 
+
+  Float_t db = 7.;
+  Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
+
+  xFLT = xtof -(.5 +.5)*2;
+  yFLT = ytof;
+  zFLT1 = zlen1 - db;
+  zFLT2 = zlen2 - db;
+  zFLT3 = zlen3 - db;
+    
+// Sizes of MRPC pads
+
+  Float_t yPad = 0.505; 
   
-  // gap in RPC chamber 
-  zazor = .03;
-  // Sizes of RPC chamber 
-  xp = 3.0; //small pixel
-//xp = 3.9; //large pixel 
-  yp = 12.3*0.05; // 5% X0 of glass 
-  zp = 3.0; //small pixel
-//zp = 4.1; //large pixel
-  // Large not sensitive volumes with CO2 
-  par[0] = xm/2;
-  par[1] = ym/2;
-  par[2] = zm0/2;
-  gMC->Gsvolu("FBT1", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
-  gMC->Gsdvn("FDT1", "FBT1", 2, 3); // 2 large modules along Z
-  par[2] = zm1 / 2;
-  gMC->Gsvolu("FBT2", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
-  gMC->Gsdvn("FDT2", "FBT2", 2, 3); // 2 (PHOS) modules along Z
-  par[2] = zm2 / 2;
-  gMC->Gsvolu("FBT3", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
-  gMC->Gsdvn("FDT3", "FBT3", 1, 3); // 1 (RICH) module along Z
-  //
-  //  subtraction of dead boundaries in X=2 cm and Z=7/2 cm 
-  par[0] = par[0]-2.;
-  Int_t nz0, nz1, nz2, nx; //- numbers of pixels
-  nx = Int_t (par[0]*2/xp);
+// Large not sensitive volumes with CO2 
+  par[0] = xFLT/2;
+  par[1] = yFLT/2;
+
   cout <<"************************* TOF geometry **************************"<<endl;
-  cout<< "nx = "<< nx << " x size = "<< par[0]*2/nx << endl;
-  par[1] = -1;
-  par[2] = (zm0 / 2.)/2.; //this is half size of module after division by 2
-  par[2]=par[2]-7/2.;
-  nz0 = Int_t (par[2]*2/zp);
-cout<< "nz0 = "<< nz0 << " z0 size = "<< par[2]*2/nz0 << endl;
+
+  par[2] = (zFLT1 / 2.);
   gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FLT1", 0, "FDT1", 0., 0., 0., 0, "ONLY");
-  par[2] = (zm1 / 2.)/2.; //this is half size of module after division by 2
-  par[2]=par[2]-7/2.;
-  nz1 = Int_t (par[2]*2/zp);
-cout<< "nz1 = "<< nz1 << " z1 size = "<< par[2]*2/nz1 << endl;
+  gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
+
+  par[2] = (zFLT2 / 2.);
   gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FLT2", 0, "FDT2", 0., 0., 0., 0, "ONLY");
-  par[2] = (zm2 / 2.); //this is half size of module after division by 1
-  par[2]=par[2]-7/2.;
-  nz2 = Int_t (par[2]*2/zp);
-cout<< "nz2 = "<< nz2 << " z2 size = "<< par[2]*2/nz2 << endl;
+  gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
+
+  par[2] = (zFLT3 / 2.); 
   gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FLT3", 0, "FDT3", 0., 0., 0., 0, "ONLY");
-  //
+  gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
+
 ////////// Layers before detector ////////////////////
-// Mylar layer in front 0.5mm thick at the beginning
+
+// Alluminium layer in front 1.0 mm thick at the beginning
   par[0] = -1;
-  par[1] = 0.05 / 2;
+  par[1] = 0.1;
   par[2] = -1;
-  ycoor = -ym/2 + par[1];
-  gMC->Gsvolu("FMY1", "BOX ", idtmed[511], par, 3); // Mylar
+  ycoor = -yFLT/2 + par[1];
+  gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
   gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FMY2", "BOX ", idtmed[511], par, 3); // Mylar
+  gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
   gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FMY3", "BOX ", idtmed[511], par, 3); // Mylar
+  gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium 
   gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-// Honeycomb layer (1cm of special!!! polyethilene)
+
+// Honeycomb layer (1cm of special polyethilene)
   ycoor = ycoor + par[1];
   par[0] = -1;
-  par[1] = 1. / 2;
+  par[1] = 0.5;
   par[2] = -1;
   ycoor = ycoor + par[1];
   gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
@@ -160,80 +197,205 @@ cout<< "nz2 = "<< nz2 << " z2 size = "<< par[2]*2/nz2 << endl;
   gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  //
+
 ///////////////// Detector itself //////////////////////
+
+  const Float_t StripWidth = 7.81;//cm
+  const Float_t DeadBound = 1.;//cm non-sensitive between the pad edge and the boundary of the strip
+  const Int_t nx = 40; // number of pads along x
+  const Int_t nz = 2;  // number of pads along z
+  const Float_t Gap=4.; //cm  distance between the strip axis
+  const Float_t Space = 5.5; //cm distance from the front plate of the box
+
+  Float_t zSenStrip;
+  zSenStrip = StripWidth-2*DeadBound;//cm
+
+  par[0] = -1;
+  par[1] = yPad/2; 
+  par[2] = StripWidth/2.;
+  
+  // Glass Layer of detector
+  gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
+
+  // Freon for non-sesitive boundaries
   par[0] = -1;
-  par[1] = yp/2; // 5 %X0 thick of glass  
+  par[1] = 0.110/2;
   par[2] = -1;
-  ycoor = -ym/2 + 2;
-  gMC->Gsvolu("FLD1", "BOX ", idtmed[514], par, 3); // Glass
-  gMC->Gspos("FLD1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FLD2", "BOX ", idtmed[514], par, 3); // Glass
-  gMC->Gspos("FLD2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FLD3", "BOX ", idtmed[514], par, 3); // Glass
-  gMC->Gspos("FLD3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  //
-  gMC->Gsdvn("FLZ1", "FLD1", nz0, 3); //pixel size xp=zp=3
-  gMC->Gsdvn("FLZ2", "FLD2", nz1, 3); 
-  gMC->Gsdvn("FLZ3", "FLD3", nz2, 3); 
-  gMC->Gsdvn("FLX1", "FLZ1", nx, 1); 
-  gMC->Gsdvn("FLX2", "FLZ2", nx, 1); 
-  gMC->Gsdvn("FLX3", "FLZ3", nx, 1); 
-  // RPC pixel itself 
-  par[0] = -1;//xp/2;
-  par[1] = -1;//yp/2; // 5 %X0 thick of glass  
-  par[2] = -1;//zp/2;
-  gMC->Gsvolu("FPA0", "BOX ", idtmed[514], par, 3);// Glass
-  gMC->Gspos("FPA0", 1, "FLX1", 0., 0., 0., 0, "ONLY");
-  gMC->Gspos("FPA0", 2, "FLX2", 0., 0., 0., 0, "ONLY");
-  gMC->Gspos("FPA0", 3, "FLX3", 0., 0., 0., 0, "ONLY");
-  // Freon gas sencitive volume
+  gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
+  gMC->Gspos("FNSF",0,"FSTR",0.,0.,0.,0,"ONLY");
+  // Mylar for non-sesitive boundaries
+  par[1] = 0.025;
+  gMC->Gsvolu("FMYI","BOX",idtmed[510],par,3); 
+  gMC->Gspos("FMYI",0,"FNSF",0.,0.,0.,0,"ONLY");
+
+  // Mylar for outer layers
+  par[1] = 0.035/2;
+  ycoor = -yPad/2.+par[1];
+  gMC->Gsvolu("FMYX","BOX",idtmed[510],par,3);
+  gMC->Gspos("FMYX",1,"FSTR",0.,ycoor,0.,0,"ONLY");
+  gMC->Gspos("FMYX",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
+  ycoor += par[1];
+  // Graphyte layers
+  par[1] = 0.003/2;
+  ycoor += par[1];
+  gMC->Gsvolu("FGRL","BOX",idtmed[502],par,3);
+  gMC->Gspos("FGRL",1,"FSTR",0.,ycoor,0.,0,"ONLY");
+  gMC->Gspos("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
+
+  // Freon sensitive layer
+  par[0] = -1;
+  par[1] = 0.110/2.;
+  par[2] = zSenStrip/2.;
+  gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
+  gMC->Gspos("FCFC",0,"FNSF",0.,0.,0.,0,"ONLY");
+  
+  // Pad definition x & z
+  gMC->Gsdvn("FLZ","FCFC", nz, 3); 
+  gMC->Gsdvn("FLX","FLZ" , nx, 1); 
+
+  // MRPC pixel itself 
   par[0] = -1;
-  par[1] = zazor/2;
+  par[1] = -1; 
   par[2] = -1;
-  gMC->Gsvolu("FPG0", "BOX ", idtmed[513], par, 3);// Freon 
-  gMC->Gspos("FPG0", 0, "FPA0", 0., 0., 0., 0, "ONLY");
-  //
-////////// Layers after detector ////////////////////
-  // Honeycomb layer after (3cm)
+  gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);
+  gMC->Gspos("FPAD", 0, "FLX", 0., 0., 0., 0, "ONLY");
+
+
+////  Positioning the Strips  (FSTR) in the FLT volumes  /////
+
+  // 3 (Central) Plate 
+  Float_t t = zFLT1+zFLT2+zFLT3/2.+7.*2.5;//Half Width of Barrel
+  Float_t zpos = 0;
+  Float_t ang;
+  Float_t Offset;  
+  Float_t last;
+  nrot = 0;
+  Int_t i=1,j=1;
+  zcoor=0;
+  Int_t UpDown=-1; // UpDown=-1 -> Upper strip, UpDown=+1 -> Lower strip
+  do{
+     ang = atan(zcoor/t);
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     AliMatrix (idrotm[nrot+1], 90., 180., 90.+ang,90.,ang, 0);
+     ycoor = -14.5+ Space; //2 cm over front plate
+     ycoor += (1-(UpDown+1)/2)*Gap;
+     gMC->Gspos("FSTR",j  ,"FLT3",0.,ycoor, zcoor,idrotm[nrot],  "ONLY");
+     gMC->Gspos("FSTR",j+1,"FLT3",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
+     ang  = ang*3.141592654/180;
+     
+     zcoor=zcoor-(zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
+     UpDown*= -1; // Alternate strips 
+     i++;
+     j+=2;
+  } while (zcoor-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+zFLT2+7*2.5);
+  
+  ycoor = -29./2.+ Space; //2 cm over front plate
+
+  // Plate  2
+  zpos = -zFLT3/2-7.;
+  ang  = atan(zpos/sqrt(2*t*t-zpos*zpos));
+  Offset = StripWidth*TMath::Cos(ang)/2;
+  zpos -= Offset;
+  nrot = 0;
+  i=1;
+  // UpDown has not to be reinitialized, so that the arrangement of the strips can continue coherently
+
+  do {
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     ycoor = -29./2.+ Space ; //2 cm over front plate
+     ycoor += (1-(UpDown+1)/2)*Gap;
+     zcoor = zpos+(zFLT3/2.+7+zFLT2/2); // Moves to the system of the centre of the modulus FLT2
+     gMC->Gspos("FSTR",i, "FLT2", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+     ang  = ang*3.141592654/180;
+     zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
+     last = StripWidth*TMath::Cos(ang)/2;
+     UpDown*=-1;
+     i++; 
+  } while (zpos-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+7);
+
+  // Plate  1
+  zpos = -t+zFLT1+3.5;
+  ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+  Offset = StripWidth*TMath::Cos(ang)/2.;
+  zpos -= Offset;
+  nrot = 0;
+  i=0;
+  ycoor= -29./2.+Space+Gap/2;
+
+ do {
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     i++;
+     zcoor = zpos+(zFLT1/2+zFLT2+zFLT3/2+7.*2.);
+     gMC->Gspos("FSTR",i, "FLT1", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+     ang  = ang *3.141592654/180;
+     zpos = zpos - zSenStrip/TMath::Cos(ang);
+     last = StripWidth*TMath::Cos(ang)/2.;
+  }  while (zpos>-t+7.+last);
+
+printf("#######################################################\n");
+printf("     Distance from the bound of the FLT3: zFLT3- %f cm \n", zpos+(zSenStrip/2)/TMath::Cos(ang));
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     zpos = zpos - zSenStrip/TMath::Cos(ang);
+printf("NEXT Distance from the bound of the FLT3: zFLT3- %f cm \n", zpos+(zSenStrip/2)/TMath::Cos(ang));
+printf("#######################################################\n");
+
+////////// Layers after detector /////////////////
+
+// Honeycomb layer after (3cm)
+
+  Float_t OverSpace = Space + 7.3;
+///  StripWidth*TMath::Sin(ang) + 1.3;
+
   par[0] = -1;
-  par[1] = 1.2 / 2.;
+  par[1] = 0.6;
   par[2] = -1;
-  ycoor = -ym/2 + 6. - par[1];
+  ycoor = -yFLT/2 + OverSpace + par[1];
   gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  // Electronics (Cu) after
+
+// Electronics (Cu) after
+  ycoor += par[1];
   par[0] = -1;
   par[1] = 1.43*0.05 / 2.; // 5% of X0
   par[2] = -1;
-  ycoor = -ym/2 + 6.+par[1];
+  ycoor += par[1];
   gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
   gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
   gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
   gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
- // Cooling water after
-  ycoor = ycoor+par[1];
+
+// Cooling water after
+  ycoor += par[1];
   par[0] = -1;
   par[1] = 36.1*0.02 / 2.; // 2% of X0
   par[2] = -1;
-  ycoor = ycoor+par[1];
+  ycoor += par[1];
   gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
   gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
   gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
   gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  //back plate honycomb (2cm)
+
+//back plate honycomb (2cm)
   par[0] = -1;
   par[1] = 2 / 2.;
   par[2] = -1;
-  ycoor = ym/2 - par[1];
+  ycoor = yFLT/2 - par[1];
   gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
@@ -269,19 +431,19 @@ void AliTOFv1::DrawModule()
   gMC->Gsatt("FLT1","SEEN",1);
   gMC->Gsatt("FLT2","SEEN",1);
   gMC->Gsatt("FLT3","SEEN",1);
-   gMC->Gsatt("FPL1","SEEN",1);
-   gMC->Gsatt("FPL2","SEEN",1);
-   gMC->Gsatt("FPL3","SEEN",1);
-   gMC->Gsatt("FLD1","SEEN",1);
-   gMC->Gsatt("FLD2","SEEN",1);
-   gMC->Gsatt("FLD3","SEEN",1);
-   gMC->Gsatt("FLZ1","SEEN",1);
-   gMC->Gsatt("FLZ2","SEEN",1);
-   gMC->Gsatt("FLZ3","SEEN",1);
-   gMC->Gsatt("FLX1","SEEN",1);
-   gMC->Gsatt("FLX2","SEEN",1);
-   gMC->Gsatt("FLX3","SEEN",1);
-   gMC->Gsatt("FPA0","SEEN",1);
+  gMC->Gsatt("FPL1","SEEN",1);
+  gMC->Gsatt("FPL2","SEEN",1);
+  gMC->Gsatt("FPL3","SEEN",1);
+  gMC->Gsatt("FLD1","SEEN",1);
+  gMC->Gsatt("FLD2","SEEN",1);
+  gMC->Gsatt("FLD3","SEEN",1);
+  gMC->Gsatt("FLZ1","SEEN",1);
+  gMC->Gsatt("FLZ2","SEEN",1);
+  gMC->Gsatt("FLZ3","SEEN",1);
+  gMC->Gsatt("FLX1","SEEN",1);
+  gMC->Gsatt("FLX2","SEEN",1);
+  gMC->Gsatt("FLX3","SEEN",1);
+  gMC->Gsatt("FPA0","SEEN",1);
   //
   gMC->Gdopt("hide", "on");
   gMC->Gdopt("shad", "on");
@@ -368,12 +530,3 @@ void AliTOFv1::StepManager()
   }
 }
 
-
-
-
-
-
-
-
-
-
index 243aacf..36a8277 100644 (file)
@@ -30,7 +30,7 @@ public:
   virtual void   CreateMaterials();
   virtual void   Init();
   virtual Int_t  IsVersion() const {return 1;}
-  virtual void   TOFpc(Float_t, Float_t, Float_t, Float_t, Float_t);
+  virtual void   TOFpc(Float_t,Float_t,Float_t,Float_t,Float_t,Float_t);
   virtual void   StepManager();
   virtual void   DrawModule();
  
index 9bf4afe..c613dd1 100644 (file)
 
 /*
 $Log$
+Revision 1.9  1999/09/29 09:24:33  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  Time Of Flight: design of P.Fonte                                        //
-//  This class contains the functions for version 2 of the Time Of Flight    //
+//  Time Of Flight: design of C.Williams                FCA                  //
+//  This class contains the functions for version 1 of the Time Of Flight    //
 //  detector.                                                                //
-//                                                                           //
+//
+//  VERSION WITH 5 MODULES AND TILTED STRIPS 
+//  
+//   WITH HOLES FOR PHOS AND HMPID 
+//   INSIDE A FULL COVERAGE SPACE FRAME
+//
+//
+//   Authors: 
+//
+//   Alessio Seganti
+//   Domenico Vicinanza
+//
+//   University of Salerno - Italy
+//
+//
+//
 //Begin_Html
 /*
 <img src="picts/AliTOFv2Class.gif">
@@ -66,216 +84,330 @@ void AliTOFv2::CreateGeometry()
   */
   //End_Html
   //
-  //
-  // Create common geometry
+  // Creates common geometry
   //
   AliTOF::CreateGeometry();
 }
  
 //_____________________________________________________________________________
-void AliTOFv2::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
-                    Float_t zm1, Float_t zm2)
+void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
+                    Float_t zlen2, Float_t zlen3, Float_t ztof0)
 {
   //
   // Definition of the Time Of Fligh Resistive Plate Chambers
-  // xm, ym, zm - sizes of TOF modules (large)
+  // xFLT, yFLT, zFLT - sizes of TOF modules (large)
   
-  Int_t inum;
-  Float_t xcor, ycor, zcor, ycoor;
-  Float_t zazor, dx, dy, dz, xp, yp, zp, ywidth;
-  Int_t ink;
+  Int_t idrotm[100];
+  Int_t nrot = 0;
+  Float_t  ycoor, zcoor;
   Float_t par[10];
-  Int_t inz, nxp, npx, npz;
-  Float_t xsz, ysz, zsz;
-  Int_t nzp0, nzp1, nzp2;
   
   Int_t *idtmed = fIdtmed->GetArray()-499;
+
+
+  par[0] =  xtof / 2.;
+  par[1] =  ytof / 2.;
+  par[2] = zlen1 / 2.;
+  gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen2 / 2.;
+  gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen3 / 2.;
+  gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
+
+
+// Position of modules
+  Float_t zcor1 = ztof0 - zlen1/2;
+  Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
+  Float_t zcor3 = 0.;
+
+   AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
+   AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
+   gMC->Gspos("FTO1", 1, "BTO1", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO1", 1, "BTO2", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO1", 1, "BTO3", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
+
+   gMC->Gspos("FTO2", 1, "BTO1", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO2", 1, "BTO2", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
+
+   gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3,  0, idrotm[0], "ONLY");
+
+// Subtraction the distance to TOF module boundaries 
+
+  Float_t db = 7.;
+  Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3; 
+
+  xFLT = xtof -(.5 +.5)*2;
+  yFLT = ytof;
+  zFLT1 = zlen1 - db;
+  zFLT2 = zlen2 - db;
+  zFLT3 = zlen3 - db;
+
+  
+// Sizes of MRPC pads
+
+  Float_t yPad = 0.505; 
   
-  // X size of small RPC plate G10 
-  xsz = 60.;
-  // Y size (thickness) of large && small RPC plate G10 
-  ysz = .26;
-  // Z size of small RPC plate G10
-  zsz = 50.;
-  // Width of CO2 box with RPC
-  ywidth = 4.;
-  // Frame width along X,Y and Z axis of RPC chambers 
-  dx = 0.;
-  dy = .3; //this is 1mm(ceramic) + 1mm(Al) + 1mm(polyethelene) 
-  dz = 0.;
-  // gap in RPC chamber 
-  zazor = .03;
-  // Sizes of RPC chamber 
-  xp = 3.06; //small pixel
-//xp = 3.9; //large pixel 
-  yp = zazor + dy * 2; //=0.83cm total thickness of RPC
-  zp = 3.06; //small pixel
-//zp = 4.1; //large pixel
-  // Large not sensitive volumes with CO2 
-  par[0] = xm / 2.;
-  par[1] = ywidth / 2.;
-  par[2] = zm0 / 2.;
-  gMC->Gsvolu("FBT1", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
-  par[2] = zm1 / 2.;
-  gMC->Gsvolu("FBT2", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
-  par[2] = zm2 / 2.;
-  gMC->Gsvolu("FBT3", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
-  // Large electronic plate (G10) after
-  par[0] = xm / 2.;
-  par[1] = ysz / 2.;
-  par[2] = zm0 / 2.;
-  ycoor = yp + par[1];
-  gMC->Gsvolu("FPE1", "BOX ", idtmed[504], par, 3); // G10
-  gMC->Gspos("FPE1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm1 / 2.;
-  gMC->Gsvolu("FPE2", "BOX ", idtmed[504], par, 3); // G10
-  gMC->Gspos("FPE2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm2 / 2.;
-  gMC->Gsvolu("FPE3", "BOX ", idtmed[504], par, 3); // G10
-  gMC->Gspos("FPE3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
-  // Electronics (5cm thick) after
-  //first - Cu (0.02574cm thick - 1.8% X0)
-  par[0] = xm / 2.;
-  par[1] = 0.02574 / 2.;
-  par[2] = zm0 / 2.;
-  ycoor = yp + ysz + 5/2 - par[1];
+// Large not sensitive volumes with CO2 
+  par[0] = xFLT/2;
+  par[1] = yFLT/2;
+
+  cout <<"************************* TOF geometry **************************"<<endl;
+
+  par[2] = (zFLT1 / 2.);
+  gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
+
+  par[2] = (zFLT2 / 2.);
+  gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
+
+  par[2] = (zFLT3 / 2.); 
+  gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
+
+////////// Layers before detector ////////////////////
+
+// Alluminium layer in front 1.0 mm thick at the beginning
+  par[0] = -1;
+  par[1] = 0.1;
+  par[2] = -1;
+  ycoor = -yFLT/2 + par[1];
+  gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
+  gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
+  gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium 
+  gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Honeycomb layer (1cm of special polyethilene)
+  ycoor = ycoor + par[1];
+  par[0] = -1;
+  par[1] = 0.5;
+  par[2] = -1;
+  ycoor = ycoor + par[1];
+  gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPL2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+///////////////// Detector itself //////////////////////
+
+  const Float_t StripWidth = 7.81;//cm
+  const Float_t DeadBound = 1.;//cm non-sensitive between the pad edge and the boundary of the strip
+  const Int_t nx = 40; // number of pads along x
+  const Int_t nz = 2;  // number of pads along z
+  const Float_t Gap=4.; //cm  distance between the strip axis
+  const Float_t Space = 5.5; //cm distance from the front plate of the box
+
+  Float_t zSenStrip;
+  zSenStrip = StripWidth-2*DeadBound;//cm
+
+  par[0] = -1;
+  par[1] = yPad/2; 
+  par[2] = StripWidth/2.;
+  
+  // Glass Layer of detector
+  gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
+
+  // Freon for non-sesitive boundaries
+  par[0] = -1;
+  par[1] = 0.110/2;
+  par[2] = -1;
+  gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
+  gMC->Gspos("FNSF",0,"FSTR",0.,0.,0.,0,"ONLY");
+  // Mylar for non-sesitive boundaries
+  par[1] = 0.025;
+  gMC->Gsvolu("FMYI","BOX",idtmed[510],par,3); 
+  gMC->Gspos("FMYI",0,"FNSF",0.,0.,0.,0,"ONLY");
+
+  // Mylar for outer layers
+  par[1] = 0.035/2;
+  ycoor = -yPad/2.+par[1];
+  gMC->Gsvolu("FMYX","BOX",idtmed[510],par,3);
+  gMC->Gspos("FMYX",1,"FSTR",0.,ycoor,0.,0,"ONLY");
+  gMC->Gspos("FMYX",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
+  ycoor += par[1];
+  // Graphyte layers
+  par[1] = 0.003/2;
+  ycoor += par[1];
+  gMC->Gsvolu("FGRL","BOX",idtmed[502],par,3);
+  gMC->Gspos("FGRL",1,"FSTR",0.,ycoor,0.,0,"ONLY");
+  gMC->Gspos("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
+
+  // Freon sensitive layer
+  par[0] = -1;
+  par[1] = 0.110/2.;
+  par[2] = zSenStrip/2.;
+  gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
+  gMC->Gspos("FCFC",0,"FNSF",0.,0.,0.,0,"ONLY");
+  
+  // Pad definition x & z
+  gMC->Gsdvn("FLZ","FCFC", nz, 3); 
+  gMC->Gsdvn("FLX","FLZ" , nx, 1); 
+
+  // MRPC pixel itself 
+  par[0] = -1;
+  par[1] = -1; 
+  par[2] = -1;
+  gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);
+  gMC->Gspos("FPAD", 0, "FLX", 0., 0., 0., 0, "ONLY");
+
+
+////  Positioning the Strips  (FSTR) in the FLT volumes  /////
+
+  // 3 (Central) Plate 
+  Float_t t = zFLT1+zFLT2+zFLT3/2.+7.*2.5;//Half Width of Barrel
+  Float_t zpos = 0;
+  Float_t ang;
+  Float_t Offset;  
+  Float_t last;
+  nrot = 0;
+  Int_t i=1,j=1;
+  zcoor=0;
+  Int_t UpDown=-1; // UpDown=-1 -> Upper strip, UpDown=+1 -> Lower strip
+  do{
+     ang = atan(zcoor/t);
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     AliMatrix (idrotm[nrot+1], 90., 180., 90.+ang,90.,ang, 0);
+     ycoor = -29./2.+ Space; //2 cm over front plate
+     ycoor += (1-(UpDown+1)/2)*Gap;
+     gMC->Gspos("FSTR",j,"FLT3",0.,ycoor,zcoor,idrotm[nrot],"ONLY");
+     gMC->Gspos("FSTR",j+1,"FLT3",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
+     ang  = ang*3.141592654/180;
+     
+     zcoor=zcoor-(zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
+     UpDown*= -1; // Alternate strips 
+     i++;
+     j+=2;
+  } while (zcoor-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+zFLT2+7*2.5);
+  
+  ycoor = -29./2.+ Space; //2 cm over front plate
+
+  // Plate  2
+  zpos = -zFLT3/2-7;
+  ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+  Offset = StripWidth*TMath::Cos(ang)/2;
+  zpos -= Offset;
+  nrot = 0;
+  i=1;
+  // UpDown has not to be reinitialized, so that the arrangement of the strips can continue coherently
+
+  do {
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     ycoor = -29./2.+ Space ; //2 cm over front plate
+     ycoor += (1-(UpDown+1)/2)*Gap;
+     zcoor = zpos+(zFLT3/2.+7+zFLT2/2); // Moves to the system of the centre of the modulus FLT2
+     gMC->Gspos("FSTR",i, "FLT2", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+     ang  = ang*3.141592654/180;
+     zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
+     last = StripWidth*TMath::Cos(ang)/2;
+     UpDown*=-1;
+     i++; 
+  } while (zpos-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+7);
+
+  // Plate  1
+  zpos = -t+zFLT1+3.5;
+  ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+  Offset = StripWidth*TMath::Cos(ang)/2.;
+  zpos -= Offset;
+  nrot = 0;
+  i=0;
+  ycoor= -29./2.+Space+Gap/2;
+
+ do {
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     i++;
+     zcoor = zpos+(zFLT1/2+zFLT2+zFLT3/2+7.*2.);
+     gMC->Gspos("FSTR",i, "FLT1", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+     ang  = ang *3.141592654/180;
+     zpos = zpos - zSenStrip/TMath::Cos(ang);
+     last = StripWidth*TMath::Cos(ang)/2.;
+  }  while (zpos>-t+7.+last);
+
+printf("#######################################################\n");
+printf("     Distance from the bound of the FLT3: zFLT3- %f cm \n", zpos+(zSenStrip/2)/TMath::Cos(ang));
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     zpos = zpos - zSenStrip/TMath::Cos(ang);
+printf("NEXT Distance from the bound of the FLT3: zFLT3- %f cm \n", zpos+(zSenStrip/2)/TMath::Cos(ang));
+printf("#######################################################\n");
+
+////////// Layers after detector /////////////////
+
+// Honeycomb layer after (3cm)
+
+  Float_t OverSpace = Space + 7.3;
+///  StripWidth*TMath::Sin(ang) + 1.3;
+
+  par[0] = -1;
+  par[1] = 0.6;
+  par[2] = -1;
+  ycoor = -yFLT/2 + OverSpace + par[1];
+  gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Electronics (Cu) after
+  ycoor += par[1];
+  par[0] = -1;
+  par[1] = 1.43*0.05 / 2.; // 5% of X0
+  par[2] = -1;
+  ycoor += par[1];
   gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
-  gMC->Gspos("FEC1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm1 / 2.;
+  gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
-  gMC->Gspos("FEC2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm2 / 2.;
+  gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
-  gMC->Gspos("FEC3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
-  //second - G10 (0.2328cm thick - 1.2% X0)
-  par[0] = xm / 2.;
-  par[1] = 0.2328 / 2.;
-  par[2] = zm0 / 2.;
-  ycoor = yp + ysz + 5/2 + par[1];
-  gMC->Gsvolu("FEG1", "BOX ", idtmed[504], par, 3); // G10
-  gMC->Gspos("FEG1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm1 / 2.;
-  gMC->Gsvolu("FEG2", "BOX ", idtmed[504], par, 3); // G10
-  gMC->Gspos("FEG2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm2 / 2.;
-  gMC->Gsvolu("FEG3", "BOX ", idtmed[504], par, 3); // G10
-  gMC->Gspos("FEG3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
-  // Al support (5mm thick) after
-  par[0] = xm / 2.;
-  par[1] = 0.5 / 2.;
-  par[2] = zm0 / 2.;
-  ycoor = yp + ysz + par[1];
-  gMC->Gsvolu("FSP1", "BOX ", idtmed[508], par, 3); // Al
-  gMC->Gspos("FSP1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm1 / 2.;
-  gMC->Gsvolu("FSP2", "BOX ", idtmed[508], par, 3); // Al
-  gMC->Gspos("FSP2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm2 / 2.;
-  gMC->Gsvolu("FSP3", "BOX ", idtmed[508], par, 3); // Al
-  gMC->Gspos("FSP3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
-  // Mylar layer in front 0.5mm thick at 5mm from detector
-  par[0] = xm / 2.;
-  par[1] = 0.05 / 2;
-  par[2] = zm0 / 2.;
-  ycoor = -yp - 0.5 - par[1];
-  gMC->Gsvolu("FMY1", "BOX ", idtmed[511], par, 3); // G10
-  gMC->Gspos("FMY1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm1 / 2.;
-  gMC->Gsvolu("FMY2", "BOX ", idtmed[511], par, 3); // G10
-  gMC->Gspos("FMY2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
-  par[2] = zm2 / 2.;
-  gMC->Gsvolu("FMY3", "BOX ", idtmed[511], par, 3); // G10
-  gMC->Gspos("FMY3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
-  //  insensitive volumes - large box for RPCs 
-  par[1] = yp; // two times thicker than RPC
-  par[2] = zm0 / 2.;
-  gMC->Gsvolu("FLT1", "BOX ", idtmed[512], par, 3); //Freon not senc.
-  gMC->Gspos("FLT1", 0, "FBT1", 0., 0., 0., 0, "ONLY");
-  par[2] = zm1 / 2.;
-  gMC->Gsvolu("FLT2", "BOX ", idtmed[512], par, 3); //Freon not senc.
-  gMC->Gspos("FLT2", 0, "FBT2", 0., 0., 0., 0, "ONLY");
-  par[2] = zm2 / 2.;
-  gMC->Gsvolu("FLT3", "BOX ", idtmed[512], par, 3); //Freon not senc.
-  gMC->Gspos("FLT3", 0, "FBT3", 0., 0., 0., 0, "ONLY");
-  // RPC box (small plate) number along X axis 
-  nxp = Int_t (xm / xsz);
-  // RPC box (small plate) number along Z axis 
-  nzp0 = Int_t (zm0 / zsz);
-  nzp1 = Int_t (zm1 / zsz);
-  nzp2 = Int_t (zm2 / zsz);
-  // (small) box (plate) for RPC size with insencitive Freon
-  par[0] = xm * .5 / nxp;
-  par[1] = yp; // two times thicker than RPC
-  par[2] = zm0 * .5 / nzp0;
-  gMC->Gsvolu("FLK0", "BOX ", idtmed[512], par, 3); //Freon not sencitive
-  // Position of (small) RPC boxes 
-  inum = 0;
-  for (ink = 1; ink <= nxp; ++ink) {
-    xcor = xm * .5 * ((ink * 2 - 1) / (Float_t) nxp -  1.);
-    for (inz = 1; inz <= nzp0; ++inz) {
-      zcor = zm0 * .5 * ((inz * 2 - 1) / (Float_t) nzp0 - 1.);
-      ++inum;
-      gMC->Gspos("FLK0", inum, "FLT1", xcor, 0., zcor, 0, "ONLY");
-    }
-    for (inz = 1; inz <= nzp1; ++inz) {
-      zcor = zm1 * .5 * ((inz * 2 - 1) / (Float_t) nzp1 - 1.);
-      ++inum;
-      gMC->Gspos("FLK0", inum, "FLT2", xcor, 0., zcor, 0, "ONLY");
-    }
-    for (inz = 1; inz <= nzp2; ++inz) {
-      zcor = zm2 * .5 * ((inz * 2 - 1) / (Float_t) nzp2 - 1.);
-      ++inum;
-      gMC->Gspos("FLK0", inum, "FLT3", xcor, 0., zcor, 0, "ONLY");
-    }
-  }
-  // Polyethilene boxes for RPC cell
-  npx = 19; //number of small pixels along X
-  npz = 16; //number of small pixels along Z
-  //  npx = 15; //large pixel
-  //  npz = 12; //large pixel
-  par[0] = xsz * .5 / npx;
-  par[1] = yp/2; 
-  par[2] = zsz * .5 / npz;
-  gMC->Gsvolu("FPP0", "BOX ", idtmed[503], par, 3); // Polyethilene
-  inum = 0;
-  for (ink = 1; ink <= npx; ++ink) {
-    xcor = xsz * .5 * ((ink * 2 - 1) / (Float_t) npx - 1.);
-    if (ink%2 != 0) ycor=yp/2; else ycor=-yp/2;
-    for (inz = 1; inz <= npz; ++inz) {
-      zcor = zsz * .5 * ((inz * 2 - 1) / (Float_t) npz - 1.);
-      ++inum;
-      gMC->Gspos("FPP0", inum, "FLK0", xcor, ycor, zcor, 0, "ONLY");
-      ycor=-ycor;
-    }
-  }
-  //Al RPC geometry 
-  par[0] = xp / 2.;
-  par[1] = yp / 2. - 0.1; //minus 1mm of poliethelene
-  par[2] = zp / 2.;
-  gMC->Gsvolu("FPA0", "BOX ", idtmed[508], par, 3);// Al
-  gMC->Gspos("FPA0", inum, "FPP0", 0., 0., 0., 0, "ONLY");
-  //Ceramic RPC geometry 
-  par[0] = xp / 2.;
-  par[1] = par[1] - 0.1; //minus 1mm of Al
-  par[2] = zp / 2.;
-  gMC->Gsvolu("FPC0", "BOX ", idtmed[507], par, 3);// Ceramic
-  gMC->Gspos("FPC0", inum, "FPA0", 0., 0., 0., 0, "ONLY");
-  // Freon gas sencitive volume
-  par[0] = xp / 2. - dx;
-  par[1] = yp / 2. - dy;
-  par[2] = zp / 2. - dz;
-  gMC->Gsvolu("FPG0", "BOX ", idtmed[513], par, 3);// Freon 
-  gMC->Gspos("FPG0", 0, "FPC0", 0., 0., 0., 0, "ONLY");
+  gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Cooling water after
+  ycoor += par[1];
+  par[0] = -1;
+  par[1] = 36.1*0.02 / 2.; // 2% of X0
+  par[2] = -1;
+  ycoor += par[1];
+  gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+//back plate honycomb (2cm)
+  par[0] = -1;
+  par[1] = 2 / 2.;
+  par[2] = -1;
+  ycoor = yFLT/2 - par[1];
+  gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEG3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
 }
 
 //_____________________________________________________________________________
 void AliTOFv2::DrawModule()
 {
   //
-  // Draw a shaded view of the Time Of Flight version 2
+  // Draw a shaded view of the Time Of Flight version 1
   //
   // Set everything unseen
   gMC->Gsatt("*", "seen", -1);
@@ -285,17 +417,32 @@ void AliTOFv2::DrawModule()
   //
   // Set the volumes visible
   gMC->Gsatt("ALIC","SEEN",0);
-  gMC->Gsatt("FBAR","SEEN",0);
-  gMC->Gsatt("FTO1","SEEN",0);
-  gMC->Gsatt("FTO2","SEEN",0);
-  gMC->Gsatt("FTO3","SEEN",0);
-  gMC->Gsatt("FBT1","SEEN",0);
-  gMC->Gsatt("FBT2","SEEN",0);
-  gMC->Gsatt("FBT3","SEEN",0);
-  gMC->Gsatt("FLT1","SEEN",0);
-  gMC->Gsatt("FLT2","SEEN",0);
-  gMC->Gsatt("FLT3","SEEN",0);
-  gMC->Gsatt("FLK0","SEEN",1);
+  gMC->Gsatt("FBAR","SEEN",1);
+  gMC->Gsatt("FTO1","SEEN",1);
+  gMC->Gsatt("FTO2","SEEN",1);
+  gMC->Gsatt("FTO3","SEEN",1);
+  gMC->Gsatt("FBT1","SEEN",1);
+  gMC->Gsatt("FBT2","SEEN",1);
+  gMC->Gsatt("FBT3","SEEN",1);
+  gMC->Gsatt("FDT1","SEEN",1);
+  gMC->Gsatt("FDT2","SEEN",1);
+  gMC->Gsatt("FDT3","SEEN",1);
+  gMC->Gsatt("FLT1","SEEN",1);
+  gMC->Gsatt("FLT2","SEEN",1);
+  gMC->Gsatt("FLT3","SEEN",1);
+  gMC->Gsatt("FPL1","SEEN",1);
+  gMC->Gsatt("FPL2","SEEN",1);
+  gMC->Gsatt("FPL3","SEEN",1);
+  gMC->Gsatt("FLD1","SEEN",1);
+  gMC->Gsatt("FLD2","SEEN",1);
+  gMC->Gsatt("FLD3","SEEN",1);
+  gMC->Gsatt("FLZ1","SEEN",1);
+  gMC->Gsatt("FLZ2","SEEN",1);
+  gMC->Gsatt("FLZ3","SEEN",1);
+  gMC->Gsatt("FLX1","SEEN",1);
+  gMC->Gsatt("FLX2","SEEN",1);
+  gMC->Gsatt("FLX3","SEEN",1);
+  gMC->Gsatt("FPA0","SEEN",1);
   //
   gMC->Gdopt("hide", "on");
   gMC->Gdopt("shad", "on");
@@ -353,18 +500,18 @@ void AliTOFv2::StepManager()
     vol[2]=copy;
     gMC->CurrentVolOffID(3,copy);
     vol[1]=copy;
-    id=gMC->CurrentVolOffID(6,copy);
+    id=gMC->CurrentVolOffID(8,copy);
     vol[0]=copy;
     if(id==fIdFTO3) {
       vol[0]+=22;
-      id=gMC->CurrentVolOffID(4,copy);
-      if(id==fIdFLT3) vol[1]+=4;
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT3) vol[1]+=6;
     } else if (id==fIdFTO2) {
       vol[0]+=20;
-      id=gMC->CurrentVolOffID(4,copy);
+      id=gMC->CurrentVolOffID(5,copy);
       if(id==fIdFLT2) vol[1]+=8;
     } else {
-      id=gMC->CurrentVolOffID(4,copy);
+      id=gMC->CurrentVolOffID(5,copy);
       if(id==fIdFLT1) vol[1]+=14;
     }
     gMC->TrackPosition(pos);
@@ -381,3 +528,4 @@ void AliTOFv2::StepManager()
     new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
 }
+
index b09d500..8f7b6b1 100644 (file)
@@ -6,7 +6,7 @@
 /* $Id$ */
 
 ///////////////////////////////////////////////////////
-//  Manager and hits classes for set:TOF  version 2  //
+//  Manager and hits classes for set:TOF  version 1  //
 ///////////////////////////////////////////////////////
  
 #include "AliTOF.h"
@@ -30,11 +30,11 @@ public:
   virtual void   CreateMaterials();
   virtual void   Init();
   virtual Int_t  IsVersion() const {return 2;}
-  virtual void   TOFpc(Float_t, Float_t, Float_t, Float_t, Float_t);
+  virtual void   TOFpc(Float_t,Float_t,Float_t,Float_t,Float_t,Float_t);
   virtual void   StepManager();
   virtual void   DrawModule();
  
    ClassDef(AliTOFv2,1)  //Time Of Flight version 2
-};
+   };
  
 #endif
index 542a8ea..1d96b04 100644 (file)
 
 /*
 $Log$
+Revision 1.9  1999/09/29 09:24:33  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  Time Of Flight: as for version 1 but full coverage                       //
-//  This class contains the functions for version 3 of the Time Of Flight    //
+//  Time Of Flight: design of C.Williams                FCA                  //
+//  This class contains the functions for version 1 of the Time Of Flight    //
 //  detector.                                                                //
-//                                                                           //
+//
+//  VERSION WITH 5 MODULES AND TILTED STRIPS 
+//  
+//   FULL COVERAGE VERSION
+//
+//   Authors:
+//
+//   Alessio Seganti
+//   Domenico Vicinanza
+//
+//   University of Salerno - Italy
+//
+//
 //Begin_Html
 /*
 <img src="picts/AliTOFv3Class.gif">
@@ -66,92 +81,116 @@ void AliTOFv3::CreateGeometry()
   */
   //End_Html
   //
-  //
-  // Create common geometry
+  // Creates common geometry
   //
   AliTOF::CreateGeometry();
 }
  
 //_____________________________________________________________________________
-void AliTOFv3::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
-                    Float_t zm1, Float_t zm2)
+void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
+                    Float_t zlen2, Float_t zlen3, Float_t ztof0)
 {
   //
   // Definition of the Time Of Fligh Resistive Plate Chambers
-  // xm, ym, zm - sizes of TOF modules (large)
+  // xFLT, yFLT, zFLT - sizes of TOF modules (large)
   
-  Float_t  ycoor;
-  Float_t zazor, xp, yp, zp;
+  Float_t  ycoor, zcoor;
   Float_t par[10];
   
   Int_t *idtmed = fIdtmed->GetArray()-499;
+
+  Int_t idrotm[100];
+  Int_t nrot = 0;
   
-  // gap in RPC chamber 
-  zazor = .03;
-  // Sizes of RPC chamber 
-  xp = 3.0; //small pixel
-//xp = 3.9; //large pixel 
-  yp = 12.3*0.05; // 5% X0 of glass 
-  zp = 3.0; //small pixel
-//zp = 4.1; //large pixel
-  // Large not sensitive volumes with CO2 
-  par[0] = xm/2;
-  par[1] = ym/2;
-  par[2] = zm0/2;
-  gMC->Gsvolu("FBT1", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
-  gMC->Gsdvn("FDT1", "FBT1", 2, 3); // 2 large modules along Z
-  par[2] = zm1 / 2;
-  gMC->Gsvolu("FBT2", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
-  gMC->Gsdvn("FDT2", "FBT2", 2, 3); // 2 (PHOS) modules along Z
-  par[2] = zm2 / 2;
-  gMC->Gsvolu("FBT3", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
-  gMC->Gsdvn("FDT3", "FBT3", 1, 3); // 1 (RICH) module along Z
-  //
-  //  subtraction of dead boundaries in X=2 cm and Z=7/2 cm 
-  par[0] = par[0]-2.;
-  Int_t nz0, nz1, nz2, nx; //- numbers of pixels
-  nx = Int_t (par[0]*2/xp);
+
+
+  par[0] =  xtof / 2.;
+  par[1] =  ytof / 2.;
+  par[2] = zlen1 / 2.;
+  gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen2 / 2.;
+  gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen3 / 2.;
+  gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
+
+
+// Positioning of modules
+
+   Float_t zcor1 = ztof0 - zlen1/2;
+   Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
+   Float_t zcor3 = 0.;
+
+   AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
+   AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
+   gMC->Gspos("FTO1", 1, "BTO1", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO1", 1, "BTO2", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO1", 1, "BTO3", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
+
+   gMC->Gspos("FTO2", 1, "BTO1", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO2", 1, "BTO2", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO2", 1, "BTO3", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
+
+   gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3,  0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO3", 0, "BTO2", 0, zcor3,  0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO3", 0, "BTO3", 0, zcor3,  0, idrotm[0], "ONLY");
+
+// Subtraction the distance to TOF module boundaries 
+
+  Float_t db = 7.;
+  Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
+
+  xFLT = xtof -(.5 +.5)*2;
+  yFLT = ytof;
+  zFLT1 = zlen1 - db;
+  zFLT2 = zlen2 - db;
+  zFLT3 = zlen3 - db;
+
+// Sizes of MRPC pads
+
+  Float_t yPad = 0.505; 
+  
+// Large not sensitive volumes with CO2 
+  par[0] = xFLT/2;
+  par[1] = yFLT/2;
+
   cout <<"************************* TOF geometry **************************"<<endl;
-  cout<< "nx = "<< nx << " x size = "<< par[0]*2/nx << endl;
-  par[1] = -1;
-  par[2] = (zm0 / 2.)/2.; //this is half size of module after division by 2
-  par[2]=par[2]-7/2.;
-  nz0 = Int_t (par[2]*2/zp);
-cout<< "nz0 = "<< nz0 << " z0 size = "<< par[2]*2/nz0 << endl;
+
+  par[2] = (zFLT1 / 2.);
   gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FLT1", 0, "FDT1", 0., 0., 0., 0, "ONLY");
-  par[2] = (zm1 / 2.)/2.; //this is half size of module after division by 2
-  par[2]=par[2]-7/2.;
-  nz1 = Int_t (par[2]*2/zp);
-cout<< "nz1 = "<< nz1 << " z1 size = "<< par[2]*2/nz1 << endl;
+  gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
+
+  par[2] = (zFLT2 / 2.);
   gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FLT2", 0, "FDT2", 0., 0., 0., 0, "ONLY");
-  par[2] = (zm2 / 2.); //this is half size of module after division by 1
-  par[2]=par[2]-7/2.;
-  nz2 = Int_t (par[2]*2/zp);
-cout<< "nz2 = "<< nz2 << " z2 size = "<< par[2]*2/nz2 << endl;
+  gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
+
+  par[2] = (zFLT3 / 2.); 
   gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
-  gMC->Gspos("FLT3", 0, "FDT3", 0., 0., 0., 0, "ONLY");
-  //
+  gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
+
 ////////// Layers before detector ////////////////////
-// Mylar layer in front 0.5mm thick at the beginning
+
+// Alluminium layer in front 1.0 mm thick at the beginning
   par[0] = -1;
-  par[1] = 0.05 / 2;
+  par[1] = 0.1;
   par[2] = -1;
-  ycoor = -ym/2 + par[1];
-  gMC->Gsvolu("FMY1", "BOX ", idtmed[511], par, 3); // Mylar
+  ycoor = -yFLT/2 + par[1];
+  gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
   gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FMY2", "BOX ", idtmed[511], par, 3); // Mylar
+  gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
   gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FMY3", "BOX ", idtmed[511], par, 3); // Mylar
+  gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium 
   gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-// Honeycomb layer (1cm of special!!! polyethilene)
+
+// Honeycomb layer (1cm of special polyethilene)
   ycoor = ycoor + par[1];
   par[0] = -1;
-  par[1] = 1. / 2;
+  par[1] = 0.5;
   par[2] = -1;
   ycoor = ycoor + par[1];
   gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
@@ -160,80 +199,204 @@ cout<< "nz2 = "<< nz2 << " z2 size = "<< par[2]*2/nz2 << endl;
   gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  //
+
 ///////////////// Detector itself //////////////////////
+
+  const Float_t StripWidth = 7.81;//cm
+  const Float_t DeadBound = 1.;//cm non-sensitive between the pad edge and the boundary of the strip
+  const Int_t nx = 40; // number of pads along x
+  const Int_t nz = 2;  // number of pads along z
+  const Float_t Gap=4.; //cm  distance between the strip axis
+  const Float_t Space = 5.5; //cm distance from the front plate of the box
+
+  Float_t zSenStrip;
+  zSenStrip = StripWidth-2*DeadBound;//cm
+
+  par[0] = -1;
+  par[1] = yPad/2; 
+  par[2] = StripWidth/2.;
+  
+  // Glass Layer of detector
+  gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
+
+  // Freon for non-sesitive boundaries
   par[0] = -1;
-  par[1] = yp/2; // 5 %X0 thick of glass  
+  par[1] = 0.110/2;
   par[2] = -1;
-  ycoor = -ym/2 + 2;
-  gMC->Gsvolu("FLD1", "BOX ", idtmed[514], par, 3); // Glass
-  gMC->Gspos("FLD1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FLD2", "BOX ", idtmed[514], par, 3); // Glass
-  gMC->Gspos("FLD2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
-  gMC->Gsvolu("FLD3", "BOX ", idtmed[514], par, 3); // Glass
-  gMC->Gspos("FLD3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  //
-  gMC->Gsdvn("FLZ1", "FLD1", nz0, 3); //pixel size xp=zp=3
-  gMC->Gsdvn("FLZ2", "FLD2", nz1, 3); 
-  gMC->Gsdvn("FLZ3", "FLD3", nz2, 3); 
-  gMC->Gsdvn("FLX1", "FLZ1", nx, 1); 
-  gMC->Gsdvn("FLX2", "FLZ2", nx, 1); 
-  gMC->Gsdvn("FLX3", "FLZ3", nx, 1); 
-  // RPC pixel itself 
-  par[0] = -1;//xp/2;
-  par[1] = -1;//yp/2; // 5 %X0 thick of glass  
-  par[2] = -1;//zp/2;
-  gMC->Gsvolu("FPA0", "BOX ", idtmed[514], par, 3);// Glass
-  gMC->Gspos("FPA0", 1, "FLX1", 0., 0., 0., 0, "ONLY");
-  gMC->Gspos("FPA0", 2, "FLX2", 0., 0., 0., 0, "ONLY");
-  gMC->Gspos("FPA0", 3, "FLX3", 0., 0., 0., 0, "ONLY");
-  // Freon gas sencitive volume
+  gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
+  gMC->Gspos("FNSF",0,"FSTR",0.,0.,0.,0,"ONLY");
+  // Mylar for non-sesitive boundaries
+  par[1] = 0.025;
+  gMC->Gsvolu("FMYI","BOX",idtmed[510],par,3); 
+  gMC->Gspos("FMYI",0,"FNSF",0.,0.,0.,0,"ONLY");
+
+  // Mylar for outer layers
+  par[1] = 0.035/2;
+  ycoor = -yPad/2.+par[1];
+  gMC->Gsvolu("FMYX","BOX",idtmed[510],par,3);
+  gMC->Gspos("FMYX",1,"FSTR",0.,ycoor,0.,0,"ONLY");
+  gMC->Gspos("FMYX",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
+  ycoor += par[1];
+  // Graphyte layers
+  par[1] = 0.003/2;
+  ycoor += par[1];
+  gMC->Gsvolu("FGRL","BOX",idtmed[502],par,3);
+  gMC->Gspos("FGRL",1,"FSTR",0.,ycoor,0.,0,"ONLY");
+  gMC->Gspos("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
+
+  // Freon sensitive layer
   par[0] = -1;
-  par[1] = zazor/2;
+  par[1] = 0.110/2.;
+  par[2] = zSenStrip/2.;
+  gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
+  gMC->Gspos("FCFC",0,"FNSF",0.,0.,0.,0,"ONLY");
+  
+  // Pad definition x & z
+  gMC->Gsdvn("FLZ","FCFC", nz, 3); 
+  gMC->Gsdvn("FLX","FLZ" , nx, 1); 
+
+  // MRPC pixel itself 
+  par[0] = -1;
+  par[1] = -1; 
   par[2] = -1;
-  gMC->Gsvolu("FPG0", "BOX ", idtmed[513], par, 3);// Freon 
-  gMC->Gspos("FPG0", 0, "FPA0", 0., 0., 0., 0, "ONLY");
-  //
-////////// Layers after detector ////////////////////
-  // Honeycomb layer after (3cm)
+  gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);
+  gMC->Gspos("FPAD", 0, "FLX", 0., 0., 0., 0, "ONLY");
+
+
+////  Positioning the Strips  (FSTR) in the FLT volumes  /////
+
+  // 3 (Central) Plate 
+  Float_t t = zFLT1+zFLT2+zFLT3/2.+7.*2.5;//Half Width of Barrel
+  Float_t zpos = 0;
+  Float_t ang;
+  Float_t Offset;  
+  Float_t last;
+  nrot = 0;
+  Int_t i=1,j=1;
+  zcoor=0;
+  Int_t UpDown=-1; // UpDown=-1 -> Upper strip, UpDown=+1 -> Lower strip
+  do{
+     ang = atan(zcoor/t);
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     AliMatrix (idrotm[nrot+1], 90., 180., 90.+ang,90.,ang, 0);
+     ycoor = -29./2.+ Space; //2 cm over front plate
+     ycoor += (1-(UpDown+1)/2)*Gap;
+     gMC->Gspos("FSTR",j,"FLT3",0.,ycoor,zcoor,idrotm[nrot],"ONLY");
+     gMC->Gspos("FSTR",j+1,"FLT3",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
+     ang  = ang*3.141592654/180;     
+     zcoor=zcoor-(zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
+     UpDown*= -1; // Alternate strips 
+     i++;
+     j+=2;
+  } while (zcoor-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+zFLT2+7*2.5);
+  
+  ycoor = -29./2.+ Space; //2 cm over front plate
+
+  // Plate  2
+  zpos = -zFLT3/2-7;
+  ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+  Offset = StripWidth*TMath::Cos(ang)/2;
+  zpos -= Offset;
+  nrot = 0;
+  i=1;
+  // UpDown has not to be reinitialized, so that the arrangement of the strips can continue coherently
+
+  do {
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     ycoor = -29./2.+ Space ; //2 cm over front plate
+     ycoor += (1-(UpDown+1)/2)*Gap;
+     zcoor = zpos+(zFLT3/2.+7+zFLT2/2); // Moves to the system of the centre of the modulus FLT2
+     gMC->Gspos("FSTR",i, "FLT2", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+     ang  = ang*3.141592654/180;
+     zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
+     last = StripWidth*TMath::Cos(ang)/2;
+     UpDown*=-1;
+     i++; 
+  } while (zpos-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+7);
+
+  // Plate  1
+  zpos = -t+zFLT1+3.5;
+  ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+  Offset = StripWidth*TMath::Cos(ang)/2.;
+  zpos -= Offset;
+  nrot = 0;
+  i=0;
+  ycoor= -29./2.+Space+Gap/2;
+
+ do {
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     ang = ang*180/3.141592654;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 0.);
+     i++;
+     zcoor = zpos+(zFLT1/2+zFLT2+zFLT3/2+7.*2.);
+     gMC->Gspos("FSTR",i, "FLT1", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+     ang  = ang *3.141592654/180;
+     zpos = zpos - zSenStrip/TMath::Cos(ang);
+     last = StripWidth*TMath::Cos(ang)/2.;
+  }  while (zpos>-t+7.+last);
+
+printf("#######################################################\n");
+printf("     Distance from the bound of the FLT3: zFLT3- %f cm \n", zpos+(zSenStrip/2)/TMath::Cos(ang));
+     ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
+     zpos = zpos - zSenStrip/TMath::Cos(ang);
+printf("NEXT Distance from the bound of the FLT3: zFLT3- %f cm \n", zpos+(zSenStrip/2)/TMath::Cos(ang));
+printf("#######################################################\n");
+
+////////// Layers after detector /////////////////
+
+// Honeycomb layer after (3cm)
+
+  Float_t OverSpace = Space + 7.3;
+///  StripWidth*TMath::Sin(ang) + 1.3;
+
   par[0] = -1;
-  par[1] = 1.2 / 2.;
+  par[1] = 0.6;
   par[2] = -1;
-  ycoor = -ym/2 + 6. - par[1];
+  ycoor = -yFLT/2 + OverSpace + par[1];
   gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  // Electronics (Cu) after
+
+// Electronics (Cu) after
+  ycoor += par[1];
   par[0] = -1;
   par[1] = 1.43*0.05 / 2.; // 5% of X0
   par[2] = -1;
-  ycoor = -ym/2 + 6.+par[1];
+  ycoor += par[1];
   gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
   gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
   gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
   gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
- // Cooling water after
-  ycoor = ycoor+par[1];
+
+// Cooling water after
+  ycoor += par[1];
   par[0] = -1;
   par[1] = 36.1*0.02 / 2.; // 2% of X0
   par[2] = -1;
-  ycoor = ycoor+par[1];
+  ycoor += par[1];
   gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
   gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
   gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
   gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
-  //back plate honycomb (2cm)
+
+//back plate honycomb (2cm)
   par[0] = -1;
   par[1] = 2 / 2.;
   par[2] = -1;
-  ycoor = ym/2 - par[1];
+  ycoor = yFLT/2 - par[1];
   gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
   gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
   gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
@@ -246,7 +409,7 @@ cout<< "nz2 = "<< nz2 << " z2 size = "<< par[2]*2/nz2 << endl;
 void AliTOFv3::DrawModule()
 {
   //
-  // Draw a shaded view of the Time Of Flight version 0
+  // Draw a shaded view of the Time Of Flight version 1
   //
   // Set everything unseen
   gMC->Gsatt("*", "seen", -1);
@@ -269,6 +432,19 @@ void AliTOFv3::DrawModule()
   gMC->Gsatt("FLT1","SEEN",1);
   gMC->Gsatt("FLT2","SEEN",1);
   gMC->Gsatt("FLT3","SEEN",1);
+  gMC->Gsatt("FPL1","SEEN",1);
+  gMC->Gsatt("FPL2","SEEN",1);
+  gMC->Gsatt("FPL3","SEEN",1);
+  gMC->Gsatt("FLD1","SEEN",1);
+  gMC->Gsatt("FLD2","SEEN",1);
+  gMC->Gsatt("FLD3","SEEN",1);
+  gMC->Gsatt("FLZ1","SEEN",1);
+  gMC->Gsatt("FLZ2","SEEN",1);
+  gMC->Gsatt("FLZ3","SEEN",1);
+  gMC->Gsatt("FLX1","SEEN",1);
+  gMC->Gsatt("FLX2","SEEN",1);
+  gMC->Gsatt("FLX3","SEEN",1);
+  gMC->Gsatt("FPA0","SEEN",1);
   //
   gMC->Gdopt("hide", "on");
   gMC->Gdopt("shad", "on");
@@ -354,3 +530,4 @@ void AliTOFv3::StepManager()
     new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
 }
+
index d27dcd6..eef794f 100644 (file)
@@ -30,7 +30,7 @@ public:
   virtual void   CreateMaterials();
   virtual void   Init();
   virtual Int_t  IsVersion() const {return 3;}
-  virtual void   TOFpc(Float_t, Float_t, Float_t, Float_t, Float_t);
+  virtual void   TOFpc(Float_t,Float_t,Float_t,Float_t,Float_t,Float_t);
   virtual void   StepManager();
   virtual void   DrawModule();
  
@@ -38,5 +38,3 @@ public:
 };
  
 #endif
-
-
diff --git a/TOF/AliTOFv4.cxx b/TOF/AliTOFv4.cxx
new file mode 100644 (file)
index 0000000..b7e312a
--- /dev/null
@@ -0,0 +1,432 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.9  1999/09/29 09:24:33  fca
+Introduction of the Copyright and cvs Log
+
+*/
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  Time Of Flight: design of C.Williams                FCA                  //
+//  This class contains the functions for version 1 of the Time Of Flight    //
+//  detector.                                                                //
+//
+//  VERSION WITH 5 MODULES AND FLAT PLATES 
+//  
+//   WITH HOLES FOR PHOS AND HMPID inside the 
+//   SPACE FRAME WITH HOLES
+//
+//   Authors:
+//
+//   Alessio Seganti
+//   Domenico Vicinanza 
+//
+//   University of Salerno - Italy
+//
+//
+//Begin_Html
+/*
+<img src="picts/AliTOFv4Class.gif">
+*/
+//End_Html
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTOFv4.h"
+#include "AliRun.h"
+#include "AliConst.h"
+ClassImp(AliTOFv4)
+//_____________________________________________________________________________
+AliTOFv4::AliTOFv4()
+{
+  //
+  // Default constructor
+  //
+}
+//_____________________________________________________________________________
+AliTOFv4::AliTOFv4(const char *name, const char *title)
+       : AliTOF(name,title)
+{
+  //
+  // Standard constructor
+  //
+}
+//_____________________________________________________________________________
+void AliTOFv4::CreateGeometry()
+{
+  //
+  // Create geometry for Time Of Flight version 0
+  //
+  //Begin_Html
+  /*
+    <img src="picts/AliTOFv4.gif">
+  */
+  //End_Html
+  //
+  // Creates common geometry
+  //
+  AliTOF::CreateGeometry();
+}
+//_____________________________________________________________________________
+void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
+                    Float_t zlen2, Float_t zlen3, Float_t ztof0)
+{
+  //
+  // Definition of the Time Of Fligh Resistive Plate Chambers
+  // xFLT, yFLT, zFLT - sizes of TOF modules (large)
+  
+  Int_t idrotm[100];
+  Float_t  ycoor, zcoor;
+  Float_t par[10];
+  Float_t yFREON, xp, yp, zp;
+  
+  Int_t *idtmed = fIdtmed->GetArray()-499;
+
+  par[0] =  xtof / 2.;
+  par[1] =  ytof / 2.;
+  par[2] = zlen1 / 2.;
+  gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen2 / 2.;
+  gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen3 / 2.;
+  gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
+
+
+// Positioning of modules
+
+   Float_t zcor1 = ztof0 - zlen1/2;
+   Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
+   Float_t zcor3 = 0.;
+
+   AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
+   AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
+   gMC->Gspos("FTO1", 1, "BTO1", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
+   zcoor = (zlen1/2.);
+   gMC->Gspos("FTO1", 1, "BTO2", 0,  zcoor, 0, idrotm[0], "ONLY");
+   zcoor = 0.;
+   gMC->Gspos("FTO1", 1, "BTO3", 0,  zcoor, 0, idrotm[0], "ONLY");
+   
+   gMC->Gspos("FTO2", 1, "BTO1", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
+   zcoor = -zlen2/2.;
+   gMC->Gspos("FTO2", 0, "BTO2", 0,  zcoor, 0, idrotm[0], "ONLY");
+
+   gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3,  0, idrotm[0], "ONLY");
+
+// Subtraction the distance to TOF module boundaries 
+
+  Float_t db = 7.;
+  Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
+
+  xFLT = xtof -(.5 +.5)*2;
+  yFLT = ytof;
+  zFLT1 = zlen1 - db;
+  zFLT2 = zlen2 - db;
+  zFLT3 = zlen3 - db;
+  
+
+  
+// freon gaps in MRPC chamber 
+  yFREON = .11; //cm
+
+// Sizes of MRPC pads
+
+  xp = 3.0; 
+  yp = 12.3*0.05; // 5% X0 of glass 
+  zp = 3.0;
+
+//  Subtraction of dead boundaries in X=2 cm and Z=7/2 cm 
+
+cout <<"************************* TOF geometry **************************"<<endl;
+
+  Int_t nz1, nz2, nz3, nx; //- numbers of pixels
+  nx = Int_t (xFLT/xp);
+
+  printf("Number of pixel along x axis = %i",nx);
+
+  par[0] = xFLT/2;
+  par[1] = yFLT/2;
+  par[2] = (zFLT1 / 2.);
+  nz1 = Int_t (par[2]*2/zp);
+  gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
+  printf("Number of pixel along z axis (module 1) = %i",nz1);
+
+  par[2] = (zFLT2 / 2.);
+  nz2 = Int_t (par[2]*2/zp);
+  gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
+  printf("Number of pixel along z axis (module 2) = %i",nz2);
+
+  par[2] = (zFLT3 / 2.); 
+  nz3 = Int_t (par[2]*2/zp);
+  gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
+  printf("Number of pixel along z axis (module 3) = %i",nz3);
+
+////////// Layers before detector ////////////////////
+
+// Alluminium layer in front 1.0 mm thick at the beginning
+  par[0] = -1;
+  par[1] = 0.1;
+  par[2] = -1;
+  ycoor = -yFLT/2 + par[1];
+  gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
+  gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
+  gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium 
+  gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Honeycomb layer (1cm of special polyethilene)
+  ycoor = ycoor + par[1];
+  par[0] = -1;
+  par[1] = 0.5;
+  par[2] = -1;
+  ycoor = ycoor + par[1];
+  gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPL2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+///////////////// Detector itself //////////////////////
+
+  const Float_t SpaceBefore=2.; // Space Beetween detector &  Front Panel
+
+  par[0] = -1;
+  par[1] = yp/2; // 5 %X0 thick of glass  
+  par[2] = -1;
+  ycoor = -yFLT/2 + SpaceBefore;
+  gMC->Gsvolu("FLD1", "BOX ", idtmed[514], par, 3); // Glass
+  gMC->Gspos("FLD1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FLD2", "BOX ", idtmed[514], par, 3); // Glass
+  gMC->Gspos("FLD2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FLD3", "BOX ", idtmed[514], par, 3); // Glass
+  gMC->Gspos("FLD3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+  gMC->Gsdvn("FLZ1", "FLD1", nz1, 3); //pixel size xp=zp=3
+  gMC->Gsdvn("FLZ2", "FLD2", nz2, 3); 
+  gMC->Gsdvn("FLZ3", "FLD3", nz3, 3); 
+  gMC->Gsdvn("FLX1", "FLZ1", nx, 1);
+  gMC->Gsdvn("FLX2", "FLZ2", nx, 1); 
+  gMC->Gsdvn("FLX3", "FLZ3", nx, 1); 
+
+// MRPC pixel itself 
+  par[0] = -1;//xp/2;
+  par[1] = -1;//yp/2; // 5 %X0 thick of glass  
+  par[2] = -1;//zp/2;
+  gMC->Gsvolu("FPA0", "BOX ", idtmed[514], par, 3);// Glass
+  gMC->Gspos("FPA0", 1, "FLX1", 0., 0., 0., 0, "ONLY");
+  gMC->Gspos("FPA0", 2, "FLX2", 0., 0., 0., 0, "ONLY");
+  gMC->Gspos("FPA0", 3, "FLX3", 0., 0., 0., 0, "ONLY");
+
+// Freon gas sencitive vol.ume
+  par[0] = -1;
+  par[1] = yFREON/2;
+  par[2] = -1;
+  gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);// Freon 
+  gMC->Gspos("FPAD", 0, "FPA0", 0., 0., 0., 0, "ONLY");
+
+////////// Layers after detector ////////////////////
+
+  const Float_t SpaceAfter = 6.; //Space beetween detector & Back Panel
+  
+// Honeycomb layer after (3cm)
+  par[0] = -1;
+  par[1] = 0.6;
+  par[2] = -1;
+  ycoor = -yFLT/2 + SpaceAfter - par[1];
+  gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Electronics (Cu) after
+  par[0] = -1;
+  par[1] = 1.43*0.05 / 2.; // 5% of X0
+  par[2] = -1;
+  ycoor = -yFLT/2 + SpaceAfter +par[1];
+  gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
+  gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
+  gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
+  gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Cooling water after
+  ycoor = ycoor+par[1];
+  par[0] = -1;
+  par[1] = 36.1*0.02 / 2.; // 2% of X0
+  par[2] = -1;
+  ycoor = ycoor+par[1];
+  gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+//back plate honycomb (2cm)
+  par[0] = -1;
+  par[1] = 1.;
+  par[2] = -1;
+  ycoor = yFLT/2 - par[1];
+  gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEG3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+}
+
+//_____________________________________________________________________________
+void AliTOFv4::DrawModule()
+{
+  //
+  // Draw a shaded view of the Time Of Flight version 1
+  //
+  // Set everything unseen
+  gMC->Gsatt("*", "seen", -1);
+  // 
+  // Set ALIC mother transparent
+  gMC->Gsatt("ALIC","SEEN",0);
+  //
+  // Set the volumes visible
+  gMC->Gsatt("ALIC","SEEN",0);
+  gMC->Gsatt("FBAR","SEEN",1);
+  gMC->Gsatt("FTO1","SEEN",1);
+  gMC->Gsatt("FTO2","SEEN",1);
+  gMC->Gsatt("FTO3","SEEN",1);
+  gMC->Gsatt("FBT1","SEEN",1);
+  gMC->Gsatt("FBT2","SEEN",1);
+  gMC->Gsatt("FBT3","SEEN",1);
+  gMC->Gsatt("FDT1","SEEN",1);
+  gMC->Gsatt("FDT2","SEEN",1);
+  gMC->Gsatt("FDT3","SEEN",1);
+  gMC->Gsatt("FLT1","SEEN",1);
+  gMC->Gsatt("FLT2","SEEN",1);
+  gMC->Gsatt("FLT3","SEEN",1);
+  gMC->Gsatt("FPL1","SEEN",1);
+  gMC->Gsatt("FPL2","SEEN",1);
+  gMC->Gsatt("FPL3","SEEN",1);
+  gMC->Gsatt("FLD1","SEEN",1);
+  gMC->Gsatt("FLD2","SEEN",1);
+  gMC->Gsatt("FLD3","SEEN",1);
+  gMC->Gsatt("FLZ1","SEEN",1);
+  gMC->Gsatt("FLZ2","SEEN",1);
+  gMC->Gsatt("FLZ3","SEEN",1);
+  gMC->Gsatt("FLX1","SEEN",1);
+  gMC->Gsatt("FLX2","SEEN",1);
+  gMC->Gsatt("FLX3","SEEN",1);
+  gMC->Gsatt("FPA0","SEEN",1);
+  //
+  gMC->Gdopt("hide", "on");
+  gMC->Gdopt("shad", "on");
+  gMC->Gsatt("*", "fill", 7);
+  gMC->SetClipBox(".");
+  gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
+  gMC->DefaultRange();
+  gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
+  gMC->Gdhead(1111, "Time Of Flight");
+  gMC->Gdman(18, 4, "MAN");
+  gMC->Gdopt("hide","off");
+}
+
+//_____________________________________________________________________________
+void AliTOFv4::CreateMaterials()
+{
+  //
+  // Define materials for the Time Of Flight
+  //
+  AliTOF::CreateMaterials();
+}
+//_____________________________________________________________________________
+void AliTOFv4::Init()
+{
+  //
+  // Initialise the detector after the geometry has been defined
+  //
+  AliTOF::Init();
+  fIdFTO2=gMC->VolId("FTO2");
+  fIdFTO3=gMC->VolId("FTO3");
+  fIdFLT1=gMC->VolId("FLT1");
+  fIdFLT2=gMC->VolId("FLT2");
+  fIdFLT3=gMC->VolId("FLT3");
+}
+//_____________________________________________________________________________
+void AliTOFv4::StepManager()
+{
+  //
+  // Procedure called at each step in the Time Of Flight
+  //
+  TLorentzVector mom, pos;
+  Float_t hits[8];
+  Int_t vol[3];
+  Int_t copy, id, i;
+  Int_t *idtmed = fIdtmed->GetArray()-499;
+  if(gMC->GetMedium()==idtmed[514-1] && 
+     gMC->IsTrackEntering() && gMC->TrackCharge()
+     && gMC->CurrentVolID(copy)==fIdSens) {
+    TClonesArray &lhits = *fHits;
+    //
+    // Record only charged tracks at entrance
+    gMC->CurrentVolOffID(1,copy);
+    vol[2]=copy;
+    gMC->CurrentVolOffID(3,copy);
+    vol[1]=copy;
+    id=gMC->CurrentVolOffID(8,copy);
+    vol[0]=copy;
+    if(id==fIdFTO3) {
+      vol[0]+=22;
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT3) vol[1]+=6;
+    } else if (id==fIdFTO2) {
+      vol[0]+=20;
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT2) vol[1]+=8;
+    } else {
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT1) vol[1]+=14;
+    }
+    gMC->TrackPosition(pos);
+    gMC->TrackMomentum(mom);
+    //
+    Double_t ptot=mom.Rho();
+    Double_t norm=1/ptot;
+    for(i=0;i<3;++i) {
+      hits[i]=pos[i];
+      hits[i+3]=mom[i]*norm;
+    }
+    hits[6]=ptot;
+    hits[7]=pos[3];
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+  }
+}
+
diff --git a/TOF/AliTOFv4.h b/TOF/AliTOFv4.h
new file mode 100644 (file)
index 0000000..4491955
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef TOFv4_H
+#define TOFv4_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////
+//  Manager and hits classes for set:TOF  version 4  //
+///////////////////////////////////////////////////////
+#include "AliTOF.h"
+#include "AliHit.h"
+class AliTOFv4 : public AliTOF {
+
+private:
+  Int_t fIdFTO2; // First sensitive volume identifier
+  Int_t fIdFTO3; // Second sensitive volume identifier
+  Int_t fIdFLT1; // Third sensitive volume identifier
+  Int_t fIdFLT2; // Fourth sensitive volume identifier
+  Int_t fIdFLT3; // Fifth sensitive volume identifier
+public:
+  AliTOFv4();
+  AliTOFv4(const char *name, const char *title);
+  virtual       ~AliTOFv4() {}
+  virtual void   CreateGeometry();
+  virtual void   CreateMaterials();
+  virtual void   Init();
+  virtual Int_t  IsVersion() const {return 4;}
+  virtual void   TOFpc(Float_t,Float_t,Float_t,Float_t,Float_t,Float_t);
+  virtual void   StepManager();
+  virtual void   DrawModule();
+   ClassDef(AliTOFv4,1)  //Time Of Flight version 4
+};
+#endif
diff --git a/TOF/AliTOFv5.cxx b/TOF/AliTOFv5.cxx
new file mode 100644 (file)
index 0000000..f383206
--- /dev/null
@@ -0,0 +1,433 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.9  1999/09/29 09:24:33  fca
+Introduction of the Copyright and cvs Log
+
+*/
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  Time Of Flight: design of C.Williams                FCA                  //
+//  This class contains the functions for version 1 of the Time Of Flight    //
+//  detector.                                                                //
+//
+//  VERSION WITH 5 MODULES AND FLAT PLATES 
+//  
+//   WITH HOLES FOR PHOS AND HMPID 
+//   INSIDE A FULL COVERAGE SPACE FRAME
+//
+//
+//   Authors:
+//
+//   Alessio Seganti
+//   Domenico Vicinanza
+//
+//   University of Salerno - Italy
+//
+//
+//Begin_Html
+/*
+<img src="picts/AliTOFv5Class.gif">
+*/
+//End_Html
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTOFv5.h"
+#include "AliRun.h"
+#include "AliConst.h"
+ClassImp(AliTOFv5)
+//_____________________________________________________________________________
+AliTOFv5::AliTOFv5()
+{
+  //
+  // Default constructor
+  //
+}
+//_____________________________________________________________________________
+AliTOFv5::AliTOFv5(const char *name, const char *title)
+       : AliTOF(name,title)
+{
+  //
+  // Standard constructor
+  //
+}
+//_____________________________________________________________________________
+void AliTOFv5::CreateGeometry()
+{
+  //
+  // Create geometry for Time Of Flight version 0
+  //
+  //Begin_Html
+  /*
+    <img src="picts/AliTOFv5.gif">
+  */
+  //End_Html
+  //
+  // Creates common geometry
+  //
+  AliTOF::CreateGeometry();
+}
+//_____________________________________________________________________________
+void AliTOFv5::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
+                    Float_t zlen2, Float_t zlen3, Float_t ztof0)
+{
+  //
+  // Definition of the Time Of Fligh Resistive Plate Chambers
+  // xFLT, yFLT, zFLT - sizes of TOF modules (large)
+  
+  Float_t  ycoor;
+  Float_t par[10];
+  Int_t idrotm[100];
+  
+  Float_t yFREON, xp, yp, zp;
+  
+  Int_t *idtmed = fIdtmed->GetArray()-499;
+
+
+  par[0] =  xtof / 2.;
+  par[1] =  ytof / 2.;
+  par[2] = zlen1 / 2.;
+  gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen2 / 2.;
+  gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen3 / 2.;
+  gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
+
+
+// Position of modules
+  Float_t zcor1 = ztof0 - zlen1/2;
+  Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
+  Float_t zcor3 = 0.;
+
+   AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
+   AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
+   gMC->Gspos("FTO1", 1, "BTO1", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO1", 1, "BTO2", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO1", 1, "BTO3", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
+
+   gMC->Gspos("FTO2", 1, "BTO1", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO2", 1, "BTO2", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
+
+   gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3,  0, idrotm[0], "ONLY");
+
+// Subtraction the distance to TOF module boundaries 
+
+  Float_t db = 7.;
+  Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
+
+
+  xFLT = xtof -(.5 +.5)*2;
+  yFLT = ytof;
+  zFLT1 = zlen1 - db;
+  zFLT2 = zlen2 - db;
+  zFLT3 = zlen3 - db;
+
+  
+// fron gaps in MRPC chamber 
+  yFREON = .11; //cm
+
+// Sizes of MRPC pads
+
+  xp = 3.0; 
+  yp = 12.3*0.05; // 5% X0 of glass 
+  zp = 3.0;
+
+//  Subtraction of dead boundaries in X=2 cm and Z=7/2 cm 
+
+cout <<"************************* TOF geometry **************************"<<endl;
+
+  Int_t nz1, nz2, nz3, nx; //- numbers of pixels
+  nx = Int_t (xFLT/xp);
+
+  printf("Number of pixel along x axis = %i",nx);
+
+  par[0] = xFLT/2;
+  par[1] = yFLT/2;
+  par[2] = (zFLT1 / 2.);
+  nz1 = Int_t (par[2]*2/zp);
+  gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
+  printf("Number of pixel along z axis (module 1) = %i",nz1);
+
+  par[2] = (zFLT2 / 2.);
+  nz2 = Int_t (par[2]*2/zp);
+  gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
+  printf("Number of pixel along z axis (module 2) = %i",nz2);
+
+  par[2] = (zFLT3 / 2.); 
+  nz3 = Int_t (par[2]*2/zp);
+  gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
+  printf("Number of pixel along z axis (module 3) = %i",nz3);
+
+////////// Layers before detector ////////////////////
+
+// Alluminium layer in front 1.0 mm thick at the beginning
+  par[0] = -1;
+  par[1] = 0.1;
+  par[2] = -1;
+  ycoor = -yFLT/2 + par[1];
+  gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
+  gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
+  gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium 
+  gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Honeycomb layer (1cm of special polyethilene)
+  ycoor = ycoor + par[1];
+  par[0] = -1;
+  par[1] = 1. / 2;
+  par[2] = -1;
+  ycoor = ycoor + par[1];
+  gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPL2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+///////////////// Detector itself //////////////////////
+
+  const Float_t SpaceBefore=2.;
+
+  par[0] = -1;
+  par[1] = yp/2; // 5 %X0 thick of glass  
+  par[2] = -1;
+  ycoor = -yFLT/2 + SpaceBefore;
+  gMC->Gsvolu("FLD1", "BOX ", idtmed[514], par, 3); // Glass
+  gMC->Gspos("FLD1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FLD2", "BOX ", idtmed[514], par, 3); // Glass
+  gMC->Gspos("FLD2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FLD3", "BOX ", idtmed[514], par, 3); // Glass
+  gMC->Gspos("FLD3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+  gMC->Gsdvn("FLZ1", "FLD1", nz1, 3); //pixel size xp=zp=3
+  gMC->Gsdvn("FLZ2", "FLD2", nz2, 3); 
+  gMC->Gsdvn("FLZ3", "FLD3", nz3, 3); 
+  gMC->Gsdvn("FLX1", "FLZ1", nx, 1);
+  gMC->Gsdvn("FLX2", "FLZ2", nx, 1); 
+  gMC->Gsdvn("FLX3", "FLZ3", nx, 1); 
+
+// MRPC pixel itself 
+  par[0] = -1;//xp/2;
+  par[1] = -1;//yp/2; // 5 %X0 thick of glass  
+  par[2] = -1;//zp/2;
+  gMC->Gsvolu("FPA0", "BOX ", idtmed[514], par, 3);// Glass
+  gMC->Gspos("FPA0", 1, "FLX1", 0., 0., 0., 0, "ONLY");
+  gMC->Gspos("FPA0", 2, "FLX2", 0., 0., 0., 0, "ONLY");
+  gMC->Gspos("FPA0", 3, "FLX3", 0., 0., 0., 0, "ONLY");
+
+// Freon gas sencitive vol.ume
+  par[0] = -1;
+  par[1] = yFREON/2;
+  par[2] = -1;
+  gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);// Freon 
+  gMC->Gspos("FPAD", 0, "FPA0", 0., 0., 0., 0, "ONLY");
+
+////////// Layers after detector ////////////////////
+
+  const Float_t SpaceAfter=6.;
+
+// Honeycomb layer after (3cm)
+  par[0] = -1;
+  par[1] = 0.6;
+  par[2] = -1;
+  ycoor = -yFLT/2 + SpaceAfter - par[1];
+  gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Electronics (Cu) after
+  par[0] = -1;
+  par[1] = 1.43*0.05 / 2.; // 5% of X0
+  par[2] = -1;
+  ycoor = -yFLT/2 + SpaceAfter +par[1];
+  gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
+  gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
+  gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
+  gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Cooling water after
+  ycoor = ycoor+par[1];
+  par[0] = -1;
+  par[1] = 36.1*0.02 / 2.; // 2% of X0
+  par[2] = -1;
+  ycoor = ycoor+par[1];
+  gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+//back plate honycomb (2cm)
+  par[0] = -1;
+  par[1] = 2 / 2.;
+  par[2] = -1;
+  ycoor = yFLT/2 - par[1];
+  gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEG3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");}
+
+//_____________________________________________________________________________
+void AliTOFv5::DrawModule()
+{
+  //
+  // Draw a shaded view of the Time Of Flight version 1
+  //
+  // Set everything unseen
+  gMC->Gsatt("*", "seen", -1);
+  // 
+  // Set ALIC mother transparent
+  gMC->Gsatt("ALIC","SEEN",0);
+  //
+  // Set the volumes visible
+  gMC->Gsatt("ALIC","SEEN",0);
+  gMC->Gsatt("FBAR","SEEN",1);
+  gMC->Gsatt("FTO1","SEEN",1);
+  gMC->Gsatt("FTO2","SEEN",1);
+  gMC->Gsatt("FTO3","SEEN",1);
+  gMC->Gsatt("FBT1","SEEN",1);
+  gMC->Gsatt("FBT2","SEEN",1);
+  gMC->Gsatt("FBT3","SEEN",1);
+  gMC->Gsatt("FDT1","SEEN",1);
+  gMC->Gsatt("FDT2","SEEN",1);
+  gMC->Gsatt("FDT3","SEEN",1);
+  gMC->Gsatt("FLT1","SEEN",1);
+  gMC->Gsatt("FLT2","SEEN",1);
+  gMC->Gsatt("FLT3","SEEN",1);
+  gMC->Gsatt("FPL1","SEEN",1);
+  gMC->Gsatt("FPL2","SEEN",1);
+  gMC->Gsatt("FPL3","SEEN",1);
+  gMC->Gsatt("FLD1","SEEN",1);
+  gMC->Gsatt("FLD2","SEEN",1);
+  gMC->Gsatt("FLD3","SEEN",1);
+  gMC->Gsatt("FLZ1","SEEN",1);
+  gMC->Gsatt("FLZ2","SEEN",1);
+  gMC->Gsatt("FLZ3","SEEN",1);
+  gMC->Gsatt("FLX1","SEEN",1);
+  gMC->Gsatt("FLX2","SEEN",1);
+  gMC->Gsatt("FLX3","SEEN",1);
+  gMC->Gsatt("FPA0","SEEN",1);
+  //
+  gMC->Gdopt("hide", "on");
+  gMC->Gdopt("shad", "on");
+  gMC->Gsatt("*", "fill", 7);
+  gMC->SetClipBox(".");
+  gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
+  gMC->DefaultRange();
+  gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
+  gMC->Gdhead(1111, "Time Of Flight");
+  gMC->Gdman(18, 4, "MAN");
+  gMC->Gdopt("hide","off");
+}
+
+//_____________________________________________________________________________
+void AliTOFv5::CreateMaterials()
+{
+  //
+  // Define materials for the Time Of Flight
+  //
+  AliTOF::CreateMaterials();
+}
+//_____________________________________________________________________________
+void AliTOFv5::Init()
+{
+  //
+  // Initialise the detector after the geometry has been defined
+  //
+  AliTOF::Init();
+  fIdFTO2=gMC->VolId("FTO2");
+  fIdFTO3=gMC->VolId("FTO3");
+  fIdFLT1=gMC->VolId("FLT1");
+  fIdFLT2=gMC->VolId("FLT2");
+  fIdFLT3=gMC->VolId("FLT3");
+}
+//_____________________________________________________________________________
+void AliTOFv5::StepManager()
+{
+  //
+  // Procedure called at each step in the Time Of Flight
+  //
+  TLorentzVector mom, pos;
+  Float_t hits[8];
+  Int_t vol[3];
+  Int_t copy, id, i;
+  Int_t *idtmed = fIdtmed->GetArray()-499;
+  if(gMC->GetMedium()==idtmed[514-1] && 
+     gMC->IsTrackEntering() && gMC->TrackCharge()
+     && gMC->CurrentVolID(copy)==fIdSens) {
+    TClonesArray &lhits = *fHits;
+    //
+    // Record only charged tracks at entrance
+    gMC->CurrentVolOffID(1,copy);
+    vol[2]=copy;
+    gMC->CurrentVolOffID(3,copy);
+    vol[1]=copy;
+    id=gMC->CurrentVolOffID(8,copy);
+    vol[0]=copy;
+    if(id==fIdFTO3) {
+      vol[0]+=22;
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT3) vol[1]+=6;
+    } else if (id==fIdFTO2) {
+      vol[0]+=20;
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT2) vol[1]+=8;
+    } else {
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT1) vol[1]+=14;
+    }
+    gMC->TrackPosition(pos);
+    gMC->TrackMomentum(mom);
+    //
+    Double_t ptot=mom.Rho();
+    Double_t norm=1/ptot;
+    for(i=0;i<3;++i) {
+      hits[i]=pos[i];
+      hits[i+3]=mom[i]*norm;
+    }
+    hits[6]=ptot;
+    hits[7]=pos[3];
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+  }
+}
+
diff --git a/TOF/AliTOFv5.h b/TOF/AliTOFv5.h
new file mode 100644 (file)
index 0000000..06ac884
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef TOFv5_H
+#define TOFv5_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////
+//  Manager and hits classes for set:TOF  version 5  //
+///////////////////////////////////////////////////////
+#include "AliTOF.h"
+#include "AliHit.h"
+class AliTOFv5 : public AliTOF {
+
+private:
+  Int_t fIdFTO2; // First sensitive volume identifier
+  Int_t fIdFTO3; // Second sensitive volume identifier
+  Int_t fIdFLT1; // Third sensitive volume identifier
+  Int_t fIdFLT2; // Fourth sensitive volume identifier
+  Int_t fIdFLT3; // Fifth sensitive volume identifier
+public:
+  AliTOFv5();
+  AliTOFv5(const char *name, const char *title);
+  virtual       ~AliTOFv5() {}
+  virtual void   CreateGeometry();
+  virtual void   CreateMaterials();
+  virtual void   Init();
+  virtual Int_t  IsVersion() const {return 5;}
+  virtual void   TOFpc(Float_t,Float_t,Float_t,Float_t,Float_t,Float_t);
+  virtual void   StepManager();
+  virtual void   DrawModule();
+   ClassDef(AliTOFv5,1)  //Time Of Flight version 1
+};
+#endif
diff --git a/TOF/AliTOFv6.cxx b/TOF/AliTOFv6.cxx
new file mode 100644 (file)
index 0000000..578a518
--- /dev/null
@@ -0,0 +1,441 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.9  1999/09/29 09:24:33  fca
+Introduction of the Copyright and cvs Log
+
+*/
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  Time Of Flight: design of C.Williams                                //
+//  This class contains the functions for version 1 of the Time Of Flight    //
+//  detector.                                                                //
+//
+//  VERSION WITH 5 MODULES AND FLAT PLATES
+//  
+//   WITH HOLES FOR PHOS AND HMPID 
+//   INSIDE THE FULL COVERAGE SPACE FRAME
+//
+//
+//   Authors:
+//
+//   Alessio Seganti
+//   Domenico Vicinanza
+//
+//   University of Salerno - Italy
+//
+//Begin_Html
+/*
+<img src="picts/AliTOFv6Class.gif">
+*/
+//End_Html
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTOFv6.h"
+#include "AliRun.h"
+#include "AliConst.h"
+ClassImp(AliTOFv6)
+//_____________________________________________________________________________
+AliTOFv6::AliTOFv6()
+{
+  //
+  // Default constructor
+  //
+}
+//_____________________________________________________________________________
+AliTOFv6::AliTOFv6(const char *name, const char *title)
+       : AliTOF(name,title)
+{
+  //
+  // Standard constructor
+  //
+}
+//_____________________________________________________________________________
+void AliTOFv6::CreateGeometry()
+{
+  //
+  // Create geometry for Time Of Flight version 0
+  //
+  //Begin_Html
+  /*
+    <img src="picts/AliTOFv6.gif">
+  */
+  //End_Html
+  //
+  // Creates common geometry
+  //
+  AliTOF::CreateGeometry();
+}
+//_____________________________________________________________________________
+void AliTOFv6::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
+                    Float_t zlen2, Float_t zlen3, Float_t ztof0)
+{
+  //
+  // Definition of the Time Of Fligh Resistive Plate Chambers
+  // xFLT, yFLT, zFLT - sizes of TOF modules (large)
+  
+  Float_t ycoor;
+  Float_t par[10];
+  Int_t idrotm[100];
+
+  Int_t *idtmed = fIdtmed->GetArray()-499;
+  
+
+  par[0] =  xtof / 2.;
+  par[1] =  ytof / 2.;
+  par[2] = zlen1 / 2.;
+  gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen2 / 2.;
+  gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
+  par[2] = zlen3 / 2.;
+  gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
+
+
+// Positioning of modules
+
+   Float_t zcor1 = ztof0 - zlen1/2;
+   Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
+   Float_t zcor3 = 0.;
+
+   AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
+   AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
+   gMC->Gspos("FTO1", 1, "BTO1", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO1", 1, "BTO2", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO1", 1, "BTO3", 0,  zcor1, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO1", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
+
+   gMC->Gspos("FTO2", 1, "BTO1", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO2", 1, "BTO2", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
+   gMC->Gspos("FTO2", 1, "BTO3", 0,  zcor2, 0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO2", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
+
+   gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3,  0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO3", 0, "BTO2", 0, zcor3,  0, idrotm[0], "ONLY");
+   gMC->Gspos("FTO3", 0, "BTO3", 0, zcor3,  0, idrotm[0], "ONLY");
+
+// Subtraction the distance to TOF module boundaries 
+
+  Float_t db = 7.;
+  Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
+
+  xFLT = xtof -(.5 +.5)*2;
+  yFLT = ytof;
+  zFLT1 = zlen1 - db;
+  zFLT2 = zlen2 - db;
+  zFLT3 = zlen3 - db;
+
+  // Definition of the Time Of Fligh Resistive Plate Chambers
+  // xFLT, yFLT, zFLT - sizes of TOF modules (large)
+  
+  Float_t yFREON, xp, yp, zp;
+  
+// fron gaps in MRPC chamber 
+  yFREON = .11; //cm
+
+// Sizes of MRPC pads
+
+  xp = 3.0; 
+  yp = 12.3*0.05; // 5% X0 of glass 
+  zp = 3.0;
+
+//  Subtraction of dead boundaries in X=2 cm and Z=7/2 cm 
+
+cout <<"************************* TOF geometry **************************"<<endl;
+
+  Int_t nz1, nz2, nz3, nx; //- numbers of pixels
+  nx = Int_t (xFLT/xp);
+
+  printf("Number of pixel along x axis = %i",nx);
+
+  par[0] = xFLT/2;
+  par[1] = yFLT/2;
+  par[2] = (zFLT1 / 2.);
+  nz1 = Int_t (par[2]*2/zp);
+  gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
+  printf("Number of pixel along z axis (module 1) = %i",nz1);
+
+  par[2] = (zFLT2 / 2.);
+  nz2 = Int_t (par[2]*2/zp);
+  gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
+  printf("Number of pixel along z axis (module 2) = %i",nz2);
+
+  par[2] = (zFLT3 / 2.); 
+  nz3 = Int_t (par[2]*2/zp);
+  gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
+  gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
+  printf("Number of pixel along z axis (module 3) = %i",nz3);
+
+////////// Layers before detector ////////////////////
+
+// Alluminium layer in front 1.0 mm thick at the beginning
+  par[0] = -1;
+  par[1] = 0.1;
+  par[2] = -1;
+  ycoor = -yFLT/2 + par[1];
+  gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
+  gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
+  gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium 
+  gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Honeycomb layer (1cm of special polyethilene)
+  ycoor = ycoor + par[1];
+  par[0] = -1;
+  par[1] = 0.5;
+  par[2] = -1;
+  ycoor = ycoor + par[1];
+  gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPL2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+///////////////// Detector itself //////////////////////
+
+  const Float_t SpaceBefore = 2.;
+
+  par[0] = -1;
+  par[1] = yp/2; // 5 %X0 thick of glass  
+  par[2] = -1;
+  ycoor = -yFLT/2 + SpaceBefore;
+  gMC->Gsvolu("FLD1", "BOX ", idtmed[514], par, 3); // Glass
+  gMC->Gspos("FLD1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FLD2", "BOX ", idtmed[514], par, 3); // Glass
+  gMC->Gspos("FLD2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FLD3", "BOX ", idtmed[514], par, 3); // Glass
+  gMC->Gspos("FLD3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+  gMC->Gsdvn("FLZ1", "FLD1", nz1, 3); //pixel size xp=zp=3
+  gMC->Gsdvn("FLZ2", "FLD2", nz2, 3); 
+  gMC->Gsdvn("FLZ3", "FLD3", nz3, 3); 
+  gMC->Gsdvn("FLX1", "FLZ1", nx, 1);
+  gMC->Gsdvn("FLX2", "FLZ2", nx, 1); 
+  gMC->Gsdvn("FLX3", "FLZ3", nx, 1); 
+
+// MRPC pixel itself 
+  par[0] = -1;//xp/2;
+  par[1] = -1;//yp/2; // 5 %X0 thick of glass  
+  par[2] = -1;//zp/2;
+  gMC->Gsvolu("FPA0", "BOX ", idtmed[514], par, 3);// Glass
+  gMC->Gspos("FPA0", 1, "FLX1", 0., 0., 0., 0, "ONLY");
+  gMC->Gspos("FPA0", 2, "FLX2", 0., 0., 0., 0, "ONLY");
+  gMC->Gspos("FPA0", 3, "FLX3", 0., 0., 0., 0, "ONLY");
+
+// Freon gas sencitive vol.ume
+  par[0] = -1;
+  par[1] = yFREON/2;
+  par[2] = -1;
+  gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);// Freon 
+  gMC->Gspos("FPAD", 0, "FPA0", 0., 0., 0., 0, "ONLY");
+
+////////// Layers after detector ////////////////////
+
+  const Float_t SpaceAfter=6.;
+
+// Honeycomb layer after (3cm)
+  par[0] = -1;
+  par[1] = 0.6;
+  par[2] = -1;
+  ycoor = -yFLT/2 + SpaceAfter - par[1];
+  gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Electronics (Cu) after
+  par[0] = -1;
+  par[1] = 1.43*0.05 / 2.; // 5% of X0
+  par[2] = -1;
+  ycoor = -yFLT/2 + SpaceAfter +par[1];
+  gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
+  gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
+  gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
+  gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+// Cooling water after
+  ycoor = ycoor+par[1];
+  par[0] = -1;
+  par[1] = 36.1*0.02 / 2.; // 2% of X0
+  par[2] = -1;
+  ycoor = ycoor+par[1];
+  gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
+  gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+//back plate honycomb (2cm)
+  par[0] = -1;
+  par[1] = 2 / 2.;
+  par[2] = -1;
+  ycoor = yFLT/2 - par[1];
+  gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
+  gMC->Gsvolu("FEG3", "BOX ", idtmed[503], par, 3); // Hony
+  gMC->Gspos("FEG3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
+
+
+}
+
+//_____________________________________________________________________________
+void AliTOFv6::DrawModule()
+{
+  //
+  // Draw a shaded view of the Time Of Flight version 1
+  //
+  // Set everything unseen
+  gMC->Gsatt("*", "seen", -1);
+  // 
+  // Set ALIC mother transparent
+  gMC->Gsatt("ALIC","SEEN",0);
+  //
+  // Set the volumes visible
+  gMC->Gsatt("ALIC","SEEN",0);
+  gMC->Gsatt("FBAR","SEEN",1);
+  gMC->Gsatt("FTO1","SEEN",1);
+  gMC->Gsatt("FTO2","SEEN",1);
+  gMC->Gsatt("FTO3","SEEN",1);
+  gMC->Gsatt("FBT1","SEEN",1);
+  gMC->Gsatt("FBT2","SEEN",1);
+  gMC->Gsatt("FBT3","SEEN",1);
+  gMC->Gsatt("FDT1","SEEN",1);
+  gMC->Gsatt("FDT2","SEEN",1);
+  gMC->Gsatt("FDT3","SEEN",1);
+  gMC->Gsatt("FLT1","SEEN",1);
+  gMC->Gsatt("FLT2","SEEN",1);
+  gMC->Gsatt("FLT3","SEEN",1);
+  gMC->Gsatt("FPL1","SEEN",1);
+  gMC->Gsatt("FPL2","SEEN",1);
+  gMC->Gsatt("FPL3","SEEN",1);
+  gMC->Gsatt("FLD1","SEEN",1);
+  gMC->Gsatt("FLD2","SEEN",1);
+  gMC->Gsatt("FLD3","SEEN",1);
+  gMC->Gsatt("FLZ1","SEEN",1);
+  gMC->Gsatt("FLZ2","SEEN",1);
+  gMC->Gsatt("FLZ3","SEEN",1);
+  gMC->Gsatt("FLX1","SEEN",1);
+  gMC->Gsatt("FLX2","SEEN",1);
+  gMC->Gsatt("FLX3","SEEN",1);
+  gMC->Gsatt("FPA0","SEEN",1);
+  //
+  gMC->Gdopt("hide", "on");
+  gMC->Gdopt("shad", "on");
+  gMC->Gsatt("*", "fill", 7);
+  gMC->SetClipBox(".");
+  gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
+  gMC->DefaultRange();
+  gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
+  gMC->Gdhead(1111, "Time Of Flight");
+  gMC->Gdman(18, 4, "MAN");
+  gMC->Gdopt("hide","off");
+}
+
+//_____________________________________________________________________________
+void AliTOFv6::CreateMaterials()
+{
+  //
+  // Define materials for the Time Of Flight
+  //
+  AliTOF::CreateMaterials();
+}
+//_____________________________________________________________________________
+void AliTOFv6::Init()
+{
+  //
+  // Initialise the detector after the geometry has been defined
+  //
+  AliTOF::Init();
+  fIdFTO2=gMC->VolId("FTO2");
+  fIdFTO3=gMC->VolId("FTO3");
+  fIdFLT1=gMC->VolId("FLT1");
+  fIdFLT2=gMC->VolId("FLT2");
+  fIdFLT3=gMC->VolId("FLT3");
+}
+//_____________________________________________________________________________
+void AliTOFv6::StepManager()
+{
+  //
+  // Procedure called at each step in the Time Of Flight
+  //
+  TLorentzVector mom, pos;
+  Float_t hits[8];
+  Int_t vol[3];
+  Int_t copy, id, i;
+  Int_t *idtmed = fIdtmed->GetArray()-499;
+  if(gMC->GetMedium()==idtmed[514-1] && 
+     gMC->IsTrackEntering() && gMC->TrackCharge()
+     && gMC->CurrentVolID(copy)==fIdSens) {
+    TClonesArray &lhits = *fHits;
+    //
+    // Record only charged tracks at entrance
+    gMC->CurrentVolOffID(1,copy);
+    vol[2]=copy;
+    gMC->CurrentVolOffID(3,copy);
+    vol[1]=copy;
+    id=gMC->CurrentVolOffID(8,copy);
+    vol[0]=copy;
+    if(id==fIdFTO3) {
+      vol[0]+=22;
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT3) vol[1]+=6;
+    } else if (id==fIdFTO2) {
+      vol[0]+=20;
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT2) vol[1]+=8;
+    } else {
+      id=gMC->CurrentVolOffID(5,copy);
+      if(id==fIdFLT1) vol[1]+=14;
+    }
+    gMC->TrackPosition(pos);
+    gMC->TrackMomentum(mom);
+    //
+    Double_t ptot=mom.Rho();
+    Double_t norm=1/ptot;
+    for(i=0;i<3;++i) {
+      hits[i]=pos[i];
+      hits[i+3]=mom[i]*norm;
+    }
+    hits[6]=ptot;
+    hits[7]=pos[3];
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+  }
+}
+
diff --git a/TOF/AliTOFv6.h b/TOF/AliTOFv6.h
new file mode 100644 (file)
index 0000000..b61f190
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef TOFv6_H
+#define TOFv6_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////
+//  Manager and hits classes for set:TOF  version 1  //
+///////////////////////////////////////////////////////
+#include "AliTOF.h"
+#include "AliHit.h"
+class AliTOFv6 : public AliTOF {
+
+private:
+  Int_t fIdFTO2; // First sensitive volume identifier
+  Int_t fIdFTO3; // Second sensitive volume identifier
+  Int_t fIdFLT1; // Third sensitive volume identifier
+  Int_t fIdFLT2; // Fourth sensitive volume identifier
+  Int_t fIdFLT3; // Fifth sensitive volume identifier
+public:
+  AliTOFv6();
+  AliTOFv6(const char *name, const char *title);
+  virtual       ~AliTOFv6() {}
+  virtual void   CreateGeometry();
+  virtual void   CreateMaterials();
+  virtual void   Init();
+  virtual Int_t  IsVersion() const {return 6;}
+  virtual void   TOFpc(Float_t,Float_t,Float_t,Float_t,Float_t,Float_t);
+  virtual void   StepManager();
+  virtual void   DrawModule();
+   ClassDef(AliTOFv6,1)  //Time Of Flight version 6
+};
+#endif
index d526afd..d2444d8 100644 (file)
@@ -2,7 +2,7 @@
 {
    gMC->Gsatt("*", "seen", -1);
    gMC->Gsatt("alic", "seen", 0);   
-   gROOT->Macro("ViewTOF.C");
+   gROOT->Macro("ViewTOF4.C");
    gMC->Gdopt("hide", "on");
    gMC->Gdopt("shad", "on");
    gMC->Gsatt("*", "fill", 7);
@@ -11,5 +11,5 @@
    gMC->DefaultRange();
    gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
    gMC->Gdhead(1111, "Time Of Flight");
-   gMC->Gdman(18, 4, "MAN");
+//   gMC->Gdman(18, 4, "MAN");
 }
index 0425811..31de150 100644 (file)
@@ -9,7 +9,7 @@ PACKAGE = TOF
 
 # C++ sources
 
-SRCS  = AliTOF.cxx     AliTOFv0.cxx      AliTOFv1.cxx    AliTOFv2.cxx AliTOFv3.cxx 
+SRCS  = AliTOF.cxx  AliTOFv0.cxx  AliTOFv1.cxx  AliTOFv2.cxx  AliTOFv3.cxx  AliTOFv4.cxx  AliTOFv5.cxx  AliTOFv6.cxx
 
 # C++ Headers
 
@@ -73,10 +73,3 @@ include $(ALICE_ROOT)/conf/GeneralMacros
 CHECKS        = $(patsubst %.cxx,check/%.viol,$(SRCS))
 
 check:          $(CHECKS)
-
-
-
-
-
-
-
index b15b74b..bcb618b 100644 (file)
 #pragma link C++ class  AliTOFv1;
 #pragma link C++ class  AliTOFv2;
 #pragma link C++ class  AliTOFv3;
+#pragma link C++ class  AliTOFv4;
+#pragma link C++ class  AliTOFv5;
+#pragma link C++ class  AliTOFv6;
+
 #pragma link C++ class  AliTOFhit;
 
 #endif
index 82d1d36..95133ba 100644 (file)
@@ -2,54 +2,18 @@
 {
    AliDetector *TOF  = gAlice->GetDetector("TOF");
    gMC->Gsatt("*","seen",0);
-   gMC->Gsatt("FBT1","seen",0);
-   gMC->Gsatt("FBT2","seen",0);
-   gMC->Gsatt("FBT3","seen",0);
+   gMC->Gsatt("BTO1","seen",0);
+   gMC->Gsatt("BTO2","seen",0);
+   gMC->Gsatt("BTO3","seen",0);
    gMC->Gsatt("FLT1","seen",1);
    gMC->Gsatt("FLT2","seen",1);
    gMC->Gsatt("FLT3","seen",1);
-   gMC->Gsatt("FMY1","seen",0);
-   gMC->Gsatt("FMY2","seen",0);
-   gMC->Gsatt("FMY3","seen",0);
-   gMC->Gsatt("FPG0","seen",0);
-   if (TOF->IsVersion() != 2) {  
-   gMC->Gsatt("FTO1","seen",0);
-   gMC->Gsatt("FTO2","seen",0);
-   gMC->Gsatt("FTO3","seen",0);
-   gMC->Gsatt("FDT1","seen",0);
-   gMC->Gsatt("FDT2","seen",0);
-   gMC->Gsatt("FDT3","seen",0);
-   gMC->Gsatt("FPL1","seen",0);
-   gMC->Gsatt("FPL2","seen",0);
-   gMC->Gsatt("FPL3","seen",0);
-   gMC->Gsatt("FLD1","seen",1);
-   gMC->Gsatt("FLD2","seen",1);
-   gMC->Gsatt("FLD3","seen",1);
-   gMC->Gsatt("FLZ1","seen",0);
-   gMC->Gsatt("FLZ2","seen",0);
-   gMC->Gsatt("FLZ3","seen",0);
-   gMC->Gsatt("FLX1","seen",0);
-   gMC->Gsatt("FLX2","seen",0);
-   gMC->Gsatt("FLX3","seen",0);
-   gMC->Gsatt("FPA0","seen",0);
-   } else {
-   gMC->Gsatt("FTO1","seen",1);
-   gMC->Gsatt("FTO2","seen",1);
-   gMC->Gsatt("FTO3","seen",1);
-   gMC->Gsatt("FPE1","seen",1);
-   gMC->Gsatt("FPE2","seen",1);
-   gMC->Gsatt("FPE3","seen",1);
-   gMC->Gsatt("FEC1","seen",1);
-   gMC->Gsatt("FEC2","seen",1);
-   gMC->Gsatt("FEC3","seen",1);
-   gMC->Gsatt("FEG1","seen",1);
-   gMC->Gsatt("FEG2","seen",1);
-   gMC->Gsatt("FEG3","seen",1);
-   gMC->Gsatt("FSP1","seen",1);
-   gMC->Gsatt("FSP2","seen",1);
-   gMC->Gsatt("FSP3","seen",1);
-   gMC->Gsatt("FLK0","seen",1);
-   gMC->Gsatt("FPP0","seen",0);
-   gMC->Gsatt("FPP0","seen",0);
-   }
+//   gMC->Gsatt("BTO1","fill",7);
+//   gMC->Gsatt("BTO2","fill",7);
+//   gMC->Gsatt("BTO3","fill",7);
+//   gMC->Gsatt("FLT1","fill",7);
+//   gMC->Gsatt("FLT2","fill",7);
+//   gMC->Gsatt("FLT3","fill",7);
+   gMC->Gsatt("FSTR","seen",1);
+//   gMC->Gsatt("FPAD","seen",0);
 }
diff --git a/TOF/tofanal.C b/TOF/tofanal.C
new file mode 100644 (file)
index 0000000..ac351d8
--- /dev/null
@@ -0,0 +1,85 @@
+void tofanal (Int_t evNumber=0) 
+{
+/////////////////////////////////////////////////////////////////////////
+//   This macro is a small example of a ROOT macro
+//   illustrating how to read the output of GALICE
+//   and fill some histograms.
+//   
+//     Root > .L anal.C   //this loads the macro in memory
+//     Root > anal();     //by default process first event   
+//     Root > anal(2);    //process third event
+//Begin_Html
+/*
+<img src="picts/tofanal.gif">
+*/
+//End_Html
+/////////////////////////////////////////////////////////////////////////
+
+
+// Dynamically link some shared libs
+   if (gClassTable->GetID("AliRun") < 0) {
+     gROOT->LoadMacro("loadlibs.C");
+     loadlibs();
+   } else {
+      delete gAlice;
+      gAlice = 0;
+   }
+      
+// Connect the Root Galice file containing Geometry, Kine and Hits
+   TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
+   if (!file) file = new TFile("galice.root");
+
+// Get AliRun object from file or create it if not on file
+   if (!gAlice) {
+      gAlice = (AliRun*)file->Get("gAlice");
+      if (gAlice) printf("AliRun object found on file\n");
+      if (!gAlice) gAlice = new AliRun("gAlice","TOF test program");
+   }
+      
+// Import the Kine and Hits Trees for the event evNumber in the file
+   gAlice->GetEvent(evNumber);
+   Float_t x,y,z,mass,e;
+   Int_t nbytes = 0;
+   Int_t j,hit,ipart;
+   Int_t nhits;
+   Float_t tof;
+   TParticle *particle;
+
+// Get pointers to Alice detectors and Hits containers
+   AliDetector *TOF  = gAlice->GetDetector("TOF");
+   TClonesArray *Particles = gAlice->Particles();
+
+   Int_t ntracks    = gAlice->TreeH()->GetEntries();
+
+   // Create histograms
+   TH1F *hTOF = new TH1F("TOF","Time-of-flight distribution",100,0,10e-8);
+   TH1F *hTOFprim = new TH1F("TOFprim","Time-of-flight distribution of primaries",100,0,10e-8);
+// Start loop on tracks in the hits containers
+   for (Int_t track=0; track<ntracks;track++) {
+     if(TOF) {
+     // ======>Histogram TOF
+       for(AliTOFhit* tofHit=(AliTOFhit*)TOF->FirstHit(track); tofHit; tofHit=(AliTOFhit*)TOF->NextHit()) {
+         tof = tofHit->fTof;
+         hTOF->Fill(tof);
+         ipart    = tofHit->fTrack;
+         particle = (TParticle*)Particles->UncheckedAt(ipart);
+         if (particle->GetFirstMother() < 0) hTOFprim->Fill(tof);
+       }
+     }        
+   }
+
+//Create a canvas, set the view range, show histograms
+   TCanvas *c1 = new TCanvas("c1","Alice TOF hits",400,10,600,700);
+   c1->Divide(1,2);
+   c1->cd(1);
+   gPad->SetFillColor(33);
+   hTOF->SetFillColor(42);
+   hTOF->Draw();
+   //   hSectors->Fit("pol1");
+   c1->cd(2);
+   gPad->SetFillColor(33);
+   hTOFprim->SetFillColor(42);
+   hTOFprim->Draw();
+   //   hTOFprim->Draw("same");
+   c1->Print("tofanal.ps");
+}