Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:18:08

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef CALOONLY_H
0004 #define CALOONLY_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <calobase/RawTowerContainer.h>
0009 #include <calobase/RawTower.h> 
0010 #include <calobase/RawClusterContainer.h>
0011 #include <calobase/RawTowerGeomContainer.h>
0012 #include <calobase/RawCluster.h>
0013 #include <calobase/RawClusterUtility.h>
0014 #include <calobase/RawTowerDefs.h>
0015 #include <calobase/RawTowerGeom.h>
0016 #include <calobase/TowerInfoContainer.h>
0017 #include <calobase/TowerInfo.h>
0018 #include <calobase/TowerInfoDefs.h>
0019 
0020 #include <fun4all/Fun4AllReturnCodes.h>
0021 
0022 #include <globalvertex/GlobalVertex.h>
0023 #include <globalvertex/GlobalVertexMap.h>
0024 #include <globalvertex/SvtxVertexMap.h>
0025 #include <globalvertex/SvtxVertex.h>
0026 
0027 #include <phool/getClass.h>
0028 #include <phool/PHCompositeNode.h>
0029 
0030 #include <trackbase/TrkrCluster.h>
0031 #include <trackbase/TrkrClusterContainer.h>
0032 #include <trackbase/TrkrDefs.h>
0033 #include <trackbase_historic/SvtxTrackMap.h>
0034 #include <trackbase_historic/SvtxTrackState_v1.h>
0035 #include <trackbase_historic/TrackSeedContainer.h>
0036 #include <trackbase_historic/TrackSeed.h>
0037 #include <trackreco/ActsPropagator.h>
0038 
0039 #include <Acts/Geometry/GeometryIdentifier.hpp>
0040 #include <Acts/MagneticField/ConstantBField.hpp>
0041 #include <Acts/MagneticField/MagneticFieldProvider.hpp>
0042 #include <Acts/Surfaces/CylinderSurface.hpp>
0043 #include <Acts/Surfaces/PerigeeSurface.hpp>
0044 #include <Acts/Geometry/TrackingGeometry.hpp>
0045 
0046 #include <CLHEP/Vector/ThreeVector.h>
0047 #include <math.h>
0048 #include <vector>
0049 
0050 #include <TFile.h>
0051 #include <TTree.h>
0052 #include <TH1F.h>
0053 #include <TH2F.h>
0054 
0055 #include <string>
0056 #include <vector>
0057 
0058 class PHCompositeNode;
0059 class TH1;
0060 class TH2;
0061 class TFile;
0062 class TTree;
0063 
0064 class CaloOnly : public SubsysReco
0065 {
0066  public:
0067 
0068   CaloOnly(const std::string &name = "CaloOnly", const std::string &file = "output.root");
0069 
0070   ~CaloOnly() override;
0071 
0072   /** Called during initialization.
0073       Typically this is where you can book histograms, and e.g.
0074       register them to Fun4AllServer (so they can be output to file
0075       using Fun4AllServer::dumpHistos() method).
0076    */
0077   int Init(PHCompositeNode *topNode) override;
0078 
0079   /** Called for each event.
0080       This is where you do the real work.
0081    */
0082   int process_event(PHCompositeNode *topNode) override;
0083 
0084   /// Called at the end of all processing.
0085   int End(PHCompositeNode *topNode) override;
0086 
0087   void ResetTreeVectors();
0088   void FillTree();
0089 
0090 private:
0091     std::string _outfilename;
0092     TFile *_outfile = nullptr;
0093     TTree *_tree = nullptr;
0094 
0095     std::vector<float> _mbd_z;
0096 
0097     std::vector<float> _run_test;
0098     // EMCal tower vectors
0099     std::vector<float> _emcalgeo_id;
0100     std::vector<float> _emcalgeo_phibin;
0101     std::vector<float> _emcalgeo_etabin;
0102 
0103     std::vector<float> _emcal_e;
0104     std::vector<float> _emcal_phi;
0105     std::vector<float> _emcal_eta;
0106     std::vector<int>   _emcal_iphi;
0107     std::vector<int>   _emcal_ieta;
0108     std::vector<float> _emcal_time;
0109     std::vector<float> _emcal_chi2;
0110     std::vector<float> _emcal_pedestal;
0111     // IHCAL tower vectors
0112     std::vector<float> _ihcal_e;
0113     std::vector<float> _ihcal_phi;
0114     std::vector<float> _ihcal_eta;
0115     std::vector<int>   _ihcal_iphi;
0116     std::vector<int>   _ihcal_ieta;
0117     
0118     std::vector<float> _ihcal_time;
0119     std::vector<float> _ihcal_chi2;
0120     std::vector<float> _ihcal_pedestal;
0121     // OHCAL tower vectors
0122     std::vector<float> _ohcal_e;
0123     std::vector<float> _ohcal_phi;
0124     std::vector<float> _ohcal_eta;
0125     std::vector<int>   _ohcal_iphi;
0126     std::vector<int>   _ohcal_ieta;
0127     std::vector<float> _ohcal_time;
0128     std::vector<float> _ohcal_chi2;
0129     std::vector<float> _ohcal_pedestal;
0130 
0131     // EMCal cluster information
0132     std::vector<int>   _emcal_cluster_id;
0133     std::vector<float> _emcal_cluster_e;
0134     std::vector<float> _emcal_cluster_phi;
0135     std::vector<float> _emcal_cluster_eta;
0136     std::vector<float> _emcal_cluster_x;
0137     std::vector<float> _emcal_cluster_y;
0138     std::vector<float> _emcal_cluster_z;
0139     std::vector<float> _emcal_cluster_R;
0140     std::vector<float> _emcal_cluster_ecore;
0141     std::vector<float> _emcal_cluster_chi2;
0142     std::vector<float> _emcal_cluster_prob;
0143     // EMCal full cluster corrections
0144     std::vector<float> _emcal_clusfull_e;
0145     std::vector<float> _emcal_clusfull_eta;
0146     std::vector<float> _emcal_clusfull_phi;
0147     std::vector<float> _emcal_clusfull_x;
0148     std::vector<float> _emcal_clusfull_y;
0149     std::vector<float> _emcal_clusfull_z;
0150     std::vector<float> _emcal_clusfull_R;
0151     std::vector<float> _emcal_clusfull_pt;
0152     // EMCal core cluster corrections
0153     std::vector<float> _emcal_cluscore_e;
0154     std::vector<float> _emcal_cluscore_eta;
0155     std::vector<float> _emcal_cluscore_phi;
0156     std::vector<float> _emcal_cluscore_x;
0157     std::vector<float> _emcal_cluscore_y;
0158     std::vector<float> _emcal_cluscore_z;
0159     std::vector<float> _emcal_cluscore_R;
0160     std::vector<float> _emcal_cluscore_pt;
0161 
0162     RawTowerGeomContainer* towerGeom;
0163 
0164     RawClusterContainer * clustersEM;
0165     RawClusterContainer * clustersIH;
0166     RawClusterContainer * clustersOH;
0167 
0168     TowerInfoContainer * EMCAL_Container;
0169     TowerInfoContainer * IHCAL_Container;
0170     TowerInfoContainer * OHCAL_Container;
0171 
0172     RawTowerGeomContainer * EMCalGeo;
0173     RawTowerGeomContainer * IHCalGeo;
0174     RawTowerGeomContainer * OHCalGeo;
0175 
0176     RawTowerContainer * EMCal_RawTowerContainer;
0177 
0178     double m_emcal_e_low_cut = 0.1;
0179 };
0180 
0181 #endif // CALOONLY_H