Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KshortReconstruction.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KshortReconstruction.h
1 #ifndef KSHORTRECONSTRUCTION_H
2 #define KSHORTRECONSTRUCTION_H
3 
4 #include <fun4all/SubsysReco.h>
5 
7 #include <trackbase/TpcDefs.h>
8 #include <trackbase/TrkrDefs.h>
9 
12 
15 
17 
21 
22 #pragma GCC diagnostic push
23 #pragma GCC diagnostic ignored "-Wshadow"
25 #pragma GCC diagnostic pop
26 
27 #include <Eigen/Dense>
28 
29 class TFile;
30 class TH1D;
31 class TNtuple;
32 
35 using SurfacePtr = std::shared_ptr<const Acts::Surface>;
37 
38 class PHCompositeNode;
39 class SvtxTrack;
40 class SvtxTrackMap;
41 class SvtxVertexMap;
42 
44 {
45  public:
46  KshortReconstruction(const std::string& name = "KshortReconstruction");
47  virtual ~KshortReconstruction() {}
48 
49  int InitRun(PHCompositeNode* topNode) override;
50  int process_event(PHCompositeNode* topNode) override;
51  int End(PHCompositeNode* /*topNode*/) override;
52 
53  void setPtCut(double ptcut) { invariant_pt_cut = ptcut; }
54  void setTrackQualityCut(double cut) { _qual_cut = cut; }
55  void setPairDCACut(double cut) { pair_dca_cut = cut; }
56  void setTrackDCACut(double cut) { track_dca_cut = cut; }
57  void setRequireMVTX(bool set) { _require_mvtx = set; }
58  void setDecayMass(Float_t decayMassSet) { decaymass = decayMassSet; } //(muons decaymass = 0.1057) (pions = 0.13957) (electron = 0.000511)
59  void set_output_file(const std::string &outputfile) { filepath = outputfile; }
60 
61  private:
62  void fillNtp(SvtxTrack* track1, SvtxTrack* track2, Acts::Vector3 dcavals1, Acts::Vector3 dcavals2, Acts::Vector3 pca_rel1, Acts::Vector3 pca_rel2, double pair_dca, double invariantMass, double invariantPt, float rapidity, float pseudorapidity, Eigen::Vector3d projected_pos1, Eigen::Vector3d projected_pos2, Eigen::Vector3d projected_mom1, Eigen::Vector3d projected_mom2, Acts::Vector3 pca_rel1_proj, Acts::Vector3 pca_rel2_proj, double pair_dca_proj);
63 
64  void fillHistogram(Eigen::Vector3d mom1, Eigen::Vector3d mom2, TH1D* massreco, double& invariantMass, double& invariantPt, float& rapidity, float& pseudorapidity);
65 
66  // void findPcaTwoTracks(SvtxTrack *track1, SvtxTrack *track2, Acts::Vector3& pca1, Acts::Vector3& pca2, double& dca);
67  void findPcaTwoTracks(Acts::Vector3 pos1, Acts::Vector3 pos2, Acts::Vector3 mom1, Acts::Vector3 mom2, Acts::Vector3& pca1, Acts::Vector3& pca2, double& dca);
68 
69  int getNodes(PHCompositeNode* topNode);
70 
72 
73  bool projectTrackToCylinder(SvtxTrack* track, double Radius, Eigen::Vector3d& pos, Eigen::Vector3d& mom);
74  bool projectTrackToPoint(SvtxTrack* track, Eigen::Vector3d PCA, Eigen::Vector3d& pos, Eigen::Vector3d& mom);
75 
77 
78  TNtuple* ntp_reco_info = nullptr;
82 
84  Float_t decaymass = 0.13957; // pion decay mass
85  bool _require_mvtx = true;
86  double _qual_cut = 10.0;
87  double pair_dca_cut = 0.05; // kshort relative cut 500 microns
88  double track_dca_cut = 0.01;
89  double invariant_pt_cut = 0.1;
90  TFile* fout = nullptr;
91  TH1D* recomass = nullptr;
92 };
93 
94 #endif // KSHORTRECONSTRUCTION_H