File indexing completed on 2025-08-05 08:11:15
0001
0002
0003 #ifndef CEMCRECO_H
0004 #define CEMCRECO_H
0005
0006 #include <fun4all/SubsysReco.h>
0007 #include <HepMC/SimpleVector.h>
0008 #include <vector>
0009
0010 class PHCompositeNode;
0011
0012 class TH1F;
0013 class TH3F;
0014 class TH2F;
0015 class TH2I;
0016 class TString;
0017
0018 class RawClusterContainer;
0019 class RawCluster;
0020 class RawTowerGeomContainer;
0021 class RawTowerContainer;
0022 class RawTower;
0023
0024 class SvtxTrackMap;
0025
0026 class GlobalVertexMap;
0027 class GlobalVertex;
0028
0029 class Fun4AllHistoManager;
0030 class TFile;
0031 class PHG4TruthInfoContainer;
0032 class PHG4Particle;
0033 class PHG4VtxPoint;
0034 class CaloEvalStack;
0035
0036
0037
0038 const int nEtaBins = 5;
0039
0040
0041 class cemcReco : public SubsysReco
0042 {
0043 public:
0044
0045 cemcReco(const std::string &name, const std::string &outName);
0046
0047 ~cemcReco() override;
0048
0049
0050
0051
0052
0053
0054 int Init(PHCompositeNode *topNode) override;
0055
0056
0057
0058
0059
0060
0061 int InitRun(PHCompositeNode *topNode) override;
0062
0063
0064
0065
0066 int process_event(PHCompositeNode *topNode) override;
0067
0068
0069 int ResetEvent(PHCompositeNode *topNode) override;
0070
0071
0072 int EndRun(const int runnumber) override;
0073
0074
0075 int End(PHCompositeNode *topNode) override;
0076
0077
0078 int Reset(PHCompositeNode * ) override;
0079
0080 void Print(const std::string &what = "ALL") const override;
0081
0082 private:
0083
0084 int nEvent;
0085 std::string Outfile;
0086
0087
0088 float calculateTSP(RawCluster *cluster, RawClusterContainer *cluster_container, RawTowerContainer *towerContainer, RawTowerGeomContainer *towerGeo, GlobalVertex *vtx);
0089 float coneSum(RawCluster *cluster, RawClusterContainer *cluster_container, SvtxTrackMap *trackmap, float coneradius, GlobalVertex *vtx);
0090 void letsSumw2();
0091 float getpT(PHG4Particle *particle);
0092 float FindTruthPhoton(float cluster_eta, float cluster_phi, float cluster_energy, PHG4TruthInfoContainer* particle);
0093 float getEta(PHG4Particle *particle);
0094 float getPhi(PHG4Particle *particle);
0095 bool compareVertices(HepMC::FourVector hepMCvtx, PHG4VtxPoint *g4vtx );
0096 bool checkBarcode(int motherBarcode, std::vector<int> &motherBarcodes);
0097 bool checkBarcode(int motherBarcode, std::vector<PHG4Particle*> &motherBarcodes);
0098
0099 int getEtaBin(float eta);
0100
0101
0102 CaloEvalStack *caloevalstack;
0103
0104
0105
0106 TH3F *ePi0InvMassEcut[2][nEtaBins];
0107 TH1F *photonE;
0108 TH1F *clusterDisp;
0109 TH2F *clusterChi2;
0110 TH2F *clusterProbPhoton;
0111 TH1F *isoPhoE;
0112 TH2F *isoPhoChi2;
0113 TH2F *isoPhoProb;
0114 TH3F *deltaR_E_invMass;
0115 TH3F *asym_E_invMass;
0116 TH2F *tsp_E;
0117 TH2F *tsp_E_iso;
0118 TH1F *truth_pi0_E[nEtaBins];
0119 TH1F *truth_eta_E;
0120 TH1F *truth_dpho_E;
0121 TH1F *pi0E_truth_reco;
0122 TH2F *deltaR_E_truth_pi0;
0123 TH3F *invMass_eta;
0124 TH3F *dPhoChi2;
0125 TH3F *dPhoProb;
0126 TH3F *pi0Chi2;
0127 TH3F *pi0Prob;
0128 TH3F *etaChi2;
0129 TH3F *etaProb;
0130 TH3F *electronChi2;
0131 TH3F *electronProb;
0132 TH3F *hadronChi2;
0133 TH3F *hadronProb;
0134 TH2F *etaFrac;
0135 TH2F *pi0Frac;
0136 TH3F *unmatchedLocale;
0137 TH1F *unmatchedE;
0138 TH3F *invMassPhoPi0;
0139 TH3F *invMassEPhi;
0140
0141
0142 TH2F *eFrac_dr_primary;
0143 TH2F *eFrac_dr_secondary;
0144
0145 TH2F *asym_E_truth_pi0;
0146
0147
0148
0149 Fun4AllHistoManager *hm = nullptr;
0150
0151
0152 TFile *out;
0153
0154 const float pi = 3.1415926;
0155 float trackErrorCount;
0156 };
0157
0158 #endif