31 if (currentName.find(
test) != std::string::npos)
35 if (currentName.find(
test) != std::string::npos)
53 std::vector<std::string> volnames = {
"FSide",
"SupportPlate"};
54 for (
auto const& theVol : volnames) {
64 const bool prev8(fv.
name().find(
"EModule") != std::string::npos);
69 ETLEndComponent = GeometricTimingDet::ETLSensor;
71 ETLEndComponent = GeometricTimingDet::ETLSensor;
75 if (check_root != GeometricTimingDet::MTD) {
78 if (check_child != GeometricTimingDet::MTD) {
79 throw cms::Exception(
"Configuration") <<
" The first child of the DDFilteredView is not what is expected \n" 89 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
93 std::vector<GeometricTimingDet*> subdet;
94 std::vector<GeometricTimingDet*>
layer;
100 size_t num = fv.geoHistory().size();
103 edm::LogVerbatim(
"MTDNumbering") <<
"Module = " << fv.name() <<
" fullNode = " << fullNode
104 <<
" thisNode = " << thisNode;
107 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
112 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
114 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
124 if ((thisNode == GeometricTimingDet::BTLModule) &&
limit == 0) {
125 if (theCmsMTDConstruction.
isBTLV2(fv)) {
131 }
else if ((thisNode == ETLEndComponent) &&
limit == 0) {
137 if (thisNode == GeometricTimingDet::BTLModule) {
139 edm::LogVerbatim(
"MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
143 }
else if (thisNode == ETLEndComponent) {
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();
189 subdet[0]->addComponent(
layer[0]);
194 subdet[1]->addComponent(
layer[1]);
195 subdet[2]->addComponent(
layer[2]);
197 subdet[1]->addComponent(
layer[1]);
198 subdet[1]->addComponent(
layer[2]);
199 subdet[2]->addComponent(
layer[3]);
200 subdet[2]->addComponent(
layer[4]);
207 mtd.get()->addComponents(subdet);
213 for (
const auto& it :
comp) {
214 after <<
"ORDER2 " << it->geographicalId().rawId() <<
" " <<
static_cast<MTDDetId>(it->geographicalId()).mtdRR()
215 <<
" " << it->type() <<
" " << it->translation().z() <<
" " 218 edm::LogVerbatim(
"MTDNumbering") <<
"GeometricTimingDet order after sorting \n" << after.str();
229 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
234 mypar.filter(ref, attribute,
"BarrelTimingLayer");
235 mypar.filter(ref, attribute,
"EndcapTimingLayer");
236 fv.mergedSpecifics(ref);
239 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Active filters using " << attribute <<
":";
242 log <<
"Filtered DD SpecPar Registry size: " << ref.size() <<
"\n";
243 for (
const auto&
t : ref) {
244 log <<
"\nSpecPar " <<
t.first <<
":\nRegExps { ";
245 for (
const auto& ki :
t.second->paths)
248 for (
const auto& kl :
t.second->spars) {
249 log << kl.first <<
" = ";
250 for (
const auto& kil : kl.second) {
259 bool doSubdet = fv.firstChild();
266 auto isBTLV2 =
false;
268 const bool prev8(fv.name().find(
"EModule") != std::string::npos);
273 ETLEndComponent = GeometricTimingDet::ETLSensor;
275 ETLEndComponent = GeometricTimingDet::ETLSensor;
278 std::vector<GeometricTimingDet*> subdet;
279 std::vector<GeometricTimingDet*>
layer;
290 <<
"Module = " << fv.name() <<
" fullNode = " << fullNode <<
" thisNode = " << thisNode;
293 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
296 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
298 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
304 if (thisNode == GeometricTimingDet::BTLModule) {
306 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
308 if (isBTLV2 ==
false) {
309 if (theCmsMTDConstruction.
isBTLV2(fv)) {
314 }
else if (thisNode == ETLEndComponent) {
316 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
321 doSubdet = fv.firstChild();
327 auto comp =
mtd->deepComponents();
329 for (
const auto& it :
comp) {
330 before <<
"ORDER1 " << it->geographicalId().rawId() <<
" " << it->type() <<
" " << it->translation().z() <<
"\n";
332 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"GeometricTimingDet order before sorting \n" << before.str();
361 subdet[0]->addComponent(
layer[0]);
366 subdet[1]->addComponent(
layer[1]);
367 subdet[2]->addComponent(
layer[2]);
369 subdet[1]->addComponent(
layer[1]);
370 subdet[1]->addComponent(
layer[2]);
371 subdet[2]->addComponent(
layer[3]);
372 subdet[2]->addComponent(
layer[4]);
379 mtd.get()->addComponents(subdet);
385 for (
const auto& it :
comp) {
386 after <<
"ORDER2 " << it->geographicalId().rawId() <<
" " <<
static_cast<MTDDetId>(it->geographicalId()).mtdRR()
387 <<
" " << it->type() <<
" " << it->translation().z() <<
" " 390 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
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)