-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[HGCAL trigger] Migration to new code structure - First pass #36337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e1cf889
Framework development for ability to run emualtors of specific FW blo…
EmyrClement 5755c24
Add tower eta and phi to standalone implementation
EmyrClement 63c4c40
Add custom function and test config for standalone clustering
jbsauvan 630a39a
Stage 1 sorting and truncation per r/z bin and FPGA
jbsauvan 5f6729c
Refactor trigger chains
jbsauvan 4f5f512
sorting and truncation module for the emulator
snwebb ed7f730
Distribution of trigger cells to stage 2 FPGAs
snwebb 23b9ca4
Add new trigger link mapping file for updated backend
snwebb f083229
Switch default trigger geometry to Imp3
jbsauvan 89b394b
New backend stage 1 producer/processor
portalesHEP 0bfc9f1
Updates and fixes of geometry tester
jbsauvan dfad877
standalone version of backend stage1 truncation
portalesHEP b36ebff
remove eventSetup in new processors, wrappers and algos
jbsauvan fc77fa5
Implement comments PR#36337
jbsauvan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #ifndef __L1Trigger_L1THGCal_HGCalAlgoWrapperBase_h__ | ||
| #define __L1Trigger_L1THGCal_HGCalAlgoWrapperBase_h__ | ||
|
|
||
| #include "L1Trigger/L1THGCal/interface/HGCalAlgoWrapperBaseT.h" | ||
| #include "L1Trigger/L1THGCal/interface/HGCalTriggerGeometryBase.h" | ||
| #include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
|
||
| #include "DataFormats/L1THGCal/interface/HGCalCluster.h" | ||
| #include "DataFormats/L1THGCal/interface/HGCalMulticluster.h" | ||
|
|
||
| #include "DataFormats/L1THGCal/interface/HGCalTowerMap.h" | ||
|
|
||
| typedef HGCalAlgoWrapperBaseT< | ||
| std::pair<const std::vector<edm::Ptr<l1t::HGCalCluster>>, const std::vector<std::pair<GlobalPoint, double>>>, | ||
| std::pair<l1t::HGCalMulticlusterBxCollection&, l1t::HGCalClusterBxCollection&>, | ||
| std::pair<const HGCalTriggerGeometryBase* const, const edm::ParameterSet&>> | ||
| HGCalHistoClusteringWrapperBase; | ||
|
|
||
| typedef HGCalAlgoWrapperBaseT<std::vector<edm::Ptr<l1t::HGCalTowerMap>>, | ||
| l1t::HGCalTowerBxCollection, | ||
| std::pair<const HGCalTriggerGeometryBase* const, const edm::ParameterSet&>> | ||
| HGCalTowerMapsWrapperBase; | ||
|
|
||
| typedef HGCalAlgoWrapperBaseT<l1t::HGCalMulticlusterBxCollection, | ||
| l1t::HGCalMulticlusterBxCollection, | ||
| std::pair<const HGCalTriggerGeometryBase* const, const edm::ParameterSet&>> | ||
| HGCalStage2FilteringWrapperBase; | ||
|
|
||
| typedef HGCalAlgoWrapperBaseT<std::vector<edm::Ptr<l1t::HGCalTriggerCell>>, | ||
| std::vector<edm::Ptr<l1t::HGCalTriggerCell>>, | ||
| std::tuple<const HGCalTriggerGeometryBase* const, const unsigned&, const uint32_t&>> | ||
| HGCalStage1TruncationWrapperBase; | ||
|
|
||
| #include "FWCore/PluginManager/interface/PluginFactory.h" | ||
| typedef edmplugin::PluginFactory<HGCalHistoClusteringWrapperBase*(const edm::ParameterSet&)> | ||
| HGCalHistoClusteringWrapperBaseFactory; | ||
| typedef edmplugin::PluginFactory<HGCalTowerMapsWrapperBase*(const edm::ParameterSet&)> HGCalTowerMapsWrapperBaseFactory; | ||
| typedef edmplugin::PluginFactory<HGCalStage2FilteringWrapperBase*(const edm::ParameterSet&)> | ||
| HGCalStage2FilteringWrapperBaseFactory; | ||
| typedef edmplugin::PluginFactory<HGCalStage1TruncationWrapperBase*(const edm::ParameterSet&)> | ||
| HGCalStage1TruncationWrapperBaseFactory; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #ifndef __L1Trigger_L1THGCal_HGCalAlgoWrapperBaseT_h__ | ||
| #define __L1Trigger_L1THGCal_HGCalAlgoWrapperBaseT_h__ | ||
|
|
||
| #include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
| #include <string> | ||
|
|
||
| template <typename InputCollection, typename OutputCollection, typename Tparam> | ||
| class HGCalAlgoWrapperBaseT { | ||
| public: | ||
| HGCalAlgoWrapperBaseT(const edm::ParameterSet& conf) : name_(conf.getParameter<std::string>("AlgoName")) {} | ||
|
|
||
| virtual ~HGCalAlgoWrapperBaseT() {} | ||
|
|
||
| virtual void configure(const Tparam& parameters) = 0; | ||
| virtual void process(const InputCollection& inputCollection, OutputCollection& outputCollection) const = 0; | ||
|
|
||
| const std::string& name() const { return name_; } | ||
|
|
||
| private: | ||
| const std::string name_; | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
L1Trigger/L1THGCal/interface/backend/HGCalBackendLayer1Processor.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #ifndef __L1Trigger_L1THGCal_HGCalBackendLayer1Processor_h__ | ||
| #define __L1Trigger_L1THGCal_HGCalBackendLayer1Processor_h__ | ||
|
|
||
| #include "L1Trigger/L1THGCal/interface/HGCalProcessorBase.h" | ||
|
|
||
| #include "DataFormats/L1THGCal/interface/HGCalTriggerCell.h" | ||
| #include "DataFormats/L1THGCal/interface/HGCalCluster.h" | ||
|
|
||
| #include "L1Trigger/L1THGCal/interface/backend/HGCalStage1TruncationImpl.h" | ||
| #include "L1Trigger/L1THGCal/interface/backend/HGCalClusteringDummyImpl.h" | ||
|
|
||
| class HGCalBackendLayer1Processor : public HGCalBackendLayer1ProcessorBase { | ||
| public: | ||
| HGCalBackendLayer1Processor(const edm::ParameterSet& conf); | ||
|
|
||
| void run(const edm::Handle<l1t::HGCalTriggerCellBxCollection>& collHandle, | ||
| l1t::HGCalClusterBxCollection& collCluster2D) override; | ||
|
|
||
| private: | ||
| std::unique_ptr<HGCalClusteringDummyImpl> clusteringDummy_; | ||
| std::unique_ptr<HGCalStage1TruncationImpl> truncation_; | ||
| }; | ||
|
|
||
| #endif |
25 changes: 25 additions & 0 deletions
25
L1Trigger/L1THGCal/interface/backend/HGCalBackendStage1Processor.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #ifndef __L1Trigger_L1THGCal_HGCalBackendStage1Processor_h__ | ||
| #define __L1Trigger_L1THGCal_HGCalBackendStage1Processor_h__ | ||
|
|
||
| #include "L1Trigger/L1THGCal/interface/HGCalProcessorBase.h" | ||
| #include "L1Trigger/L1THGCal/interface/HGCalAlgoWrapperBase.h" | ||
|
|
||
| #include "DataFormats/L1THGCal/interface/HGCalTriggerCell.h" | ||
| #include "DataFormats/L1THGCal/interface/HGCalCluster.h" | ||
|
|
||
| #include "L1Trigger/L1THGCal/interface/backend/HGCalStage1TruncationImpl.h" | ||
| #include "L1Trigger/L1THGCal/interface/backend/HGCalClusteringDummyImpl.h" | ||
|
|
||
| class HGCalBackendStage1Processor : public HGCalBackendStage1ProcessorBase { | ||
| public: | ||
| HGCalBackendStage1Processor(const edm::ParameterSet& conf); | ||
|
|
||
| void run(const std::pair<uint32_t, std::vector<edm::Ptr<l1t::HGCalTriggerCell>>>& fpga_id_tcs, | ||
| std::vector<edm::Ptr<l1t::HGCalTriggerCell>>& truncated_tcs) override; | ||
|
|
||
| private: | ||
| std::unique_ptr<HGCalStage1TruncationWrapperBase> truncationWrapper_; | ||
| const edm::ParameterSet conf_; | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #ifndef L1Trigger_L1THGCal_HGCalCluster_SA_h | ||
| #define L1Trigger_L1THGCal_HGCalCluster_SA_h | ||
|
|
||
| #include <vector> | ||
|
|
||
| namespace l1thgcfirmware { | ||
|
|
||
| class HGCalCluster { | ||
| public: | ||
| HGCalCluster(float x, | ||
| float y, | ||
| float z, | ||
| int zside, | ||
| unsigned int layer, | ||
| float eta, | ||
| float phi, | ||
| float pt, | ||
| float mipPt, | ||
| unsigned int index_cmssw) | ||
| : x_(x), | ||
| y_(y), | ||
| z_(z), | ||
| zside_(zside), | ||
| layer_(layer), | ||
| eta_(eta), | ||
| phi_(phi), | ||
| pt_(pt), | ||
| mipPt_(mipPt), | ||
| index_cmssw_(index_cmssw) {} | ||
|
|
||
| ~HGCalCluster() = default; | ||
|
|
||
| float x() const { return x_; } | ||
| float y() const { return y_; } | ||
| float z() const { return z_; } | ||
| float zside() const { return zside_; } | ||
| unsigned int layer() const { return layer_; } | ||
| float eta() const { return eta_; } | ||
| float phi() const { return phi_; } | ||
| float pt() const { return pt_; } | ||
| float mipPt() const { return mipPt_; } | ||
| unsigned int index_cmssw() const { return index_cmssw_; } | ||
|
|
||
| private: | ||
| float x_; | ||
| float y_; | ||
| float z_; | ||
| int zside_; | ||
| unsigned int layer_; | ||
| float eta_; | ||
| float phi_; | ||
| float pt_; | ||
| float mipPt_; | ||
| unsigned int index_cmssw_; | ||
| }; | ||
|
|
||
| typedef std::vector<HGCalCluster> HGCalClusterSACollection; | ||
|
|
||
| } // namespace l1thgcfirmware | ||
|
|
||
| #endif |
56 changes: 56 additions & 0 deletions
56
L1Trigger/L1THGCal/interface/backend/HGCalHistoClusteringConfig_SA.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| #ifndef __L1Trigger_L1THGCal_HGCalHistoCluteringConfig_SA_h__ | ||
| #define __L1Trigger_L1THGCal_HGCalHistoCluteringConfig_SA_h__ | ||
|
|
||
| #include <vector> | ||
|
|
||
| namespace l1thgcfirmware { | ||
|
|
||
| class ClusterAlgoConfig { | ||
| public: | ||
| ClusterAlgoConfig(const double midRadius, | ||
| const double dr, | ||
| const std::vector<double>& dr_byLayer_coefficientA, | ||
| const std::vector<double>& dr_byLayer_coefficientB, | ||
| const float ptC3dThreshold) | ||
| : midRadius_(midRadius), | ||
| dr_(dr), | ||
| dr_byLayer_coefficientA_(dr_byLayer_coefficientA), | ||
| dr_byLayer_coefficientB_(dr_byLayer_coefficientB), | ||
| ptC3dThreshold_(ptC3dThreshold) {} | ||
|
|
||
| void setParameters(double midRadius, | ||
| double dr, | ||
| const std::vector<double>& dr_byLayer_coefficientA, | ||
| const std::vector<double>& dr_byLayer_coefficientB, | ||
| float ptC3dThreshold) { | ||
| midRadius_ = midRadius; | ||
| dr_ = dr; | ||
| dr_byLayer_coefficientA_ = dr_byLayer_coefficientA; | ||
| dr_byLayer_coefficientB_ = dr_byLayer_coefficientB; | ||
| ptC3dThreshold_ = ptC3dThreshold; | ||
| } | ||
|
|
||
| void setParameters(const ClusterAlgoConfig& newConfig) { | ||
| setParameters(newConfig.midRadius(), | ||
| newConfig.dr(), | ||
| newConfig.dr_byLayer_coefficientA(), | ||
| newConfig.dr_byLayer_coefficientB(), | ||
| newConfig.ptC3dThreshold()); | ||
| } | ||
| double midRadius() const { return midRadius_; } | ||
| double dr() const { return dr_; } | ||
| const std::vector<double>& dr_byLayer_coefficientA() const { return dr_byLayer_coefficientA_; } | ||
| const std::vector<double>& dr_byLayer_coefficientB() const { return dr_byLayer_coefficientB_; } | ||
| float ptC3dThreshold() const { return ptC3dThreshold_; } | ||
|
|
||
| private: | ||
| double midRadius_; | ||
| double dr_; | ||
| std::vector<double> dr_byLayer_coefficientA_; | ||
| std::vector<double> dr_byLayer_coefficientB_; | ||
| float ptC3dThreshold_; | ||
| }; | ||
|
|
||
| } // namespace l1thgcfirmware | ||
|
|
||
| #endif | ||
33 changes: 33 additions & 0 deletions
33
L1Trigger/L1THGCal/interface/backend/HGCalHistoClusteringImpl_SA.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #ifndef __L1Trigger_L1THGCal_HGCalHistoClusteringImplSA_h__ | ||
| #define __L1Trigger_L1THGCal_HGCalHistoClusteringImplSA_h__ | ||
|
|
||
| #include "L1Trigger/L1THGCal/interface/backend/HGCalCluster_SA.h" | ||
| #include "L1Trigger/L1THGCal/interface/backend/HGCalSeed_SA.h" | ||
| #include "L1Trigger/L1THGCal/interface/backend/HGCalMulticluster_SA.h" | ||
| #include "L1Trigger/L1THGCal/interface/backend/HGCalHistoClusteringConfig_SA.h" | ||
|
|
||
| #include <string> | ||
| #include <vector> | ||
| #include <memory> | ||
|
|
||
| class HGCalHistoClusteringImplSA { | ||
| public: | ||
| HGCalHistoClusteringImplSA() = default; | ||
| ~HGCalHistoClusteringImplSA() = default; | ||
|
|
||
| void runAlgorithm() const; | ||
|
|
||
| std::vector<l1thgcfirmware::HGCalMulticluster> clusterSeedMulticluster_SA( | ||
| const std::vector<l1thgcfirmware::HGCalCluster>& clusters, | ||
| const std::vector<l1thgcfirmware::HGCalSeed>& seeds, | ||
| std::vector<l1thgcfirmware::HGCalCluster>& rejected_clusters, | ||
| const l1thgcfirmware::ClusterAlgoConfig& configuration) const; | ||
|
|
||
| void finalizeClusters_SA(const std::vector<l1thgcfirmware::HGCalMulticluster>&, | ||
| const std::vector<l1thgcfirmware::HGCalCluster>&, | ||
| std::vector<l1thgcfirmware::HGCalMulticluster>&, | ||
| std::vector<l1thgcfirmware::HGCalCluster>&, | ||
| const l1thgcfirmware::ClusterAlgoConfig& configuration) const; | ||
| }; | ||
|
|
||
| #endif |
57 changes: 57 additions & 0 deletions
57
L1Trigger/L1THGCal/interface/backend/HGCalMulticluster_SA.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #ifndef L1Trigger_L1THGCal_HGCalMulticluster_SA_h | ||
| #define L1Trigger_L1THGCal_HGCalMulticluster_SA_h | ||
|
|
||
| #include "L1Trigger/L1THGCal/interface/backend/HGCalCluster_SA.h" | ||
|
|
||
| #include <vector> | ||
|
|
||
| namespace l1thgcfirmware { | ||
|
|
||
| class HGCalMulticluster { | ||
| public: | ||
| HGCalMulticluster() | ||
| : centre_x_(0), | ||
| centre_y_(0), | ||
| centre_z_(0), | ||
| centreProj_x_(0), | ||
| centreProj_y_(0), | ||
| centreProj_z_(0), | ||
| mipPt_(0), | ||
| sumPt_() {} | ||
|
|
||
| HGCalMulticluster(const l1thgcfirmware::HGCalCluster& tc, float fraction = 1.); | ||
|
|
||
| void addConstituent(const l1thgcfirmware::HGCalCluster& tc, bool updateCentre = true, float fraction = 1.); | ||
|
|
||
| ~HGCalMulticluster() = default; | ||
|
|
||
| const std::vector<l1thgcfirmware::HGCalCluster>& constituents() const { return constituents_; } | ||
|
|
||
| unsigned size() const { return constituents_.size(); } | ||
|
|
||
| float sumPt() const { return sumPt_; } | ||
|
|
||
| private: | ||
| // Could replace this with own simple implementation of GlobalPoint? | ||
| // Or just a struct? | ||
| float centre_x_; | ||
| float centre_y_; | ||
| float centre_z_; | ||
|
|
||
| float centreProj_x_; | ||
| float centreProj_y_; | ||
| float centreProj_z_; | ||
|
|
||
| float mipPt_; | ||
| float sumPt_; | ||
|
|
||
| std::vector<l1thgcfirmware::HGCalCluster> constituents_; | ||
|
|
||
| void updateP4AndPosition(const l1thgcfirmware::HGCalCluster& tc, bool updateCentre = true, float fraction = 1.); | ||
| }; | ||
|
|
||
| typedef std::vector<HGCalMulticluster> HGCalMulticlusterSACollection; | ||
|
|
||
| } // namespace l1thgcfirmware | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #ifndef L1Trigger_L1THGCal_HGCalSeed_SA_h | ||
| #define L1Trigger_L1THGCal_HGCalSeed_SA_h | ||
|
|
||
| namespace l1thgcfirmware { | ||
|
|
||
| class HGCalSeed { | ||
| public: | ||
| HGCalSeed(float x, float y, float z, float energy) : x_(x), y_(y), z_(z), energy_(energy) {} | ||
|
|
||
| ~HGCalSeed(){}; | ||
|
|
||
| float x() const { return x_; } | ||
| float y() const { return y_; } | ||
| float z() const { return z_; } | ||
| float energy() const { return energy_; } | ||
|
|
||
| private: | ||
| float x_; | ||
| float y_; | ||
| float z_; | ||
| float energy_; | ||
| }; | ||
|
|
||
| typedef std::vector<HGCalSeed> HGCalSeedSACollection; | ||
|
|
||
| } // namespace l1thgcfirmware | ||
|
|
||
| #endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess all these private classs members can be made
constThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually they cannot be
const: they can be modified by thesetParametersmethods