27 beamSpotTag_( iConfig.getParameter<
edm::InputTag>(
"BeamSpotTag") ),
29 candTag_( iConfig.getParameter<
edm::InputTag >(
"CandTag") ),
31 previousCandTag_( iConfig.getParameter<
edm::InputTag >(
"PreviousCandTag") ),
32 previousCandToken_(consumes<
trigger::TriggerFilterObjectWithRefs>(previousCandTag_)),
33 seedMapTag_( iConfig.getParameter<
edm::InputTag >(
"SeedMapTag") ),
34 seedMapToken_(consumes<
SeedMap>(seedMapTag_)),
35 minN_( iConfig.getParameter<
int>(
"MinN") ),
36 maxEta_( iConfig.getParameter<double>(
"MaxEta") ),
37 absetaBins_( iConfig.getParameter<
std::vector<double> >(
"AbsEtaBins") ),
38 minNstations_( iConfig.getParameter<
std::vector<
int> >(
"MinNstations") ),
39 minNhits_( iConfig.getParameter<
std::vector<
int> >(
"MinNhits") ),
40 cutOnChambers_( iConfig.getParameter<
bool>(
"CutOnChambers") ),
41 minNchambers_( iConfig.getParameter<
std::vector<
int> >(
"MinNchambers") ),
42 maxDr_( iConfig.getParameter<double>(
"MaxDr") ),
43 minDr_( iConfig.getParameter<double>(
"MinDr") ),
44 maxDz_( iConfig.getParameter<double>(
"MaxDz") ),
45 min_DxySig_(iConfig.getParameter<double> (
"MinDxySig")),
46 minPt_( iConfig.getParameter<double>(
"MinPt") ),
47 nSigmaPt_( iConfig.getParameter<double>(
"NSigmaPt") ),
48 matchPreviousCand_( iConfig.getParameter<
bool>(
"MatchToPreviousCand") )
56 throw cms::Exception(
"Configuration") <<
"Number of MinNstations, MinNhits, or MinNchambers cuts " 57 <<
"does not match number of eta bins." << endl;
63 throw cms::Exception(
"Configuration") <<
"Absolute eta bins must be in increasing order." << endl;
70 ss<<
"Constructed with parameters:"<<endl;
75 ss<<
" MinN = "<<
minN_<<endl;
76 ss<<
" MaxEta = "<<
maxEta_<<endl;
77 ss<<
" MinNstations = ";
89 ss<<
" MinNchambers = ";
95 ss<<
" MaxDr = "<<
maxDr_<<endl;
96 ss<<
" MinDr = "<<
minDr_<<endl;
97 ss<<
" MaxDz = "<<
maxDz_<<endl;
99 ss<<
" MinPt = "<<
minPt_<<endl;
102 LogDebug(
"HLTMuonL2FromL1TPreFilter")<<ss.str();
116 desc.
add<
int>(
"MinN",1);
117 desc.
add<
double>(
"MaxEta",2.5);
118 desc.
add<std::vector<double> >(
"AbsEtaBins", std::vector<double>(1, 9999.));
119 desc.
add<std::vector<int> >(
"MinNstations", std::vector<int>(1, 1));
120 desc.
add<std::vector<int> >(
"MinNhits", std::vector<int>(1, 0));
121 desc.
add<
bool> (
"CutOnChambers",
false);
122 desc.
add<std::vector<int> >(
"MinNchambers", std::vector<int>(1, 0));
123 desc.
add<
double>(
"MaxDr",9999.0);
124 desc.
add<
double>(
"MinDr",-1.0);
125 desc.
add<
double>(
"MaxDz",9999.0);
126 desc.
add<
double>(
"MinDxySig",-1.0);
127 desc.
add<
double>(
"MinPt",0.0);
128 desc.
add<
double>(
"NSigmaPt",0.0);
129 desc.
add<
bool>(
"MatchToPreviousCand",
true);
130 descriptions.
add(
"hltMuonL2FromL1TPreFilter",desc);
146 using namespace reco;
170 for(
auto cand=allMuons->begin();
cand!=allMuons->end();
cand++){
180 bool failNstations(
false), failNhits(
false), failNchambers(
false);
181 for(
unsigned int i=0;
i<nAbsetaBins; ++
i) {
183 if(mu->hitPattern().muonStationsWithAnyHits() <
minNstations_[
i]) {
190 ( mu->hitPattern().dtStationsWithAnyHits() +
197 if(failNstations || failNhits || failNchambers)
continue;
212 double pt = mu->pt();
213 double abspar0 =
std::abs(mu->parameter(0));
216 if(abspar0 > 0) ptLx +=
nSigmaPt_*mu->error(0)/abspar0*
pt;
217 if(ptLx <
minPt_)
continue;
233 <<
'\t'<<
"q*ptLx"<<
'\t' 244 ss<<
"-----------------------------------------------------------------------------------------------------------------------"<<endl;
245 for (
auto cand = allMuons->begin();
cand != allMuons->end();
cand++) {
248 <<
cand-allMuons->begin()
249 <<
'\t'<<scientific<<mu->charge()*mu->pt()
250 <<
'\t'<<scientific<<mu->charge()*mu->pt()*(1. + ((mu->parameter(0) != 0) ?
nSigmaPt_*mu->error(0)/
std::abs(mu->parameter(0)) : 0.))
251 <<
'\t'<<
fixed<<mu->eta()
252 <<
'\t'<<
fixed<<mu->phi()
253 <<
'\t'<<mu->hitPattern().muonStationsWithAnyHits()
254 <<
'\t'<<mu->numberOfValidHits()
255 <<
'\t'<<scientific<<mu->d0()
256 <<
'\t'<<scientific<<mu->dz()
259 vector<RecoChargedCandidateRef> firedMuons;
264 ss<<
"-----------------------------------------------------------------------------------------------------------------------"<<endl;
265 ss<<
"Decision of filter is "<<accept<<
", number of muons passing = "<<filterproduct.
muonSize();
266 LogDebug(
"HLTMuonL2FromL1TPreFilter")<<ss.str();
edm::InputTag previousCandTag_
input tag of the preceeding L1 filter in the path
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
~HLTMuonL2FromL1TPreFilter() override
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > candToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool isTriggeredByL1(reco::TrackRef &l2muon)
checks if a L2 muon was seeded by a fired L1
std::vector< int > minNstations_
minimum number of muon stations used
double minDr_
cut on impact parameter wrt to the beam spot
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
math::XYZPoint Point
point in the space
bool cutOnChambers_
choose whether to apply cut on number of chambers (DT+CSC)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
#define DEFINE_FWK_MODULE(type)
bool matchPreviousCand_
require the matching with the L1 firing the L1 filter
edm::EDGetTokenT< SeedMap > seedMapToken_
double min_DxySig_
dxy significance cut
std::vector< int > minNhits_
minimum number of valid muon hits
edm::InputTag beamSpotTag_
input tag of the beam spot
Abs< T >::type abs(const T &t)
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
int minN_
minimum number of muons to fire the trigger
double minPt_
pt threshold in GeV
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::string getL1Keys(reco::TrackRef &l2muon)
returns the indices of L1 seeds
size_type muonSize() const
std::vector< int > minNchambers_
minimum number of valid chambers
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
double maxDz_
cut on dz wrt to the beam spot
HLTMuonL2FromL1TPreFilter(const edm::ParameterSet &)
double maxDr_
cut on impact parameter wrt to the beam spot
const Point & position() const
position
edm::InputTag candTag_
input tag of L2 muons
std::vector< double > absetaBins_
double nSigmaPt_
pt uncertainty margin (in number of sigmas)
edm::InputTag seedMapTag_
input tag of the map from the L2 seed to the sister L2 seeds of cleaned tracks