Back to home page

sPhenix code displayed by LXR

 
 

    


Warning, /coresoftware/offline/QA/SimulationModules/truthDecayTester.h.outdated is written in an unsupported language. File is not indexed.

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef GEANTTESTER_H
0004 #define GEANTTESTER_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <decayfinder/DecayFinderContainer_v1.h>  // for DecayFinderContainer_v1
0009 
0010 #include <g4main/PHG4Particle.h>
0011 #include <g4main/PHG4TruthInfoContainer.h>
0012 #include <g4main/PHG4VtxPoint.h>
0013 
0014 #include <TBranch.h>
0015 #include <TFile.h>
0016 #include <TTree.h>
0017 
0018 #include <string>
0019 
0020 class PHCompositeNode;
0021 class PHG4TruthInfoContainer;
0022 class PHG4Particle;
0023 class PHG4VtxPoint;
0024 
0025 class truthDecayTester : public SubsysReco
0026 {
0027  public:
0028   truthDecayTester(const std::string &name = "truthDecayTester");
0029 
0030   virtual ~truthDecayTester();
0031 
0032   /** Called during initialization.
0033       Typically this is where you can book histograms, and e.g.
0034       register them to Fun4AllServer (so they can be output to file
0035       using Fun4AllServer::dumpHistos() method).
0036    */
0037   int Init(PHCompositeNode *topNode) override;
0038 
0039   /** Called for each event.
0040       This is where you do the real work.
0041    */
0042   int process_event(PHCompositeNode *topNode) override;
0043 
0044   std::string get_histo_prefix();
0045 
0046   /// Called at the end of all processing.
0047   int End(PHCompositeNode *topNode) override;
0048 
0049   void setMotherPDG(int PDGID) { m_decay_pdg_id = PDGID; }
0050   void setMinPT(float value) { m_min_pt = value; }
0051   void setEtaRange(float min, float max)
0052   {
0053     m_min_eta = min;
0054     m_max_eta = max;
0055   }
0056   void setDFNodeName(const std::string &name) { m_df_module_name = name; }
0057   void setOutputName(const std::string &name) { m_outfile_name = name; }
0058   void writeTuple(bool write) { m_write_nTuple = write; }
0059 
0060  private:
0061   unsigned int m_nTracks;
0062   float m_min_pt;
0063   float m_min_eta;
0064   ;
0065   float m_max_eta;
0066   bool m_write_nTuple;
0067   int m_decay_pdg_id;
0068 
0069   PHG4TruthInfoContainer *m_truth_info;
0070   PHG4Particle *m_g4particle;
0071   std::string m_df_module_name;
0072   std::string m_outfile_name;
0073   TFile *m_outfile;
0074   TTree *m_tree;
0075   bool m_write_QAHists;
0076   DecayFinderContainer_v1 *m_decayMap = nullptr;
0077 
0078   void initializeBranches();
0079   void getMotherPDG(PHCompositeNode *topNode);
0080   std::vector<int> getDecayFinderMothers(PHCompositeNode *topNode);
0081   bool isInRange(float min, float value, float max);
0082   void resetValues();
0083 
0084   static const int max_tracks = 20;
0085   unsigned int m_event_number = 0;
0086   float m_mother_mass = -99;
0087   float m_daughter_sum_mass = 0;
0088   float m_mother_decayLength = -99;
0089   float m_mother_decayTime = -99;
0090   int m_mother_pdg_id = -99;
0091   float m_mother_px = 0;
0092   float m_mother_py = 0;
0093   float m_mother_pz = 0;
0094   float m_mother_pE = 0;
0095   float m_mother_pT = 0;
0096   float m_mother_eta = 0;
0097   int m_mother_barcode = -99;
0098   int m_track_pdg_id[max_tracks] = {0};
0099   float m_track_px[max_tracks] = {0};
0100   float m_track_py[max_tracks] = {0};
0101   float m_track_pz[max_tracks] = {0};
0102   float m_track_pE[max_tracks] = {0};
0103   float m_track_pT[max_tracks] = {0};
0104   float m_track_eta[max_tracks] = {0};
0105   float m_track_mass[max_tracks] = {0};
0106   int m_track_mother_barcode[max_tracks] = {0};
0107   float m_delta_px = 0;
0108   float m_delta_py = 0;
0109   float m_delta_pz = 0;
0110   float m_delta_pE = 0;
0111   bool m_accept_px_1percent = false;
0112   bool m_accept_py_1percent = false;
0113   bool m_accept_pz_1percent = false;
0114   bool m_accept_pE_1percent = false;
0115   bool m_accept_px_5percent = false;
0116   bool m_accept_py_5percent = false;
0117   bool m_accept_pz_5percent = false;
0118   bool m_accept_pE_5percent = false;
0119   bool m_accept_px_15percent = false;
0120   bool m_accept_py_15percent = false;
0121   bool m_accept_pz_15percent = false;
0122   bool m_accept_pE_15percent = false;
0123   bool m_accept_eta = true;
0124   bool m_accept_pT = true;
0125 };
0126 
0127 #endif  // GEANTTESTER_H