1 #ifndef HLTrigger_Muon_HLTTriMuonIsolation_h 2 #define HLTrigger_Muon_HLTTriMuonIsolation_h 43 static bool ptComparer(
const T & cand_1,
const T & cand_2) {
return cand_1.pt() > cand_2.pt(); }
70 Muon1PtCut_ (iConfig.getParameter<double> (
"Muon1PtCut" )) ,
71 Muon2PtCut_ (iConfig.getParameter<double> (
"Muon2PtCut" )) ,
72 Muon3PtCut_ (iConfig.getParameter<double> (
"Muon3PtCut" )) ,
73 TriMuonPtCut_ (iConfig.getParameter<double> (
"TriMuonPtCut" )) ,
77 IsoConeSize_ (iConfig.getParameter<double> (
"IsoConeSize" )) ,
83 MaxDZ_ (iConfig.getParameter<double> (
"MaxDZ" )) ,
88 produces<reco::CompositeCandidateCollection>(
"Taus");
89 produces<reco::CompositeCandidateCollection>(
"SelectedTaus");
119 if (AllMuCands->size() >= 3 && L3MuCands->size() >= 2){
122 auto AllMuCands_end = AllMuCands->end();
123 for (
auto i = AllMuCands->begin();
i != AllMuCands_end-2; ++
i) {
125 bool passingPreviousFilter_1 =
false;
126 for (
const auto & imu : PassedL3Muons){
129 for (
auto j =
i+1; j != AllMuCands_end-1; ++j) {
131 bool passingPreviousFilter_2 =
false;
132 for (
const auto & jmu : PassedL3Muons){
136 if (!(passingPreviousFilter_1 || passingPreviousFilter_2))
continue;
137 for (
auto k = j+1;
k != AllMuCands_end; ++
k){
139 bool passingPreviousFilter_3 =
false;
140 for (
const auto & kmu : PassedL3Muons){
144 if (!( (passingPreviousFilter_1 & passingPreviousFilter_2 ) ||
145 (passingPreviousFilter_1 & passingPreviousFilter_3 ) ||
146 (passingPreviousFilter_2 & passingPreviousFilter_3 ) ))
continue;
153 daughters.reserve(3);
155 daughters.push_back(*
i);
156 daughters.push_back(*j);
157 daughters.push_back(*
k);
159 std::sort(daughters.begin(), daughters.end(), ptComparer<reco::RecoChargedCandidate>);
172 int charge = daughters[0].charge() + daughters[1].charge() + daughters[2].charge();
174 int tauPdgId = charge > 0? 15 : -15;
187 bool collimated =
true;
188 for (
auto const &idau : daughters){
195 if (!collimated)
continue;
212 Taus->push_back(tau);
218 std::sort(Taus->begin(), Taus->end(), ptComparer<reco::CompositeCandidate>);
221 for (
const auto & itau : *Taus){
224 double sumPt = -itau.pt();
227 for (
const auto & itrk : *IsoTracks){
237 if ( !( (sumPt < chAbsIsoCut)||(sumPt < chRelIsoCut) ) )
continue;
239 SelectedTaus->push_back(itau);
256 desc.
add<
double>(
"Muon1PtCut" , 5. );
257 desc.
add<
double>(
"Muon2PtCut" , 3. );
258 desc.
add<
double>(
"Muon3PtCut" , 0. );
259 desc.
add<
double>(
"TriMuonPtCut" , 8. );
260 desc.
add<
double>(
"TriMuonEtaCut" , 2.5 );
261 desc.
add<
double>(
"ChargedAbsIsoCut", 3.0 );
262 desc.
add<
double>(
"ChargedRelIsoCut", 0.1 );
263 desc.
add<
double>(
"IsoConeSize" , 0.5 );
264 desc.
add<
double>(
"MatchingConeSize", 0.03 );
265 desc.
add<
double>(
"MinTriMuonMass" , 0.5 );
266 desc.
add<
double>(
"MaxTriMuonMass" , 2.8 );
267 desc.
add<
double>(
"MaxTriMuonRadius", 0.6 );
268 desc.
add<
int> (
"TriMuonAbsCharge", -1 );
269 desc.
add<
double>(
"MaxDZ" , 0.3 );
270 desc.
add<
bool> (
"EnableRelIso" ,
false);
271 desc.
add<
bool> (
"EnableAbsIso" ,
true );
272 descriptions.
add(
"hltTriMuonIsolationProducer",desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > AllMuonsToken_
double eta() const final
momentum pseudorapidity
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_
std::vector< CompositeCandidate > CompositeCandidateCollection
collection of Candidate objects
const double TriMuonPtCut_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const int TriMuonAbsCharge_
const double MinTriMuonMass_
std::vector< Track > TrackCollection
collection of Tracks
double pt() const final
transverse momentum
static bool ptComparer(const T &cand_1, const T &cand_2)
int charge() const final
electric charge
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const double TriMuonEtaCut_
void setVertex(const Point &vertex) override
set vertex
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const double TwiceMuonMass_
~HLTTriMuonIsolation() override
void setCharge(Charge q) final
set electric charge
const double ChargedAbsIsoCut_
const double IsoConeSize_
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
const double MatchingConeSize_
Abs< T >::type abs(const T &t)
const LorentzVector & p4() const final
four-momentum Lorentz vector
edm::Handle< reco::TrackCollection > IsoTracks
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
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
double vz() const override
z coordinate of vertex position
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
edm::Handle< reco::RecoChargedCandidateRef > PassedL3Muons
HLTTriMuonIsolation(const edm::ParameterSet &iConfig)
virtual double vz() const =0
z coordinate of vertex position
const double MaxTriMuonRadius_
void setPdgId(int pdgId) final
void setP4(const LorentzVector &p4) final
set 4-momentum
const edm::EDGetTokenT< reco::TrackCollection > IsoTracksToken_
double mass() const final
mass
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > L3DiMuonsFilterToken_