PageRenderTime 31ms CodeModel.GetById 19ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/DetectorDescription/RegressionTest/interface/DDCompareTools.h

https://github.com/aivanov-cern/cmssw
C Header | 99 lines | 69 code | 15 blank | 15 comment | 0 complexity | c23ec8b12c748e06fc1108ad98a2699d MD5 | raw file
 1#include "DetectorDescription/Core/interface/DDCompactView.h"
 2#include "DetectorDescription/Core/interface/DDExpandedView.h"
 3#include "DetectorDescription/Core/interface/DDSolid.h"
 4
 5/// DDComparators need to know if names of DDRotation matter.
 6/**
 7   Therefore the constructors (default) are set to care about rotation names
 8   but if one really wants to compare without regard to the name, for example
 9   in the case of two DDCompactViews created in-memory from reading two 
10   separate sets of XML rather than from DB objects, then one must set this
11   to false.
12 **/
13struct DDCompOptions {
14  DDCompOptions() : compRotName_(false), attResync_(false),
15		    contOnError_(false), distTol_(0.0004),
16		    rotTol_(0.0004), specTol_(0.0004)
17  { }
18
19  bool compRotName_;
20  bool attResync_;
21  bool contOnError_;
22  double distTol_;
23  double rotTol_;
24  double specTol_;
25};
26
27struct DDCompareEPV : public std::binary_function<DDExpandedView, DDExpandedView, bool> {
28  DDCompareEPV();
29  DDCompareEPV(const DDCompOptions& ddco);
30  bool operator()(DDExpandedView& lhs, DDExpandedView& rhs) const ;
31  DDCompOptions ddco_;
32};
33
34struct DDCompareCPV : public std::binary_function<DDCompactView, DDCompactView, bool> {
35  DDCompareCPV();
36  DDCompareCPV(const DDCompOptions& ddco);
37  bool operator()(const DDCompactView& lhs, const DDCompactView& rhs) const ;
38  DDCompOptions ddco_;
39};
40
41/// LogicalParts have solids which could be BooleanSolids.
42/**
43   This means they need to know if the DDRotation naems matter.
44 **/
45struct DDCompareLP : public std::binary_function<DDLogicalPart, DDLogicalPart, bool> {
46  DDCompareLP();
47  DDCompareLP(const DDCompOptions& ddco);
48  bool operator()(const DDLogicalPart& lhs, const DDLogicalPart& rhs) const ;
49  DDCompOptions ddco_;
50};
51
52/// Needs to know about rotmat because of BooleanSolid
53struct DDCompareSolid : public std::binary_function<DDSolid, DDSolid, bool> {
54  DDCompareSolid();
55  DDCompareSolid(const DDCompOptions& ddco);
56  bool operator()(const DDSolid& lhs, const DDSolid& rhs) const ;
57  DDCompOptions ddco_;
58};
59
60struct DDCompareDBLVEC : public std::binary_function<std::vector<double>, std::vector<double>, bool> {
61  DDCompareDBLVEC();
62  DDCompareDBLVEC(double tol);
63  bool operator()(const std::vector<double>& lhs, const std::vector<double>& rhs) const ;
64  double tol_;
65};
66
67/// Needs to know because of Rotation Matrix of Boolean Relationship.
68struct DDCompareBoolSol : public std::binary_function<DDBooleanSolid, DDBooleanSolid, bool> {
69  DDCompareBoolSol();
70  DDCompareBoolSol(const DDCompOptions& ddco);
71  bool operator()(const DDBooleanSolid& lhs, const DDBooleanSolid& rhs) const ;
72  DDCompOptions ddco_;
73};
74
75struct DDCompareDDTrans : public std::binary_function<DDTranslation, DDTranslation, bool> {
76  DDCompareDDTrans();
77  DDCompareDDTrans(double tol);
78  bool operator()(const DDTranslation& lhs, const DDTranslation& rhs) const;
79  double tol_;
80};
81
82/// Allows to compare name or not. If not, compares only values of the rotation matrix.
83struct DDCompareDDRot : public std::binary_function<DDRotation, DDRotation, bool> {
84  DDCompareDDRot();
85  DDCompareDDRot(const DDCompOptions& ddco);
86  bool operator()(const DDRotation& lhs, const DDRotation& rhs) const;
87  DDCompOptions ddco_;
88};
89
90struct DDCompareDDRotMat : public std::binary_function<DDRotationMatrix, DDRotationMatrix, bool> {
91  DDCompareDDRotMat();
92  DDCompareDDRotMat(double tol);
93  bool operator()(const DDRotationMatrix& lhs, const DDRotationMatrix& rhs) const;
94  double tol_;
95};
96
97
98
99