31 muCandTag_ (iConfig.getParameter<
edm::
InputTag>(
"MuonTag")),
33 trkCandTag_ (iConfig.getParameter<
edm::
InputTag>(
"TrackTag")),
35 MuMuTkVertexTag_ (iConfig.getParameter<
edm::
InputTag>(
"MuMuTkVertexTag")),
37 beamSpotTag_ (iConfig.getParameter<
edm::
InputTag> (
"BeamSpotTag")),
39 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
40 minPt_(iConfig.getParameter<double>(
"MinPt")),
41 maxNormalisedChi2_(iConfig.getParameter<double>(
"MaxNormalisedChi2")),
42 minVtxProbability_(iConfig.getParameter<double>(
"MinVtxProbability")),
43 minLxySignificance_(iConfig.getParameter<double>(
"MinLxySignificance")),
44 minCosinePointingAngle_(iConfig.getParameter<double>(
"MinCosinePointingAngle"))
55 desc.
add<
double>(
"MaxEta",2.5);
56 desc.
add<
double>(
"MinPt" ,0.0);
57 desc.
add<
double>(
"MaxNormalisedChi2" ,10.0);
58 desc.
add<
double>(
"MinVtxProbability" , 0.0);
59 desc.
add<
double>(
"MinLxySignificance",3.0);
60 desc.
add<
double>(
"MinCosinePointingAngle",0.9);
65 descriptions.
add(
"HLTmumutkFilter",desc);
80 if(foundVertexColl) displacedVertexColl = *displacedVertexCollHandle;
100 bool triggered =
false;
103 reco::VertexCollection::iterator it;
104 for(it = displacedVertexColl.begin(); it!= displacedVertexColl.end(); it++){
108 if(displacedVertex.
tracksSize() != 3)
throw cms::Exception(
"BadLogic") <<
"HLTmumutkFilter: ERROR: the Jpsi+trk vertex must have " 109 <<
"exactly two muons + 1 trk by definition. It now has n trakcs = " 115 double vtxProb = 0.0;
116 if ((displacedVertex.
chi2()>=0.0) && (displacedVertex.
ndof()>0) )
117 vtxProb = TMath::Prob(displacedVertex.
chi2(), displacedVertex.
ndof() );
129 reco::RecoChargedCandidateCollection::const_iterator mucand1;
130 reco::RecoChargedCandidateCollection::const_iterator mucand2;
131 reco::RecoChargedCandidateCollection::const_iterator tkcand ;
134 bool track1Matched =
false;
135 bool track2Matched =
false;
136 bool track3Matched =
false;
137 for (
auto cand=mucands->begin();
cand!=mucands->end();
cand++) {
139 if (!track1Matched) {
140 if (tkRef == vertextkRef1 && iFoundRefs==0) {mucand1 =
cand; iFoundRefs++; track1Matched =
true;}
141 else if(tkRef == vertextkRef1 && iFoundRefs==1) {mucand2 =
cand; iFoundRefs++; track1Matched =
true;}
143 if (!track2Matched) {
144 if (tkRef == vertextkRef2 && iFoundRefs==0) {mucand1 =
cand; iFoundRefs++; track2Matched =
true;}
145 else if(tkRef == vertextkRef2 && iFoundRefs==1) {mucand2 =
cand; iFoundRefs++; track2Matched =
true;}
147 if (!track3Matched) {
148 if (tkRef == vertextkRef3 && iFoundRefs==0) {mucand1 =
cand; iFoundRefs++; track3Matched =
true;}
149 else if(tkRef == vertextkRef3 && iFoundRefs==1) {mucand2 =
cand; iFoundRefs++; track3Matched =
true;}
152 if(iFoundRefs < 2)
throw cms::Exception(
"BadLogic") <<
"HLTmumutkFilterr: ERROR: the vertex must have " 153 <<
" at least two muons by definition." << std::endl;
155 int iTrkFoundRefs = 0;
156 for (
auto cand=trkcands->begin();
cand!=trkcands->end();
cand++) {
158 if (tkRef == vertextkRef1 && iTrkFoundRefs==0 && !track1Matched) {tkcand =
cand; iTrkFoundRefs++; track1Matched =
true;
break;}
159 if (tkRef == vertextkRef2 && iTrkFoundRefs==0 && !track2Matched) {tkcand =
cand; iTrkFoundRefs++; track2Matched =
true;
break;}
160 if (tkRef == vertextkRef3 && iTrkFoundRefs==0 && !track3Matched) {tkcand =
cand; iTrkFoundRefs++; track3Matched =
true;
break;}
162 if(iTrkFoundRefs == 0)
throw cms::Exception(
"BadLogic") <<
"HLTmumutkFilterr: ERROR: the vertex must have " 163 <<
" at least one track by definition." << std::endl;
167 mucand1->py() + mucand2->py() + tkcand->py(),
173 GlobalPoint secondaryVertex (vpoint.x(), vpoint.y(), vpoint.z());
174 GlobalError err(verr.At(0,0), verr.At(1,0), verr.At(1,1), verr.At(2,0), verr.At(2,1), verr.At(2,2) );
176 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.x()) + (secondaryVertex.z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
177 -1*((vertexBeamSpot.
y0() - secondaryVertex.y()) + (secondaryVertex.z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
179 float lxy = displacementFromBeamspot.perp();
180 float lxyerr =
sqrt(err.rerr(displacementFromBeamspot));
183 Vertex::Point vperp(displacementFromBeamspot.x(),displacementFromBeamspot.y(),0.);
184 float cosAlpha = vperp.Dot(pperp)/(vperp.R()*pperp.R());
186 if (pperp.R() <
minPt_ )
continue;
200 LogDebug(
"HLTDisplacedMumuTrkFilter") <<
" >>>>> Result of HLTDisplacedMuMuTrkFilter is "<< triggered;
208 unsigned int i_max=vcands.size();
210 if (candref == vcands[i])
return true;
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
static bool triggerdByPreviousLevel(const reco::RecoChargedCandidateRef &, const std::vector< reco::RecoChargedCandidateRef > &)
double z0() const
z coordinate
const double maxNormalisedChi2_
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
HLTmumutkFilter(const edm::ParameterSet &)
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::vector< Vertex > VertexCollection
collection of Vertex objects
const double minLxySignificance_
const Point & position() const
position
edm::InputTag trkCandTag_
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
~HLTmumutkFilter() override
double dydz() const
dydz slope
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trkCandToken_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muCandToken_
const double minCosinePointingAngle_
double chi2() const
chi-squares
const double minVtxProbability_
math::XYZPoint Point
point in the space
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double dxdz() const
dxdz slope
edm::EDGetTokenT< reco::VertexCollection > MuMuTkVertexToken_
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Error error() const
return SMatrix
double y0() const
y coordinate
double normalizedChi2() const
chi-squared divided by n.d.o.f.
trackRef_iterator tracks_begin() const
first iterator over tracks
size_t tracksSize() const
number of tracks
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
double x0() const
x coordinate