/*
$Log$
+Revision 1.14 1999/11/05 22:39:06 fca
+New hits structure
+
+Revision 1.13 1999/11/01 20:41:57 fca
+Added protections against using the wrong version of FRAME
+
Revision 1.12 1999/10/22 08:04:14 fca
Correct improper use of negative parameters
// //
///////////////////////////////////////////////////////////////////////////////
+#include <iostream.h>
#include <stdlib.h>
#include "AliTOFv0.h"
//
// Standard constructor
//
+ //
+ // 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()!=0) {
+ Error("Ctor","FRAME version 0 needed with this version of TOF\n");
+ exit(1);
+ }
+
}
//_____________________________________________________________________________
Float_t zSenStrip;
zSenStrip = StripWidth-2*DeadBound;//cm
- par[0] = xFLT*0.5;
+ par[0] = xFLT/2;
par[1] = yPad/2;
par[2] = StripWidth/2.;
gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
// Freon for non-sesitive boundaries
- par[0] = xFLT*0.5;
+ par[0] = xFLT/2;
par[1] = 0.110/2;
par[2] = -1;
gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
gMC->Gspos("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
// Freon sensitive layer
- par[0] = xFLT*0.5;
+ par[0] = -1;
par[1] = 0.110/2.;
par[2] = zSenStrip/2.;
gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
gMC->Gsdvn("FLZ","FCFC", nz, 3);
gMC->Gsdvn("FLX","FLZ" , nx, 1);
-
//// 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;
do{
ang = atan(zcoor/t);
- ang = ang*kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang,90.);
- AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang,90.);
+ ang = ang * kRaddeg;
+ AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
+ AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90.,ang, 90.);
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/kRaddeg;
+ ang = ang / kRaddeg;
zcoor=zcoor-(zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
UpDown*= -1; // Alternate strips
do {
ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
- ang = ang*kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang,270.);
+ ang = ang * kRaddeg;
+ AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
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/kRaddeg;
+ ang = ang / kRaddeg;
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;
do {
ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
- ang = ang*kRaddeg;
- AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang,270.);
+ ang = ang * kRaddeg;
+ AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
i++;
zcoor = zpos+(zFLT1/2+zFLT2+zFLT3/2+7.*2.);
gMC->Gspos("FSTR",i, "FLT1", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
- ang = ang /kRaddeg;
+ ang = ang / kRaddeg;
zpos = zpos - zSenStrip/TMath::Cos(ang);
last = StripWidth*TMath::Cos(ang)/2.;
} while (zpos>-t+7.+last);
AliTOF::Init();
- //
- // 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()!=0) {
- Error("Ctor","FRAME version 0 needed with this version of TOF\n");
- exit(1);
- }
-
fIdFTO2=gMC->VolId("FTO2");
fIdFTO3=gMC->VolId("FTO3");
fIdFLT1=gMC->VolId("FLT1");
// 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;
+ Float_t hits[8],rho,phi,phid,z;
+ Int_t sector, plate, pad_x, pad_z, strip;
+ Int_t copy, pad_z_id, pad_x_id, strip_id, i;
Int_t *idtmed = fIdtmed->GetArray()-499;
- if(gMC->GetMedium()==idtmed[514-1] &&
+
+
+ if(gMC->GetMedium()==idtmed[513] &&
gMC->IsTrackEntering() && gMC->TrackCharge()
- && gMC->CurrentVolID(copy)==fIdSens) {
+ && 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;
- }
+
+ //_________getting information about hit volumes_____________
+
+ pad_z_id=gMC->CurrentVolOffID(2,copy);
+ pad_z=copy;
+
+ pad_x_id=gMC->CurrentVolOffID(1,copy);
+ pad_x=copy;
+
+ strip_id=gMC->CurrentVolOffID(5,copy);
+ strip=copy;
+
+ pad_z = (strip-1)*2+pad_z;
+
gMC->TrackPosition(pos);
gMC->TrackMomentum(mom);
- //
+
+ rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+ phi = TMath::ACos(pos[0]/rho);
+ Float_t as = TMath::ASin(pos[1]/rho);
+ if (as<0) phi = 2*3.141592654-phi;
+
+ z = pos[2];
+
+ if (z<= 62. && z>=-62.) plate = 3;
+ if (z<= 216. && z>62.) plate = 4;
+ if (z>=-216. && z<-62.) plate = 2;
+ if (z>216.) plate = 5;
+ if (z<-216.) plate = 1;
+
+ phid = phi*kRaddeg;
+ sector = Int_t (phid/20.);
+ sector++;
+
Double_t ptot=mom.Rho();
Double_t norm=1/ptot;
for(i=0;i<3;++i) {
}
hits[6]=ptot;
hits[7]=pos[3];
- new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+ new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),sector, plate, pad_x, pad_z, hits);
}
}
+