34 std::string_view currentNSName(
ev.logicalPart().name().ns());
36 if (currentNSName.find(
test) != std::string::npos) {
39 std::string_view currentName(
ev.logicalPart().name().name());
41 if (currentName.find(
test) != std::string::npos) {
46 if (currentName.find(
test) != std::string::npos) {
76 const bool prev8(fv.
name().find(
"EModule") != std::string::npos);
81 ETLEndComponent = GeometricTimingDet::ETLSensor;
83 ETLEndComponent = GeometricTimingDet::ETLSensor;
87 if (check_root != GeometricTimingDet::MTD) {
90 if (check_child != GeometricTimingDet::MTD) {
91 throw cms::Exception(
"Configuration") <<
" The first child of the DDFilteredView is not what is expected \n" 101 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
105 std::vector<GeometricTimingDet*> subdet;
106 std::vector<GeometricTimingDet*>
layer;
112 size_t num = fv.geoHistory().size();
115 edm::LogVerbatim(
"MTDNumbering") <<
"Module = " << fv.name() <<
" fullNode = " << fullNode
116 <<
" thisNode = " << thisNode;
119 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
124 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
126 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
136 if ((thisNode == GeometricTimingDet::BTLModule) &&
limit == 0) {
137 if (theCmsMTDConstruction.
isBTLV2(fv)) {
143 }
else if ((thisNode == ETLEndComponent) &&
limit == 0) {
149 if (thisNode == GeometricTimingDet::BTLModule) {
151 edm::LogVerbatim(
"MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
155 }
else if (thisNode == ETLEndComponent) {
157 edm::LogVerbatim(
"MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
167 auto comp =
mtd->deepComponents();
169 for (
const auto&
it :
comp) {
170 before <<
"ORDER1 " <<
it->geographicalId().rawId() <<
" " <<
it->type() <<
" " <<
it->translation().z() <<
"\n";
172 edm::LogVerbatim(
"MTDNumbering") <<
"GeometricTimingDet order before sorting \n" << before.str();
201 subdet[0]->addComponent(
layer[0]);
206 subdet[1]->addComponent(
layer[1]);
207 subdet[2]->addComponent(
layer[2]);
209 subdet[1]->addComponent(
layer[1]);
210 subdet[1]->addComponent(
layer[2]);
211 subdet[2]->addComponent(
layer[3]);
212 subdet[2]->addComponent(
layer[4]);
219 mtd.get()->addComponents(subdet);
225 for (
const auto&
it :
comp) {
226 after <<
"ORDER2 " <<
it->geographicalId().rawId() <<
" " <<
static_cast<MTDDetId>(
it->geographicalId()).mtdRR()
227 <<
" " <<
it->type() <<
" " <<
it->translation().z() <<
" " 230 edm::LogVerbatim(
"MTDNumbering") <<
"GeometricTimingDet order after sorting \n" << after.str();
241 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
246 mypar.filter(ref, attribute,
"BarrelTimingLayer");
247 mypar.filter(ref, attribute,
"EndcapTimingLayer");
248 fv.mergedSpecifics(ref);
251 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Active filters using " << attribute <<
":";
254 log <<
"Filtered DD SpecPar Registry size: " << ref.size() <<
"\n";
255 for (
const auto&
t : ref) {
256 log <<
"\nSpecPar " <<
t.first <<
":\nRegExps { ";
257 for (
const auto& ki :
t.second->paths)
260 for (
const auto& kl :
t.second->spars) {
261 log << kl.first <<
" = ";
262 for (
const auto& kil : kl.second) {
271 bool doSubdet = fv.firstChild();
278 auto isBTLV2 =
false;
280 const bool prev8(fv.name().find(
"EModule") != std::string::npos);
285 ETLEndComponent = GeometricTimingDet::ETLSensor;
287 ETLEndComponent = GeometricTimingDet::ETLSensor;
290 std::vector<GeometricTimingDet*> subdet;
291 std::vector<GeometricTimingDet*>
layer;
302 <<
"Module = " << fv.name() <<
" fullNode = " << fullNode <<
" thisNode = " << thisNode;
305 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
308 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
310 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
316 if (thisNode == GeometricTimingDet::BTLModule) {
318 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
320 if (isBTLV2 ==
false) {
321 if (theCmsMTDConstruction.
isBTLV2(fv)) {
326 }
else if (thisNode == ETLEndComponent) {
328 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
333 doSubdet = fv.firstChild();
339 auto comp =
mtd->deepComponents();
341 for (
const auto&
it :
comp) {
342 before <<
"ORDER1 " <<
it->geographicalId().rawId() <<
" " <<
it->type() <<
" " <<
it->translation().z() <<
"\n";
344 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"GeometricTimingDet order before sorting \n" << before.str();
373 subdet[0]->addComponent(
layer[0]);
378 subdet[1]->addComponent(
layer[1]);
379 subdet[2]->addComponent(
layer[2]);
381 subdet[1]->addComponent(
layer[1]);
382 subdet[1]->addComponent(
layer[2]);
383 subdet[2]->addComponent(
layer[3]);
384 subdet[2]->addComponent(
layer[4]);
391 mtd.get()->addComponents(subdet);
397 for (
const auto&
it :
comp) {
398 after <<
"ORDER2 " <<
it->geographicalId().rawId() <<
" " <<
static_cast<MTDDetId>(
it->geographicalId()).mtdRR()
399 <<
" " <<
it->type() <<
" " <<
it->translation().z() <<
" " 402 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"GeometricTimingDet order after sorting \n" << after.str();
Log< level::Info, true > LogVerbatim
bool isBTLV2(FilteredView &)
void addNS(const std::string &addNS)
bool parent()
set the current node to the parent node ...
void buildBTLModule(FilteredView &, GeometricTimingDet *)
GeometricTimingDet * buildSubdet(FilteredView &)
GeometricTimingDet::GeometricTimingEnumType type(std::string const &) const
dd4hep::SpecParRefs DDSpecParRefs
std::vector< std::string > allowedNS_
constexpr NumType convertRadToDeg(NumType radians)
const cms::DDDetector * detector() const
const std::string & name() const
The name of a logical-part of the current node in the filtered-view.
DDSpecParRegistry const & specpars() const
static constexpr size_t kNLayerTDR
Compact representation of the geometrical detector hierarchy.
static constexpr size_t kModStrLen
static constexpr size_t kNLayerPreTDR
Detector identifier base class for the MIP Timing Layer.
std::vector< std::string > veto_
dd4hep::SpecParRegistry DDSpecParRegistry
static std::unique_ptr< GeometricTimingDet > construct(const DDCompactView &cpv)
void add(const std::string &add)
GeometricTimingDet * buildLayer(FilteredView &)
bool next(int)
set current node to the next node in the filtered tree
std::vector< std::string > allowed_
Log< level::Info, false > LogInfo
void buildETLModule(FilteredView &, GeometricTimingDet *)
dd4hep::Volume worldVolume() const
Handle to the world volume containing everything.
bool accept(const DDExpandedView &ev) const final
true, if the DDExpandedNode fulfills the filter criteria
constexpr valType make0To2pi(valType angle)
enum GTDEnumType { unknown=100, MTD=0, BTL=1, BTLLayer=2, BTLTray=3, BTLModule=4, BTLSensor=5, BTLCrystal=6, ETL=7, ETLDisc=8, ETLRing=9, ETLModule=10, ETLSensor=11 } GeometricTimingEnumType
std::vector< GeometricTimingDet const * > ConstGeometricTimingDetContainer
bool firstChild()
set the current node to the first child ...
A Filter accepts or rejects a DDExpandedNode based on a user-coded decision rule. ...
void veto(const std::string &veto)
Provides an exploded view of the detector (tree-view)