* provided "as is" without express or implied warranty. *
**************************************************************************/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
-//
+// //
// This class contains the functions for version 4 of the Time Of Flight //
// detector. //
-//
-// VERSION WITH 5 MODULES AND TILTED STRIPS
-//
-// FULL COVERAGE VERSION
-//
-// Author:
-// Fabrizio Pierella
-// University of Bologna - Italy
-//
-//
-//Begin_Html
-/*
-<img src="picts/AliTOFv4T0Class.gif">
-*/
-//End_Html
+// //
+// VERSION WITH 5 MODULES AND TILTED STRIPS //
+// //
+// FULL COVERAGE VERSION +OPTION for PHOS holes //
+// //
+// Author: //
+// Fabrizio Pierella //
+// University of Bologna - Italy //
+// //
+// //
+//Begin_Html //
+/* //
+<img src="picts/AliTOFv4T0Class.gif"> //
+*/ //
+//End_Html //
// //
///////////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
#include "TVirtualMC.h"
-#include "AliTOFv4T0.h"
-#include "TBRIK.h"
-#include "TGeometry.h"
-#include "TNode.h"
+#include <TBRIK.h>
+#include <TGeometry.h>
#include <TLorentzVector.h>
-#include "TObject.h"
-#include "AliRun.h"
-#include "AliConst.h"
+#include <TNode.h>
+#include <TObject.h>
+#include <TVirtualMC.h>
+#include "AliConst.h"
+#include "AliRun.h"
+#include "AliTOFv4T0.h"
+#include "AliTOFGeometry.h"
+#include "AliMC.h"
ClassImp(AliTOFv4T0)
//
// Check that FRAME is there otherwise we have no place where to
// put TOF
+
+
AliModule* frame=gAlice->GetModule("FRAME");
if(!frame) {
Error("Ctor","TOF needs FRAME to be present\n");
exit(1);
- } else
- if(frame->IsVersion()!=1) {
- Error("Ctor","FRAME version 1 needed with this version of TOF\n");
- exit(1);
- }
-
-}
+ } else{
+
+ if (fTOFGeometry) delete fTOFGeometry;
+ fTOFGeometry = new AliTOFGeometry();
-//____________________________________________________________________________
+ if(frame->IsVersion()==1) {
+ cout << " Frame version " << frame->IsVersion() << endl;
+ cout << " Full Coverage for TOF" << endl;
+ fTOFHoles=false;}
+ else {
+ cout << " Frame version " << frame->IsVersion() << endl;
+ cout << " TOF with Holes for PHOS " << endl;
+ fTOFHoles=true;}
+ }
+ fTOFGeometry->SetHoles(fTOFHoles);
+}
+//____________________________________________________________________________
void AliTOFv4T0::BuildGeometry()
{
//
top = gAlice->GetGeometry()->GetNode("alice");
// Position the different copies
- const Float_t krTof =(fRmax+fRmin)/2;
- const Float_t khTof = fRmax-fRmin;
- const Int_t kNTof = fNTof;
- const Float_t kPi = TMath::Pi();
+ const Float_t krTof =(AliTOFGeometry::Rmax()+AliTOFGeometry::Rmin())/2;
+ const Float_t khTof = AliTOFGeometry::Rmax()-AliTOFGeometry::Rmin();
+ const Int_t kNTof = AliTOFGeometry::NSectors();
+ const Float_t kPi = TMath::Pi();
const Float_t kangle = 2*kPi/kNTof;
Float_t ang;
// define offset for nodes
- Float_t zOffsetC = fZtof - fZlenC*0.5;
- Float_t zOffsetB = fZtof - fZlenC - fZlenB*0.5;
+ Float_t zOffsetC = AliTOFGeometry::MaxhZtof() - AliTOFGeometry::ZlenC()*0.5;
+ Float_t zOffsetB = AliTOFGeometry::MaxhZtof() - AliTOFGeometry::ZlenC() - AliTOFGeometry::ZlenB()*0.5;
Float_t zOffsetA = 0.;
// Define TOF basic volume
- char nodeName0[7], nodeName1[7], nodeName2[7];
+ char nodeName0[7], nodeName1[7], nodeName2[7];
char nodeName3[7], nodeName4[7], rotMatNum[7];
new TBRIK("S_TOF_C","TOF box","void",
- fStripLn*0.5,khTof*0.5,fZlenC*0.5);
+ AliTOFGeometry::StripLength()*0.5,khTof*0.5,AliTOFGeometry::ZlenC()*0.5);
new TBRIK("S_TOF_B","TOF box","void",
- fStripLn*0.5,khTof*0.5,fZlenB*0.5);
+ AliTOFGeometry::StripLength()*0.5,khTof*0.5,AliTOFGeometry::ZlenB()*0.5);
new TBRIK("S_TOF_A","TOF box","void",
- fStripLn*0.5,khTof*0.5,fZlenA*0.5);
+ AliTOFGeometry::StripLength()*0.5,khTof*0.5,AliTOFGeometry::ZlenA()*0.5);
for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
top->cd();
node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetC,rotMatNum);
node->SetLineColor(kColorTOF);
- fNodes->Add(node);
+ fNodes->Add(node);
- top->cd();
+ top->cd();
node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetC,rotMatNum);
node->SetLineColor(kColorTOF);
- fNodes->Add(node);
+ fNodes->Add(node);
top->cd();
node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetB,rotMatNum);
node->SetLineColor(kColorTOF);
- fNodes->Add(node);
+ fNodes->Add(node);
top->cd();
node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetB,rotMatNum);
node->SetLineColor(kColorTOF);
- fNodes->Add(node);
+ fNodes->Add(node);
top->cd();
node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetA,rotMatNum);
node->SetLineColor(kColorTOF);
- fNodes->Add(node);
+ fNodes->Add(node);
} // end loop on nodeNum
}
AliTOF::CreateGeometry();
}
+
//_____________________________________________________________________________
void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
Float_t zlenB, Float_t zlenA, Float_t ztof0)
// Definition of the Time Of Fligh Resistive Plate Chambers
// xFLT, yFLT, zFLT - sizes of TOF modules (large)
- Float_t ycoor, zcoor;
+ Float_t ycoor;
Float_t par[3];
Int_t *idtmed = fIdtmed->GetArray()-499;
Int_t idrotm[100];
Int_t nrot = 0;
- Float_t hTof = fRmax-fRmin;
-
- Float_t radius = fRmin+2.;//cm
+
+ Float_t radius = AliTOFGeometry::Rmin()+2.;//cm
+
par[0] = xtof * 0.5;
par[1] = ytof * 0.5;
AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
+
gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
- gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
+ if(!fTOFHoles)gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
- Float_t db = 0.5;//cm
+
+ Float_t db = 0.5; // cm
Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
- xFLT = fStripLn;
+ xFLT = AliTOFGeometry::StripLength();
yFLT = ytof;
zFLTA = zlenA;
zFLTB = zlenB;
zFLTC = zlenC;
- xFST = xFLT-fDeadBndX*2;//cm
+ xFST = xFLT - AliTOFGeometry::DeadBndX()*2; // cm
// Sizes of MRPC pads
- Float_t yPad = 0.505;//cm
+ Float_t yPad = 0.505; //cm
// Large not sensitive volumes with Insensitive Freon
par[0] = xFLT*0.5;
///// Layers of Aluminum before and after detector /////
///// Aluminum Box for Modules (1.8 mm thickness) /////
///// lateral walls not simulated for the time being
- //const Float_t khAlWall = 0.18;
+ // const Float_t khAlWall = 0.18;
// fp to be checked
const Float_t khAlWall = 0.11;
par[0] = xFLT*0.5;
- par[1] = khAlWall/2.;//cm
+ par[1] = khAlWall/2.; // cm
ycoor = -yFLT/2 + par[1];
par[2] = (zFLTA *0.5);
gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
///////////////// Detector itself //////////////////////
- const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
+ const Float_t kdeadBound = AliTOFGeometry::DeadBndZ(); //cm non-sensitive between the pad edge
//and the boundary of the strip
- const Int_t knx = fNpadX; // number of pads along x
- const Int_t knz = fNpadZ; // number of pads along z
- const Float_t kspace = fSpace; //cm distance from the front plate of the box
+ const Int_t knx = AliTOFGeometry::NpadX(); // number of pads along x
+ const Int_t knz = AliTOFGeometry::NpadZ(); // number of pads along z
- Float_t zSenStrip = fZpad*fNpadZ;//cm
+ Float_t zSenStrip = AliTOFGeometry::ZPad() * AliTOFGeometry::NpadZ(); // cm
Float_t stripWidth = zSenStrip + 2*kdeadBound;
par[0] = xFLT*0.5;
- par[1] = yPad*0.5;
+ par[1] = yPad*0.5;
par[2] = stripWidth*0.5;
// new description for strip volume -double stack strip-
const Float_t khpcby = 0.08 ; // heigth of PCB Layer
const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
- const Float_t khglasseiy = 0.135; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
+ const Float_t khglasseiy = 0.135; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
const Float_t kwsensmz = 2*3.5 ; // cm
const Float_t klsensmx = 48*2.5; // cm
const Float_t klstripx = 122.;
Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
- // coordinates of the strip center in the strip reference frame; used for positioning
- // internal strip volumes
- Float_t posfp[3]={0.,0.,0.};
+ // Coordinates of the strip center in the strip reference frame;
+ // used for positioninG internal strip volumes
+ Float_t posfp[3]={0.,0.,0.};
- // FSTR volume definition and filling this volume with non sensitive Gas Mixture
+ // FSTR volume definition-filling this volume with non sensitive Gas Mixture
gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
//-- HONY Layer definition
// parfp[0] = -1;
gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
//-- PCB Layer definition
+
parfp[1] = khpcby*0.5;
gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
// positioning 2 PCB Layers on FSTR volume
//-- MYLAR Layer definition
+
parfp[1] = khmyly*0.5;
gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
// positioning 2 MYLAR Layers on FSTR volume
- posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
+ posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
// adding further 2 MYLAR Layers on FSTR volume
//-- Graphite Layer definition
+
parfp[1] = khgraphy*0.5;
gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
// positioning 2 Graphite Layers on FSTR volume
//-- Glass (EXT. +Semi INT.) Layer definition
+
parfp[1] = khglasseiy*0.5;
gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
// positioning 2 Glass Layers on FSTR volume
//-- Sensitive Mixture Layer definition
+
parfp[0] = klsensmx*0.5;
parfp[1] = khsensmy*0.5;
parfp[2] = kwsensmz*0.5;
gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
// dividing FSEN along z in knz=2 and along x in knx=48
+
gMC->Gsdvn("FSEZ","FSEN",knz,3);
gMC->Gsdvn("FSEX","FSEZ",knx,1);
// FPAD volume definition
- parfp[0] = klpadx*0.5;
+
+ parfp[0] = klpadx*0.5;
parfp[1] = khsensmy*0.5;
parfp[2] = kwpadz*0.5;
gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
// positioning the FPAD volumes on previous divisions
gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
- //// Positioning the Strips (FSTR) in the FLT volumes /////
-
- // Plate A (Central)
-
- Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
-
- Float_t gap = fGapA+0.5; //cm updated distance between the strip axis
- Float_t zpos = 0;
- Float_t ang = 0;
- Int_t i=1,j=1;
- nrot = 0;
- zcoor = 0;
- ycoor = -14.5 + kspace ; //2 cm over front plate
-
- AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
- gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
- if(fDebug>=1) {
- printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
- printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
- }
- zcoor -= zSenStrip;
- j++;
- Int_t upDown = -1; // upDown=-1 -> Upper strip
- // upDown=+1 -> Lower strip
- do{
- ang = atan(zcoor/radius);
- ang *= kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
- AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
- ang /= kRaddeg;
- ycoor = -14.5+ kspace; //2 cm over front plate
- ycoor += (1-(upDown+1)/2)*gap;
- gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
- gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
- if(fDebug>=1) {
- printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
- printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
- }
- j += 2;
- upDown*= -1; // Alternate strips
- zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
- upDown*gap*TMath::Tan(ang)-
- (zSenStrip/2)/TMath::Cos(ang);
- } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
-
- zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
- upDown*gap*TMath::Tan(ang)+
- (zSenStrip/2)/TMath::Cos(ang);
-
- gap = fGapB;
- zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
- upDown*gap*TMath::Tan(ang)-
- (zSenStrip/2)/TMath::Cos(ang);
-
- ang = atan(zcoor/radius);
- ang *= kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
- AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
- ang /= kRaddeg;
-
- ycoor = -14.5+ kspace; //2 cm over front plate
- ycoor += (1-(upDown+1)/2)*gap;
- gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
- gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
- if(fDebug>=1) {
- printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
- printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
- }
- ycoor = -hTof/2.+ kspace;//2 cm over front plate
-
- // Plate B
-
- nrot = 0;
- i=1;
- upDown = 1;
- Float_t deadRegion = 1.0;//cm
-
- zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
- upDown*gap*TMath::Tan(ang)-
- (zSenStrip/2)/TMath::Cos(ang)-
- deadRegion/TMath::Cos(ang);
-
- ang = atan(zpos/radius);
- ang *= kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
- ang /= kRaddeg;
- ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
- ycoor += (1-(upDown+1)/2)*gap;
- zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
- gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
- if(fDebug>=1) {
- printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
- printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
- }
- i++;
- upDown*=-1;
-
- do {
- zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
- upDown*gap*TMath::Tan(ang)-
- (zSenStrip/2)/TMath::Cos(ang);
- ang = atan(zpos/radius);
- ang *= kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
+
+ ///////////////////Positioning A module//////////////////////////
+
+
+ for(Int_t istrip =0; istrip < fTOFGeometry->NStripA(); istrip++){
+
+ Float_t ang = fTOFGeometry->GetAngles(2,istrip);
+ AliMatrix (idrotm[0],90.,0.,90.-ang,90.,-ang, 90.);
ang /= kRaddeg;
- Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame
- Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips
- ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate
- ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB);
- zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
- gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+ Float_t zpos = tan(ang)*radius;
+ Float_t ypos= fTOFGeometry->GetHeights(2,istrip);
+ gMC->Gspos("FSTR",AliTOFGeometry::NStripA()-istrip,"FLTA",0.,ypos, zpos,idrotm[0], "ONLY");
if(fDebug>=1) {
- printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
- printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
+ printf("y = %f, z = %f, , z coord = %f, Rot ang = %f, St. %2i \n",ypos,zpos,tan(ang)*radius ,ang*kRaddeg,istrip);
}
- upDown*=-1;
- i++;
- } while (TMath::Abs(ang*kRaddeg)<22.5);
- //till we reach a tilting angle of 22.5 degrees
-
- ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
- zpos = zpos - zSenStrip/TMath::Cos(ang);
- // this avoid overlaps in between outer strips in plate B
- Float_t deltaMovingUp=0.8; // [cm]
- Float_t deltaMovingDown=-0.5; // [cm]
-
- do {
- ang = atan(zpos/radius);
- ang *= kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
+ }
+
+
+ ///////////////////Positioning B module//////////////////////////
+
+ for(Int_t istrip =0; istrip < fTOFGeometry->NStripB(); istrip++){
+
+ Float_t ang = fTOFGeometry->GetAngles(3,istrip);
+ AliMatrix (idrotm[0],90.,0.,90.-ang,90.,-ang, 90.);
ang /= kRaddeg;
- zcoor = zpos+(zFLTB/2+zFLTA/2+db);
- gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY");
- deltaMovingUp+=0.8; // update delta moving toward the end of the plate
- zpos = zpos - zSenStrip/TMath::Cos(ang);
+ Float_t zpos = tan(ang)*radius+(zFLTA*0.5+zFLTB*0.5+db);
+ Float_t ypos= fTOFGeometry->GetHeights(3,istrip);
+ gMC->Gspos("FSTR",istrip+1,"FLTB",0.,ypos, zpos,idrotm[nrot], "ONLY");
if(fDebug>=1) {
- printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
- printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
+ printf("y = %f, z = %f, , z coord = %f, Rot ang = %f, St. %2i \n",ypos,zpos,tan(ang)*radius,ang*kRaddeg,istrip);
}
- i++;
-
- } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
-
- // Plate C
-
- zpos = zpos + zSenStrip/TMath::Cos(ang);
-
- zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
- gap*TMath::Tan(ang)-
- (zSenStrip/2)/TMath::Cos(ang);
-
- nrot = 0;
- i=0;
- Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate
- ycoor= -hTof*0.5+kspace+gap+deltaGap;
+ }
+
- do {
- i++;
- ang = atan(zpos/radius);
- ang *= kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
+ ///////////////////Positioning C module//////////////////////////
+
+ for(Int_t istrip =0; istrip < fTOFGeometry->NStripC(); istrip++){
+
+ Float_t ang = fTOFGeometry->GetAngles(4,istrip);
+ AliMatrix (idrotm[0],90.,0.,90.-ang,90.,-ang, 90.);
ang /= kRaddeg;
- zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
- gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
+ Float_t zpos = tan(ang)*radius+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
+ Float_t ypos= fTOFGeometry->GetHeights(4,istrip);
+ gMC->Gspos("FSTR",istrip+1,"FLTC",0.,ypos, zpos,idrotm[nrot], "ONLY");
if(fDebug>=1) {
- printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
- printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
- }
- zpos = zpos - zSenStrip/TMath::Cos(ang);
- } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
-
-
+ printf("y = %f, z = %f, z coord = %f, Rot ang = %f, St. %2i \n",ypos,zpos,tan(ang)*radius,ang*kRaddeg,istrip);
+ }
+ }
+
////////// Layers after strips /////////////////
// Al Layer thickness (2.3mm) factor 0.7
- Float_t overSpace = fOverSpc;//cm
+ Float_t overSpace = AliTOFGeometry::OverSpc();//cm
par[0] = xFLT*0.5;
par[1] = 0.115*0.7; // factor 0.7
// plexiglass thickness: 1.5 mm ; factor 0.3
+
ycoor += par[1];
par[0] = xFLT*0.5;
par[1] = 0.075*0.3; // factor 0.3
gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
// frame of Air
+
ycoor += par[1];
par[0] = xFLT*0.5;
par[1] = (yFLT/2-ycoor-khAlWall)*0.5; // Aluminum layer considered (0.18 cm)
// card volume definition
// see GEOM200 in GEANT manual
+
+
AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg
Float_t cardpar[3];
cardpos[2]= -53.;
Float_t aplpos1 = -2.;
Int_t icard;
- for (icard=0; icard<15; ++icard) {
+ for (icard=0; icard < fTOFGeometry->NStripA(); ++icard) {
cardpos[2]= cardpos[2]+stepforcardA;
aplpos2 = cardpos[2]+0.15;
- gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
+ gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
gMC->Gspos("FALP",icard,"FAIA",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
}
// intermediate module positioning (FAIB)
Float_t stepforcardB= 7.05;
cardpos[2]= -70.5;
- for (icard=0; icard<19; ++icard) {
+ for (icard=0; icard < fTOFGeometry->NStripB(); ++icard) {
cardpos[2]= cardpos[2]+stepforcardB;
- aplpos2 = cardpos[2]+0.15;
- gMC->Gspos("FCAR",icard,"FAIB",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
- gMC->Gspos("FALP",icard,"FAIB",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
+ aplpos2 = cardpos[2]+0.15;
+ gMC->Gspos("FCAR",icard,"FAIB",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
+ gMC->Gspos("FALP",icard,"FAIB",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
}
// outer module positioning (FAIC)
Float_t stepforcardC= 8.45238;
cardpos[2]= -88.75;
- for (icard=0; icard<20; ++icard) {
+ for (icard=0; icard < fTOFGeometry->NStripC(); ++icard) {
cardpos[2]= cardpos[2]+stepforcardC;
aplpos2 = cardpos[2]+0.15;
- gMC->Gspos("FCAR",icard,"FAIC",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
+ gMC->Gspos("FCAR",icard,"FAIC",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
gMC->Gspos("FALP",icard,"FAIC",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
}
// tube volume definition
+
Float_t tubepar[3];
tubepar[0]= 0.;
tubepar[1]= 0.4;
tubepos[2]= -53.+tdis;
// tub1pos = 5.;
Int_t itub;
- for (itub=0; itub<15; ++itub) {
+ for (itub=0; itub < fTOFGeometry->NStripA(); ++itub) {
tubepos[2]= tubepos[2]+stepforcardA;
gMC->Gspos("FTUB",itub,"FAIA",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
"ONLY");
// intermediate module positioning (FAIB)
tubepos[2]= -70.5+tdis;
- for (itub=0; itub<19; ++itub) {
+ for (itub=0; itub < fTOFGeometry->NStripB(); ++itub) {
tubepos[2]= tubepos[2]+stepforcardB;
gMC->Gspos("FTUB",itub,"FAIB",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
"ONLY");
// outer module positioning (FAIC)
tubepos[2]= -88.75+tdis;
- for (itub=0; itub<20; ++itub) {
+ for (itub=0; itub < fTOFGeometry->NStripC(); ++itub) {
tubepos[2]= tubepos[2]+stepforcardC;
gMC->Gspos("FTUB",itub,"FAIC",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
"ONLY");
}
}
-
//_____________________________________________________________________________
void AliTOFv4T0::DrawModule() const
{
// Draw a shaded view of the TOF detector version 4
//
- //Set ALIC mother transparent
+
+//Set ALIC mother transparent
gMC->Gsatt("ALIC","SEEN",0);
//
//_____________________________________________________________________________
void AliTOFv4T0::StepManager()
{
+
//
// Procedure called at each step in the Time Of Flight
//
+
TLorentzVector mom, pos;
Float_t xm[3],pm[3],xpad[3],ppad[3];
Float_t hits[14],phi,phid,z;
Int_t copy, padzid, padxid, stripid, i;
Int_t *idtmed = fIdtmed->GetArray()-499;
Float_t incidenceAngle;
-
+
if(gMC->GetMedium()==idtmed[513] &&
gMC->IsTrackEntering() && gMC->TrackCharge()
&& gMC->CurrentVolID(copy)==fIdSens)
- {
+ {
+
+ AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+
// getting information about hit volumes
padzid=gMC->CurrentVolOffID(2,copy);
- padz=copy;
+ padz=copy;
+
padxid=gMC->CurrentVolOffID(1,copy);
- padx=copy;
+ padx=copy;
stripid=gMC->CurrentVolOffID(4,copy);
- strip=copy;
+ strip=copy;
gMC->TrackPosition(pos);
gMC->TrackMomentum(mom);
-// Double_t NormPos=1./pos.Rho();
+
+ // Double_t NormPos=1./pos.Rho();
+
Double_t normMom=1./mom.Rho();
-// getting the cohordinates in pad ref system
+ // getting the cohordinates in pad ref system
+
xm[0] = (Float_t)pos.X();
xm[1] = (Float_t)pos.Y();
xm[2] = (Float_t)pos.Z();
gMC->Gmtod(xm,xpad,1);
gMC->Gmtod(pm,ppad,2);
+
+ if (TMath::Abs(ppad[1])>1) {
+ Warning("StepManager","Abs(ppad) > 1");
+ ppad[1]=TMath::Sign((Float_t)1,ppad[1]);
+ }
incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
+
z = pos[2];
- plate = 0;
- if (TMath::Abs(z) <= fZlenA*0.5) plate = 3;
- if (z < (fZlenA*0.5+fZlenB) &&
- z > fZlenA*0.5) plate = 4;
- if (z >-(fZlenA*0.5+fZlenB) &&
- z < -fZlenA*0.5) plate = 2;
- if (z > (fZlenA*0.5+fZlenB)) plate = 5;
- if (z <-(fZlenA*0.5+fZlenB)) plate = 1;
+ plate = -1;
+
+ if (TMath::Abs(z) <= AliTOFGeometry::ZlenA()*0.5) plate = 2;
+ if (z < (AliTOFGeometry::ZlenA()*0.5+AliTOFGeometry::ZlenB()) &&
+ z > AliTOFGeometry::ZlenA()*0.5) plate = 1;
+ if (z >-(AliTOFGeometry::ZlenA()*0.5+AliTOFGeometry::ZlenB()) &&
+ z < -AliTOFGeometry::ZlenA()*0.5) plate = 3;
+ if (z > (AliTOFGeometry::ZlenA()*0.5+AliTOFGeometry::ZlenB())) plate = 0;
+ if (z <-(AliTOFGeometry::ZlenA()*0.5+AliTOFGeometry::ZlenB())) plate = 4;
+
+
+ if (plate==0) strip=fTOFGeometry->NStripC()-strip;
+ else if (plate==1) strip=fTOFGeometry->NStripB()-strip;
+ else strip--;
+
+ //Apply ALICE conventions for volume numbering increasing with theta, phi
+
+ if (plate==3 || plate==4){
+ padx=fTOFGeometry->NpadX()-padx;
+ padz=fTOFGeometry->NpadZ()-padz;
+ xpad[0]=-xpad[0];
+ xpad[2]=-xpad[2];
+ }
+ else {
+ padx--;
+ padz--;
+ }
+
+
phi = pos.Phi();
- phid = phi*kRaddeg+180.;
+ if (phi>=0.) phid = phi*kRaddeg;
+ else phid = phi*kRaddeg + 360.;
+
sector = Int_t (phid/20.);
- sector++;
for(i=0;i<3;++i) {
hits[i] = pos[i];
vol[1]= plate;
vol[2]= strip;
vol[3]= padx;
- vol[4]= padz;
-
- AddT0Hit(gAlice->CurrentTrack(),vol, hits);
+ vol[4]= padz;
+
+ AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}