#include <SurveyOutput.h>
Public Member Functions | |
SurveyOutput (const std::vector< Alignable * > &, const std::string &fileName) | |
void | write (unsigned int iter) |
write out variables | |
Private Attributes | |
const std::vector< Alignable * > & | theAlignables |
TFile | theFile |
Write variables to ntuple for survey analysis.
Definition at line 19 of file SurveyOutput.h.
SurveyOutput::SurveyOutput | ( | const std::vector< Alignable * > & | alignables, |
const std::string & | fileName | ||
) |
Definition at line 10 of file SurveyOutput.cc.
: theAlignables(alignables), theFile(fileName.c_str(), "RECREATE") { }
void SurveyOutput::write | ( | unsigned int | iter | ) |
write out variables
Definition at line 17 of file SurveyOutput.cc.
References Alignable::displacement(), i, MultiGaussianStateTransform::N, nt, connectstrParser::o, Alignable::rotation(), theAlignables, theFile, align::toAngles(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by SurveyAlignment::iterate().
{ std::ostringstream o; o << 't' << iter; TNtuple* nt = new TNtuple(o.str().c_str(), "", "x:y:z:a:b:g"); unsigned int N = theAlignables.size(); for (unsigned int i = 0; i < N; ++i) { const Alignable* ali = theAlignables[i]; align::GlobalVector shifts = ali->displacement() * 1e4; // cm to um align::EulerAngles angles = align::toAngles( ali->rotation() ) * 1e3; // to mrad nt->Fill( shifts.x(), shifts.y(), shifts.z(), angles(1), angles(2), angles(3) ); // const AlgebraicVector& pars = ali->alignmentParameters()->parameters(); // nt->Fill(pars[0], pars[1], pars[2], pars[3], pars[4], pars[5]); } theFile.Write(); delete nt; }
const std::vector<Alignable*>& SurveyOutput::theAlignables [private] |
Definition at line 35 of file SurveyOutput.h.
Referenced by write().
TFile SurveyOutput::theFile [private] |
Definition at line 37 of file SurveyOutput.h.
Referenced by write().