00001
00002
00003
00005 #ifndef HcalNumberingFromDDD_h
00006 #define HcalNumberingFromDDD_h
00007
00008 #include "Geometry/HcalCommonData/interface/HcalCellType.h"
00009 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00010 #include "DetectorDescription/Core/interface/DDsvalues.h"
00011
00012 #include "CLHEP/Vector/ThreeVector.h"
00013
00014 #include <vector>
00015 #include <string>
00016
00017 class DDCompactView;
00018 class DDFilteredView;
00019
00020 class HcalNumberingFromDDD {
00021
00022 public:
00023
00024 HcalNumberingFromDDD(std::string & name, const DDCompactView & cpv);
00025 ~HcalNumberingFromDDD();
00026
00027 struct HcalID {
00028 int subdet, zside, depth, etaR, phi, phis, lay;
00029 HcalID(int det=0, int zs=0, int d=0, int et=0, int fi=0, int phiskip=0, int ly=-1) :
00030 subdet(det), zside(zs), depth(d), etaR(et), phi(fi), phis(phiskip), lay(ly) {}
00031 };
00032
00033 HcalID unitID(int det, const CLHEP::Hep3Vector& pos, int depth, int lay=-1) const;
00034 HcalID unitID(double eta, double phi, int depth=1, int lay=-1) const;
00035 HcalID unitID(int det, double etaR, double phi, int depth,
00036 int lay=-1) const;
00037 HcalID unitID(int det, int zside, int depth, int etaR, int phi,
00038 int lay=-1) const;
00039 HcalCellType::HcalCell cell(int det, int zside, int depth, int etaR,
00040 int iphi, bool corr=true) const;
00041 std::vector<double> getEtaTable() const;
00042 unsigned int numberOfCells(HcalSubdetector) const;
00043 std::vector<HcalCellType> HcalCellTypes() const;
00044 std::vector<HcalCellType> HcalCellTypes(HcalSubdetector) const;
00045 void printTile();
00046
00047 private:
00048
00049 double getEta(int det, int etaR, int zside, int depth=1) const;
00050 double getEta(double r, double z) const;
00051 double deltaEta(int det, int eta, int depth) const;
00052 void initialize(std::string & name, const DDCompactView & cpv);
00053 void loadSpecPars(const DDFilteredView&);
00054 void loadGeometry(const DDFilteredView&);
00055 std::vector<double> getDDDArray(const std::string &, const DDsvalues_type &,
00056 int&) const;
00057 int getShift(HcalSubdetector subdet, int depth) const;
00058 double getGain (HcalSubdetector subdet, int depth) const;
00059 unsigned find (int element, std::vector<int>& array) const;
00060 int unitPhi (int det, int etaR) const;
00061 void tileHB(int eta, int depth);
00062 void tileHE(int eta, int depth);
00063 double getEtaHO(double& etaR, double& x, double& y, double& z) const;
00064
00065 private:
00066
00067 std::vector<double> phioff;
00068 std::vector<double> etaTable;
00069 int nEta;
00070 std::vector<double> rTable;
00071 int nR;
00072 std::vector<int> etaMin;
00073 std::vector<int> etaMax;
00074 std::vector<double> phibin;
00075 int nPhi;
00076 std::vector<int> depth1;
00077 std::vector<int> depth2;
00078 std::vector<int> depth3;
00079 int nDepth;
00080 std::vector<double> gainHB;
00081 std::vector<int> shiftHB;
00082 std::vector<double> gainHE;
00083 std::vector<int> shiftHE;
00084 std::vector<double> gainHF;
00085 std::vector<int> shiftHF;
00086 double zVcal;
00087 double dzVcal;
00088 double dlShort;
00089 std::vector<int> nOff;
00090 std::vector<double> rHB, drHB;
00091 std::vector<double> zHE, dzHE;
00092 std::vector<double> zho;
00093 int nzHB, nmodHB;
00094 int nzHE, nmodHE;
00095 double etaHO[4], rminHO;
00096 std::vector<double> rhoxb, zxb, dyxb, dzxb;
00097 std::vector<int> layb, laye;
00098 std::vector<double> zxe, rhoxe, dyxe, dx1e, dx2e;
00099 };
00100
00101 #endif