#include <AlignmentParametersIORoot.h>
Private Member Functions | |
AlignmentParametersIORoot () | |
Constructor. | |
int | close (void) |
Close IO. | |
void | createBranches (void) |
Create all branches and give names. | |
int | findEntry (align::ID, align::StructureType) |
int | open (const char *filename, int iteration, bool writemode) |
Open IO. | |
AlignmentParameters * | readOne (Alignable *ali, int &ierr) |
Read AlignmentParameters of one Alignable. | |
void | setBranchAddresses (void) |
Set branch adresses. | |
int | writeOne (Alignable *ali) |
Write AlignmentParameters of one Alignable. | |
Private Attributes | |
double | theCov [nParMax *(nParMax+1)/2] |
int | theCovarRang |
int | theCovRang |
int | theHieraLevel |
align::ID | theId |
align::StructureType | theObjId |
double | thePar [nParMax] |
int | theParamType |
Friends | |
class | AlignmentIORoot |
Concrete class for ROOT-based I/O of AlignmentParameters
(last update by
)
Definition at line 16 of file AlignmentParametersIORoot.h.
AlignmentParametersIORoot::AlignmentParametersIORoot | ( | ) | [private] |
Constructor.
Definition at line 15 of file AlignmentParametersIORoot.cc.
References AlignmentIORootBase::treename, and AlignmentIORootBase::treetxt.
int AlignmentParametersIORoot::close | ( | void | ) | [private, virtual] |
Close IO.
Implements AlignmentParametersIO.
Definition at line 118 of file AlignmentParametersIORoot.cc.
References AlignmentIORootBase::bWrite, AlignmentIORootBase::closeRoot(), and AlignmentIORootBase::tree.
Referenced by AlignmentIORoot::readAlignmentParameters(), AlignmentIORoot::writeAlignmentParameters(), and AlignmentIORoot::writeOrigRigidBodyAlignmentParameters().
{ if ( bWrite ) { int nIndices = tree->BuildIndex( "Id", "ObjId" ); edm::LogInfo( "Alignment" ) << "@SUB=AlignmentParametersIORoot::setBranchAddresses" << "number of indexed entries: " << nIndices; } return closeRoot(); }
void AlignmentParametersIORoot::createBranches | ( | void | ) | [private, virtual] |
Create all branches and give names.
Implements AlignmentIORootBase.
Definition at line 23 of file AlignmentParametersIORoot.cc.
References theCov, theCovarRang, theCovRang, theHieraLevel, theId, theObjId, thePar, theParamType, and AlignmentIORootBase::tree.
{ tree->Branch("parSize", &theCovRang, "CovRang/I"); tree->Branch("Id", &theId, "Id/i"); tree->Branch("paramType", &theParamType, "paramType/I"); tree->Branch("Par", &thePar, "Par[CovRang]/D"); tree->Branch("covarSize", &theCovarRang, "CovarRang/I"); tree->Branch("Cov", &theCov, "Cov[CovarRang]/D"); tree->Branch("ObjId", &theObjId, "ObjId/I"); tree->Branch("HieraLevel",&theHieraLevel,"HieraLevel/I"); }
int AlignmentParametersIORoot::findEntry | ( | align::ID | , |
align::StructureType | |||
) | [private] |
Find entry number corresponding to ID and structure type. Returns -1 on failure.
int AlignmentParametersIORoot::open | ( | const char * | filename, |
int | iteration, | ||
bool | writemode | ||
) | [inline, private, virtual] |
Open IO.
Implements AlignmentParametersIO.
Definition at line 32 of file AlignmentParametersIORoot.h.
References AlignmentIORootBase::openRoot().
Referenced by AlignmentIORoot::readAlignmentParameters(), AlignmentIORoot::writeAlignmentParameters(), and AlignmentIORoot::writeOrigRigidBodyAlignmentParameters().
AlignmentParameters * AlignmentParametersIORoot::readOne | ( | Alignable * | ali, |
int & | ierr | ||
) | [private, virtual] |
Read AlignmentParameters of one Alignable.
Implements AlignmentParametersIO.
Definition at line 78 of file AlignmentParametersIORoot.cc.
References Alignable::alignableObjectId(), Alignable::alignmentParameters(), AlignmentParameters::clone(), prof2calltree::count, AlignmentParametersFactory::createParameters(), Alignable::id(), AlignmentParametersFactory::parametersType(), runTheMatrix::sel, AlignmentParameters::selector(), AlignmentParameters::setValid(), theCov, theCovRang, thePar, theParamType, and AlignmentIORootBase::tree.
{ if( tree->GetEntryWithIndex( ali->id(), ali->alignableObjectId() ) > 0 ) { int covsize = theCovRang; int count=0; AlgebraicVector par(covsize, 0); AlgebraicSymMatrix cov(covsize, 0); for(int row=0;row<covsize;row++) { par[row]=thePar[row]; for(int col=0; col < covsize;col++) { if(row-1<col) {cov[row][col]=theCov[count];count++;} } } using namespace AlignmentParametersFactory; ParametersType parType = parametersType(theParamType); AlignmentParameters* alipar1; if ( ali->alignmentParameters() ) { const std::vector<bool>& sel = ali->alignmentParameters()->selector(); alipar1 = createParameters(ali, parType, sel); } else { const std::vector<bool> sel( theCovRang, true ); alipar1 = createParameters(ali, parType, sel); } AlignmentParameters* alipar = alipar1->clone(par,cov); alipar->setValid(true); ierr=0; delete alipar1; return alipar; } ierr=-1; return(0); }
void AlignmentParametersIORoot::setBranchAddresses | ( | void | ) | [private, virtual] |
Set branch adresses.
Implements AlignmentIORootBase.
Definition at line 37 of file AlignmentParametersIORoot.cc.
References theCov, theCovarRang, theCovRang, theHieraLevel, theId, theObjId, thePar, theParamType, and AlignmentIORootBase::tree.
{ tree->SetBranchAddress("parSize", &theCovRang); tree->SetBranchAddress("covarSize", &theCovarRang); tree->SetBranchAddress("Id", &theId); tree->SetBranchAddress("Par", &thePar); tree->SetBranchAddress("paramType", &theParamType); tree->SetBranchAddress("Cov", &theCov); tree->SetBranchAddress("ObjId", &theObjId); tree->SetBranchAddress("HieraLevel",&theHieraLevel); }
int AlignmentParametersIORoot::writeOne | ( | Alignable * | ali | ) | [private, virtual] |
Write AlignmentParameters of one Alignable.
Implements AlignmentParametersIO.
Definition at line 51 of file AlignmentParametersIORoot.cc.
References Alignable::alignableObjectId(), Alignable::alignmentParameters(), prof2calltree::count, AlignmentParameters::covariance(), AlignmentParameters::hierarchyLevel(), Alignable::id(), AlignmentParameters::parameters(), theCov, theCovarRang, theCovRang, theHieraLevel, theId, theObjId, thePar, theParamType, AlignmentIORootBase::tree, and AlignmentParameters::type().
{ const AlignmentParameters* ap =ali->alignmentParameters(); const AlgebraicVector& params = ap->parameters(); const AlgebraicSymMatrix& cov = ap->covariance(); theCovRang = params.num_row(); theCovarRang = theCovRang*(theCovRang+1)/2; int count=0; for(int row=0;row<theCovRang;row++){ thePar[row]=params[row]; for(int col=0;col<theCovRang;col++){ if(row-1<col) { theCov[count] = cov[row][col]; count++; } } } theId = ali->id(); theParamType = ap->type(); theObjId = ali->alignableObjectId(); theHieraLevel = ap->hierarchyLevel(); tree->Fill(); return 0; }
friend class AlignmentIORoot [friend] |
Definition at line 18 of file AlignmentParametersIORoot.h.
double AlignmentParametersIORoot::theCov[nParMax *(nParMax+1)/2] [private] |
Definition at line 55 of file AlignmentParametersIORoot.h.
Referenced by createBranches(), readOne(), setBranchAddresses(), and writeOne().
int AlignmentParametersIORoot::theCovarRang [private] |
Definition at line 51 of file AlignmentParametersIORoot.h.
Referenced by createBranches(), setBranchAddresses(), and writeOne().
int AlignmentParametersIORoot::theCovRang [private] |
Definition at line 51 of file AlignmentParametersIORoot.h.
Referenced by createBranches(), readOne(), setBranchAddresses(), and writeOne().
int AlignmentParametersIORoot::theHieraLevel [private] |
Definition at line 51 of file AlignmentParametersIORoot.h.
Referenced by createBranches(), setBranchAddresses(), and writeOne().
align::ID AlignmentParametersIORoot::theId [private] |
Definition at line 52 of file AlignmentParametersIORoot.h.
Referenced by createBranches(), setBranchAddresses(), and writeOne().
Definition at line 53 of file AlignmentParametersIORoot.h.
Referenced by createBranches(), setBranchAddresses(), and writeOne().
double AlignmentParametersIORoot::thePar[nParMax] [private] |
Definition at line 55 of file AlignmentParametersIORoot.h.
Referenced by createBranches(), readOne(), setBranchAddresses(), and writeOne().
int AlignmentParametersIORoot::theParamType [private] |
Definition at line 51 of file AlignmentParametersIORoot.h.
Referenced by createBranches(), readOne(), setBranchAddresses(), and writeOne().