32 pixlTag_ (iConfig.getParameter<
edm::InputTag>(
"pixlTag")),
33 min_Pt_ (iConfig.getParameter<double>(
"MinPt")),
34 min_trks_ (iConfig.getParameter<unsigned
int>(
"MinTrks")),
35 min_sep_ (iConfig.getParameter<double>(
"MinSep"))
41 LogDebug(
"") <<
"Requesting tracks from same vertex eta-phi separation by " <<
min_sep_;
51 desc.
add<
double>(
"MinPt",0.);
52 desc.
add<
unsigned int>(
"MinTrks",2);
53 desc.
add<
double>(
"MinSep",1.);
54 descriptions.
add(
"hltPixlMBFilt",desc);
85 vector<double> etastore;
86 vector<double> phistore;
89 auto apixl(tracks->begin());
90 auto epixl(tracks->end());
91 RecoChargedCandidateCollection::const_iterator ipixl, jpixl;
92 unsigned int nsame_vtx=0;
95 for (ipixl=apixl; ipixl!=epixl; ipixl++){
96 if (ipixl->pt() <
min_Pt_)
continue;
98 const double& ztrk1 = ipixl->vz();
99 const double& etatrk1 = ipixl->momentum().eta();
100 const double& phitrk1 = ipixl->momentum().phi();
105 etastore.push_back(etatrk1);
106 phistore.push_back(phitrk1);
107 itstore.push_back(itrk);
108 if (fabs(ztrk1) < 15.0) {
111 for (jpixl=apixl; jpixl!=epixl; jpixl++) {
112 if (jpixl->pt() <
min_Pt_)
continue;
114 if (jpixl==ipixl)
continue;
115 const double& ztrk2 = jpixl->vz();
116 const double& etatrk2 = jpixl->momentum().eta();
117 const double& phitrk2 = jpixl->momentum().phi();
118 double eta_dist=etatrk2-etatrk1;
119 double phi_dist=phitrk2-phitrk1;
120 double etaphi_dist=
sqrt(eta_dist*eta_dist + phi_dist*phi_dist);
121 if (fabs(ztrk2-ztrk1) < 1.0 && etaphi_dist >
min_sep_) {
122 if (
min_trks_ <= 2 || itstore.size() <= 1) {
123 etastore.push_back(etatrk2);
124 phistore.push_back(phitrk2);
125 itstore.push_back(jtrk);
129 LogDebug(
"") <<
"HLTPixlMBFilt: with mintrks=2 we should not be here...";
131 for (
unsigned int k=1;
k < itstore.size();
k++) {
132 eta_dist=etatrk2-etastore.at(
k);
133 phi_dist=phitrk2-phistore.at(
k);
134 etaphi_dist=
sqrt(eta_dist*eta_dist + phi_dist*phi_dist);
141 etastore.push_back(etatrk2);
142 phistore.push_back(phitrk2);
143 itstore.push_back(jtrk);
168 for (
int iaddr : itstore) {
173 LogDebug(
"") <<
"Number of pixel-track objects accepted:"
HLTPixlMBFilt(const edm::ParameterSet &)
~HLTPixlMBFilt() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
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>)
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > pixlToken_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override