test
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
DDPixFwdDiskAlgo Class Reference

#include <DDPixFwdDiskAlgo.h>

Inheritance diagram for DDPixFwdDiskAlgo:

Public Member Functions

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

Private Attributes

double anchorR
 
double bladeAngle
 
double bladeTilt
 
std::vector< double > bladeZShift
 
std::string childName
 
std::string flagString
 
std::string idNameSpace
 
int nBlades
 
std::string rotName
 
int startCopyNo
 
double zPlane
 

Detailed Description

Definition at line 10 of file DDPixFwdDiskAlgo.h.

Constructor & Destructor Documentation

DDPixFwdDiskAlgo::DDPixFwdDiskAlgo ( )

Definition at line 17 of file DDPixFwdDiskAlgo.cc.

References LogDebug.

17  {
18  LogDebug("TrackerGeom") <<"DDPixFwdDiskAlgo info: Creating an instance";
19 }
#define LogDebug(id)
DDPixFwdDiskAlgo::~DDPixFwdDiskAlgo ( )
virtual

Definition at line 21 of file DDPixFwdDiskAlgo.cc.

21 {}

Member Function Documentation

void DDPixFwdDiskAlgo::execute ( DDCompactView cpv)

Definition at line 57 of file DDPixFwdDiskAlgo.cc.

References anchorR, bladeAngle, bladeTilt, bladeZShift, class-composition::child, childName, filterCSVwithJSON::copy, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), SiPixelRawToDigiRegional_cfi::deltaPhi, plotBeamSpotDB::first, flagString, LogDebug, DDName::name(), nBlades, phi, DDCompactView::position(), makeMuonMisalignmentScenario::rot, rotName, edm::second(), funct::sin(), startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, and zPlane.

57  {
58 
59  int copy = startCopyNo;
60  DDName mother = parent().name();
62  std::string flagSelector = "Y";
63 
64  double deltaPhi = (360./nBlades)*CLHEP::deg;
65  std::string rotns = DDSplit(rotName).second;
66  for (int iBlade=0; iBlade<nBlades; ++iBlade) {
67 
68  if (flagString[iBlade] == flagSelector[0]) {
69  std::string rotstr = DDSplit(rotName).first +dbl_to_string(double(copy));
70 
71  double phi = (iBlade+0.5)*deltaPhi;
72 // double phi = (iBlade+0.5)*deltaPhi - 90.*CLHEP::deg;
73  double phix = std::atan2(std::sin(phi)*std::cos(bladeAngle),
75  double thetx= std::acos(-std::sin(bladeAngle));
76  double phiy = std::atan2((std::cos(phi)*std::cos(bladeTilt)+std::sin(phi)
78  (-std::sin(phi)*std::cos(bladeTilt)+std::cos(phi)
80  double thety= std::acos(std::cos(bladeAngle)*std::sin(bladeTilt));
81  double phiz = std::atan2((-std::cos(phi)*std::sin(bladeTilt)+std::sin(phi)
85  double thetz= std::acos(std::cos(bladeAngle)*std::cos(bladeTilt));
86  DDRotation rot = DDRotation(DDName(rotstr, rotns));
87  if (!rot) {
88  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: Creating a new "
89  << "rotation: " << rotstr << "\t"
90  << thetx/CLHEP::deg << ", " << phix/CLHEP::deg
91  << ", " << thety/CLHEP::deg << ", "
92  << phiy/CLHEP::deg << ", " << thetz/CLHEP::deg
93  << ", " << phiz/CLHEP::deg;
94  LogDebug("TrackerGeom") << "Rotation Matrix (" << phi/CLHEP::deg << ", " << bladeAngle/CLHEP::deg << ", " << bladeTilt/CLHEP::deg << ") " << std::cos(phi)*std::cos(bladeAngle) << ", " << (-std::sin(phi)*std::cos(bladeTilt)+std::cos(phi)*std::sin(bladeAngle)*std::sin(bladeTilt)) << ", " << (std::sin(phi)*std::sin(bladeTilt)+std::cos(phi)*std::sin(bladeAngle)*std::cos(bladeTilt)) << ", " << std::sin(phi)*std::cos(bladeAngle) << ", " << (std::cos(phi)*std::cos(bladeTilt)+std::sin(phi)*std::sin(bladeAngle)*std::sin(bladeTilt)) << ", " << (-std::cos(phi)*std::sin(bladeTilt)+std::sin(phi)*std::sin(bladeAngle)*std::cos(bladeTilt)) << ", " << -std::sin(bladeAngle) << ", " << std::cos(bladeAngle)*std::sin(bladeTilt) << ", " << std::cos(bladeAngle)*std::cos(bladeTilt);
95  rot = DDrot(DDName(rotstr, rotns), thetx,phix, thety,phiy, thetz,phiz);
96  }
97  double xpos = anchorR*(-std::sin(phi)*std::cos(bladeTilt)+std::cos(phi)
99  double ypos = anchorR*(std::cos(phi)*std::cos(bladeTilt)+std::sin(phi)
102  bladeZShift[iBlade];
103  DDTranslation tran(xpos, ypos, zpos);
104  cpv.position (child, mother, copy, tran, rot);
105  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: " << child
106  << " number " << copy << " positioned in "
107  << mother << " at " << tran << " with " << rot;
108  }
109  copy++;
110  }
111 }
#define LogDebug(id)
std::string flagString
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)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::string childName
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::string rotName
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::vector< double > bladeZShift
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
void DDPixFwdDiskAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 23 of file DDPixFwdDiskAlgo.cc.

References anchorR, bladeAngle, bladeTilt, bladeZShift, childName, flagString, idNameSpace, LogDebug, DDName::name(), nBlades, DDCurrentNamespace::ns(), rotName, startCopyNo, and zPlane.

27  {
28 
29  startCopyNo = int(nArgs["StartCopyNo"]);
30  nBlades = int(nArgs["NumberOfBlades"]);
31  bladeAngle = nArgs["BladeAngle"];
32  bladeTilt = nArgs["BladeTilt"];
33  zPlane = nArgs["BladeCommonZ"];
34  bladeZShift = vArgs["BladeZShift"];
35  anchorR = nArgs["AnchorRadius"];
36 
38  childName = sArgs["ChildName"];
39  rotName = sArgs["RotationName"];
40  flagString = sArgs["FlagString"];
41  DDName parentName = parent().name();
42  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo debug: Parent " << parentName
43  << "\tChild " << childName << " NameSpace "
44  << idNameSpace << "\tRot Name " << rotName
45  << "\tCopyNo (Start/Total) " << startCopyNo << ", "
46  << nBlades << "\tAngles " << bladeAngle/CLHEP::deg
47  << ", " << bladeTilt/CLHEP::deg << "\tZshifts "
48  << zPlane << "\tAmnchor Radius " << anchorR;
49 
50  for (int iBlade=0; iBlade<nBlades; ++iBlade) {
51  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo: Blade " << iBlade
52  << " flag " << flagString[iBlade] << " zshift "
53  << bladeZShift[iBlade];
54  }
55 }
#define LogDebug(id)
std::string flagString
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
static std::string & ns()
std::string childName
std::string rotName
std::string idNameSpace
std::vector< double > bladeZShift
const std::string & name() const
Returns the name.
Definition: DDName.cc:87

Member Data Documentation

double DDPixFwdDiskAlgo::anchorR
private

Definition at line 35 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

double DDPixFwdDiskAlgo::bladeAngle
private

Definition at line 32 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

double DDPixFwdDiskAlgo::bladeTilt
private

Definition at line 36 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDPixFwdDiskAlgo::bladeZShift
private

Definition at line 34 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixFwdDiskAlgo::childName
private

Definition at line 27 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixFwdDiskAlgo::flagString
private

Definition at line 29 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixFwdDiskAlgo::idNameSpace
private

Definition at line 26 of file DDPixFwdDiskAlgo.h.

Referenced by initialize().

int DDPixFwdDiskAlgo::nBlades
private

Definition at line 30 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixFwdDiskAlgo::rotName
private

Definition at line 28 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

int DDPixFwdDiskAlgo::startCopyNo
private

Definition at line 31 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

double DDPixFwdDiskAlgo::zPlane
private

Definition at line 33 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().