|
|
Go to the documentation of this file.
47 : inputMuonCollections_(iConfig.getParameter<
std::vector<
edm::
InputTag> >(
"InputMuonCollections")),
48 inputTrackCollections_(iConfig.getParameter<
std::vector<
edm::
InputTag> >(
"InputTrackCollections")),
49 inputCosmicMuonCollection_(iConfig.getParameter<
edm::
InputTag>(
"InputCosmicMuonCollection")),
50 inputVertexCollection_(iConfig.getParameter<
edm::
InputTag>(
"InputVertexCollection")) {
104 const std::string theCategory =
"MuonCosmicCompatibilityFiller";
129 float offTimeNegMult, offTimePosMult, offTimeNeg, offTimePos;
146 if (
muon.isTimeValid()) {
149 float positiveTime = 0;
150 if (
muon.time().timeAtIpInOut < offTimeNegMult ||
muon.time().timeAtIpInOut > offTimePosMult)
152 if (
muon.time().timeAtIpInOut > 0.)
153 positiveTime =
muon.time().timeAtIpInOut;
162 if (outertrack->phi() > 0)
170 for (reco::MuonCollection::const_iterator iMuon = muonHandle->begin(); iMuon != muonHandle->end();
172 if (!iMuon->isGlobalMuon())
176 if (
muon.isTimeValid()) {
178 if (checkedTrack->phi() < 0 && isUp) {
182 }
else if (checkedTrack->phi() > 0 && !isUp) {
195 if (
muon.time().timeAtIpInOut < offTimeNeg ||
muon.time().timeAtIpInOut > offTimePos)
200 if (!isLoose &&
result > 0) {
216 if (
muon.isGlobalMuon())
218 else if (
muon.isTrackerMuon())
220 else if (
muon.isStandAloneMuon() ||
muon.isRPCMuon() ||
muon.isGEMMuon() ||
muon.isME0Muon())
223 for (
unsigned int iColl = 0; iColl <
trackTokens_.size(); ++iColl) {
238 unsigned int nGlb = 0;
244 for (reco::MuonCollection::const_iterator iMuon = muonHandle->begin(); iMuon != muonHandle->end(); ++iMuon) {
245 if (!iMuon->isGlobalMuon())
267 bool overlappingMuon =
false;
268 if (!
muon.isGlobalMuon())
281 RefVtx.SetXYZ(0, 0, 0);
286 for (reco::VertexCollection::const_iterator it =
vertices.begin(); it !=
vertices.end(); ++it) {
287 RefVtx = it->position();
291 for (reco::MuonCollection::const_iterator cosmicMuon = muonHandle->begin(); cosmicMuon != muonHandle->end();
293 if (cosmicMuon->innerTrack() ==
muon.innerTrack() || cosmicMuon->outerTrack() ==
muon.outerTrack())
300 if (outertrack->phi() > 0)
304 int RecHitsMuon = outertrack->numberOfValidHits();
305 int RecHitsCosmicMuon = 0;
317 if ((*coshit)->isValid()) {
318 DetId id((*coshit)->geographicalId());
325 if (isUp && hity > 0)
327 if (!isUp && hity < 0)
343 GlobalPoint muonRefVtx(outertrack->vx(), outertrack->vy(), outertrack->vz());
344 GlobalPoint cosmicRefVtx(costrack->vx(), costrack->vy(), costrack->vz());
351 if ((*trkhit)->isValid()) {
354 if ((*coshit)->isValid()) {
355 if ((*trkhit)->geographicalId() == (*coshit)->geographicalId()) {
356 if (((*trkhit)->localPosition() - (*coshit)->localPosition()).
mag() < 10
e-5)
367 if (RecHitsMuon != 0)
368 fraction = shared / (double)RecHitsMuon;
371 overlappingMuon =
true;
377 return overlappingMuon;
385 bool isLoose)
const {
386 float maxdxyMult, maxdzMult, maxdxy, maxdz;
404 if (
muon.isGlobalMuon())
406 else if (
muon.isTrackerMuon() ||
muon.isRPCMuon())
408 else if (
muon.isStandAloneMuon())
411 bool multipleMu =
false;
416 RefVtx.SetXYZ(0, 0, 0);
421 for (reco::VertexCollection::const_iterator it =
vertices.begin(); it !=
vertices.end(); ++it) {
422 RefVtx = it->position();
424 if (
track.isNonnull()) {
428 if (fabs((*track).dxy(RefVtx)) < maxdxyMult || fabs((*track).dz(RefVtx)) < maxdzMult) {
438 if (fabs((*track).dxy(RefVtx)) < maxdxy || fabs((*track).dz(RefVtx)) < maxdz) {
442 if (!isLoose && fabs((*track).dxy(RefVtx)) >
largedxy_)
450 if (
result == 0 && multipleMu) {
462 for (reco::MuonCollection::const_iterator
muons = muonHandle->begin();
muons != muonHandle->end(); ++
muons) {
463 if (!
muons->isGlobalMuon())
466 if (
muons->innerTrack() ==
muon.innerTrack() &&
muons->outerTrack() ==
muon.outerTrack())
470 if (
muons->isGlobalMuon())
472 if (fabs((*tracks).dxy(RefVtx)) >
hIpTrdxy_)
494 bool checkVertex)
const {
499 if (
muon.isGlobalMuon()) {
510 if (checkVertex && cosmicVertex == 0)
518 double weight_btob = 2.0;
519 double weight_ip = 2.0;
520 double weight_time = 1.0;
521 double weight_overlap = 0.5;
527 if (backToback >= 1) {
529 result += weight_btob * 2.;
534 result -= weight_btob * 0.5;
542 result += weight_ip * 2.0;
543 if (backToback == 0) {
545 if (tightTime == 0) {
546 if (looseTime == 0 && !isOverlapping)
547 result -= weight_ip * 1.0;
550 }
else if (tightIp >= 2) {
554 result -= weight_ip * 1.0;
561 if (backToback >= 1) {
563 result += weight_time * tightTime;
564 else if (looseIp == 0)
565 result += weight_time * 0.25;
568 if (backToback >= 1 && tightIp == 0)
569 result += weight_time * 0.25;
574 if (backToback == 0 && isOverlapping) {
576 if (tightIp == 0 && tightTime >= 1) {
577 result += weight_overlap * 1.0;
608 for (reco::VertexCollection::const_iterator it =
vertices.begin(); it !=
vertices.end(); ++it) {
const Surface::PositionType & position() const
The position (origin of the R.F.)
float timeCompatibility
cosmic-likeness based on time: 0 == prompt-like
double offTimeNegLooseMult_
std::vector< edm::InputTag > inputTrackCollections_
T const * product() const
edm::EDGetTokenT< reco::MuonCollection > cosmicToken_
std::vector< edm::EDGetTokenT< reco::TrackCollection > > trackTokens_
~MuonCosmicCompatibilityFiller()
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
std::vector< Vertex > VertexCollection
collection of Vertex objects
unsigned int nMuons(const edm::Event &) const
get number of muons in the vent
float backToBackCompatibility
cosmic-likeness based on presence of a track in opp side: 0 == no matching opp tracks
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
reco::MuonCosmicCompatibility fillCompatibility(const reco::Muon &muon, edm::Event &, const edm::EventSetup &)
fill cosmic compatibility variables
unsigned int pvMatches(const edm::Event &, const reco::Muon &, bool) const
return cosmic-likeness based on the 2D impact parameters (dxy, dz wrt to PV). 0 == cosmic-like
float combinedCosmicID(const edm::Event &, const edm::EventSetup &iSetup, const reco::Muon &, bool CheckMuonID, bool checkVertex) const
combined cosmic-likeness: 0 == not cosmic-like
std::vector< Muon > MuonCollection
collection of Muon objects
double offTimeNegTightMult_
float cosmicCompatibility
combined cosmic-likeness: 0 == not cosmic-like
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
float vertexCompatibility
cosmic-likeness based on the event activity information: tracker track multiplicity and vertex qualit...
MuonCosmicCompatibilityFiller(const edm::ParameterSet &, edm::ConsumesCollector &)
bool checkMuonID(const reco::Muon &) const
tag a muon as cosmic based on the muonID information
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::InputTag inputCosmicMuonCollection_
unsigned int eventActivity(const edm::Event &, const reco::Muon &) const
returns cosmic-likeness based on the event activity information: tracker track multiplicity and verte...
float muonTiming(const edm::Event &iEvent, const reco::Muon &muon, bool isLoose) const
check muon time (DT and CSC) information: 0 == prompt-like
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
bool isNonnull() const
Checks for non-null.
float overlapCompatibility
cosmic-likeness based on overlap with traversing cosmic muon (only muon/STA hits are used)
std::vector< edm::InputTag > inputMuonCollections_
unsigned int backToBack2LegCosmic(const edm::Event &, const reco::Muon &) const
return cosmic-likeness based on presence of a track in opp side: 0 == no matching opp tracks
std::vector< edm::EDGetTokenT< reco::MuonCollection > > muonTokens_
float ipCompatibility
cosmic-likeness based on the 2D impact parameters (dxy, dz wrt to PV). 0 == cosmic-like
edm::InputTag inputVertexCollection_
T getParameter(std::string const &) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
double offTimePosTightMult_
bool isOverlappingMuon(const edm::Event &, const edm::EventSetup &iSetup, const reco::Muon &) const
returns cosmic-likeness based on overlap with traversing cosmic muon (only muon/STA hits are used)
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
const GeomDet * idToDet(DetId) const override
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
bool checkMuonSegments(const reco::Muon &muon) const
tag a muon as cosmic based on segment compatibility and the number of segment matches
double offTimePosLooseMult_
reco::TrackRef findOppositeTrack(const edm::Handle< reco::TrackCollection > &collection, const reco::Track &muon, double angleMatch=0.01, double momentumMatch=0.05)
std::vector< Track > TrackCollection
collection of Tracks