]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/testITSUv1/CreateITSUv1_tdr7.C
Updating the TDR7 layout
[u/mrichter/AliRoot.git] / ITS / UPGRADE / testITSUv1 / CreateITSUv1_tdr7.C
1 #if !defined(__CINT__) || defined(__MAKECINT__)
2 #include <TSystem.h>
3 #include <TMath.h>
4 #endif
5
6 //---------------------------------------
7 double radii2Turbo(double rMin,double rMid,double rMax, double sensW)
8 {
9   // compute turbo angle from radii and sensor width
10   return TMath::ASin((rMax*rMax-rMin*rMin)/(2*rMid*sensW))*TMath::RadToDeg();
11 }
12
13 double radii2Phi(double rMin,double rMid,double rMax, double sensW)
14 {
15   // compute phi coverage
16   return 2*TMath::ACos((rMax+rMin)*
17                        (rMid*rMid+rMin*rMax-sensW*sensW/4.)/
18                        (4.*rMid*rMax*rMin));
19 }
20
21 void CreateITSUv1_tdr7()
22 {
23   //---------------------------------------------------------------------------
24   //  This is the TDR7 layout.
25   //  With this layout, the two middle layers are shifted in radius 
26   //  closer to the outer layers.
27   //---------------------------------------------------------------------------
28
29   const Double_t dltR =4.94;  // wrapper volume: radial shift wrt the TDR6  
30   const Double_t dltZ =21.1;  // wrapper volume: increment in the lenght
31   const Int_t    dltNsta=6;   // increment in the number of staves 
32   const Int_t    dltNmod=1;   // increment in the number of modules in Z 
33   //
34   gSystem->Load("libITSUpgradeBase.so");
35   gSystem->Load("libITSUpgradeSim.so");
36   //
37   // build ITS upgrade detector
38   // sensitive area 13x15mm (X,Z) with 20x20 micron pitch, 2mm dead zone on readout side and 50 micron guardring
39   const double kSensThick = 18e-4;
40   const double kPitchX = 20e-4;
41   const double kPitchZ = 20e-4;
42   const int    kNRow   = 650; 
43   const int    kNCol   = 1500;
44   const double kLrThick03 = 120e-4;   // -> effective thickness for ~0.3%X layers
45   const double kLrThick08 = 600e-4;   // -> effective thickness for ~0.8%X layers
46   //
47   const double kReadOutEdge = 0.2;   // width of the readout edge (passive bottom)
48   const double kGuardRing   = 50e-4; // width of passive area on left/right/top of the sensor
49   //
50   const int kNLr = 7;
51   const int kNLrInner = 3;
52   const int kBuildLevel = 3;
53   enum {kRmn,kRmd,kRmx,kNModPerStave,kPhi0,kNStave,kNPar};
54   // Radii are from last TDR (ALICE-TDR-017.pdf Tab. 1.1, rMid is mean value)
55   const double tdr5dat[kNLr][kNPar] = { 
56     {2.24, 2.34, 2.67,  9., 16.37, 12}, // for each inner layer: rMin,rMid,rMax,NChip/Stave, phi0, nStaves
57     {3.01, 3.15, 3.46,  9., 12.03, 16},
58     {3.78, 3.93, 4.21,  9., 10.02, 20},
59     {-1,  19.6+dltR,   -1,  4.+dltNmod,  0.  , 24+dltNsta},  // for others: -, rMid, -, NMod/HStave, phi0, nStaves // 24 was 49
60     {-1,  24.55+dltR,  -1,  4.+dltNmod,  0.  , 30+dltNsta},  // 30 was 61
61     {-1,  34.39, -1,    7.,  0.  , 42},  // 42 was 88
62     {-1,  39.34, -1,    7.,  0.  , 48}   // 48 was 100
63   };
64   const int nChipsPerModule = 7; // For OB: how many chips in a row
65
66   // create segmentations:
67   AliITSUSegmentationPix* seg0 = new AliITSUSegmentationPix(0,        // segID (0:9)
68                                                             1,  // chips per module
69                                                             kNCol,    // ncols (total for module)
70                                                             kNRow,    // nrows
71                                                             kPitchX,  // default row pitch in cm
72                                                             kPitchZ,  // default col pitch in cm
73                                                             kSensThick,  // sensor thickness in cm
74                                                             -1,     // no special left col between chips
75                                                             -1,     // no special right col between chips
76                                                             kGuardRing, // left
77                                                             kGuardRing, // right
78                                                             kGuardRing, // top
79                                                             kReadOutEdge  // bottom
80                                                             );    // see AliITSUSegmentationPix.h for extra options
81   seg0->Store(AliITSUGeomTGeo::GetITSsegmentationFileName());
82   //
83   seg0->Print();
84   //
85   double dzLr,rLr,phi0,turbo;
86   int nStaveLr,nModPerStaveLr,idLr;
87   //
88   AliITSUv1 *ITS  = new AliITSUv1("ITS Upgrade",kNLr);
89   ITS->SetStaveModelIB(AliITSUv1::kIBModel22);
90   ITS->SetStaveModelOB(AliITSUv1::kOBModel1);
91   //
92   const int kNWrapVol = 3;
93   const double wrpRMin[kNWrapVol]  = { 2.1, 15.0+dltR, 32.0};
94   const double wrpRMax[kNWrapVol]  = { 7.0, 27.0+dltR+2.3, 43.0+1.5};
95   const double wrpZSpan[kNWrapVol] = {28.0, 86.0+dltZ, 150.0};
96   //
97   ITS->SetNWrapVolumes(kNWrapVol); // define wrapper volumes for layers
98   for (int iw=0;iw<kNWrapVol;iw++) ITS->DefineWrapVolume(iw,wrpRMin[iw],wrpRMax[iw],wrpZSpan[iw]);
99   //
100   for (int idLr=0;idLr<kNLr;idLr++) {
101     rLr   = tdr5dat[idLr][kRmd];
102     phi0  = tdr5dat[idLr][kPhi0]; 
103     //
104     nStaveLr = TMath::Nint(tdr5dat[idLr][kNStave]);
105     nModPerStaveLr =  TMath::Nint(tdr5dat[idLr][kNModPerStave]);
106     int nChipsPerStaveLr = nModPerStaveLr;
107     //
108     if (idLr>=kNLrInner) {
109       nChipsPerStaveLr *= nChipsPerModule;
110       ITS->DefineLayer(idLr, phi0, rLr, nChipsPerStaveLr*seg0->Dz(), nStaveLr, nModPerStaveLr, 
111                        kLrThick03, seg0->Dy(), seg0->GetChipTypeID(),kBuildLevel);
112       //      printf("Add Lr%d: R=%6.2f DZ:%6.2f Staves:%3d NMod/Stave:%3d\n",
113       //             idLr,rLr,nChipsPerStaveLr*seg0->Dz(),nStaveLr,nModPerStaveLr);
114     } else {
115       turbo = -radii2Turbo(tdr5dat[idLr][kRmn],rLr,tdr5dat[idLr][kRmx],seg0->Dx());     
116       ITS->DefineLayerTurbo(idLr, phi0, rLr, nChipsPerStaveLr*seg0->Dz(), nStaveLr, nChipsPerStaveLr, 
117                           seg0->Dx(), turbo, kLrThick08, seg0->Dy(), seg0->GetChipTypeID());
118       //      printf("Add Lr%d: R=%6.2f DZ:%6.2f Turbo:%+6.2f Staves:%3d NMod/Stave:%3d\n",
119       //             idLr,rLr,nChipsPerStaveLr*seg0->Dz(),turbo,nStaveLr,nModPerStaveLr);
120     }
121     //
122   }
123   //  
124 }