Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:55:20

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