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();
138 unsigned int rpId = pD->
copyno();
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 expandedView = delExpandedView(expandedView);
281 int nsLength = part.
name().
ns().length();
282 return atoi(part.
name().
ns().substr(nsLength - 3, nsLength).c_str());
287 return rpId * 10 + detNo;
300 translRotFromTransform(translation, rotation, transform);
305 translRotToTransform(translation, rotation, transform);
316 translRotToTransform(translation, rotation, C);
318 if (useMeasuredParent)
319 getGlobalTransform(parent, *measuredCV, mP);
321 getGlobalTransform(parent, idealCV, mP);
322 getGlobalTransform(parent, idealCV, iP);
326 applyCorrectionToTransform(correction, F);
331 translRotFromTransform(translation, rotation, F);
335 DDCompactView::graph_type::const_iterator it = idealCV.graph().begin_iter();
336 DDCompactView::graph_type::const_iterator itEnd = idealCV.graph().end_iter();
337 for (; it != itEnd; ++it) {
338 if (!isDetector(it->to())) {
341 const int copyNo = it->edge()->copyno_;
342 const DDDivision &division = it->edge()->division();
347 const int rpId = getRPIdFromNamespace(to);
348 if (alignments !=
NULL) {
350 applyCorrection(from, to, correction,
351 translation, rotationMatrix,
false);
356 measuredCV->position(to, from, copyNo, translation, rotation, &division);
362 DDCompactView::graph_type::const_iterator it = idealCV.graph().begin_iter();
363 DDCompactView::graph_type::const_iterator itEnd = idealCV.graph().end_iter();
364 for (; it != itEnd; ++it) {
365 if (isDetector(it->to())) {
368 const int copyNo = it->edge()->copyno_;
369 const DDDivision &division = it->edge()->division();
373 const int rpId = getRPIdFromNamespace(from);
374 const int detId = getDetectorId(rpId, copyNo);
375 if (alignments !=
NULL) {
377 applyCorrection(from, to, correction,
378 translation, rotationMatrix);
382 measuredCV->position(to, from, copyNo, translation, rotation, &division);
390 root = this->idealCV.root();
400 positionEverythingButDetectors();
411 measured_ddcv = producer.
produce();
433 LogVerbatim(
"TotemRPGeometryESModule::produceMeasuredDDCV")
434 <<
">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: "
435 << alignments->GetRPMap().size() <<
" RP and "
436 << alignments->GetSensorMap().size() <<
" sensor alignments applied.";
440 LogVerbatim(
"TotemRPGeometryESModule::produceMeasuredDDCV")
441 <<
">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: No alignments applied.";
445 ApplyAlignments(idealCV, alignments, measuredCV);
446 return auto_ptr<DDCompactView>(measuredCV);
478 LogVerbatim(
"TotemRPGeometryESModule::produceRealGD")
479 <<
">> TotemRPGeometryESModule::produceRealGD > Measured geometry: "
480 << alignments->GetRPMap().size() <<
" RP and "
481 << alignments->GetSensorMap().size() <<
" sensor alignments applied.";
484 LogVerbatim(
"TotemRPGeometryESModule::produceRealGD")
485 <<
">> TotemRPGeometryESModule::produceRealGD > Real geometry: No alignments applied.";
489 ApplyAlignments(measuredGD, alignments, newGD);
490 return auto_ptr<DetGeomDesc>(newGD);
509 LogVerbatim(
"TotemRPGeometryESModule::produceMisalignedGD")
510 <<
">> TotemRPGeometryESModule::produceMisalignedGD > Measured geometry: "
511 << alignments->GetRPMap().size() <<
" RP and "
512 << alignments->GetSensorMap().size() <<
" sensor alignments applied.";
515 LogVerbatim(
"TotemRPGeometryESModule::produceMisalignedGD")
516 <<
">> TotemRPGeometryESModule::produceMisalignedGD > Misaligned geometry: No alignments applied.";
520 ApplyAlignments(measuredGD, alignments, newGD);
521 return auto_ptr<DetGeomDesc>(newGD);
void positionEverythingButDetectors(void)
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()
Builds structure of DetGeomDesc objects out of DDCompactView (resp. DDFilteredView).
std::auto_ptr< DDCompactView > produceMeasuredDDCV(const VeryForwardMeasuredGeometryRecord &)
const std::string & ns() const
Returns the namespace.
static unsigned int rawToDecId(unsigned int raw)
fast conversion Raw to Decimal ID
const char DDD_TOTEM_RP_PRIMARY_VACUUM_NAME[]
DDD name of RP.
const DDCompactView & idealCV
type of data representation of DDCompactView
static int getDetectorId(const int rpId, const int detNo)
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.
uint32_t rawId() const
get the raw id
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.
std::auto_ptr< DetGeomDesc > produceMeasuredGD(const VeryForwardMeasuredGeometryRecord &)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::auto_ptr< TotemRPGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
Alignment correction or result of alignment procedure for a single RP sensor. Within the geometry des...
const DDTranslation & translation() const
The absolute translation of the current node.
static bool isRPBox(const DDLogicalPart &part)
std::auto_ptr< DetGeomDesc > produceRealGD(const VeryForwardRealGeometryRecord &)
virtual int copyno() const
DDCompactView *& produce()
TotemRPGeometryESModule(const edm::ParameterSet &p)
virtual DetId geographicalID() const
T const * product() const
static int getRPIdFromNamespace(const DDLogicalPart &part)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Container for RP alignment corrections. The corrections are stored on two levels - RP and sensor...
The manager class for TOTEM RP geometry.
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...
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.
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)
std::auto_ptr< TotemRPGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
std::auto_ptr< TotemRPGeometry > produceMeasuredTG(const VeryForwardMeasuredGeometryRecord &)
std::auto_ptr< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
static DDExpandedView * newExpandedView(const DDCompactView &compactView, const DDLogicalPart &part)