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

◆ ~AlignmentParametersIO()

virtual AlignmentParametersIO::~AlignmentParametersIO ( )
inlineprotectedvirtual

Definition at line 16 of file AlignmentParametersIO.h.

16 {};

Member Function Documentation

◆ close()

virtual int AlignmentParametersIO::close ( void  )
protectedpure virtual

◆ open()

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

open IO

Implemented in AlignmentParametersIORoot.

◆ read()

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

read AlignmentParameters of many Alignables

Definition at line 60 of file AlignmentParametersIO.cc.

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 }

References readOne().

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

◆ readOne()

virtual AlignmentParameters* AlignmentParametersIO::readOne ( Alignable ali,
int &  ierr 
)
protectedpure virtual

read AlignmentParameters of one Alignable

Implemented in AlignmentParametersIORoot.

Referenced by read().

◆ write()

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

write AlignmentParameters of many Alignables

Definition at line 25 of file AlignmentParametersIO.cc.

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 }

References writeOne().

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

◆ writeOne()

virtual int AlignmentParametersIO::writeOne ( Alignable ali)
protectedpure virtual

◆ writeOneOrigRigidBody()

int AlignmentParametersIO::writeOneOrigRigidBody ( Alignable ali)
protectedvirtual

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

Definition at line 11 of file AlignmentParametersIO.cc.

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 }

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

Referenced by writeOrigRigidBody().

◆ writeOrigRigidBody()

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

write original RigidBodyAlignmentParameters of many Alignables

Definition at line 42 of file AlignmentParametersIO.cc.

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 }

References writeOneOrigRigidBody().

Referenced by AlignmentIORoot::writeOrigRigidBodyAlignmentParameters().

Alignable::setAlignmentParameters
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
Definition: Alignable.cc:123
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
AlignmentParameters
Definition: AlignmentParameters.h:35
AlignmentParametersIO::writeOne
virtual int writeOne(Alignable *ali)=0
write AlignmentParameters of one Alignable
AlignmentParametersIO::readOne
virtual AlignmentParameters * readOne(Alignable *ali, int &ierr)=0
read AlignmentParameters of one Alignable
RigidBodyAlignmentParameters
Definition: RigidBodyAlignmentParameters.h:21
AlignmentParameters::clone
virtual AlignmentParameters * clone(const AlgebraicVector &par, const AlgebraicSymMatrix &cov) const =0
Enforce clone methods in derived classes.
align::Parameters
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:32
AlignmentParameters::covariance
const AlgebraicSymMatrix & covariance(void) const
Get parameter covariance matrix.
Definition: AlignmentParameters.cc:67
AlignmentParameters::parameters
const AlgebraicVector & parameters(void) const
Get alignment parameters.
Definition: AlignmentParameters.cc:64
AlignmentParametersIO::writeOneOrigRigidBody
virtual int writeOneOrigRigidBody(Alignable *ali)
write original RigidBodyAlignmentParameters (i.e. 3 shifts and 3 rotation)
Definition: AlignmentParametersIO.cc:11
Alignable::alignmentParameters
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:58