CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MTDGeomBuilderFromGeometricTimingDet Class Reference

#include <MTDGeomBuilderFromGeometricTimingDet.h>

Public Member Functions

MTDGeometrybuild (const GeometricTimingDet *gd, const PMTDParameters &ptp, const MTDTopology *tTopo)
 

Private Member Functions

void buildGeomDet (MTDGeometry *)
 
void buildPixel (std::vector< const GeometricTimingDet * > const &, MTDGeometry *, GeomDetType::SubDetector det, const PMTDParameters &ptp)
 
PlaneBuilderFromGeometricTimingDet::ResultType buildPlaneWithMaterial (const GeometricTimingDet *gd, double scaleFactor=1.) const
 

Private Attributes

std::map< std::string, const MTDGeomDetType * > theMTDDetTypeMap
 
const MTDTopologytheTopo
 

Detailed Description

Definition at line 16 of file MTDGeomBuilderFromGeometricTimingDet.h.

Member Function Documentation

MTDGeometry * MTDGeomBuilderFromGeometricTimingDet::build ( const GeometricTimingDet gd,
const PMTDParameters ptp,
const MTDTopology tTopo 
)

Definition at line 36 of file MTDGeomBuilderFromGeometricTimingDet.cc.

References GeometricTimingDet::BTL, buildGeomDet(), buildPixel(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricTimingDet::components(), TauDecayModes::dec, GeometricTimingDet::deepComponents(), GeometricTimingDet::ETL, mps_fire::i, LogDebug, LogTrace, MTDDetId::mtdSubDetector(), theMTDDetTypeMap, theTopo, GeomDetEnumerators::TimingBarrel, GeomDetEnumerators::TimingEndcap, PbPb_ZMuSkimMuonDPG_cff::tracker, and GeometricTimingDet::unknown.

Referenced by MTDDigiGeometryESModule::produce().

38  {
39  theMTDDetTypeMap.clear();
40 
41  MTDGeometry* tracker = new MTDGeometry(gd);
42  std::vector<const GeometricTimingDet*> comp;
43  gd->deepComponents(comp);
44 
45  if (tTopo)
46  theTopo = tTopo;
47 
48  //define a vector which associate to the detid subdetector index -1 (from 0 to 5) the GeometridDet enumerator to be able to know which type of subdetector it is
49 
50  std::vector<GeometricTimingDet::GTDEnumType> gdsubdetmap(
51  2, GeometricTimingDet::unknown); // hardcoded "2" should not be a surprise...
53 
54  LogDebug("SubDetectorGeometricTimingDetType")
55  << "GeometricTimingDet enumerator values of the subdetectors" << std::endl;
56  for (unsigned int i = 0; i < subdetgd.size(); ++i) {
57  MTDDetId mtdid(subdetgd[i]->geographicalId());
58  assert(mtdid.mtdSubDetector() > 0 && mtdid.mtdSubDetector() < 3);
59  gdsubdetmap[mtdid.mtdSubDetector() - 1] = subdetgd[i]->type();
60  LogTrace("SubDetectorGeometricTimingDetType")
61  << "subdet " << i << " type " << subdetgd[i]->type() << " detid " << std::hex
62  << subdetgd[i]->geographicalId().rawId() << std::dec << " subdetid " << subdetgd[i]->geographicalId().subdetId()
63  << std::endl;
64  }
65 
66  std::vector<const GeometricTimingDet*> dets[2];
67  std::vector<const GeometricTimingDet*>& btl = dets[0];
68  btl.reserve(comp.size());
69  std::vector<const GeometricTimingDet*>& etl = dets[1];
70  etl.reserve(comp.size());
71 
72  for (auto& i : comp) {
73  MTDDetId mtdid(i->geographicalId());
74  dets[mtdid.mtdSubDetector() - 1].emplace_back(i);
75  }
76 
77  //loop on all the six elements of dets and firstly check if they are from pixel-like detector and call buildPixel, then loop again and check if they are strip and call buildSilicon. "unknown" can be filled either way but the vector of GeometricTimingDet must be empty !!
78  // this order is VERY IMPORTANT!!!!! For the moment I (AndreaV) understand that some pieces of code rely on pixel-like being before strip-like
79 
80  // now building the Pixel-like subdetectors
81  for (unsigned int i = 0; i < 2; ++i) {
82  if (gdsubdetmap[i] == GeometricTimingDet::BTL)
84  if (gdsubdetmap[i] == GeometricTimingDet::ETL)
86  }
87 
88  buildGeomDet(tracker); //"GeomDet"
89 
90  verifyDUinTG(*tracker);
91 
92  return tracker;
93 }
#define LogDebug(id)
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
ConstGeometricTimingDetContainer & components()
ConstGeometricTimingDetContainer deepComponents() const
#define LogTrace(id)
std::map< std::string, const MTDGeomDetType * > theMTDDetTypeMap
std::vector< GeometricTimingDet const * > ConstGeometricTimingDetContainer
void buildPixel(std::vector< const GeometricTimingDet * > const &, MTDGeometry *, GeomDetType::SubDetector det, const PMTDParameters &ptp)
void MTDGeomBuilderFromGeometricTimingDet::buildGeomDet ( MTDGeometry tracker)
private

Definition at line 174 of file MTDGeomBuilderFromGeometricTimingDet.cc.

References MTDGeometry::addDet(), MTDGeometry::addDetId(), MTDGeometry::detUnitIds(), MTDGeometry::detUnits(), and mps_fire::i.

Referenced by build().

174  {
175  auto const& gdu = tracker->detUnits();
176  auto const& gduId = tracker->detUnitIds();
177 
178  for (u_int32_t i = 0; i < gdu.size(); i++) {
179  tracker->addDet(gdu[i]);
180  tracker->addDetId(gduId[i]);
181  string gduTypeName = gdu[i]->type().name();
182  }
183 }
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: MTDGeometry.h:27
void addDetId(DetId p)
Definition: MTDGeometry.cc:146
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: MTDGeometry.h:29
void addDet(GeomDet const *p)
Definition: MTDGeometry.cc:128
void MTDGeomBuilderFromGeometricTimingDet::buildPixel ( std::vector< const GeometricTimingDet * > const &  gdv,
MTDGeometry tracker,
GeomDetType::SubDetector  det,
const PMTDParameters ptp 
)
private

Definition at line 95 of file MTDGeomBuilderFromGeometricTimingDet.cc.

References MTDGeometry::addDetUnit(), MTDGeometry::addDetUnitId(), MTDGeometry::addType(), MTDTopologyBuilder::build(), buildPlaneWithMaterial(), Exception, mps_fire::i, LogDebug, MTDGeometry::setEndsetDU(), MTDGeometry::setOffsetDU(), AlCaHLTBitMon_QueryRunRegistry::string, GeomDetEnumerators::subDetGeom, OrderedSet::t, groupFilesInBlocks::temp, theMTDDetTypeMap, GeomDetEnumerators::TimingBarrel, GeomDetEnumerators::TimingEndcap, and PMTDParameters::vitems_.

Referenced by build().

100 {
101  LogDebug("BuildingGeomDetUnits") << " Pixel type. Size of vector: " << gdv.size()
102  << " GeomDetType subdetector: " << det
103  << " logical subdetector: " << GeomDetEnumerators::subDetGeom[det]
104  << " big pix per ROC x: " << 0 << " y: " << 0 << " is upgrade: " << true
105  << std::endl;
106 
107  // this is a hack while we put things into the DDD
108  int ROCrows(0), ROCcols(0), ROCSx(0), ROCSy(0);
109  switch (det) {
111  ROCrows = ptp.vitems_[0].vpars_[8];
112  ROCcols = ptp.vitems_[0].vpars_[9];
113  ROCSx = ptp.vitems_[0].vpars_[10];
114  ROCSy = ptp.vitems_[0].vpars_[11];
115  break;
117  ROCrows = ptp.vitems_[1].vpars_[8];
118  ROCcols = ptp.vitems_[1].vpars_[9];
119  ROCSx = ptp.vitems_[1].vpars_[10];
120  ROCSy = ptp.vitems_[1].vpars_[11];
121  break;
122  break;
123  default:
124  throw cms::Exception("UnknownDet") << "MTDGeomBuilderFromGeometricTimingDet got a weird detector: " << det;
125  }
126 
127  switch (det) {
129  tracker->setOffsetDU(0);
130  break;
132  tracker->setOffsetDU(1);
133  break;
134  default:
135  throw cms::Exception("MTDGeomBuilderFromGeometricTimingDet") << det << " is not a timing detector!";
136  }
137 
138  for (auto i : gdv) {
139  std::string const& detName = i->name();
140  if (theMTDDetTypeMap.find(detName) == theMTDDetTypeMap.end()) {
141  std::unique_ptr<const Bounds> bounds(i->bounds());
142 
143  PixelTopology* t = MTDTopologyBuilder().build(&*bounds,
144  true,
145  ROCrows,
146  ROCcols,
147  0,
148  0, // these are BIG_PIX_XXXXX
149  ROCSx,
150  ROCSy);
151 
152  theMTDDetTypeMap[detName] = new MTDGeomDetType(t, detName, det);
153  tracker->addType(theMTDDetTypeMap[detName]);
154  }
155 
157  GeomDetUnit* temp = new MTDGeomDetUnit(&(*plane), theMTDDetTypeMap[detName], i->geographicalID());
158 
159  tracker->addDetUnit(temp);
160  tracker->addDetUnitId(i->geographicalID());
161  }
162  switch (det) {
164  tracker->setEndsetDU(0);
165  break;
167  tracker->setEndsetDU(1);
168  break;
169  default:
170  throw cms::Exception("MTDGeomBuilderFromGeometricTimingDet") << det << " is not a timing detector!";
171  }
172 }
#define LogDebug(id)
void setEndsetDU(unsigned sid)
Definition: MTDGeometry.h:42
std::vector< Item > vitems_
void addType(GeomDetType const *p)
Definition: MTDGeometry.cc:115
PlaneBuilderFromGeometricTimingDet::ResultType buildPlaneWithMaterial(const GeometricTimingDet *gd, double scaleFactor=1.) const
SubDetector subDetGeom[21]
PixelTopology * build(const Bounds *bounds, bool upgradeGeometry, int ROWS_PER_ROC, int COLS_PER_ROC, int BIG_PIX_PER_ROC_X, int BIG_PIX_PER_ROC_Y, int ROCS_X, int ROCS_Y)
std::map< std::string, const MTDGeomDetType * > theMTDDetTypeMap
void addDetUnitId(DetId p)
Definition: MTDGeometry.cc:126
void setOffsetDU(unsigned sid)
Definition: MTDGeometry.h:41
void addDetUnit(GeomDet const *p)
Definition: MTDGeometry.cc:119
PlaneBuilderFromGeometricTimingDet::ResultType MTDGeomBuilderFromGeometricTimingDet::buildPlaneWithMaterial ( const GeometricTimingDet gd,
double  scaleFactor = 1. 
) const
private

Definition at line 185 of file MTDGeomBuilderFromGeometricTimingDet.cc.

References PlaneBuilderFromGeometricTimingDet::plane(), GeometricTimingDet::radLength(), Scenarios_cff::scale, and GeometricTimingDet::xi().

Referenced by buildPixel().

186  {
188  PlaneBuilderFromGeometricTimingDet::ResultType plane = planeBuilder.plane(gd);
189  //
190  // set medium properties (if defined)
191  //
192  plane->setMediumProperties(MediumProperties(gd->radLength() * scale, gd->xi() * scale));
193 
194  return plane;
195 }
double radLength() const
ResultType plane(const GeometricTimingDet *gd) const

Member Data Documentation

std::map<std::string, const MTDGeomDetType*> MTDGeomBuilderFromGeometricTimingDet::theMTDDetTypeMap
private

Definition at line 30 of file MTDGeomBuilderFromGeometricTimingDet.h.

Referenced by build(), and buildPixel().

const MTDTopology* MTDGeomBuilderFromGeometricTimingDet::theTopo
private

Definition at line 31 of file MTDGeomBuilderFromGeometricTimingDet.h.

Referenced by build().