1 #ifndef HLTrigger_Muon_HLTTriMuonIsolation_h
2 #define HLTrigger_Muon_HLTTriMuonIsolation_h
44 return cand_1.pt() > cand_2.pt();
71 L3DiMuonsFilterToken_(
72 consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<edm::
InputTag>(
"L3DiMuonsFilterSrc"))),
74 Muon1PtCut_(iConfig.getParameter<double>(
"Muon1PtCut")),
75 Muon2PtCut_(iConfig.getParameter<double>(
"Muon2PtCut")),
76 Muon3PtCut_(iConfig.getParameter<double>(
"Muon3PtCut")),
77 TriMuonPtCut_(iConfig.getParameter<double>(
"TriMuonPtCut")),
78 TriMuonEtaCut_(iConfig.getParameter<double>(
"TriMuonEtaCut")),
79 ChargedRelIsoCut_(iConfig.getParameter<double>(
"ChargedRelIsoCut")),
80 ChargedAbsIsoCut_(iConfig.getParameter<double>(
"ChargedAbsIsoCut")),
81 IsoConeSize_(iConfig.getParameter<double>(
"IsoConeSize")),
82 MatchingConeSize_(iConfig.getParameter<double>(
"MatchingConeSize")),
83 MinTriMuonMass_(iConfig.getParameter<double>(
"MinTriMuonMass")),
84 MaxTriMuonMass_(iConfig.getParameter<double>(
"MaxTriMuonMass")),
85 MaxTriMuonRadius_(iConfig.getParameter<double>(
"MaxTriMuonRadius")),
86 TriMuonAbsCharge_(iConfig.getParameter<int>(
"TriMuonAbsCharge")),
87 MaxDZ_(iConfig.getParameter<double>(
"MaxDZ")),
88 EnableRelIso_(iConfig.getParameter<bool>(
"EnableRelIso")),
89 EnableAbsIso_(iConfig.getParameter<bool>(
"EnableAbsIso")) {
91 produces<reco::CompositeCandidateCollection>(
"Taus");
92 produces<reco::CompositeCandidateCollection>(
"SelectedTaus");
118 if (AllMuCands->size() >= 3 && L3MuCands->size() >= 2) {
121 auto AllMuCands_end = AllMuCands->end();
122 for (
auto i = AllMuCands->begin();
i != AllMuCands_end - 2; ++
i) {
124 bool passingPreviousFilter_1 =
false;
125 for (
const auto& imu : PassedL3Muons) {
127 passingPreviousFilter_1 =
true;
129 for (
auto j =
i + 1;
j != AllMuCands_end - 1; ++
j) {
131 bool passingPreviousFilter_2 =
false;
132 for (
const auto& jmu : PassedL3Muons) {
134 passingPreviousFilter_2 =
true;
137 if (!(passingPreviousFilter_1 || passingPreviousFilter_2))
139 for (
auto k =
j + 1;
k != AllMuCands_end; ++
k) {
141 bool passingPreviousFilter_3 =
false;
142 for (
const auto& kmu : PassedL3Muons) {
144 passingPreviousFilter_3 =
true;
147 if (!((passingPreviousFilter_1 & passingPreviousFilter_2) ||
148 (passingPreviousFilter_1 & passingPreviousFilter_3) ||
149 (passingPreviousFilter_2 & passingPreviousFilter_3)))
157 daughters.reserve(3);
159 daughters.push_back(*
i);
160 daughters.push_back(*
j);
161 daughters.push_back(*
k);
163 std::sort(daughters.begin(), daughters.end(), ptComparer<reco::RecoChargedCandidate>);
179 int charge = daughters[0].charge() + daughters[1].charge() + daughters[2].charge();
181 int tauPdgId = charge > 0 ? 15 : -15;
197 bool collimated =
true;
198 for (
auto const& idau : daughters) {
231 Taus->push_back(tau);
237 std::sort(Taus->begin(), Taus->end(), ptComparer<reco::CompositeCandidate>);
240 for (
const auto& itau : *Taus) {
242 double sumPt = -itau.pt();
245 for (
const auto& itrk : *IsoTracks) {
257 if (!((sumPt < chAbsIsoCut) || (sumPt < chRelIsoCut)))
260 SelectedTaus->push_back(itau);
275 desc.
add<
double>(
"Muon1PtCut", 5.);
276 desc.
add<
double>(
"Muon2PtCut", 3.);
277 desc.
add<
double>(
"Muon3PtCut", 0.);
278 desc.
add<
double>(
"TriMuonPtCut", 8.);
279 desc.
add<
double>(
"TriMuonEtaCut", 2.5);
280 desc.
add<
double>(
"ChargedAbsIsoCut", 3.0);
281 desc.
add<
double>(
"ChargedRelIsoCut", 0.1);
282 desc.
add<
double>(
"IsoConeSize", 0.5);
283 desc.
add<
double>(
"MatchingConeSize", 0.03);
284 desc.
add<
double>(
"MinTriMuonMass", 0.5);
285 desc.
add<
double>(
"MaxTriMuonMass", 2.8);
286 desc.
add<
double>(
"MaxTriMuonRadius", 0.6);
287 desc.
add<
int>(
"TriMuonAbsCharge", -1);
288 desc.
add<
double>(
"MaxDZ", 0.3);
289 desc.
add<
bool>(
"EnableRelIso",
false);
290 desc.
add<
bool>(
"EnableAbsIso",
true);
291 descriptions.
add(
"hltTriMuonIsolationProducer", desc);
~HLTTriMuonIsolation() override=default
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > AllMuonsToken_
edm::Handle< reco::RecoChargedCandidateCollection > L3MuCands
edm::Handle< trigger::TriggerFilterObjectWithRefs > L3DiMuonsFilterCands
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
const double MaxTriMuonMass_
double pt() const final
transverse momentum
std::vector< CompositeCandidate > CompositeCandidateCollection
collection of Candidate objects
double vz() const override
z coordinate of vertex position
const double TriMuonPtCut_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const int TriMuonAbsCharge_
const double MinTriMuonMass_
std::vector< Track > TrackCollection
collection of Tracks
static bool ptComparer(const T &cand_1, const T &cand_2)
const double TriMuonEtaCut_
const LorentzVector & p4() const final
four-momentum Lorentz vector
void setVertex(const Point &vertex) override
set vertex
const double TwiceMuonMass_
void setCharge(Charge q) final
set electric charge
const double ChargedAbsIsoCut_
const double IsoConeSize_
const double MatchingConeSize_
Abs< T >::type abs(const T &t)
edm::Handle< reco::TrackCollection > IsoTracks
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double ChargedRelIsoCut_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > L3MuonsToken_
edm::Handle< reco::RecoChargedCandidateCollection > AllMuCands
virtual double vz() const =0
z coordinate of vertex position
double mass() const final
mass
edm::Handle< reco::RecoChargedCandidateRef > PassedL3Muons
HLTTriMuonIsolation(const edm::ParameterSet &iConfig)
const double MaxTriMuonRadius_
void setPdgId(int pdgId) final
void setP4(const LorentzVector &p4) final
set 4-momentum
const edm::EDGetTokenT< reco::TrackCollection > IsoTracksToken_
int charge() const final
electric charge
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > L3DiMuonsFilterToken_
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
double eta() const final
momentum pseudorapidity