16 template <
class FilteredView>
19 template <
class FilteredView>
21 bool order = (
a->translation().z() ==
b->translation().z()) ?
a->translation().rho() <
b->translation().rho()
22 :
a->translation().z() <
b->translation().z();
26 template <
class FilteredView>
30 return id1.mtdRR() <
id2.mtdRR();
33 template <
class FilteredView>
40 template <
class FilteredView>
46 template <
class FilteredView>
50 (
a->translation().z() <
b->translation().z());
64 baseNumber_.setSize(gh.size());
66 for (
uint i = gh.size();
i-- > 0;) {
67 baseNumber_.addLevel(gh[
i].logicalPart().
name().
name(), gh[
i].copyno());
69 edm::LogVerbatim(
"CmsMTDConstruction") << gh[
i].logicalPart().name().name() <<
" " << gh[
i].copyno();
73 det->setGeographicalID(
BTLDetId(btlScheme_.getUnitID(baseNumber_)));
77 auto module_number = copyNumbers[copyNumbers.size() - 2];
79 constexpr
char positive[] =
"PositiveZ";
80 constexpr
char negative[] =
"NegativeZ";
83 size_t delim1 =
modname.find(
"BModule");
84 size_t delim2 =
modname.find(
"Layer");
89 <<
"BTLModule = " <<
modname <<
" " << copyNumbers[copyNumbers.size() - 3] <<
" " << module_number;
92 if (
modname.find(positive) != std::string::npos) {
93 det->setGeographicalID(
BTLDetId(1, copyNumbers[copyNumbers.size() - 3], module_number, 0, 1));
94 }
else if (
modname.find(negative) != std::string::npos) {
95 det->setGeographicalID(
BTLDetId(0, copyNumbers[copyNumbers.size() - 3], module_number, 0, 1));
98 <<
"BTL Module " << module_number <<
" is neither positive nor negative in Z!";
113 baseNumber_.setSize(fv.
copyNos().size());
117 size_t ipos =
name.rfind(
'_');
118 baseNumber_.addLevel(
name.substr(0, ipos), fv.
copyNos()[
i]);
124 det->setGeographicalID(
BTLDetId(btlScheme_.getUnitID(baseNumber_)));
128 auto module_number = copyNumbers[1];
130 constexpr
char positive[] =
"PositiveZ";
131 constexpr
char negative[] =
"NegativeZ";
134 size_t delim1 =
modname.find(
"BModule");
135 size_t delim2 =
modname.find(
"Layer");
143 if (
modname.find(positive) != std::string::npos) {
144 det->setGeographicalID(
BTLDetId(1, copyNumbers[2], module_number, 0, 1));
145 }
else if (
modname.find(negative) != std::string::npos) {
146 det->setGeographicalID(
BTLDetId(0, copyNumbers[2], module_number, 0, 1));
149 <<
"BTL Module " << module_number <<
" is neither positive nor negative in Z!";
165 baseNumber_.setSize(gh.size());
167 for (
uint i = gh.size();
i-- > 0;) {
168 baseNumber_.addLevel(gh[
i].logicalPart().
name().
name(), gh[
i].copyno());
170 edm::LogVerbatim(
"CmsMTDConstruction") << gh[
i].logicalPart().name().name() <<
" " << gh[
i].copyno();
174 det->setGeographicalID(
ETLDetId(etlScheme_.getUnitID(baseNumber_)));
186 baseNumber_.setSize(fv.
copyNos().size());
190 size_t ipos =
name.rfind(
'_');
191 baseNumber_.addLevel(
name.substr(0, ipos), fv.
copyNos()[
i]);
197 det->setGeographicalID(
ETLDetId(etlScheme_.getUnitID(baseNumber_)));
202 template <
class FilteredView>
205 auto thisDet = theCmsMTDStringToEnum.type(nodeName);
208 if (thisDet == GeometricTimingDet::BTL) {
210 }
else if (thisDet == GeometricTimingDet::ETL) {
211 const uint32_t side = subdet->
translation().z() > 0 ? 1 : 0;
214 throw cms::Exception(
"CmsMTDConstruction") <<
" ERROR - I was expecting a SubDet, I got a " << fv.name();
220 template <
class FilteredView>
223 auto thisDet = theCmsMTDStringToEnum.type(nodeName);
226 if (thisDet != GeometricTimingDet::BTLLayer && thisDet != GeometricTimingDet::ETLDisc) {
227 throw cms::Exception(
"CmsMTDConstruction") <<
" ERROR - I was expecting a SubDet, I got a " << fv.name();
231 if (thisDet == GeometricTimingDet::BTLLayer) {
236 layer->setGeographicalID(nLayer);
237 }
else if (thisDet == GeometricTimingDet::ETLDisc) {
241 nLayer = (fv.name().find(
"Disc1") != std::string::npos) ? 1 : 2;
242 layer->setGeographicalID(nLayer);
248 template <
class FilteredView>
250 return (fv.name().substr(0, 9) ==
"BTLModule");
Log< level::Info, true > LogVerbatim
bool isBTLV2(FilteredView &)
nav_type copyNumbers() const
return the stack of copy numbers
const std::vector< int > copyNos() const
The list of the volume copy numbers.
void buildBTLModule(FilteredView &, GeometricTimingDet *)
GeometricTimingDet * buildSubdet(FilteredView &)
const std::string path() const
The full path to the current node.
constexpr NumType convertRadToDeg(NumType radians)
const std::vector< const Node * > geoHistory() const
const std::string & name() const
The name of a logical-part of the current node in the filtered-view.
static constexpr size_t kModStrLen
Detector identifier base class for the MIP Timing Layer.
std::string_view name() const
void addComponent(GeometricTimingDet *)
GeometricTimingDet * buildLayer(FilteredView &)
void setGeographicalID(DetId id)
void buildETLModule(FilteredView &, GeometricTimingDet *)
Translation const & translation() const
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
static bool mtdOrderZ(const GeometricTimingDet *a, const GeometricTimingDet *b)
constexpr valType make0To2pi(valType angle)
static bool mtdOrderRR(const GeometricTimingDet *a, const GeometricTimingDet *b)
Detector identifier class for the Endcap Timing Layer.
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
auto copyNumbers(Ts &&... ts) const -> decltype(copyNos(std::forward< Ts >(ts)...))
static bool btlOrderPhi(const GeometricTimingDet *a, const GeometricTimingDet *b)
static bool btlOrderZ(const GeometricTimingDet *a, const GeometricTimingDet *b)
static bool mtdOrderPhi(const GeometricTimingDet *a, const GeometricTimingDet *b)