CMS 3D CMS Logo

SurveyOutput Class Reference

Write variables to ntuple for survey analysis. More...

#include <Alignment/SurveyAnalysis/interface/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.

00011                                                      :
00012   theAlignables(alignables),
00013   theFile(fileName.c_str(), "RECREATE")
00014 {
00015 }


Member Function Documentation

void SurveyOutput::write ( unsigned int  iter  ) 

write out variables

Definition at line 17 of file SurveyOutput.cc.

References Alignable::displacement(), e3, e4, i, N, 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().

00018 {
00019   std::ostringstream o;
00020 
00021   o << 't' << iter;
00022 
00023   TNtuple* nt = new TNtuple(o.str().c_str(), "", "x:y:z:a:b:g");
00024 
00025   unsigned int N = theAlignables.size();
00026 
00027   for (unsigned int i = 0; i < N; ++i)
00028   {
00029     const Alignable* ali = theAlignables[i];
00030 
00031     align::GlobalVector shifts = ali->displacement() * 1e4; // cm to um
00032 
00033     align::EulerAngles angles = align::toAngles( ali->rotation() ) * 1e3; // to mrad
00034 
00035     nt->Fill( shifts.x(), shifts.y(), shifts.z(),
00036               angles(1), angles(2), angles(3) );
00037 //     const AlgebraicVector& pars = ali->alignmentParameters()->parameters();
00038 
00039 //     nt->Fill(pars[0], pars[1], pars[2], pars[3], pars[4], pars[5]);
00040   }
00041 
00042   theFile.Write();
00043 
00044   delete nt;
00045 }


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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:33:01 2009 for CMSSW by  doxygen 1.5.4