CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDHCalTestBeamAlgo ()
 

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

References LogDebug.

16  {
17  LogDebug("HCalGeom") << "DDHCalTestBeamAlgo test: Creating an instance";
18 }
#define LogDebug(id)
DDHCalTestBeamAlgo::~DDHCalTestBeamAlgo ( )
virtual

Definition at line 20 of file DDHCalTestBeamAlgo.cc.

20 {}

Member Function Documentation

void DDHCalTestBeamAlgo::execute ( DDCompactView cpv)

Definition at line 50 of file DDHCalTestBeamAlgo.cc.

References abs, funct::cos(), DDrot(), alignCSCRings::e, eta(), LogDebug, dbtoconf::parent, phi, DDCompactView::position(), alignCSCRings::r, idealTransformation::rotation, funct::sin(), and theta().

50  {
51 
52  double thetax = 90.*CLHEP::deg + theta;
53  double sthx = sin(thetax);
54  if (abs(sthx)>1.e-12) sthx = 1./sthx;
55  else sthx = 1.;
56  double phix = atan2(sthx*cos(theta)*sin(phi),sthx*cos(theta)*cos(phi));
57  double thetay = 90.*CLHEP::deg;
58  double phiy = 90.*CLHEP::deg + phi;
59  double thetaz = theta;
60  double phiz = phi;
61 
63  string rotstr = childName;
64  LogDebug("HCalGeom") << "DDHCalTestBeamAlgo test: Creating a new rotation "
65  << rotstr << "\t" << thetax/CLHEP::deg << ","
66  << phix/CLHEP::deg << "," << thetay/CLHEP::deg << ","
67  << phiy/CLHEP::deg << "," << thetaz/CLHEP::deg <<","
68  << phiz/CLHEP::deg;
69  rotation = DDrot(DDName(rotstr, idNameSpace), thetax, phix, thetay, phiy,
70  thetaz, phiz);
71 
72  double r = dist*sin(theta);
73  double xpos = r*cos(phi);
74  double ypos = r*sin(phi);
75  double zpos = dist*cos(theta);
76  DDTranslation tran(xpos, ypos, zpos);
77 
78  DDName parentName = parent().name();
79  cpv.position(DDName(childName,idNameSpace), parentName,copyNumber, tran,rotation);
80  LogDebug("HCalGeom") << "DDHCalTestBeamAlgo test: "
81  << DDName(childName, idNameSpace) << " number "
82  << copyNumber << " positioned in " << parentName
83  << " at " << tran << " with " << rotation;
84 
85  xpos = (dist-dz)*sin(theta)*cos(phi);
86  ypos = (dist-dz)*sin(theta)*sin(phi);
87  zpos = (dist-dz)*cos(theta);
88 
89  edm::LogInfo("HCalGeom") << "DDHCalTestBeamAlgo: Suggested Beam position "
90  << "(" << xpos << ", " << ypos << ", " << zpos
91  << ") and (dist, eta, phi) = (" << (dist-dz) << ", "
92  << eta << ", " << phi << ")";
93 }
#define LogDebug(id)
list parent
Definition: dbtoconf.py:74
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
#define abs(x)
Definition: mlp_lapack.h:159
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:91
void DDHCalTestBeamAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 22 of file DDHCalTestBeamAlgo.cc.

References eta(), create_public_lumi_plots::exp, LogDebug, DDCurrentNamespace::ns(), dbtoconf::parent, phi, funct::sin(), and theta().

26  {
27 
28  eta = nArgs["Eta"];
29  theta = 2.0*atan(exp(-eta));
30  phi = nArgs["Phi"];
31  distance = nArgs["Dist"];
32  distanceZ = nArgs["DistZ"];
33  dz = nArgs["Dz"];
34  copyNumber = int (nArgs["Number"]);
36  LogDebug("HCalGeom") << "DDHCalTestBeamAlgo debug: Parameters for position"
37  << "ing--" << " Eta " << eta << "\tPhi "
38  << phi/CLHEP::deg << "\tTheta " << theta/CLHEP::deg
39  << "\tDistance " << distance << "/" << distanceZ << "/"
40  << dist <<"\tDz " << dz <<"\tcopyNumber " << copyNumber;
41 
43  childName = sArgs["ChildName"];
44  DDName parentName = parent().name();
45  LogDebug("HCalGeom") << "DDHCalTestBeamAlgo debug: Parent " << parentName
46  << "\tChild " << childName << " NameSpace "
47  << idNameSpace;
48 }
#define LogDebug(id)
list parent
Definition: dbtoconf.py:74
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
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

Definition at line 32 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::eta
private

Definition at line 26 of file DDHCalTestBeamAlgo.h.

std::string DDHCalTestBeamAlgo::idNameSpace
private

Definition at line 35 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::phi
private

Definition at line 27 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::theta
private

Definition at line 28 of file DDHCalTestBeamAlgo.h.