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 }

◆ ~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.

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 }

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

◆ 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.

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 }

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

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().

DDHCalTestBeamAlgo::childName
std::string childName
Definition: DDHCalTestBeamAlgo.cc:48
DDrot
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
DDHCalTestBeamAlgo::dz
double dz
Definition: DDHCalTestBeamAlgo.cc:44
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDHCalTestBeamAlgo::dist
double dist
Definition: DDHCalTestBeamAlgo.cc:43
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
DDHCalTestBeamAlgo::distanceZ
double distanceZ
Definition: DDHCalTestBeamAlgo.cc:42
DDHCalTestBeamAlgo::copyNumber
int copyNumber
Definition: DDHCalTestBeamAlgo.cc:45
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDHCalTestBeamAlgo::distance
double distance
Definition: DDHCalTestBeamAlgo.cc:41
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
createfilelist.int
int
Definition: createfilelist.py:10
DDHCalTestBeamAlgo::phi
double phi
Definition: DDHCalTestBeamAlgo.cc:39
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDHCalTestBeamAlgo::theta
double theta
Definition: DDHCalTestBeamAlgo.cc:40
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
class-composition.parent
parent
Definition: class-composition.py:98
DDHCalTestBeamAlgo::eta
double eta
Definition: DDHCalTestBeamAlgo.cc:38
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
DDHCalTestBeamAlgo::idNameSpace
std::string idNameSpace
Definition: DDHCalTestBeamAlgo.cc:47