CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDPixFwdDiskAlgo Class Reference
Inheritance diagram for DDPixFwdDiskAlgo:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 23 of file DDPixFwdDiskAlgo.cc.

Constructor & Destructor Documentation

◆ DDPixFwdDiskAlgo()

DDPixFwdDiskAlgo::DDPixFwdDiskAlgo ( )

Definition at line 51 of file DDPixFwdDiskAlgo.cc.

51 { LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo info: Creating an instance"; }

References LogDebug.

◆ ~DDPixFwdDiskAlgo()

DDPixFwdDiskAlgo::~DDPixFwdDiskAlgo ( )
override

Definition at line 53 of file DDPixFwdDiskAlgo.cc.

53 {}

Member Function Documentation

◆ execute()

void DDPixFwdDiskAlgo::execute ( DDCompactView cpv)
override

Definition at line 84 of file DDPixFwdDiskAlgo.cc.

84  {
85  int copy = startCopyNo;
86  DDName mother = parent().name();
88  string flagSelector = "Y";
89 
90  double deltaPhi = (360. / nBlades) * CLHEP::deg;
91  string rotns = DDSplit(rotName).second;
92  for (int iBlade = 0; iBlade < nBlades; ++iBlade) {
93  if (flagString[iBlade] == flagSelector[0]) {
94  string rotstr = DDSplit(rotName).first + to_string(double(copy));
95 
96  double phi = (iBlade + 0.5) * deltaPhi;
97  // double phi = (iBlade+0.5)*deltaPhi - 90.*CLHEP::deg;
98  double phix = atan2(sin(phi) * cos(bladeAngle), cos(phi) * cos(bladeAngle));
99  double thetx = acos(-sin(bladeAngle));
100  double phiy = atan2((cos(phi) * cos(bladeTilt) + sin(phi) * sin(bladeAngle) * sin(bladeTilt)),
101  (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt)));
102  double thety = acos(cos(bladeAngle) * sin(bladeTilt));
103  double phiz = atan2((-cos(phi) * sin(bladeTilt) + sin(phi) * sin(bladeAngle) * cos(bladeTilt)),
104  (sin(phi) * sin(bladeTilt) + cos(phi) * sin(bladeAngle) * cos(bladeTilt)));
105  double thetz = acos(cos(bladeAngle) * cos(bladeTilt));
106  DDRotation rot = DDRotation(DDName(rotstr, rotns));
107  if (!rot) {
108  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: Creating a new "
109  << "rotation: " << rotstr << "\t" << thetx / CLHEP::deg << ", " << phix / CLHEP::deg
110  << ", " << thety / CLHEP::deg << ", " << phiy / CLHEP::deg << ", " << thetz / CLHEP::deg
111  << ", " << phiz / CLHEP::deg;
112  LogDebug("TrackerGeom") << "Rotation Matrix (" << phi / CLHEP::deg << ", " << bladeAngle / CLHEP::deg << ", "
113  << bladeTilt / CLHEP::deg << ") " << cos(phi) * cos(bladeAngle) << ", "
114  << (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt)) << ", "
115  << (sin(phi) * sin(bladeTilt) + cos(phi) * sin(bladeAngle) * cos(bladeTilt)) << ", "
116  << sin(phi) * cos(bladeAngle) << ", "
117  << (cos(phi) * cos(bladeTilt) + sin(phi) * sin(bladeAngle) * sin(bladeTilt)) << ", "
118  << (-cos(phi) * sin(bladeTilt) + sin(phi) * sin(bladeAngle) * cos(bladeTilt)) << ", "
119  << -sin(bladeAngle) << ", " << cos(bladeAngle) * sin(bladeTilt) << ", "
120  << cos(bladeAngle) * cos(bladeTilt);
121  rot = DDrot(DDName(rotstr, rotns), thetx, phix, thety, phiy, thetz, phiz);
122  }
123  double xpos = anchorR * (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt));
124  double ypos = anchorR * (cos(phi) * cos(bladeTilt) + sin(phi) * sin(bladeAngle) * sin(bladeTilt));
125  double zpos = anchorR * (cos(bladeAngle) * sin(bladeTilt)) + zPlane + bladeZShift[iBlade];
126  DDTranslation tran(xpos, ypos, zpos);
127  cpv.position(child, mother, copy, tran, rot);
128  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: " << child << " number " << copy << " positioned in " << mother
129  << " at " << tran << " with " << rot;
130  }
131  copy++;
132  }
133 }

References submitPVValidationJobs::child, filterCSVwithJSON::copy, funct::cos(), DDrot(), DDSplit(), SiPixelRawToDigiRegional_cfi::deltaPhi, first, LogDebug, class-composition::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, cms::rotation_utils::rotName(), edm::second(), and funct::sin().

◆ initialize()

void DDPixFwdDiskAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 55 of file DDPixFwdDiskAlgo.cc.

59  {
60  startCopyNo = int(nArgs["StartCopyNo"]);
61  nBlades = int(nArgs["NumberOfBlades"]);
62  bladeAngle = nArgs["BladeAngle"];
63  bladeTilt = nArgs["BladeTilt"];
64  zPlane = nArgs["BladeCommonZ"];
65  bladeZShift = vArgs["BladeZShift"];
66  anchorR = nArgs["AnchorRadius"];
67 
69  childName = sArgs["ChildName"];
70  rotName = sArgs["RotationName"];
71  flagString = sArgs["FlagString"];
72  DDName parentName = parent().name();
73  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo debug: Parent " << parentName << "\tChild " << childName << " NameSpace "
74  << idNameSpace << "\tRot Name " << rotName << "\tCopyNo (Start/Total) " << startCopyNo << ", "
75  << nBlades << "\tAngles " << bladeAngle / CLHEP::deg << ", " << bladeTilt / CLHEP::deg
76  << "\tZshifts " << zPlane << "\tAmnchor Radius " << anchorR;
77 
78  for (int iBlade = 0; iBlade < nBlades; ++iBlade) {
79  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo: Blade " << iBlade << " flag " << flagString[iBlade] << " zshift "
80  << bladeZShift[iBlade];
81  }
82 }

References createfilelist::int, LogDebug, DDCurrentNamespace::ns(), class-composition::parent, and cms::rotation_utils::rotName().

Member Data Documentation

◆ anchorR

double DDPixFwdDiskAlgo::anchorR
private

Definition at line 47 of file DDPixFwdDiskAlgo.cc.

◆ bladeAngle

double DDPixFwdDiskAlgo::bladeAngle
private

Definition at line 44 of file DDPixFwdDiskAlgo.cc.

◆ bladeTilt

double DDPixFwdDiskAlgo::bladeTilt
private

Definition at line 48 of file DDPixFwdDiskAlgo.cc.

◆ bladeZShift

vector<double> DDPixFwdDiskAlgo::bladeZShift
private

Definition at line 46 of file DDPixFwdDiskAlgo.cc.

◆ childName

string DDPixFwdDiskAlgo::childName
private

Definition at line 39 of file DDPixFwdDiskAlgo.cc.

◆ flagString

string DDPixFwdDiskAlgo::flagString
private

Definition at line 41 of file DDPixFwdDiskAlgo.cc.

◆ idNameSpace

string DDPixFwdDiskAlgo::idNameSpace
private

Definition at line 38 of file DDPixFwdDiskAlgo.cc.

◆ nBlades

int DDPixFwdDiskAlgo::nBlades
private

Definition at line 42 of file DDPixFwdDiskAlgo.cc.

◆ rotName

string DDPixFwdDiskAlgo::rotName
private

Definition at line 40 of file DDPixFwdDiskAlgo.cc.

◆ startCopyNo

int DDPixFwdDiskAlgo::startCopyNo
private

Definition at line 43 of file DDPixFwdDiskAlgo.cc.

◆ zPlane

double DDPixFwdDiskAlgo::zPlane
private

Definition at line 45 of file DDPixFwdDiskAlgo.cc.

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
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
DDPixFwdDiskAlgo::anchorR
double anchorR
Definition: DDPixFwdDiskAlgo.cc:47
DDPixFwdDiskAlgo::bladeTilt
double bladeTilt
Definition: DDPixFwdDiskAlgo.cc:48
DDPixFwdDiskAlgo::bladeZShift
vector< double > bladeZShift
Definition: DDPixFwdDiskAlgo.cc:46
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
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
DDPixFwdDiskAlgo::idNameSpace
string idNameSpace
Definition: DDPixFwdDiskAlgo.cc:38
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
DDPixFwdDiskAlgo::childName
string childName
Definition: DDPixFwdDiskAlgo.cc:39
DDPixFwdDiskAlgo::rotName
string rotName
Definition: DDPixFwdDiskAlgo.cc:40
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
DDPixFwdDiskAlgo::nBlades
int nBlades
Definition: DDPixFwdDiskAlgo.cc:42
createfilelist.int
int
Definition: createfilelist.py:10
DDPixFwdDiskAlgo::bladeAngle
double bladeAngle
Definition: DDPixFwdDiskAlgo.cc:44
DDPixFwdDiskAlgo::zPlane
double zPlane
Definition: DDPixFwdDiskAlgo.cc:45
DDAxes::phi
submitPVValidationJobs.child
child
Definition: submitPVValidationJobs.py:119
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDPixFwdDiskAlgo::startCopyNo
int startCopyNo
Definition: DDPixFwdDiskAlgo.cc:43
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDPixFwdDiskAlgo::flagString
string flagString
Definition: DDPixFwdDiskAlgo.cc:41
child
Definition: simpleInheritance.h:11
class-composition.parent
parent
Definition: class-composition.py:98
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
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