35 pixlTag_ (iConfig.getParameter<edm::InputTag>(
"pixlTag")),
36 min_Pt_ (iConfig.getParameter<double>(
"MinPt")),
37 min_trks_ (iConfig.getParameter<unsigned int>(
"MinTrks")),
38 min_sep_ (iConfig.getParameter<double>(
"MinSep"))
43 LogDebug(
"") <<
"Requesting tracks from same vertex eta-phi separation by " <<
min_sep_;
46 produces<trigger::TriggerFilterObjectWithRefs>();
63 using namespace trigger;
81 vector<double> etastore;
82 vector<double> phistore;
85 RecoChargedCandidateCollection::const_iterator apixl(
tracks->begin());
86 RecoChargedCandidateCollection::const_iterator epixl(
tracks->end());
87 RecoChargedCandidateCollection::const_iterator ipixl, jpixl;
88 unsigned int nsame_vtx=0;
91 for (ipixl=apixl; ipixl!=epixl; ipixl++){
93 const double& ztrk1 = ipixl->vz();
94 const double& etatrk1 = ipixl->momentum().eta();
95 const double& phitrk1 = ipixl->momentum().phi();
100 etastore.push_back(etatrk1);
101 phistore.push_back(phitrk1);
102 itstore.push_back(itrk);
103 if (fabs(ztrk1) < 15.0) {
106 for (jpixl=apixl; jpixl!=epixl; jpixl++) {
108 if (jpixl==ipixl)
continue;
109 const double& ztrk2 = jpixl->vz();
110 const double& etatrk2 = jpixl->momentum().eta();
111 const double& phitrk2 = jpixl->momentum().phi();
112 double eta_dist=etatrk2-etatrk1;
113 double phi_dist=phitrk2-phitrk1;
114 double etaphi_dist=
sqrt(eta_dist*eta_dist + phi_dist*phi_dist);
115 if (fabs(ztrk2-ztrk1) < 1.0 && etaphi_dist >
min_sep_) {
116 if (
min_trks_ <= 2 || itstore.size() <= 1) {
117 etastore.push_back(etatrk2);
118 phistore.push_back(phitrk2);
119 itstore.push_back(jtrk);
123 LogDebug(
"") <<
"HLTPixlMBFilt: with mintrks=2 we should not be here...";
125 for (
unsigned int k=1;
k < itstore.size();
k++) {
126 eta_dist=etatrk2-etastore.at(
k);
127 phi_dist=phitrk2-phistore.at(
k);
128 etaphi_dist=
sqrt(eta_dist*eta_dist + phi_dist*phi_dist);
135 etastore.push_back(etatrk2);
136 phistore.push_back(phitrk2);
137 itstore.push_back(jtrk);
165 for (
unsigned int ipos=0; ipos < itstore.size(); ipos++) {
166 int iaddr=itstore.at(ipos);
171 iEvent.
put(filterobject);
174 LogDebug(
"") <<
"Number of pixel-track objects accepted:"
HLTPixlMBFilt(const edm::ParameterSet &)
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)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual bool filter(edm::Event &, const edm::EventSetup &)