fName="TOF";
fMerger = 0x0;
fTZero = kFALSE;
+ fTOFGeometry = 0;
}
//_____________________________________________________________________________
fReTask= 0x0;
fReconParticles= 0x0;
fMerger = 0x0;
+ fTOFGeometry = 0;
if (strstr(option,"tzero")){
fHits = new TClonesArray("AliTOFhitT0", 1000);
#include <Riostream.h>
#include "AliTOFMerger.h"
#include "AliTOFSDigitizer.h"
+#include "AliTOFGeometry.h"
class AliTOF : public AliDetector {
TClonesArray *ReconParticles() const {return fReconParticles;}
void RecreateSDigitsArray();
void CreateSDigitsArray();
+ AliTOFGeometry *GetGeometry() const { return fTOFGeometry; };
Int_t fNevents ; // Number of events to digitize
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
#include "AliTOFDigitMap.h"
#include "AliTOFdigit.h"
-#include "AliTOFConstants.h"
+#include "AliTOFGeometry.h"
#include <TClonesArray.h>
// 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;
#include "AliHitMap.h"
#include "TObject.h"
+#include "AliTOFGeometry.h"
class TClonesArray;
class AliTOFDigitMap : public TObject
--- /dev/null
+/**************************************************************************
+ * 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 <stdlib.h>
+#include <Riostream.h>
+///////////////////////////////////////////////////////////////////////////////
+// //
+// 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<fgkNPlates; i++){
+ if ( GetMaxPlateTheta(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<nstrips; istrip++){
+
+ if(
+ GetMaxStripTheta(iplate,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;
+}
+
+
+
--- /dev/null
+#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 <Theta>
+
+ 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
#include "AliTOFHitMap.h"
#include "AliTOFSDigit.h"
-#include "AliTOFConstants.h"
+#include "AliTOFGeometry.h"
#include <TClonesArray.h>
// 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;
#include "AliHitMap.h"
#include "TObject.h"
+
class TClonesArray;
class AliTOFHitMap : public TObject
#include "TLeaf.h"
#include "AliConst.h"
-#include "AliTOFConstants.h"
+#include "AliTOFGeometry.h"
#include "AliTOFPID.h"
#include <stdlib.h>
fNtuple = 0;
fgen = 0;
foutfileName = 0;
+
}
//____________________________________________________________________________
// add Task to //root/Tasks folder
TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ;
roottasks->Add(this) ;
+
}
//____________________________________________________________________________
void AliTOFPID::Init(const Option_t* opt)
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;
}
#include "TLeaf.h"
#include "AliConst.h"
-#include "AliTOFConstants.h"
#include "AliTOFProb.h"
#include <stdlib.h>
#include <TVirtualMC.h>
#include "AliConst.h"
+#include "AliTOFGeometry.h"
#include "AliDetector.h"
#include "AliHeader.h"
#include "AliLoader.h"
#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliTOF.h"
-#include "AliTOFConstants.h"
#include "AliTOFHitMap.h"
#include "AliTOFPad.h"
#include "AliTOFRecHit.h"
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<AliTOFConstants::fgkNSectors*AliTOFConstants::fgkNPlates; i++) mapPixels[i] = new Int_t*[AliTOFConstants::fgkNStripC];
- for (Int_t i=0; i<AliTOFConstants::fgkNSectors*AliTOFConstants::fgkNPlates; i++) {
- for (Int_t j=0; j<AliTOFConstants::fgkNStripC; j++) {
- mapPixels[i][j]= new Int_t[AliTOFConstants::fgkNpadZ*AliTOFConstants::fgkNpadX];
+ Int_t *** mapPixels = new Int_t**[AliTOFGeometry::NSectors()*AliTOFGeometry::NPlates()];
+ for (Int_t i=0; i<AliTOFGeometry::NSectors()*AliTOFGeometry::NPlates(); i++) mapPixels[i] = new Int_t*[AliTOFGeometry::NStripC()];
+ for (Int_t i=0; i<AliTOFGeometry::NSectors()*AliTOFGeometry::NPlates(); i++) {
+ for (Int_t j=0; j<AliTOFGeometry::NStripC(); j++) {
+ mapPixels[i][j]= new Int_t[AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX()];
}
}
// initializing the previous array
- for (Int_t i=0;i<AliTOFConstants::fgkNSectors*AliTOFConstants::fgkNPlates;i++) {
- for (Int_t j=0;j<AliTOFConstants::fgkNStripC;j++) {
- for (Int_t l=0;l<AliTOFConstants::fgkNpadZ*AliTOFConstants::fgkNpadX;l++) {
+ for (Int_t i=0;i<AliTOFGeometry::NSectors()*AliTOFGeometry::NPlates();i++) {
+ for (Int_t j=0;j<AliTOFGeometry::NStripC();j++) {
+ for (Int_t l=0;l<AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX();l++) {
mapPixels[i][j][l]=0;
}
}
delete [] iTrackPt;
delete [] ptTrack;
- for (Int_t i=0; i<AliTOFConstants::fgkNSectors*AliTOFConstants::fgkNPlates; i++) {
- for (Int_t j=0; j<AliTOFConstants::fgkNStripC; j++) {
+ for (Int_t i=0; i<AliTOFGeometry::NSectors()*AliTOFGeometry::NPlates(); i++) {
+ for (Int_t j=0; j<AliTOFGeometry::NStripC(); j++) {
delete [] mapPixels[i][j];
}
}
- for (Int_t i=0; i<AliTOFConstants::fgkNSectors*AliTOFConstants::fgkNPlates; i++) delete [] mapPixels[i];
+ for (Int_t i=0; i<AliTOFGeometry::NSectors()*AliTOFGeometry::NPlates(); i++) delete [] mapPixels[i];
delete [] mapPixels;
cout << " Number of events: " << fNevents << endl;
cout << " Recostruction from event "<< fFirstEvent << " to event "<< fLastEvent << endl;
cout << " TOF geometry parameters " << endl;
- cout << " Min. radius of the TOF (cm) "<< AliTOFConstants::fgkrmin << endl;
- cout << " Max. radius of the TOF (cm) "<< AliTOFConstants::fgkrmax << endl;
- cout << " Number of TOF geom. levels "<< AliTOFConstants::fgkmaxtoftree<< endl;
- cout << " Number of TOF sectors "<< AliTOFConstants::fgkNSectors << endl;
- cout << " Number of TOF modules "<< AliTOFConstants::fgkNPlates << endl;
- cout << " Max. Number of strips in a module "<< AliTOFConstants::fgkNStripC << endl;
- cout << " Number of pads per strip "<< AliTOFConstants::fgkNpadX*AliTOFConstants::fgkNpadZ << endl;
- cout << " Number of strips in central module "<< AliTOFConstants::fgkNStripA << endl;
- cout << " Number of strips in intermediate modules "<< AliTOFConstants::fgkNStripB << endl;
- cout << " Number of strips in outer modules "<< AliTOFConstants::fgkNStripC << endl;
- cout << " Number of MRPC in x strip direction "<< AliTOFConstants::fgkNpadX<< endl;
- cout << " Size of MRPC (cm) along X "<< AliTOFConstants::fgkXPad<< endl;
- cout << " Number of MRPC in z strip direction "<< AliTOFConstants::fgkNpadZ<<endl;
- cout << " Size of MRPC (cm) along Z "<< AliTOFConstants::fgkZPad<<endl;
+ cout << " Min. radius of the TOF (cm) "<< AliTOFGeometry::Rmin() << endl;
+ cout << " Max. radius of the TOF (cm) "<< AliTOFGeometry::Rmax() << endl;
+ cout << " Number of TOF geom. levels "<< AliTOFGeometry::MaxTOFTree()<< endl;
+ cout << " Number of TOF sectors "<< AliTOFGeometry::NSectors() << endl;
+ cout << " Number of TOF modules "<< AliTOFGeometry::NPlates() << endl;
+ cout << " Max. Number of strips in a module "<< AliTOFGeometry::NStripC() << endl;
+ cout << " Number of pads per strip "<< AliTOFGeometry::NpadX()*AliTOFGeometry::NpadZ() << endl;
+ cout << " Number of strips in central module "<< AliTOFGeometry::NStripA() << endl;
+ cout << " Number of strips in intermediate modules "<< AliTOFGeometry::NStripB() << endl;
+ cout << " Number of strips in outer modules "<< AliTOFGeometry::NStripC() << endl;
+ cout << " Number of MRPC in x strip direction "<< AliTOFGeometry::NpadX()<< endl;
+ cout << " Size of MRPC (cm) along X "<< AliTOFGeometry::XPad()<< endl;
+ cout << " Number of MRPC in z strip direction "<< AliTOFGeometry::NpadZ()<<endl;
+ cout << " Size of MRPC (cm) along Z "<< AliTOFGeometry::ZPad()<<endl;
cout << " Module Lengths (cm)" << endl;
- cout << " A Module: "<< AliTOFConstants::fgkzlenA<< " B Modules: "<< AliTOFConstants::fgkzlenB<< " C Modules: "<< AliTOFConstants::fgkzlenC<< endl;
- cout << " Inner radius of the TOF detector (cm): "<<AliTOFConstants::fgkrmin << endl;
- cout << " Outer radius of the TOF detector (cm): "<<AliTOFConstants::fgkrmax << endl;
- cout << " Max. half z-size of TOF (cm) : "<<AliTOFConstants::fgkMaxhZtof << endl;
+ cout << " A Module: "<< AliTOFGeometry::ZlenA()<< " B Modules: "<< AliTOFGeometry::ZlenB()<< " C Modules: "<< AliTOFGeometry::ZlenC()<< endl;
+ cout << " Inner radius of the TOF detector (cm): "<<AliTOFGeometry::Rmin() << endl;
+ cout << " Outer radius of the TOF detector (cm): "<<AliTOFGeometry::Rmax() << endl;
+ cout << " Max. half z-size of TOF (cm) : "<<AliTOFGeometry::MaxhZtof() << endl;
cout << " TOF Pad parameters " << endl;
cout << " Time Resolution (ns) "<< fTimeResolution <<" Pad Efficiency: "<< fpadefficiency << endl;
cout << " Edge Effect option: "<< fEdgeEffect<< endl;
char name[5];
name[4]=0;
- for (i=0; i<AliTOFConstants::fgkmaxtoftree; i++) nGeom[i]=0;
+ for (i=0; i<AliTOFGeometry::MaxTOFTree(); i++) nGeom[i]=0;
zPad=100.;
xPad=100.;
// 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;
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;
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
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<resX) ? res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resX * resX) : res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns
(timeWalkZ<timeWalkX) ? timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ : timeWalk[nActivatedPads-1] = 0.001 * timeWalkX; // ns
} // end C
// E:
- if(ix < AliTOFConstants::fgkNpadX && dX > 0) {
+ if(ix < AliTOFGeometry::NpadX() && dX > 0) {
nActivatedPads++;
nPlace[nActivatedPads-1] = nPlace[0] + 1;
eff[nActivatedPads-1] = effX;
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<resX) ? res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resX * resX) : res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns
(timeWalkZ<timeWalkX) ? timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ : timeWalk[nActivatedPads-1] = 0.001*timeWalkX; // ns
// 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;
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;
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
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<resX) ? res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resX * resX) : res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns
(timeWalkZ<timeWalkX) ? timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ : timeWalk[nActivatedPads-1] = 0.001 * timeWalkX; // ns
} // end C
// E:
- if(ix < AliTOFConstants::fgkNpadX && dX > 0) {
+ if(ix < AliTOFGeometry::NpadX() && dX > 0) {
nActivatedPads++;
nPlace[nActivatedPads-1] = nPlace[0] + 1;
eff[nActivatedPads-1] = effX;
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<resX) ? res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resX * resX) : res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns
(timeWalkZ<timeWalkX) ? timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ : timeWalk[nActivatedPads-1] = 0.001*timeWalkX; // ns
TParticle *particle;
Int_t nHitOutofTofVolumes; // number of hits out of TOF GEANT volumes (it happens in very
// few cases)
- Int_t * npixel = new Int_t[AliTOFConstants::fgkmaxtoftree]; // array used by TOFRecon for check on TOF geometry
+ Int_t * npixel = new Int_t[AliTOFGeometry::MaxTOFTree()]; // array used by TOFRecon for check on TOF geometry
Int_t npions=0; // number of pions for the current event
Int_t nkaons=0; // number of kaons for the current event
Int_t nprotons=0; // number of protons for the current event
nHitOutofTofVolumes++;
}
} else {
- Float_t zStrip=AliTOFConstants::fgkZPad*(padz-0.5-0.5*AliTOFConstants::fgkNpadZ)+Zpad;
+ Float_t zStrip=AliTOFGeometry::ZPad()*(padz-0.5-0.5*AliTOFGeometry::NpadZ())+Zpad;
if(padz!=npixel[3]) printf(" : Zpad=%f, padz=%i, npixel[3]=%i, zStrip=%f\n",Zpad,padz,npixel[3],zStrip);
- Float_t xStrip=AliTOFConstants::fgkXPad*(padx-0.5-0.5*AliTOFConstants::fgkNpadX)+Xpad;
+ Float_t xStrip=AliTOFGeometry::XPad()*(padx-0.5-0.5*AliTOFGeometry::NpadX())+Xpad;
Int_t nPlace[4]={0,0,0,0};
- nPlace[0]=(padz-1)*AliTOFConstants::fgkNpadX+padx;
+ nPlace[0]=(padz-1)*AliTOFGeometry::NpadX()+padx;
Int_t nActivatedPads=0;
Int_t nFiredPads=0;
}// close - the hit belongs to a fired pad
- Int_t iMapFirstIndex=AliTOFConstants::fgkNSectors*(npixel[1]-1)+npixel[0]-1;
+ Int_t iMapFirstIndex=AliTOFGeometry::NSectors()*(npixel[1]-1)+npixel[0]-1;
Int_t iMapValue=MapPixels[iMapFirstIndex][npixel[2]-1][nPlace[indexOfPad]-1];
if(iMapValue==0) {
// to parameterized fZNoise distribution (to be used with events
// generated in the barrel region)
- Float_t * zLen = new Float_t[AliTOFConstants::fgkNPlates+1];
- Float_t * zStrips = new Float_t[AliTOFConstants::fgkNPlates];
- zStrips[0]=(Float_t) (AliTOFConstants::fgkNStripC);
- zStrips[1]=(Float_t) (AliTOFConstants::fgkNStripB);
- zStrips[2]=(Float_t) (AliTOFConstants::fgkNStripA);
- zStrips[3]=(Float_t) (AliTOFConstants::fgkNStripB);
- zStrips[4]=(Float_t) (AliTOFConstants::fgkNStripC);
+ Float_t * zLen = new Float_t[AliTOFGeometry::NPlates()+1];
+ Float_t * zStrips = new Float_t[AliTOFGeometry::NPlates()];
+ zStrips[0]=(Float_t) (AliTOFGeometry::NStripC());
+ zStrips[1]=(Float_t) (AliTOFGeometry::NStripB());
+ zStrips[2]=(Float_t) (AliTOFGeometry::NStripA());
+ zStrips[3]=(Float_t) (AliTOFGeometry::NStripB());
+ zStrips[4]=(Float_t) (AliTOFGeometry::NStripC());
- zLen[5]=AliTOFConstants::fgkzlenA*0.5+AliTOFConstants::fgkzlenB+AliTOFConstants::fgkzlenC;
- zLen[4]=zLen[5]-AliTOFConstants::fgkzlenC;
- zLen[3]=zLen[4]-AliTOFConstants::fgkzlenB;
- zLen[2]=zLen[3]-AliTOFConstants::fgkzlenA;
- zLen[1]=zLen[2]-AliTOFConstants::fgkzlenB;
- zLen[0]=zLen[1]-AliTOFConstants::fgkzlenC;
+ zLen[5]=AliTOFGeometry::ZlenA()*0.5+AliTOFGeometry::ZlenB()+AliTOFGeometry::ZlenC();
+ zLen[4]=zLen[5]-AliTOFGeometry::ZlenC();
+ zLen[3]=zLen[4]-AliTOFGeometry::ZlenB();
+ zLen[2]=zLen[3]-AliTOFGeometry::ZlenA();
+ zLen[1]=zLen[2]-AliTOFGeometry::ZlenB();
+ zLen[0]=zLen[1]-AliTOFGeometry::ZlenC();
Int_t isector; // random sector number
TF1 *noiseTof = new TF1("noiseTof","exp(-x/20)",0,100);
if(strstr(option,"pp")){
- fZnoise = new TF1("fZnoise","257.8-0.178*x-0.000457*x*x",-AliTOFConstants::fgkMaxhZtof,AliTOFConstants::fgkMaxhZtof);
+ fZnoise = new TF1("fZnoise","257.8-0.178*x-0.000457*x*x",-AliTOFGeometry::MaxhZtof(),AliTOFGeometry::MaxhZtof());
}
if(strstr(option,"Pb-Pb")){
- fZnoise = new TF1("fZnoise","182.2-0.09179*x-0.0001931*x*x",-AliTOFConstants::fgkMaxhZtof,AliTOFConstants::fgkMaxhZtof);
+ fZnoise = new TF1("fZnoise","182.2-0.09179*x-0.0001931*x*x",-AliTOFGeometry::MaxhZtof(),AliTOFGeometry::MaxhZtof());
}
if(fNoise) {
for(Int_t i=0;i<fNoise;i++) {
- isector=(Int_t) (AliTOFConstants::fgkNSectors*gRandom->Rndm())+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();
// 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;
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;
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]);
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;
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;
// 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);
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;
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;
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++;
gyLast=gy;
gzLast=gz;
- } while(rho<AliTOFConstants::fgkrmax); //end of do
+ } while(rho<AliTOFGeometry::Rmax()); //end of do
if(istep>0) {
istep=-3; // holes in TOF
}
} else {
- if(TMath::Abs(gz)<AliTOFConstants::fgkMaxhZtof) {
+ if(TMath::Abs(gz)<AliTOFGeometry::MaxhZtof()) {
// if(TMath::Abs(gz)<MAXZTOF2) {
istep=-2; // PHOS and RICH holes or holes in between TOF plates
} else {
inverseOfParticleSpeed=time/wLength;
//w=900.*inverseOfParticleSpeed*inverseOfParticleSpeed-1.;
- w=(100.*AliTOFConstants::fgkSpeedOfLight)*(100.*AliTOFConstants::fgkSpeedOfLight)*inverseOfParticleSpeed*inverseOfParticleSpeed-1.;
+ w=(100.*AliTOFGeometry::SpeedOfLight())*(100.*AliTOFGeometry::SpeedOfLight())*inverseOfParticleSpeed*inverseOfParticleSpeed-1.;
w2=pvtx*pvtx;
Float_t squareMass=w2*w;
mass=TMath::Sqrt(TMath::Abs(squareMass));
Float_t fPBound; //tracks/hits with P(GeV/c)<PBOUND do not take into account (kinematical cut)
protected:
+
ClassDef(AliTOFReconstructioner,1) // Task class for TOF reconstruction
#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliTOF.h"
-#include "AliTOFConstants.h"
+#include "AliTOFGeometry.h"
#include "AliTOFDigitMap.h"
#include "AliTOFHitMap.h"
#include "AliTOFReconstructionerV2.h"
// check if the point falls into a pad
// using the G3 geometry
- Int_t* volumeID = new Int_t[AliTOFConstants::fgkmaxtoftree];
+ Int_t* volumeID = new Int_t[AliTOFGeometry::MaxTOFTree()];
// volumeID[0] -> TOF Sector range [1-18]
// volumeID[1] -> TOF Plate range [1- 5]
// volumeID[2] -> TOF Strip max range [1-20]
char name[5];
name[4]=0;
- for (i=0; i<AliTOFConstants::fgkmaxtoftree; i++) nGeom[i]=0;
+ for (i=0; i<AliTOFGeometry::MaxTOFTree(); i++) nGeom[i]=0;
zPad=100.;
xPad=100.;
#include "AliRun.h"
#include "AliTOF.h"
-#include "AliTOFConstants.h"
+#include "AliTOFGeometry.h"
#include "AliTOFSDigit.h"
ClassImp(AliTOFSDigit)
//
// Constructor of digit object
//
+
fSector = vol[0];
fPlate = vol[1];
fStrip = vol[2];
//
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;
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;
// 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;
}
#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliTOF.h"
-#include "AliTOFConstants.h"
+#include "AliTOFGeometry.h"
#include "AliTOFHitMap.h"
#include "AliTOFSDigit.h"
#include "AliTOFSDigitizer.h"
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};
// 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
//__________________________________________________________________
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;
// 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;
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;
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
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<resX) ? res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resX * resX) : res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns
(timeWalkZ<timeWalkX) ? timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ : timeWalk[nActivatedPads-1] = 0.001 * timeWalkX; // ns
} // end C
// E:
- if(ix < AliTOFConstants::fgkNpadX && dX > 0) {
+ if(ix < AliTOFGeometry::NpadX() && dX > 0) {
nActivatedPads++;
nPlace[nActivatedPads-1] = nPlace[0] + 1;
eff[nActivatedPads-1] = effX;
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<resX) ? res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resX * resX) : res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns
(timeWalkZ<timeWalkX) ? timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ : timeWalk[nActivatedPads-1] = 0.001*timeWalkX; // ns
#include "STRUCT/AliPIPEv0.h"
#include "ITS/AliITSvPPRasymmFMD.h"
#include "TPC/AliTPCv2.h"
-#include "TOF/AliTOFv2FHoles.h"
#include "TOF/AliTOFv4T0.h"
#include "RICH/AliRICHv3.h"
#include "ZDC/AliZDCv2.h"
// This part for configuration
static PprRun_t srun = test50;
-//static PprRun_t srun = kPythia6;
-static PprGeo_t sgeo = kNoHoles;
+static PprGeo_t sgeo = kHoles;
static PprRad_t srad = kGluonRadiation;
static PprMag_t smag = k5kG;
}
- if (iTOF) {
- if (sgeo == kHoles) {
- //=================== TOF parameters ============================
- AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes");
- } else {
- AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
- }
- }
+ if (iTOF) AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
if (iRICH)
#include "AliESDtrack.h"
#include "AliTOFdigit.h"
-#include <TGeant3.h>
-#include "../STRUCT/AliBODY.h"
-#include "../STRUCT/AliFRAMEv2.h"
+#include <TGeant3.h> // 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 <stdlib.h>
-class TVirtualMC;
-extern TVirtualMC *gMC;
ClassImp(AliTOFpidESD)
+//_________________________________________________________________________
static Int_t InitGeo() {
//gSystem->Load("libgeant321");
//new TGeant3("C++ Interface to Geant3");
}
//_________________________________________________________________________
-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];
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
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;
dig[3]=d->GetPadz();
dig[4]=d->GetPadx();
+ // fTOFGeometry->GetPos(dig,g); // uncomment this
DtoM(dig,g);
Double_t h[5];
return 0;
}
+//_________________________________________________________________________
Int_t AliTOFpidESD::LoadClusters(TTree *dTree) {
//--------------------------------------------------------------------
//This function loads the TOF clusters
dig[3]=d->GetPadz();
dig[4]=d->GetPadx();
+ //fTOFGeometry->GetPos(dig,g);
DtoM(dig,g);
Double_t h[5];
return 0;
}
+//_________________________________________________________________________
void AliTOFpidESD::UnloadClusters() {
//--------------------------------------------------------------------
//This function unloads TOF clusters
fN=0;
}
+//_________________________________________________________________________
Int_t AliTOFpidESD::InsertCluster(AliTOFcluster *c) {
//--------------------------------------------------------------------
//This function adds a cluster to the array of clusters sorted in Z
return 0;
}
+//_________________________________________________________________________
Int_t AliTOFpidESD::FindClusterIndex(Double_t z) const {
//--------------------------------------------------------------------
// This function returns the index of the nearest cluster
return 0;
}
+
//-------------------------------------------------------
#include <TObject.h>
+#include "AliTOFGeometry.h"
class AliESD;
class TFile;
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
};
// //
// VERSION WITH 5 MODULES AND TILTED STRIPS //
// //
-// FULL COVERAGE VERSION //
+// FULL COVERAGE VERSION +OPTION for PHOS holes //
// //
// Author: //
// Fabrizio Pierella //
#include "AliConst.h"
#include "AliRun.h"
#include "AliTOFv4T0.h"
-#include "AliTOFConstants.h" // AdC
#include "AliMC.h"
ClassImp(AliTOFv4T0)
//
// Check that FRAME is there otherwise we have no place where to
// put TOF
+
+
AliModule* frame=gAlice->GetModule("FRAME");
if(!frame) {
Error("Ctor","TOF needs FRAME to be present\n");
exit(1);
- } else
- if(frame->IsVersion()!=1) {
- Error("Ctor","FRAME version 1 needed with this version of TOF\n");
- exit(1);
- }
-
-}
+ } else{
+
+ if (fTOFGeometry) delete fTOFGeometry;
+ fTOFGeometry = new AliTOFGeometry();
-//____________________________________________________________________________
+ if(frame->IsVersion()==1) {
+ cout << " Frame version " << frame->IsVersion() << endl;
+ cout << " Full Coverage for TOF" << endl;
+ fTOFHoles=false;}
+ else {
+ cout << " Frame version " << frame->IsVersion() << endl;
+ cout << " TOF with Holes for PHOS " << endl;
+ fTOFHoles=true;}
+ }
+}
+//____________________________________________________________________________
void AliTOFv4T0::BuildGeometry()
{
//
AliTOF::CreateGeometry();
}
+
//_____________________________________________________________________________
void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
Float_t zlenB, Float_t zlenA, Float_t ztof0)
// Definition of the Time Of Fligh Resistive Plate Chambers
// xFLT, yFLT, zFLT - sizes of TOF modules (large)
- Float_t ycoor, zcoor;
+ Float_t ycoor;
Float_t par[3];
Int_t *idtmed = fIdtmed->GetArray()-499;
Int_t idrotm[100];
Int_t nrot = 0;
- Float_t hTof = fRmax-fRmin;
-
+
Float_t radius = fRmin+2.;//cm
+
par[0] = xtof * 0.5;
par[1] = ytof * 0.5;
AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
+
gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
- gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
+ if(!fTOFHoles)gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
+
Float_t db = 0.5;//cm
Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
///// 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;
//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;
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;
gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
//-- PCB Layer definition
+
parfp[1] = khpcby*0.5;
gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
// positioning 2 PCB Layers on FSTR volume
//-- MYLAR Layer definition
+
parfp[1] = khmyly*0.5;
gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
// positioning 2 MYLAR Layers on FSTR volume
//-- Graphite Layer definition
+
parfp[1] = khgraphy*0.5;
gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
// positioning 2 Graphite Layers on FSTR volume
//-- Glass (EXT. +Semi INT.) Layer definition
+
parfp[1] = khglasseiy*0.5;
gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
// positioning 2 Glass Layers on FSTR volume
//-- Sensitive Mixture Layer definition
+
parfp[0] = klsensmx*0.5;
parfp[1] = khsensmy*0.5;
parfp[2] = kwsensmz*0.5;
gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
// dividing FSEN along z in knz=2 and along x in knx=48
+
gMC->Gsdvn("FSEZ","FSEN",knz,3);
gMC->Gsdvn("FSEX","FSEZ",knx,1);
// FPAD volume definition
+
parfp[0] = klpadx*0.5;
parfp[1] = khsensmy*0.5;
parfp[2] = kwpadz*0.5;
// 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
// plexiglass thickness: 1.5 mm ; factor 0.3
+
ycoor += par[1];
par[0] = xFLT*0.5;
par[1] = 0.075*0.3; // factor 0.3
gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
// frame of Air
+
ycoor += par[1];
par[0] = xFLT*0.5;
par[1] = (yFLT/2-ycoor-khAlWall)*0.5; // Aluminum layer considered (0.18 cm)
// card volume definition
// see GEOM200 in GEANT manual
+
+
AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg
Float_t cardpar[3];
cardpos[2]= -53.;
Float_t aplpos1 = -2.;
Int_t icard;
- for (icard=0; icard<15; ++icard) {
+ for (icard=0; icard < fTOFGeometry->NStripA(); ++icard) {
cardpos[2]= cardpos[2]+stepforcardA;
aplpos2 = cardpos[2]+0.15;
gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
// 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");
// 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");
}
// tube volume definition
+
Float_t tubepar[3];
tubepar[0]= 0.;
tubepar[1]= 0.4;
tubepos[2]= -53.+tdis;
// tub1pos = 5.;
Int_t itub;
- for (itub=0; itub<15; ++itub) {
+ for (itub=0; itub < fTOFGeometry->NStripA(); ++itub) {
tubepos[2]= tubepos[2]+stepforcardA;
gMC->Gspos("FTUB",itub,"FAIA",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
"ONLY");
// intermediate module positioning (FAIB)
tubepos[2]= -70.5+tdis;
- for (itub=0; itub<19; ++itub) {
+ for (itub=0; itub < fTOFGeometry->NStripB(); ++itub) {
tubepos[2]= tubepos[2]+stepforcardB;
gMC->Gspos("FTUB",itub,"FAIB",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
"ONLY");
// outer module positioning (FAIC)
tubepos[2]= -88.75+tdis;
- for (itub=0; itub<20; ++itub) {
+ for (itub=0; itub < fTOFGeometry->NStripC(); ++itub) {
tubepos[2]= tubepos[2]+stepforcardC;
gMC->Gspos("FTUB",itub,"FAIC",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
"ONLY");
}
}
-
//_____________________________________________________________________________
void AliTOFv4T0::DrawModule() const
{
//_____________________________________________________________________________
void AliTOFv4T0::StepManager()
{
+
//
// Procedure called at each step in the Time Of Flight
//
+
TLorentzVector mom, pos;
Float_t xm[3],pm[3],xpad[3],ppad[3];
Float_t hits[14],phi,phid,z;
Int_t copy, padzid, padxid, stripid, i;
Int_t *idtmed = fIdtmed->GetArray()-499;
Float_t incidenceAngle;
-
+
if(gMC->GetMedium()==idtmed[513] &&
gMC->IsTrackEntering() && gMC->TrackCharge()
&& gMC->CurrentVolID(copy)==fIdSens)
padzid=gMC->CurrentVolOffID(2,copy);
padz=copy;
+
padxid=gMC->CurrentVolOffID(1,copy);
padx=copy;
gMC->TrackPosition(pos);
gMC->TrackMomentum(mom);
-// Double_t NormPos=1./pos.Rho();
+
+ // Double_t NormPos=1./pos.Rho();
+
Double_t normMom=1./mom.Rho();
-// getting the cohordinates in pad ref system
+ // getting the cohordinates in pad ref system
+
xm[0] = (Float_t)pos.X();
xm[1] = (Float_t)pos.Y();
xm[2] = (Float_t)pos.Z();
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
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];
vol[1]= plate;
vol[2]= strip;
vol[3]= padx;
- vol[4]= padz;
-
+ vol[4]= padz;
+
AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}
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();
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)
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 */
#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+;
#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+;
-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)