CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SurveyOutput Class Reference

#include <SurveyOutput.h>

Public Member Functions

 SurveyOutput (const std::vector< Alignable * > &, const std::string &fileName)
 
void write (unsigned int iter)
 write out variables More...
 

Private Attributes

const std::vector< Alignable * > & theAlignables
 
TFile theFile
 

Detailed Description

Write variables to ntuple for survey analysis.

Date:
2007/01/09
Revision:
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.

11  :
12  theAlignables(alignables),
13  theFile(fileName.c_str(), "RECREATE")
14 {
15 }
const std::vector< Alignable * > & theAlignables
Definition: SurveyOutput.h:35

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 pkg.AbstractPkg::generate(), and SurveyAlignment::iterate().

18 {
19  std::ostringstream o;
20 
21  o << 't' << iter;
22 
23  TNtuple* nt = new TNtuple(o.str().c_str(), "", "x:y:z:a:b:g");
24 
25  unsigned int N = theAlignables.size();
26 
27  for (unsigned int i = 0; i < N; ++i)
28  {
29  const Alignable* ali = theAlignables[i];
30 
31  align::GlobalVector shifts = ali->displacement() * 1e4; // cm to um
32 
33  align::EulerAngles angles = align::toAngles( ali->rotation() ) * 1e3; // to mrad
34 
35  nt->Fill( shifts.x(), shifts.y(), shifts.z(),
36  angles(1), angles(2), angles(3) );
37 // const AlgebraicVector& pars = ali->alignmentParameters()->parameters();
38 
39 // nt->Fill(pars[0], pars[1], pars[2], pars[3], pars[4], pars[5]);
40  }
41 
42  theFile.Write();
43 
44  delete nt;
45 }
int i
Definition: DBlmapReader.cc:9
const std::vector< Alignable * > & theAlignables
Definition: SurveyOutput.h:35
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:140
T y() const
Definition: PV3DBase.h:63
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:143
T z() const
Definition: PV3DBase.h:64
EulerAngles toAngles(const RotationType &)
Convert rotation matrix to angles about x-, y-, z-axes (frame rotation).
Definition: Utilities.cc:7
int nt
Definition: AMPTWrapper.h:32
AlgebraicVector EulerAngles
Definition: Definitions.h:36
#define N
Definition: blowfish.cc:9
T x() const
Definition: PV3DBase.h:62

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