![]() |
![]() |
Functions | |
def | loopover |
def | matrixmult |
def | rotFromEuler |
def | rotFromPhi |
def | transpose |
Variables | |
int | epsilon = 1 |
tuple | geom1 = MuonGeometry(file(args[0])) |
tuple | geom2 = MuonGeometry(file(args[1])) |
tuple | opts = dict(opts) |
tuple | sqrtepsilon = sqrt(epsilon) |
string | usage = "Usage: geometryDiff.py [-h|--help] [-e|--epsilon epsilon] geometry1.xml geometry2.xml" |
def geometryDiff::loopover | ( | which | ) |
Definition at line 60 of file geometryDiff.py.
00060 : 00061 if which == "DT": 00062 keys = geom1.dt.keys() 00063 keys.sort(dtorder) 00064 00065 elif which == "CSC": 00066 keys = geom1.csc.keys() 00067 keys.sort(cscorder) 00068 00069 else: raise Exception 00070 00071 for key in keys: 00072 if which == "DT": 00073 g1 = geom1.dt[key] 00074 g2 = geom2.dt[key] 00075 else: 00076 g1 = geom1.csc[key] 00077 g2 = geom2.csc[key] 00078 00079 if g1.relativeto != g2.relativeto: 00080 print "%s %s relativeto=\"%s\" versus relativeto=\"%s\"" % (which, str(key), g1.relativeto, g2.relativeto) 00081 00082 if abs(g1.x - g2.x) > epsilon or abs(g1.y - g2.y) > epsilon or abs(g1.z - g2.z) > epsilon: 00083 print "%s %s position difference: (%g, %g, %g) - (%g, %g, %g) = (%g, %g, %g)" % \ 00084 (which, str(key), g1.x, g1.y, g1.z, g2.x, g2.y, g2.z, g1.x - g2.x, g1.y - g2.y, g1.z - g2.z) 00085 00086 if "phix" in g1.__dict__: 00087 g1type = "phi" 00088 g1a, g1b, g1c = g1.phix, g1.phiy, g1.phiz 00089 g1rot = rotFromPhi(g1) 00090 else: 00091 g1type = "euler" 00092 g1a, g1b, g1c = g1.alpha, g1.beta, g1.gamma 00093 g1rot = rotFromEuler(g1) 00094 00095 if "phix" in g2.__dict__: 00096 g2type = "phi" 00097 g2a, g2b, g2c = g2.phix, g2.phiy, g2.phiz 00098 g2rot = rotFromPhi(g2) 00099 else: 00100 g2type = "euler" 00101 g2a, g2b, g2c = g2.alpha, g2.beta, g2.gamma 00102 g2rot = rotFromEuler(g2) 00103 00104 diff = matrixmult(g1rot, transpose(g2rot)) 00105 if abs(diff[0][0] - 1.) > sqrtepsilon or abs(diff[1][1] - 1.) > sqrtepsilon or abs(diff[2][2] - 1.) > sqrtepsilon or \ 00106 abs(diff[0][1]) > epsilon or abs(diff[0][2]) > epsilon or abs(diff[1][2]) > epsilon: 00107 print "%s %s rotation difference: %s(%g, %g, %g) - %s(%g, %g, %g) = %s" % \ 00108 (which, str(key), g1type, g1a, g1b, g1c, g2type, g2a, g2b, g2c, str(diff)) 00109 00110 loopover("DT") 00111 loopover("CSC") 00112 00113
def geometryDiff::matrixmult | ( | a, | ||
b | ||||
) |
Definition at line 34 of file geometryDiff.py.
00034 : 00035 return [[sum([i*j for i, j in zip(row, col)]) for col in zip(*b)] for row in a] 00036 def transpose(a):
def geometryDiff::rotFromEuler | ( | g | ) |
Definition at line 53 of file geometryDiff.py.
00053 : 00054 s1, s2, s3 = sin(g.alpha), sin(g.beta), sin(g.gamma) 00055 c1, c2, c3 = cos(g.alpha), cos(g.beta), cos(g.gamma) 00056 return [[c2 * c3, c1 * s3 + s1 * s2 * c3, s1 * s3 - c1 * s2 * c3,], 00057 [-c2 * s3, c1 * c3 - s1 * s2 * s3, s1 * c3 + c1 * s2 * s3,], 00058 [s2, -s1 * c2, c1 * c2, ]] 00059 def loopover(which):
def geometryDiff::rotFromPhi | ( | g | ) |
Definition at line 40 of file geometryDiff.py.
00040 : 00041 phix, phiy, phiz = g.phix, g.phiy, g.phiz 00042 rotX = [[1., 0., 0., ], 00043 [0., cos(phix), sin(phix),], 00044 [0., -sin(phix), cos(phix),]] 00045 rotY = [[cos(phiy), 0., -sin(phiy),], 00046 [0., 1., 0., ], 00047 [sin(phiy), 0., cos(phiy),]] 00048 rotZ = [[cos(phiz), sin(phiz), 0., ], 00049 [-sin(phiz), cos(phiz), 0., ], 00050 [0., 0., 1., ]] 00051 return matrixmult(rotX, matrixmult(rotY, rotZ)) 00052 def rotFromEuler(g):
def geometryDiff::transpose | ( | a | ) |
Definition at line 37 of file geometryDiff.py.
Referenced by AlignmentExtendedCorrelationsStore::correlations(), AlignmentCorrelationsStore::correlations(), AlignmentCorrelationsStore::correlationsAvailable(), AlignmentExtendedCorrelationsStore::correlationsAvailable(), AlignmentExtendedCorrelationsStore::getCorrelations(), IgSoSplineTrack::midpoint(), AlignmentExtendedCorrelationsStore::setCorrelations(), and AlignmentCorrelationsStore::setCorrelations().
00037 : 00038 return [[a[j][i] for j in range(len(a[i]))] for i in range(len(a))] 00039 def rotFromPhi(g):
int geometryDiff::epsilon = 1 [static] |
Definition at line 24 of file geometryDiff.py.
Referenced by HLTMuonRate::analyze(), GeneralBinFinderInPhi< T >::binIndex(), MagGeoBuilderFromDDD::bSlab::bSlab(), TrackWithHistory::checkAtEnd(), CorrectDeadChannelsClassic(), CorrectDeadChannelsNN(), IntegralOverPhiFunction::DoEval(), IntegrandThetaFunction::DoEval(), VisG4TwigOps::estimateCubicVolume(), KinematicPerigeeConversions::extendedPerigeeFromKinematicParameters(), HLTPi0RecHitsFilter::filter(), Thrust::finalAxis(), PerigeeConversions::ftsToPerigeeParameters(), TrackerBounds::initialize(), ECALBounds::initialize(), ConversionTrackEcalImpactPoint::initialize(), EcalListOfFEDSProducer::Jets(), SimpleNavigationSchool::linkNextLargerLayer(), HICSimpleNavigationSchool::linkNextLargerLayer(), HICSimpleNavigationSchool::linkNextLayerInGroup(), SimpleNavigationSchool::linkNextLayerInGroup(), main(), EcalListOfFEDSProducer::Muon(), NavVolume6Faces::nextSurface(), DTTopology::onWhichBorder(), DTTopology::onWhichBorder_old(), NumericSafeGreaterByPt< T >::operator()(), NumericSafeLessByPt< T >::operator()(), NumericSafeLessByEt< T >::operator()(), NumericSafeGreaterByEt< T >::operator()(), DTSegmentCand::operator==(), SimpleNavigationSchool::outerRadiusIncrease(), HICSimpleNavigationSchool::outerRadiusIncrease(), PFGeometry::PFGeometry(), cms::TrackListMerger::produce(), cms::SimpleTrackListMerger::produce(), TrackerOnlyConversionProducer::produce(), RecHitPropagator::propagate(), IgSoCrystalHit::refresh(), and muonisolation::NominalEfficiencyThresholds::thresholdValueForEfficiency().
tuple geometryDiff::geom1 = MuonGeometry(file(args[0])) [static] |
Definition at line 28 of file geometryDiff.py.
tuple geometryDiff::geom2 = MuonGeometry(file(args[1])) [static] |
Definition at line 29 of file geometryDiff.py.
tuple geometryDiff::opts = dict(opts) [static] |
Definition at line 18 of file geometryDiff.py.
tuple geometryDiff::sqrtepsilon = sqrt(epsilon) [static] |
Definition at line 32 of file geometryDiff.py.
string geometryDiff::usage = "Usage: geometryDiff.py [-h|--help] [-e|--epsilon epsilon] geometry1.xml geometry2.xml" [static] |
Definition at line 6 of file geometryDiff.py.