CMS 3D CMS Logo

Protected Member Functions

AlignmentUserVariablesIO Class Reference

#include <AlignmentUserVariablesIO.h>

Inheritance diagram for AlignmentUserVariablesIO:
HIPUserVariablesIORoot MillePedeVariablesIORoot

List of all members.

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/10/08 14:38:15
Revision:
1.5
Author:
cklae

(at least last update...)

Definition at line 17 of file AlignmentUserVariablesIO.h.


Constructor & Destructor Documentation

virtual AlignmentUserVariablesIO::~AlignmentUserVariablesIO ( ) [inline, protected, virtual]

Definition at line 22 of file AlignmentUserVariablesIO.h.

{}

Member Function Documentation

virtual int AlignmentUserVariablesIO::close ( void  ) [protected, pure virtual]
virtual int AlignmentUserVariablesIO::open ( const char *  filename,
int  iteration,
bool  writemode 
) [protected, pure 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 41 of file AlignmentUserVariablesIO.cc.

References readOne().

Referenced by HIPUserVariablesIORoot::readHIPUserVariables().

{
  std::vector<AlignmentUserVariables*> retvec;
  ierr=0;
  int ierr2;
  int icount=0;
  int icount2=0;
  for(align::Alignables::const_iterator it=alivec.begin();
    it!=alivec.end(); it++) {
    AlignmentUserVariables* ad=readOne(*it, ierr2); // should create with new!
    if (ierr2==0) { 
      retvec.push_back(ad); icount++; 
      if (ad!=0) icount2++;
    }
  }
  edm::LogInfo("Alignment") << "@SUB=AlignmentUserVariablesIO::read"
                            << "Read variables all,read,valid: " << alivec.size() <<","
                            << icount <<","<< icount2;
  return retvec;
}
virtual AlignmentUserVariables* AlignmentUserVariablesIO::readOne ( Alignable ali,
int &  ierr 
) [protected, pure virtual]

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

Implemented in HIPUserVariablesIORoot, and MillePedeVariablesIORoot.

Referenced by read().

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

write AlignmentUserVariables of many Alignables

Definition at line 20 of file AlignmentUserVariablesIO.cc.

References writeOne().

Referenced by HIPUserVariablesIORoot::writeHIPUserVariables().

{
  int icount=0;
  for(align::Alignables::const_iterator it=alivec.begin();
    it!=alivec.end(); it++) {
    if ((*it)->alignmentParameters()->isValid() || !(validCheck)) {
      icount++;
      int iret=writeOne(*it);
      if (iret!=0) return iret;
    }
  }
  edm::LogInfo("Alignment") << "@SUB=AlignmentUserVariablesIO::write"
                            << "Write variables all,written: " << alivec.size() <<","<< icount;
  return 0;
}
virtual int AlignmentUserVariablesIO::writeOne ( Alignable ali) [protected, pure virtual]