CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDHCalTBZposAlgo Class Reference
Inheritance diagram for DDHCalTBZposAlgo:

Public Member Functions

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

Private Attributes

std::string childName
 
int copyNumber
 
double dist
 
double eta
 
std::string idNameSpace
 
double shiftX
 
double shiftY
 
double theta
 
double tilt
 
double zoffset
 

Detailed Description

Definition at line 25 of file DDHCalTBZposAlgo.cc.

Constructor & Destructor Documentation

◆ DDHCalTBZposAlgo()

DDHCalTBZposAlgo::DDHCalTBZposAlgo ( )

Definition at line 53 of file DDHCalTBZposAlgo.cc.

53  {
54 #ifdef EDM_ML_DEBUG
55  edm::LogVerbatim("HCalGeom") << "DDHCalTBZposAlgo: Creating an instance";
56 #endif
57 }
Log< level::Info, true > LogVerbatim

◆ ~DDHCalTBZposAlgo()

DDHCalTBZposAlgo::~DDHCalTBZposAlgo ( )
override

Definition at line 59 of file DDHCalTBZposAlgo.cc.

59 {}

Member Function Documentation

◆ execute()

void DDHCalTBZposAlgo::execute ( DDCompactView cpv)
override

Definition at line 89 of file DDHCalTBZposAlgo.cc.

References submitPVValidationJobs::child, angle_units::operators::convertRadToDeg(), funct::cos(), DDrot(), DDSplit(), first, formatAsDegrees(), class-composition::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, edm::second(), funct::sin(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), theta(), and x.

89  {
90  DDName mother = parent().name();
92 
93  double thetax = 90._deg - theta;
94  double z = zoffset + dist * tan(thetax);
95  double x = shiftX - shiftY * sin(tilt);
96  double y = shiftY * cos(tilt);
97  DDTranslation tran(x, y, z);
99  if (tilt != 0) {
100  std::string rotstr = "R" + formatAsDegrees(tilt);
101  rot = DDRotation(DDName(rotstr, idNameSpace));
102  if (!rot) {
103 #ifdef EDM_ML_DEBUG
104  edm::LogVerbatim("HCalGeom") << "DDHCalZposAlgo: Creating a rotation " << DDName(rotstr, idNameSpace) << "\t90, "
105  << convertRadToDeg(tilt) << ",90," << (90 + convertRadToDeg(tilt)) << ", 0, 0";
106 #endif
107  rot = DDrot(DDName(rotstr, idNameSpace), 90._deg, tilt, 90._deg, (90._deg + tilt), 0.0, 0.0);
108  }
109  }
110  cpv.position(child, mother, copyNumber, tran, rot);
111 #ifdef EDM_ML_DEBUG
112  edm::LogVerbatim("HCalGeom") << "DDHCalTBZposAlgo: " << child << " number " << copyNumber << " positioned in "
113  << mother << " at " << tran << " with " << rot;
114 #endif
115 }
Log< level::Info, true > LogVerbatim
std::string idNameSpace
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
std::string childName
std::string formatAsDegrees(double radianVal)
Definition: DDTypes.cc:68
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7

◆ initialize()

void DDHCalTBZposAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 61 of file DDHCalTBZposAlgo.cc.

References angle_units::operators::convertRadToDeg(), PVValHelper::eta, JetChargeProducer_cfi::exp, createfilelist::int, DDCurrentNamespace::ns(), class-composition::parent, and theta().

65  {
66  eta = nArgs["Eta"];
67  theta = 2.0 * atan(exp(-eta));
68  shiftX = nArgs["ShiftX"];
69  shiftY = nArgs["ShiftY"];
70  zoffset = nArgs["Zoffset"];
71  dist = nArgs["Distance"];
72  tilt = nArgs["TiltAngle"];
73  copyNumber = int(nArgs["Number"]);
74  edm::LogVerbatim("HCalGeom") << "DDHCalTBZposAlgo: Parameters for position"
75  << "ing--"
76  << " Eta " << eta << "\tTheta " << convertRadToDeg(theta) << "\tShifts " << shiftX
77  << ", " << shiftY << " along x, y "
78  << "axes; \tZoffest " << zoffset << "\tRadial Distance " << dist << "\tTilt angle "
79  << convertRadToDeg(tilt) << "\tcopyNumber " << copyNumber;
80 
82  childName = sArgs["ChildName"];
83 #ifdef EDM_ML_DEBUG
84  edm::LogVerbatim("HCalGeom") << "DDHCalTBZposAlgo: Parent " << parent().name() << "\tChild " << childName
85  << " NameSpace " << idNameSpace;
86 #endif
87 }
Log< level::Info, true > LogVerbatim
std::string idNameSpace
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
static std::string & ns()
std::string childName

Member Data Documentation

◆ childName

std::string DDHCalTBZposAlgo::childName
private

Definition at line 50 of file DDHCalTBZposAlgo.cc.

◆ copyNumber

int DDHCalTBZposAlgo::copyNumber
private

Definition at line 47 of file DDHCalTBZposAlgo.cc.

◆ dist

double DDHCalTBZposAlgo::dist
private

Definition at line 45 of file DDHCalTBZposAlgo.cc.

◆ eta

double DDHCalTBZposAlgo::eta
private

◆ idNameSpace

std::string DDHCalTBZposAlgo::idNameSpace
private

Definition at line 49 of file DDHCalTBZposAlgo.cc.

◆ shiftX

double DDHCalTBZposAlgo::shiftX
private

Definition at line 43 of file DDHCalTBZposAlgo.cc.

◆ shiftY

double DDHCalTBZposAlgo::shiftY
private

Definition at line 42 of file DDHCalTBZposAlgo.cc.

◆ theta

double DDHCalTBZposAlgo::theta
private

Definition at line 41 of file DDHCalTBZposAlgo.cc.

Referenced by Tau.Tau::zImpact().

◆ tilt

double DDHCalTBZposAlgo::tilt
private

Definition at line 46 of file DDHCalTBZposAlgo.cc.

◆ zoffset

double DDHCalTBZposAlgo::zoffset
private

Definition at line 44 of file DDHCalTBZposAlgo.cc.