CMS 3D CMS Logo

AlignmentUserVariablesIO.cc
Go to the documentation of this file.
1 
10 
11 // this class's header
15 
16 //-----------------------------------------------------------------------------
17 // write many user variables
18 
19 int
21  bool validCheck)
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 }
36 
37 //-----------------------------------------------------------------------------
38 // read many user variables
39 
40 std::vector<AlignmentUserVariables*>
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!=nullptr) 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
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
int write(const align::Alignables &alivec, bool validCheck)
std::vector< AlignmentUserVariables * > read(const align::Alignables &alivec, int &ierr)
virtual int writeOne(Alignable *ali)=0