33 using namespace trigger;
38 muCandTag_ (iConfig.getParameter<edm::
InputTag>(
"MuCand")),
40 trkCandTag_ (iConfig.getParameter<edm::
InputTag>(
"TrackCand")),
42 thirdTrackMass_(iConfig.getParameter<double>(
"ThirdTrackMass")),
43 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
44 minPt_(iConfig.getParameter<double>(
"MinPt")),
45 minInvMass_(iConfig.getParameter<double>(
"MinInvMass")),
46 maxInvMass_(iConfig.getParameter<double>(
"MaxInvMass")),
47 maxNormalisedChi2_(iConfig.getParameter<double>(
"MaxNormalisedChi2")),
48 minLxySignificance_(iConfig.getParameter<double>(
"MinLxySignificance")),
49 minCosinePointingAngle_(iConfig.getParameter<double>(
"MinCosinePointingAngle")),
50 minD0Significance_(iConfig.getParameter<double>(
"MinD0Significance")),
51 fastAccept_(iConfig.getParameter<bool>(
"FastAccept")),
52 beamSpotTag_ (iConfig.getParameter<edm::
InputTag> (
"BeamSpotTag")),
55 produces<VertexCollection>();
56 produces<CandidateCollection>();
71 desc.
add<
double>(
"ThirdTrackMass",0.106);
72 desc.
add<
double>(
"MaxEta",2.5);
73 desc.
add<
double>(
"MinPt",3.0);
74 desc.
add<
double>(
"MinInvMass",1.2);
75 desc.
add<
double>(
"MaxInvMass",2.2);
76 desc.
add<
double>(
"MaxNormalisedChi2",10.0);
77 desc.
add<
double>(
"MinLxySignificance",3.0);
78 desc.
add<
double>(
"MinCosinePointingAngle",0.9);
79 desc.
add<
double>(
"MinD0Significance",0.0);
80 desc.
add<
bool>(
"FastAccept",
false);
82 descriptions.
add(
"hltmmkFilter",desc);
100 const double MuMass(0.106);
101 const double MuMass2(MuMass*MuMass);
146 vector<TrackRef> trkMuCands;
149 vector<bool> isUsedCand(trkcands->size(),
false);
154 for (RecoChargedCandidateCollection::const_iterator mucand1=mucands->begin(), endCand1=mucands->end(); mucand1!=endCand1; ++mucand1) {
156 if ( mucands->size()<2)
break;
157 if ( trkcands->size()<1)
break;
160 LogDebug(
"HLTDisplacedMumukFilter") <<
" 1st muon: q*pt= " << trk1->charge()*trk1->pt() <<
", eta= " << trk1->eta() <<
", hits= " << trk1->numberOfValidHits();
163 if (fabs(trk1->eta()) >
maxEta_)
continue;
166 if (trk1->pt() <
minPt_)
continue;
168 RecoChargedCandidateCollection::const_iterator mucand2 = mucand1; ++mucand2;
170 for (RecoChargedCandidateCollection::const_iterator endCand2=mucands->end(); mucand2!=endCand2; ++mucand2) {
174 LogDebug(
"HLTDisplacedMumukFilter") <<
" 2nd muon: q*pt= " << trk2->charge()*trk2->pt() <<
", eta= " << trk2->eta() <<
", hits= " << trk2->numberOfValidHits();
177 if (fabs(trk2->eta()) >
maxEta_)
continue;
180 if (trk2->pt() <
minPt_)
continue;
182 RecoChargedCandidateCollection::const_iterator trkcand, endCandTrk;
184 std::vector<bool>::iterator isUsedIter, endIsUsedCand;
187 for ( trkcand = trkcands->begin(), endCandTrk=trkcands->end(), isUsedIter = isUsedCand.begin(), endIsUsedCand = isUsedCand.end(); trkcand != endCandTrk && isUsedIter != endIsUsedCand; ++trkcand, ++isUsedIter) {
191 if (
overlap(*mucand1,*trkcand)) {
192 trkMuCands.push_back(trk3);
196 else if (
overlap(*mucand2,*trkcand)){
197 trkMuCands.push_back(trk3);
202 if(trkMuCands.size()==2)
break;
209 for ( trkcand = trkcands->begin(), endCandTrk=trkcands->end(), isUsedIter = isUsedCand.begin(), endIsUsedCand = isUsedCand.end(); trkcand != endCandTrk && isUsedIter != endIsUsedCand; ++trkcand, ++isUsedIter) {
213 LogDebug(
"HLTDisplacedMumukFilter") <<
" 3rd track: q*pt= " << trk3->charge()*trk3->pt() <<
", eta= " << trk3->eta() <<
", hits= " << trk3->numberOfValidHits();
217 for (
unsigned int itmc=0;itmc<trkMuCands.size();itmc++)
if(trk3==trkMuCands.at(itmc)) skip=
true;
221 if(*isUsedIter)
continue;
224 if (fabs(trk3->eta()) >
maxEta_)
continue;
227 if (trk3->pt() <
minPt_)
continue;
230 e1 =
sqrt(trk1->momentum().Mag2()+MuMass2);
231 e2 =
sqrt(trk2->momentum().Mag2()+MuMass2);
232 e3 =
sqrt(trk3->momentum().Mag2()+thirdTrackMass2);
241 double invmass =
abs(p.mass());
243 LogDebug(
"HLTDisplacedMumukFilter") <<
" Invmass= " << invmass;
248 vector<TransientTrack> t_tks;
249 t_tks.push_back((*theB).build(&trk1));
250 t_tks.push_back((*theB).build(&trk2));
251 t_tks.push_back((*theB).build(&trk3));
253 if (t_tks.size()!=3)
continue;
273 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() -secondaryVertex.
x()) + (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()), -1*((vertexBeamSpot.
y0() - secondaryVertex.
y())+ (secondaryVertex.
z() -vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()), 0);
275 float lxy = displacementFromBeamspot.
perp();
276 float lxyerr =
sqrt(err.
rerr(displacementFromBeamspot));
282 Vertex::Point vperp(displacementFromBeamspot.
x(),displacementFromBeamspot.
y(),0.);
285 float cosAlpha = vperp.Dot(pperp)/(vperp.R()*pperp.R());
287 LogDebug(
"HLTDisplacedMumukFilter") <<
" vertex fit normalised chi2: " << normChi2 <<
", Lxy significance: " << lxy/lxyerr <<
", cosine pointing angle: " << cosAlpha;
290 vertexCollection->push_back(vertex);
296 LogDebug(
"HLTDisplacedMumukFilter") <<
" Event passed!";
305 vector<RecoChargedCandidateRef> vref;
307 for (
unsigned int i=0;
i<vref.size();
i++) {
312 }
else if (trktmp==trk2) {
314 }
else if (trktmp==trk3) {
317 if (i1done && i2done && i3done)
break;
341 const bool accept (counter >= 1);
343 LogDebug(
"HLTDisplacedMumukFilter") <<
" >>>>> Result of HLTDisplacedMumukFilter is "<< accept <<
", number of muon pairs passing thresholds= " <<
counter;
345 iEvent.
put(vertexCollection);
367 double dpt = a.
pt() - b.
pt();
373 double deta = a.
eta() - b.
eta();
376 if ((dphi + deta) < eps) {
GlobalError positionError() const
static int overlap(const reco::Candidate &, const reco::Candidate &)
double z0() const
z coordinate
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trkCandToken_
HLTmmkFilter(const edm::ParameterSet &)
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Measurement1D transverseImpactParameter() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual double pt() const =0
transverse momentum
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
std::vector< Vertex > VertexCollection
collection of Vertex objects
const Vector & momentum() const
track momentum vector
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
virtual bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
double dydz() const
dydz slope
float normalisedChiSquared() const
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
CovarianceMatrix covariance() const
return track covariance matrix
GlobalPoint position() const
Abs< T >::type abs(const T &t)
math::XYZPoint Point
point in the space
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
T const * get() const
Returns C++ pointer to the item.
edm::InputTag trkCandTag_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double dxdz() const
dxdz slope
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muCandToken_
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
double significance() const
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
T rerr(const GlobalPoint &aPoint) const
T const * product() const
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double minCosinePointingAngle_
const double thirdTrackMass_
static std::atomic< unsigned int > counter
double y0() const
y coordinate
int charge() const
track electric charge
const double maxNormalisedChi2_
static FreeTrajectoryState initialFreeState(const reco::Track &, const MagneticField *)
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
const double minD0Significance_
math::PtEtaPhiELorentzVectorF LorentzVector
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity
const double minLxySignificance_
double x0() const
x coordinate