File indexing completed on 2025-08-05 08:20:37
0001
0002
0003 #ifndef MVTX_P2_ALIGN_H
0004 #define MVTX_P2_ALIGN_H
0005
0006 #include <fun4all/SubsysReco.h>
0007 #include <phool/PHTimeServer.h>
0008 #include <map>
0009 #include <limits.h>
0010
0011 #include <trackbase/TrkrClusterContainer.h>
0012 #include <trackbase/TrkrDefs.h>
0013
0014 class TrkrHitSetContainer;
0015
0016 class MvtxPrototype2Align : public SubsysReco {
0017
0018 public:
0019
0020 struct AlignmentPar {
0021 double dx;
0022 double dy;
0023 double dz;
0024 };
0025
0026
0027 MvtxPrototype2Align(const std::string &name = "MvtxAlign");
0028 virtual ~MvtxPrototype2Align() {}
0029
0030
0031 int Init(PHCompositeNode *topNode) {return 0;}
0032
0033
0034 int InitRun(PHCompositeNode *topNode);
0035
0036
0037 int process_event(PHCompositeNode *topNode);
0038
0039
0040 int End(PHCompositeNode *topNode) {return 0;}
0041
0042
0043 void AddAlignmentPar(TrkrDefs::hitsetkey key, double dx, double dy, double dz);
0044
0045
0046 void PrintAlignmentPars(std::ostream &os = std::cout) const;
0047
0048
0049 void SetAlignmentParFileDir(const std::string fdir) { fdir_ = fdir; }
0050
0051
0052 void SetAlignmentParFromFile(const bool yn) { apff_ = yn; }
0053
0054
0055 void SetAlignmentParFileName(const char* name) { m_afname = name; }
0056
0057
0058 void SetIsGlobal(const bool yn) { m_is_global = yn; }
0059 bool GetIsGlobal() { return m_is_global; }
0060
0061 private:
0062
0063
0064 int ReadAlignmentParFile();
0065
0066
0067 TrkrClusterContainer* clusters_;
0068
0069
0070 std::map<TrkrDefs::hitsetkey, AlignmentPar> alignmap_;
0071
0072
0073 std::string fdir_;
0074 int runnumber_;
0075 bool apff_;
0076 std::string m_afname;
0077
0078 bool m_is_global;
0079
0080 PHTimeServer::timer _timer;
0081 };
0082
0083 #endif