CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDHCalTestBeamAlgo Class Reference

#include <DDHCalTestBeamAlgo.h>

List of all members.

Public Member Functions

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

Private Attributes

std::string childName
int copyNumber
double dist
double distance
double distanceZ
double dz
double eta
std::string idNameSpace
double phi
double theta

Detailed Description

Definition at line 10 of file DDHCalTestBeamAlgo.h.


Constructor & Destructor Documentation

DDHCalTestBeamAlgo::DDHCalTestBeamAlgo ( )

Definition at line 16 of file DDHCalTestBeamAlgo.cc.

References LogDebug.

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

Definition at line 20 of file DDHCalTestBeamAlgo.cc.

{}

Member Function Documentation

void DDHCalTestBeamAlgo::execute ( DDCompactView cpv)

Definition at line 50 of file DDHCalTestBeamAlgo.cc.

References abs, funct::cos(), DDrot(), alignCSCRings::e, eta(), LogDebug, dbtoconf::parent, phi, DDCompactView::position(), alignCSCRings::r, idealTransformation::rotation, funct::sin(), and theta().

                                                   {

  double thetax = 90.*CLHEP::deg + theta;
  double sthx   = sin(thetax);
  if (abs(sthx)>1.e-12) sthx = 1./sthx;
  else                  sthx = 1.;
  double phix   = atan2(sthx*cos(theta)*sin(phi),sthx*cos(theta)*cos(phi));
  double thetay = 90.*CLHEP::deg;
  double phiy   = 90.*CLHEP::deg + phi;
  double thetaz = theta;
  double phiz   = phi;
  
  DDRotation rotation;
  string rotstr = childName;
  LogDebug("HCalGeom") << "DDHCalTestBeamAlgo test: Creating a new rotation "
                       << rotstr << "\t" << thetax/CLHEP::deg << "," 
                       << phix/CLHEP::deg << "," << thetay/CLHEP::deg << "," 
                       << phiy/CLHEP::deg << "," << thetaz/CLHEP::deg <<"," 
                       << phiz/CLHEP::deg;
  rotation = DDrot(DDName(rotstr, idNameSpace), thetax, phix, thetay, phiy,
                   thetaz, phiz);
        
  double r    = dist*sin(theta);
  double xpos = r*cos(phi);
  double ypos = r*sin(phi);
  double zpos = dist*cos(theta);
  DDTranslation tran(xpos, ypos, zpos);
  
  DDName parentName = parent().name(); 
 cpv.position(DDName(childName,idNameSpace), parentName,copyNumber, tran,rotation);
  LogDebug("HCalGeom") << "DDHCalTestBeamAlgo test: " 
                       << DDName(childName, idNameSpace) << " number " 
                       << copyNumber << " positioned in " << parentName 
                       << " at " << tran << " with " << rotation;

  xpos = (dist-dz)*sin(theta)*cos(phi);
  ypos = (dist-dz)*sin(theta)*sin(phi);
  zpos = (dist-dz)*cos(theta);

  edm::LogInfo("HCalGeom") << "DDHCalTestBeamAlgo: Suggested Beam position "
                           << "(" << xpos << ", " << ypos << ", " << zpos 
                           << ") and (dist, eta, phi) = (" << (dist-dz) << ", "
                           << eta << ", " << phi << ")";
}
void DDHCalTestBeamAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 22 of file DDHCalTestBeamAlgo.cc.

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

                                                                      {

  eta        = nArgs["Eta"];
  theta      = 2.0*atan(exp(-eta));
  phi        = nArgs["Phi"];
  distance   = nArgs["Dist"];
  distanceZ  = nArgs["DistZ"];
  dz         = nArgs["Dz"];
  copyNumber = int (nArgs["Number"]);
  dist       = (distance+distanceZ/sin(theta));
  LogDebug("HCalGeom") << "DDHCalTestBeamAlgo debug: Parameters for position"
                       << "ing--" << " Eta " << eta << "\tPhi " 
                       << phi/CLHEP::deg << "\tTheta " << theta/CLHEP::deg 
                       << "\tDistance " << distance << "/" << distanceZ << "/"
                       << dist <<"\tDz " << dz <<"\tcopyNumber " << copyNumber;

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

Member Data Documentation

std::string DDHCalTestBeamAlgo::childName [private]

Definition at line 36 of file DDHCalTestBeamAlgo.h.

Definition at line 33 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::dist [private]

Definition at line 31 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::distance [private]

Definition at line 29 of file DDHCalTestBeamAlgo.h.

Definition at line 30 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::dz [private]

Definition at line 32 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::eta [private]

Definition at line 26 of file DDHCalTestBeamAlgo.h.

std::string DDHCalTestBeamAlgo::idNameSpace [private]

Definition at line 35 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::phi [private]

Definition at line 27 of file DDHCalTestBeamAlgo.h.

double DDHCalTestBeamAlgo::theta [private]

Definition at line 28 of file DDHCalTestBeamAlgo.h.