Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-09 08:30:21

0001 // Copyright 2023, Friederike Bock
0002 // Subject to the terms in the LICENSE file found in the top-level directory.
0003 //
0004 //  Sections Copyright (C) 2023 Friederike Bock
0005 //  under SPDX-License-Identifier: LGPL-3.0-or-later
0006 
0007 #include <DDSegmentation/BitFieldCoder.h>
0008 #include <JANA/JEvent.h>
0009 #include <JANA/JEventProcessor.h>
0010 #include <JANA/Utils/JTypeInfo.h>
0011 #include <TDirectory.h>
0012 #include <TH2.h>
0013 #include <TH3.h>
0014 #include <TTree.h>
0015 #include <spdlog/logger.h>
0016 #include <memory>
0017 #include <string>
0018 
0019 class lfhcal_studiesProcessor : public JEventProcessor {
0020 public:
0021   lfhcal_studiesProcessor() { SetTypeName(NAME_OF_THIS); }
0022 
0023   void Init() override;
0024   //     void InitWithGlobalRootLock() override;
0025   //     void ProcessSequential(const std::shared_ptr<const JEvent>& event) override;
0026   void Process(const std::shared_ptr<const JEvent>& event) override;
0027   void Finish() override;
0028   //     void FinishWithGlobalRootLock() override;
0029   TDirectory* m_dir_main;
0030   // Declare histogram and tree pointers here. e.g.
0031   TH2D* hMCEnergyVsEta;
0032   TH3D* hClusterEcalib_E_eta;
0033   TH3D* hClusterNCells_E_eta;
0034   TH3D* hClusterEcalib_E_phi;
0035   TH2D* hPosCaloHitsXY;
0036   TH2D* hPosCaloHitsZX;
0037   TH2D* hPosCaloHitsZY;
0038   TH3D* hClusterESimcalib_E_eta;
0039   TH3D* hClusterSimNCells_E_eta;
0040   TH3D* hClusterESimcalib_E_phi;
0041   TH2D* hCellESim_layerZ;
0042   TH2D* hCellESim_layerX;
0043   TH2D* hCellESim_layerY;
0044   TH2D* hCellTSim_layerZ;
0045   TH2D* hPosCaloSimHitsXY;
0046   TH2D* hPosCaloSimHitsZX;
0047   TH2D* hPosCaloSimHitsZY;
0048   TH3D* hRecClusterEcalib_E_eta;
0049   TH3D* hRecNClusters_E_eta;
0050   TH3D* hRecClusterEcalib_Ehigh_eta;
0051   TH3D* hRecClusterNCells_Ehigh_eta;
0052   TH3D* hRecFClusterEcalib_E_eta;
0053   TH3D* hRecFNClusters_E_eta;
0054   TH3D* hRecFClusterEcalib_Ehigh_eta;
0055   TH3D* hRecFClusterNCells_Ehigh_eta;
0056   TH3D* hRecFEmClusterEcalib_E_eta;
0057   TH3D* hRecFEmNClusters_E_eta;
0058   TH3D* hRecFEmClusterEcalib_Ehigh_eta;
0059   TH2D* hSamplingFractionEta;
0060 
0061   bool enableTree = true;
0062   TTree* event_tree;
0063   const int maxNTowers = 65000;
0064   int t_lFHCal_towers_N;
0065   short* t_lFHCal_towers_cellIDx;
0066   short* t_lFHCal_towers_cellIDy;
0067   short* t_lFHCal_towers_cellIDz;
0068   short* t_lFHCal_towers_clusterIDA;
0069   short* t_lFHCal_towers_clusterIDB;
0070   float* t_lFHCal_towers_cellE;
0071   float* t_lFHCal_towers_cellT;
0072   int* t_lFHCal_towers_cellTrueID;
0073 
0074   bool enableTreeCluster = true;
0075   bool enableECalCluster = true;
0076   TTree* cluster_tree;
0077   const int maxNCluster = 50;
0078   const int maxNMC      = 50;
0079   int t_mc_N;
0080   float* t_mc_E;
0081   float* t_mc_Phi;
0082   float* t_mc_Eta;
0083   int t_lFHCal_clusters_N;
0084   float* t_lFHCal_cluster_E;
0085   int* t_lFHCal_cluster_NCells;
0086   float* t_lFHCal_cluster_Phi;
0087   float* t_lFHCal_cluster_Eta;
0088   int t_fEMC_clusters_N;
0089   float* t_fEMC_cluster_E;
0090   int* t_fEMC_cluster_NCells;
0091   float* t_fEMC_cluster_Phi;
0092   float* t_fEMC_cluster_Eta;
0093 
0094   int nEventsWithCaloHits = 0;
0095   bool isLFHCal           = true;
0096   std::shared_ptr<spdlog::logger> m_log;
0097   dd4hep::DDSegmentation::BitFieldCoder* m_decoder;
0098   std::string nameSimHits       = "LFHCALHits";
0099   std::string nameRecHits       = "LFHCALRecHits";
0100   std::string nameClusters      = "LFHCALClusters";
0101   std::string nameProtoClusters = "LFHCALIslandProtoClusters";
0102   short iPassive;
0103   short iLx;
0104   short iLy;
0105   short iLz;
0106 };