Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MvtxPrototype2Align.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MvtxPrototype2Align.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef MVTX_P2_ALIGN_H
4 #define MVTX_P2_ALIGN_H
5 
6 #include <fun4all/SubsysReco.h>
7 #include <phool/PHTimeServer.h>
8 #include <map>
9 #include <limits.h>
10 
12 #include <trackbase/TrkrDefs.h>
13 
15 
17 
18 public:
19 
20  struct AlignmentPar {
21  double dx;
22  double dy;
23  double dz;
24  };
25 
26 
27  MvtxPrototype2Align(const std::string &name = "MvtxAlign");
28  virtual ~MvtxPrototype2Align() {}
29 
31  int Init(PHCompositeNode *topNode) {return 0;}
32 
34  int InitRun(PHCompositeNode *topNode);
35 
37  int process_event(PHCompositeNode *topNode);
38 
40  int End(PHCompositeNode *topNode) {return 0;}
41 
43  void AddAlignmentPar(TrkrDefs::hitsetkey key, double dx, double dy, double dz);
44 
46  void PrintAlignmentPars(std::ostream &os = std::cout) const;
47 
49  void SetAlignmentParFileDir(const std::string fdir) { fdir_ = fdir; }
50 
52  void SetAlignmentParFromFile(const bool yn) { apff_ = yn; }
53 
55  void SetAlignmentParFileName(const char* name) { m_afname = name; }
56 
58  void SetIsGlobal(const bool yn) { m_is_global = yn; }
59  bool GetIsGlobal() { return m_is_global; }
60 
61 private:
62 
63  // read the alignment parameters from file based on run number
65 
66  // node tree storage pointers
68 
69  // storage object for misalignments
70  std::map<TrkrDefs::hitsetkey, AlignmentPar> alignmap_;
71 
72  // directory for alignment parameter files
75  bool apff_; // alignment par from file
76  std::string m_afname; // alignment par file name. If null generated by run by run
77 
79 
81 };
82 
83 #endif