1 #if !defined(__CINT__) || defined(__MAKECINT__)
6 //---------------------------------------
7 double radii2Turbo(double rMin,double rMid,double rMax, double sensW)
9 // compute turbo angle from radii and sensor width
10 return TMath::ASin((rMax*rMax-rMin*rMin)/(2*rMid*sensW))*TMath::RadToDeg();
13 double radii2Phi(double rMin,double rMid,double rMax, double sensW)
15 // compute phi coverage
16 return 2*TMath::ACos((rMax+rMin)*
17 (rMid*rMid+rMin*rMax-sensW*sensW/4.)/
24 gSystem->Load("libITSUpgradeBase.so");
25 gSystem->Load("libITSUpgradeSim.so");
28 // build ITS upgrade detector
29 // sensitive area 13x15mm (X,Z) with 20x20 micron pitch, 2mm dead zone on readout side and 50 micron guardring
30 const double kSensThick = 18e-4;
31 const double kPitchX = 20e-4;
32 const double kPitchZ = 20e-4;
33 const int kNRow = 650;
34 const int kNCol = 750;
35 const int kNChips = 2;
36 const double kLrThick03 = 120e-4; // -> effective thickness for ~0.3%X layers
37 const double kLrThick08 = 600e-4; // -> effective thickness for ~0.8%X layers
39 const double kReadOutEdge = 0.2; // width of the readout edge (passive bottom)
40 const double kGuardRing = 50e-4; // width of passive area on left/right/top of the sensor
43 const int kNLrInner = 3;
44 const int kBuildLevel = 3;
45 enum {kRmn,kRmd,kRmx,kNModPerStave,kPhi0,kNStave,kNPar};
46 const double tdr5dat[kNLr][kNPar] = {
47 {2.24, 2.34, 2.67, 9., 16.37, 12}, // for each inner layer: rMin,rMid,rMax,NMod/Stave,phi0, nStave
48 {3.01, 3.15, 3.46, 9., 12.03, 16},
49 {3.78, 3.93, 4.21, 9., 10.02, 20},
50 {-1, 19.4, -1, 28., 0. , 49}, // for others: -, rMid, -, NMod/Stave, phi0, nStave
51 {-1, 24.7, -1, 28., 0. , 61},
52 {-1, 35.32,-1, 49., 0. , 88},
53 {-1, 40.52,-1, 49., 0. , 100}
56 // create segmentations:
57 AliITSUSegmentationPix* seg0 = new AliITSUSegmentationPix(0, // segID (0:9)
58 kNChips, // chips per module
59 kNChips*kNCol, // ncols (total for module)
61 kPitchX, // default row pitch in cm
62 kPitchZ, // default col pitch in cm
63 kSensThick, // sensor thickness in cm
64 -1, // no special left col between chips
65 -1, // no special right col between chips
69 kReadOutEdge // bottom
70 ); // see AliITSUSegmentationPix.h for extra options
71 seg0->Store(AliITSUGeomTGeo::GetITSsegmentationFileName());
73 AliITSUSegmentationPix* seg1 = new AliITSUSegmentationPix(1, // segID (0:9)
74 kNChips, // chips per module
75 kNChips*kNCol, // ncols (total for module)
76 2*kNRow, // nrows for oute layers
77 kPitchX, // default row pitch in cm
78 kPitchZ, // default col pitch in cm
79 kSensThick, // sensor thickness in cm
80 -1, // no special left col between chips
81 -1, // no special right col between chips
84 kReadOutEdge, // top !!! readout from both sides
85 kReadOutEdge // bottom
86 ); // see AliITSUSegmentationPix.h for extra options
87 seg1->Store(AliITSUGeomTGeo::GetITSsegmentationFileName());
92 const double kMinOvl = 0.005; // require active zones overlap
93 const double kTilt = -10.; // tilt in degrees for outer layers
94 double dzLr,rLr,phi0,turbo,thick;
95 AliITSUSegmentationPix* seg=0;
96 int nStaveLr,nModPerStaveLr,idLr;
97 // virtual void DefineLayerTurbo(const Int_t nlay, const Double_t r, const Double_t zlen, const Int_t nladd, const Int_t nmod, const Double_t width,
98 // const Double_t tilt, const Double_t lthick = 0., const Double_t dthick = 0., const UInt_t detType=0);
99 AliITSUv1 *ITS = new AliITSUv1("ITS Upgrade",7);
100 ITS->SetStaveModelIB(AliITSUv1::kIBModel22);
101 ITS->SetStaveModelOB(AliITSUv1::kOBModel0);
103 const int kNWrapVol = 3;
104 const double wrpRMin[kNWrapVol] = { 2.1, 15.0, 32.0};
105 const double wrpRMax[kNWrapVol] = { 7.0, 27.0, 43.0};
106 const double wrpZSpan[kNWrapVol] = {28.0, 86.0, 150.0};
107 ITS->SetNWrapVolumes(kNWrapVol); // define wrapper volumes for layers
108 for (int iw=0;iw<kNWrapVol;iw++) ITS->DefineWrapVolume(iw,wrpRMin[iw],wrpRMax[iw],wrpZSpan[iw]);
110 for (int idLr=0;idLr<kNLr;idLr++) {
111 rLr = tdr5dat[idLr][kRmd];
112 phi0 = tdr5dat[idLr][kPhi0];
113 if (idLr<kNLrInner) {
115 turbo = -radii2Turbo(tdr5dat[idLr][kRmn],rLr,tdr5dat[idLr][kRmx],seg->Dx());
123 nStaveLr = TMath::Nint(tdr5dat[idLr][kNStave]);
124 if (nStaveLr<0) nStaveLr = getNStaves(seg,kTilt,rLr,kMinOvl); // calculate automatically
125 nModPerStaveLr = TMath::Nint(tdr5dat[idLr][kNModPerStave]);
126 ITS->DefineLayerTurbo(idLr, phi0, rLr, nModPerStaveLr*seg->Dz(), nStaveLr, nModPerStaveLr,
127 seg->Dx(), turbo, thick, seg->Dy(), seg->GetChipTypeID());
128 printf("Add Lr%d: R=%6.2f DZ:%6.2f Turbo:%+6.2f Staves:%3d NMod/Stave:%3d\n",idLr,rLr,nModPerStaveLr*seg->Dz(),turbo,nStaveLr,nModPerStaveLr);
134 Int_t getNStaves(AliITSUSegmentationPix* seg, double tilt, double r0, double minOvl)
136 double dphi = (90.-tilt)*TMath::DegToRad();
137 double cs = TMath::Cos(dphi);
138 double sn = TMath::Sin(dphi);
139 double dx = seg->Dx();
140 double tL = -dx/2 + seg->GetGuardBot();
141 double tU = dx/2 - seg->GetGuardTop();
143 double xL = r0 + cs*tL;
145 double xU = r0 + cs*tU;
147 double phiL = TMath::ATan2(yL,xL);
148 double phiU = TMath::ATan2(yU,xU);
149 double dphi = TMath::Abs(phiL-phiU);
150 if (dphi>TMath::Pi()) dphi = TMath::Abs(dphi-TMath::Pi()*2);
151 double span = dphi*r0;
154 int nStaveLr = 1 + r0*TMath::Pi()*2/span;
155 do { ov = 1.-r0*TMath::Pi()*2/nStaveLr/span; } while ( minOvl>=0 && ov<minOvl && nStaveLr++ );
156 printf("Reccommend %2d staves for R=%5.2f, ActiveOvl=%5.2f\% (%6.f micron)\n",nStaveLr,r0,ov*100,ov*span*1e4);