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

71 {
72  align::Parameters retvec;
73  int ierr2;
74  int icount=0;
75  for(align::Alignables::const_iterator it=alivec.begin();
76  it!=alivec.end(); ++it) {
77  AlignmentParameters* ad=readOne(*it, ierr2);
78  if (ad!=nullptr && ierr2==0) { retvec.push_back(ad); icount++; }
79  }
80  edm::LogInfo("Alignment") << "@SUB-AlignmentParametersIO::write"
81  << "Read " << icount << " out of " << alivec.size() << " parameters";
82  return retvec;
83 }
virtual AlignmentParameters * readOne(Alignable *ali, int &ierr)=0
read AlignmentParameters of one Alignable
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:32
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 29 of file AlignmentParametersIO.cc.

References writeOne().

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

31 {
32  int icount=0;
33  for(align::Alignables::const_iterator it=alivec.begin();
34  it!=alivec.end(); ++it) {
35  if ((*it)->alignmentParameters()->isValid() || !(validCheck)) {
36  icount++;
37  int iret=writeOne(*it);
38  if (iret!=0) return iret;
39  }
40  }
41  edm::LogInfo("Alignment") << "@SUB=AlignmentParametersIO::write"
42  << "Wrote " << icount << " out of " << alivec.size() << " parameters";
43  return 0;
44 }
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().

12 {
13 
15  AlignmentParameters *parBack = (par ? par->clone(par->parameters(), par->covariance()) : nullptr);
16 
18  int iret = this->writeOne(ali);
19 
20  ali->setAlignmentParameters(parBack); // deletes the above created RigidBodyAlignmentParameters
21 
22  return iret;
23 }
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:129
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 50 of file AlignmentParametersIO.cc.

References writeOneOrigRigidBody().

Referenced by AlignmentIORoot::writeOrigRigidBodyAlignmentParameters(), and ~AlignmentParametersIO().

51 {
52  int icount = 0;
53  for(align::Alignables::const_iterator it = alivec.begin(); it != alivec.end(); ++it) {
54  if (!validCheck || (*it)->alignmentParameters()->isValid()) {
55  ++icount;
56  int iret = this->writeOneOrigRigidBody(*it);
57  if (iret != 0) return iret;
58  }
59  }
60  edm::LogInfo("Alignment") << "@SUB=AlignmentParametersIO::writeOrigRigidBody"
61  << "Wrote " << icount << " out of " << alivec.size()
62  << " original parameters.";
63  return 0;
64 }
virtual int writeOneOrigRigidBody(Alignable *ali)
write original RigidBodyAlignmentParameters (i.e. 3 shifts and 3 rotation)