CMS 3D CMS Logo

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

Public Member Functions

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

Private Attributes

std::string childName
 
int copyNumber
 
double dist
 
double distance
 
double distanceZ
 
double dz
 
double eta
 
std::string idNameSpace
 
double phi
 
double theta
 

Detailed Description

Definition at line 23 of file DDHCalTestBeamAlgo.cc.

Constructor & Destructor Documentation

◆ DDHCalTestBeamAlgo()

DDHCalTestBeamAlgo::DDHCalTestBeamAlgo ( )

Definition at line 51 of file DDHCalTestBeamAlgo.cc.

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

◆ ~DDHCalTestBeamAlgo()

DDHCalTestBeamAlgo::~DDHCalTestBeamAlgo ( )
override

Definition at line 57 of file DDHCalTestBeamAlgo.cc.

57 {}

Member Function Documentation

◆ execute()

void DDHCalTestBeamAlgo::execute ( DDCompactView cpv)
override

Definition at line 87 of file DDHCalTestBeamAlgo.cc.

References funct::abs(), angle_units::operators::convertRadToDeg(), funct::cos(), DDrot(), PVValHelper::dz, MillePedeFileConverter_cfg::e, PVValHelper::eta, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, funct::sin(), AlCaHLTBitMon_QueryRunRegistry::string, and theta().

87  {
88  double thetax = 90._deg + theta;
89  double sthx = sin(thetax);
90  if (std::abs(sthx) > 1.e-12)
91  sthx = 1. / sthx;
92  else
93  sthx = 1.;
94  double phix = atan2(sthx * cos(theta) * sin(phi), sthx * cos(theta) * cos(phi));
95  double thetay = 90._deg;
96  double phiy = 90._deg + phi;
97  double thetaz = theta;
98  double phiz = phi;
99 
101  std::string rotstr = childName;
102 #ifdef EDM_ML_DEBUG
103  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo: Creating a rotation " << rotstr << "\t"
104  << convertRadToDeg(thetax) << "," << convertRadToDeg(phix) << ","
105  << convertRadToDeg(thetay) << "," << convertRadToDeg(phiy) << ","
106  << convertRadToDeg(thetaz) << "," << convertRadToDeg(phiz);
107 #endif
108  rotation = DDrot(DDName(rotstr, idNameSpace), thetax, phix, thetay, phiy, thetaz, phiz);
109 
110  double r = dist * sin(theta);
111  double xpos = r * cos(phi);
112  double ypos = r * sin(phi);
113  double zpos = dist * cos(theta);
114  DDTranslation tran(xpos, ypos, zpos);
115 
116  DDName parentName = parent().name();
117  cpv.position(DDName(childName, idNameSpace), parentName, copyNumber, tran, rotation);
118 #ifdef EDM_ML_DEBUG
119  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo: " << DDName(childName, idNameSpace) << " number " << copyNumber
120  << " positioned in " << parentName << " at " << tran << " with " << rotation;
121 
122  xpos = (dist - dz) * sin(theta) * cos(phi);
123  ypos = (dist - dz) * sin(theta) * sin(phi);
124  zpos = (dist - dz) * cos(theta);
125 
126  edm::LogInfo("HCalGeom") << "DDHCalTestBeamAlgo: Suggested Beam position "
127  << "(" << xpos << ", " << ypos << ", " << zpos << ") and (dist, eta, phi) = (" << (dist - dz)
128  << ", " << eta << ", " << phi << ")";
129 #endif
130 }
Log< level::Info, true > LogVerbatim
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
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.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
Log< level::Info, false > LogInfo
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7

◆ initialize()

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

Definition at line 59 of file DDHCalTestBeamAlgo.cc.

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

63  {
64  eta = nArgs["Eta"];
65  theta = 2.0 * atan(exp(-eta));
66  phi = nArgs["Phi"];
67  distance = nArgs["Dist"];
68  distanceZ = nArgs["DistZ"];
69  dz = nArgs["Dz"];
70  copyNumber = int(nArgs["Number"]);
71  dist = (distance + distanceZ / sin(theta));
72 #ifdef EDM_ML_DEBUG
73  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo: Parameters for position"
74  << "ing--"
75  << " Eta " << eta << "\tPhi " << convertRadToDeg(phi) << "\tTheta "
76  << convertRadToDeg(theta) << "\tDistance " << distance << "/" << distanceZ << "/" << dist
77  << "\tDz " << dz << "\tcopyNumber " << copyNumber;
78 #endif
80  childName = sArgs["ChildName"];
81 #ifdef EDM_ML_DEBUG
82  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo:Parent " << parent().name() << "\tChild " << childName
83  << " NameSpace " << idNameSpace;
84 #endif
85 }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
static std::string & ns()

Member Data Documentation

◆ childName

std::string DDHCalTestBeamAlgo::childName
private

Definition at line 48 of file DDHCalTestBeamAlgo.cc.

◆ copyNumber

int DDHCalTestBeamAlgo::copyNumber
private

Definition at line 45 of file DDHCalTestBeamAlgo.cc.

◆ dist

double DDHCalTestBeamAlgo::dist
private

Definition at line 43 of file DDHCalTestBeamAlgo.cc.

◆ distance

double DDHCalTestBeamAlgo::distance
private

Definition at line 41 of file DDHCalTestBeamAlgo.cc.

◆ distanceZ

double DDHCalTestBeamAlgo::distanceZ
private

Definition at line 42 of file DDHCalTestBeamAlgo.cc.

◆ dz

double DDHCalTestBeamAlgo::dz
private

◆ eta

double DDHCalTestBeamAlgo::eta
private

◆ idNameSpace

std::string DDHCalTestBeamAlgo::idNameSpace
private

Definition at line 47 of file DDHCalTestBeamAlgo.cc.

◆ phi

double DDHCalTestBeamAlgo::phi
private

◆ theta

double DDHCalTestBeamAlgo::theta
private

Definition at line 40 of file DDHCalTestBeamAlgo.cc.

Referenced by Tau.Tau::zImpact().