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 24 of file DDHCalTestBeamAlgo.cc.

Constructor & Destructor Documentation

◆ DDHCalTestBeamAlgo()

DDHCalTestBeamAlgo::DDHCalTestBeamAlgo ( )

Definition at line 52 of file DDHCalTestBeamAlgo.cc.

52  {
53 #ifdef EDM_ML_DEBUG
54  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo: Creating an instance";
55 #endif
56 }

◆ ~DDHCalTestBeamAlgo()

DDHCalTestBeamAlgo::~DDHCalTestBeamAlgo ( )
override

Definition at line 58 of file DDHCalTestBeamAlgo.cc.

58 {}

Member Function Documentation

◆ execute()

void DDHCalTestBeamAlgo::execute ( DDCompactView cpv)
override

Definition at line 88 of file DDHCalTestBeamAlgo.cc.

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

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 60 of file DDHCalTestBeamAlgo.cc.

64  {
65  eta = nArgs["Eta"];
66  theta = 2.0 * atan(exp(-eta));
67  phi = nArgs["Phi"];
68  distance = nArgs["Dist"];
69  distanceZ = nArgs["DistZ"];
70  dz = nArgs["Dz"];
71  copyNumber = int(nArgs["Number"]);
72  dist = (distance + distanceZ / sin(theta));
73 #ifdef EDM_ML_DEBUG
74  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo: Parameters for position"
75  << "ing--"
76  << " Eta " << eta << "\tPhi " << convertRadToDeg(phi) << "\tTheta "
77  << convertRadToDeg(theta) << "\tDistance " << distance << "/" << distanceZ << "/" << dist
78  << "\tDz " << dz << "\tcopyNumber " << copyNumber;
79 #endif
81  childName = sArgs["ChildName"];
82 #ifdef EDM_ML_DEBUG
83  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo:Parent " << parent().name() << "\tChild " << childName
84  << " NameSpace " << idNameSpace;
85 #endif
86 }

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 49 of file DDHCalTestBeamAlgo.cc.

◆ copyNumber

int DDHCalTestBeamAlgo::copyNumber
private

Definition at line 46 of file DDHCalTestBeamAlgo.cc.

◆ dist

double DDHCalTestBeamAlgo::dist
private

Definition at line 44 of file DDHCalTestBeamAlgo.cc.

◆ distance

double DDHCalTestBeamAlgo::distance
private

Definition at line 42 of file DDHCalTestBeamAlgo.cc.

◆ distanceZ

double DDHCalTestBeamAlgo::distanceZ
private

Definition at line 43 of file DDHCalTestBeamAlgo.cc.

◆ dz

double DDHCalTestBeamAlgo::dz
private

◆ eta

double DDHCalTestBeamAlgo::eta
private

◆ idNameSpace

std::string DDHCalTestBeamAlgo::idNameSpace
private

Definition at line 48 of file DDHCalTestBeamAlgo.cc.

◆ phi

double DDHCalTestBeamAlgo::phi
private

◆ theta

double DDHCalTestBeamAlgo::theta
private

Definition at line 41 of file DDHCalTestBeamAlgo.cc.

Referenced by Tau.Tau::zImpact().

DDHCalTestBeamAlgo::childName
std::string childName
Definition: DDHCalTestBeamAlgo.cc:49
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:45
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDHCalTestBeamAlgo::dist
double dist
Definition: DDHCalTestBeamAlgo.cc:44
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
DDHCalTestBeamAlgo::distanceZ
double distanceZ
Definition: DDHCalTestBeamAlgo.cc:43
DDHCalTestBeamAlgo::copyNumber
int copyNumber
Definition: DDHCalTestBeamAlgo.cc:46
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDHCalTestBeamAlgo::distance
double distance
Definition: DDHCalTestBeamAlgo.cc:42
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
createfilelist.int
int
Definition: createfilelist.py:10
DDHCalTestBeamAlgo::phi
double phi
Definition: DDHCalTestBeamAlgo.cc:40
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:41
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:88
DDHCalTestBeamAlgo::eta
double eta
Definition: DDHCalTestBeamAlgo.cc:39
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:48