32 if (
ev.logicalPart().name().fullname().find(
test) != std::string::npos)
36 if (
ev.logicalPart().name().fullname().find(
test) != std::string::npos)
54 std::vector<std::string> volnames = {
"service",
65 "MIC6_Aluminium_Disc",
71 "SensorModule_Front_Left",
72 "SensorModule_Front_Right",
73 "SensorModule_Back_Left",
74 "SensorModule_Back_Right",
100 for (
auto const& theVol : volnames) {
108 auto isBTLV2 =
false;
111 if (check_root != GeometricTimingDet::MTD) {
114 if (check_child != GeometricTimingDet::MTD) {
115 throw cms::Exception(
"Configuration") <<
" The first child of the DDFilteredView is not what is expected \n" 125 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
129 std::vector<GeometricTimingDet*> subdet;
130 std::vector<GeometricTimingDet*>
layer;
136 size_t num = fv.geoHistory().size();
139 edm::LogVerbatim(
"MTDNumbering") <<
"Module = " << fv.name() <<
" fullNode = " << fullNode
140 <<
" thisNode = " << thisNode;
143 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
148 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
150 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
160 if ((thisNode == GeometricTimingDet::BTLModule) &&
limit == 0) {
161 if (theCmsMTDConstruction.
isBTLV2(fv)) {
167 }
else if ((thisNode == GeometricTimingDet::ETLModule) &&
limit == 0) {
168 if (theCmsMTDConstruction.
isETLtdr(fv)) {
177 if (thisNode == GeometricTimingDet::BTLModule) {
179 edm::LogVerbatim(
"MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
183 }
else if (thisNode == GeometricTimingDet::ETLModule) {
185 edm::LogVerbatim(
"MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
195 auto comp =
mtd->deepComponents();
197 for (
const auto& it :
comp) {
198 before <<
"ORDER1 " << it->geographicalId().rawId() <<
" " << it->type() <<
" " << it->translation().z() <<
"\n";
200 edm::LogVerbatim(
"MTDNumbering") <<
"GeometricTimingDet order before sorting \n" << before.str();
229 subdet[0]->addComponent(
layer[0]);
234 subdet[1]->addComponent(
layer[1]);
235 subdet[2]->addComponent(
layer[2]);
237 subdet[1]->addComponent(
layer[1]);
238 subdet[1]->addComponent(
layer[2]);
239 subdet[2]->addComponent(
layer[3]);
240 subdet[2]->addComponent(
layer[4]);
247 mtd.get()->addComponents(subdet);
253 for (
const auto& it :
comp) {
254 after <<
"ORDER2 " << it->geographicalId().rawId() <<
" " <<
static_cast<MTDDetId>(it->geographicalId()).mtdRR()
255 <<
" " << it->type() <<
" " << it->translation().z() <<
" " 258 edm::LogVerbatim(
"MTDNumbering") <<
"GeometricTimingDet order after sorting \n" << after.str();
269 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
274 mypar.filter(ref, attribute,
"BarrelTimingLayer");
275 mypar.filter(ref, attribute,
"EndcapTimingLayer");
276 fv.mergedSpecifics(ref);
279 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Active filters using " << attribute <<
":";
282 log <<
"Filtered DD SpecPar Registry size: " << ref.size() <<
"\n";
283 for (
const auto&
t : ref) {
284 log <<
"\nSpecPar " <<
t.first <<
":\nRegExps { ";
285 for (
const auto& ki :
t.second->paths)
288 for (
const auto& kl :
t.second->spars) {
289 log << kl.first <<
" = ";
290 for (
const auto& kil : kl.second) {
299 bool doSubdet = fv.firstChild();
306 auto isBTLV2 =
false;
308 std::vector<GeometricTimingDet*> subdet;
309 std::vector<GeometricTimingDet*>
layer;
320 <<
"Module = " << fv.name() <<
" fullNode = " << fullNode <<
" thisNode = " << thisNode;
323 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
326 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
328 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
334 if (thisNode == GeometricTimingDet::BTLModule) {
336 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
338 if (isBTLV2 ==
false) {
339 if (theCmsMTDConstruction.
isBTLV2(fv)) {
344 }
else if (thisNode == GeometricTimingDet::ETLModule) {
346 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
351 doSubdet = fv.firstChild();
357 auto comp =
mtd->deepComponents();
359 for (
const auto& it :
comp) {
360 before <<
"ORDER1 " << it->geographicalId().rawId() <<
" " << it->type() <<
" " << it->translation().z() <<
"\n";
362 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"GeometricTimingDet order before sorting \n" << before.str();
391 subdet[0]->addComponent(
layer[0]);
396 subdet[1]->addComponent(
layer[1]);
397 subdet[2]->addComponent(
layer[2]);
399 subdet[1]->addComponent(
layer[1]);
400 subdet[1]->addComponent(
layer[2]);
401 subdet[2]->addComponent(
layer[3]);
402 subdet[2]->addComponent(
layer[4]);
409 mtd.get()->addComponents(subdet);
415 for (
const auto& it :
comp) {
416 after <<
"ORDER2 " << it->geographicalId().rawId() <<
" " <<
static_cast<MTDDetId>(it->geographicalId()).mtdRR()
417 <<
" " << it->type() <<
" " << it->translation().z() <<
" " 420 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"GeometricTimingDet order after sorting \n" << after.str();
Log< level::Info, true > LogVerbatim
bool isBTLV2(FilteredView &)
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
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
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
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
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)