CMS 3D CMS Logo

Public Member Functions | Private Attributes

SurveyOutput Class Reference

#include <SurveyOutput.h>

List of all members.

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

Detailed Description

Write variables to ntuple for survey analysis.

Date:
2007/03/14 18:05:35
Revision:
1.1
Author:
Chung Khim Lae

Definition at line 19 of file SurveyOutput.h.


Constructor & Destructor Documentation

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")
{
}

Member Function Documentation

void SurveyOutput::write ( unsigned int  iter)

write out variables

Definition at line 17 of file SurveyOutput.cc.

References Alignable::displacement(), i, N, nt, python::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;
}

Member Data Documentation

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().