CMS 3D CMS Logo

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