GEMGeometryBuilder

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 66 67 68 69 70 71 72 73 74
#ifndef Geometry_GEMGeometry_GEMGeometryBuilder_H
#define Geometry_GEMGeometry_GEMGeometryBuilder_H

#include "DataFormats/GeometrySurface/interface/Plane.h"
/*
//\class GEMGeometryBuilder

 Description: GEM Geometry builder from DD & DD4hep
              DD4hep part added to the original old file (DD version) made by M. Maggi (INFN Bari)
//
// Author:  Sergio Lo Meo (sergio.lo.meo@cern.ch) following what Ianna Osburne made for DTs (DD4hep migration)
//          Created:  27 Jan 2020 
*/
#include <string>
#include <map>
#include <vector>
#include "DataFormats/MuonDetId/interface/GEMDetId.h"
#include "DD4hep/DD4hepUnits.h"

class DDCompactView;
class DDFilteredView;
namespace cms {
  class DDFilteredView;
  class DDCompactView;
  class MuonNumbering;
}  // namespace cms
class GEMGeometry;
class GEMSuperChamber;
class GEMChamber;
class GEMEtaPartition;
class MuonGeometryConstants;

class GEMGeometryBuilder {
public:
  GEMGeometryBuilder();

  ~GEMGeometryBuilder();

  // for DDD
  void build(GEMGeometry& theGeometry, const DDCompactView* cview, const MuonGeometryConstants& muonConstants);
  // for DD4hep
  void build(GEMGeometry& theGeometry, const cms::DDCompactView* cview, const MuonGeometryConstants& muonConstants);

private:
  std::map<GEMDetId, std::vector<GEMDetId>> chids;

  // for DDD
  typedef ReferenceCountingPointer<BoundPlane> RCPBoundPlane;

  RCPBoundPlane boundPlane(const DDFilteredView& fv, Bounds* bounds, bool isOddChamber) const;

  GEMSuperChamber* buildSuperChamber(DDFilteredView& fv, GEMDetId detId) const;

  GEMChamber* buildChamber(DDFilteredView& fv, GEMDetId detId) const;

  GEMEtaPartition* buildEtaPartition(DDFilteredView& fv, GEMDetId detId) const;

  // for DD4hep

  RCPBoundPlane boundPlane(const cms::DDFilteredView& fv, Bounds* bounds, bool isOddChamber) const;

  GEMSuperChamber* buildSuperChamber(cms::DDFilteredView& fv, GEMDetId detId) const;

  GEMChamber* buildChamber(cms::DDFilteredView& fv, GEMDetId detId) const;

  GEMEtaPartition* buildEtaPartition(cms::DDFilteredView& fv, GEMDetId detId) const;

  // Common
  void buildRegions(GEMGeometry&, const std::vector<GEMSuperChamber*>&, bool demonstratorGeometry);

  static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
};

#endif