Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:45

0001 #ifndef HcalCommonData_HcalGeomParameters_h
0002 #define HcalCommonData_HcalGeomParameters_h
0003 
0004 /** \class HcalGeomParameters
0005  *
0006  * this class extracts some geometry constants from CompactView
0007  * to be used by Reco Geometry/Topology
0008  *  
0009  *  $Date: 2015/06/25 00:06:50 $
0010  * \author Sunanda Banerjee, Fermilab <sunanda.banerjee@cern.ch>
0011  *
0012  */
0013 
0014 #include <string>
0015 #include <vector>
0016 #include <iostream>
0017 
0018 #include "DetectorDescription/Core/interface/DDFilteredView.h"
0019 #include "DetectorDescription/DDCMS/interface/DDFilteredView.h"
0020 #include "DetectorDescription/DDCMS/interface/DDCompactView.h"
0021 #include "Geometry/HcalCommonData/interface/HcalCellType.h"
0022 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0023 #include "DD4hep/DD4hepUnits.h"
0024 
0025 class HcalParameters;
0026 
0027 class HcalGeomParameters {
0028 public:
0029   static constexpr double k_ScaleFromDDD = 0.1;
0030   static constexpr double k_ScaleToDDD = 10.0;
0031   static constexpr double k_ScaleFromDDDToG4 = 1.0;
0032   static constexpr double k_ScaleToDDDFromG4 = 1.0;
0033   static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
0034   static constexpr double k_ScaleToDD4hep = dd4hep::cm;
0035   static constexpr double k_ScaleFromDD4hepToG4 = (1.0 / dd4hep::mm);
0036   static constexpr double k_ScaleToDD4hepFromG4 = dd4hep::mm;
0037 
0038   HcalGeomParameters() = default;
0039 
0040   double getConstDzHF() const { return dzVcal_; }
0041   void getConstRHO(std::vector<double>&) const;
0042   std::vector<int> getModHalfHBHE(const int type) const;
0043   void loadGeometry(const DDFilteredView& _fv, HcalParameters& php);
0044   void loadGeometry(const cms::DDCompactView& cpv, HcalParameters& php);
0045 
0046 private:
0047   unsigned find(int element, std::vector<int>& array) const;
0048   double getEta(double r, double z) const;
0049   void clear(HcalParameters& php);
0050   void loadfinal(HcalParameters& php);
0051 
0052   int nzHB_, nmodHB_;         // Number of halves and modules in HB
0053   int nzHE_, nmodHE_;         // Number of halves and modules in HE
0054   double etaHO_[4], rminHO_;  // eta in HO ring boundaries
0055   double zVcal_;              // Z-position  of the front of HF
0056   double dzVcal_;             // Half length of the HF
0057   double dlShort_;            // Diference of length between long and short
0058   static const int maxLayer_ = 20;
0059   static const int kHELayer1_ = 21, kHELayer2_ = 71;
0060   std::vector<double> rb_, ze_, thkb_, thke_;
0061   std::vector<int> ib_, ie_, izb_, phib_, ize_, phie_;
0062   std::vector<double> rxb_, rminHE_, rmaxHE_;
0063 };
0064 
0065 #endif