111 deque<const DetGeomDesc *> buffer;
112 deque<DetGeomDesc *> bufferNew;
113 buffer.push_back(idealGD.
product());
114 bufferNew.push_back(newGD);
116 while (buffer.size() > 0)
121 bufferNew.pop_front();
151 buffer.push_back(sDC);
157 bufferNew.push_back(cD);
191 const string &ns = part.
name().
ns();
198 expandedView->
next();
236 rotation.GetComponents(values);
237 for (
int i = 0;
i < 9; ++
i) {
238 transform[
i / 3][
i % 3] = values[
i];
241 transform[0][3] = translation.X();
242 transform[1][3] = translation.Y();
243 transform[2][3] = translation.Z();
244 transform[3][3] = 1.;
252 for (
int i = 0;
i < 9; ++
i) {
253 values[
i] = transform[
i / 3][
i % 3];
255 rotation.SetComponents(values, values + 9);
257 translation.SetXYZ(transform[0][3], transform[1][3], transform[2][3]);
262 DDExpandedView *expandedView = newExpandedView(compactView, part);
264 delExpandedView(expandedView);
282 const int nsLength = part.
name().
ns().length();
283 const unsigned int rpDecId = atoi(part.
name().
ns().substr(nsLength - 3, nsLength).c_str());
285 const unsigned int armIdx = rpDecId / 100;
286 const unsigned int stIdx = (rpDecId / 10) % 10;
287 const unsigned int rpIdx = rpDecId % 10;
302 translRotFromTransform(translation, rotation, transform);
307 translRotToTransform(translation, rotation, transform);
318 translRotToTransform(translation, rotation, C);
320 if (useMeasuredParent)
321 getGlobalTransform(parent, *measuredCV, mP);
323 getGlobalTransform(parent, idealCV, mP);
324 getGlobalTransform(parent, idealCV, iP);
328 applyCorrectionToTransform(correction, F);
333 translRotFromTransform(translation, rotation, F);
337 DDCompactView::graph_type::const_iterator it = idealCV.graph().begin_iter();
338 DDCompactView::graph_type::const_iterator itEnd = idealCV.graph().end_iter();
339 for (; it != itEnd; ++it) {
340 if (!isDetector(it->to())) {
343 const int copyNo = it->edge()->copyno_;
344 const DDDivision &division = it->edge()->division();
350 if (alignments !=
NULL)
354 applyCorrection(from, to, correction, translation, rotationMatrix,
false);
359 measuredCV->position(to, from, copyNo, translation, rotation, &division);
366 DDCompactView::graph_type::const_iterator it = idealCV.graph().begin_iter();
367 DDCompactView::graph_type::const_iterator itEnd = idealCV.graph().end_iter();
368 for (; it != itEnd; ++it) {
369 if (isDetector(it->to())) {
372 const int copyNo = it->edge()->copyno_;
373 const DDDivision &division = it->edge()->division();
377 if (alignments !=
NULL)
383 applyCorrection(from, to, correction, translation, rotationMatrix);
387 measuredCV->position(to, from, copyNo, translation, rotation, &division);
395 alignments(alignments.isValid() ? &(*alignments) :
NULL) {
396 root = this->idealCV.root();
406 positionEverythingButDetectors();
417 measured_ddcv = producer.
produce();
439 LogVerbatim(
"TotemRPGeometryESModule::produceMeasuredDDCV")
440 <<
">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: "
441 << alignments->GetRPMap().size() <<
" RP and "
442 << alignments->GetSensorMap().size() <<
" sensor alignments applied.";
446 LogVerbatim(
"TotemRPGeometryESModule::produceMeasuredDDCV")
447 <<
">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: No alignments applied.";
451 ApplyAlignments(idealCV, alignments, measuredCV);
452 return std::unique_ptr<DDCompactView>(measuredCV);
484 LogVerbatim(
"TotemRPGeometryESModule::produceRealGD")
485 <<
">> TotemRPGeometryESModule::produceRealGD > Measured geometry: "
486 << alignments->GetRPMap().size() <<
" RP and "
487 << alignments->GetSensorMap().size() <<
" sensor alignments applied.";
490 LogVerbatim(
"TotemRPGeometryESModule::produceRealGD")
491 <<
">> TotemRPGeometryESModule::produceRealGD > Real geometry: No alignments applied.";
495 ApplyAlignments(measuredGD, alignments, newGD);
496 return std::unique_ptr<DetGeomDesc>(newGD);
515 LogVerbatim(
"TotemRPGeometryESModule::produceMisalignedGD")
516 <<
">> TotemRPGeometryESModule::produceMisalignedGD > Measured geometry: "
517 << alignments->GetRPMap().size() <<
" RP and "
518 << alignments->GetSensorMap().size() <<
" sensor alignments applied.";
521 LogVerbatim(
"TotemRPGeometryESModule::produceMisalignedGD")
522 <<
">> TotemRPGeometryESModule::produceMisalignedGD > Misaligned geometry: No alignments applied.";
526 ApplyAlignments(measuredGD, alignments, newGD);
527 return std::unique_ptr<DetGeomDesc>(newGD);
537 return std::make_unique<TotemRPGeometry>( gD.
product() );
547 return std::make_unique<TotemRPGeometry>( gD.
product());
557 return std::make_unique<TotemRPGeometry>( gD.
product());
void positionEverythingButDetectors(void)
Detector ID class for TOTEM Si strip detectors.
bool next()
set current node to the next node in the expanded tree
T getUntrackedParameter(std::string const &, T const &) const
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
const RPAlignmentCorrectionsData *const alignments
void ApplyAlignments(const edm::ESHandle< DetGeomDesc > &measuredGD, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments, DetGeomDesc *&newGD)
static bool isDetector(const DDLogicalPart &part)
RotationMatrix getRotationMatrix() const
virtual ~TotemRPGeometryESModule()
std::unique_ptr< TotemRPGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
Builds structure of DetGeomDesc objects out of DDCompactView (resp. DDFilteredView).
const std::string & ns() const
Returns the namespace.
const char DDD_TOTEM_RP_PRIMARY_VACUUM_NAME[]
DDD name of RP.
const DDCompactView & idealCV
type of data representation of DDCompactView
static void translRotFromTransform(DDTranslation &translation, DDRotationMatrix &rotation, const TMatrixD &transform)
Event setup record containing the real (actual) geometry information.
const DetGeomDesc * construct(const DDCompactView *cpv)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
const DepRecordT & getRecord() const
static value_type & instance()
static void applyCorrectionToTransform(const RPAlignmentCorrectionData &correction, TMatrixD &transform)
static bool evRotationStoreState
Event setup record containing the Measured (measured) geometry information.
const math::XYZVectorD & getTranslation() const
void ApplyAlignment(const RPAlignmentCorrectionData &)
alignment
static void getGlobalTransform(const DDLogicalPart &part, const DDCompactView &compactView, TMatrixD &transform)
virtual ConstContainer components() const
access to the tree structure
Builds ideal, real and misaligned geometries.
void get(HolderT &iHolder) const
Geometrical description of a detector.
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::unique_ptr< DetGeomDesc > produceRealGD(const VeryForwardRealGeometryRecord &)
Alignment correction or result of alignment procedure for a single RP sensor. Within the geometry des...
std::unique_ptr< DDCompactView > produceMeasuredDDCV(const VeryForwardMeasuredGeometryRecord &)
std::unique_ptr< DetGeomDesc > produceMeasuredGD(const VeryForwardMeasuredGeometryRecord &)
const DDTranslation & translation() const
The absolute translation of the current node.
static bool isRPBox(const DDLogicalPart &part)
DDCompactView *& produce()
TotemRPGeometryESModule(const edm::ParameterSet &p)
virtual DetId geographicalID() const
std::unique_ptr< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
void setPlane(uint32_t det)
T const * product() const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Container for RP alignment corrections. The corrections are stored on two levels - RP and sensor...
std::unique_ptr< TotemRPGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
static void translRotToTransform(const DDTranslation &translation, const DDRotationMatrix &rotation, TMatrixD &transform)
MeasuredGeometryProducer(const edm::ESHandle< DDCompactView > &idealCV, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments)
DDCompactView * measuredCV
Event setup record containing the misaligned geometry information. It is used for alignment studies o...
static TotemRPDetId getRPIdFromNamespace(const DDLogicalPart &part)
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
const char DDD_TOTEM_RP_DETECTOR_NAME[]
DDD name of RP detector.
std::unique_ptr< TotemRPGeometry > produceMeasuredTG(const VeryForwardMeasuredGeometryRecord &)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
void positionDetectors(void)
void applyCorrection(const DDLogicalPart &parent, const DDLogicalPart &child, const RPAlignmentCorrectionData &correction, DDTranslation &translation, DDRotationMatrix &rotation, const bool useMeasuredParent=true)
Provides an exploded view of the detector (tree-view)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
void addComponent(DetGeomDesc *)
const std::string & name() const
Returns the name.
static DDExpandedView * delExpandedView(DDExpandedView *expandedView)
static DDExpandedView * newExpandedView(const DDCompactView &compactView, const DDLogicalPart &part)