CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DDPixBarStackTrigLayerAlgo Class Reference

#include <DDPixBarStackTrigLayerAlgo.h>

Inheritance diagram for DDPixBarStackTrigLayerAlgo:

Public Member Functions

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

Private Attributes

std::string genMat
 
std::string idNameSpace
 
std::vector< std::string > ladder
 
std::vector< double > ladderThick
 
std::vector< double > ladderWidth
 
double layerDz
 
double layerR
 
int number
 

Detailed Description

Definition at line 10 of file DDPixBarStackTrigLayerAlgo.h.

Constructor & Destructor Documentation

DDPixBarStackTrigLayerAlgo::DDPixBarStackTrigLayerAlgo ( )

Definition at line 21 of file DDPixBarStackTrigLayerAlgo.cc.

References LogDebug.

21  {
22  LogDebug("PixelGeom") <<"DDPixBarStackTrigLayerAlgo info: Creating an instance";
23 }
#define LogDebug(id)
DDPixBarStackTrigLayerAlgo::~DDPixBarStackTrigLayerAlgo ( )
virtual

Definition at line 25 of file DDPixBarStackTrigLayerAlgo.cc.

25 {}

Member Function Documentation

void DDPixBarStackTrigLayerAlgo::execute ( DDCompactView cpv)

Definition at line 49 of file DDPixBarStackTrigLayerAlgo.cc.

References filterCSVwithJSON::copy, funct::cos(), dbl_to_string(), DDBase< N, C >::ddname(), DDrot(), DDSplit(), plotBeamSpotDB::first, genMat, i, cutBasedElectronID_PHYS14_PU20bx25_V1_cff::idName, idNameSpace, ladder, ladderThick, layerDz, layerR, LogDebug, number, confdb::parent, phi, DDCompactView::position(), makeMuonMisalignmentScenario::rot, edm::second(), funct::sin(), AlCaHLTBitMon_QueryRunRegistry::string, and DDSolidFactory::tubs().

49  {
50 
51  DDName mother = parent().name();
52  std::string idName = DDSplit(mother).first;
53 
54  double dphi = CLHEP::twopi/number;
55 
56  // Firstly Create Solid volumon for Stack Trig layer.
57  double rtmi = cos(0.5*dphi)*layerR- ladderThick[0] ; //fix me here for temporary test.
58  double rtmx = layerR ;
60  rtmi, rtmx, 0, CLHEP::twopi);
61  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: "
62  << DDName(idName, idNameSpace) << " Tubs made of "
63  << genMat << " from 0 to " << CLHEP::twopi/CLHEP::deg
64  << " with Rin " << rtmi << " Rout " << rtmx
65  << " ZHalf " << 0.5*layerDz;
66  // Create Logical volume for Stack Trig Layer
68  DDMaterial matter(matname);
69  DDLogicalPart layer(solid.ddname(), matter, solid);
70  // Note, How to place this stack Trig layer will be defined in data/stacktriglayer0.xml
71 
72  DDName ladderFull(DDSplit(ladder[0]).first, DDSplit(ladder[0]).second);
73 
74  int copy=1, iup=-1;
75  double phi0 = 90*CLHEP::deg;
76  for (int i=0; i<number; i++) {
77 
78  double phi = phi0 + i*dphi;
79  double phix, phiy, rrr ;
80  std::string rots;
81  // Create Translation for each Ladder.
82  DDTranslation tran;
84  iup =-iup;
85  rrr = rtmi+ 0.5* ladderThick[0];
86  tran = DDTranslation(rrr*cos(phi), rrr*sin(phi), 0);
87  rots = idName + dbl_to_string(copy);
88  if (iup > 0) phix = phi-90*CLHEP::deg;
89  else phix = phi+90*CLHEP::deg;
90  phiy = phix+90.*CLHEP::deg;
91 
92  LogDebug("PixelGeom") << "DDPixBarStackTrigLayerAlgo test: Creating a new "
93  << "rotation: " << rots << "\t90., " << phix/CLHEP::deg
94  << ", 90.," << phiy/CLHEP::deg << ", 0, 0";
95 
96  //Create Rotation for each Ladder.
97  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg, phiy, 0.,0.);
98 
99  //Place each Ladder into this Stack Trig Layer
100  cpv.position (ladderFull, layer, copy, tran, rot);
101 
102  LogDebug("PixelGeom") << "DDPixBarStackTrigLayerAlgo test: " << ladderFull
103  << " number " << copy << " positioned in "
104  << layer.name() << " at " << tran << " with "
105  << rot;
106  copy++;
107 
108  }
109 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
parent
Definition: confdb.py:1052
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:788
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::vector< std::string > ladder
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
const N & ddname() const
Definition: DDBase.h:80
void DDPixBarStackTrigLayerAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 27 of file DDPixBarStackTrigLayerAlgo.cc.

References genMat, idNameSpace, ladder, ladderThick, ladderWidth, layerDz, layerR, LogDebug, DDCurrentNamespace::ns(), and number.

31  {
32 
34 
35  genMat = sArgs["GeneralMaterial"];
36  number = int(nArgs["Ladders"]);
37 
38  layerDz = nArgs["LayerDz"];
39  layerR = nArgs["LayerR"];
40 
41  ladder = vsArgs["LadderName"];
42  ladderWidth = vArgs["LadderWidth"];
43  ladderThick = vArgs["LadderThick"];
44  LogDebug("PixelGeom") << " in stacktrig algo: number = " << number
45  << " layerDz = " << layerDz
46  << " layerR = " << layerR << std::endl;
47 }
#define LogDebug(id)
static std::string & ns()
std::vector< std::string > ladder

Member Data Documentation

std::string DDPixBarStackTrigLayerAlgo::genMat
private

Definition at line 27 of file DDPixBarStackTrigLayerAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarStackTrigLayerAlgo::idNameSpace
private

Definition at line 26 of file DDPixBarStackTrigLayerAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDPixBarStackTrigLayerAlgo::ladder
private

Definition at line 31 of file DDPixBarStackTrigLayerAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDPixBarStackTrigLayerAlgo::ladderThick
private

Definition at line 33 of file DDPixBarStackTrigLayerAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDPixBarStackTrigLayerAlgo::ladderWidth
private

Definition at line 32 of file DDPixBarStackTrigLayerAlgo.h.

Referenced by initialize().

double DDPixBarStackTrigLayerAlgo::layerDz
private

Definition at line 29 of file DDPixBarStackTrigLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarStackTrigLayerAlgo::layerR
private

Definition at line 30 of file DDPixBarStackTrigLayerAlgo.h.

Referenced by execute(), and initialize().

int DDPixBarStackTrigLayerAlgo::number
private

Definition at line 28 of file DDPixBarStackTrigLayerAlgo.h.

Referenced by execute(), and initialize().