Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MakeMilleFiles.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MakeMilleFiles.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 
10 #ifndef MAKEMILLEFILES_H
11 #define MAKEMILLEFILES_H
12 
13 #include "AlignmentDefs.h"
14 
15 #include <fun4all/SubsysReco.h>
16 
17 #include <string>
18 #include <vector>
19 
20 #include <trackbase/ActsGeometry.h>
22 #include <trackbase/TrkrDefs.h>
25 
27 
28 class PHCompositeNode;
30 class SvtxTrack;
31 class SvtxTrackMap;
32 class TrkrCluster;
34 class Mille;
35 class ActsPropagator;
36 
38 
39 class MakeMilleFiles : public SubsysReco
40 {
41  public:
42  MakeMilleFiles(const std::string& name = "MakeMilleFiles");
43 
44  int InitRun(PHCompositeNode* topNode) override;
45  int process_event(PHCompositeNode* topNode) override;
46  int End(PHCompositeNode* topNode) override;
47 
48  void set_binary(bool bin) { _binary = bin; }
56  void use_event_vertex(bool useit) { m_useEventVertex = useit; }
57  void set_layer_fixed(unsigned int layer);
58  void set_mvtx_layer_fixed(unsigned int layer, unsigned int clamshell);
59  void set_layer_gparam_fixed(unsigned int layer, unsigned int param);
60  void set_layer_lparam_fixed(unsigned int layer, unsigned int param);
61 
62  void set_layers_fixed(unsigned int minlayer, unsigned int maxlayer);
63  void set_error_inflation_factor(unsigned int layer, float factor)
64  {
65  m_layerMisalignment.insert(std::make_pair(layer, factor));
66  }
67  void set_tpc_sector_fixed(unsigned int region, unsigned int sector,
68  unsigned int side)
69  {
70  // make a combined subsector index
71  unsigned int subsector = region * 24 + side * 12 + sector;
72  fixed_sectors.insert(subsector);
73  }
74  void set_vtx_sigma(float xysig, float zsig)
75  {
76  m_vtxSigma(0) = xysig;
77  m_vtxSigma(1) = zsig;
78  }
79 
80  private:
82 
83  int GetNodes(PHCompositeNode* topNode);
85 
86  bool is_layer_fixed(unsigned int layer);
87 
88  bool is_layer_param_fixed(unsigned int layer, unsigned int param, std::set<std::pair<unsigned int, unsigned int>>& param_fixed);
89 
90  bool is_tpc_sector_fixed(unsigned int layer, unsigned int sector, unsigned int side);
91  bool is_mvtx_layer_fixed(unsigned int layer, unsigned int clamshell);
94  const Acts::Vector3& vertex,
95  float glblvtx_derivative[SvtxAlignmentState::NRES][3]);
97  ActsPropagator& propagator,
98  const Acts::Vector3& vertex,
99  float lclvtx_derivative[SvtxAlignmentState::NRES][SvtxAlignmentState::NLOC]);
101  const Acts::Vector3& vertex,
102  const Acts::Vector3& localx) const;
103  void getProjectionVtxXY(SvtxTrack* track, const Acts::Vector3& vertex,
104  Acts::Vector3& projx, Acts::Vector3& projy);
105 
106  std::string data_outfilename = ("mille_output_data_file.bin");
108 
109  bool m_useEventVertex = false;
110  bool _binary = true;
111 
112  Acts::Vector2 m_vtxSigma = {0.1, 0.1};
113 
114  std::map<unsigned int, float> m_layerMisalignment;
115  std::set<unsigned int> fixed_sectors;
116  // set default groups to lowest level
121 
122  std::set<unsigned int> fixed_layers;
123  std::set<std::pair<unsigned int,unsigned int>> fixed_mvtx_layers;
124  std::set<std::pair<unsigned int, unsigned int>> fixed_layer_gparams, fixed_layer_lparams;
125 
127  std::ofstream m_constraintFile;
128 
134 };
135 
136 #endif // MAKEMILLEFILES_H