CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
CmsMTDConstruction Class Reference

#include <CmsMTDConstruction.h>

Inheritance diagram for CmsMTDConstruction:
CmsMTDLevelBuilder CmsMTDAbstractConstruction

Public Member Functions

void buildComponent (DDFilteredView &, GeometricTimingDet *, std::string) override
 
- Public Member Functions inherited from CmsMTDLevelBuilder
void build (DDFilteredView &, GeometricTimingDet *, std::string) override
 
 ~CmsMTDLevelBuilder () override
 
- Public Member Functions inherited from CmsMTDAbstractConstruction
virtual ~CmsMTDAbstractConstruction ()=default
 

Private Member Functions

void buildBTLModule (DDFilteredView &, GeometricTimingDet *, const std::string &)
 
void buildETLModule (DDFilteredView &, GeometricTimingDet *, const std::string &)
 

Additional Inherited Members

- Static Public Member Functions inherited from CmsMTDLevelBuilder
static double getPhi (const GeometricTimingDet *a)
 
static double getPhiGluedModule (const GeometricTimingDet *a)
 
static double getPhiGluedModuleMirror (const GeometricTimingDet *a)
 
static double getPhiMirror (const GeometricTimingDet *a)
 
static double getPhiModule (const GeometricTimingDet *a)
 
static double getPhiModuleMirror (const GeometricTimingDet *a)
 
static bool isLessModZ (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool isLessR (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool isLessRModule (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool isLessZ (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool phiSortNP (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool subDetByType (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
- Protected Attributes inherited from CmsMTDLevelBuilder
CmsMTDStringToEnum theCmsMTDStringToEnum
 

Detailed Description

Adds GeometricTimingDets representing final modules to the previous level

Definition at line 9 of file CmsMTDConstruction.h.

Member Function Documentation

void CmsMTDConstruction::buildBTLModule ( DDFilteredView fv,
GeometricTimingDet mother,
const std::string &  attribute 
)
private

Definition at line 41 of file CmsMTDConstruction.cc.

References GeometricTimingDet::addComponent(), constexpr, DDFilteredView::copyNumbers(), Exception, DDName::fullname(), DDFilteredView::logicalPart(), DDBase< N, C >::name(), GeometricTimingDet::setGeographicalID(), AlCaHLTBitMon_QueryRunRegistry::string, CmsMTDLevelBuilder::theCmsMTDStringToEnum, and CmsMTDStringToEnum::type().

Referenced by buildComponent().

43  {
44 
46 
47  const auto& copyNumbers = fv.copyNumbers();
48  auto module_number = copyNumbers[copyNumbers.size()-2];
49 
50  constexpr char positive[] = "PositiveZ";
51  constexpr char negative[] = "NegativeZ";
52 
53  const std::string modname = fv.logicalPart().name().fullname();
54  size_t delim1 = modname.find("BModule");
55  size_t delim2 = modname.find("Layer");
56  module_number += atoi(modname.substr(delim1+7,delim2).c_str())-1;
57 
58  if( modname.find(positive) != std::string::npos ) {
59  det->setGeographicalID(BTLDetId(1,copyNumbers[copyNumbers.size()-3],module_number,0,1));
60  } else if ( modname.find(negative) != std::string::npos ) {
61  det->setGeographicalID(BTLDetId(0,copyNumbers[copyNumbers.size()-3],module_number,0,1));
62  } else {
63  throw cms::Exception("CmsMTDConstruction::buildBTLModule")
64  << "BTL Module " << module_number << " is neither positive nor negative in Z!";
65  }
66 
67  mother->addComponent(det);
68 }
GeometricTimingDet::GeometricTimingEnumType type(std::string const &) const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:74
nav_type copyNumbers() const
return the stack of copy numbers
CmsMTDStringToEnum theCmsMTDStringToEnum
void addComponent(GeometricTimingDet *)
const std::string fullname() const
Definition: DDName.h:43
void setGeographicalID(DetId id)
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:18
#define constexpr
void CmsMTDConstruction::buildComponent ( DDFilteredView fv,
GeometricTimingDet mother,
std::string  attribute 
)
overridevirtual

Implements CmsMTDLevelBuilder.

Definition at line 8 of file CmsMTDConstruction.cc.

References GeometricTimingDet::addComponent(), GeometricTimingDet::BTLModule, buildBTLModule(), buildETLModule(), GeometricTimingDet::ETLModule, Exception, DDFilteredView::firstChild(), DDName::fullname(), DDFilteredView::logicalPart(), DDBase< N, C >::name(), DDFilteredView::nextSibling(), DDFilteredView::parent(), AlCaHLTBitMon_QueryRunRegistry::string, CmsMTDLevelBuilder::theCmsMTDStringToEnum, and CmsMTDStringToEnum::type().

Referenced by CmsMTDETLRingBuilder::buildComponent(), and CmsMTDModuleBuilder::buildComponent().

10  {
11 
12  //
13  // at this level I check whether it is a merged detector or not
14  //
15 
17 
18  const std::string part_name = fv.logicalPart().name().fullname().substr(0,11);
19 
21  bool dodets = fv.firstChild();
22  while (dodets) {
23  buildBTLModule(fv,det,attribute);
24  dodets = fv.nextSibling();
25  }
26  fv.parent();
27  } else if ( theCmsMTDStringToEnum.type(part_name) == GeometricTimingDet::ETLModule ) {
28  bool dodets = fv.firstChild();
29  while (dodets) {
30  buildETLModule(fv,det,attribute);
31  dodets = fv.nextSibling();
32  }
33  fv.parent();
34  } else {
35  throw cms::Exception("MTDConstruction") << "woops got: " << part_name << std::endl;
36  }
37 
38  mother->addComponent(det);
39 }
GeometricTimingDet::GeometricTimingEnumType type(std::string const &) const
bool parent()
set the current node to the parent node ...
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:74
bool nextSibling()
set the current node to the next sibling ...
CmsMTDStringToEnum theCmsMTDStringToEnum
void buildETLModule(DDFilteredView &, GeometricTimingDet *, const std::string &)
void buildBTLModule(DDFilteredView &, GeometricTimingDet *, const std::string &)
void addComponent(GeometricTimingDet *)
const std::string fullname() const
Definition: DDName.h:43
bool firstChild()
set the current node to the first child ...
void CmsMTDConstruction::buildETLModule ( DDFilteredView fv,
GeometricTimingDet mother,
const std::string &  attribute 
)
private

Definition at line 70 of file CmsMTDConstruction.cc.

References GeometricTimingDet::addComponent(), DDFilteredView::copyNumbers(), DDName::fullname(), ExtractStringFromDDD::getString(), GeometricTimingDet::name(), GeometricTimingDet::setGeographicalID(), AlCaHLTBitMon_QueryRunRegistry::string, CmsMTDLevelBuilder::theCmsMTDStringToEnum, GeometricTimingDet::translation(), and CmsMTDStringToEnum::type().

Referenced by buildComponent().

72  {
73 
75 
76  const auto& copyNumbers = fv.copyNumbers();
77  auto module_number = copyNumbers[copyNumbers.size()-2];
78 
79  size_t delim_ring = det->name().fullname().find("EModule");
80  size_t delim_disc = det->name().fullname().find("Disc");
81 
82  std::string ringN = det->name().fullname().substr(delim_ring+7,delim_disc);
83 
84  const uint32_t side = det->translation().z() > 0 ? 1 : 0;
85 
86  // label geographic detid is front or back (even though it is one module per entry here)
87  det->setGeographicalID(ETLDetId(side,atoi(ringN.c_str()),module_number,0));
88 
89  mother->addComponent(det);
90 }
GeometricTimingDet::GeometricTimingEnumType type(std::string const &) const
nav_type copyNumbers() const
return the stack of copy numbers
CmsMTDStringToEnum theCmsMTDStringToEnum
static std::string getString(std::string const &, DDFilteredView *)
DDTranslation const & translation() const
void addComponent(GeometricTimingDet *)
const std::string fullname() const
Definition: DDName.h:43
void setGeographicalID(DetId id)
DDName const & name() const
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15