CMS 3D CMS Logo

Private Member Functions | Private Attributes | Friends

AlignmentParametersIORoot Class Reference

#include <AlignmentParametersIORoot.h>

Inheritance diagram for AlignmentParametersIORoot:
AlignmentIORootBase AlignmentParametersIO

List of all members.

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.
AlignmentParametersreadOne (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

Detailed Description

Concrete class for ROOT-based I/O of AlignmentParameters

Date:
2009/01/23 15:47:42
Revision:
1.7

(last update by

Author:
ewidl

)

Definition at line 16 of file AlignmentParametersIORoot.h.


Constructor & Destructor Documentation

AlignmentParametersIORoot::AlignmentParametersIORoot ( ) [private]

Constructor.

Definition at line 15 of file AlignmentParametersIORoot.cc.

References AlignmentIORootBase::treename, and AlignmentIORootBase::treetxt.

{
  treename = "AlignmentParameters";
  treetxt = "Alignment Parameters";
}

Member Function Documentation

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]
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(), EgammaValidation_Wenu_cff::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]

Friends And Related Function Documentation

friend class AlignmentIORoot [friend]

Definition at line 18 of file AlignmentParametersIORoot.h.


Member Data Documentation

Definition at line 55 of file AlignmentParametersIORoot.h.

Referenced by createBranches(), readOne(), setBranchAddresses(), and writeOne().

Definition at line 51 of file AlignmentParametersIORoot.h.

Referenced by createBranches(), setBranchAddresses(), and writeOne().

Definition at line 51 of file AlignmentParametersIORoot.h.

Referenced by createBranches(), readOne(), setBranchAddresses(), and writeOne().

Definition at line 51 of file AlignmentParametersIORoot.h.

Referenced by createBranches(), setBranchAddresses(), and writeOne().

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().

Definition at line 55 of file AlignmentParametersIORoot.h.

Referenced by createBranches(), readOne(), setBranchAddresses(), and writeOne().

Definition at line 51 of file AlignmentParametersIORoot.h.

Referenced by createBranches(), readOne(), setBranchAddresses(), and writeOne().