* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.27 2002/06/24 14:09:12 vicinanz
-review on materials and
-
-Revision 1.26 2002/05/08 13:24:50 vicinanz
-AliTOFanalyzeMatching.C macro added and minor changes to the AliTOF code
-
-Revision 1.25 2001/11/22 11:22:51 hristov
-Updated version of TOF digitization, N^2 problem solved (J.Chudoba)
-
-Revision 1.23 2001/09/27 10:39:20 vicinanz
-SDigitizer and Merger added
-
-Revision 1.22 2001/09/20 15:54:22 vicinanz
-Updated Strip Structure (Double Stack)
-
-Revision 1.21 2001/08/28 08:45:59 vicinanz
-TTask and TFolder structures implemented
-
-Revision 1.20 2001/05/16 14:57:24 alibrary
-New files for folders and Stack
-
-Revision 1.19 2001/05/04 10:09:48 vicinanz
-Major upgrades to the strip structure
-
-Revision 1.18 2000/12/04 08:48:20 alibrary
-Fixing problems in the HEAD
-
-Revision 1.17 2000/10/02 21:28:17 fca
-Removal of useless dependecies via forward declarations
-
-Revision 1.16 2000/05/10 16:52:18 vicinanz
-New TOF version with holes for PHOS/RICH
-
-Revision 1.14.2.1 2000/05/10 09:37:16 vicinanz
-New version with Holes for PHOS/RICH
-
-Revision 1.14 1999/11/05 22:39:06 fca
-New hits structure
-
-Revision 1.13 1999/11/02 11:26:39 fca
-added stdlib.h for exit
-
-Revision 1.12 1999/11/01 20:41:57 fca
-Added protections against using the wrong version of FRAME
-
-Revision 1.11 1999/10/22 08:04:14 fca
-Correct improper use of negative parameters
-
-Revision 1.10 1999/10/16 19:30:06 fca
-Corrected Rotation Matrix and CVS log
-
-Revision 1.9 1999/10/15 15:35:20 fca
-New version for frame1099 with and without holes
-
-Revision 1.8 1999/09/29 09:24:33 fca
-Introduction of the Copyright and cvs Log
-
-*/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
-//
+// //
// This class contains the functions for version 3 of the Time Of Flight //
// detector. //
-//
-// VERSION WITH 5 MODULES AND TILTED STRIPS
-// HITS DEFINED FOR THIS VERSION
-// HOLES FOR RICH DETECTOR
-//
-// Authors:
-//
-// Alessio Seganti
-// Domenico Vicinanza
-//
-// University of Salerno - Italy
-//
-// Fabrizio Pierella
-// University of Bologna - Italy
-//
-//
-//Begin_Html
-/*
-<img src="picts/AliTOFv3Class.gif">
-*/
-//End_Html
+// //
+// VERSION WITH 5 MODULES AND TILTED STRIPS //
+// HITS DEFINED FOR THIS VERSION //
+// HOLES FOR HMPID DETECTOR //
+// //
+// Authors: //
+// //
+// Alessio Seganti //
+// Domenico Vicinanza //
+// //
+// University of Salerno - Italy //
+// //
+// Fabrizio Pierella //
+// University of Bologna - Italy //
+// //
+// //
+//Begin_Html //
+/* //
+<img src="picts/AliTOFv3Class.gif"> //
+*/ //
+//End_Html //
// //
///////////////////////////////////////////////////////////////////////////////
-#include <iostream.h>
+#include <Riostream.h>
#include <stdlib.h>
-#include "AliTOFv3.h"
-#include "TBRIK.h"
-#include "TGeometry.h"
-#include "TNode.h"
#include <TLorentzVector.h>
-#include "TObject.h"
+#include <TObject.h>
+#include <TVirtualMC.h>
+
+#include "AliConst.h"
#include "AliRun.h"
+#include "AliTOFv3.h"
+#include "AliTOFConstants.h" // AdC
#include "AliMC.h"
-#include "AliConst.h"
-
ClassImp(AliTOFv3)
}
}
-
-//____________________________________________________________________________
-
-void AliTOFv3::BuildGeometry()
-{
- //
- // Build TOF ROOT geometry for the ALICE event display
- //
- TNode *node, *top;
- const int kColorTOF = 27;
-
- // Find top TNODE
- 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 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 zOffsetA = 0.;
- // Define TOF basic volume
-
- 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);
- new TBRIK("S_TOF_B","TOF box","void",
- fStripLn*0.5,khTof*0.5,fZlenB*0.5);
- new TBRIK("S_TOF_A","TOF box","void",
- fStripLn*0.5,khTof*0.5,fZlenA*0.5);
-
- for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
-
- if (nodeNum<10) {
- sprintf(rotMatNum,"rot50%i",nodeNum);
- sprintf(nodeName0,"FTO00%i",nodeNum);
- sprintf(nodeName1,"FTO10%i",nodeNum);
- sprintf(nodeName2,"FTO20%i",nodeNum);
- sprintf(nodeName3,"FTO30%i",nodeNum);
- sprintf(nodeName4,"FTO40%i",nodeNum);
- }
- if (nodeNum>9) {
- sprintf(rotMatNum,"rot5%i",nodeNum);
- sprintf(nodeName0,"FTO0%i",nodeNum);
- sprintf(nodeName1,"FTO1%i",nodeNum);
- sprintf(nodeName2,"FTO2%i",nodeNum);
- sprintf(nodeName3,"FTO3%i",nodeNum);
- sprintf(nodeName4,"FTO4%i",nodeNum);
- }
-
- new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
- ang = (4.5-nodeNum) * kangle;
-
- 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);
-
- 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);
- if (nodeNum !=1 && nodeNum!=17 && nodeNum !=18)
- {
- 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);
-
- 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);
- } // Holes for RICH detector
-
- if (nodeNum !=1 && nodeNum !=17 && nodeNum !=18)
- {
- 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);
- } // Holes for RICH detector, central part
- }
-}
-
-
//_____________________________________________________________________________
void AliTOFv3::CreateGeometry()
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-
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.};
+ Float_t posfp[3]={0.,0.,0.};
// FSTR volume definition and filling this volume with non sensitive Gas Mixture
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
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);
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;
+ Int_t j=1; // AdC
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) {
- printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
+ AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
+
+ Int_t centerLoc= (Int_t)(fNStripA/2.) + 1; // AdC
+
+ //gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
+ gMC->Gspos("FSTR",centerLoc,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); // AdC
+ if(fDebug>=1) {
+ printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
}
zcoor -= zSenStrip;
- j++;
+ //j++; // AdC
Int_t upDown = -1; // upDown=-1 -> Upper strip
- // upDown=+1 -> Lower 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], 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) {
- printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
+ //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
+ //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
+ gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
+ gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
+ if(fDebug>=1) {
+ printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
}
- j += 2;
+ j++; //j += 2; // AdC
upDown*= -1; // Alternate strips
zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
upDown*gap*TMath::Tan(ang)-
ang = atan(zcoor/radius);
ang *= kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
+ 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) {
- printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
- printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
+ //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
+ //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
+ gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
+ gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
+ if(fDebug>=1) {
+ printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
+ 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;
+ Int_t i=1; // AdC
upDown = 1;
Float_t deadRegion = 1.0;//cm
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) {
- printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
- printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
+ 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;
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");
- if(fDebug) {
+ 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);
}
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);
- if(fDebug) {
+ 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);
}
ang /= kRaddeg;
zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
- if(fDebug) {
+ 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);
}
for (icard=0; icard<19; ++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");
+ 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");
}
for (icard=0; icard<20; ++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");
}
// Draw a shaded view of the TOF detector version 3
//
- AliMC* pMC = AliMC::GetMC();
-
//Set ALIC mother transparent
- pMC->Gsatt("ALIC","SEEN",0);
+ gMC->Gsatt("ALIC","SEEN",0);
//
//Set volumes visible
// Draw a shaded view of the TOF strips for version 3
//
- AliMC* pMC = AliMC::GetMC();
-
//Set ALIC mother transparent
- pMC->Gsatt("ALIC","SEEN",0);
+ gMC->Gsatt("ALIC","SEEN",0);
//
//Set volumes visible
" TOF "
"**************************************\n",ClassName());
printf("\n%s Version 3 of TOF initialing, "
- "TOF with holes for RICH detector\n",ClassName());
+ "TOF with holes for HMPID detector\n",ClassName());
}
AliTOF::Init();
Int_t *idtmed = fIdtmed->GetArray()-499;
Float_t incidenceAngle;
- if(gMC->GetMedium()==idtmed[513] &&
+ if(gMC->CurrentMedium()==idtmed[513] &&
gMC->IsTrackEntering() && gMC->TrackCharge()
&& gMC->CurrentVolID(copy)==fIdSens)
{
// 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;
z = pos[2];
- plate = 0;
- if (TMath::Abs(z) <= fZlenA*0.5) plate = 3;
+ plate = 0;
+ if (TMath::Abs(z) <= fZlenA*0.5) plate = 2; //3; // AdC
if (z < (fZlenA*0.5+fZlenB) &&
- z > fZlenA*0.5) plate = 4;
+ z > fZlenA*0.5) plate = 1; //4; // AdC
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;
+ z < -fZlenA*0.5) plate = 3; //2; // AdC
+ if (z > (fZlenA*0.5+fZlenB)) plate = 0; //5; // AdC
+ if (z <-(fZlenA*0.5+fZlenB)) plate = 4; //1; // AdC
+
+ if (plate==0) strip=AliTOFConstants::fgkNStripC-strip; // AdC
+ else if (plate==1) strip=AliTOFConstants::fgkNStripB-strip; // AdC
+ else strip--; // AdC
+
+ if (z<=0.) padx=AliTOFConstants::fgkNpadX-padx; // AdC
+ else padx--; // AdC
+
+ if (plate==3 || plate==4) padz=AliTOFConstants::fgkNpadZ-padz; // AdC
+ else padz--; // AdC
phi = pos.Phi();
- phid = phi*kRaddeg+180.;
+ if (phi>=0.) phid = phi*kRaddeg; //+180.; // AdC
+ else phid = phi*kRaddeg + 360.; // AdC
sector = Int_t (phid/20.);
- sector++;
+ //sector++; // AdC
for(i=0;i<3;++i) {
hits[i] = pos[i];
vol[3]= padx;
vol[4]= padz;
- AddHit(gAlice->CurrentTrack(),vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}