Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:30:54

0001 // ----------------------------------------------------------------------------
0002 // 'CheckClustParEPProcessor.h'
0003 // Derek Anderson
0004 // 05.07.2024
0005 //
0006 // A JANA plugin to check the E/p of calorimeter
0007 // clusters and their associated MCParticles
0008 // ----------------------------------------------------------------------------
0009 
0010 #ifndef CHECKCLUSTPAREPPROCESSOR_H
0011 #define CHECKCLUSTPAREPPROCESSOR_H
0012 
0013 // c++ utilities
0014 #include <string>
0015 #include <vector>
0016 #include <utility>
0017 // root libraries
0018 #include <TH1.h>
0019 #include <TFile.h>
0020 // jana libraries
0021 #include <JANA/JEventProcessor.h>
0022 #include <JANA/JEventProcessorSequentialRoot.h>
0023 // services
0024 #include "services/rootfile/RootFile_service.h"
0025 // edm types
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 // CheckClustParEPProcessor definition ----------------------------------------
0040 
0041 class CheckClustParEPProcessor: public JEventProcessorSequentialRoot {
0042 
0043   // struct to hold user options
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   };  // end Config
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     // output histograms
0072     vector<TH1D*> m_vecHistEP;
0073 
0074 };
0075 
0076 #endif
0077 
0078 // end ------------------------------------------------------------------------