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

◆ build()

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

Definition at line 36 of file MTDGeomBuilderFromGeometricTimingDet.cc.

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") << "MTD GeometricTimingDet enumerator values of the subdetectors";
55  for (unsigned int i = 0; i < subdetgd.size(); ++i) {
56  MTDDetId mtdid(subdetgd[i]->geographicalId());
57  assert(mtdid.mtdSubDetector() > 0 && mtdid.mtdSubDetector() < 3);
58  gdsubdetmap[mtdid.mtdSubDetector() - 1] = subdetgd[i]->type();
59  LogTrace("SubDetectorGeometricTimingDetType") << "MTD subdet " << i << " type " << subdetgd[i]->type() << " detid "
60  << std::hex << subdetgd[i]->geographicalId().rawId() << std::dec
61  << " subdetid " << subdetgd[i]->geographicalId().subdetId();
62  }
63 
64  std::vector<const GeometricTimingDet*> dets[2];
65  std::vector<const GeometricTimingDet*>& btl = dets[0];
66  btl.reserve(comp.size());
67  std::vector<const GeometricTimingDet*>& etl = dets[1];
68  etl.reserve(comp.size());
69 
70  for (auto& i : comp) {
71  MTDDetId mtdid(i->geographicalId());
72  dets[mtdid.mtdSubDetector() - 1].emplace_back(i);
73  }
74 
75  //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 !!
76  // this order is VERY IMPORTANT!!!!! For the moment I (AndreaV) understand that some pieces of code rely on pixel-like being before strip-like
77 
78  // now building the Pixel-like subdetectors
79  for (unsigned int i = 0; i < 2; ++i) {
80  if (gdsubdetmap[i] == GeometricTimingDet::BTL)
82  if (gdsubdetmap[i] == GeometricTimingDet::ETL)
84  }
85 
86  buildGeomDet(tracker); //"GeomDet"
87 
88  verifyDUinTG(*tracker);
89 
90  return tracker;
91 }

References cms::cuda::assert(), 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().

◆ buildGeomDet()

void MTDGeomBuilderFromGeometricTimingDet::buildGeomDet ( MTDGeometry tracker)
private

Definition at line 171 of file MTDGeomBuilderFromGeometricTimingDet.cc.

171  {
172  auto const& gdu = tracker->detUnits();
173  auto const& gduId = tracker->detUnitIds();
174 
175  for (u_int32_t i = 0; i < gdu.size(); i++) {
176  tracker->addDet(gdu[i]);
177  tracker->addDetId(gduId[i]);
178  string gduTypeName = gdu[i]->type().name();
179  }
180 }

References mps_fire::i, and PbPb_ZMuSkimMuonDPG_cff::tracker.

Referenced by build().

◆ buildPixel()

void MTDGeomBuilderFromGeometricTimingDet::buildPixel ( std::vector< const GeometricTimingDet * > const &  gdv,
MTDGeometry tracker,
GeomDetType::SubDetector  det,
const PMTDParameters ptp 
)
private

Definition at line 93 of file MTDGeomBuilderFromGeometricTimingDet.cc.

98 {
99  LogDebug("BuildingGeomDetUnits") << " MTD Pixel type. Size of vector: " << gdv.size()
100  << " GeomDetType subdetector: " << det
101  << " logical subdetector: " << GeomDetEnumerators::subDetGeom[det]
102  << " big pix per ROC x: " << 0 << " y: " << 0 << " is upgrade: " << true;
103 
104  // this is a hack while we put things into the DDD
105  int ROCrows(0), ROCcols(0), ROCSx(0), ROCSy(0);
106  switch (det) {
108  ROCrows = ptp.vitems_[0].vpars_[8];
109  ROCcols = ptp.vitems_[0].vpars_[9];
110  ROCSx = ptp.vitems_[0].vpars_[10];
111  ROCSy = ptp.vitems_[0].vpars_[11];
112  break;
114  ROCrows = ptp.vitems_[1].vpars_[8];
115  ROCcols = ptp.vitems_[1].vpars_[9];
116  ROCSx = ptp.vitems_[1].vpars_[10];
117  ROCSy = ptp.vitems_[1].vpars_[11];
118  break;
119  break;
120  default:
121  throw cms::Exception("UnknownDet") << "MTDGeomBuilderFromGeometricTimingDet got a weird detector: " << det;
122  }
123 
124  switch (det) {
126  tracker->setOffsetDU(0);
127  break;
129  tracker->setOffsetDU(1);
130  break;
131  default:
132  throw cms::Exception("MTDGeomBuilderFromGeometricTimingDet") << det << " is not a timing detector!";
133  }
134 
135  for (auto i : gdv) {
136  std::string const& detName = i->name();
137  if (theMTDDetTypeMap.find(detName) == theMTDDetTypeMap.end()) {
138  std::unique_ptr<const Bounds> bounds(i->bounds());
139 
140  PixelTopology* t = MTDTopologyBuilder().build(&*bounds,
141  true,
142  ROCrows,
143  ROCcols,
144  0,
145  0, // these are BIG_PIX_XXXXX
146  ROCSx,
147  ROCSy);
148 
149  theMTDDetTypeMap[detName] = new MTDGeomDetType(t, detName, det);
150  tracker->addType(theMTDDetTypeMap[detName]);
151  }
152 
154  GeomDetUnit* temp = new MTDGeomDetUnit(&(*plane), theMTDDetTypeMap[detName], i->geographicalID());
155 
156  tracker->addDetUnit(temp);
157  tracker->addDetUnitId(i->geographicalID());
158  }
159  switch (det) {
161  tracker->setEndsetDU(0);
162  break;
164  tracker->setEndsetDU(1);
165  break;
166  default:
167  throw cms::Exception("MTDGeomBuilderFromGeometricTimingDet") << det << " is not a timing detector!";
168  }
169 }

References MTDTopologyBuilder::build(), buildPlaneWithMaterial(), Exception, mps_fire::i, LogDebug, AlCaHLTBitMon_QueryRunRegistry::string, GeomDetEnumerators::subDetGeom, OrderedSet::t, groupFilesInBlocks::temp, theMTDDetTypeMap, GeomDetEnumerators::TimingBarrel, GeomDetEnumerators::TimingEndcap, PbPb_ZMuSkimMuonDPG_cff::tracker, and PMTDParameters::vitems_.

Referenced by build().

◆ buildPlaneWithMaterial()

PlaneBuilderFromGeometricTimingDet::ResultType MTDGeomBuilderFromGeometricTimingDet::buildPlaneWithMaterial ( const GeometricTimingDet gd,
double  scaleFactor = 1. 
) const
private

Definition at line 182 of file MTDGeomBuilderFromGeometricTimingDet.cc.

183  {
185  PlaneBuilderFromGeometricTimingDet::ResultType plane = planeBuilder.plane(gd);
186  //
187  // set medium properties (if defined)
188  //
189  plane->setMediumProperties(MediumProperties(gd->radLength() * scale, gd->xi() * scale));
190 
191  return plane;
192 }

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

Referenced by buildPixel().

Member Data Documentation

◆ theMTDDetTypeMap

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

Definition at line 30 of file MTDGeomBuilderFromGeometricTimingDet.h.

Referenced by build(), and buildPixel().

◆ theTopo

const MTDTopology* MTDGeomBuilderFromGeometricTimingDet::theTopo
private

Definition at line 31 of file MTDGeomBuilderFromGeometricTimingDet.h.

Referenced by build().

MTDGeomBuilderFromGeometricTimingDet::theMTDDetTypeMap
std::map< std::string, const MTDGeomDetType * > theMTDDetTypeMap
Definition: MTDGeomBuilderFromGeometricTimingDet.h:30
mps_fire.i
i
Definition: mps_fire.py:355
GeomDet
Definition: GeomDet.h:27
PMTDParameters::vitems_
std::vector< Item > vitems_
Definition: PMTDParameters.h:18
MTDGeomBuilderFromGeometricTimingDet::buildPlaneWithMaterial
PlaneBuilderFromGeometricTimingDet::ResultType buildPlaneWithMaterial(const GeometricTimingDet *gd, double scaleFactor=1.) const
Definition: MTDGeomBuilderFromGeometricTimingDet.cc:182
cms::cuda::assert
assert(be >=bs)
GeometricTimingDet::ConstGeometricTimingDetContainer
std::vector< GeometricTimingDet const * > ConstGeometricTimingDetContainer
Definition: GeometricTimingDet.h:31
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
PlaneBuilderFromGeometricTimingDet
Definition: PlaneBuilderFromGeometricTimingDet.h:11
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
MTDGeomBuilderFromGeometricTimingDet::theTopo
const MTDTopology * theTopo
Definition: MTDGeomBuilderFromGeometricTimingDet.h:31
MTDGeomDetType
Definition: MTDGeomDetType.h:11
MTDTopologyBuilder::build
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)
Definition: MTDTopologyBuilder.cc:8
GeomDetEnumerators::TimingBarrel
Definition: GeomDetEnumerators.h:29
MTDGeomBuilderFromGeometricTimingDet::buildGeomDet
void buildGeomDet(MTDGeometry *)
Definition: MTDGeomBuilderFromGeometricTimingDet.cc:171
GeometricTimingDet::radLength
double radLength() const
Definition: GeometricTimingDet.h:151
OrderedSet.t
t
Definition: OrderedSet.py:90
PixelTopology
Definition: PixelTopology.h:10
MTDGeomBuilderFromGeometricTimingDet::buildPixel
void buildPixel(std::vector< const GeometricTimingDet * > const &, MTDGeometry *, GeomDetType::SubDetector det, const PMTDParameters &ptp)
Definition: MTDGeomBuilderFromGeometricTimingDet.cc:93
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
GeometricTimingDet::ETL
Definition: GeometricTimingDet.h:59
Scenarios_cff.scale
scale
Definition: Scenarios_cff.py:2186
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
GeometricTimingDet::components
ConstGeometricTimingDetContainer & components()
Definition: GeometricTimingDet.h:120
PlaneBuilderFromGeometricTimingDet::plane
ResultType plane(const GeometricTimingDet *gd) const
Definition: PlaneBuilderFromGeometricTimingDet.cc:23
GeomDetEnumerators::TimingEndcap
Definition: GeomDetEnumerators.h:30
MTDGeomDetUnit
Definition: MTDGeomDetUnit.h:15
MTDGeometry
Definition: MTDGeometry.h:14
MediumProperties
Definition: MediumProperties.h:12
GeomDetEnumerators::subDetGeom
constexpr SubDetector subDetGeom[21]
Definition: GeomDetEnumerators.h:40
MTDDetId
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
Exception
Definition: hltDiff.cc:246
GeometricTimingDet::BTL
Definition: GeometricTimingDet.h:53
GeometricTimingDet::deepComponents
ConstGeometricTimingDetContainer deepComponents() const
Definition: GeometricTimingDet.cc:197
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
GeometricTimingDet::xi
double xi() const
Definition: GeometricTimingDet.h:152
MTDTopologyBuilder
Definition: MTDTopologyBuilder.h:12
GeometricTimingDet::unknown
Definition: GeometricTimingDet.h:51