CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDHCalTBZposAlgo Class Reference

#include <DDHCalTBZposAlgo.h>

List of all members.

Public Member Functions

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

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.

                                   {
  LogDebug("HCalGeom") << "DDHCalTBZposAlgo test: Creating an instance";
}
DDHCalTBZposAlgo::~DDHCalTBZposAlgo ( ) [virtual]

Definition at line 22 of file DDHCalTBZposAlgo.cc.

{}

Member Function Documentation

void DDHCalTBZposAlgo::execute ( DDCompactView cpv)

Definition at line 53 of file DDHCalTBZposAlgo.cc.

References funct::cos(), dbl_to_string(), DDrot(), DDSplit(), first, LogDebug, dbtoconf::parent, DDCompactView::position(), edm::second(), funct::sin(), funct::tan(), theta(), x, detailsBasic3DVector::y, and z.

                                                 {

  DDName mother = parent().name();
  DDName child(DDSplit(childName).first, DDSplit(childName).second);
 
  double thetax = 90.*CLHEP::deg - theta;
  double z      = zoffset + dist*tan(thetax);
  double x      = shiftX - shiftY*sin(tilt);
  double y      = shiftY*cos(tilt);
  DDTranslation tran(x,y,z);
  DDRotation rot;
  double tiltdeg = tilt/CLHEP::deg;
  int    itilt   = int(tiltdeg+0.1);
  if (itilt != 0) {
    std::string rotstr = "R";
    if (tiltdeg < 100) rotstr = "R0"; 
    rotstr = rotstr + dbl_to_string(tiltdeg);
    rot    = DDRotation(DDName(rotstr, idNameSpace)); 
    if (!rot) {
      LogDebug("HCalGeom") << "DDHCalAngular test: Creating a new rotation "
                           << DDName(rotstr,idNameSpace) << "\t90, " << tiltdeg
                           << ", 90, " << (tiltdeg+90) << ", 0, 0";
      rot = DDrot(DDName(rotstr, idNameSpace), 90*CLHEP::deg, tilt, 
                  90*CLHEP::deg, (90*CLHEP::deg+tilt), 0.0,  0.0);
    }
  }
 cpv.position(child, mother, copyNumber, tran, rot);
  LogDebug("HCalGeom") << "DDHCalTBZposAlgo test: " << child << " number " 
                       << copyNumber << " positioned in " << mother
                       << " at " << tran << " with " << rot;
}
void DDHCalTBZposAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 24 of file DDHCalTBZposAlgo.cc.

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

                                                                    {

  eta        = nArgs["Eta"];
  theta      = 2.0*atan(exp(-eta));
  shiftX     = nArgs["ShiftX"];
  shiftY     = nArgs["ShiftY"];
  zoffset    = nArgs["Zoffset"];
  dist       = nArgs["Distance"];
  tilt       = nArgs["TiltAngle"];
  copyNumber = int (nArgs["Number"]);
  LogDebug("HCalGeom") << "DDHCalTBZposAlgo debug: Parameters for position"
                       << "ing--" << " Eta " << eta << "\tTheta " 
                       << theta/CLHEP::deg << "\tShifts " << shiftX << ", " 
                       << shiftY  << " along x, y axes; \tZoffest " << zoffset
                       << "\tRadial Distance " << dist << "\tTilt angle "
                       << tilt/CLHEP::deg << "\tcopyNumber " << copyNumber;

  idNameSpace = DDCurrentNamespace::ns();
  childName   = sArgs["ChildName"]; 
  DDName parentName = parent().name(); 
  LogDebug("HCalGeom") << "DDHCalTBZposAlgo debug: Parent " << parentName
                       << "\tChild " << childName << " NameSpace "
                       << idNameSpace;
}

Member Data Documentation

std::string DDHCalTBZposAlgo::childName [private]

Definition at line 36 of file DDHCalTBZposAlgo.h.

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.

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.

double DDHCalTBZposAlgo::tilt [private]

Definition at line 32 of file DDHCalTBZposAlgo.h.

double DDHCalTBZposAlgo::zoffset [private]

Definition at line 30 of file DDHCalTBZposAlgo.h.