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 20 of file DDPixBarStackTrigLayerAlgo.cc.

References LogDebug.

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

Definition at line 24 of file DDPixBarStackTrigLayerAlgo.cc.

24 {}

Member Function Documentation

void DDPixBarStackTrigLayerAlgo::execute ( DDCompactView cpv)

Definition at line 48 of file DDPixBarStackTrigLayerAlgo.cc.

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

48  {
49 
50  DDName mother = parent().name();
51  std::string idName = DDSplit(mother).first;
52 
53  double dphi = CLHEP::twopi/number;
54 
55  // Firstly Create Solid volumon for Stack Trig layer.
56  double rtmi = cos(0.5*dphi)*layerR- ladderThick[0] ; //fix me here for temporary test.
57  double rtmx = layerR ;
59  rtmi, rtmx, 0, CLHEP::twopi);
60  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: "
61  << DDName(idName, idNameSpace) << " Tubs made of "
62  << genMat << " from 0 to " << CLHEP::twopi/CLHEP::deg
63  << " with Rin " << rtmi << " Rout " << rtmx
64  << " ZHalf " << 0.5*layerDz;
65  // Create Logical volume for Stack Trig Layer
67  DDMaterial matter(matname);
68  DDLogicalPart layer(solid.ddname(), matter, solid);
69  // Note, How to place this stack Trig layer will be defined in data/stacktriglayer0.xml
70 
71  DDName ladderFull(DDSplit(ladder[0]).first, DDSplit(ladder[0]).second);
72 
73  int copy=1, iup=-1;
74  double phi0 = 90*CLHEP::deg;
75  for (int i=0; i<number; i++) {
76 
77  double phi = phi0 + i*dphi;
78  double phix, phiy, rrr ;
79  std::string rots;
80  // Create Translation for each Ladder.
81  DDTranslation tran;
83  iup =-iup;
84  rrr = rtmi+ 0.5* ladderThick[0];
85  tran = DDTranslation(rrr*cos(phi), rrr*sin(phi), 0);
86  rots = idName + std::to_string(copy);
87  if (iup > 0) phix = phi-90*CLHEP::deg;
88  else phix = phi+90*CLHEP::deg;
89  phiy = phix+90.*CLHEP::deg;
90 
91  LogDebug("PixelGeom") << "DDPixBarStackTrigLayerAlgo test: Creating a new "
92  << "rotation: " << rots << "\t90., " << phix/CLHEP::deg
93  << ", 90.," << phiy/CLHEP::deg << ", 0, 0";
94 
95  //Create Rotation for each Ladder.
96  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg, phiy, 0.,0.);
97 
98  //Place each Ladder into this Stack Trig Layer
99  cpv.position (ladderFull, layer, copy, tran, rot);
100 
101  LogDebug("PixelGeom") << "DDPixBarStackTrigLayerAlgo test: " << ladderFull
102  << " number " << copy << " positioned in "
103  << layer.name() << " at " << tran << " with "
104  << rot;
105  copy++;
106 
107  }
108 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
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:16
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
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:92
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:823
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 26 of file DDPixBarStackTrigLayerAlgo.cc.

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

30  {
31 
33 
34  genMat = sArgs["GeneralMaterial"];
35  number = int(nArgs["Ladders"]);
36 
37  layerDz = nArgs["LayerDz"];
38  layerR = nArgs["LayerR"];
39 
40  ladder = vsArgs["LadderName"];
41  ladderWidth = vArgs["LadderWidth"];
42  ladderThick = vArgs["LadderThick"];
43  LogDebug("PixelGeom") << " in stacktrig algo: number = " << number
44  << " layerDz = " << layerDz
45  << " layerR = " << layerR << std::endl;
46 }
#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().