Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-06 08:34:51

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 femc_studiesProcessor : public JEventProcessor {
0020 public:
0021   femc_studiesProcessor() { SetTypeName(NAME_OF_THIS); }
0022 
0023   void Init() override;
0024   //     void InitWithGlobalRootLock() override;
0025   void Process(const std::shared_ptr<const JEvent>& event) override;
0026   //     void ProcessSequential(const std::shared_ptr<const JEvent>& event) override;
0027   //     void FinishWithGlobalRootLock() override;
0028   void Finish() 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   TH3D* hClusterESimcalib_E_eta;
0037   TH3D* hClusterSimNCells_E_eta;
0038   TH3D* hClusterESimcalib_E_phi;
0039   TH2D* hCellESim_layerX;
0040   TH2D* hCellESim_layerY;
0041   TH2D* hCellTSim_layerX;
0042   TH2D* hPosCaloSimHitsXY;
0043   TH3D* hRecClusterEcalib_E_eta;
0044   TH3D* hRecNClusters_E_eta;
0045   TH3D* hRecClusterEcalib_Ehigh_eta;
0046   TH3D* hRecClusterNCells_Ehigh_eta;
0047   TH3D* hRecFClusterEcalib_E_eta;
0048   TH3D* hRecFNClusters_E_eta;
0049   TH3D* hRecFClusterEcalib_Ehigh_eta;
0050   TH3D* hRecFClusterNCells_Ehigh_eta;
0051   TH2D* hSamplingFractionEta;
0052 
0053   bool enableTree = false;
0054   TTree* event_tree;
0055   const int maxNTowers = 65000;
0056   int t_fEMC_towers_N;
0057   short* t_fEMC_towers_cellIDx;
0058   short* t_fEMC_towers_cellIDy;
0059   short* t_fEMC_towers_clusterIDA;
0060   short* t_fEMC_towers_clusterIDB;
0061   float* t_fEMC_towers_cellE;
0062   float* t_fEMC_towers_cellT;
0063   int* t_fEMC_towers_cellTrueID;
0064 
0065   bool enableTreeCluster = false;
0066   TTree* cluster_tree;
0067   const int maxNCluster = 50;
0068   const int maxNMC      = 50;
0069   int t_mc_N;
0070   float* t_mc_E;
0071   float* t_mc_Phi;
0072   float* t_mc_Eta;
0073   int t_fEMC_clusters_N;
0074   float* t_fEMC_cluster_E;
0075   int* t_fEMC_cluster_NCells;
0076   float* t_fEMC_cluster_Phi;
0077   float* t_fEMC_cluster_Eta;
0078 
0079   int nEventsWithCaloHits = 0;
0080   std::shared_ptr<spdlog::logger> m_log;
0081   dd4hep::DDSegmentation::BitFieldCoder* m_decoder;
0082   std::string nameSimHits       = "EcalEndcapPHits";
0083   std::string nameRecHits       = "EcalEndcapPRecHits";
0084   std::string nameClusters      = "EcalEndcapPClusters";
0085   std::string nameProtoClusters = "EcalEndcapPIslandProtoClusters";
0086   short iLx;
0087   short iLy;
0088 };