CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDPixFwdDiskAlgo Class Reference

#include <DDPixFwdDiskAlgo.h>

List of all members.

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.

                                   {
  LogDebug("TrackerGeom") <<"DDPixFwdDiskAlgo info: Creating an instance";
}
DDPixFwdDiskAlgo::~DDPixFwdDiskAlgo ( ) [virtual]

Definition at line 21 of file DDPixFwdDiskAlgo.cc.

{}

Member Function Documentation

void DDPixFwdDiskAlgo::execute ( DDCompactView cpv)

Definition at line 57 of file DDPixFwdDiskAlgo.cc.

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

                                                 {

  int    copy   = startCopyNo;
  DDName mother = parent().name();
  DDName child(DDSplit(childName).first, DDSplit(childName).second);
  std::string flagSelector = "Y";

  double deltaPhi   = (360./nBlades)*CLHEP::deg;
  std::string rotns = DDSplit(rotName).second;
  for (int iBlade=0; iBlade<nBlades; ++iBlade) {
        
    if (flagString[iBlade] == flagSelector[0]) {
      std::string rotstr = DDSplit(rotName).first +dbl_to_string(double(copy));

      double phi  = (iBlade+0.5)*deltaPhi;
//      double phi  = (iBlade+0.5)*deltaPhi - 90.*CLHEP::deg;
      double phix = std::atan2(std::sin(phi)*std::cos(bladeAngle),
                               std::cos(phi)*std::cos(bladeAngle));
      double thetx= std::acos(-std::sin(bladeAngle));
      double phiy = std::atan2((std::cos(phi)*std::cos(bladeTilt)+std::sin(phi)
                                *std::sin(bladeAngle)*std::sin(bladeTilt)),
                               (-std::sin(phi)*std::cos(bladeTilt)+std::cos(phi)
                                *std::sin(bladeAngle)*std::sin(bladeTilt)));
      double thety= std::acos(std::cos(bladeAngle)*std::sin(bladeTilt));
      double phiz = std::atan2((-std::cos(phi)*std::sin(bladeTilt)+std::sin(phi)
                                *std::sin(bladeAngle)*std::cos(bladeTilt)),
                               (std::sin(phi)*std::sin(bladeTilt)+std::cos(phi)
                                *std::sin(bladeAngle)*std::cos(bladeTilt)));
      double thetz= std::acos(std::cos(bladeAngle)*std::cos(bladeTilt));
      DDRotation rot = DDRotation(DDName(rotstr, rotns));
      if (!rot) {
        LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: Creating a new "
                                << "rotation: " << rotstr << "\t" 
                                << thetx/CLHEP::deg << ", " << phix/CLHEP::deg 
                                << ", " << thety/CLHEP::deg << ", " 
                                << phiy/CLHEP::deg << ", " << thetz/CLHEP::deg
                                << ", " << phiz/CLHEP::deg;
        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);
        rot = DDrot(DDName(rotstr, rotns), thetx,phix, thety,phiy, thetz,phiz);
      }
      double xpos = anchorR*(-std::sin(phi)*std::cos(bladeTilt)+std::cos(phi)
                             *std::sin(bladeAngle)*std::sin(bladeTilt));
      double ypos = anchorR*(std::cos(phi)*std::cos(bladeTilt)+std::sin(phi)
                             *std::sin(bladeAngle)*std::sin(bladeTilt));
      double zpos = anchorR*(std::cos(bladeAngle)*std::sin(bladeTilt))+zPlane+
        bladeZShift[iBlade];
      DDTranslation tran(xpos, ypos, zpos);
      cpv.position (child, mother, copy, tran, rot);
      LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: " << child 
                              << " number " << copy << " positioned in "
                              << mother << " at " << tran << " with " << rot;
    }
    copy++;
  }
}
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, nBlades, DDCurrentNamespace::ns(), dbtoconf::parent, rotName, startCopyNo, and zPlane.

                                                                           {

  startCopyNo = int(nArgs["StartCopyNo"]);
  nBlades     = int(nArgs["NumberOfBlades"]);
  bladeAngle  = nArgs["BladeAngle"];
  bladeTilt   = nArgs["BladeTilt"];
  zPlane      = nArgs["BladeCommonZ"];
  bladeZShift = vArgs["BladeZShift"];
  anchorR     = nArgs["AnchorRadius"];
 
  idNameSpace = DDCurrentNamespace::ns();
  childName   = sArgs["ChildName"]; 
  rotName     = sArgs["RotationName"]; 
  flagString  = sArgs["FlagString"];
  DDName parentName = parent().name();
  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo debug: Parent " << parentName 
                          << "\tChild " << childName << " NameSpace " 
                          << idNameSpace << "\tRot Name " << rotName
                          << "\tCopyNo (Start/Total) " << startCopyNo << ", " 
                          << nBlades << "\tAngles " << bladeAngle/CLHEP::deg 
                          << ", " << bladeTilt/CLHEP::deg << "\tZshifts " 
                          << zPlane << "\tAmnchor Radius " << anchorR;

  for (int iBlade=0; iBlade<nBlades; ++iBlade) {
    LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo: Blade " << iBlade 
                            << " flag " << flagString[iBlade] << " zshift "
                            << bladeZShift[iBlade];
  }
}

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().

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().

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().