CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TEcnaNumbering.h
Go to the documentation of this file.
1 #ifndef ROOT_TEcnaNumbering
2 #define ROOT_TEcnaNumbering
3 
4 #include "TString.h"
5 #include "TObject.h"
6 #include "Riostream.h"
7 
9 
10 class TEcnaNumbering : public TObject {
11 
12 private:
13 
14  Int_t fgMaxCar; // Max nb of caracters for char*
15  Int_t fCnew; // flags for dynamical allocation
16  Int_t fCdelete;
17 
18  TString fTTBELL;
19 
20  TString fFlagSubDet;
21  Int_t fFlagPrint;
22 
24 
25  //================================= BARREL
26 
27  Int_t** fT2dSMCrys;
28  Int_t* fT1dSMCrys;
29  Int_t* fT1dSMTow;
30  Int_t* fT1dTowEcha;
31 
34 
35  //================================= ENDCAP
36 
37  Int_t*** fT3dDeeCrys; // = CNA_CrysInDee[CNA_SCInDee - 1][CMS_CrysInSC - 1][CMS_DeeDir_index]
38  Int_t** fT2dDeeCrys;
39  Int_t* fT1dDeeCrys;
40 
41  Int_t** fT2dDeeSC; // = CNA_SCInDee[CNA_CrysInDee - 1][CMS_DeeDir_index]
42  Int_t* fT1dDeeSC;
43 
44  Int_t** fT2dSCEcha; // = CMS_CrysInSC[CNA_CrysInDee - 1][CMS_DeeDir_index]
45  Int_t* fT1dSCEcha;
46 
47  Int_t** fT2d_jch_JY; // = JY[CMS_SCQuadType_index][CMS_CrysInSC - 1]
48  Int_t* fT1d_jch_JY;
49 
50  Int_t** fT2d_ich_IX; // = IX[CMS_SCQuadType_index][CMS_CrysInSC - 1]
51  Int_t* fT1d_ich_IX;
52 
55 
56  Int_t** fT2d_DS; // = DS[Dee - 1, CNA_SCInDee - 1]
57  Int_t* fT1d_DS;
58 
59  Int_t** fT2d_DSSC; // = SCInDS[Dee - 1, CNA_SCInDee - 1]
60  Int_t* fT1d_DSSC;
61 
62  Int_t** fT2d_DeeSCCons; // = SCConsInDee[Dee - 1, CNA_SCInDee - 1]
64 
65  Int_t** fT2d_RecovDeeSC; // = CNA_SCInDee[Dee - 1, SCConsInDee - 1]
67 
68  //........................................................................................
69 
70 protected:
71 
72  void Init();
73 
74 public:
75 
76  //------------------------------- methods
77 
79  TEcnaNumbering(const TString, const TEcnaParEcal*);
81 
82  void SetEcalSubDetector(const TString, const TEcnaParEcal*);
83 
84  //================================== BARREL
85 
86  void BuildBarrelCrysTable(); // correspondance crystal# in super-module <-> (tower number, channel# in tower)
87 
88  Int_t Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t&, const Int_t&);
89  Int_t Get0SMEchaFrom1SMTowAnd0TowEcha(const Int_t&, const Int_t&);
90 
91  Int_t Get0TowEchaFrom0SMEcha(const Int_t&);
92  Int_t Get1SMTowFrom0SMEcha(const Int_t&);
93  Int_t Get0TowEchaFrom1SMCrys(const Int_t&);
94  Int_t Get1SMTowFrom1SMCrys(const Int_t&);
95 
96  Int_t GetHashedNumberFromIEtaAndIPhi(const Int_t&, const Int_t&);
97  Int_t GetIEtaFromHashed(const Int_t&, const Int_t&);
98  Int_t GetIPhiFromHashed(const Int_t&);
99 
100  //..........................................................................................................
101  Double_t GetEta(const Int_t&, const Int_t&, const Int_t&);
102  Double_t GetEtaMin(const Int_t&, const Int_t&);
103  Double_t GetEtaMax(const Int_t&, const Int_t&);
104 
105  Double_t GetIEtaMin(const Int_t&, const Int_t&); // only for axis of TowerCrystalNumbering (+0.5 shift)
106  Double_t GetIEtaMax(const Int_t&, const Int_t&); // only for axis of TowerCrystalNumbering (-0.5 shift)
107 
108  Double_t GetIEtaMin(const Int_t&); // only for axis of SMTowerNumbering (+0.5 shift)
109  Double_t GetIEtaMax(const Int_t&); // only for axis of SMTowerNumbering (-0.5 shift)
110 
111  Double_t GetPhiInSM(const Int_t&, const Int_t&, const Int_t&);
112  Double_t GetPhi(const Int_t&, const Int_t&, const Int_t&);
113 
114  Double_t GetPhiMin(const Int_t&, const Int_t&);
115  Double_t GetPhiMax(const Int_t&, const Int_t&);
116 
117  Double_t GetJPhiMin(const Int_t&, const Int_t&);
118  Double_t GetJPhiMax(const Int_t&, const Int_t&);
119 
120  Double_t GetJPhiMin(const Int_t&);
121  Double_t GetJPhiMax(const Int_t&);
122 
123  Double_t GetPhiMin(const Int_t&);
124  Double_t GetPhiMax(const Int_t&);
125 
126  Double_t GetSMCentralPhi(const Int_t&);
127 
128  TString GetXDirectionEB(const Int_t&);
129  TString GetYDirectionEB(const Int_t&);
130  TString GetJYDirectionEB(const Int_t&);
131 
132  TString GetTowerLvrbType(const Int_t&);
133  TString GetStinLvrbType(const Int_t&);
134 
135  TString GetSMHalfBarrel(const Int_t&);
136 
137  //================================== ENDCAP
138 
139  void BuildEndcapCrysTable(); // correspondance crystal# in Dee <-> (SC number, channel# in SC)
140  void BuildEndcapSCTable(); // correspondance SC# in Dee <-> (DS#, SC# in DS, SC# for construction)
141  // (SC = Super Crystal, DS = Data Sector)
142 
143  Int_t Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(const Int_t&, const Int_t&, const TString);
144 
145  Int_t Get1SCEchaFrom0DeeEcha(const Int_t&);
146  Int_t Get1DeeSCEcnaFrom0DeeEcha(const Int_t&);
147  Int_t Get1SCEchaFrom1DeeCrys(const Int_t&, const TString);
148  Int_t Get1DeeSCEcnaFrom1DeeCrys(const Int_t&, const TString);
149 
150  Int_t GetDSFrom1DeeSCEcna(const Int_t&, const Int_t&);
151  Int_t GetDSSCFrom1DeeSCEcna(const Int_t&, const Int_t&, const Int_t&);
152  Int_t GetDSSCFrom1DeeSCEcna(const Int_t&, const Int_t&);
153  Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t&, const Int_t&);
154  Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t&, const Int_t&, const Int_t&);
155  Int_t Get1DeeSCEcnaFromDeeSCCons(const Int_t&, const Int_t&);
156 
157  Int_t GetIXCrysInSC(const Int_t&, const Int_t&, const Int_t&);
158  Int_t GetJYCrysInSC(const Int_t&, const Int_t&, const Int_t&);
159  Int_t GetIXSCInDee(const Int_t&);
160  Int_t GetJYSCInDee(const Int_t&);
161  Int_t GetIXCrysInDee(const Int_t&, const Int_t&, const Int_t&);
162  Int_t GetJYCrysInDee(const Int_t&, const Int_t&, const Int_t&);
163 
164  Int_t GetMaxSCInDS(const Int_t&);
165 
166  Double_t GetIIXMin(const Int_t&); // only for axis of SCCrystalNumbering (+0.5 shift)
167  Double_t GetIIXMax(const Int_t&); // only for axis of SCCrystalNumbering (-0.5 shift)
168  Double_t GetIIXMin(); // only for axis of DeeSCNumbering (+0.5 shift)
169  Double_t GetIIXMax(); // only for axis of DeeSCNumbering (-0.5 shift)
170 
171  Double_t GetJIYMin(const Int_t&, const Int_t&);
172  Double_t GetJIYMax(const Int_t&, const Int_t&);
173  Double_t GetJIYMin(const Int_t&);
174  Double_t GetJIYMax(const Int_t&);
175 
176  Int_t GetDeeDirIndex(const TString);
177  Int_t GetSCQuadTypeIndex(const TString, const TString);
178  TString GetDeeDirViewedFromIP(const Int_t&);
179 
180  TString GetSCQuadFrom1DeeSCEcna(const Int_t&);
181  TString GetEEDeeEndcap(const Int_t&);
182  TString GetEEDeeType(const Int_t&);
183 
184  TString GetDeeHalfEndcap(const Int_t&);
185 
186  TString GetSCType(const Int_t&); // for special (not connected) SC's
187 
188  Int_t StexEchaForCons(const Int_t&, const Int_t&);
189 
190  TString GetXDirectionEE(const Int_t&);
191  TString GetYDirectionEE(const Int_t&);
192  TString GetJYDirectionEE(const Int_t&);
193 
194  //========================================= BARREL and ENDCAP
195 
196  Int_t Get1StexStinFrom0StexEcha(const Int_t&);
197 
198  Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t&, const Int_t&);
199  Int_t Get1StexCrysFrom1StexStinAnd0StinEcha(const Int_t&, const Int_t&, const Int_t&); // last arg = Stex Number
200 
201  Double_t GetIHocoMin(const Int_t&, const Int_t&); // only for axis of TowerCrystalNumbering (+0.5 shift)
202  Double_t GetIHocoMax(const Int_t&, const Int_t&); // only for axis of TowerCrystalNumbering (-0.5 shift)
203 
204  Double_t GetVecoMin(const Int_t&, const Int_t&);
205  Double_t GetVecoMax(const Int_t&, const Int_t&);
206 
207  Double_t GetJVecoMin(const Int_t&, const Int_t&);
208  Double_t GetJVecoMax(const Int_t&, const Int_t&);
209 
210  TString GetStexHalfStas(const Int_t&);
211 
212  Int_t GetSMFromFED(const Int_t&); // SM = SuperModule
213  Int_t GetDSFromFED(const Int_t&); // DS = DataSector
214 
215  Int_t MaxCrysInStinEcna(const Int_t&, const Int_t&, const TString); // for not connected and incomplete SC's
216 
217  ClassDef(TEcnaNumbering,1) //Channel Numbering for CNA
218 };
219 #endif
Double_t GetEtaMax(const Int_t &, const Int_t &)
Int_t Get1StexStinFrom0StexEcha(const Int_t &)
Int_t * fT1dSCEcha
void BuildBarrelCrysTable()
Int_t ** fT2d_DS
TString GetSCQuadFrom1DeeSCEcna(const Int_t &)
Double_t GetVecoMin(const Int_t &, const Int_t &)
Int_t Get0SMEchaFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
Int_t Get1DeeSCEcnaFromDeeSCCons(const Int_t &, const Int_t &)
Double_t GetPhiMin(const Int_t &, const Int_t &)
Int_t GetSMFromFED(const Int_t &)
TString GetYDirectionEB(const Int_t &)
TString GetSMHalfBarrel(const Int_t &)
TString GetDeeDirViewedFromIP(const Int_t &)
TString GetJYDirectionEB(const Int_t &)
Double_t GetJPhiMax(const Int_t &, const Int_t &)
Int_t Get1DeeSCEcnaFrom0DeeEcha(const Int_t &)
TString GetEEDeeType(const Int_t &)
TString GetStinLvrbType(const Int_t &)
Int_t Get1DeeSCEcnaFrom1DeeCrys(const Int_t &, const TString)
Double_t GetPhiMax(const Int_t &, const Int_t &)
Int_t Get1SCEchaFrom0DeeEcha(const Int_t &)
Int_t * fT1dDeeCrys
Int_t * fT1d_ich_IX
Int_t ** fT2d_ich_IX
Double_t GetEtaMin(const Int_t &, const Int_t &)
Int_t Get0TowEchaFrom1SMCrys(const Int_t &)
Int_t ** fT2d_RecovDeeSC
Int_t GetIXSCInDee(const Int_t &)
Double_t GetIHocoMin(const Int_t &, const Int_t &)
Int_t * fT1d_DeeSCCons
Int_t GetHashedNumberFromIEtaAndIPhi(const Int_t &, const Int_t &)
Int_t Get1SMTowFrom1SMCrys(const Int_t &)
Int_t GetJYSCInDee(const Int_t &)
TString GetXDirectionEE(const Int_t &)
Int_t ** fT2dDeeSC
void BuildEndcapCrysTable()
TString GetTowerLvrbType(const Int_t &)
Double_t GetJVecoMin(const Int_t &, const Int_t &)
TEcnaParEcal * fEcal
Int_t ** fT2d_DSSC
Int_t Get0TowEchaFrom0SMEcha(const Int_t &)
Double_t GetJIYMax(const Int_t &, const Int_t &)
Int_t GetJYCrysInDee(const Int_t &, const Int_t &, const Int_t &)
Int_t Get1SCEchaFrom1DeeCrys(const Int_t &, const TString)
TString GetDeeHalfEndcap(const Int_t &)
Double_t GetJPhiMin(const Int_t &, const Int_t &)
Int_t * fT1dSMCrys
TString GetYDirectionEE(const Int_t &)
Int_t Get1SMTowFrom0SMEcha(const Int_t &)
Int_t GetDeeDirIndex(const TString)
Int_t GetDSSCFrom1DeeSCEcna(const Int_t &, const Int_t &, const Int_t &)
Int_t ** fT2d_jch_JY
Int_t GetDSFromFED(const Int_t &)
Double_t GetVecoMax(const Int_t &, const Int_t &)
Int_t StexEchaForCons(const Int_t &, const Int_t &)
Double_t GetJIYMin(const Int_t &, const Int_t &)
Int_t GetDSFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString)
Double_t GetEta(const Int_t &, const Int_t &, const Int_t &)
Int_t Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
Double_t GetIIXMax()
TString fCodeChNumberingITP2Top
Int_t GetIXCrysInSC(const Int_t &, const Int_t &, const Int_t &)
Double_t GetIEtaMin(const Int_t &, const Int_t &)
Int_t GetIPhiFromHashed(const Int_t &)
Int_t * fT1d_RecovDeeSC
Int_t GetMaxSCInDS(const Int_t &)
Double_t GetPhiInSM(const Int_t &, const Int_t &, const Int_t &)
Int_t GetIEtaFromHashed(const Int_t &, const Int_t &)
Int_t * fT1d_jch_JY
Int_t * fT1dTowEcha
Int_t GetJYCrysInSC(const Int_t &, const Int_t &, const Int_t &)
Int_t ** fT2d_DeeSCCons
Double_t GetPhi(const Int_t &, const Int_t &, const Int_t &)
TString GetSCType(const Int_t &)
Double_t GetIHocoMax(const Int_t &, const Int_t &)
TString fFlagSubDet
Int_t ** fT2dDeeCrys
Int_t GetIXCrysInDee(const Int_t &, const Int_t &, const Int_t &)
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
Int_t ** fT2dSMCrys
Int_t GetSCQuadTypeIndex(const TString, const TString)
Double_t GetIEtaMax(const Int_t &, const Int_t &)
TString GetStexHalfStas(const Int_t &)
TString GetEEDeeEndcap(const Int_t &)
Double_t GetIIXMin()
void SetEcalSubDetector(const TString, const TEcnaParEcal *)
TString fCodeChNumberingITP1Bot
Double_t GetSMCentralPhi(const Int_t &)
TString fCodeChNumberingLvrbBot
TString GetJYDirectionEE(const Int_t &)
Double_t GetJVecoMax(const Int_t &, const Int_t &)
Int_t Get1StexCrysFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &, const Int_t &)
TString fCodeChNumberingLvrbTop
TString GetXDirectionEB(const Int_t &)
Int_t *** fT3dDeeCrys
Int_t Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(const Int_t &, const Int_t &, const TString)
Int_t ** fT2dSCEcha