Skip to content

Commit

Permalink
Merge pull request #27669 from ianna/dd4hep-muon-algo-to-geom-v1
Browse files Browse the repository at this point in the history
DD4hep: Migrate Muon Algorithms to Geometry/MuonCommonData Package
  • Loading branch information
cmsbuild committed Aug 2, 2019
2 parents 0151b74 + 389b250 commit 810780f
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 88 deletions.
7 changes: 7 additions & 0 deletions Geometry/MuonCommonData/plugins/BuildFile.xml
Expand Up @@ -3,3 +3,10 @@
<use name="FWCore/PluginManager"/>
<flags EDM_PLUGIN="1"/>
</library>

<library name="DD4hep_GeometryMuonCommonDataPlugins" file="dd4hep/*.cc">
<use name="DetectorDescription/DDCMS"/>
<use name="dd4hep"/>
<lib name="Geom"/>
<flags DD4HEP_PLUGIN="1"/>
</library>
40 changes: 38 additions & 2 deletions Geometry/MuonCommonData/plugins/DDGEMAngular.cc
Expand Up @@ -5,13 +5,47 @@

#include <cmath>
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "DetectorDescription/Core/interface/DDLogicalPart.h"
#include "DetectorDescription/Core/interface/DDCurrentNamespace.h"
#include "DataFormats/Math/interface/GeantUnits.h"
#include "Geometry/MuonCommonData/plugins/DDGEMAngular.h"
#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h"
#include "DetectorDescription/Core/interface/DDTypes.h"
#include "DetectorDescription/Core/interface/DDAlgorithm.h"

class DDGEMAngular : public DDAlgorithm {
public:
//Constructor and Destructor
DDGEMAngular();
~DDGEMAngular() 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 startAngle; //Start angle
double stepAngle; //Step angle
int invert; //inverted or forward
double rPos; //Radial position of center
double zoffset; //Offset in z
int n; //Mumber of copies
int startCopyNo; //Start copy Number
int incrCopyNo; //Increment copy Number

std::string rotns; //Namespace for rotation matrix
std::string idNameSpace; //Namespace of this and ALL sub-parts
std::string childName; //Children name
};

using namespace geant_units::operators;

Expand Down Expand Up @@ -97,3 +131,5 @@ void DDGEMAngular::execute(DDCompactView& cpv) {
copyNo += incrCopyNo;
}
}

DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDGEMAngular, "muon:DDGEMAngular");
39 changes: 0 additions & 39 deletions Geometry/MuonCommonData/plugins/DDGEMAngular.h

This file was deleted.

37 changes: 36 additions & 1 deletion Geometry/MuonCommonData/plugins/DDMuonAngular.cc
Expand Up @@ -5,12 +5,45 @@

#include <cmath>
#include <algorithm>
#include <map>
#include <string>
#include <vector>

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "DetectorDescription/Core/interface/DDLogicalPart.h"
#include "DetectorDescription/Core/interface/DDCurrentNamespace.h"
#include "DataFormats/Math/interface/GeantUnits.h"
#include "Geometry/MuonCommonData/plugins/DDMuonAngular.h"
#include "DetectorDescription/Core/interface/DDTypes.h"
#include "DetectorDescription/Core/interface/DDAlgorithm.h"
#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h"

class DDMuonAngular : public DDAlgorithm {
public:
//Constructor and Destructor
DDMuonAngular();
~DDMuonAngular() 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 startAngle; //Start angle
double stepAngle; //Step angle
double zoffset; //Offset in z
int n; //Mumber of copies
int startCopyNo; //Start copy Number
int incrCopyNo; //Increment copy Number

std::string rotns; //Namespace for rotation matrix
std::string idNameSpace; //Namespace of this and ALL sub-parts
std::string childName; //Children name
};

using namespace geant_units::operators;

Expand Down Expand Up @@ -86,3 +119,5 @@ void DDMuonAngular::execute(DDCompactView& cpv) {
copyNo += incrCopyNo;
}
}

DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDMuonAngular, "muon:DDMuonAngular");
37 changes: 0 additions & 37 deletions Geometry/MuonCommonData/plugins/DDMuonAngular.h

This file was deleted.

9 changes: 0 additions & 9 deletions Geometry/MuonCommonData/plugins/module.cc

This file was deleted.

0 comments on commit 810780f

Please sign in to comment.