16 #include "CLHEP/Units/GlobalSystemOfUnits.h" 41 <<
"Can not proceed, no CSC parts found with the filter. The current node is: " << fv.
logicalPart().
toString();
44 int noOfAnonParams = 0;
45 std::vector<const DDsvalues_type*> spec = fv.
specifics();
46 std::vector<const DDsvalues_type*>::const_iterator spit = spec.begin();
47 std::vector<double> uparvals;
48 std::vector<double> fpar;
49 std::vector<double> dpar;
50 std::vector<double> gtran(3);
51 std::vector<double> grmat(9);
52 std::vector<double> trm(9);
69 LogTrace(
myName) <<
myName <<
": raw id for this detector is " <<
id <<
", octal " << std::oct <<
id <<
", hex " 73 int jendcap = detid.
endcap();
75 int jring = detid.
ring();
77 int jlayer = detid.
layer();
88 bool chSpecsAlreadyExist =
false;
96 LogDebug(
myName) <<
"already found a " << chamberType <<
" at index " << ct;
97 chSpecsAlreadyExist =
true;
99 for (; spit != spec.end(); spit++) {
100 DDsvalues_type::const_iterator it = (**spit).begin();
101 for (; it != (**spit).end(); it++) {
103 if (it->second.name() ==
"upar") {
104 uparvals.emplace_back(it->second.doubles().size());
105 for (
double i : it->second.doubles()) {
106 uparvals.emplace_back(
i);
109 }
else if (it->second.name() ==
"NoOfAnonParams") {
110 noOfAnonParams =
static_cast<int>(it->second.doubles()[0]);
111 }
else if (it->second.name() ==
"NumWiresPerGrp") {
113 for (
double i : it->second.doubles()) {
117 }
else if (it->second.name() ==
"NumGroups") {
119 for (
double i : it->second.doubles()) {
122 }
else if (it->second.name() ==
"WireSpacing") {
124 }
else if (it->second.name() ==
"AlignmentPinToFirstWire") {
126 }
else if (it->second.name() ==
"TotNumWireGroups") {
128 }
else if (it->second.name() ==
"LengthOfFirstWire") {
130 }
else if (it->second.name() ==
"LengthOfLastWire") {
132 }
else if (it->second.name() ==
"RadialExtentOfWirePlane") {
152 for (CSCWireGroupPackage::Container::const_iterator it = wg.
wiresInEachGroup.begin();
155 uparvals.emplace_back(*it);
157 for (CSCWireGroupPackage::Container::const_iterator it = wg.
consecutiveGroups.begin();
160 uparvals.emplace_back(*it);
177 LogTrace(
myName) <<
myName <<
": dpars are... " << dpar[4] / cm <<
", " << dpar[8] / cm <<
", " << dpar[3] / cm
178 <<
", " << dpar[0] / cm;
180 fpar.emplace_back((dpar[4] / cm));
181 fpar.emplace_back((dpar[8] / cm));
182 fpar.emplace_back((dpar[3] / cm));
183 fpar.emplace_back((dpar[0] / cm));
191 LogTrace(
myName) <<
myName <<
": gtran[0]=" << gtran[0] <<
", gtran[1]=" << gtran[1] <<
", gtran[2]=" << gtran[2];
195 fv.
rotation().GetComponents(trm.begin(), trm.end());
197 for (
size_t i = 0;
i < 9; ++
i) {
198 grmat[
i] = (
float)1.0 * trm[rotindex];
199 rotindex = rotindex + 3;
200 if ((
i + 1) % 3 == 0) {
201 rotindex = (
i + 1) / 3;
227 LogTrace(
myName) <<
myName <<
":_z_ E" << jendcap <<
" S" << jstation <<
" R" << jring <<
" C" << jchamber <<
" L" 228 << jlayer <<
" gx=" << gtran[0] <<
", gy=" << gtran[1] <<
", gz=" << gtran[2]
229 <<
" thickness=" << fpar[2] * 2.;
233 LogTrace(
myName) <<
myName <<
":_z_ frame=" << uparvals[31] / 10. <<
" gap=" << uparvals[32] / 10.
234 <<
" panel=" << uparvals[33] / 10. <<
" offset=" << uparvals[34] / 10.;
236 if (jstation == 1 && jring == 1) {
242 rig.
insert(
id, gtran, grmat, fpar);
243 if (!chSpecsAlreadyExist) {
245 LogDebug(
myName) <<
" inserting chamber type " << chamberType << std::endl;
249 std::copy(uparvals.begin(), uparvals.end(), std::back_inserter(rdp.
pfupars));
256 const int kNoOfAnonParams = 35;
257 if (noOfAnonParams == 0) {
258 noOfAnonParams = kNoOfAnonParams;
263 uparvals.begin() + noOfAnonParams + 1, uparvals.begin() + (2 * noOfAnonParams) + 2, uparvals.begin() + 1);
266 rig.
insert(detid1a.rawId(), gtran, grmat, fpar);
276 LogDebug(
myName) <<
"found chamber type " << chtypeA <<
" so don't put it in! ";
283 std::copy(uparvals.begin(), uparvals.end(), std::back_inserter(rdp.
pfupars));
287 rig.
insert(
id, gtran, grmat, fpar);
288 if (!chSpecsAlreadyExist) {
294 std::copy(uparvals.begin(), uparvals.end(), std::back_inserter(rdp.
pfupars));
300 doSubDets = fv.
next();
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
static int whatChamberType(int istation, int iring)
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
double narrowWidthOfWirePlane
Container wiresInEachGroup
virtual ~CSCGeometryParsFromDD()
Destructor.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Compact representation of the geometrical detector hierarchy.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
A DDSolid represents the shape of a part.
bool build(const DDCompactView *cview, const MuonDDDConstants &muonConstants, RecoIdealGeometry &rig, CSCRecoDigiParameters &rdp)
Build the geometry returning the RecoIdealGeometry and the CSCRecoDigiParameters objects.
std::vector< float > pfupars
U second(std::pair< T, U > const &p)
bool next()
set current node to the next node in the filtered tree
std::vector< int > pChamberType
std::vector< int > pUserParOffset
DDSolidShape shape(void) const
The type of the solid.
double wideWidthOfWirePlane
DDSolid solidA(void) const
std::string toString() const
std::vector< int > pUserParSize
int baseNumberToUnitNumber(const MuonBaseNumber &) override
bool firstChild()
set the current node to the first child ...
CSCGeometryParsFromDD()
Constructor.
Container consecutiveGroups
const DDTranslation & translation() const
The absolute translation of the current node.
std::vector< const DDsvalues_type * > specifics() const
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history)
double alignmentPinToFirstWire