69 #include "CLHEP/Matrix/SymMatrix.h"
126 theCurrentTracker(0),
128 m_x(0.), m_y(0.), m_z(0.),
129 m_alpha(0.), m_beta(0.), m_gamma(0.),
131 m_xx(0.), m_xy(0.), m_yy(0.), m_xz(0.), m_yz(0.), m_zz(0.),
133 m_d1(0.), m_d2(0.), m_d3(0.),
140 m_tree =
new TTree(m_outputTreename.c_str(),m_outputTreename.c_str());
145 m_treeErrors =
new TTree(
"alignTreeErrors",
"alignTreeErrors");
200 Alignments* theAlignments = theCurrentTracker->alignments();
205 for (std::vector<AlignTransform>::const_iterator
i = theAlignments->
m_align.begin();
i != theAlignments->
m_align.end(); ++
i){
208 CLHEP::Hep3Vector translation =
i->translation();
209 m_x = translation.x();
210 m_y = translation.y();
211 m_z = translation.z();
214 CLHEP::HepRotation
rotation =
i->rotation();
216 m_beta = rotation.getTheta();
231 delete theAlignments;
233 std::vector<AlignTransformErrorExtended> alignErrors = alignmentErrors->m_alignError;
234 for (std::vector<AlignTransformErrorExtended>::const_iterator
i = alignErrors.begin();
i != alignErrors.end(); ++
i){
237 CLHEP::HepSymMatrix errMatrix =
i->matrix();
240 m_xx = errMatrix[0][0];
241 m_xy = errMatrix[0][1];
242 m_xz = errMatrix[0][2];
243 m_yy = errMatrix[1][1];
244 m_yz = errMatrix[1][2];
245 m_zz = errMatrix[2][2];
250 auto const & detUnits = theCurTracker->
detUnits() ;
253 for (
auto iunit = detUnits.begin(); iunit != detUnits.end(); ++iunit) {
255 DetId detid = (*iunit)->geographicalId();
261 auto geomDetUnit = *iunit ;
264 if ( geomDetUnit->surfaceDeformation() ) {
265 std::vector<double> surfaceDeformParams = (geomDetUnit->surfaceDeformation())->
parameters() ;
267 m_dNpar = surfaceDeformParams.size() ;
268 m_dtype = (geomDetUnit->surfaceDeformation())->
type() ;
269 m_d1 = surfaceDeformParams.at(0) ;
270 m_d2 = surfaceDeformParams.at(1) ;
271 m_d3 = surfaceDeformParams.at(2) ;
273 for (std::vector<double>::const_iterator it = surfaceDeformParams.begin(); it != surfaceDeformParams.end(); ++it) {
Float_t deformationValues_[kMaxNumPar]
T getUntrackedParameter(std::string const &, T const &) const
Class to update a given geometry with a set of alignments.
#define DEFINE_FWK_MODULE(type)
AlignableTracker * theCurrentTracker
std::vector< double > * mp_dpar
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
std::string m_outputTreename
std::vector< AlignTransform > m_align
UInt_t numDeformationValues_
uint32_t rawId() const
get the raw id
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
void get(HolderT &iHolder) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
~TrackerGeometryIntoNtuples()
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
T const * product() const
TTree * m_treeDeformations
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
TrackerGeometryIntoNtuples(const edm::ParameterSet &)