Warning, file /DD4hep/examples/DDCMS/src/plugins/DDTECPhiAltAlgo.cpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include "DD4hep/DetFactoryHelper.h"
0020 #include "DDCMS/DDCMSPlugins.h"
0021
0022 using namespace std;
0023 using namespace dd4hep;
0024 using namespace dd4hep::cms;
0025
0026 static long algorithm(Detector& ,
0027 ParsingContext& ctxt,
0028 xml_h e,
0029 SensitiveDetector& )
0030 {
0031 Namespace ns(ctxt, e, true);
0032 AlgoArguments args(ctxt, e);
0033 Volume mother = ns.volume(args.parentName());
0034 Volume child = ns.volume(args.childName());
0035 double startAngle = args.value<double>("StartAngle");
0036 double incrAngle = args.value<double>("IncrAngle");
0037 double zIn = args.value<double>("ZIn");
0038 double zOut = args.value<double>("ZOut");
0039 int number = args.value<double>("Number");
0040 int startCopyNo = args.find("StartCopyNo") ? args.value<int>("StartCopyNo") : 1;
0041 int incrCopyNo = args.find("IncrCopyNo") ? args.value<int>("IncrCopyNo") : 1;
0042
0043 LogDebug("TECGeom") << "debug: Parameters for "
0044 << "positioning--" << "\tStartAngle "
0045 << startAngle/CLHEP::deg << "\tIncrAngle "
0046 << incrAngle/CLHEP::deg << "\tZ in/out " << zIn << ", "
0047 << zOut << "\tCopy Numbers " << number
0048 << " Start/Increment " << startCopyNo << ", "
0049 << incrCopyNo;
0050 LogDebug("TECGeom") << "debug: Parent " << mother.name()
0051 << "\tChild " << child.name() << " NameSpace "
0052 << ns.name;
0053
0054 if (number > 0) {
0055 double theta = 90.*CLHEP::deg;
0056 int copyNo = startCopyNo;
0057 for (int i=0; i<number; i++) {
0058 double phiz = startAngle + i*incrAngle;
0059 double phix = phiz + 90.*CLHEP::deg;
0060 Rotation3D rotation = make_rotation3D(theta, phix, 0e0, 0e0, theta, phiz);
0061 Position tran(0., 0., (i%2 == 0) ? zIn : zOut);
0062 mother.placeVolume(child,copyNo,Transform3D(rotation,tran));
0063 LogDebug("TECGeom") << "test: " << child.name() <<" number "
0064 << copyNo << " positioned in " << mother.name() <<" at "
0065 << tran << " with " << rotation;
0066 copyNo += incrCopyNo;
0067 }
0068 }
0069 return 1;
0070 }
0071
0072
0073 DECLARE_DDCMS_DETELEMENT(DDCMS_track_DDTECPhiAltAlgo,algorithm)
0074