HcalGeomParameters

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
#ifndef HcalCommonData_HcalGeomParameters_h
#define HcalCommonData_HcalGeomParameters_h

/** \class HcalGeomParameters
 *
 * this class extracts some geometry constants from CompactView
 * to be used by Reco Geometry/Topology
 *  
 *  $Date: 2015/06/25 00:06:50 $
 * \author Sunanda Banerjee, Fermilab <sunanda.banerjee@cern.ch>
 *
 */

#include <string>
#include <vector>
#include <iostream>

#include "DetectorDescription/Core/interface/DDFilteredView.h"
#include "DetectorDescription/DDCMS/interface/DDFilteredView.h"
#include "DetectorDescription/DDCMS/interface/DDCompactView.h"
#include "Geometry/HcalCommonData/interface/HcalCellType.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
#include "DD4hep/DD4hepUnits.h"

class HcalParameters;

class HcalGeomParameters {
public:
  static constexpr double k_ScaleFromDDD = 0.1;
  static constexpr double k_ScaleToDDD = 10.0;
  static constexpr double k_ScaleFromDDDToG4 = 1.0;
  static constexpr double k_ScaleToDDDFromG4 = 1.0;
  static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
  static constexpr double k_ScaleToDD4hep = dd4hep::cm;
  static constexpr double k_ScaleFromDD4hepToG4 = (1.0 / dd4hep::mm);
  static constexpr double k_ScaleToDD4hepFromG4 = dd4hep::mm;

  HcalGeomParameters() = default;

  double getConstDzHF() const { return dzVcal_; }
  void getConstRHO(std::vector<double>&) const;
  std::vector<int> getModHalfHBHE(const int type) const;
  void loadGeometry(const DDFilteredView& _fv, HcalParameters& php);
  void loadGeometry(const cms::DDCompactView& cpv, HcalParameters& php);

private:
  unsigned find(int element, std::vector<int>& array) const;
  double getEta(double r, double z) const;
  void clear(HcalParameters& php);
  void loadfinal(HcalParameters& php);

  int nzHB_, nmodHB_;         // Number of halves and modules in HB
  int nzHE_, nmodHE_;         // Number of halves and modules in HE
  double etaHO_[4], rminHO_;  // eta in HO ring boundaries
  double zVcal_;              // Z-position  of the front of HF
  double dzVcal_;             // Half length of the HF
  double dlShort_;            // Diference of length between long and short
  static const int maxLayer_ = 20;
  static const int kHELayer1_ = 21, kHELayer2_ = 71;
  std::vector<double> rb_, ze_, thkb_, thke_;
  std::vector<int> ib_, ie_, izb_, phib_, ize_, phie_;
  std::vector<double> rxb_, rminHE_, rmaxHE_;
};

#endif