CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDHCalTestBeamAlgo Class Reference

#include <DDHCalTestBeamAlgo.h>

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 10 of file DDHCalTestBeamAlgo.h.

Constructor & Destructor Documentation

DDHCalTestBeamAlgo::DDHCalTestBeamAlgo ( )

Definition at line 18 of file DDHCalTestBeamAlgo.cc.

18  {
19 #ifdef EDM_ML_DEBUG
20  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo: Creating an instance";
21 #endif
22 }
DDHCalTestBeamAlgo::~DDHCalTestBeamAlgo ( )
override

Definition at line 24 of file DDHCalTestBeamAlgo.cc.

24 {}

Member Function Documentation

void DDHCalTestBeamAlgo::execute ( DDCompactView cpv)
override

Definition at line 58 of file DDHCalTestBeamAlgo.cc.

References funct::abs(), geant_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().

58  {
59 
60  double thetax = 90._deg + theta;
61  double sthx = sin(thetax);
62  if (std::abs(sthx)>1.e-12) sthx = 1./sthx;
63  else sthx = 1.;
64  double phix = atan2(sthx*cos(theta)*sin(phi),sthx*cos(theta)*cos(phi));
65  double thetay = 90._deg;
66  double phiy = 90._deg + phi;
67  double thetaz = theta;
68  double phiz = phi;
69 
71  std::string rotstr = childName;
72 #ifdef EDM_ML_DEBUG
73  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo: Creating a rotation "
74  << rotstr << "\t" << convertRadToDeg(thetax)
75  << "," << convertRadToDeg(phix) << ","
76  << convertRadToDeg(thetay) << ","
77  << convertRadToDeg(phiy) << ","
78  << convertRadToDeg(thetaz) <<","
79  << convertRadToDeg(phiz);
80 #endif
81  rotation = DDrot(DDName(rotstr, idNameSpace), thetax, phix, thetay, phiy,
82  thetaz, phiz);
83 
84  double r = dist*sin(theta);
85  double xpos = r*cos(phi);
86  double ypos = r*sin(phi);
87  double zpos = dist*cos(theta);
88  DDTranslation tran(xpos, ypos, zpos);
89 
90  DDName parentName = parent().name();
91  cpv.position(DDName(childName,idNameSpace), parentName, copyNumber, tran,
92  rotation);
93 #ifdef EDM_ML_DEBUG
94  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo: "
95  << DDName(childName, idNameSpace) << " number "
96  << copyNumber << " positioned in " << parentName
97  << " at " << tran << " with " << rotation;
98 
99  xpos = (dist-dz)*sin(theta)*cos(phi);
100  ypos = (dist-dz)*sin(theta)*sin(phi);
101  zpos = (dist-dz)*cos(theta);
102 
103  edm::LogInfo("HCalGeom") << "DDHCalTestBeamAlgo: Suggested Beam position "
104  << "(" << xpos << ", " << ypos << ", " << zpos
105  << ") and (dist, eta, phi) = (" << (dist-dz) << ", "
106  << eta << ", " << phi << ")";
107 #endif
108 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
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:80
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void DDHCalTestBeamAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 26 of file DDHCalTestBeamAlgo.cc.

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

30  {
31 
32  eta = nArgs["Eta"];
33  theta = 2.0*atan(exp(-eta));
34  phi = nArgs["Phi"];
35  distance = nArgs["Dist"];
36  distanceZ = nArgs["DistZ"];
37  dz = nArgs["Dz"];
38  copyNumber = int (nArgs["Number"]);
40 #ifdef EDM_ML_DEBUG
41  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo: Parameters for position"
42  << "ing--" << " Eta " << eta << "\tPhi "
43  << convertRadToDeg(phi) << "\tTheta "
44  << convertRadToDeg(theta) << "\tDistance "
45  << distance << "/" << distanceZ << "/"
46  << dist <<"\tDz " << dz <<"\tcopyNumber "
47  << copyNumber;
48 #endif
50  childName = sArgs["ChildName"];
51 #ifdef EDM_ML_DEBUG
52  edm::LogVerbatim("HCalGeom") << "DDHCalTestBeamAlgo:Parent "
53  << parent().name() << "\tChild " << childName
54  << " NameSpace " << idNameSpace;
55 #endif
56 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
static std::string & ns()

Member Data Documentation

std::string DDHCalTestBeamAlgo::childName
private

Definition at line 36 of file DDHCalTestBeamAlgo.h.

int DDHCalTestBeamAlgo::copyNumber
private

Definition at line 33 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::dist
private

Definition at line 31 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::distance
private

Definition at line 29 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::distanceZ
private

Definition at line 30 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::dz
private
double DDHCalTestBeamAlgo::eta
private
std::string DDHCalTestBeamAlgo::idNameSpace
private

Definition at line 35 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::phi
private
double DDHCalTestBeamAlgo::theta
private

Definition at line 28 of file DDHCalTestBeamAlgo.h.

Referenced by Tau.Tau::zImpact().