39 HLTFilter_(iConfig.getParameter<
vector<
string>>(
"HLTFilter")),
40 HLTPath_(iConfig.getParameter<
vector<
string>>(
"HLTPath")) {
103 for (
unsigned int ip = 0; ip <
HLTPath.size(); ip++) {
104 int N_Triggers = trigResults->
size();
106 for (
int i_Trig = 0; i_Trig < N_Triggers; ++i_Trig) {
107 if (!trigResults->
accept(i_Trig))
110 if (TrigPath.find(
HLTPath[ip]) != std::string::npos)
119 std::vector<string>
Seed) {
122 using namespace reco;
129 std::vector<std::array<float, 5>> max_per_trigger;
131 for (
unsigned int ipath = 0; ipath <
Seed.size(); ipath++) {
132 std::vector<std::array<float, 5>> tot_tr_obj_pt_eta_phi;
133 if (!triggerObjectsSummary.
isValid())
135 size_t filterIndex = (*triggerObjectsSummary).filterIndex(
InputTag(
Seed[ipath],
"",
"HLT"));
137 if (filterIndex < (*triggerObjectsSummary).sizeFilters()) {
139 for (
size_t j = 0;
j <
keys.size();
j++) {
141 std::array<float, 5> tr_obj_pt_eta_phi;
142 if (fabs(foundObject.
id()) != 13)
144 tr_obj_pt_eta_phi[0] = foundObject.
pt();
145 tr_obj_pt_eta_phi[1] = foundObject.
eta();
146 tr_obj_pt_eta_phi[2] = foundObject.
phi();
147 tr_obj_pt_eta_phi[3] = foundObject.
id() / fabs(foundObject.
id());
148 tot_tr_obj_pt_eta_phi.push_back(tr_obj_pt_eta_phi);
152 if (!tot_tr_obj_pt_eta_phi.empty()) {
154 tot_tr_obj_pt_eta_phi.end(),
155 [](
const std::array<float, 5>&
a,
const std::array<float, 5>&
b) {
return a[0] >
b[0]; });
156 max_per_trigger.push_back(tot_tr_obj_pt_eta_phi.at(0));
162 max_per_trigger.end(),
163 [](
const std::array<float, 5>&
a,
const std::array<float, 5>&
b) {
return a[0] >
b[0]; });
164 return max_per_trigger.at(0);
171 using namespace reco;
245 bool isFake =
vtx.isFake();
272 if (deltaRmu < MuTrgMatchCone && SelectedMu_DR > deltaRmu) {
278 bool tight =
false, soft =
false;
283 const Track* mutrack =
mu.bestTrack();
290 auto muTrack = std::make_shared<reco::Track>(*mutrack);
316 const Track* eltrack = el.bestTrack();
321 auto ElTrack = std::make_shared<reco::Track>(*eltrack);
324 el_pt.push_back(eltrack->pt());
325 el_eta.push_back(eltrack->eta());
326 el_phi.push_back(eltrack->phi());
342 if (trk.charge() == 0)
356 auto cleanTrack = std::make_shared<reco::Track>(trk);
367 TLorentzVector vel1, vel2;
368 std::vector<std::shared_ptr<reco::Track>> cleanedObjects;
372 cleanedObjects.push_back(vec);
377 cleanedObjects.push_back(vec);
380 if (cleanedObjects.empty())
383 for (
auto&
obj : cleanedObjects) {
385 unsigned int iobj = &
obj - &cleanedObjects[0];
387 float massLep = 0.0005;
398 vel1.SetPtEtaPhiM(
obj->pt(),
obj->eta(),
obj->phi(), massLep);
404 if (
obj->charge() * trk2->charge() == 1)
408 vel2.SetPtEtaPhiM(trk2->pt(), trk2->eta(), trk2->phi(), massLep);
425 float InvMassLepLep = (vel1 + vel2).M();
429 std::vector<reco::TransientTrack> tempTracks;
430 tempTracks.reserve(2);
431 tempTracks.push_back(*tranobj);
432 tempTracks.push_back(*trantrk2);
433 LLvertex = theKalmanFitter.
vertex(tempTracks);
444 -1 * ((theBeamSpot->
y0() - LLvertex.
position().
y()) +
449 float tempCos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
468 float massLep = 0.0005;
471 vel1.SetPtEtaPhiM(objtrk->pt(), objtrk->eta(), objtrk->phi(), massLep);
472 vel2.SetPtEtaPhiM(pairtrk->pt(), pairtrk->eta(), pairtrk->phi(), massLep);
475 if (trk->charge() == objtrk->charge() &&
485 vK.SetPtEtaPhiM(trk->pt(), trk->eta(), trk->phi(), 0.493);
487 float InvMass = (vel1 + vel2 + vK).M();
490 if ((vel1 + vel2 + vK).Pt() <
PtB_Cut)
493 std::vector<reco::TransientTrack> tempTracks;
494 tempTracks.reserve(3);
495 tempTracks.push_back(*tranobj);
496 tempTracks.push_back(*tranpair);
497 tempTracks.push_back(*trantrk);
498 LLvertex = theKalmanFitter.
vertex(tempTracks);
506 -1 * ((theBeamSpot->
y0() - LLvertex.
position().
y()) +
509 math::XYZVector pperp((vel1 + vel2 + vK).Px(), (vel1 + vel2 + vK).Py(), 0);
511 float tempCos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
std::vector< float > muon_eta
bool accept() const
Has at least one path accepted the event?
T getParameter(std::string const &) const
float totalChiSquared() const
std::vector< std::shared_ptr< reco::Track > > cleanedTracks
std::vector< unsigned int > object_id
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
GlobalPoint position() const
const Point & position() const
position
GlobalError positionError() const
bool filter(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
double TrkObjExclusionCone
double dydz() const
dydz slope
edm::EDGetTokenT< edm::TriggerResults > trgresultsToken_
std::vector< std::shared_ptr< reco::Track > > cleanedPairTracks
float degreesOfFreedom() const
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
std::vector< unsigned int > Epair_ObjectId
std::vector< string > HLTFilter_
std::vector< unsigned int > Epair_ObjectIndex
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
std::vector< std::shared_ptr< reco::Track > > MuTracks
std::vector< unsigned int > Epair_TrkIndex
Single trigger physics object (e.g., an isolated muon)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
reco::TrackBase::Point vertex_point
double x0() const
x coordinate
double pt() const
track transverse momentum
unsigned int size() const
Get number of paths stored.
std::vector< float > SelectedTrgObj_PtEtaPhiCharge
void addDefault(ParameterSetDescription const &psetDescription)
edm::EDGetToken electronsToken_
std::vector< float > el_pt
edm::EDGetTokenT< edm::ValueMap< float > > eleBWPToken_
std::vector< unsigned int > object_container
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken_
const TriggerObjectCollection & getObjects() const
float ChiSquaredProbability(double chiSquared, double nrDOF)
#define DEFINE_FWK_MODULE(type)
std::vector< float > el_eta
bool isTightMuonCustom(const reco::Muon &recoMu, const reco::Vertex recoVtx)
std::vector< unsigned int > Trk_container
bool isMediumMuonCustom(const reco::Muon &recoMu)
std::vector< float > muon_medium
double y0() const
y coordinate
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
double ElTrgExclusionCone
edm::EDGetTokenT< trigger::TriggerEvent > trigobjectsToken_
std::vector< std::shared_ptr< reco::Track > > cleanedObjTracks
std::vector< std::shared_ptr< reco::Track > > ElTracks
std::vector< float > muon_pt
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
double eta() const
pseudorapidity of momentum vector
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
double MuTrgExclusionCone
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::EDGetTokenT< reco::ConversionCollection > conversionsToken_
std::vector< size_type > Keys
std::vector< float > el_phi
double dxdz() const
dxdz slope
edm::EDGetToken muonsToken_
~LeptonSkimming() override
std::vector< float > muon_tight
bool hltFired(const edm::Event &iEvent, const edm::EventSetup &iSetup, std::vector< string > HLTPath)
double z0() const
z coordinate
bool ObjPtLargerThanTrack
std::vector< float > muon_soft
edm::EDGetTokenT< edm::ValueMap< float > > eleUnBWPToken_
std::vector< string > HLTPath_
std::vector< float > muon_phi
void beginStream(edm::StreamID) override
std::array< float, 5 > hltObject(const edm::Event &iEvent, const edm::EventSetup &iSetup, std::vector< string > Seed)
LeptonSkimming(const edm::ParameterSet &)
void endStream() override