-
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.
Merge pull request #35836 from kakwok/MuonShowerCluster_from_12_1_0_pre4
Data Format for hadronic showers in muon system
- Loading branch information
Showing
9 changed files
with
499 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#ifndef DataFormats_MuonReco_MuonRecHitCluster_h | ||
#define DataFormats_MuonReco_MuonRecHitCluster_h | ||
|
||
#include <vector> | ||
#include "DataFormats/Math/interface/Vector3D.h" | ||
|
||
namespace reco { | ||
|
||
class MuonRecHitCluster { | ||
public: | ||
//default constructor | ||
MuonRecHitCluster() = default; | ||
|
||
MuonRecHitCluster(const math::RhoEtaPhiVectorF position, | ||
const int size, | ||
const int nStation, | ||
const float avgStation, | ||
const float time, | ||
const float timeSpread, | ||
const int nME11, | ||
const int nME12, | ||
const int nME41, | ||
const int nME42, | ||
const int nMB1, | ||
const int nMB2); | ||
|
||
// | ||
~MuonRecHitCluster() = default; | ||
|
||
float eta() const { return position_.Eta(); } | ||
float phi() const { return position_.Phi(); } | ||
float x() const { return position_.X(); } | ||
float y() const { return position_.Y(); } | ||
float z() const { return position_.Z(); } | ||
float r() const { return position_.Rho(); } | ||
int size() const { return size_; } | ||
int nStation() const { return nStation_; } | ||
float avgStation() const { return avgStation_; } | ||
int nMB1() const { return nMB1_; } | ||
int nMB2() const { return nMB2_; } | ||
int nME11() const { return nME11_; } | ||
int nME12() const { return nME12_; } | ||
int nME41() const { return nME41_; } | ||
int nME42() const { return nME42_; } | ||
float time() const { return time_; } | ||
float timeSpread() const { return timeSpread_; } | ||
|
||
private: | ||
math::RhoEtaPhiVectorF position_; | ||
int size_; | ||
int nStation_; | ||
float avgStation_; | ||
float time_; | ||
float timeSpread_; | ||
int nME11_; | ||
int nME12_; | ||
int nME41_; | ||
int nME42_; | ||
int nMB1_; | ||
int nMB2_; | ||
}; | ||
|
||
typedef std::vector<MuonRecHitCluster> MuonRecHitClusterCollection; | ||
} // namespace reco | ||
#endif |
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,26 @@ | ||
#include "DataFormats/MuonReco/interface/MuonRecHitCluster.h" | ||
|
||
reco::MuonRecHitCluster::MuonRecHitCluster(const math::RhoEtaPhiVectorF position, | ||
const int size, | ||
const int nStation, | ||
const float avgStation, | ||
const float time, | ||
const float timeSpread, | ||
const int nME11, | ||
const int nME12, | ||
const int nME41, | ||
const int nME42, | ||
const int nMB1, | ||
const int nMB2) | ||
: position_(position), | ||
size_(size), | ||
nStation_(nStation), | ||
avgStation_(avgStation), | ||
time_(time), | ||
timeSpread_(timeSpread), | ||
nME11_(nME11), | ||
nME12_(nME12), | ||
nME41_(nME41), | ||
nME42_(nME42), | ||
nMB1_(nMB1), | ||
nMB2_(nMB2) {} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/PluginManager"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="Geometry/CSCGeometry"/> | ||
<use name="Geometry/DTGeometry"/> | ||
<use name="Geometry/Records"/> | ||
<use name="DataFormats/MuonReco"/> | ||
<use name="fastjet"/> | ||
<flags EDM_PLUGIN="1"/> |
Oops, something went wrong.