CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDHCalLinearXY Class Reference

#include <DDHCalLinearXY.h>

List of all members.

Public Member Functions

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

Private Attributes

std::vector< double > centre
std::vector< std::string > childName
double deltaX
double deltaY
std::string idNameSpace
int numberX
int numberY

Detailed Description

Definition at line 10 of file DDHCalLinearXY.h.


Constructor & Destructor Documentation

DDHCalLinearXY::DDHCalLinearXY ( )

Definition at line 15 of file DDHCalLinearXY.cc.

References LogDebug.

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

Definition at line 19 of file DDHCalLinearXY.cc.

{}

Member Function Documentation

void DDHCalLinearXY::execute ( DDCompactView cpv)

Definition at line 48 of file DDHCalLinearXY.cc.

References centre, childName, filterCSVwithJSON::copy, DDSplit(), deltaX, deltaY, first, i, j, gen::k, LogDebug, numberX, numberY, dbtoconf::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, and edm::second().

                                               {

  DDName mother = parent().name();
  DDName child;
  DDRotation rot;
  double xoff = centre[0] - (numberX-1)*deltaX/2.;
  double yoff = centre[1] - (numberY-1)*deltaY/2.;
  int    copy = 0;

  for (int i=0; i<numberX; i++) {
    for (int j=0; j<numberY; j++) {
        
      DDTranslation tran(xoff+i*deltaX,yoff+j*deltaY,centre[2]);
      bool     place = true;
      unsigned int k = copy;
      if (childName.size() == 1) k = 0;
      if (k < childName.size() && (childName[k] != " " && childName[k] != "Null")) {
        child = DDName(DDSplit(childName[k]).first, DDSplit(childName[k]).second);
      } else {
        place = false;
      }
      copy++;
      if (place) {
        cpv.position(child, mother, copy, tran, rot);
        LogDebug("HCalGeom") << "DDHCalLinearXY test: " << child 
                             << " number " << copy << " positioned in "
                             << mother << " at " << tran << " with " << rot;
      } else {
        LogDebug("HCalGeom") << "DDHCalLinearXY test: No child placed for ["
                             << copy << "]";
      }
    }
  }
}
void DDHCalLinearXY::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 21 of file DDHCalLinearXY.cc.

References centre, childName, deltaX, deltaY, i, idNameSpace, LogDebug, DDCurrentNamespace::ns(), numberX, numberY, and dbtoconf::parent.

                                                                        {

  numberX   = int(nArgs["NumberX"]);
  deltaX    = nArgs["DeltaX"];
  numberY   = int(nArgs["NumberY"]);
  deltaY    = nArgs["DeltaY"];
  centre    = vArgs["Center"];
  
  idNameSpace = DDCurrentNamespace::ns();
  childName   = vsArgs["Child"]; 
  DDName parentName = parent().name();
  LogDebug("HCalGeom") << "DDHCalLinearXY debug: Parent " << parentName
                       << "\twith " << childName.size() << " children";
  for (unsigned int i=0; i<childName.size(); ++i) 
    LogDebug("HCalGeom") << "DDHCalLinearXY debug: Child[" << i << "] = "
                         << childName[i];
  LogDebug("HCalGeom") << "DDHCalLinearXY debug: NameSpace " 
                       << idNameSpace << "\tNumber along X/Y " << numberX
                       << "/" << numberY << "\tDelta along X/Y " << deltaX
                       << "/" << deltaY << "\tCentre " << centre[0] << ", " 
                       << centre[1] << ", "     << centre[2];
}

Member Data Documentation

std::vector<double> DDHCalLinearXY::centre [private]

Definition at line 33 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDHCalLinearXY::childName [private]

Definition at line 28 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

double DDHCalLinearXY::deltaX [private]

Definition at line 30 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

double DDHCalLinearXY::deltaY [private]

Definition at line 32 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

std::string DDHCalLinearXY::idNameSpace [private]

Definition at line 27 of file DDHCalLinearXY.h.

Referenced by initialize().

int DDHCalLinearXY::numberX [private]

Definition at line 29 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

int DDHCalLinearXY::numberY [private]

Definition at line 31 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().