Skip to content

Commit

Permalink
Merge pull request #27711 from bsunanda/Phase2-hgx209
Browse files Browse the repository at this point in the history
Phase2-hgx209 Clean up the plugin area in view of transition to dd4hep
  • Loading branch information
cmsbuild authored Aug 11, 2019
2 parents c80860c + c1e7d61 commit b1bd95b
Show file tree
Hide file tree
Showing 25 changed files with 602 additions and 644 deletions.
49 changes: 42 additions & 7 deletions Geometry/HGCalCommonData/plugins/DDHGCalCell.cc
Original file line number Diff line number Diff line change
@@ -1,14 +1,47 @@
#include "Geometry/HGCalCommonData/plugins/DDHGCalCell.h"
#include "DetectorDescription/Core/interface/DDAlgorithm.h"
#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h"
#include "DetectorDescription/Core/interface/DDCurrentNamespace.h"
#include "DetectorDescription/Core/interface/DDLogicalPart.h"
#include "DetectorDescription/Core/interface/DDMaterial.h"
#include "DetectorDescription/Core/interface/DDSolid.h"
#include "DetectorDescription/Core/interface/DDSplit.h"
#include "DetectorDescription/Core/interface/DDTypes.h"
#include "DetectorDescription/Core/interface/DDutils.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/PluginManager/interface/PluginFactory.h"

#include <string>
#include <vector>

//#define EDM_ML_DEBUG

class DDHGCalCell : public DDAlgorithm {
public:
// Constructor and Destructor
DDHGCalCell();
~DDHGCalCell() override;

void initialize(const DDNumericArguments& nArgs,
const DDVectorArguments& vArgs,
const DDMapArguments& mArgs,
const DDStringArguments& sArgs,
const DDStringVectorArguments& vsArgs) override;
void execute(DDCompactView& cpv) override;

private:
double waferSize_; // Wafer Size
double waferT_; // Wafer Thickness
double cellT_; // Cell Thickness
int nCells_; // Number of columns (8:12)
int posSens_; // Position depleted layer
std::string material_; // Name of the material
std::string fullCN_, fullSensN_; // Name of full cell
std::vector<std::string> truncCN_, truncSensN_; // Names of truncated cells
std::vector<std::string> extenCN_, extenSensN_; // Names of extended cells
std::vector<std::string> cornrCN_, cornrSensN_; // Names of corner cells
std::string nameSpace_; // Namespace to be used
};

DDHGCalCell::DDHGCalCell() {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: Creating an instance";
Expand All @@ -17,11 +50,11 @@ DDHGCalCell::DDHGCalCell() {

DDHGCalCell::~DDHGCalCell() {}

void DDHGCalCell::initialize(const DDNumericArguments &nArgs,
const DDVectorArguments &,
const DDMapArguments &,
const DDStringArguments &sArgs,
const DDStringVectorArguments &vsArgs) {
void DDHGCalCell::initialize(const DDNumericArguments& nArgs,
const DDVectorArguments&,
const DDMapArguments&,
const DDStringArguments& sArgs,
const DDStringVectorArguments& vsArgs) {
waferSize_ = nArgs["WaferSize"];
waferT_ = nArgs["WaferThick"];
cellT_ = nArgs["CellThick"];
Expand Down Expand Up @@ -63,7 +96,7 @@ void DDHGCalCell::initialize(const DDNumericArguments &nArgs,
#endif
}

void DDHGCalCell::execute(DDCompactView &cpv) {
void DDHGCalCell::execute(DDCompactView& cpv) {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "==>> Executing DDHGCalCell...";
#endif
Expand Down Expand Up @@ -228,3 +261,5 @@ void DDHGCalCell::execute(DDCompactView &cpv) {
#endif
}
}

DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalCell, "hgcal:DDHGCalCell");
36 changes: 0 additions & 36 deletions Geometry/HGCalCommonData/plugins/DDHGCalCell.h

This file was deleted.

76 changes: 75 additions & 1 deletion Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,91 @@
// Description: Geometry factory class for HGCal (EE and HESil)
///////////////////////////////////////////////////////////////////////////////

#include "Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.h"
#include "DataFormats/Math/interface/GeantUnits.h"
#include "DetectorDescription/Core/interface/DDAlgorithm.h"
#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h"
#include "DetectorDescription/Core/interface/DDCurrentNamespace.h"
#include "DetectorDescription/Core/interface/DDLogicalPart.h"
#include "DetectorDescription/Core/interface/DDMaterial.h"
#include "DetectorDescription/Core/interface/DDSolid.h"
#include "DetectorDescription/Core/interface/DDSplit.h"
#include "DetectorDescription/Core/interface/DDTypes.h"
#include "DetectorDescription/Core/interface/DDutils.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h"

#include <cmath>
#include <memory>
#include <string>
#include <unordered_set>
#include <vector>

//#define EDM_ML_DEBUG
using namespace geant_units::operators;

class DDHGCalEEAlgo : public DDAlgorithm {
public:
// Constructor and Destructor
DDHGCalEEAlgo(); // const std::string & name);
~DDHGCalEEAlgo() override;

void initialize(const DDNumericArguments& nArgs,
const DDVectorArguments& vArgs,
const DDMapArguments& mArgs,
const DDStringArguments& sArgs,
const DDStringVectorArguments& vsArgs) override;
void execute(DDCompactView& cpv) override;

protected:
void constructLayers(const DDLogicalPart&, DDCompactView& cpv);
void positionSensitive(const DDLogicalPart& glog,
double rin,
double rout,
double zpos,
int layertype,
int layercenter,
DDCompactView& cpv);

private:
HGCalGeomTools geomTools_;
std::unique_ptr<HGCalWaferType> waferType_;

std::vector<std::string> wafers_; // Wafers
std::vector<std::string> materials_; // Materials
std::vector<std::string> names_; // Names
std::vector<double> thick_; // Thickness of the material
std::vector<int> copyNumber_; // Initial copy numbers
std::vector<int> layers_; // Number of layers in a section
std::vector<double> layerThick_; // Thickness of each section
std::vector<int> layerType_; // Type of the layer
std::vector<int> layerSense_; // Content of a layer (sensitive?)
std::vector<int> layerCenter_; // Centering of the wafers
int firstLayer_; // Copy # of the first sensitive layer
int absorbMode_; // Absorber mode
double zMinBlock_; // Starting z-value of the block
std::vector<double> rad100to200_; // Parameters for 120-200mum trans.
std::vector<double> rad200to300_; // Parameters for 200-300mum trans.
double zMinRadPar_; // Minimum z for radius parametriz.
int choiceType_; // Type of parametrization to be used
int nCutRadPar_; // Cut off threshold for corners
double fracAreaMin_; // Minimum fractional conatined area
double waferSize_; // Width of the wafer
double waferSepar_; // Sensor separation
int sectors_; // Sectors
std::vector<double> slopeB_; // Slope at the lower R
std::vector<double> zFrontB_; // Starting Z values for the slopes
std::vector<double> rMinFront_; // Corresponding rMin's
std::vector<double> slopeT_; // Slopes at the larger R
std::vector<double> zFrontT_; // Starting Z values for the slopes
std::vector<double> rMaxFront_; // Corresponding rMax's
std::string nameSpace_; // Namespace of this and ALL sub-parts
std::unordered_set<int> copies_; // List of copy #'s
double alpha_, cosAlpha_;
};

DDHGCalEEAlgo::DDHGCalEEAlgo() {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: Creating an instance";
Expand Down Expand Up @@ -338,3 +410,5 @@ void DDHGCalEEAlgo::positionSensitive(const DDLogicalPart& glog,
<< ntype[5] << ") for " << glog.ddname() << " R " << rin << ":" << rout;
#endif
}

DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalEEAlgo, "hgcal:DDHGCalEEAlgo");
76 changes: 0 additions & 76 deletions Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.h

This file was deleted.

Loading

0 comments on commit b1bd95b

Please sign in to comment.