File indexing completed on 2026-04-04 08:12:08
0001 #ifndef WHOLEEVENTEECS_H
0002 #define WHOLEEVENTEECS_H
0003
0004
0005 #include <fun4all/SubsysReco.h>
0006 #include <fun4all/Fun4AllBase.h>
0007 #include <fun4all/Fun4AllReturnCodes.h>
0008
0009
0010 #include <phool/PHCompositeNode.h>
0011 #include <phool/getClass.h>
0012
0013
0014 #include <calobase/TowerInfoContainer.h>
0015 #include <calobase/TowerInfoContainerv1.h>
0016 #include <calobase/TowerInfoContainerv2.h>
0017 #include <calobase/TowerInfov2.h>
0018 #include <calobase/TowerInfov1.h>
0019 #include <calobase/TowerInfo.h>
0020 #include <calobase/RawTowerDefs.h>
0021 #include <calobase/RawTowerGeomContainer.h>
0022 #include <calobase/RawTowerGeomContainer_Cylinderv1.h>
0023
0024
0025 #include <jetbase/JetContainer.h>
0026 #include <jetbase/JetContainerv1.h>
0027 #include <jetbase/JetMapv1.h>
0028 #include <jetbase/JetMap.h>
0029 #include <jetbase/Jetv1.h>
0030 #include <jetbase/Jetv2.h>
0031 #include <jetbase/Jet.h>
0032
0033
0034 #include <globalvertex/GlobalVertex.h>
0035 #include <globalvertex/GlobalVertexMap.h>
0036 #include <globalvertex/GlobalVertexMapv1.h>
0037 #include <globalvertex/MbdVertexMapv1.h>
0038
0039
0040 #include <ffarawobjects/Gl1Packetv2.h>
0041 #include <ffarawobjects/Gl1Packetv1.h>
0042 #include <calotrigger/TriggerAnalyzer.h>
0043 #include <calotrigger/TriggerRunInfov1.h>
0044
0045
0046 #include <TH1.h>
0047 #include <TFile.h>
0048
0049
0050 #include <array>
0051 #include <cmath>
0052 #include <string>
0053 #include <vector>
0054
0055 class PHCompositeNode;
0056 class Jet;
0057 class JetContainer;
0058
0059 class TriggerAnalyzer;
0060
0061 class wholeEventEECs : public SubsysReco
0062 {
0063 public:
0064
0065 wholeEventEECs(const std::string &name = "wholeEventEECs");
0066 ~wholeEventEECs() override = default;
0067
0068 int InitRun(PHCompositeNode *topNode) override;
0069
0070 int process_event(PHCompositeNode *topNode) override;
0071
0072 int End(PHCompositeNode *topNode) override;
0073
0074 void set_outputName(const std::string &name)
0075 {
0076 m_outputName = name;
0077 }
0078
0079 private:
0080
0081 const std::string obsNames[5] = {"dR","dEta","dPhi","theta","z"};
0082 const std::string obsSymbols[5] = {"#DeltaR","#Delta#eta","#Delta#phi","#theta","z=(1-cos#theta)/2"};
0083 const float obsMax[5] = {static_cast<float>(sqrt(2.2*2.2 + M_PI*M_PI)), 2.2, M_PI, M_PI, 1.0};
0084 const std::string caloNames[4] = {"EMCal","IHCal","OHCal","All"};
0085
0086 std::map<std::array<float, 3>, float> towers[4];
0087 std::map<std::array<float, 3>, float> towersCorrected[4];
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101 std::string m_outputName = "wholeEventEEC.root";
0102 TFile *m_outputFile{nullptr};
0103
0104 TH1D *nEvents{nullptr};
0105 TH1D *EEC[5][4]{nullptr};
0106 TH1D *EEC_corr[5][4]{nullptr};
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122 JetContainer *jets{nullptr};
0123
0124 TowerInfoContainer *towerInfoContainers[3]{nullptr};
0125 RawTowerGeomContainer_Cylinderv1 *geoms[3]{nullptr};
0126 RawTowerGeomContainer_Cylinderv1 *emcal_geom{nullptr};
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138 GlobalVertexMap *vtxMap{nullptr};
0139 GlobalVertex *vtx{nullptr};
0140
0141 float m_vtx_z{-999};
0142
0143 int m_eventIndex{-1};
0144 int m_nGoodEvents{0};
0145
0146 bool isGoodTrigger(PHCompositeNode *topNode);
0147
0148 bool isGoodDijet();
0149
0150 std::array<float, 3> correct_for_vertex(std::array<float, 3> center);
0151
0152 std::array<float, 5> calc_observables(std::map<std::array<float, 3>, float>::iterator &iterA, std::map<std::array<float, 3>, float>::iterator &iterB);
0153
0154 };
0155 #endif