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!";
172 baseNumber_.setSize(gh.size());
174 for (
uint i = gh.size();
i-- > 0;) {
175 baseNumber_.addLevel(gh[
i].logicalPart().
name().
name(), gh[
i].copyno());
177 edm::LogVerbatim(
"CmsMTDConstruction") << gh[
i].logicalPart().name().name() <<
" " << gh[
i].copyno();
181 det->setGeographicalID(
ETLDetId(etlScheme_.getUnitID(baseNumber_)));
185 auto module_number = copyNumbers[copyNumbers.size() - 2];
187 size_t delim_ring = det->name().find(
"EModule");
188 size_t delim_disc = det->name().find(
"Disc");
192 const uint32_t side = det->translation().z() > 0 ? 1 : 0;
195 det->setGeographicalID(
ETLDetId(side, atoi(ringN.c_str()), module_number, 0));
208 baseNumber_.setSize(fv.
copyNos().size());
212 size_t ipos =
name.rfind(
'_');
213 baseNumber_.addLevel(
name.substr(0, ipos), fv.
copyNos()[
i]);
219 det->setGeographicalID(
ETLDetId(etlScheme_.getUnitID(baseNumber_)));
224 template <
class FilteredView>
227 auto thisDet = theCmsMTDStringToEnum.type(nodeName);
230 if (thisDet == GeometricTimingDet::BTL) {
232 }
else if (thisDet == GeometricTimingDet::ETL) {
233 const uint32_t side = subdet->
translation().z() > 0 ? 1 : 0;
236 throw cms::Exception(
"CmsMTDConstruction") <<
" ERROR - I was expecting a SubDet, I got a " << fv.name();
242 template <
class FilteredView>
245 auto thisDet = theCmsMTDStringToEnum.type(nodeName);
248 if (thisDet != GeometricTimingDet::BTLLayer && thisDet != GeometricTimingDet::ETLDisc) {
249 throw cms::Exception(
"CmsMTDConstruction") <<
" ERROR - I was expecting a SubDet, I got a " << fv.name();
253 if (thisDet == GeometricTimingDet::BTLLayer) {
258 layer->setGeographicalID(nLayer);
259 }
else if (thisDet == GeometricTimingDet::ETLDisc) {
263 nLayer = (fv.name().find(
"Disc1") != std::string::npos) ? 1 : 2;
264 layer->setGeographicalID(nLayer);
270 template <
class FilteredView>
272 return (fv.name().substr(0, 9) ==
"BTLModule");
275 template <
class FilteredView>
277 return (fv.name() ==
"EModule_Timingactive");
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 *)
bool isETLtdr(FilteredView &)
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)