1 |
fronga |
1.1 |
#ifndef Alignment_CommonAlignmentAlgorithm_AlignableDataIORoot_h
|
2 |
|
|
#define Alignment_CommonAlignmentAlgorithm_AlignableDataIORoot_h
|
3 |
|
|
|
4 |
|
|
#include <map>
|
5 |
|
|
|
6 |
|
|
#include "TTree.h"
|
7 |
|
|
|
8 |
|
|
#include "Alignment/CommonAlignmentAlgorithm/interface/AlignableDataIO.h"
|
9 |
|
|
#include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentIORootBase.h"
|
10 |
|
|
#include "Alignment/CommonAlignmentAlgorithm/interface/AlignableData.h"
|
11 |
|
|
#include "Alignment/CommonAlignment/interface/Alignable.h"
|
12 |
|
|
|
13 |
|
|
/// concrete class for ROOT based IO of Alignable positions
|
14 |
|
|
|
15 |
|
|
class AlignableDataIORoot : public AlignmentIORootBase,
|
16 |
|
|
public AlignableDataIO
|
17 |
|
|
{
|
18 |
|
|
|
19 |
|
|
friend class AlignmentIORoot;
|
20 |
|
|
|
21 |
|
|
private:
|
22 |
|
|
/// constructor
|
23 |
|
|
AlignableDataIORoot(PosType p);
|
24 |
|
|
|
25 |
|
|
/// open IO
|
26 |
|
|
int open(char* filename, int iteration, bool writemode)
|
27 |
|
|
{ newopen=true; return openRoot(filename,iteration,writemode); }
|
28 |
|
|
|
29 |
|
|
/// close IO
|
30 |
|
|
int close(void){ return closeRoot(); }
|
31 |
|
|
|
32 |
|
|
/// write absolute positions
|
33 |
|
|
int writeAbsRaw(AlignableAbsData ad);
|
34 |
|
|
/// read absolute positions
|
35 |
|
|
AlignableAbsData readAbsRaw(Alignable* ali,int& ierr);
|
36 |
|
|
/// write relative positions
|
37 |
|
|
int writeRelRaw(AlignableRelData ad);
|
38 |
|
|
/// read relative positions
|
39 |
|
|
AlignableRelData readRelRaw(Alignable* ali,int& ierr);
|
40 |
|
|
|
41 |
|
|
int findEntry(unsigned int detId,int comp);
|
42 |
|
|
void createBranches(void);
|
43 |
|
|
void setBranchAddresses(void);
|
44 |
|
|
|
45 |
|
|
// data members
|
46 |
|
|
|
47 |
|
|
/// root tree contents
|
48 |
|
|
int ObjId;
|
49 |
|
|
unsigned int Id;
|
50 |
|
|
double Pos[3];
|
51 |
|
|
double Rot[9];
|
52 |
|
|
|
53 |
|
|
bool newopen;
|
54 |
|
|
typedef std::map< std::pair<int,int> , int > treemaptype;
|
55 |
|
|
treemaptype treemap;
|
56 |
|
|
|
57 |
|
|
};
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
#endif
|