CMS 3D CMS Logo

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

#include <DDHCalTBZposAlgo.h>

Inheritance diagram for DDHCalTBZposAlgo:

Public Member Functions

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

Private Attributes

std::string childName
 
int copyNumber
 
double dist
 
double eta
 
std::string idNameSpace
 
double shiftX
 
double shiftY
 
double theta
 
double tilt
 
double zoffset
 

Detailed Description

Definition at line 10 of file DDHCalTBZposAlgo.h.

Constructor & Destructor Documentation

DDHCalTBZposAlgo::DDHCalTBZposAlgo ( )

Definition at line 18 of file DDHCalTBZposAlgo.cc.

References LogDebug.

18  {
19  LogDebug("HCalGeom") << "DDHCalTBZposAlgo test: Creating an instance";
20 }
#define LogDebug(id)
DDHCalTBZposAlgo::~DDHCalTBZposAlgo ( )
override

Definition at line 22 of file DDHCalTBZposAlgo.cc.

22 {}

Member Function Documentation

void DDHCalTBZposAlgo::execute ( DDCompactView cpv)
override

Definition at line 53 of file DDHCalTBZposAlgo.cc.

References class-composition::child, funct::cos(), DDrot(), DDSplit(), plotBeamSpotDB::first, createfilelist::int, LogDebug, class-composition::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, edm::second(), funct::sin(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), and theta().

53  {
54 
55  DDName mother = parent().name();
57 
58  double thetax = 90.*CLHEP::deg - theta;
59  double z = zoffset + dist*tan(thetax);
60  double x = shiftX - shiftY*sin(tilt);
61  double y = shiftY*cos(tilt);
62  DDTranslation tran(x,y,z);
64  double tiltdeg = tilt/CLHEP::deg;
65  int itilt = int(tiltdeg+0.1);
66  if (itilt != 0) {
67  std::string rotstr = "R";
68  if (tiltdeg < 100) rotstr = "R0";
69  rotstr = rotstr + std::to_string(tiltdeg);
70  rot = DDRotation(DDName(rotstr, idNameSpace));
71  if (!rot) {
72  LogDebug("HCalGeom") << "DDHCalAngular test: Creating a new rotation "
73  << DDName(rotstr,idNameSpace) << "\t90, " << tiltdeg
74  << ", 90, " << (tiltdeg+90) << ", 0, 0";
75  rot = DDrot(DDName(rotstr, idNameSpace), 90*CLHEP::deg, tilt,
76  90*CLHEP::deg, (90*CLHEP::deg+tilt), 0.0, 0.0);
77  }
78  }
79  cpv.position(child, mother, copyNumber, tran, rot);
80  LogDebug("HCalGeom") << "DDHCalTBZposAlgo test: " << child << " number "
81  << copyNumber << " positioned in " << mother
82  << " at " << tran << " with " << rot;
83 }
#define LogDebug(id)
std::string idNameSpace
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.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
std::string childName
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
void DDHCalTBZposAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 24 of file DDHCalTBZposAlgo.cc.

References PVValHelper::eta, JetChargeProducer_cfi::exp, createfilelist::int, LogDebug, DDCurrentNamespace::ns(), class-composition::parent, and theta().

28  {
29 
30  eta = nArgs["Eta"];
31  theta = 2.0*atan(exp(-eta));
32  shiftX = nArgs["ShiftX"];
33  shiftY = nArgs["ShiftY"];
34  zoffset = nArgs["Zoffset"];
35  dist = nArgs["Distance"];
36  tilt = nArgs["TiltAngle"];
37  copyNumber = int (nArgs["Number"]);
38  LogDebug("HCalGeom") << "DDHCalTBZposAlgo debug: Parameters for position"
39  << "ing--" << " Eta " << eta << "\tTheta "
40  << theta/CLHEP::deg << "\tShifts " << shiftX << ", "
41  << shiftY << " along x, y axes; \tZoffest " << zoffset
42  << "\tRadial Distance " << dist << "\tTilt angle "
43  << tilt/CLHEP::deg << "\tcopyNumber " << copyNumber;
44 
46  childName = sArgs["ChildName"];
47  DDName parentName = parent().name();
48  LogDebug("HCalGeom") << "DDHCalTBZposAlgo debug: Parent " << parentName
49  << "\tChild " << childName << " NameSpace "
50  << idNameSpace;
51 }
#define LogDebug(id)
std::string idNameSpace
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::string childName

Member Data Documentation

std::string DDHCalTBZposAlgo::childName
private

Definition at line 36 of file DDHCalTBZposAlgo.h.

int DDHCalTBZposAlgo::copyNumber
private

Definition at line 33 of file DDHCalTBZposAlgo.h.

double DDHCalTBZposAlgo::dist
private

Definition at line 31 of file DDHCalTBZposAlgo.h.

double DDHCalTBZposAlgo::eta
private

Definition at line 26 of file DDHCalTBZposAlgo.h.

Referenced by Particle.Particle::__str__(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

std::string DDHCalTBZposAlgo::idNameSpace
private

Definition at line 35 of file DDHCalTBZposAlgo.h.

double DDHCalTBZposAlgo::shiftX
private

Definition at line 29 of file DDHCalTBZposAlgo.h.

double DDHCalTBZposAlgo::shiftY
private

Definition at line 28 of file DDHCalTBZposAlgo.h.

double DDHCalTBZposAlgo::theta
private

Definition at line 27 of file DDHCalTBZposAlgo.h.

Referenced by Tau.Tau::zImpact().

double DDHCalTBZposAlgo::tilt
private

Definition at line 32 of file DDHCalTBZposAlgo.h.

double DDHCalTBZposAlgo::zoffset
private

Definition at line 30 of file DDHCalTBZposAlgo.h.