48 std::pair<float, float> pitch = topo->
pitch();
49 fwRecoGeometry.
idToName[rawid].topology[0] = pitch.first;
50 fwRecoGeometry.
idToName[rawid].topology[1] = pitch.second;
63 #define ADD_SISTRIP_TOPOLOGY(rawid, detUnit) \ 64 const StripGeomDetUnit* det = dynamic_cast<const StripGeomDetUnit*>(detUnit); \ 66 if (const StripTopology* topo = dynamic_cast<const StripTopology*>(&det->specificTopology())) { \ 67 fwRecoGeometry.idToName[rawid].topology[0] = 0; \ 68 fwRecoGeometry.idToName[rawid].topology[1] = topo->nstrips(); \ 69 fwRecoGeometry.idToName[rawid].topology[2] = topo->stripLength(); \ 71 if (const RadialStripTopology* rtop = \ 72 dynamic_cast<const RadialStripTopology*>(&(det->specificType().specificTopology()))) { \ 73 fwRecoGeometry.idToName[rawid].topology[0] = 1; \ 74 fwRecoGeometry.idToName[rawid].topology[3] = rtop->yAxisOrientation(); \ 75 fwRecoGeometry.idToName[rawid].topology[4] = rtop->originToIntersection(); \ 76 fwRecoGeometry.idToName[rawid].topology[5] = rtop->phiOfOneEdge(); \ 77 fwRecoGeometry.idToName[rawid].topology[6] = rtop->angularWidth(); \ 78 } else if (const RectangularStripTopology* topo = \ 79 dynamic_cast<const RectangularStripTopology*>(&(det->specificType().specificTopology()))) { \ 80 fwRecoGeometry.idToName[rawid].topology[0] = 2; \ 81 fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \ 82 } else if (const TrapezoidalStripTopology* topo = \ 83 dynamic_cast<const TrapezoidalStripTopology*>(&(det->specificType().specificTopology()))) { \ 84 fwRecoGeometry.idToName[rawid].topology[0] = 3; \ 85 fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \ 88 const Phase2TrackerGeomDetUnit* det = dynamic_cast<const Phase2TrackerGeomDetUnit*>(detUnit); \ 90 if (const Phase2TrackerTopology* topo = \ 91 dynamic_cast<const Phase2TrackerTopology*>(&(det->specificTopology()))) { \ 92 fwRecoGeometry.idToName[rawid].topology[0] = topo->pitch().first; \ 93 fwRecoGeometry.idToName[rawid].topology[1] = topo->pitch().second; \ 99 const std::array<std::string, 3> hgcal_geom_names = {
100 {
"HGCalEESensitive",
"HGCalHESiliconSensitive",
"HGCalHEScintillatorSensitive"}};
104 m_tracker =
pset.getUntrackedParameter<
bool>(
"Tracker",
true);
105 m_muon =
pset.getUntrackedParameter<
bool>(
"Muon",
true);
106 m_gem =
pset.getUntrackedParameter<
bool>(
"GEM",
false);
107 m_calo =
pset.getUntrackedParameter<
bool>(
"Calo",
true);
108 m_timing =
pset.getUntrackedParameter<
bool>(
"Timing",
false);
126 auto fwRecoGeometry = std::make_unique<FWRecoGeometry>();
157 fwRecoGeometry->idToName.resize(
m_current + 1);
158 std::vector<FWRecoGeom::Info>(fwRecoGeometry->idToName).
swap(fwRecoGeometry->idToName);
159 std::sort(fwRecoGeometry->idToName.begin(), fwRecoGeometry->idToName.end());
161 return fwRecoGeometry;
171 unsigned int rawid =
chamber->geographicalId();
172 unsigned int current =
insert_id(rawid, fwRecoGeometry);
177 for (std::vector<const CSCLayer*>::const_iterator lit =
chamber->layers().begin(), lend =
chamber->layers().end();
183 unsigned int rawid =
layer->geographicalId();
184 unsigned int current =
insert_id(rawid, fwRecoGeometry);
215 unsigned int rawid =
chamber->geographicalId().rawId();
216 unsigned int current =
insert_id(rawid, fwRecoGeometry);
222 for (
auto it = dtGeometry->
layers().begin(),
end = dtGeometry->
layers().end(); it !=
end; ++it) {
226 unsigned int rawid =
layer->id().rawId();
227 unsigned int current =
insert_id(rawid, fwRecoGeometry);
241 fwRecoGeometry.
idToName[current].topology[6] = surf.bounds().width();
242 fwRecoGeometry.
idToName[current].topology[7] = surf.bounds().thickness();
243 fwRecoGeometry.
idToName[current].topology[8] = surf.bounds().length();
254 for (
auto it = rpcGeom->
rolls().begin(),
end = rpcGeom->
rolls().end(); it !=
end; ++it) {
258 unsigned int current =
insert_id(rawid, fwRecoGeometry);
271 fwRecoGeometry.
extraDet.Add(
new TNamed(
"RE4",
"RPC endcap station 4"));
272 }
catch (std::runtime_error&
e) {
289 unsigned int rawid = sc->geographicalId().rawId();
290 unsigned int current =
insert_id(rawid, fwRecoGeometry);
295 for (
auto ch : gemGeom->
chambers()) {
297 unsigned int rawid = ch->geographicalId().rawId();
298 unsigned int current =
insert_id(rawid, fwRecoGeometry);
305 unsigned int rawid = roll->geographicalId().rawId();
306 unsigned int current =
insert_id(rawid, fwRecoGeometry);
317 fwRecoGeometry.
idToName[current].topology[3] = roll->localPitch(lTop);
318 fwRecoGeometry.
idToName[current].topology[4] = roll->localPitch(lBottom);
319 fwRecoGeometry.
idToName[current].topology[5] = roll->npads();
323 fwRecoGeometry.
extraDet.Add(
new TNamed(
"GEM",
"GEM muon detector"));
327 fwRecoGeometry.
extraDet.Add(
new TNamed(
"GE2",
"GEM endcap station 2"));
328 }
catch (std::runtime_error&
e) {
347 unsigned int rawid = roll->geographicalId().rawId();
348 unsigned int current =
insert_id(rawid, fwRecoGeometry);
359 fwRecoGeometry.
idToName[current].topology[3] = roll->localPitch(lTop);
360 fwRecoGeometry.
idToName[current].topology[4] = roll->localPitch(lBottom);
361 fwRecoGeometry.
idToName[current].topology[5] = roll->npads();
364 fwRecoGeometry.
extraDet.Add(
new TNamed(
"ME0",
"ME0 muon detector"));
379 unsigned int rawid = detid.
rawId();
380 unsigned int current =
insert_id(rawid, fwRecoGeometry);
397 unsigned int rawid = detid.
rawId();
398 unsigned int current =
insert_id(rawid, fwRecoGeometry);
415 unsigned int rawid = detid.
rawId();
416 unsigned int current =
insert_id(rawid, fwRecoGeometry);
433 unsigned int rawid = detid.
rawId();
434 unsigned int current =
insert_id(rawid, fwRecoGeometry);
451 unsigned int rawid = detid.
rawId();
452 unsigned int current =
insert_id(rawid, fwRecoGeometry);
469 unsigned int rawid = detid.
rawId();
470 unsigned int current =
insert_id(rawid, fwRecoGeometry);
480 std::set<DetId>
cache;
481 for (std::vector<DetId>::const_iterator it =
vid.begin(),
end =
vid.end(); it !=
end; ++it) {
482 unsigned int id =
insert_id(it->rawId(), fwRecoGeometry);
494 const auto cor =
geom->getNewCorners(*it);
502 for (
uint i = 0;
i < (cor.size() - 1); ++
i) {
503 fwRecoGeometry.
idToName[
id].points[
i * 3 + 0] = cor[
i].x();
504 fwRecoGeometry.
idToName[
id].points[
i * 3 + 1] = cor[
i].y();
505 fwRecoGeometry.
idToName[
id].points[
i * 3 + 2] = cor[
i].z();
509 auto center =
geom->getPosition(*it);
510 fwRecoGeometry.
idToName[
id].points[(cor.size() - 1) * 3 + 0] = center.x();
511 fwRecoGeometry.
idToName[
id].points[(cor.size() - 1) * 3 + 1] = center.y();
512 fwRecoGeometry.
idToName[
id].points[(cor.size() - 1) * 3 + 2] = center.z();
518 fwRecoGeometry.
idToName[
id].shape[3] = cor[cor.size() - 1].z();
521 fwRecoGeometry.
idToName[
id].topology[0] = cor.size() - 1;
554 auto val_x = (cor[0].x() - cor[3].x());
555 auto val_y = (cor[0].y() - cor[3].y());
556 auto val = round(std::acos(val_y /
std::sqrt(val_x * val_x + val_y * val_y)) /
M_PI * 180.);
576 auto [iter, is_new] =
cache.insert(wafer_detid);
578 unsigned int local_id =
insert_id(wafer_detid, fwRecoGeometry);
579 auto const& dddConstants =
geom->topology().dddConstants();
580 auto wafer_size =
static_cast<float>(dddConstants.waferSize(
true));
582 auto r = wafer_size / 2.f;
583 float x[6] = {-
r, -
r, 0.f,
r,
r, 0.f};
584 float y[6] = {
R / 2.f, -
R / 2.f, -
R, -
R / 2.f,
R / 2.f,
R};
585 float z[6] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f};
586 for (
unsigned int i = 0;
i < 6; ++
i) {
587 HepGeom::Point3D<float> wafer_corner(
x[
i],
y[
i],
z[
i]);
589 geom->topology().dddConstants().waferLocal2Global(wafer_corner, wafer_detid,
true,
true,
false);
598 fwRecoGeometry.
idToName[local_id].matrix[0] = 1.0;
599 fwRecoGeometry.
idToName[local_id].matrix[4] = 1.0;
600 fwRecoGeometry.
idToName[local_id].matrix[8] = 1.0;
603 fwRecoGeometry.
idToName[local_id].shape[3] = cor[cor.size() - 1].z();
606 fwRecoGeometry.
idToName[local_id].topology[0] = 6;
612 fwRecoGeometry.
idToName[local_id].topology[2] = rhtools.
zside(it->rawId());
618 fwRecoGeometry.
idToName[local_id].topology[4] =
637 fwRecoGeometry.
idToName.back().id = rawid;
643 std::vector<GlobalPoint>::const_iterator begin,
644 std::vector<GlobalPoint>::const_iterator
end,
646 unsigned int index(0);
647 for (std::vector<GlobalPoint>::const_iterator
i = begin;
i !=
end; ++
i) {
663 std::array<const float, 4>
const& par =
b2->parameters();
667 fwRecoGeometry.
idToName[
id].shape[1] = par[0];
668 fwRecoGeometry.
idToName[
id].shape[2] = par[1];
669 fwRecoGeometry.
idToName[
id].shape[3] = par[2];
670 fwRecoGeometry.
idToName[
id].shape[4] = par[3];
675 fwRecoGeometry.
idToName[
id].shape[1] =
b2->width() * 0.5;
676 fwRecoGeometry.
idToName[
id].shape[2] =
b2->length() * 0.5;
677 fwRecoGeometry.
idToName[
id].shape[3] =
b2->thickness() * 0.5;
708 path +=
"trackerParameters.xml";
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > m_caloGeomToken
const DetContainer & detsTIB() const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
virtual int nstrips() const =0
std::string trackerTopologyXML
float centreToIntersection() const override
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
void addFTLGeometry(FWRecoGeometry &)
std::string fullPath() const
const DetContainer & detsPXB() const
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
void addTOBGeometry(FWRecoGeometry &)
FWRecoGeometryESProducer(const edm::ParameterSet &)
void addTIBGeometry(FWRecoGeometry &)
float phiOfOneEdge() const override
static const int kHGCalCellUMask
static const int maxPoints_
const DetContainer & detsPXF() const
const GlobalTrackingGeometry * m_trackingGeom
Log< level::Error, false > LogError
void addRPCGeometry(FWRecoGeometry &)
static const int kHGCalCellVOffset
const TrackerGeometry * m_trackerGeom
void swap(Association< C > &lhs, Association< C > &rhs)
std::unique_ptr< FWRecoGeometry > produce(const FWRecoGeometryRecord &)
constexpr std::array< uint8_t, layerIndexSize > layer
float yAxisOrientation() const override
void fillPoints(unsigned int id, std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end, FWRecoGeometry &)
FWRecoGeom::InfoMap idToName
int firstChannel() const
Returns the wire number of the first wire.
void addCaloGeometry(FWRecoGeometry &)
virtual float localX(float mpX) const =0
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
float wireAngle() const override
virtual float stripLength() const =0
const_iterator end() const
float cellWidth() const
Returns the cell width.
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > m_trackingGeomToken
const DetContainer & detsTOB() const
static const int kHGCalCellVMask
virtual float stripOffset(void) const
virtual bool isItBigPixelInX(int ixbin) const =0
bool isThere(GeomDetEnumerators::SubDetector subdet) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void addPixelForwardGeometry(FWRecoGeometry &)
const_iterator begin() const
void writeTrackerParametersXML(FWRecoGeometry &)
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
float angularWidth() const override
double wireSpacing() const
DetId geographicalId() const
The label of this GeomDet.
void ADD_PIXEL_TOPOLOGY(unsigned int rawid, const GeomDet *detUnit, FWRecoGeometry &)
const TrackerGeomDet * idToDet(DetId) const override
const StripTopology & specificTopology() const
void addCSCGeometry(FWRecoGeometry &)
void addTECGeometry(FWRecoGeometry &)
const Plane & surface() const
The nominal surface of the GeomDet.
float yCentreOfStripPlane() const override
const PositionType & position() const
const CaloGeometry * m_caloGeom
virtual float localY(float mpY) const =0
constexpr uint32_t rawId() const
get the raw id
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
static const int kHGCalCellUOffset
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
~FWRecoGeometryESProducer(void) override
void addGEMGeometry(FWRecoGeometry &)
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
virtual float pitch() const =0
int lastChannel() const
Returns the wire number of the last wire.
void addTIDGeometry(FWRecoGeometry &)
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
const DetContainer & detsTEC() const
const RotationType & rotation() const
void addPixelBarrelGeometry(FWRecoGeometry &)
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
virtual std::pair< float, float > pitch() const =0
unsigned int insert_id(unsigned int id, FWRecoGeometry &)
const ChamberContainer & chambers() const
Return a vector of all chambers.
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
int channels() const
Returns the number of wires in the layer.
void addDTGeometry(FWRecoGeometry &)
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
void addME0Geometry(FWRecoGeometry &)
const DetContainer & detsTID() const
float cellHeight() const
Returns the cell height.
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.