-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin
committed
Nov 27, 2021
1 parent
86b6c26
commit 5b73c34
Showing
5 changed files
with
197 additions
and
92 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
106 changes: 106 additions & 0 deletions
106
HLTrigger/special/plugins/HLTMuonRecHitClusterFilter.cc
This file contains 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,106 @@ | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
#include "FWCore/Framework/interface/global/EDFilter.h" | ||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
#include "FWCore/Utilities/interface/EDGetToken.h" | ||
#include "FWCore/Utilities/interface/InputTag.h" | ||
#include "FWCore/Utilities/interface/StreamID.h" | ||
#include "DataFormats/MuonReco/interface/MuonRecHitCluster.h" | ||
|
||
class HLTMuonRecHitClusterFilter : public edm::global::EDFilter<> { | ||
public: | ||
explicit HLTMuonRecHitClusterFilter(const edm::ParameterSet&); | ||
~HLTMuonRecHitClusterFilter() override = default; | ||
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); | ||
|
||
private: | ||
bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override; | ||
const edm::EDGetTokenT<reco::MuonRecHitClusterCollection> cluster_token_; | ||
const int min_N_; | ||
const int min_Size_; | ||
const int min_SizeMinusMB1_; | ||
const int max_nMB1_; | ||
const int max_nMB2_; | ||
const int max_nME11_; | ||
const int max_nME12_; | ||
const int max_nME41_; | ||
const int max_nME42_; | ||
const int min_Nstation_; | ||
const double min_AvgStation_; | ||
const double min_Time_; | ||
const double max_Time_; | ||
const double min_Eta_; | ||
const double max_Eta_; | ||
const double max_TimeSpread_; | ||
}; | ||
// | ||
// constructors and destructor | ||
// | ||
HLTMuonRecHitClusterFilter::HLTMuonRecHitClusterFilter(const edm::ParameterSet& iConfig) | ||
: cluster_token_(consumes<reco::MuonRecHitClusterCollection>(iConfig.getParameter<edm::InputTag>("ClusterTag"))), | ||
min_N_(iConfig.getParameter<int>("MinN")), | ||
min_Size_(iConfig.getParameter<int>("MinSize")), | ||
min_SizeMinusMB1_(iConfig.getParameter<int>("MinSizeMinusMB1")), | ||
max_nMB1_(iConfig.getParameter<int>("Max_nMB1")), | ||
max_nMB2_(iConfig.getParameter<int>("Max_nMB2")), | ||
max_nME11_(iConfig.getParameter<int>("Max_nME11")), | ||
max_nME12_(iConfig.getParameter<int>("Max_nME12")), | ||
max_nME41_(iConfig.getParameter<int>("Max_nME41")), | ||
max_nME42_(iConfig.getParameter<int>("Max_nME42")), | ||
min_Nstation_(iConfig.getParameter<int>("MinNstation")), | ||
min_AvgStation_(iConfig.getParameter<double>("MinAvgStation")), | ||
min_Time_(iConfig.getParameter<double>("MinTime")), | ||
max_Time_(iConfig.getParameter<double>("MaxTime")), | ||
min_Eta_(iConfig.getParameter<double>("MinEta")), | ||
max_Eta_(iConfig.getParameter<double>("MaxEta")), | ||
max_TimeSpread_(iConfig.getParameter<double>("MaxTimeSpread")) {} | ||
|
||
void HLTMuonRecHitClusterFilter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { | ||
edm::ParameterSetDescription desc; | ||
desc.add<edm::InputTag>("ClusterTag", edm::InputTag("hltCSCrechitClusters")); | ||
desc.add<int>("MinN", 1); | ||
desc.add<int>("MinSize", 50); | ||
desc.add<int>("MinSizeMinusMB1", 0); | ||
desc.add<int>("Max_nMB1", 0); | ||
desc.add<int>("Max_nMB2", 0); | ||
desc.add<int>("Max_nME11", 0); | ||
desc.add<int>("Max_nME12", 0); | ||
desc.add<int>("Max_nME41", 0); | ||
desc.add<int>("Max_nME42", 0); | ||
desc.add<int>("MinNstation", 0); | ||
desc.add<double>("MinAvgStation", 0.0); | ||
desc.add<double>("MinTime", -999); | ||
desc.add<double>("MaxTime", 999); | ||
desc.add<double>("MinEta", -1.0); | ||
desc.add<double>("MaxEta", -1.0); | ||
desc.add<double>("MaxTimeSpread", 999); | ||
descriptions.addWithDefaultLabel(desc); | ||
} | ||
|
||
// | ||
// member functions | ||
// | ||
|
||
// ------------ method called on each new Event ------------ | ||
bool HLTMuonRecHitClusterFilter::filter(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { | ||
int nClusterPassed = 0; | ||
|
||
auto const& rechitClusters = iEvent.get(cluster_token_); | ||
|
||
for (auto const& cluster : rechitClusters) { | ||
if ((cluster.size() >= min_Size_) && ((cluster.size() - cluster.nMB1()) >= min_SizeMinusMB1_) && | ||
(cluster.nMB1() <= max_nMB1_) && (cluster.nMB2() <= max_nMB2_) && (cluster.nME11() <= max_nME11_) && | ||
(cluster.nME12() <= max_nME12_) && (cluster.nME41() <= max_nME41_) && (cluster.nME42() <= max_nME42_) && | ||
(cluster.nStation() >= min_Nstation_) && (cluster.avgStation() >= min_AvgStation_) && | ||
((min_Eta_ < 0.0) || (std::abs(cluster.eta()) >= min_Eta_)) && | ||
((max_Eta_ < 0.0) || (std::abs(cluster.eta()) <= max_Eta_)) && (cluster.time() > min_Time_) && | ||
(cluster.time() <= max_Time_) && (cluster.timeSpread() <= max_TimeSpread_)) { | ||
nClusterPassed++; | ||
} | ||
} | ||
|
||
return (nClusterPassed >= min_N_); | ||
} | ||
|
||
DEFINE_FWK_MODULE(HLTMuonRecHitClusterFilter); |
This file contains 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
Oops, something went wrong.