27 if (
ev.logicalPart().name().fullname().find(
test) != std::string::npos)
31 if (
ev.logicalPart().name().fullname().find(
test) != std::string::npos)
55 filter.veto(
"SupportPlate");
57 filter.veto(
"ThermalScreen");
58 filter.veto(
"Aluminium_Disc");
59 filter.veto(
"MIC6_Aluminium_Disc");
64 filter.veto(
"SensorModule");
66 filter.veto(
"LGAD_Substrate");
73 if (check_root != GeometricTimingDet::MTD) {
76 if (check_child != GeometricTimingDet::MTD) {
77 throw cms::Exception(
"Configuration") <<
" The first child of the DDFilteredView is not what is expected \n" 87 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
91 std::vector<GeometricTimingDet*> subdet;
92 std::vector<GeometricTimingDet*>
layer;
98 size_t num = fv.geoHistory().size();
101 edm::LogVerbatim(
"MTDNumbering") <<
"Module = " << fv.name() <<
" fullNode = " << fullNode
102 <<
" thisNode = " << thisNode;
105 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
110 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
112 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
121 if ((thisNode == GeometricTimingDet::BTLModule) &&
limit == 0) {
127 else if ((thisNode == GeometricTimingDet::ETLModule) &&
limit == 0) {
128 if (theCmsMTDConstruction.
isETLtdr(fv)) {
137 if (thisNode == GeometricTimingDet::BTLModule) {
139 edm::LogVerbatim(
"MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
143 }
else if (thisNode == GeometricTimingDet::ETLModule) {
145 edm::LogVerbatim(
"MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
155 auto comp =
mtd->deepComponents();
157 for (
const auto& it :
comp) {
158 before <<
"ORDER1 " << it->geographicalId().rawId() <<
" " << it->type() <<
" " << it->translation().z() <<
"\n";
160 edm::LogVerbatim(
"MTDNumbering") <<
"GeometricTimingDet order before sorting \n" << before.str();
175 subdet[0]->addComponent(
layer[0]);
180 subdet[1]->addComponent(
layer[1]);
181 subdet[2]->addComponent(
layer[2]);
183 subdet[1]->addComponent(
layer[1]);
184 subdet[1]->addComponent(
layer[2]);
185 subdet[2]->addComponent(
layer[3]);
186 subdet[2]->addComponent(
layer[4]);
193 mtd.get()->addComponents(subdet);
199 for (
const auto& it :
comp) {
200 after <<
"ORDER2 " << it->geographicalId().rawId() <<
" " << it->type() <<
" " << it->translation().z() <<
"\n";
202 edm::LogVerbatim(
"MTDNumbering") <<
"GeometricTimingDet order after sorting \n" << after.str();
213 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
218 mypar.filter(ref, attribute,
"BarrelTimingLayer");
219 mypar.filter(ref, attribute,
"EndcapTimingLayer");
220 fv.mergedSpecifics(ref);
223 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Active filters using " << attribute <<
":";
226 log <<
"Filtered DD SpecPar Registry size: " << ref.size() <<
"\n";
227 for (
const auto&
t : ref) {
228 log <<
"\nSpecPar " <<
t.first <<
":\nRegExps { ";
229 for (
const auto& ki :
t.second->paths)
232 for (
const auto& kl :
t.second->spars) {
233 log << kl.first <<
" = ";
234 for (
const auto& kil : kl.second) {
243 bool doSubdet = fv.firstChild();
250 std::vector<GeometricTimingDet*> subdet;
251 std::vector<GeometricTimingDet*>
layer;
262 <<
"Module = " << fv.name() <<
" fullNode = " << fullNode <<
" thisNode = " << thisNode;
265 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
268 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
270 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
276 if (thisNode == GeometricTimingDet::BTLModule) {
278 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
281 }
else if (thisNode == GeometricTimingDet::ETLModule) {
283 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
288 doSubdet = fv.firstChild();
294 auto comp =
mtd->deepComponents();
296 for (
const auto& it :
comp) {
297 before <<
"ORDER1 " << it->geographicalId().rawId() <<
" " << it->type() <<
" " << it->translation().z() <<
"\n";
299 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"GeometricTimingDet order before sorting \n" << before.str();
314 subdet[0]->addComponent(
layer[0]);
319 subdet[1]->addComponent(
layer[1]);
320 subdet[2]->addComponent(
layer[2]);
322 subdet[1]->addComponent(
layer[1]);
323 subdet[1]->addComponent(
layer[2]);
324 subdet[2]->addComponent(
layer[3]);
325 subdet[2]->addComponent(
layer[4]);
332 mtd.get()->addComponents(subdet);
338 for (
const auto& it :
comp) {
339 after <<
"ORDER2 " << it->geographicalId().rawId() <<
" " << it->type() <<
" " << it->translation().z() <<
"\n";
341 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"GeometricTimingDet order after sorting \n" << after.str();
Log< level::Info, true > LogVerbatim
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
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
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< std::string > veto_
dd4hep::SpecParRegistry DDSpecParRegistry
static std::unique_ptr< GeometricTimingDet > construct(const DDCompactView &cpv)
bool isETLtdr(FilteredView &)
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
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)