CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Protected Member Functions
AlignmentParametersIO Class Referenceabstract

#include <AlignmentParametersIO.h>

Inheritance diagram for AlignmentParametersIO:
AlignmentParametersIORoot

Protected Member Functions

virtual int close (void)=0
 close IO More...
 
virtual int open (const char *filename, int iteration, bool writemode)=0
 open IO More...
 
align::Parameters read (const align::Alignables &alivec, int &ierr)
 read AlignmentParameters of many Alignables More...
 
virtual AlignmentParametersreadOne (Alignable *ali, int &ierr)=0
 read AlignmentParameters of one Alignable More...
 
int write (const align::Alignables &alivec, bool validCheck)
 write AlignmentParameters of many Alignables More...
 
virtual int writeOne (Alignable *ali)=0
 write AlignmentParameters of one Alignable More...
 
virtual int writeOneOrigRigidBody (Alignable *ali)
 write original RigidBodyAlignmentParameters (i.e. 3 shifts and 3 rotation) More...
 
int writeOrigRigidBody (const align::Alignables &alivec, bool validCheck)
 write original RigidBodyAlignmentParameters of many Alignables More...
 
virtual ~AlignmentParametersIO ()
 

Detailed Description

abstract base class for I/O of AlignmentParameters

Date:
2007/01/23 16:07:08
Revision:
1.4

(last update by

Author:
fronga

)

Definition at line 14 of file AlignmentParametersIO.h.

Constructor & Destructor Documentation

virtual AlignmentParametersIO::~AlignmentParametersIO ( )
inlineprotectedvirtual

Definition at line 16 of file AlignmentParametersIO.h.

16 {};

Member Function Documentation

virtual int AlignmentParametersIO::close ( void  )
protectedpure virtual
virtual int AlignmentParametersIO::open ( const char *  filename,
int  iteration,
bool  writemode 
)
protectedpure virtual

open IO

Implemented in AlignmentParametersIORoot.

align::Parameters AlignmentParametersIO::read ( const align::Alignables alivec,
int &  ierr 
)
protected

read AlignmentParameters of many Alignables

Definition at line 60 of file AlignmentParametersIO.cc.

References readOne().

Referenced by edmIntegrityCheck.PublishToFileSystem::get(), and AlignmentIORoot::readAlignmentParameters().

60  {
61  align::Parameters retvec;
62  int ierr2;
63  int icount = 0;
64  for (align::Alignables::const_iterator it = alivec.begin(); it != alivec.end(); ++it) {
65  AlignmentParameters* ad = readOne(*it, ierr2);
66  if (ad != nullptr && ierr2 == 0) {
67  retvec.push_back(ad);
68  icount++;
69  }
70  }
71  edm::LogInfo("Alignment") << "@SUB-AlignmentParametersIO::write"
72  << "Read " << icount << " out of " << alivec.size() << " parameters";
73  return retvec;
74 }
virtual AlignmentParameters * readOne(Alignable *ali, int &ierr)=0
read AlignmentParameters of one Alignable
Log< level::Info, false > LogInfo
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:32
virtual AlignmentParameters* AlignmentParametersIO::readOne ( Alignable ali,
int &  ierr 
)
protectedpure virtual

read AlignmentParameters of one Alignable

Implemented in AlignmentParametersIORoot.

Referenced by read().

int AlignmentParametersIO::write ( const align::Alignables alivec,
bool  validCheck 
)
protected

write AlignmentParameters of many Alignables

Definition at line 25 of file AlignmentParametersIO.cc.

References writeOne().

Referenced by pkg.AbstractPkg::generate(), querying.connection::write_and_commit(), and AlignmentIORoot::writeAlignmentParameters().

25  {
26  int icount = 0;
27  for (align::Alignables::const_iterator it = alivec.begin(); it != alivec.end(); ++it) {
28  if ((*it)->alignmentParameters()->isValid() || !(validCheck)) {
29  icount++;
30  int iret = writeOne(*it);
31  if (iret != 0)
32  return iret;
33  }
34  }
35  edm::LogInfo("Alignment") << "@SUB=AlignmentParametersIO::write"
36  << "Wrote " << icount << " out of " << alivec.size() << " parameters";
37  return 0;
38 }
Log< level::Info, false > LogInfo
virtual int writeOne(Alignable *ali)=0
write AlignmentParameters of one Alignable
virtual int AlignmentParametersIO::writeOne ( Alignable ali)
protectedpure virtual
int AlignmentParametersIO::writeOneOrigRigidBody ( Alignable ali)
protectedvirtual

write original RigidBodyAlignmentParameters (i.e. 3 shifts and 3 rotation)

Definition at line 11 of file AlignmentParametersIO.cc.

References Alignable::alignmentParameters(), AlignmentParameters::clone(), AlignmentParameters::covariance(), AlignmentParameters::parameters(), Alignable::setAlignmentParameters(), and writeOne().

Referenced by writeOrigRigidBody().

11  {
13  AlignmentParameters* parBack = (par ? par->clone(par->parameters(), par->covariance()) : nullptr);
14 
16  int iret = this->writeOne(ali);
17 
18  ali->setAlignmentParameters(parBack); // deletes the above created RigidBodyAlignmentParameters
19 
20  return iret;
21 }
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:58
const AlgebraicVector & parameters(void) const
Get alignment parameters.
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
Definition: Alignable.cc:123
virtual AlignmentParameters * clone(const AlgebraicVector &par, const AlgebraicSymMatrix &cov) const =0
Enforce clone methods in derived classes.
const AlgebraicSymMatrix & covariance(void) const
Get parameter covariance matrix.
virtual int writeOne(Alignable *ali)=0
write AlignmentParameters of one Alignable
int AlignmentParametersIO::writeOrigRigidBody ( const align::Alignables alivec,
bool  validCheck 
)
protected

write original RigidBodyAlignmentParameters of many Alignables

Definition at line 42 of file AlignmentParametersIO.cc.

References writeOneOrigRigidBody().

Referenced by AlignmentIORoot::writeOrigRigidBodyAlignmentParameters().

42  {
43  int icount = 0;
44  for (align::Alignables::const_iterator it = alivec.begin(); it != alivec.end(); ++it) {
45  if (!validCheck || (*it)->alignmentParameters()->isValid()) {
46  ++icount;
47  int iret = this->writeOneOrigRigidBody(*it);
48  if (iret != 0)
49  return iret;
50  }
51  }
52  edm::LogInfo("Alignment") << "@SUB=AlignmentParametersIO::writeOrigRigidBody"
53  << "Wrote " << icount << " out of " << alivec.size() << " original parameters.";
54  return 0;
55 }
virtual int writeOneOrigRigidBody(Alignable *ali)
write original RigidBodyAlignmentParameters (i.e. 3 shifts and 3 rotation)
Log< level::Info, false > LogInfo