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) {
65 if (check_root != GeometricTimingDet::MTD) {
68 if (check_child != GeometricTimingDet::MTD) {
69 throw cms::Exception(
"Configuration") <<
" The first child of the DDFilteredView is not what is expected \n" 79 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
83 std::vector<GeometricTimingDet*> subdet;
84 std::vector<GeometricTimingDet*>
layer;
90 size_t num = fv.geoHistory().size();
93 edm::LogVerbatim(
"MTDNumbering") <<
"Module = " << fv.name() <<
" fullNode = " << fullNode
94 <<
" thisNode = " << thisNode;
97 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
102 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
104 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
114 if ((thisNode == GeometricTimingDet::BTLModule) &&
limit == 0) {
115 if (theCmsMTDConstruction.
isBTLV2(fv)) {
121 }
else if ((thisNode == GeometricTimingDet::ETLModule) &&
limit == 0) {
127 if (thisNode == GeometricTimingDet::BTLModule) {
129 edm::LogVerbatim(
"MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
133 }
else if (thisNode == GeometricTimingDet::ETLModule) {
135 edm::LogVerbatim(
"MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
145 auto comp =
mtd->deepComponents();
147 for (
const auto& it :
comp) {
148 before <<
"ORDER1 " << it->geographicalId().rawId() <<
" " << it->type() <<
" " << it->translation().z() <<
"\n";
150 edm::LogVerbatim(
"MTDNumbering") <<
"GeometricTimingDet order before sorting \n" << before.str();
179 subdet[0]->addComponent(
layer[0]);
184 subdet[1]->addComponent(
layer[1]);
185 subdet[2]->addComponent(
layer[2]);
187 subdet[1]->addComponent(
layer[1]);
188 subdet[1]->addComponent(
layer[2]);
189 subdet[2]->addComponent(
layer[3]);
190 subdet[2]->addComponent(
layer[4]);
197 mtd.get()->addComponents(subdet);
203 for (
const auto& it :
comp) {
204 after <<
"ORDER2 " << it->geographicalId().rawId() <<
" " <<
static_cast<MTDDetId>(it->geographicalId()).mtdRR()
205 <<
" " << it->type() <<
" " << it->translation().z() <<
" " 208 edm::LogVerbatim(
"MTDNumbering") <<
"GeometricTimingDet order after sorting \n" << after.str();
219 auto mtd = std::make_unique<GeometricTimingDet>(&fv, GeometricTimingDet::MTD);
224 mypar.filter(ref, attribute,
"BarrelTimingLayer");
225 mypar.filter(ref, attribute,
"EndcapTimingLayer");
226 fv.mergedSpecifics(ref);
229 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Active filters using " << attribute <<
":";
232 log <<
"Filtered DD SpecPar Registry size: " << ref.size() <<
"\n";
233 for (
const auto&
t : ref) {
234 log <<
"\nSpecPar " <<
t.first <<
":\nRegExps { ";
235 for (
const auto& ki :
t.second->paths)
238 for (
const auto& kl :
t.second->spars) {
239 log << kl.first <<
" = ";
240 for (
const auto& kil : kl.second) {
249 bool doSubdet = fv.firstChild();
256 auto isBTLV2 =
false;
258 std::vector<GeometricTimingDet*> subdet;
259 std::vector<GeometricTimingDet*>
layer;
270 <<
"Module = " << fv.name() <<
" fullNode = " << fullNode <<
" thisNode = " << thisNode;
273 if (fullNode == GeometricTimingDet::BTL || fullNode == GeometricTimingDet::ETL) {
276 subdet.emplace_back(theCmsMTDConstruction.
buildSubdet(fv));
278 if (fullNode == GeometricTimingDet::BTLLayer || fullNode == GeometricTimingDet::ETLDisc) {
284 if (thisNode == GeometricTimingDet::BTLModule) {
286 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
288 if (isBTLV2 ==
false) {
289 if (theCmsMTDConstruction.
isBTLV2(fv)) {
294 }
else if (thisNode == GeometricTimingDet::ETLModule) {
296 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"Registered in GeometricTimingDet as type " << thisNode;
301 doSubdet = fv.firstChild();
307 auto comp =
mtd->deepComponents();
309 for (
const auto& it :
comp) {
310 before <<
"ORDER1 " << it->geographicalId().rawId() <<
" " << it->type() <<
" " << it->translation().z() <<
"\n";
312 edm::LogVerbatim(
"DD4hep_MTDNumbering") <<
"GeometricTimingDet order before sorting \n" << before.str();
341 subdet[0]->addComponent(
layer[0]);
346 subdet[1]->addComponent(
layer[1]);
347 subdet[2]->addComponent(
layer[2]);
349 subdet[1]->addComponent(
layer[1]);
350 subdet[1]->addComponent(
layer[2]);
351 subdet[2]->addComponent(
layer[3]);
352 subdet[2]->addComponent(
layer[4]);
359 mtd.get()->addComponents(subdet);
365 for (
const auto& it :
comp) {
366 after <<
"ORDER2 " << it->geographicalId().rawId() <<
" " <<
static_cast<MTDDetId>(it->geographicalId()).mtdRR()
367 <<
" " << it->type() <<
" " << it->translation().z() <<
" " 370 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)