CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaNumbering.h

Go to the documentation of this file.
00001 #ifndef ROOT_TEcnaNumbering
00002 #define ROOT_TEcnaNumbering
00003 
00004 #include "TString.h"
00005 #include "TObject.h"
00006 #include "Riostream.h"
00007 
00008 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaObject.h"
00009 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParEcal.h"
00010 
00022 
00023 class TEcnaNumbering : public TObject {
00024 
00025 private:
00026 
00027   Int_t fgMaxCar;   // Max nb of caracters for char*
00028   Int_t fCnew;          // flags for dynamical allocation
00029   Int_t fCdelete;       
00030 
00031   TString fTTBELL;
00032 
00033   TString fFlagSubDet;
00034   Int_t   fFlagPrint;
00035 
00036   TEcnaParEcal*   fEcal;
00037 
00038   //================================= BARREL
00039 
00040   Int_t** fT2dSMCrys;
00041   Int_t*  fT1dSMCrys;
00042   Int_t*  fT1dSMTow;
00043   Int_t*  fT1dTowEcha;
00044 
00045   TString fCodeChNumberingLvrbBot;
00046   TString fCodeChNumberingLvrbTop;
00047 
00048   //================================= ENDCAP
00049 
00050   Int_t*** fT3dDeeCrys;      // = CNA_CrysInDee[CNA_SCInDee - 1][CMS_CrysInSC - 1][CMS_DeeDir_index] 
00051   Int_t**  fT2dDeeCrys;
00052   Int_t*   fT1dDeeCrys;
00053 
00054   Int_t**  fT2dDeeSC;        // = CNA_SCInDee[CNA_CrysInDee - 1][CMS_DeeDir_index]
00055   Int_t*   fT1dDeeSC;
00056 
00057   Int_t**  fT2dSCEcha;       // = CMS_CrysInSC[CNA_CrysInDee - 1][CMS_DeeDir_index]
00058   Int_t*   fT1dSCEcha;
00059 
00060   Int_t**  fT2d_jch_JY;      // = JY[CMS_SCQuadType_index][CMS_CrysInSC - 1]
00061   Int_t*   fT1d_jch_JY;
00062 
00063   Int_t**  fT2d_ich_IX;      // = IX[CMS_SCQuadType_index][CMS_CrysInSC - 1]
00064   Int_t*   fT1d_ich_IX;
00065 
00066   TString  fCodeChNumberingITP1Bot;
00067   TString  fCodeChNumberingITP2Top;
00068 
00069   Int_t**  fT2d_DS;          // = DS[Dee - 1, CNA_SCInDee - 1]
00070   Int_t*   fT1d_DS;  
00071 
00072   Int_t**  fT2d_DSSC;        // = SCInDS[Dee - 1, CNA_SCInDee - 1]
00073   Int_t*   fT1d_DSSC;
00074 
00075   Int_t**  fT2d_DeeSCCons;   // = SCConsInDee[Dee - 1, CNA_SCInDee - 1]
00076   Int_t*   fT1d_DeeSCCons;
00077 
00078   Int_t**  fT2d_RecovDeeSC;  // = CNA_SCInDee[Dee - 1, SCConsInDee - 1]
00079   Int_t*   fT1d_RecovDeeSC;
00080 
00081   //........................................................................................
00082 
00083 protected:
00084 
00085   void Init();
00086 
00087 public:
00088 
00089   //------------------------------- methods
00090 
00091   TEcnaNumbering();
00092   TEcnaNumbering(TEcnaObject*, const TString);
00093   TEcnaNumbering(const TString, const TEcnaParEcal*);
00094   ~TEcnaNumbering();
00095 
00096   void SetEcalSubDetector(const TString);
00097   void SetEcalSubDetector(const TString, const TEcnaParEcal*);
00098 
00099   //================================== BARREL
00100 
00101   void  BuildBarrelCrysTable();   // correspondance crystal# in super-module <-> (tower number, channel# in tower)
00102 
00103   Int_t Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t&, const Int_t&);
00104   Int_t Get0SMEchaFrom1SMTowAnd0TowEcha(const Int_t&, const Int_t&);
00105 
00106   Int_t Get0TowEchaFrom0SMEcha(const Int_t&);
00107   Int_t Get1SMTowFrom0SMEcha(const Int_t&);
00108   Int_t Get0TowEchaFrom1SMCrys(const Int_t&);
00109   Int_t Get1SMTowFrom1SMCrys(const Int_t&);
00110 
00111   Int_t GetHashedNumberFromIEtaAndIPhi(const Int_t&, const Int_t&);
00112   Int_t GetIEtaFromHashed(const Int_t&, const Int_t&);
00113   Int_t GetIPhiFromHashed(const Int_t&);
00114 
00115   //..........................................................................................................
00116   Double_t GetEta(const Int_t&, const Int_t&, const Int_t&);
00117   Double_t GetEtaMin(const Int_t&, const Int_t&);
00118   Double_t GetEtaMax(const Int_t&, const Int_t&);
00119 
00120   Double_t GetIEtaMin(const Int_t&, const Int_t&);    // only for axis of TowerCrystalNumbering (+0.5 shift)
00121   Double_t GetIEtaMax(const Int_t&, const Int_t&);    // only for axis of TowerCrystalNumbering (-0.5 shift)
00122 
00123   Double_t GetIEtaMin(const Int_t&);                  // only for axis of SMTowerNumbering (+0.5 shift)
00124   Double_t GetIEtaMax(const Int_t&);                  // only for axis of SMTowerNumbering (-0.5 shift)
00125 
00126   Double_t GetPhiInSM(const Int_t&, const Int_t&, const Int_t&);
00127   Double_t GetPhi(const Int_t&, const Int_t&, const Int_t&);
00128 
00129   Double_t GetPhiMin(const Int_t&, const Int_t&);
00130   Double_t GetPhiMax(const Int_t&, const Int_t&);
00131 
00132   Double_t GetJPhiMin(const Int_t&, const Int_t&);
00133   Double_t GetJPhiMax(const Int_t&, const Int_t&);
00134 
00135   Double_t GetJPhiMin(const Int_t&);
00136   Double_t GetJPhiMax(const Int_t&);
00137 
00138   Double_t GetPhiMin(const Int_t&);
00139   Double_t GetPhiMax(const Int_t&);
00140 
00141   Double_t GetSMCentralPhi(const Int_t&);
00142 
00143   TString GetXDirectionEB(const Int_t&);
00144   TString GetYDirectionEB(const Int_t&);
00145   TString GetJYDirectionEB(const Int_t&);
00146 
00147   TString GetTowerLvrbType(const Int_t&);
00148   TString GetStinLvrbType(const Int_t&);
00149 
00150   TString GetSMHalfBarrel(const Int_t&);
00151 
00152   Int_t   PlusMinusSMNumber(const Int_t&);
00153 
00154   //================================== ENDCAP
00155 
00156   void BuildEndcapCrysTable(); // correspondance crystal# in Dee <-> (SC number, channel# in SC)
00157   void BuildEndcapSCTable();   // correspondance  SC# in Dee <-> (DS#, SC# in DS, SC# for construction)
00158                                // (SC = Super Crystal, DS = Data Sector)
00159  
00160   Int_t Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(const Int_t&, const Int_t&, const TString);
00161 
00162   Int_t Get1SCEchaFrom0DeeEcha(const Int_t&);
00163   Int_t Get1DeeSCEcnaFrom0DeeEcha(const Int_t&);
00164   Int_t Get1SCEchaFrom1DeeCrys(const Int_t&, const TString);
00165   Int_t Get1DeeSCEcnaFrom1DeeCrys(const Int_t&, const TString);
00166 
00167   Int_t GetDSFrom1DeeSCEcna(const Int_t&, const Int_t&);
00168   Int_t GetDSSCFrom1DeeSCEcna(const Int_t&, const Int_t&, const Int_t&);
00169   Int_t GetDSSCFrom1DeeSCEcna(const Int_t&, const Int_t&);
00170   Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t&, const Int_t&);
00171   Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t&, const Int_t&, const Int_t&);
00172   Int_t Get1DeeSCEcnaFromDeeSCCons(const Int_t&, const Int_t&);
00173 
00174   Int_t GetIXCrysInSC(const Int_t&, const Int_t&, const Int_t&);
00175   Int_t GetJYCrysInSC(const Int_t&, const Int_t&, const Int_t&);
00176   Int_t GetIXSCInDee(const Int_t&);
00177   Int_t GetJYSCInDee(const Int_t&);
00178   Int_t GetIXCrysInDee(const Int_t&, const Int_t&, const Int_t&);
00179   Int_t GetJYCrysInDee(const Int_t&, const Int_t&, const Int_t&);
00180 
00181   Int_t GetMaxSCInDS(const Int_t&);
00182 
00183   Double_t GetIIXMin(const Int_t&);    // only for axis of SCCrystalNumbering (+0.5 shift)
00184   Double_t GetIIXMax(const Int_t&);    // only for axis of SCCrystalNumbering (-0.5 shift)
00185   Double_t GetIIXMin();                // only for axis of DeeSCNumbering (+0.5 shift)
00186   Double_t GetIIXMax();                // only for axis of DeeSCNumbering (-0.5 shift)
00187 
00188   Double_t GetJIYMin(const Int_t&, const Int_t&);
00189   Double_t GetJIYMax(const Int_t&, const Int_t&);
00190   Double_t GetJIYMin(const Int_t&);
00191   Double_t GetJIYMax(const Int_t&);
00192 
00193   Int_t   GetDeeDirIndex(const TString);
00194   Int_t   GetSCQuadTypeIndex(const TString, const TString);
00195   TString GetDeeDirViewedFromIP(const Int_t&);
00196 
00197   TString GetSCQuadFrom1DeeSCEcna(const Int_t&);
00198   TString GetEEDeeEndcap(const Int_t&);
00199   TString GetEEDeeType(const Int_t&);
00200 
00201   TString GetDeeHalfEndcap(const Int_t&);
00202 
00203   TString GetSCType(const Int_t&);  // for special (not connected) SC's
00204 
00205   Int_t StexEchaForCons(const Int_t&, const Int_t&);
00206 
00207   TString GetXDirectionEE(const Int_t&);
00208   TString GetYDirectionEE(const Int_t&);
00209   TString GetJYDirectionEE(const Int_t&);
00210 
00211   //========================================= BARREL and ENDCAP
00212 
00213   Int_t Get1StexStinFrom0StexEcha(const Int_t&);
00214 
00215   Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t&, const Int_t&);
00216   Int_t Get1StexCrysFrom1StexStinAnd0StinEcha(const Int_t&, const Int_t&, const Int_t&); // last arg = Stex Number
00217 
00218   Double_t GetIHocoMin(const Int_t&, const Int_t&);   // only for axis of TowerCrystalNumbering (+0.5 shift)
00219   Double_t GetIHocoMax(const Int_t&, const Int_t&);   // only for axis of TowerCrystalNumbering (-0.5 shift)
00220 
00221   Double_t GetVecoMin(const Int_t&, const Int_t&);
00222   Double_t GetVecoMax(const Int_t&, const Int_t&);
00223 
00224   Double_t GetJVecoMin(const Int_t&, const Int_t&);
00225   Double_t GetJVecoMax(const Int_t&, const Int_t&);
00226 
00227   TString GetStexHalfStas(const Int_t&);
00228 
00229   Int_t GetSMFromFED(const Int_t&);   // SM = SuperModule
00230   Int_t GetDSFromFED(const Int_t&);   // DS = DataSector
00231 
00232   Int_t MaxCrysInStinEcna(const Int_t&, const Int_t&, const TString); // for not connected and incomplete SC's
00233 
00234   ClassDef(TEcnaNumbering,1)  //Channel Numbering for CNA
00235 };
00236 #endif