From a953366269b36c123dbaaf546207d6ce50b6baaf Mon Sep 17 00:00:00 2001 From: Markus Frank <markus.frank@cern.ch> Date: Tue, 19 Feb 2013 12:30:16 +0000 Subject: [PATCH] Use of ROOT::Math vectors, rotations and transformations - closest approach to CLHEP --- DDExamples/AlignDet/src/BoxDetector_geo.cpp | 2 +- DDExamples/CLICSiDSimu/src/SteppingAction.cpp | 8 ++++---- DDExamples/ILDExReco/src/GearTPC.cpp | 4 ++-- cmake/FindROOT.cmake | 2 ++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/DDExamples/AlignDet/src/BoxDetector_geo.cpp b/DDExamples/AlignDet/src/BoxDetector_geo.cpp index d8d82dfa1..eadd759ad 100644 --- a/DDExamples/AlignDet/src/BoxDetector_geo.cpp +++ b/DDExamples/AlignDet/src/BoxDetector_geo.cpp @@ -25,7 +25,7 @@ static Ref_t create_element(LCDD& lcdd, const xml_h& e, SensitiveDetector&) { det_vol.setVisAttributes(lcdd, x_det.visStr()); PlacedVolume phv = mother.placeVolume(det_vol,Position(pos.x(),pos.y(),pos.z()), - Rotation(rot.x(),rot.y(),rot.z())); + Rotation(rot.z(),rot.y(),rot.x())); phv.addPhysVolID("id",x_det.id()); det.setPlacement(phv); return det; diff --git a/DDExamples/CLICSiDSimu/src/SteppingAction.cpp b/DDExamples/CLICSiDSimu/src/SteppingAction.cpp index 63fb162f6..d46333179 100644 --- a/DDExamples/CLICSiDSimu/src/SteppingAction.cpp +++ b/DDExamples/CLICSiDSimu/src/SteppingAction.cpp @@ -49,17 +49,17 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep) { Position pos1 = step.prePos(); Position pos2 = step.postPos(); - Momentum mom = step.postMom(); + Momentum mom = step.postMom(); if ( step.sd(step.pre) ) { - double len = (pos2-pos1).length(); + double len = (pos2-pos1).R(); ::printf(" Track:%08ld pos:%.0f Len:%.1f SD:%s [%s] Deposit:%.0f keV\n", - long(step.track),pos2.length()/cm,len/cm,step.sdName(step.pre,"----"), step.preStepStatus(), + long(step.track),pos2.R()/cm,len/cm,step.sdName(step.pre,"----"), step.preStepStatus(), edep/keV); } #if 0 ::printf(" Track:%08ld Pos:(%8f %8f %8f) -> (%f %f %f) Mom:%7.0f %7.0f %7.0f \n", - long(step.track), pos1.x, pos1.y, pos1.z, pos2.x, pos2.y, pos2.z, mom.x, mom.y, mom.z); + long(step.track), pos1.X(), pos1.Y(), pos1.Z(), pos2.X(), pos2.Y(), pos2.Z(), mom.X(), mom.Y(), mom.Z()); ::printf(" pre-Vol: %s Status:%s SD:%s\n", step.volName(step.pre,"----"), step.preStepStatus(), step.sdName(step.pre,"----")); ::printf(" post-Vol:%s Status:%s SD:%s\n", diff --git a/DDExamples/ILDExReco/src/GearTPC.cpp b/DDExamples/ILDExReco/src/GearTPC.cpp index 3c00eae28..b5fc9ed08 100644 --- a/DDExamples/ILDExReco/src/GearTPC.cpp +++ b/DDExamples/ILDExReco/src/GearTPC.cpp @@ -131,7 +131,7 @@ namespace DD4hep { { Position global(c0,c1,zpos), local; it->second.worldToLocal(global,local); - Double_t point_local[3]={local.x,local.y,local.z}; + Double_t point_local[3]={local.X(),local.Y(),local.Z()}; onMod=it->second.volume().solid()->Contains(point_local); if(onMod) { @@ -159,7 +159,7 @@ namespace DD4hep { //trafo of input world coordinates to local module system Position global(c0,c1,zpos), local; it->second.worldToLocal(global,local); - Double_t point_local[3]={local.x,local.y,local.z}; + Double_t point_local[3]={local.X(),local.Y(),local.Z()}; onMod=it->second.volume().solid()->Contains(point_local); if(onMod) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index 17e7ff8d5..27f7d1cee 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -38,6 +38,8 @@ if(ROOT_CONFIG_EXECUTABLE) endif() +set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lGenVector) + # handle the QUIETLY and REQUIRED arguments and set ROOT_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) -- GitLab