From 0f4a73742ac6d527b4373abce1eac8673a3a8be2 Mon Sep 17 00:00:00 2001 From: decaro Date: Mon, 29 Dec 2003 15:18:03 +0000 Subject: [PATCH] TOF geometry updating (addition of AliTOFGeometry) --- TOF/AliTOF.cxx | 2 + TOF/AliTOF.h | 7 +- TOF/AliTOFDigitMap.cxx | 12 +- TOF/AliTOFDigitMap.h | 1 + TOF/AliTOFGeometry.cxx | 542 +++++++++++++++++++++++++++++++ TOF/AliTOFGeometry.h | 119 +++++++ TOF/AliTOFHitMap.cxx | 12 +- TOF/AliTOFHitMap.h | 1 + TOF/AliTOFPID.cxx | 12 +- TOF/AliTOFProb.cxx | 1 - TOF/AliTOFReconstructioner.cxx | 198 +++++------ TOF/AliTOFReconstructioner.h | 1 + TOF/AliTOFReconstructionerV2.cxx | 6 +- TOF/AliTOFSDigit.cxx | 19 +- TOF/AliTOFSDigitizer.cxx | 42 +-- TOF/AliTOFconfig.C | 13 +- TOF/AliTOFpidESD.cxx | 75 +++-- TOF/AliTOFpidESD.h | 3 + TOF/AliTOFv4T0.cxx | 322 +++++++----------- TOF/AliTOFv4T0.h | 13 +- TOF/TOFLinkDef.h | 8 +- TOF/libTOF.pkg | 7 +- 22 files changed, 1003 insertions(+), 413 deletions(-) create mode 100644 TOF/AliTOFGeometry.cxx create mode 100644 TOF/AliTOFGeometry.h diff --git a/TOF/AliTOF.cxx b/TOF/AliTOF.cxx index 7ecb205cdaf..6913f5ec471 100644 --- a/TOF/AliTOF.cxx +++ b/TOF/AliTOF.cxx @@ -91,6 +91,7 @@ AliTOF::AliTOF() fName="TOF"; fMerger = 0x0; fTZero = kFALSE; + fTOFGeometry = 0; } //_____________________________________________________________________________ @@ -110,6 +111,7 @@ AliTOF::AliTOF(const char *name, const char *title, Option_t *option) fReTask= 0x0; fReconParticles= 0x0; fMerger = 0x0; + fTOFGeometry = 0; if (strstr(option,"tzero")){ fHits = new TClonesArray("AliTOFhitT0", 1000); diff --git a/TOF/AliTOF.h b/TOF/AliTOF.h index ce7d643c7ca..d271a9f4c4c 100644 --- a/TOF/AliTOF.h +++ b/TOF/AliTOF.h @@ -30,6 +30,7 @@ class AliTOFMerger; #include #include "AliTOFMerger.h" #include "AliTOFSDigitizer.h" +#include "AliTOFGeometry.h" class AliTOF : public AliDetector { @@ -88,6 +89,7 @@ public: TClonesArray *ReconParticles() const {return fReconParticles;} void RecreateSDigitsArray(); void CreateSDigitsArray(); + AliTOFGeometry *GetGeometry() const { return fTOFGeometry; }; Int_t fNevents ; // Number of events to digitize @@ -128,9 +130,10 @@ protected: Int_t fNFec; // number of FEC Int_t fNTdc; // number of TDC Int_t fNPadXRoc; // number of pads for each ROC - Int_t fIdSens; // the unique numeric identifier for sensitive volume FPAD + Int_t fIdSens; // the unique identifier for sensitive volume FPAD Bool_t fTZero; // flag indicating if T0 is used - + AliTOFGeometry *fTOFGeometry; //The TOF Geometry parameters + private: ClassDef(AliTOF,6) // Time Of Flight base class diff --git a/TOF/AliTOFDigitMap.cxx b/TOF/AliTOFDigitMap.cxx index f5d44ad5f1d..cb7f71f4457 100644 --- a/TOF/AliTOFDigitMap.cxx +++ b/TOF/AliTOFDigitMap.cxx @@ -37,7 +37,7 @@ #include "AliTOFDigitMap.h" #include "AliTOFdigit.h" -#include "AliTOFConstants.h" +#include "AliTOFGeometry.h" #include @@ -62,11 +62,11 @@ AliTOFDigitMap::AliTOFDigitMap(TClonesArray *dig) // of course, these constants must not be hardwired // change later - fNSector = AliTOFConstants::fgkNSectors; - fNplate = AliTOFConstants::fgkNPlates; - fNstrip = AliTOFConstants::fgkNStripC; - fNpx = AliTOFConstants::fgkNpadX; - fNpz = AliTOFConstants::fgkNpadZ; + fNSector = AliTOFGeometry::NSectors(); + fNplate = AliTOFGeometry::NPlates(); + fNstrip = AliTOFGeometry::NStripC(); + fNpx = AliTOFGeometry::NpadX(); + fNpz = AliTOFGeometry::NpadZ(); fMaxIndex=fNSector*fNplate*fNstrip*fNpx*fNpz; fDigitMap = new Int_t[fMaxIndex]; fDigits = dig; diff --git a/TOF/AliTOFDigitMap.h b/TOF/AliTOFDigitMap.h index b8a7c7dac02..38a950e195c 100644 --- a/TOF/AliTOFDigitMap.h +++ b/TOF/AliTOFDigitMap.h @@ -17,6 +17,7 @@ #include "AliHitMap.h" #include "TObject.h" +#include "AliTOFGeometry.h" class TClonesArray; class AliTOFDigitMap : public TObject diff --git a/TOF/AliTOFGeometry.cxx b/TOF/AliTOFGeometry.cxx new file mode 100644 index 00000000000..7607bee7d87 --- /dev/null +++ b/TOF/AliTOFGeometry.cxx @@ -0,0 +1,542 @@ +/************************************************************************** + * 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 0.01 2003/12/04 S.Arcelli +Revision 0.02 2003/12/10 S.Arcelli: + Implement Global methods GetPos & GetDetID +Revision 0.03 2003/12/14 S.Arcelli + Set Phi range [-180,180]->[0,360] +*/ + +#include +#include +/////////////////////////////////////////////////////////////////////////////// +// // +// TOF Geometry class // +// // +/////////////////////////////////////////////////////////////////////////////// + +#include "AliConst.h" +#include "AliTOFGeometry.h" + +ClassImp(AliTOFGeometry) + +//_____________________________________________________________________________ +AliTOFGeometry::AliTOFGeometry() +{ + // + // AliTOFGeometry default constructor + // + Init(); + +} + +//_____________________________________________________________________________ +AliTOFGeometry::~AliTOFGeometry() +{ + // + // AliTOFGeometry destructor + // + +} +//_____________________________________________________________________________ +void AliTOFGeometry::Init() +{ + // + // Initialize strip Tilt Angles and Heights + // + // Strips Tilt Angles + + const Float_t angles[fgkNPlates][fgkMaxNstrip] ={ + + {44.494, 43.725, 42.946, 42.156, 41.357, 40.548, 39.729, 38.899, + 38.060, 37.211, 36.353, 35.484, 34.606, 33.719, 32.822, 31.916, + 31.001, 30.077, 29.144, 28.202 }, + + {26.884, 25.922, 24.952, 23.975, 22.989, 22.320, 21.016, 20.309, + 19.015, 18.270, 16.989, 16.205, 14.941, 14.117, 12.871, 12.008, + 10.784, 9.8807, 8.681, 0.0 }, + + { 7.5835, 6.4124, 5.4058, 4.2809, 3.2448, 2.1424, 1.078, -0., -1.078, + -2.1424, -3.2448, -4.2809, -5.4058, -6.4124, -7.5835, 0.0, 0.0, 0.0, + 0.0, 0.0 }, + + {-8.681, -9.8807, -10.784, -12.008, -12.871, -14.117, -14.941, -16.205, + -16.989, -18.27, -19.015, -20.309, -21.016, -22.32, -22.989, + -23.975, -24.952, -25.922, -26.884, 0. }, + + {-28.202, -29.144, -30.077, -31.001, -31.916, -32.822, -33.719, -34.606, + -35.484, -36.353, -37.211, -38.06, -38.899, -39.729, -40.548, + -41.357, -42.156, -42.946, -43.725, -44.494 }}; + + + //Strips Heights + + const Float_t heights[fgkNPlates][fgkMaxNstrip]= { + + {-5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, + -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5 }, + + {-6.3, -7.1, -7.9, -8.7, -9.5, -3, -9.5, -3, -9.5, -3, + -9.5, -3.0, -9.5, -3.0, -9.5, -3, -9.5, -3, -9 , 0.}, + + { -3, -9, -4.5, -9, -4.5, -9, -4.5, -9, -4.5, -9, + -4.5, -9, -4.5, -9, -3, 0.0, 0.0, 0.0, 0.0, 0.0 }, + + { -9, -3, -9.5, -3, -9.5, -3, -9.5, -3, -9.5, -3, -9.5, + -3, -9.5, -3, -9.5, -8.7, -7.9, -7.1, -6.3, 0. }, + + {-5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, + -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5 }}; + + + // Deposit in fAngles, fHeights + + for (Int_t iplate = 0; iplate < fgkNPlates; iplate++) { + for (Int_t istrip = 0; istrip < fgkMaxNstrip; istrip++) { + fAngles[iplate][istrip] = angles[iplate][istrip]; + fHeights[iplate][istrip] = heights[iplate][istrip]; + } + } + + fPhiSec = 360./fgkNSectors; +} + +//_____________________________________________________________________________ +void AliTOFGeometry::GetPos(Int_t *det, Float_t *pos) +{ +// +// Returns space point coor (x,y,z) (cm) for Detector +// Indices (iSect,iPlate,iStrip,iPadX,iPadZ) +// + + pos[0]=GetX(det); + pos[1]=GetY(det); + pos[2]=GetZ(det); + +} +//_____________________________________________________________________________ +void AliTOFGeometry::GetDetID( Float_t *pos, Int_t *det) +{ + // + // Returns Detector Indices (iSect,iPlate,iStrip,iPadX,iPadZ) + // space point coor (x,y,z) (cm) + + + det[0]=GetSector(pos); + det[1]=GetPlate(pos); + det[2]=GetStrip(pos); + det[3]=GetPadZ(pos); + det[4]=GetPadX(pos); + +} +//_____________________________________________________________________________ +Float_t AliTOFGeometry::GetX(Int_t *det) +{ + // + // Returns X coordinate (cm) + // + + Int_t isector = det[0]; + Int_t iplate = det[1]; + Int_t istrip = det[2]; + Int_t ipadz = det[3]; + Int_t ipadx = det[4]; + + // Find out distance d on the plane wrt median phi: + Float_t d = (ipadx+0.5)*fgkXPad-(fgkNpadX*fgkXPad)*0.5; + + // The radius r in xy plane: + Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip]+ + (ipadz-0.5)*fgkZPad*TMath::Sin(fAngles[iplate][istrip]/kRaddeg)-0.25; + + // local azimuthal angle in the sector philoc + Float_t philoc = TMath:: ATan(d/r); + + // azimuthal angle in the global frame phi + Float_t phi = philoc*kRaddeg+(isector+0.5 )*fPhiSec; + + Float_t xCoor = r/TMath::Cos(philoc)*TMath::Cos(phi/kRaddeg); + return xCoor; + +} +//_____________________________________________________________________________ +Float_t AliTOFGeometry::GetY(Int_t *det) +{ + // + // Returns Y coordinate (cm) + // + + Int_t isector = det[0]; + Int_t iplate = det[1]; + Int_t istrip = det[2]; + Int_t ipadz = det[3]; + Int_t ipadx = det[4]; + + // Find out distance d on the plane wrt median phi: + Float_t d = (ipadx+0.5)*fgkXPad-(fgkNpadX*fgkXPad)*0.5; + + // The radius r in xy plane: + Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip]+ + (ipadz-0.5)*fgkZPad*TMath::Sin(fAngles[iplate][istrip]/kRaddeg)-0.25; + + // local azimuthal angle in the sector philoc + Float_t philoc = TMath:: ATan(d/r); + + // azimuthal angle in the global frame phi + Float_t phi = philoc*kRaddeg+(isector+0.5 )*fPhiSec; + + Float_t yCoor = r/TMath::Cos(philoc)*TMath::Sin(phi/kRaddeg); + return yCoor; + +} + +//_____________________________________________________________________________ +Float_t AliTOFGeometry::GetZ(Int_t *det) +{ + // + // Returns Z coordinate (cm) + // + + Int_t iplate = det[1]; + Int_t istrip = det[2]; + Int_t ipadz = det[3]; + + + // The radius r in xy plane: + Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip]; + + Float_t zCoor = r*TMath::Tan(0.5*TMath::Pi()-GetStripTheta(iplate, istrip))- + (ipadz-0.5)*fgkZPad*TMath::Cos(fAngles[iplate][istrip]/kRaddeg); + return zCoor; + +} +//_____________________________________________________________________________ +Int_t AliTOFGeometry::GetSector(Float_t *pos) +{ + // + // Returns the Sector index + // + + Int_t iSect = -1; + + Float_t x = pos[0]; + Float_t y = pos[1]; + + Float_t phi = TMath::ATan2(y,x); + if(phi<0.) phi=2.*TMath::Pi()+phi; + iSect = (Int_t) (phi*kRaddeg/fPhiSec); + + return iSect; + +} +//_____________________________________________________________________________ +Int_t AliTOFGeometry::GetPadX(Float_t *pos) +{ + // + // Returns the Pad index along X + // + + Int_t iPadX = -1; + + Float_t x = pos[0]; + Float_t y = pos[1]; + Float_t z = pos[2]; + + Int_t isector = GetSector(pos); + if(isector == -1){ + cout << "Detector Index could not be determined" << endl; + return iPadX;} + Int_t iplate = GetPlate(pos); + if(iplate == -1){ + cout << "Detector Index could not be determined" << endl; + return iPadX;} + Int_t istrip = GetStrip(pos); + if(istrip == -1){ + cout << "Detector Index could not be determined" << endl; + return iPadX;} + + + Float_t rho=TMath::Sqrt(x*x+y*y); + Float_t phi = TMath::ATan2(y,x); + if(phi<0.) phi=2.*TMath::Pi()+phi; + + // Get the local angle in the sector philoc + Float_t philoc = phi*kRaddeg-(isector+0.5)*fPhiSec; + philoc*=TMath::Pi()/180.; + // theta projected on the median of the sector + Float_t theta = TMath::ATan2(rho*TMath::Cos(philoc),z); + // The radius r in xy plane: + Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip]+ + (theta-GetStripTheta(iplate, istrip))/ + (GetMaxStripTheta(iplate, istrip)-GetMinStripTheta(iplate, istrip)) + * 2.*fgkZPad*TMath::Sin(fAngles[iplate][istrip]/kRaddeg)-0.25; + + // Find out distance projected onto the strip plane + Float_t d = (r*TMath::Tan(philoc)+(fgkNpadX*fgkXPad)*0.5); + + iPadX = (Int_t) ( d/fgkXPad); + return iPadX; + +} +//_____________________________________________________________________________ +Int_t AliTOFGeometry::GetPlate(Float_t *pos) +{ + // + // Returns the Plate index + // + Int_t iPlate=-1; + + Int_t isector = GetSector(pos); + if(isector == -1){ + cout << "Detector Index could not be determined" << endl; + return iPlate;} + + Float_t x = pos[0]; + Float_t y = pos[1]; + Float_t z = pos[2]; + + Float_t rho=TMath::Sqrt(x*x+y*y); + Float_t phi=TMath::ATan2(y,x); + if(phi<0) phi=2.*TMath::Pi()+phi; + // Get the local angle in the sector philoc + Float_t philoc = phi*kRaddeg-(isector+0.5)*fPhiSec; + philoc*=TMath::Pi()/180.; + // theta projected on the median of the sector + Float_t theta=TMath::ATan2(rho*TMath::Cos(philoc),z); + + for (Int_t i=0; i= theta && + GetMinPlateTheta(i) <= theta)iPlate=i; + } + + return iPlate; + +} +//_____________________________________________________________________________ +Int_t AliTOFGeometry::GetStrip(Float_t *pos) +{ + // + // Returns the Strip index + // + + Int_t iStrip=-1; + + + Int_t isector = GetSector(pos); + if(isector == -1){ + cout << "Detector Index could not be determined" << endl; + return iStrip;} + Int_t iplate = GetPlate(pos); + if(iplate == -1){ + cout << "Detector Index could not be determined" << endl; + return iStrip;} + + + Float_t x = pos[0]; + Float_t y = pos[1]; + Float_t z = pos[2]; + + Int_t nstrips=0; + if(iplate==0 || iplate == 4)nstrips=fgkNStripC; + if(iplate==1 || iplate == 3)nstrips=fgkNStripB; + if(iplate==2) nstrips=fgkNStripA; + + Float_t rho=TMath::Sqrt(x*x+y*y); + Float_t phi=TMath::ATan2(y,x); + if(phi<0) phi=2.*TMath::Pi()+phi; + // Get the local angle in the sector philoc + Float_t philoc = phi*kRaddeg-(isector+0.5)*fPhiSec; + philoc*=TMath::Pi()/180.; + // theta projected on the median of the sector + Float_t theta=TMath::ATan2(rho*TMath::Cos(philoc),z); + + for (Int_t istrip=0; istrip= theta + && + GetMinStripTheta(iplate,istrip) <= theta ) iStrip = istrip; + + } + + return iStrip; +} +//_____________________________________________________________________________ +Int_t AliTOFGeometry::GetPadZ(Float_t *pos) +{ + // + // Returns the Pad index along Z + // + Int_t iPadZ = -1; + + Int_t isector = GetSector(pos); + if(isector == -1){ + cout << "Detector Index could not be determined" << endl; + return iPadZ;} + Int_t iplate = GetPlate(pos); + if(iplate == -1){ + cout << "Detector Index could not be determined" << endl; + return iPadZ;} + Int_t istrip = GetStrip(pos); + if(istrip == -1){ + cout << "Detector Index could not be determined" << endl; + return iPadZ;} + + + Float_t x = pos[0]; + Float_t y = pos[1]; + Float_t z = pos[2]; + + Float_t rho=TMath::Sqrt(x*x+y*y); + Float_t phi=TMath::ATan2(y,x); + if(phi<0) phi=2.*TMath::Pi()+phi; + Float_t philoc = phi*kRaddeg-(isector+0.5)*fPhiSec; + philoc*=TMath::Pi()/180.; + Float_t theta=TMath::ATan2(rho*TMath::Cos(philoc),z); + + if (theta >= GetStripTheta(iplate, istrip))iPadZ=1; + else iPadZ=0; + + return iPadZ; +} +//_____________________________________________________________________________ +Float_t AliTOFGeometry::GetMinPlateTheta(Int_t iPlate) +{ + // + // Returns the minimum theta angle of a given plate iPlate (rad) + // + + + Int_t index=0; + + Float_t delta =0.; + if(iPlate==0)delta = -1. ; + if(iPlate==1)delta = -0.5; + if(iPlate==3)delta = +0.5; + if(iPlate==4)delta = +1. ; + + Float_t z=(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][index]/kRaddeg)+delta; + Float_t r=(fgkRmin+fgkRmax)/2.+fHeights[iPlate][index]; + z =z+fgkZPad*TMath::Cos(fAngles[iPlate][index]/kRaddeg); + r =r-fgkZPad*TMath::Sin(fAngles[iPlate][index]/kRaddeg); + + Float_t thmin = 0.5*TMath::Pi()-TMath::ATan(z/r)-fgkDprecMin; + return thmin; + +} +//_____________________________________________________________________________ +Float_t AliTOFGeometry::GetMaxPlateTheta(Int_t iPlate) +{ + // + // Returns the maximum theta angle of a given plate iPlate (rad) + + Int_t index=0; + if(iPlate==0 ||iPlate == 4)index=fgkNStripC-1; + if(iPlate==1 ||iPlate == 3)index=fgkNStripB-1; + if(iPlate==2) index=fgkNStripA-1; + + Float_t delta =0.; + if(iPlate==0)delta = -1. ; + if(iPlate==1)delta = -0.5; + if(iPlate==3)delta = +0.5; + if(iPlate==4)delta = +1. ; + + Float_t z=(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][index]/kRaddeg)+delta; + Float_t r=(fgkRmin+fgkRmax)/2.+fHeights[iPlate][index]; + z =z-fgkZPad*TMath::Cos(fAngles[iPlate][index]/kRaddeg); + r= r+fgkZPad*TMath::Sin(fAngles[iPlate][index]/kRaddeg); + + Float_t thmax = 0.5*TMath::Pi()-TMath::ATan(z/r)+fgkDprecMax; + return thmax; + +} +//_____________________________________________________________________________ +Float_t AliTOFGeometry::GetMaxStripTheta(Int_t iPlate, Int_t iStrip) +{ + // + // Returns the maximum theta angle of a given strip iStrip (rad) + // + + + Float_t delta =0.; + if(iPlate==0)delta = -1. ; + if(iPlate==1)delta = -0.5; + if(iPlate==3)delta = +0.5; + if(iPlate==4)delta = +1. ; + + Float_t r =(fgkRmin+fgkRmax)/2.+fHeights[iPlate][iStrip]; + Float_t z =(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][iStrip]/kRaddeg)+delta; + z = z-fgkZPad*TMath::Cos(fAngles[iPlate][iStrip]/kRaddeg); + r = r+fgkZPad*TMath::Sin(fAngles[iPlate][iStrip]/kRaddeg); + Float_t thmax =0.5*TMath::Pi()-TMath::ATan(z/r)+fgkDprecMax; + return thmax; + +} + +//_____________________________________________________________________________ +Float_t AliTOFGeometry::GetMinStripTheta(Int_t iPlate, Int_t iStrip) +{ + // + // Returns the minimum theta angle of a given Strip iStrip (rad) + // + + + Float_t delta =0.; + if(iPlate==0)delta = -1. ; + if(iPlate==1)delta = -0.5; + if(iPlate==3)delta = +0.5; + if(iPlate==4)delta = +1. ; + + + Float_t r =(fgkRmin+fgkRmax)/2.+fHeights[iPlate][iStrip]; + Float_t z =(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][iStrip]/kRaddeg)+delta; + z =z+fgkZPad*TMath::Cos(fAngles[iPlate][iStrip]/kRaddeg); + r =r-fgkZPad*TMath::Sin(fAngles[iPlate][iStrip]/kRaddeg); + Float_t thmin =0.5*TMath::Pi()-TMath::ATan(z/r)-fgkDprecMin; + + return thmin; + +} + + +//_____________________________________________________________________________ +Float_t AliTOFGeometry::GetStripTheta(Int_t iPlate, Int_t iStrip) +{ + // + // returns the median theta angle of a given strip iStrip (rad) + // + + + Float_t delta =0.; + if(iPlate==0)delta = -1. ; + if(iPlate==1)delta = -0.5; + if(iPlate==3)delta = +0.5; + if(iPlate==4)delta = +1. ; + + Float_t r =(fgkRmin+fgkRmax)/2.+fHeights[iPlate][iStrip]; + Float_t z =(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][iStrip]/kRaddeg)+delta; + Float_t theta =0.5*TMath::Pi()-TMath::ATan(z/r); + if(iPlate != 2){ + if(theta > 0.5*TMath::Pi() )theta+=fgkDprecCen; + if(theta < 0.5*TMath::Pi() )theta-=fgkDprecCen; + } + return theta; +} + + + diff --git a/TOF/AliTOFGeometry.h b/TOF/AliTOFGeometry.h new file mode 100644 index 00000000000..5c50996979d --- /dev/null +++ b/TOF/AliTOFGeometry.h @@ -0,0 +1,119 @@ +#ifndef ALITOFGEOMETRY_H +#define ALITOFGEOMETRY_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +/////////////////////////////////////////////////////////////////////////////// +// // +// TOF geometry class // +// // +/////////////////////////////////////////////////////////////////////////////// + + + +class AliTOFGeometry{ + + public: + AliTOFGeometry(); + virtual ~AliTOFGeometry(); + + static Int_t NStripA() { return fgkNStripA;}; + static Int_t NStripB() { return fgkNStripB;}; + static Int_t NStripC() { return fgkNStripC;}; + static Int_t NpadX() { return fgkNpadX;}; + static Int_t NpadZ() { return fgkNpadZ;}; + static Int_t NSectors() { return fgkNSectors;}; + static Int_t NPlates() { return fgkNPlates;}; + static Int_t NPadXSector() { return (fgkNStripA + 2*fgkNStripB + + 2*fgkNStripC)*fgkNpadX*fgkNpadZ;}; + static Int_t TimeDiff() { return fgkTimeDiff;}; + static Int_t MaxTOFTree() { return fgkMaxTOFTree;}; + + + static Float_t Rmin() { return fgkRmin;}; + static Float_t Rmax() { return fgkRmax;}; + static Float_t ZlenA() { return fgkZlenA;}; + static Float_t ZlenB() { return fgkZlenB;}; + static Float_t ZlenC() { return fgkZlenC;}; + static Float_t XPad() { return fgkXPad;}; + static Float_t ZPad() { return fgkZPad;}; + static Float_t MaxhZtof() { return fgkMaxhZtof;}; + + + static Float_t SigmaForTail1() { return fgkSigmaForTail1;}; + static Float_t SigmaForTail2() { return fgkSigmaForTail2;}; + static Float_t SpeedOfLight() { return fgkSpeedOfLight;}; + static Float_t PionMass() { return fgkPionMass;}; + static Float_t KaonMass() { return fgkKaonMass;}; + static Float_t ProtonMass() { return fgkProtonMass;}; + static Float_t ElectronMass() { return fgkElectronMass;}; + static Float_t MuonMass() { return fgkMuonMass;}; + + + + virtual void Init(); + virtual void GetPos(Int_t *det,Float_t *pos); + virtual void GetDetID(Float_t *pos,Int_t *det); + virtual Int_t GetPlate(Float_t *pos); + virtual Int_t GetStrip(Float_t *pos); + virtual Int_t GetSector(Float_t *pos); + virtual Int_t GetPadX(Float_t *pos); + virtual Int_t GetPadZ(Float_t *pos); + virtual Float_t GetX(Int_t *det); + virtual Float_t GetY(Int_t *det); + virtual Float_t GetZ(Int_t *det); + virtual Float_t GetMinPlateTheta(Int_t iPlate); + virtual Float_t GetMaxPlateTheta(Int_t iPlate); + virtual Float_t GetMinStripTheta(Int_t iPlate, Int_t iStrip); + virtual Float_t GetMaxStripTheta(Int_t iPlate, Int_t iStrip); + virtual Float_t GetStripTheta(Int_t iPlate, Int_t iStrip); + virtual Float_t GetAngles(Int_t iplate, Int_t istrip) const {return fAngles[iplate][istrip];}; + virtual Float_t GetHeights(Int_t iplate, Int_t istrip) const {return fHeights[iplate][istrip];}; + + private: + + static const Int_t fgkNStripA = 15; // number of strips in A type module + static const Int_t fgkNStripB = 19; // number of strips in B type module + static const Int_t fgkNStripC = 20; // number of strips in C type module + static const Int_t fgkNpadX = 48; // Number of pads along X + static const Int_t fgkNpadZ = 2; // Number of pads along Z + static const Int_t fgkNSectors = 18; // Number of Sectors + static const Int_t fgkNPlates = 5; // Number of Plates + static const Int_t fgkMaxNstrip = 20; // Max. number of strips + static const Int_t fgkMaxTOFTree = 5; // numer of geom. levels: + static const Int_t fgkTimeDiff = 25000;// Min signal separation (ps) + + static const Float_t fgkRmin = 370.; // Inner radius of the TOF (cm) + static const Float_t fgkRmax = 399; // Outer radius of the TOF (cm) + static const Float_t fgkZlenA = 106.0;// length (cm) of the A module + static const Float_t fgkZlenB = 141.0;// length (cm) of the B module + static const Float_t fgkZlenC = 177.5;// length (cm) of the C module + static const Float_t fgkXPad = 2.5; // Pad size in the x direction (cm) + static const Float_t fgkZPad = 3.5; // Pad size in the z direction (cm) + static const Float_t fgkMaxhZtof = 371.5;// Max half z-size of TOF (cm) + + + static const Float_t fgkSigmaForTail1= 2.;//Sig1 for simulation of TDC tails + static const Float_t fgkSigmaForTail2= 0.5;//Sig2 for simulation of TDC tails + static const Float_t fgkSpeedOfLight = 0.299792458;// c (10^9 m/s) + static const Float_t fgkPionMass = 0.13957;// pion mass (Gev/c^2) + static const Float_t fgkKaonMass = 0.49368;// kaon mass (Gev/c^2) + static const Float_t fgkProtonMass = 0.93827;// proton mass (Gev/c^2) + static const Float_t fgkElectronMass = 0.00051;// electron mass (Gev/c^2) + static const Float_t fgkMuonMass = 0.10566;// muon mass (Gev/c^2) + + + static const Float_t fgkDprecMin = 0.0000075;//num.prec.tolerance on Thmin + static const Float_t fgkDprecMax = 0.0000100;//num.prec.tolerance on Thma + static const Float_t fgkDprecCen = 0.0000005;//num.prec.tolerance on + + Float_t fAngles[fgkNPlates][fgkMaxNstrip]; //Strip Tilt Angles + Float_t fHeights[fgkNPlates][fgkMaxNstrip];//Strip heights + Float_t fPhiSec; //sector Phi width (deg) + + ClassDef(AliTOFGeometry,0) // TOF Geometry base class +}; + +#endif diff --git a/TOF/AliTOFHitMap.cxx b/TOF/AliTOFHitMap.cxx index a7cc4365ecd..3e93c2ec744 100644 --- a/TOF/AliTOFHitMap.cxx +++ b/TOF/AliTOFHitMap.cxx @@ -38,7 +38,7 @@ #include "AliTOFHitMap.h" #include "AliTOFSDigit.h" -#include "AliTOFConstants.h" +#include "AliTOFGeometry.h" #include @@ -64,11 +64,11 @@ AliTOFHitMap::AliTOFHitMap(TClonesArray *dig) // of course, these constants must not be hardwired // change later - fNSector = AliTOFConstants::fgkNSectors; - fNplate = AliTOFConstants::fgkNPlates; - fNstrip = AliTOFConstants::fgkNStripC; - fNpx = AliTOFConstants::fgkNpadX; - fNpz = AliTOFConstants::fgkNpadZ; + fNSector = AliTOFGeometry::NSectors(); + fNplate = AliTOFGeometry::NPlates(); + fNstrip = AliTOFGeometry::NStripC(); + fNpx = AliTOFGeometry::NpadX(); + fNpz = AliTOFGeometry::NpadZ(); fMaxIndex=fNSector*fNplate*fNstrip*fNpx*fNpz; fHitMap = new Int_t[fMaxIndex]; fSDigits = dig; diff --git a/TOF/AliTOFHitMap.h b/TOF/AliTOFHitMap.h index 82ef41c5955..18b2206f904 100644 --- a/TOF/AliTOFHitMap.h +++ b/TOF/AliTOFHitMap.h @@ -18,6 +18,7 @@ #include "AliHitMap.h" #include "TObject.h" + class TClonesArray; class AliTOFHitMap : public TObject diff --git a/TOF/AliTOFPID.cxx b/TOF/AliTOFPID.cxx index 15ca3904f95..81e7a0a7990 100644 --- a/TOF/AliTOFPID.cxx +++ b/TOF/AliTOFPID.cxx @@ -73,7 +73,7 @@ #include "TLeaf.h" #include "AliConst.h" -#include "AliTOFConstants.h" +#include "AliTOFGeometry.h" #include "AliTOFPID.h" #include @@ -95,6 +95,7 @@ ClassImp(AliTOFPID) fNtuple = 0; fgen = 0; foutfileName = 0; + } //____________________________________________________________________________ @@ -114,6 +115,7 @@ ClassImp(AliTOFPID) // add Task to //root/Tasks folder TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ; roottasks->Add(this) ; + } //____________________________________________________________________________ void AliTOFPID::Init(const Option_t* opt) @@ -370,19 +372,19 @@ void AliTOFPID::Exec(const Option_t *eventType, const Option_t *outputmode, cons switch(abspdgcode){ case 321: if(isSelected && (matc==3 || matc==4)) kamatch->Fill(pvtx); - mt=TMath::Sqrt(AliTOFConstants::fgkKaonMass*AliTOFConstants::fgkKaonMass+px*px+py*py); + mt=TMath::Sqrt(AliTOFGeometry::KaonMass()*AliTOFGeometry::KaonMass()+px*px+py*py); break; case 2212: if(isSelected && (matc==2 || matc==3 || matc==4)) prmatch->Fill(pvtx); - mt=TMath::Sqrt(AliTOFConstants::fgkProtonMass*AliTOFConstants::fgkProtonMass+px*px+py*py); + mt=TMath::Sqrt(AliTOFGeometry::ProtonMass()*AliTOFGeometry::ProtonMass()+px*px+py*py); break; case 11: if(strstr(eventType,"pp") && (matc==3 || matc==4)) elmatch->Fill(pvtx); // as in kaon case - mt=TMath::Sqrt(AliTOFConstants::fgkElectronMass*AliTOFConstants::fgkElectronMass+px*px+py*py); + mt=TMath::Sqrt(AliTOFGeometry::ElectronMass()*AliTOFGeometry::ElectronMass()+px*px+py*py); break; default: if(isSelected && matc>0) pimatch->Fill(pvtx); - mt=TMath::Sqrt(AliTOFConstants::fgkPionMass*AliTOFConstants::fgkPionMass+px*px+py*py); + mt=TMath::Sqrt(AliTOFGeometry::PionMass()*AliTOFGeometry::PionMass()+px*px+py*py); break; } diff --git a/TOF/AliTOFProb.cxx b/TOF/AliTOFProb.cxx index 8cb62121374..c6d987c5703 100644 --- a/TOF/AliTOFProb.cxx +++ b/TOF/AliTOFProb.cxx @@ -52,7 +52,6 @@ #include "TLeaf.h" #include "AliConst.h" -#include "AliTOFConstants.h" #include "AliTOFProb.h" #include diff --git a/TOF/AliTOFReconstructioner.cxx b/TOF/AliTOFReconstructioner.cxx index 39f36c0d140..26253d288b6 100644 --- a/TOF/AliTOFReconstructioner.cxx +++ b/TOF/AliTOFReconstructioner.cxx @@ -53,6 +53,7 @@ #include #include "AliConst.h" +#include "AliTOFGeometry.h" #include "AliDetector.h" #include "AliHeader.h" #include "AliLoader.h" @@ -60,7 +61,6 @@ #include "AliRun.h" #include "AliRunLoader.h" #include "AliTOF.h" -#include "AliTOFConstants.h" #include "AliTOFHitMap.h" #include "AliTOFPad.h" #include "AliTOFRecHit.h" @@ -384,21 +384,21 @@ void AliTOFReconstructioner::Exec(const char* datafile, Option_t *option) cout << "number of primary tracked tracks in current event " << ntracks << endl; // number of primary tracked tracks // array declaration and initialization // TOF arrays - // Int_t mapPixels[AliTOFConstants::fgkNSectors*AliTOFConstants::fgkNPlates][AliTOFConstants::fgkNStripC][AliTOFConstants::fgkNpadZ*AliTOFConstants::fgkNpadX]; + // Int_t mapPixels[AliTOFGeometry::NSectors()*AliTOFGeometry::NPlates()][AliTOFGeometry::NStripC()][AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX()]; - Int_t *** mapPixels = new Int_t**[AliTOFConstants::fgkNSectors*AliTOFConstants::fgkNPlates]; - for (Int_t i=0; i 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX(); eff[nActivatedPads-1] = effZ; res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ; // ns @@ -980,7 +980,7 @@ void AliTOFReconstructioner::BorderEffect(Float_t z0, Float_t x0, Float_t geantT if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX - 1; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() - 1; eff[nActivatedPads-1] = effX * effZ; (resZ 0) { + if(ix < AliTOFGeometry::NpadX() && dX > 0) { nActivatedPads++; nPlace[nActivatedPads-1] = nPlace[0] + 1; eff[nActivatedPads-1] = effX; @@ -1031,7 +1031,7 @@ void AliTOFReconstructioner::BorderEffect(Float_t z0, Float_t x0, Float_t geantT if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX + 1; + nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() + 1; eff[nActivatedPads - 1] = effX * effZ; (resZ 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX(); eff[nActivatedPads-1] = effZ; res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ; // ns @@ -1261,7 +1261,7 @@ void AliTOFReconstructioner::BorderEffect(Float_t z0, Float_t x0, Float_t geantT if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX - 1; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() - 1; eff[nActivatedPads-1] = effX * effZ; (resZ 0) { + if(ix < AliTOFGeometry::NpadX() && dX > 0) { nActivatedPads++; nPlace[nActivatedPads-1] = nPlace[0] + 1; eff[nActivatedPads-1] = effX; @@ -1309,7 +1309,7 @@ void AliTOFReconstructioner::BorderEffect(Float_t z0, Float_t x0, Float_t geantT if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX + 1; + nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() + 1; eff[nActivatedPads - 1] = effX * effZ; (resZRndm())+1; //the sector number + isector=(Int_t) (AliTOFGeometry::NSectors()*gRandom->Rndm())+1; //the sector number // non-flat z-distribution of additional hits Float_t zNoise=fZnoise->GetRandom(); @@ -1995,15 +1995,15 @@ void AliTOFReconstructioner::AddNoiseFromOuter(Option_t *option, Int_t ***MapPix // to be checked the holes case if(isector>12 && isector<16) { // sectors 13,14,15 - RICH do { - iplate=(Int_t) (AliTOFConstants::fgkNPlates*gRandom->Rndm())+1; + iplate=(Int_t) (AliTOFGeometry::NPlates()*gRandom->Rndm())+1; } while (iplate==2 || iplate==3 || iplate==4); // } else if(isector>11 && isector<17) { // sectors 12,13,14,15,16 - PHOS } else if(isector>2 && isector<8) { // sectors 3,4,5,6,7 - PHOS do { - iplate=(Int_t) (AliTOFConstants::fgkNPlates*gRandom->Rndm())+1; + iplate=(Int_t) (AliTOFGeometry::NPlates()*gRandom->Rndm())+1; } while (iplate==3); } else { - iplate=(Int_t) (AliTOFConstants::fgkNPlates*gRandom->Rndm())+1; + iplate=(Int_t) (AliTOFGeometry::NPlates()*gRandom->Rndm())+1; } } else { iplate=0; @@ -2028,12 +2028,12 @@ void AliTOFReconstructioner::AddNoiseFromOuter(Option_t *option, Int_t ***MapPix istrip=(Int_t)((zNoise-zLen[iplate-1])/((zLen[iplate]-zLen[iplate-1])/zStrips[iplate-1])); //the strip number in the plate istrip++; - ipadAlongX = (Int_t)(AliTOFConstants::fgkNpadX*gRandom->Rndm())+1; - ipadAlongZ = (Int_t)(AliTOFConstants::fgkNpadZ*gRandom->Rndm())+1; - ipad=(Int_t)(ipadAlongZ-1)*AliTOFConstants::fgkNpadX+ipadAlongX; //the pad number + ipadAlongX = (Int_t)(AliTOFGeometry::NpadX()*gRandom->Rndm())+1; + ipadAlongZ = (Int_t)(AliTOFGeometry::NpadZ()*gRandom->Rndm())+1; + ipad=(Int_t)(ipadAlongZ-1)*AliTOFGeometry::NpadX()+ipadAlongX; //the pad number - Float_t xStrip=(ipadAlongX-1)*AliTOFConstants::fgkXPad+AliTOFConstants::fgkXPad*gRandom->Rndm()-0.5*AliTOFConstants::fgkNpadX*AliTOFConstants::fgkXPad;//x-coor.in the strip frame - Float_t zStrip=(ipadAlongZ-1)*AliTOFConstants::fgkZPad+AliTOFConstants::fgkZPad*gRandom->Rndm()-0.5*AliTOFConstants::fgkNpadZ*AliTOFConstants::fgkZPad;//z-coor.in the strip frame + Float_t xStrip=(ipadAlongX-1)*AliTOFGeometry::XPad()+AliTOFGeometry::XPad()*gRandom->Rndm()-0.5*AliTOFGeometry::NpadX()*AliTOFGeometry::XPad();//x-coor.in the strip frame + Float_t zStrip=(ipadAlongZ-1)*AliTOFGeometry::ZPad()+AliTOFGeometry::ZPad()*gRandom->Rndm()-0.5*AliTOFGeometry::NpadZ()*AliTOFGeometry::ZPad();//z-coor.in the strip frame Int_t nPlace[4]={0,0,0,0}; nPlace[0]=ipad; @@ -2062,12 +2062,12 @@ void AliTOFReconstructioner::AddNoiseFromOuter(Option_t *option, Int_t ***MapPix ipad = nPlace[indexOfPad]; - Int_t iMapValue=MapPixels[AliTOFConstants::fgkNSectors*(iplate-1)+isector-1][istrip-1][ipad-1]; + Int_t iMapValue=MapPixels[AliTOFGeometry::NSectors()*(iplate-1)+isector-1][istrip-1][ipad-1]; if(iMapValue==0) { ipixel++; if(indexOfPad) nPixEdge++; - MapPixels[AliTOFConstants::fgkNSectors*(iplate-1)+isector-1][istrip-1][ipad-1]=ipixel; + MapPixels[AliTOFGeometry::NSectors()*(iplate-1)+isector-1][istrip-1][ipad-1]=ipixel; pixelArray[ipixel-1].SetGeom(isector,iplate,istrip,ipad); pixelArray[ipixel-1].AddState(1); pixelArray[ipixel-1].SetRealTime(tofAfterSimul[indexOfPad]); @@ -2116,7 +2116,7 @@ void AliTOFReconstructioner::AddNoiseFromOuter(Option_t *option, Int_t ***MapPix Float_t occupancy; // numberOfPads for AliTOFV4 (Full coverage) // - to be upgraded checking the used TOF version - - Float_t numberOfPads=AliTOFConstants::fgkPadXSector*AliTOFConstants::fgkNSectors; + Float_t numberOfPads=AliTOFGeometry::NPadXSector()*AliTOFGeometry::NSectors(); occupancy=100.*ipixel/numberOfPads; // percentage of fired pads printf(" Overall TOF occupancy (percentage of fired pads after adding noise) = %f\n",occupancy); delete [] zLen; @@ -2607,7 +2607,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit coslam=gpt/gp; sinlam=gpz/gp; // helixRadius=100.*gpt/TMath::Abs(0.299792458*chargeField); - helixRadius=100.*gpt/TMath::Abs(AliTOFConstants::fgkSpeedOfLight*chargeField); + helixRadius=100.*gpt/TMath::Abs(AliTOFGeometry::SpeedOfLight()*chargeField); xHelixCenter=x-helixRadius*TMath::Cos(phi0); yHelixCenter=y-helixRadius*TMath::Sin(phi0); zHelixCenter=z; @@ -2616,7 +2616,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit // Solves the equation f(s)=r(s)-RTOFINNER=0 by the Newton's method: // snew=s-f/f' istep=0; - s=AliTOFConstants::fgkrmin-TMath::Sqrt(x*x+y*y);; + s=AliTOFGeometry::Rmin()-TMath::Sqrt(x*x+y*y);; do { istep++; xRespectToHelixCenter=helixRadius*TMath::Cos(phi0+s*helixFactor); @@ -2624,7 +2624,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit gx=xHelixCenter+xRespectToHelixCenter; gy=yHelixCenter+yRespectToHelixCenter; gr=TMath::Sqrt(gx*gx+gy*gy); - deltaRadius=gr-AliTOFConstants::fgkrmin; + deltaRadius=gr-AliTOFGeometry::Rmin(); xp=-helixFactor*yRespectToHelixCenter; yp= helixFactor*xRespectToHelixCenter; fp=(gx*xp+gy*yp)/gr; @@ -2679,7 +2679,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit if(cosAngl<0) printf(" cosAngl<0: gx=%f,gy=%f, gxLast=%f,gyLast=%f,gzLast=%f\n",gx,gy,gxLast,gyLast,gzLast); area /= cosAngl; - TestTracks=(Int_t) (2*area/(AliTOFConstants::fgkXPad * AliTOFConstants::fgkZPad)); + TestTracks=(Int_t) (2*area/(AliTOFGeometry::XPad() * AliTOFGeometry::ZPad())); if(TestTracks<12) TestTracks=12; @@ -2706,9 +2706,9 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit iwork2=npixel[1]; iwork3=npixel[2]; // iwork4=npixel[3]; - iwork4=(npixel[3]-1)*AliTOFConstants::fgkNpadX+npixel[4]; + iwork4=(npixel[3]-1)*AliTOFGeometry::NpadX()+npixel[4]; - Int_t ifirstindex=AliTOFConstants::fgkNSectors*(npixel[1]-1)+npixel[0]; + Int_t ifirstindex=AliTOFGeometry::NSectors()*(npixel[1]-1)+npixel[0]; iMapValue=mapPixels[ifirstindex-1][iwork3-1][iwork4-1]; if(iMapValue==0) { ipixel++; @@ -2763,7 +2763,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit gyLast=gy; gzLast=gz; - } while(rho0) { @@ -2772,7 +2772,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit istep=-3; // holes in TOF } } else { - if(TMath::Abs(gz) TOF Sector range [1-18] // volumeID[1] -> TOF Plate range [1- 5] // volumeID[2] -> TOF Strip max range [1-20] @@ -709,7 +709,7 @@ void AliTOFReconstructionerV2::IsInsideThePad(Float_t x, Float_t y, Float_t z, I char name[5]; name[4]=0; - for (i=0; iAt(i)) < tdcwindow) { sameTime = i; @@ -201,7 +202,7 @@ void AliTOFSDigit::Update(AliTOFSDigit* sdig) Int_t sameTime = -1; - Float_t tdcwindow=((Float_t)AliTOFConstants::fgkTimeDiff)/tdcbin; + Float_t tdcwindow=((Float_t)AliTOFGeometry::TimeDiff())/tdcbin; for (Int_t i = 0; i < fNDigits; i++) { if (TMath::Abs(tdc-fTdc->At(i)) < tdcwindow) { sameTime = i; @@ -261,24 +262,24 @@ Int_t AliTOFSDigit::GetTotPad() const // starting from the digits data. // - Int_t pad = fPadx+AliTOFConstants::fgkNpadX*(fPadz-1); + Int_t pad = fPadx+AliTOFGeometry::NpadX()*(fPadz-1); Int_t before=0; switch(fPlate){ case 1: before = 0; break; - case 2: before = AliTOFConstants::fgkNStripC; + case 2: before = AliTOFGeometry::NStripC(); break; - case 3: before = AliTOFConstants::fgkNStripB + AliTOFConstants::fgkNStripC; + case 3: before = AliTOFGeometry::NStripB() + AliTOFGeometry::NStripC(); break; - case 4: before = AliTOFConstants::fgkNStripA + AliTOFConstants::fgkNStripB + AliTOFConstants::fgkNStripC; + case 4: before = AliTOFGeometry::NStripA() + AliTOFGeometry::NStripB() + AliTOFGeometry::NStripC(); break; - case 5: before = AliTOFConstants::fgkNStripA + 2*AliTOFConstants::fgkNStripB + AliTOFConstants::fgkNStripC; + case 5: before = AliTOFGeometry::NStripA() + 2*AliTOFGeometry::NStripB() + AliTOFGeometry::NStripC(); break; } Int_t strip = fStrip+before; - Int_t padTot = AliTOFConstants::fgkPadXStrip*(strip-1)+pad; + Int_t padTot = AliTOFGeometry::NpadX()*AliTOFGeometry::NpadZ()*(strip-1)+pad; return padTot; } diff --git a/TOF/AliTOFSDigitizer.cxx b/TOF/AliTOFSDigitizer.cxx index 4ab01871cd8..034a2357b8c 100644 --- a/TOF/AliTOFSDigitizer.cxx +++ b/TOF/AliTOFSDigitizer.cxx @@ -44,7 +44,7 @@ #include "AliRun.h" #include "AliRunLoader.h" #include "AliTOF.h" -#include "AliTOFConstants.h" +#include "AliTOFGeometry.h" #include "AliTOFHitMap.h" #include "AliTOFSDigit.h" #include "AliTOFSDigitizer.h" @@ -338,8 +338,8 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { nselectedHitsinEv++; if (particle->GetFirstMother() < 0) nHitsFromPrim++; // counts hits due to primary particles - Float_t xStrip=AliTOFConstants::fgkXPad*(vol[3]+0.5-0.5*AliTOFConstants::fgkNpadX)+Xpad; - Float_t zStrip=AliTOFConstants::fgkZPad*(vol[4]+0.5-0.5*AliTOFConstants::fgkNpadZ)+Zpad; + Float_t xStrip=AliTOFGeometry::XPad()*(vol[3]+0.5-0.5*AliTOFGeometry::NpadX())+Xpad; + Float_t zStrip=AliTOFGeometry::ZPad()*(vol[4]+0.5-0.5*AliTOFGeometry::NpadZ())+Zpad; Int_t nActivatedPads = 0, nFiredPads = 0; Bool_t isFired[4] = {kFALSE, kFALSE, kFALSE, kFALSE}; @@ -362,8 +362,8 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { // recalculate the volume only for neighbouring pads if(indexOfPad){ - (nPlace[indexOfPad]<=AliTOFConstants::fgkNpadX) ? vol[4] = 0 : vol[4] = 1; - (nPlace[indexOfPad]<=AliTOFConstants::fgkNpadX) ? vol[3] = nPlace[indexOfPad] - 1 : vol[3] = nPlace[indexOfPad] - AliTOFConstants::fgkNpadX - 1; + (nPlace[indexOfPad]<=AliTOFGeometry::NpadX()) ? vol[4] = 0 : vol[4] = 1; + (nPlace[indexOfPad]<=AliTOFGeometry::NpadX()) ? vol[3] = nPlace[indexOfPad] - 1 : vol[3] = nPlace[indexOfPad] - AliTOFGeometry::NpadX() - 1; } // check if two sdigit are on the same pad; // in that case we sum the two or more sdigits @@ -465,11 +465,11 @@ void AliTOFSDigitizer::Print(Option_t* /*opt*/)const //__________________________________________________________________ void AliTOFSDigitizer::SelectSectorAndPlate(Int_t sector, Int_t plate) { - Bool_t isaWrongSelection=(sector < 0) || (sector >= AliTOFConstants::fgkNSectors) || (plate < 0) || (plate >= AliTOFConstants::fgkNPlates); + Bool_t isaWrongSelection=(sector < 0) || (sector >= AliTOFGeometry::NSectors()) || (plate < 0) || (plate >= AliTOFGeometry::NPlates()); if(isaWrongSelection){ cout << "You have selected an invalid value for sector or plate " << endl; - cout << "The correct range for sector is [0,"<< AliTOFConstants::fgkNSectors-1 <<"]\n"; - cout << "The correct range for plate is [0,"<< AliTOFConstants::fgkNPlates-1 <<"]\n"; + cout << "The correct range for sector is [0,"<< AliTOFGeometry::NSectors()-1 <<"]\n"; + cout << "The correct range for plate is [0,"<< AliTOFGeometry::NPlates()-1 <<"]\n"; cout << "By default we continue sdigitizing all hits in all plates of all sectors \n"; } else { fSelectedSector=sector; @@ -510,7 +510,7 @@ void AliTOFSDigitizer::SimulateDetectorResponse(Float_t z0, Float_t x0, Float_t // qCenterPad - charge extimated for each pad, arb. units // weightsSum - sum of weights extimated for each pad fired, arb. units - const Float_t kSigmaForTail[2] = {AliTOFConstants::fgkSigmaForTail1,AliTOFConstants::fgkSigmaForTail2}; //for tail + const Float_t kSigmaForTail[2] = {AliTOFGeometry::SigmaForTail1(),AliTOFGeometry::SigmaForTail2()}; //for tail Int_t iz = 0, ix = 0; Float_t dX = 0., dZ = 0., x = 0., z = 0.; Float_t h = fHparameter, h2 = fH2parameter, k = fKparameter, k2 = fK2parameter; @@ -530,17 +530,17 @@ void AliTOFSDigitizer::SimulateDetectorResponse(Float_t z0, Float_t x0, Float_t nFiredPads = 0; (z0 <= 0) ? iz = 0 : iz = 1; - dZ = z0 + (0.5 * AliTOFConstants::fgkNpadZ - iz - 0.5) * AliTOFConstants::fgkZPad; // hit position in the pad frame, (0,0) - center of the pad - z = 0.5 * AliTOFConstants::fgkZPad - TMath::Abs(dZ); // variable for eff., res. and timeWalk. functions - iz++; // z row: 1, ..., AliTOFConstants::fgkNpadZ = 2 - ix = (Int_t)((x0 + 0.5 * AliTOFConstants::fgkNpadX * AliTOFConstants::fgkXPad) / AliTOFConstants::fgkXPad); - dX = x0 + (0.5 * AliTOFConstants::fgkNpadX - ix - 0.5) * AliTOFConstants::fgkXPad; // hit position in the pad frame, (0,0) - center of the pad - x = 0.5 * AliTOFConstants::fgkXPad - TMath::Abs(dX); // variable for eff., res. and timeWalk. functions; - ix++; // x row: 1, ..., AliTOFConstants::fgkNpadX = 48 + dZ = z0 + (0.5 * AliTOFGeometry::NpadZ() - iz - 0.5) * AliTOFGeometry::ZPad(); // hit position in the pad frame, (0,0) - center of the pad + z = 0.5 * AliTOFGeometry::ZPad() - TMath::Abs(dZ); // variable for eff., res. and timeWalk. functions + iz++; // z row: 1, ..., AliTOFGeometry::NpadZ = 2 + ix = (Int_t)((x0 + 0.5 * AliTOFGeometry::NpadX() * AliTOFGeometry::XPad()) / AliTOFGeometry::XPad()); + dX = x0 + (0.5 * AliTOFGeometry::NpadX() - ix - 0.5) * AliTOFGeometry::XPad(); // hit position in the pad frame, (0,0) - center of the pad + x = 0.5 * AliTOFGeometry::XPad() - TMath::Abs(dX); // variable for eff., res. and timeWalk. functions; + ix++; // x row: 1, ..., AliTOFGeometry::NpadX = 48 ////// Pad A: nActivatedPads++; - nPlace[nActivatedPads-1] = (iz - 1) * AliTOFConstants::fgkNpadX + ix; + nPlace[nActivatedPads-1] = (iz - 1) * AliTOFGeometry::NpadX() + ix; qInduced[nActivatedPads-1] = qCenterPad; padId[nActivatedPads-1] = 1; @@ -602,7 +602,7 @@ void AliTOFSDigitizer::SimulateDetectorResponse(Float_t z0, Float_t x0, Float_t if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX(); eff[nActivatedPads-1] = effZ; res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ; // ns @@ -654,7 +654,7 @@ void AliTOFSDigitizer::SimulateDetectorResponse(Float_t z0, Float_t x0, Float_t if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX - 1; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() - 1; eff[nActivatedPads-1] = effX * effZ; (resZ 0) { + if(ix < AliTOFGeometry::NpadX() && dX > 0) { nActivatedPads++; nPlace[nActivatedPads-1] = nPlace[0] + 1; eff[nActivatedPads-1] = effX; @@ -705,7 +705,7 @@ void AliTOFSDigitizer::SimulateDetectorResponse(Float_t z0, Float_t x0, Float_t if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX + 1; + nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() + 1; eff[nActivatedPads - 1] = effX * effZ; (resZ -#include "../STRUCT/AliBODY.h" -#include "../STRUCT/AliFRAMEv2.h" +#include // For DtoM and InitGeo, should +#include "../STRUCT/AliBODY.h" // be removed after we switch to +#include "../STRUCT/AliFRAMEv2.h" // AliTOGeometry::GetPos #include "AliTOFv2FHoles.h" -#include "AliTOFConstants.h" #include -class TVirtualMC; -extern TVirtualMC *gMC; ClassImp(AliTOFpidESD) +//_________________________________________________________________________ static Int_t InitGeo() { //gSystem->Load("libgeant321"); //new TGeant3("C++ Interface to Geant3"); @@ -59,21 +57,6 @@ static Int_t InitGeo() { } //_________________________________________________________________________ -AliTOFpidESD::AliTOFpidESD(Double_t *param) throw (const Char_t *) { - // - // The main constructor - // - if (InitGeo()) throw "AliTOFpidESD: can not initialize the geometry !\n"; - - fR=378.; - fDy=AliTOFConstants::fgkXPad; fDz=AliTOFConstants::fgkZPad; - fN=0; fEventN=0; - - fSigma=param[0]; - fRange=param[1]; - -} - static Int_t DtoM(Int_t *dig, Float_t *g) { const Int_t kMAX=13; Int_t lnam[kMAX],lnum[kMAX]; @@ -85,29 +68,29 @@ static Int_t DtoM(Int_t *dig, Float_t *g) { strncpy((Char_t*)(lnam+1),"B077",4); lnum[1]=1; //4 padx if z<=0 then ... -if ((dig[1]==4)||(dig[1]==3)) dig[4]=AliTOFConstants::fgkNpadX-dig[4]; +if ((dig[1]==4)||(dig[1]==3)) dig[4]=AliTOFGeometry::NpadX()-dig[4]; else if (dig[1]==2) { - if (dig[2]>7) dig[4]=AliTOFConstants::fgkNpadX-dig[4]; + if (dig[2]>7) dig[4]=AliTOFGeometry::NpadX()-dig[4]; else if (dig[2]==7) { - if (dig[3]==1) dig[4]=AliTOFConstants::fgkNpadX-dig[4]; + if (dig[3]==1) dig[4]=AliTOFGeometry::NpadX()-dig[4]; else dig[4]+=1; } else dig[4]+=1; } else dig[4]+=1; //3 padz -if ((dig[1]==3)||(dig[1]==4)) dig[3]=AliTOFConstants::fgkNpadZ-dig[3]; +if ((dig[1]==3)||(dig[1]==4)) dig[3]=AliTOFGeometry::NpadZ()-dig[3]; else dig[3]+=1; //2 strip -if (dig[1]==0) dig[2]=AliTOFConstants::fgkNStripC-dig[2]; -else if (dig[1]==1) dig[2]=AliTOFConstants::fgkNStripB-dig[2]; +if (dig[1]==0) dig[2]=AliTOFGeometry::NStripC()-dig[2]; +else if (dig[1]==1) dig[2]=AliTOFGeometry::NStripB()-dig[2]; else dig[2]+=1; //1 module -dig[1]=AliTOFConstants::fgkNPlates-dig[1]; +dig[1]=AliTOFGeometry::NPlates()-dig[1]; //0 sector -dig[0]+=(AliTOFConstants::fgkNSectors/2); dig[0]%=AliTOFConstants::fgkNSectors; +dig[0]+=(AliTOFGeometry::NSectors()/2); dig[0]%=AliTOFGeometry::NSectors(); dig[0]+=1; //sector @@ -261,10 +244,37 @@ dig[0]+=1; return 0; } + +//_________________________________________________________________________ +AliTOFpidESD::AliTOFpidESD(Double_t *param) throw (const Char_t *) { + // + // The main constructor + // + if (InitGeo()) throw "AliTOFpidESD: can not initialize the geometry !\n"; + + + if (fTOFGeometry) delete fTOFGeometry; + fTOFGeometry = new AliTOFGeometry(); + + fR=378.; + fDy=fTOFGeometry->XPad(); fDz=fTOFGeometry->ZPad(); + fN=0; fEventN=0; + + fSigma=param[0]; + fRange=param[1]; + +} + + +//_________________________________________________________________________ + +//_________________________________________________________________________ Int_t AliTOFpidESD::LoadClusters(const TFile *df) { + //-------------------------------------------------------------------- //This function loads the TOF clusters //-------------------------------------------------------------------- + if (!((TFile *)df)->IsOpen()) { Error("LoadClusters","file with the TOF digits has not been open !\n"); return 1; @@ -299,6 +309,7 @@ Int_t AliTOFpidESD::LoadClusters(const TFile *df) { dig[3]=d->GetPadz(); dig[4]=d->GetPadx(); + // fTOFGeometry->GetPos(dig,g); // uncomment this DtoM(dig,g); Double_t h[5]; @@ -314,6 +325,7 @@ Int_t AliTOFpidESD::LoadClusters(const TFile *df) { return 0; } +//_________________________________________________________________________ Int_t AliTOFpidESD::LoadClusters(TTree *dTree) { //-------------------------------------------------------------------- //This function loads the TOF clusters @@ -340,6 +352,7 @@ Int_t AliTOFpidESD::LoadClusters(TTree *dTree) { dig[3]=d->GetPadz(); dig[4]=d->GetPadx(); + //fTOFGeometry->GetPos(dig,g); DtoM(dig,g); Double_t h[5]; @@ -354,6 +367,7 @@ Int_t AliTOFpidESD::LoadClusters(TTree *dTree) { return 0; } +//_________________________________________________________________________ void AliTOFpidESD::UnloadClusters() { //-------------------------------------------------------------------- //This function unloads TOF clusters @@ -362,6 +376,7 @@ void AliTOFpidESD::UnloadClusters() { fN=0; } +//_________________________________________________________________________ Int_t AliTOFpidESD::InsertCluster(AliTOFcluster *c) { //-------------------------------------------------------------------- //This function adds a cluster to the array of clusters sorted in Z @@ -379,6 +394,7 @@ Int_t AliTOFpidESD::InsertCluster(AliTOFcluster *c) { return 0; } +//_________________________________________________________________________ Int_t AliTOFpidESD::FindClusterIndex(Double_t z) const { //-------------------------------------------------------------------- // This function returns the index of the nearest cluster @@ -517,3 +533,4 @@ Double_t dz=5*TMath::Sqrt(cov[2]) + 0.5*fDz + 2.5*TMath::Abs(par[3]); return 0; } + diff --git a/TOF/AliTOFpidESD.h b/TOF/AliTOFpidESD.h index c4c300bb2dc..79f90f898f1 100644 --- a/TOF/AliTOFpidESD.h +++ b/TOF/AliTOFpidESD.h @@ -10,6 +10,7 @@ //------------------------------------------------------- #include +#include "AliTOFGeometry.h" class AliESD; class TFile; @@ -74,6 +75,8 @@ private: Int_t fN; // number of the TOF clusters AliTOFcluster *fClusters[kMaxCluster]; // pointers to the TOF clusters + AliTOFGeometry *fTOFGeometry; //The TOF Geometry + ClassDef(AliTOFpidESD,1) // TOF PID class }; diff --git a/TOF/AliTOFv4T0.cxx b/TOF/AliTOFv4T0.cxx index 04155d65204..7908962aafc 100644 --- a/TOF/AliTOFv4T0.cxx +++ b/TOF/AliTOFv4T0.cxx @@ -22,7 +22,7 @@ // // // VERSION WITH 5 MODULES AND TILTED STRIPS // // // -// FULL COVERAGE VERSION // +// FULL COVERAGE VERSION +OPTION for PHOS holes // // // // Author: // // Fabrizio Pierella // @@ -51,7 +51,6 @@ #include "AliConst.h" #include "AliRun.h" #include "AliTOFv4T0.h" -#include "AliTOFConstants.h" // AdC #include "AliMC.h" ClassImp(AliTOFv4T0) @@ -74,20 +73,29 @@ AliTOFv4T0::AliTOFv4T0(const char *name, const char *title) // // 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;} + } +} +//____________________________________________________________________________ void AliTOFv4T0::BuildGeometry() { // @@ -191,6 +199,7 @@ void AliTOFv4T0::CreateGeometry() AliTOF::CreateGeometry(); } + //_____________________________________________________________________________ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, Float_t zlenB, Float_t zlenA, Float_t ztof0) @@ -199,14 +208,14 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // 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 + par[0] = xtof * 0.5; par[1] = ytof * 0.5; @@ -226,6 +235,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, 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"); @@ -241,9 +251,10 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, 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 xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC; @@ -281,7 +292,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ///// 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; @@ -306,7 +317,6 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, //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 Float_t zSenStrip = fZpad*fNpadZ;//cm Float_t stripWidth = zSenStrip + 2*kdeadBound; @@ -337,12 +347,12 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, 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 + // 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; @@ -356,6 +366,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, 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 @@ -368,6 +379,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, //-- MYLAR Layer definition + parfp[1] = khmyly*0.5; gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3); // positioning 2 MYLAR Layers on FSTR volume @@ -381,6 +393,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, //-- Graphite Layer definition + parfp[1] = khgraphy*0.5; gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3); // positioning 2 Graphite Layers on FSTR volume @@ -394,6 +407,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, //-- 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 @@ -407,6 +421,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, //-- Sensitive Mixture Layer definition + parfp[0] = klsensmx*0.5; parfp[1] = khsensmy*0.5; parfp[2] = kwsensmz*0.5; @@ -420,10 +435,12 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, 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[1] = khsensmy*0.5; parfp[2] = kwpadz*0.5; @@ -431,186 +448,55 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // 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 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.); - Int_t centerLoc= (Int_t)(fNStripA/2.) + 1; // AdC + ///////////////////Positioning A module////////////////////////// - //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++; // AdC - 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.); + + 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; - 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"); - 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 + Float_t zpos = tan(ang)*radius; + Float_t ypos= fTOFGeometry->GetHeights(2,istrip); + gMC->Gspos("FSTR",fNStripA-istrip,"FLTA",0.,ypos, zpos,idrotm[0], "ONLY"); 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); + printf("y = %f, z = %f, , z coord = %f, Rot ang = %f, St. %2i \n",ypos,zpos,tan(ang)*radius ,ang*kRaddeg,istrip); } - j++; //j += 2; // AdC - 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"); - 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; - Int_t i=1; // AdC - 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.); - 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"); - 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); - } - 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 @@ -631,6 +517,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // 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 @@ -646,6 +533,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, 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) @@ -667,6 +555,8 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // card volume definition // see GEOM200 in GEANT manual + + AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg Float_t cardpar[3]; @@ -687,7 +577,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, 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"); @@ -699,7 +589,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // 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"); @@ -710,7 +600,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // 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"); @@ -718,6 +608,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, } // tube volume definition + Float_t tubepar[3]; tubepar[0]= 0.; tubepar[1]= 0.4; @@ -740,7 +631,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, 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"); @@ -749,7 +640,7 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // 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"); @@ -757,14 +648,13 @@ void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // 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 { @@ -1042,9 +932,11 @@ void AliTOFv4T0::Init() //_____________________________________________________________________________ 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; @@ -1053,7 +945,7 @@ void AliTOFv4T0::StepManager() 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) @@ -1062,6 +954,7 @@ void AliTOFv4T0::StepManager() padzid=gMC->CurrentVolOffID(2,copy); padz=copy; + padxid=gMC->CurrentVolOffID(1,copy); padx=copy; @@ -1072,10 +965,13 @@ void AliTOFv4T0::StepManager() 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(); @@ -1089,9 +985,11 @@ void AliTOFv4T0::StepManager() incidenceAngle = TMath::ACos(ppad[1])*kRaddeg; + z = pos[2]; - plate = 0; + plate = -1; + if (TMath::Abs(z) <= fZlenA*0.5) plate = 2; //3; // AdC if (z < (fZlenA*0.5+fZlenB) && z > fZlenA*0.5) plate = 1; //4; // AdC @@ -1100,21 +998,31 @@ void AliTOFv4T0::StepManager() 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 + + if (plate==0) strip=fTOFGeometry->NStripC()-strip; // AdC + else if (plate==1) strip=fTOFGeometry->NStripB()-strip; // AdC else strip--; // AdC + + //Apply ALICE conventions for volume numbering increasing with theta, phi + + if (plate==3 || plate==4){ + padx=fTOFGeometry->NpadX()-padx; // SA + padz=fTOFGeometry->NpadZ()-padz; // AdC + xpad[0]=-xpad[0]; + xpad[2]=-xpad[2]; + } + else { + padx--; // AdC + padz--; // 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(); if (phi>=0.) phid = phi*kRaddeg; //+180.; // AdC else phid = phi*kRaddeg + 360.; // AdC + sector = Int_t (phid/20.); - //sector++; // AdC for(i=0;i<3;++i) { hits[i] = pos[i]; @@ -1134,8 +1042,8 @@ void AliTOFv4T0::StepManager() vol[1]= plate; vol[2]= strip; vol[3]= padx; - vol[4]= padz; - + vol[4]= padz; + AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits); } } diff --git a/TOF/AliTOFv4T0.h b/TOF/AliTOFv4T0.h index 7194403a0a8..7382643d414 100644 --- a/TOF/AliTOFv4T0.h +++ b/TOF/AliTOFv4T0.h @@ -17,7 +17,9 @@ class AliTOFv4T0 : public AliTOF { public: AliTOFv4T0(); AliTOFv4T0(const char *name, const char *title); - virtual ~AliTOFv4T0() {} + virtual ~AliTOFv4T0() { if (fTOFGeometry) {delete fTOFGeometry; + fTOFGeometry = 0; } +} virtual void BuildGeometry(); virtual void CreateGeometry(); virtual void CreateMaterials(); @@ -29,9 +31,7 @@ public: virtual void DrawModule() const; virtual void DrawDetectorModules(); virtual void DrawDetectorStrips(); -// virtual void DrawDetectorModulesinFrame(); -// virtual void DrawDetectorStripsinFrame(); - + private: Int_t fIdFTOA; // FTOA volume identifier (outer plate A) Int_t fIdFTOB; // FTOB volume identifier (outer plate B) @@ -39,8 +39,9 @@ private: Int_t fIdFLTA; // FLTA volume identifier (inner plate A) Int_t fIdFLTB; // FLTB volume identifier (inner plate B) Int_t fIdFLTC; // FLTC volume identifier (inner plate C) - - ClassDef(AliTOFv4T0,1) //Time Of Flight version 4 + Bool_t fTOFHoles; // Selecting Geometry with and w/o holes + + ClassDef(AliTOFv4T0,1) //Time Of Flight version 4 }; #endif /* ALITOFv4T0_H */ diff --git a/TOF/TOFLinkDef.h b/TOF/TOFLinkDef.h index c492470ba76..36c5402f491 100644 --- a/TOF/TOFLinkDef.h +++ b/TOF/TOFLinkDef.h @@ -12,13 +12,8 @@ #pragma link C++ class AliTOFT0+; #pragma link C++ class AliTOFPID+; #pragma link C++ class AliTOFProb+; -#pragma link C++ class AliTOFv0+; -#pragma link C++ class AliTOFv1+; -#pragma link C++ class AliTOFv2+; -#pragma link C++ class AliTOFv3+; -#pragma link C++ class AliTOFv4+; +#pragma link C++ class AliTOFGeometry+; #pragma link C++ class AliTOFv4T0+; -#pragma link C++ class AliTOFv2FHoles+; #pragma link C++ class AliTOFhit+; #pragma link C++ class AliTOFhitT0+; @@ -32,7 +27,6 @@ #pragma link C++ class AliTOFMerger+; #pragma link C++ class AliTOFSDigit+; #pragma link C++ class AliTOFHitMap+; -#pragma link C++ class AliTOFConstants+; #pragma link C++ class AliTOFPad+; #pragma link C++ class AliTOFTrack+; #pragma link C++ class AliTOFRecHit+; diff --git a/TOF/libTOF.pkg b/TOF/libTOF.pkg index 7f71fe123f2..4016aebab43 100644 --- a/TOF/libTOF.pkg +++ b/TOF/libTOF.pkg @@ -1,4 +1,9 @@ -SRCS = AliTOF.cxx AliTOFv0.cxx AliTOFv1.cxx AliTOFv2.cxx AliTOFv3.cxx AliTOFv4.cxx AliTOFv4T0.cxx AliTOFhit.cxx AliTOFhitT0.cxx AliTOFPID.cxx AliTOFT0.cxx AliTOFdigit.cxx AliTOFRawSector.cxx AliTOFRoc.cxx AliTOFRawDigit.cxx AliTOFDigitizer.cxx AliTOFSDigitizer.cxx AliTOFMerger.cxx AliTOFv2FHoles.cxx AliTOFSDigit.cxx AliTOFHitMap.cxx AliTOFConstants.cxx AliTOFPad.cxx AliTOFRecHit.cxx AliTOFTrack.cxx AliTOFReconstructioner.cxx AliTOFProb.cxx AliTOFTrackV2.cxx AliTOFReconstructionerV2.cxx AliTOFDigitMap.cxx AliTOFpidESD.cxx +SRCS = AliTOF.cxx AliTOFGeometry.cxx AliTOFv4T0.cxx AliTOFhit.cxx AliTOFhitT0.cxx \ + AliTOFPID.cxx AliTOFT0.cxx AliTOFdigit.cxx AliTOFRawSector.cxx AliTOFRoc.cxx \ + AliTOFRawDigit.cxx AliTOFDigitizer.cxx AliTOFSDigitizer.cxx AliTOFMerger.cxx \ + AliTOFSDigit.cxx AliTOFHitMap.cxx AliTOFPad.cxx AliTOFRecHit.cxx AliTOFTrack.cxx \ + AliTOFReconstructioner.cxx AliTOFProb.cxx AliTOFTrackV2.cxx AliTOFReconstructionerV2.cxx \ + AliTOFDigitMap.cxx AliTOFpidESD.cxx HDRS:= $(SRCS:.cxx=.h) -- 2.39.3