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
DDHCalXtalAlgo Class Reference

#include <DDHCalXtalAlgo.h>

Inheritance diagram for DDHCalXtalAlgo:

Public Member Functions

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

Private Attributes

double angwidth
 
double dx
 
double dz
 
int iaxis
 
std::string idName
 
std::string idNameSpace
 
std::vector< std::string > names
 
double offset
 
double radius
 

Detailed Description

Definition at line 10 of file DDHCalXtalAlgo.h.

Constructor & Destructor Documentation

DDHCalXtalAlgo::DDHCalXtalAlgo ( )

Definition at line 16 of file DDHCalXtalAlgo.cc.

References LogDebug.

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

Definition at line 20 of file DDHCalXtalAlgo.cc.

20 {}

Member Function Documentation

void DDHCalXtalAlgo::execute ( DDCompactView cpv)

Definition at line 51 of file DDHCalXtalAlgo.cc.

References funct::abs(), angle(), DDrot(), i, LogDebug, cscdqm::h::names, evf::evtn::offset(), dbtoconf::parent, phi, DDCompactView::position(), CosmicsPD_Skims::radius, idealTransformation::rotation, funct::sin(), and theta().

51  {
52 
53  double theta[3], phi[3], pos[3];
54  phi[0] = 0;
55  phi[1] = 90*CLHEP::deg;
56  theta[1-iaxis] = 90*CLHEP::deg;
57  pos[1-iaxis] = 0;
58  int number = (int)(names.size());
59  for (int i=0; i<number; i++) {
60  double angle = 0.5*angwidth*(2*i+1-number);
61  theta[iaxis] = 90*CLHEP::deg + angle;
62  if (angle>0) {
63  theta[2] = angle;
64  phi[2] = 90*iaxis*CLHEP::deg;
65  } else {
66  theta[2] =-angle;
67  phi[2] = 90*(2-3*iaxis)*CLHEP::deg;
68  }
69  pos[iaxis] = angle*(dz+radius);
70  pos[2] = dx*abs(sin(angle)) + offset;
71 
73  string rotstr = names[i];
74  DDTranslation tran(pos[0], pos[1], pos[2]);
75  DDName parentName = parent().name();
76 
77  if (abs(angle) > 0.01*CLHEP::deg) {
78  LogDebug("HCalGeom") << "DDHCalXtalAlgo test: Creating a new rotation "
79  << rotstr << "\t" << theta[0]/CLHEP::deg << ","
80  << phi[0]/CLHEP::deg << "," << theta[1]/CLHEP::deg
81  << "," << phi[1]/CLHEP::deg << ","
82  << theta[2]/CLHEP::deg << "," << phi[2]/CLHEP::deg;
83  rotation = DDrot(DDName(rotstr, idNameSpace), theta[0], phi[0], theta[1],
84  phi[1], theta[2], phi[2]);
85  }
86  cpv.position(DDName(idName, idNameSpace), parentName, i+1, tran, rotation);
87  LogDebug("HCalGeom") << "DDHCalXtalAlgo test: "
88  << DDName(idName,idNameSpace) << " number " << i+1
89  << " positioned in " << parentName << " at " << tran
90  << " with " << rotation;
91  }
92 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
std::vector< std::string > names
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string idName
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::string idNameSpace
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
Definition: DDAxes.h:10
void DDHCalXtalAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 22 of file DDHCalXtalAlgo.cc.

References i, LogDebug, cscdqm::h::names, DDCurrentNamespace::ns(), evf::evtn::offset(), dbtoconf::parent, and CosmicsPD_Skims::radius.

26  {
27 
28  radius = nArgs["Radius"];
29  offset = nArgs["Offset"];
30  dx = nArgs["Dx"];
31  dz = nArgs["Dz"];
32  angwidth = nArgs["AngWidth"];
33  iaxis = int (nArgs["Axis"]);
34  names = vsArgs["Names"];
35 
36  LogDebug("HCalGeom") << "DDHCalXtalAlgo debug: Parameters for positioning:: "
37  << "Axis " << iaxis << "\tRadius " << radius
38  << "\tOffset " << offset << "\tDx " << dx << "\tDz "
39  << dz << "\tAngWidth " << angwidth/CLHEP::deg
40  << "\tNumbers " << names.size();
41  for (unsigned int i = 0; i < names.size(); i++)
42  LogDebug("HCalGeom") << "\tnames[" << i << "] = " << names[i];
43 
45  idName = sArgs["ChildName"];
46  DDName parentName = parent().name();
47  LogDebug("HCalGeom") << "DDHCalXtalAlgo debug: Parent " << parentName
48  << "\tChild " << idName << " NameSpace " << idNameSpace;
49 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
static std::string & ns()
std::vector< std::string > names
std::string idName
std::string idNameSpace

Member Data Documentation

double DDHCalXtalAlgo::angwidth
private

Definition at line 30 of file DDHCalXtalAlgo.h.

double DDHCalXtalAlgo::dx
private

Definition at line 28 of file DDHCalXtalAlgo.h.

double DDHCalXtalAlgo::dz
private

Definition at line 29 of file DDHCalXtalAlgo.h.

int DDHCalXtalAlgo::iaxis
private

Definition at line 31 of file DDHCalXtalAlgo.h.

std::string DDHCalXtalAlgo::idName
private

Definition at line 35 of file DDHCalXtalAlgo.h.

std::string DDHCalXtalAlgo::idNameSpace
private

Definition at line 34 of file DDHCalXtalAlgo.h.

std::vector<std::string> DDHCalXtalAlgo::names
private

Definition at line 32 of file DDHCalXtalAlgo.h.

double DDHCalXtalAlgo::offset
private

Definition at line 27 of file DDHCalXtalAlgo.h.

double DDHCalXtalAlgo::radius
private

Definition at line 26 of file DDHCalXtalAlgo.h.