1 #ifndef HLTrigger_Muon_HLTTriMuonIsolation_h 2 #define HLTrigger_Muon_HLTTriMuonIsolation_h 68 Muon1PtCut_ (iConfig.getParameter<double> (
"Muon1PtCut" )) ,
69 Muon2PtCut_ (iConfig.getParameter<double> (
"Muon2PtCut" )) ,
70 Muon3PtCut_ (iConfig.getParameter<double> (
"Muon3PtCut" )) ,
71 TriMuonPtCut_ (iConfig.getParameter<double> (
"TriMuonPtCut" )) ,
75 IsoConeSize_ (iConfig.getParameter<double> (
"IsoConeSize" )) ,
81 MaxDZ_ (iConfig.getParameter<double> (
"MaxDZ" )) ,
82 EnableRelIso_ (iConfig.getParameter<bool> (
"EnableRelIso" )) ,
86 produces<reco::CompositeCandidateCollection>(
"Taus");
87 produces<reco::CompositeCandidateCollection>(
"SelectedTaus");
117 if (AllMuCands->size() >= 3 && L3MuCands->size() >= 2){
120 auto AllMuCands_end = AllMuCands->end();
121 for (
auto i = AllMuCands->begin();
i != AllMuCands_end-2; ++
i) {
123 bool passingPreviousFilter_1 =
false;
124 for (
const auto & imu : PassedL3Muons){
127 for (
auto j =
i+1; j != AllMuCands_end-1; ++j) {
129 bool passingPreviousFilter_2 =
false;
130 for (
const auto & jmu : PassedL3Muons){
134 if (!(passingPreviousFilter_1 || passingPreviousFilter_2))
continue;
135 for (
auto k = j+1;
k != AllMuCands_end; ++
k){
137 bool passingPreviousFilter_3 =
false;
138 for (
const auto & kmu : PassedL3Muons){
142 if (!( (passingPreviousFilter_1 & passingPreviousFilter_2 ) ||
143 (passingPreviousFilter_1 & passingPreviousFilter_3 ) ||
144 (passingPreviousFilter_2 & passingPreviousFilter_3 ) ))
continue;
151 daughters.reserve(3);
153 daughters.push_back(*
i);
154 daughters.push_back(*j);
155 daughters.push_back(*
k);
157 std::sort(daughters.begin(), daughters.end(),
ptComparer);
164 int charge = daughters[0].charge() + daughters[1].charge() + daughters[2].charge();
166 int tauPdgId = charge > 0? 15 : -15;
179 bool collimated =
true;
180 for (
auto const &idau : daughters){
187 if (!collimated)
continue;
190 Taus->push_back(tau);
196 for (
const auto & itau : *Taus){
201 if (itau.daughter(0)->pt() <
Muon1PtCut_ )
continue;
202 if (itau.daughter(1)->pt() <
Muon2PtCut_ )
continue;
203 if (itau.daughter(2)->pt() <
Muon3PtCut_ )
continue;
205 if (
std::abs(itau.daughter(0)->vz() - itau.vz()) >
MaxDZ_)
continue;
206 if (
std::abs(itau.daughter(1)->vz() - itau.vz()) >
MaxDZ_)
continue;
207 if (
std::abs(itau.daughter(2)->vz() - itau.vz()) >
MaxDZ_)
continue;
210 double sumPt = -itau.pt();
213 for (
const auto & itrk : *IsoTracks){
223 SelectedTaus->push_back(itau);
240 desc.
add<
double>(
"Muon1PtCut" , 5. );
241 desc.
add<
double>(
"Muon2PtCut" , 3. );
242 desc.
add<
double>(
"Muon3PtCut" , 0. );
243 desc.
add<
double>(
"TriMuonPtCut" , 8. );
244 desc.
add<
double>(
"TriMuonEtaCut" , 2.5 );
245 desc.
add<
double>(
"ChargedAbsIsoCut", 3.0 );
246 desc.
add<
double>(
"ChargedRelIsoCut", 0.1 );
247 desc.
add<
double>(
"IsoConeSize" , 0.5 );
248 desc.
add<
double>(
"MatchingConeSize", 0.03 );
249 desc.
add<
double>(
"MinTriMuonMass" , 0.5 );
250 desc.
add<
double>(
"MaxTriMuonMass" , 2.8 );
251 desc.
add<
double>(
"MaxTriMuonRadius", 0.6 );
252 desc.
add<
int> (
"TriMuonAbsCharge", -1 );
253 desc.
add<
double>(
"MaxDZ" , 0.3 );
254 desc.
add<
bool> (
"EnableRelIso" ,
false);
255 desc.
add<
bool> (
"EnableAbsIso" ,
true );
256 descriptions.
add(
"hltTriMuonIsolationProducer",desc);
virtual double pt() const final
transverse momentum
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_
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_
virtual void setPdgId(int pdgId) final
std::vector< Track > TrackCollection
collection of Tracks
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
static bool ptComparer(const reco::RecoChargedCandidate &mu_1, const reco::RecoChargedCandidate &mu_2)
const double TriMuonEtaCut_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const double ChargedAbsIsoCut_
const double IsoConeSize_
const double MatchingConeSize_
virtual void setCharge(Charge q) final
set electric charge
Abs< T >::type abs(const T &t)
edm::Handle< reco::TrackCollection > IsoTracks
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual double vz() const
z coordinate of vertex position
virtual void setVertex(const Point &vertex)
set vertex
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
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double ChargedRelIsoCut_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > L3MuonsToken_
edm::Handle< reco::RecoChargedCandidateCollection > AllMuCands
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
edm::Handle< reco::RecoChargedCandidateRef > PassedL3Muons
HLTTriMuonIsolation(const edm::ParameterSet &iConfig)
virtual double vz() const =0
z coordinate of vertex position
const double MaxTriMuonRadius_
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
const edm::EDGetTokenT< reco::TrackCollection > IsoTracksToken_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > L3DiMuonsFilterToken_