test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Definition at line 22 of file AlignmentUserVariablesIO.h.

22 {}

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 41 of file AlignmentUserVariablesIO.cc.

References readOne().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), HIPUserVariablesIORoot::readHIPUserVariables(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

42 {
43  std::vector<AlignmentUserVariables*> retvec;
44  ierr=0;
45  int ierr2;
46  int icount=0;
47  int icount2=0;
48  for(align::Alignables::const_iterator it=alivec.begin();
49  it!=alivec.end(); it++) {
50  AlignmentUserVariables* ad=readOne(*it, ierr2); // should create with new!
51  if (ierr2==0) {
52  retvec.push_back(ad); icount++;
53  if (ad!=0) icount2++;
54  }
55  }
56  edm::LogInfo("Alignment") << "@SUB=AlignmentUserVariablesIO::read"
57  << "Read variables all,read,valid: " << alivec.size() <<","
58  << icount <<","<< icount2;
59  return retvec;
60 }
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().

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 pkg.AbstractPkg::generate(), and HIPUserVariablesIORoot::writeHIPUserVariables().

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