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