CMS 3D CMS Logo

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

Member Function Documentation

virtual int AlignmentParametersIO::close ( void  )
protectedpure virtual
virtual int AlignmentParametersIO::open ( const char *  filename,
int  iteration,
bool  writemode 
)
protectedpure virtual
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(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), AlignmentIORoot::readAlignmentParameters(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches(), and ~AlignmentParametersIO().

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
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:33
virtual AlignmentParameters* AlignmentParametersIO::readOne ( Alignable ali,
int &  ierr 
)
protectedpure virtual
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(), AlignmentIORoot::writeAlignmentParameters(), and ~AlignmentParametersIO().

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 }
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(), and ~AlignmentParametersIO().

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:61
const AlgebraicVector & parameters(void) const
Get alignment parameters.
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
Definition: Alignable.cc:127
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(), and ~AlignmentParametersIO().

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)