CMS 3D CMS Logo

HcalNumberingFromDDD.h

Go to the documentation of this file.
00001 
00002 // File: HcalNumberingFromDDD.h
00003 // Description: Usage of DDD to get to numbering scheme for hadron calorimeter
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, 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   std::vector<HcalCellType::HcalCellType> HcalCellTypes() const;
00043   std::vector<HcalCellType::HcalCellType> HcalCellTypes(HcalSubdetector) const;
00044 
00045 private:
00046 
00047   double         getEta(int det, int etaR, int zside, int depth=1) const;
00048   double         getEta(double r, double z) const;
00049   double         deltaEta(int det, int eta, int depth) const;
00050   void           initialize(std::string & name, const DDCompactView & cpv);
00051   void           loadSpecPars(DDFilteredView);
00052   void           loadGeometry(DDFilteredView);
00053   std::vector<double> getDDDArray(const std::string &, const DDsvalues_type &,
00054                                   int&) const;
00055   int            getShift(HcalSubdetector subdet, int depth) const;
00056   double         getGain (HcalSubdetector subdet, int depth) const;
00057   unsigned       find (int element, std::vector<int> array) const;
00058 
00059 private:
00060 
00061   std::vector<double> phioff;   // Phi offset for barrel, endcap, forward
00062   std::vector<double> etaTable; // Eta table 
00063   int                 nEta;     // Number of bins in eta for HB and HE
00064   std::vector<double> rTable;   // R-table
00065   int                 nR;       // Number of bins in r
00066   std::vector<int>    etaMin;   // Minimum eta bin number for HB/HE/HF
00067   std::vector<int>    etaMax;   // Maximum eta bin number for HB/HE/HF
00068   std::vector<double> phibin;   // Phi step for all eta bins (HB, HE and HF)
00069   int                 nPhi;     // Number of bins in dphi
00070   std::vector<int>    depth1;   // Maximum layer number for depth 1
00071   std::vector<int>    depth2;   // Maximum layer number for depth 2
00072   std::vector<int>    depth3;   // Maximum layer number for depth 3
00073   int                 nDepth;   // Number of bins in depth1/depth2/depth3
00074   std::vector<double> gainHB;   // Gain factor   for HB
00075   std::vector<int>    shiftHB;  // Readout shift ..  ..
00076   std::vector<double> gainHE;   // Gain factor   for HE
00077   std::vector<int>    shiftHE;  // Readout shift ..  ..
00078   std::vector<double> gainHF;   // Gain factor   for HF
00079   std::vector<int>    shiftHF;  // Readout shift ..  ..
00080   double              zVcal;    // Z-position  of the HF
00081   double              dzVcal;   // Half length of the HF
00082   std::vector<int>    nOff;     // Speical eta bin #'s in barrel and endcap
00083   std::vector<double> rHB;      // Radial positions of HB layers
00084   std::vector<double> zHE;      // Z-positions of HE layers
00085   int                 nzHB, nmodHB; // Number of halves and modules in HB
00086   int                 nzHE, nmodHE; // Number of halves and modules in HE
00087 };
00088 
00089 #endif

Generated on Tue Jun 9 17:37:30 2009 for CMSSW by  doxygen 1.5.4