17 , m_input(iConfig.getParameter<
edm::InputTag>(
"input"))
18 , m_minHits(iConfig.getParameter<unsigned
int>(
"minHits"))
19 , m_xWindow(iConfig.getParameter<double>(
"xWindow"))
20 , m_yWindow(iConfig.getParameter<double>(
"yWindow"))
21 , m_ring1(iConfig.getParameter<
bool>(
"ring1"))
22 , m_ring2(iConfig.getParameter<
bool>(
"ring2"))
23 , m_fillHists(iConfig.getParameter<
bool>(
"fillHists"))
33 m_xdiff = tfile->
make<TH1F>(
"xdiff",
"xdiff", 200, 0., 10.);
34 m_ydiff = tfile->
make<TH1F>(
"ydiff",
"ydiff", 200, 0., 10.);
46 desc.
add<
unsigned int>(
"minHits",4);
47 desc.
add<
double>(
"xWindow",1000.);
48 desc.
add<
double>(
"yWindow",1000.);
49 desc.
add<
bool>(
"ring1",
true);
50 desc.
add<
bool>(
"ring2",
false);
51 desc.
add<
bool>(
"fillHists",
false);
52 descriptions.
add(
"hltCSCOverlapFilter",desc);
60 bool got_cscGeometry =
false;
62 std::map<int, std::vector<const CSCRecHit2D*> > chamber_tohit;
64 for (
auto const &
hit : *hits) {
70 std::map<int, std::vector<const CSCRecHit2D*> >::const_iterator chamber_iter = chamber_tohit.find(chamber_id);
71 if (chamber_iter == chamber_tohit.end()) {
72 std::vector<const CSCRecHit2D*> newlist;
73 newlist.push_back(&
hit);
75 chamber_tohit[chamber_id].push_back(&
hit);
81 for (
std::map<
int, std::vector<const CSCRecHit2D*> >::const_iterator chamber_iter = chamber_tohit.begin();
82 chamber_iter != chamber_tohit.end();
89 if (chamber_iter->second.size() >=
m_minHits) {
90 CSCDetId chamber_id(chamber_iter->first);
92 int next = chamber + 1;
95 if (next == 37 && (
std::abs(chamber_id.
station()) == 1 || chamber_id.
ring() == 2)) next = 1;
96 if (next == 19 && (
std::abs(chamber_id.
station()) != 1 && chamber_id.
ring() == 1)) next = 1;
100 std::map<int, std::vector<const CSCRecHit2D*> >::const_iterator chamber_next = chamber_tohit.find(next_id);
101 if (chamber_next != chamber_tohit.end() && chamber_next->second.size() >=
m_minHits) {
102 if (!got_cscGeometry) {
104 got_cscGeometry =
true;
107 unsigned int pairs_in_window = 0;
108 for (
auto hit1 = chamber_iter->second.begin(); hit1 != chamber_iter->second.end(); ++hit1) {
109 for (
auto hit2 : chamber_next->second) {
120 if (pairs_in_window >= minHitsSquared) {
TH1F * m_pairsWithWindowCut
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const GeomDet * idToDet(DetId) const override
edm::EDGetTokenT< CSCRecHit2DCollection > cscrechitsToken
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
constexpr uint32_t rawId() const
get the raw id
T * make(const Args &...args) const
make new ROOT object
#define DEFINE_FWK_MODULE(type)
Abs< T >::type abs(const T &t)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
TH1F * m_nhitsNoWindowCut
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~HLTCSCOverlapFilter() override
HLTCSCOverlapFilter(const edm::ParameterSet &)