CMS 3D CMS Logo

List of all members | Protected Member Functions
AlignmentUserVariablesIO Class Referenceabstract

#include <AlignmentUserVariablesIO.h>

Inheritance diagram for AlignmentUserVariablesIO:
HIPUserVariablesIORoot MillePedeVariablesIORoot

Protected Member Functions

virtual int close (void)=0
 
virtual int open (const char *filename, int iteration, bool writemode)=0
 
std::vector< AlignmentUserVariables * > read (const align::Alignables &alivec, int &ierr)
 
virtual AlignmentUserVariablesreadOne (Alignable *ali, int &ierr)=0
 
int write (const align::Alignables &alivec, bool validCheck)
 
virtual int writeOne (Alignable *ali)=0
 
virtual ~AlignmentUserVariablesIO ()
 

Detailed Description

Abstract base class for I/O of AlignmentUserVariables. Note that it is the caller's responsibility to delete objects created during reading.

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

(at least last update...)

Definition at line 17 of file AlignmentUserVariablesIO.h.

Constructor & Destructor Documentation

virtual AlignmentUserVariablesIO::~AlignmentUserVariablesIO ( )
inlineprotectedvirtual

Member Function Documentation

virtual int AlignmentUserVariablesIO::close ( void  )
protectedpure virtual
virtual int AlignmentUserVariablesIO::open ( const char *  filename,
int  iteration,
bool  writemode 
)
protectedpure virtual
std::vector< AlignmentUserVariables * > AlignmentUserVariablesIO::read ( const align::Alignables alivec,
int &  ierr 
)
protected

read AlignmentUserVariables of many Alignables (using readOne, so take care of memory!)

Definition at line 37 of file AlignmentUserVariablesIO.cc.

References readOne().

Referenced by edmIntegrityCheck.PublishToFileSystem::get(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), HIPUserVariablesIORoot::readHIPUserVariables(), MillePedeVariablesIORoot::readMillePedeVariables(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches(), and ~AlignmentUserVariablesIO().

37  {
38  std::vector<AlignmentUserVariables*> retvec;
39  ierr = 0;
40  int ierr2;
41  int icount = 0;
42  int icount2 = 0;
43  for (align::Alignables::const_iterator it = alivec.begin(); it != alivec.end(); ++it) {
44  AlignmentUserVariables* ad = readOne(*it, ierr2); // should create with new!
45  if (ierr2 == 0) {
46  retvec.push_back(ad);
47  icount++;
48  if (ad != nullptr)
49  icount2++;
50  }
51  }
52  edm::LogInfo("Alignment") << "@SUB=AlignmentUserVariablesIO::read"
53  << "Read variables all,read,valid: " << alivec.size() << "," << icount << "," << icount2;
54  return retvec;
55 }
virtual AlignmentUserVariables * readOne(Alignable *ali, int &ierr)=0
(Abstract) Base class for alignment algorithm user variables
virtual AlignmentUserVariables* AlignmentUserVariablesIO::readOne ( Alignable ali,
int &  ierr 
)
protectedpure virtual

read AlignmentUserVariables of one Alignable, object should be created and has to be deleted

Implemented in MillePedeVariablesIORoot, and HIPUserVariablesIORoot.

Referenced by read(), and ~AlignmentUserVariablesIO().

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

write AlignmentUserVariables of many Alignables

Definition at line 19 of file AlignmentUserVariablesIO.cc.

References writeOne().

Referenced by pkg.AbstractPkg::generate(), querying.connection::write_and_commit(), HIPUserVariablesIORoot::writeHIPUserVariables(), MillePedeVariablesIORoot::writeMillePedeVariables(), and ~AlignmentUserVariablesIO().

19  {
20  int icount = 0;
21  for (align::Alignables::const_iterator it = alivec.begin(); it != alivec.end(); ++it) {
22  if ((*it)->alignmentParameters()->isValid() || !(validCheck)) {
23  icount++;
24  int iret = writeOne(*it);
25  if (iret != 0)
26  return iret;
27  }
28  }
29  edm::LogInfo("Alignment") << "@SUB=AlignmentUserVariablesIO::write"
30  << "Write variables all,written: " << alivec.size() << "," << icount;
31  return 0;
32 }
virtual int writeOne(Alignable *ali)=0
virtual int AlignmentUserVariablesIO::writeOne ( Alignable ali)
protectedpure virtual