Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:07

0001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignableDataIORoot_h
0002 #define Alignment_CommonAlignmentAlgorithm_AlignableDataIORoot_h
0003 
0004 #include <map>
0005 
0006 #include "Alignment/CommonAlignment/interface/StructureType.h"
0007 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignableDataIO.h"
0008 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentIORootBase.h"
0009 
0010 class Alignable;
0011 
0012 /// concrete class for ROOT based IO of Alignable positions
0013 
0014 class AlignableDataIORoot : public AlignmentIORootBase, public AlignableDataIO {
0015   friend class AlignmentIORoot;
0016 
0017 private:
0018   /// constructor
0019   AlignableDataIORoot(PosType p);
0020 
0021   /// open IO
0022   int open(const char* filename, int iteration, bool writemode) override {
0023     newopen = true;
0024     return openRoot(filename, iteration, writemode);
0025   }
0026 
0027   /// close IO
0028   int close(void) override { return closeRoot(); }
0029 
0030   /// write absolute positions
0031   int writeAbsRaw(const AlignableAbsData& ad) override;
0032   /// read absolute positions
0033   AlignableAbsData readAbsRaw(Alignable* ali, int& ierr) override;
0034   /// write relative positions
0035   int writeRelRaw(const AlignableRelData& ad) override;
0036   /// read relative positions
0037   AlignableRelData readRelRaw(Alignable* ali, int& ierr) override;
0038 
0039   int findEntry(align::ID, align::StructureType);
0040   void createBranches(void) override;
0041   void setBranchAddresses(void) override;
0042 
0043   // data members
0044 
0045   /// root tree contents
0046   align::StructureType ObjId;
0047   //unsigned int Id;
0048   align::ID Id;
0049   Double_t Pos[3];
0050   Double_t Rot[9];
0051   UInt_t numDeformationValues_;
0052   enum { kMaxNumPar = 20 };  // slighly above 'two bowed surfaces' limit
0053   Float_t deformationValues_[kMaxNumPar];
0054 
0055   bool newopen;
0056   typedef std::map<std::pair<align::ID, align::StructureType>, int> treemaptype;
0057   treemaptype treemap;
0058 };
0059 
0060 #endif