CMS 3D CMS Logo

Functions
DDDCmsTrackerContruction Namespace Reference

Functions

std::unique_ptr< GeometricDetconstruct (cms::DDCompactView const &cpv, std::vector< int > const &detidShifts)
 
std::unique_ptr< GeometricDetconstruct (DDCompactView const &cpv, std::vector< int > const &detidShifts)
 
void printAllTrackerGeometricDets (const GeometricDet *tracker)
 

Detailed Description

High level class to build a tracker. It will only build subdets, then call subdet builders

Function Documentation

◆ construct() [1/2]

std::unique_ptr< GeometricDet > DDDCmsTrackerContruction::construct ( cms::DDCompactView const &  cpv,
std::vector< int > const &  detidShifts 
)

Definition at line 62 of file DDDCmsTrackerContruction.cc.

63  {
64  std::string attribute("TkDDDStructure");
65  cms::DDFilteredView fv(cpv, cms::DDFilter(attribute));
66  fv.firstChild();
67 
68  CmsTrackerStringToEnum theCmsTrackerStringToEnum;
69  if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD<cms::DDFilteredView>::getString("TkDDDStructure", &fv)) !=
71  fv.firstChild();
72  if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD<cms::DDFilteredView>::getString(attribute, &fv)) !=
74  throw cms::Exception("Configuration")
75  << " The first child of the DDFilteredView is not what is expected \n"
77  }
78  }
79 
80  auto tracker = std::make_unique<GeometricDet>(&fv, GeometricDet::Tracker);
81 
82  edm::LogVerbatim("DDDCmsTrackerContruction") << "DDDCmsTrackerContruction::construct: Call Tracker builder.";
83  CmsTrackerBuilder<cms::DDFilteredView> theCmsTrackerBuilder;
84  theCmsTrackerBuilder.build(fv, tracker.get(), attribute);
85 
86  edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds";
87  CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts);
88  theCmsTrackerDetIdBuilder.buildId(*tracker);
89 
90  if (DEBUG) {
92  }
93 
94  return tracker;
95 }

References CmsTrackerLevelBuilder< FilteredView >::build(), CmsTrackerDetIdBuilder::buildId(), DEBUG, Exception, cms::DDFilteredView::firstChild(), ExtractStringFromDDD< FilteredView >::getString(), printAllTrackerGeometricDets(), AlCaHLTBitMon_QueryRunRegistry::string, GeometricDet::Tracker, PbPb_ZMuSkimMuonDPG_cff::tracker, and CmsTrackerStringToEnum::type().

◆ construct() [2/2]

std::unique_ptr< GeometricDet > DDDCmsTrackerContruction::construct ( DDCompactView const &  cpv,
std::vector< int > const &  detidShifts 
)

Definition at line 18 of file DDDCmsTrackerContruction.cc.

19  {
20  std::string attribute = "TkDDDStructure";
22 
23  DDFilteredView fv(cpv, filter);
24 
25  CmsTrackerStringToEnum theCmsTrackerStringToEnum;
26  if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD<DDFilteredView>::getString(attribute, &fv)) !=
28  fv.firstChild();
29  if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD<DDFilteredView>::getString(attribute, &fv)) !=
31  throw cms::Exception("Configuration") << " The first child of the DDFilteredView is not what is expected \n"
32  << ExtractStringFromDDD<DDFilteredView>::getString(attribute, &fv) << "\n";
33  }
34  }
35 
36  auto tracker = std::make_unique<GeometricDet>(&fv, GeometricDet::Tracker);
37 
38  edm::LogVerbatim("DDDCmsTrackerContruction") << "DDDCmsTrackerContruction::construct: Call Tracker builder.";
39  CmsTrackerBuilder<DDFilteredView> theCmsTrackerBuilder;
40  theCmsTrackerBuilder.build(fv, tracker.get(), attribute);
41 
42  edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds";
43  CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts);
44  theCmsTrackerDetIdBuilder.buildId(*tracker);
45 
46  if (DEBUG) {
48  }
49 
50  fv.parent();
51  //
52  // set the Tracker
53  //
54  //TrackerMapDDDtoID::instance().setTracker(tracker);
55  //NOTE: If it is decided that the TrackerMapDDDtoID should be
56  // constructed here, then we should return from this
57  // function so that the EventSetup can manage it
58 
59  return tracker;
60 }

References CmsTrackerLevelBuilder< FilteredView >::build(), CmsTrackerDetIdBuilder::buildId(), DEBUG, Exception, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), ExtractStringFromDDD< FilteredView >::getString(), DDFilteredView::parent(), printAllTrackerGeometricDets(), AlCaHLTBitMon_QueryRunRegistry::string, GeometricDet::Tracker, PbPb_ZMuSkimMuonDPG_cff::tracker, and CmsTrackerStringToEnum::type().

Referenced by TrackerGeometricDetESModule::produce().

◆ printAllTrackerGeometricDets()

void DDDCmsTrackerContruction::printAllTrackerGeometricDets ( const GeometricDet tracker)

Definition at line 103 of file DDDCmsTrackerContruction.cc.

103  {
104  std::ofstream outputFile("All_Tracker_GeometricDets_before_DetId_building.log", std::ios::out);
105 
106  // Tree navigation: queue for BFS (we want to see same hierarchy level together).
107  // (for DFS, would just use a stack instead).
108  std::deque<const GeometricDet*> queue;
109  queue.emplace_back(tracker);
110 
111  while (!queue.empty()) {
112  const GeometricDet* myDet = queue.front();
113  queue.pop_front();
114 
115  for (auto& child : myDet->components()) {
116  queue.emplace_back(child);
117  }
118 
119  outputFile << " " << std::endl;
120  outputFile << " " << std::endl;
121  outputFile << "............................." << std::endl;
122  outputFile << "myDet->geographicalID() = " << myDet->geographicalId() << std::endl;
123  outputFile << "myDet->name() = " << myDet->name() << std::endl;
124  outputFile << "myDet->module->type() = " << std::fixed << std::setprecision(7) << myDet->type() << std::endl;
125  outputFile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation()
126  << std::endl;
127  outputFile << "myDet->module->rho() = " << std::fixed << std::setprecision(7) << myDet->rho() << std::endl;
128  if (fabs(myDet->rho()) > 0.00001) {
129  outputFile << "myDet->module->phi() = " << std::fixed << std::setprecision(7) << myDet->phi() << std::endl;
130  }
131  outputFile << "myDet->module->rotation() = " << std::fixed << std::setprecision(7) << myDet->rotation()
132  << std::endl;
133  outputFile << "myDet->module->shape() = " << std::fixed << std::setprecision(7) << myDet->shape() << std::endl;
136  outputFile << "myDet->params() = " << std::fixed << std::setprecision(7);
137  for (const auto& para : myDet->params()) {
138  outputFile << para << " ";
139  }
140  outputFile << " " << std::endl;
141  }
142  outputFile << "myDet->radLength() = " << myDet->radLength() << std::endl;
143  outputFile << "myDet->xi() = " << myDet->xi() << std::endl;
144  outputFile << "myDet->pixROCRows() = " << myDet->pixROCRows() << std::endl;
145  outputFile << "myDet->pixROCCols() = " << myDet->pixROCCols() << std::endl;
146  outputFile << "myDet->pixROCx() = " << myDet->pixROCx() << std::endl;
147  outputFile << "myDet->pixROCy() = " << myDet->pixROCy() << std::endl;
148  outputFile << "myDet->stereo() = " << myDet->stereo() << std::endl;
149  outputFile << "myDet->isLowerSensor() = " << myDet->isLowerSensor() << std::endl;
150  outputFile << "myDet->isUpperSensor() = " << myDet->isUpperSensor() << std::endl;
151  outputFile << "myDet->siliconAPVNum() = " << myDet->siliconAPVNum() << std::endl;
152  }
153 }

References GeometricDet::components(), cms::ddbox, cms::ddtrap, cms::ddtubs, alignBH_cfg::fixed, GeometricDet::geographicalId(), GeometricDet::isLowerSensor(), GeometricDet::isUpperSensor(), GeometricDet::name(), MillePedeFileConverter_cfg::out, download_sqlite_cfg::outputFile, GeometricDet::params(), GeometricDet::phi(), GeometricDet::pixROCCols(), GeometricDet::pixROCRows(), GeometricDet::pixROCx(), GeometricDet::pixROCy(), createBeamHaloJobs::queue, GeometricDet::radLength(), GeometricDet::rho(), GeometricDet::rotation(), GeometricDet::shape(), GeometricDet::shape_dd4hep(), GeometricDet::siliconAPVNum(), GeometricDet::stereo(), PbPb_ZMuSkimMuonDPG_cff::tracker, GeometricDet::translation(), GeometricDet::type(), and GeometricDet::xi().

Referenced by construct().

GeometricDet::phi
double phi() const
Definition: GeometricDet.h:102
ExtractStringFromDDD::getString
static std::string getString(const std::string &, FilteredView *)
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
CmsTrackerStringToEnum::type
GeometricDet::GeometricEnumType type(std::string const &) const
Definition: CmsTrackerStringToEnum.cc:122
GeometricDet::isLowerSensor
bool isLowerSensor() const
Definition: GeometricDet.h:138
cms::DDSolidShape::ddtubs
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:150
DEBUG
#define DEBUG
Definition: DDDCmsTrackerContruction.cc:16
CmsTrackerBuilder
Definition: CmsTrackerBuilder.h:14
CmsTrackerStringToEnum
Definition: CmsTrackerStringToEnum.h:10
GeometricDet::translation
const Translation & translation() const
Definition: GeometricDet.h:100
cms::DDFilteredView
Definition: DDFilteredView.h:70
ExtractStringFromDDD
Definition: ExtractStringFromDDD.h:12
GeometricDet::shape
LegacySolidShape shape() const
Definition: GeometricDet.h:112
GeometricDet::Tracker
Definition: GeometricDet.h:50
download_sqlite_cfg.outputFile
outputFile
Definition: download_sqlite_cfg.py:5
GeometricDet::name
const std::string & name() const
Definition: GeometricDet.h:90
cms::DDFilter
Definition: DDFilteredView.h:59
GeometricDet::params
const std::vector< double > & params() const
Definition: GeometricDet.h:116
GeometricDet::shape_dd4hep
const cms::DDSolidShape & shape_dd4hep() const
Definition: GeometricDet.h:114
GeometricDet::rotation
const RotationMatrix & rotation() const
Definition: GeometricDet.h:103
GeometricDet
Definition: GeometricDet.h:31
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
DDDCmsTrackerContruction::printAllTrackerGeometricDets
void printAllTrackerGeometricDets(const GeometricDet *tracker)
Definition: DDDCmsTrackerContruction.cc:103
GeometricDet::radLength
double radLength() const
Definition: GeometricDet.h:126
createBeamHaloJobs.queue
queue
Definition: createBeamHaloJobs.py:343
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
GeometricDet::stereo
bool stereo() const
Definition: GeometricDet.h:137
GeometricDet::geographicalId
const DetId & geographicalId() const
Definition: GeometricDet.h:96
CmsTrackerLevelBuilder::build
void build(FilteredView &, GeometricDet *, const std::string &) override
GeometricDet::pixROCRows
double pixROCRows() const
Definition: GeometricDet.h:132
cms::DDSolidShape::ddtrap
cms::DDSolidShape::ddbox
DDSpecificsHasNamedValueFilter
Definition: DDFilter.h:60
GeometricDet::pixROCx
double pixROCx() const
Definition: GeometricDet.h:134
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GeometricDet::rho
double rho() const
Definition: GeometricDet.h:101
CmsTrackerDetIdBuilder
Definition: CmsTrackerDetIdBuilder.h:15
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:245
GeometricDet::siliconAPVNum
double siliconAPVNum() const
Definition: GeometricDet.h:140
GeometricDet::pixROCCols
double pixROCCols() const
Definition: GeometricDet.h:133
GeometricDet::xi
double xi() const
Definition: GeometricDet.h:127
GeometricDet::pixROCy
double pixROCy() const
Definition: GeometricDet.h:135
DDFilteredView
Definition: DDFilteredView.h:20
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
GeometricDet::type
const GeometricEnumType & type() const
Definition: GeometricDet.h:91
child
Definition: simpleInheritance.h:11
GeometricDet::isUpperSensor
bool isUpperSensor() const
Definition: GeometricDet.h:139