File indexing completed on 2025-10-31 09:23:17
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 #ifndef CHECKCLUSTPAREPPROCESSOR_H
0011 #define CHECKCLUSTPAREPPROCESSOR_H
0012 
0013 
0014 #include <string>
0015 #include <vector>
0016 #include <utility>
0017 
0018 #include <TH1.h>
0019 #include <TFile.h>
0020 
0021 #include <JANA/JEventProcessor.h>
0022 #include <JANA/JEventProcessorSequentialRoot.h>
0023 
0024 #include "services/rootfile/RootFile_service.h"
0025 
0026 #include <edm4eic/Cluster.h>
0027 #include <edm4eic/ClusterCollection.h>
0028 #include <edm4eic/MCRecoClusterParticleAssociation.h>
0029 #include <edm4eic/MCRecoClusterParticleAssociationCollection.h>
0030 #include <edm4hep/MCParticle.h>
0031 #include <edm4hep/MCParticleCollection.h>
0032 #include <edm4hep/Vector3f.h>
0033 #include <edm4hep/utils/vector_utils.h>
0034 
0035 using namespace std;
0036 
0037 
0038 
0039 
0040 
0041 class CheckClustParEPProcessor: public JEventProcessorSequentialRoot {
0042 
0043   
0044   struct Config {
0045     string sPlugin;
0046     string sMCPars;
0047     vector<pair<string, string>> sClustAndAssocs;
0048   } m_config = {
0049     "CheckClustParEP",
0050     "MCParticles",
0051     {
0052       make_pair("HcalEndcapNClusters", "HcalEndcapNClusterAssociations"),
0053       make_pair("EcalEndcapNClusters", "EcalEndcapNClusterAssociations"),
0054       make_pair("HcalBarrelClusters",  "HcalBarrelClusterAssociations"),
0055       make_pair("EcalBarrelClusters",  "EcalBarrelClusterAssociations"),
0056       make_pair("LFHCALClusters",      "LFHCALClusterAssociations"),
0057       make_pair("EcalEndcapPClusters", "EcalEndcapPClusterAssociations")
0058     }
0059   };  
0060 
0061   public:
0062 
0063     CheckClustParEPProcessor() { SetTypeName(NAME_OF_THIS); }
0064 
0065     void InitWithGlobalRootLock() override;
0066     void ProcessSequential(const std::shared_ptr<const JEvent>& event) override;
0067     void FinishWithGlobalRootLock() override;
0068 
0069   private:
0070 
0071     
0072     vector<TH1D*> m_vecHistEP;
0073 
0074 };
0075 
0076 #endif
0077 
0078