forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cms-sw#21148 from makortel/ntuple_matchScore
Update TrackingNtuple
- Loading branch information
Showing
15 changed files
with
789 additions
and
477 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
SimTracker/TrackAssociation/interface/trackAssociationChi2.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef SimTracker_TrackAssociation_trackAssociationChi2_h | ||
#define SimTracker_TrackAssociation_trackAssociationChi2_h | ||
|
||
#include "DataFormats/TrackReco/interface/TrackBase.h" | ||
#include "MagneticField/Engine/interface/MagneticField.h" | ||
#include "DataFormats/BeamSpot/interface/BeamSpot.h" | ||
#include "DataFormats/GeometryVector/interface/Basic3DVector.h" | ||
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" | ||
|
||
namespace track_associator { | ||
/// basic method where chi2 is computed | ||
double trackAssociationChi2(const reco::TrackBase::ParameterVector& rParameters, | ||
const reco::TrackBase::CovarianceMatrix& recoTrackCovMatrix, | ||
const Basic3DVector<double>& momAtVtx, | ||
const Basic3DVector<double>& vert, | ||
int charge, | ||
const MagneticField& magfield, | ||
const reco::BeamSpot& bs) ; | ||
|
||
double trackAssociationChi2(const reco::TrackBase::ParameterVector& rParameters, | ||
const reco::TrackBase::CovarianceMatrix& recoTrackCovMatrix, | ||
const TrackingParticle& trackingParticle, | ||
const MagneticField& magfield, | ||
const reco::BeamSpot& bs); | ||
|
||
double trackAssociationChi2(const reco::TrackBase& track, | ||
const TrackingParticle& trackingParticle, | ||
const MagneticField& magfield, | ||
const reco::BeamSpot& bs); | ||
} | ||
|
||
#endif |
78 changes: 78 additions & 0 deletions
78
SimTracker/TrackAssociation/interface/trackHitsToClusterRefs.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#ifndef SimTracker_TrackAssociation_trackHitsToClusterRefs_h | ||
#define SimTracker_TrackAssociation_trackHitsToClusterRefs_h | ||
|
||
#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" | ||
#include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h" | ||
#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" | ||
#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" | ||
#include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h" | ||
#include "DataFormats/SiStripDetId/interface/SiStripDetId.h" | ||
#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" | ||
|
||
namespace track_associator { | ||
const TrackingRecHit* getHitFromIter(trackingRecHit_iterator iter) { | ||
return &(**iter); | ||
} | ||
|
||
const TrackingRecHit* getHitFromIter(TrackingRecHitCollection::const_iterator iter) { | ||
return &(*iter); | ||
} | ||
|
||
template<typename iter> | ||
std::vector<OmniClusterRef> hitsToClusterRefs(iter begin, iter end) { | ||
std::vector<OmniClusterRef> returnValue; | ||
for (iter iRecHit = begin; iRecHit != end; ++iRecHit) { | ||
const TrackingRecHit* rhit = getHitFromIter(iRecHit); | ||
if (rhit->isValid()) { | ||
int subdetid = rhit->geographicalId().subdetId(); | ||
if (subdetid==PixelSubdetector::PixelBarrel||subdetid==PixelSubdetector::PixelEndcap) { | ||
const SiPixelRecHit* pRHit = dynamic_cast<const SiPixelRecHit*>(rhit); | ||
if (!pRHit->cluster().isNonnull()) | ||
edm::LogError("TrackAssociator") << ">>> RecHit does not have an associated cluster!" << " file: " << __FILE__ << " line: " << __LINE__; | ||
returnValue.push_back(pRHit->omniClusterRef()); | ||
} | ||
else if (subdetid==SiStripDetId::TIB||subdetid==SiStripDetId::TOB||subdetid==SiStripDetId::TID||subdetid==SiStripDetId::TEC) { | ||
const std::type_info &tid = typeid(*rhit); | ||
if (tid == typeid(SiStripMatchedRecHit2D)) { | ||
const SiStripMatchedRecHit2D* sMatchedRHit = dynamic_cast<const SiStripMatchedRecHit2D*>(rhit); | ||
if (!sMatchedRHit->monoHit().cluster().isNonnull() || !sMatchedRHit->stereoHit().cluster().isNonnull()) | ||
edm::LogError("TrackAssociator") << ">>> RecHit does not have an associated cluster!" << " file: " << __FILE__ << " line: " << __LINE__; | ||
returnValue.push_back(sMatchedRHit->monoClusterRef()); | ||
returnValue.push_back(sMatchedRHit->stereoClusterRef()); | ||
} | ||
else if (tid == typeid(SiStripRecHit2D)) { | ||
const SiStripRecHit2D* sRHit = dynamic_cast<const SiStripRecHit2D*>(rhit); | ||
if (!sRHit->cluster().isNonnull()) | ||
edm::LogError("TrackAssociator") << ">>> RecHit does not have an associated cluster!" << " file: " << __FILE__ << " line: " << __LINE__; | ||
returnValue.push_back(sRHit->omniClusterRef()); | ||
} | ||
else if (tid == typeid(SiStripRecHit1D)) { | ||
const SiStripRecHit1D* sRHit = dynamic_cast<const SiStripRecHit1D*>(rhit); | ||
if (!sRHit->cluster().isNonnull()) | ||
edm::LogError("TrackAssociator") << ">>> RecHit does not have an associated cluster!" << " file: " << __FILE__ << " line: " << __LINE__; | ||
returnValue.push_back(sRHit->omniClusterRef()); | ||
} | ||
else if (tid == typeid(Phase2TrackerRecHit1D)) { | ||
const Phase2TrackerRecHit1D* ph2Hit = dynamic_cast<const Phase2TrackerRecHit1D*>(rhit); | ||
if (!ph2Hit->cluster().isNonnull() ) | ||
edm::LogError("TrackAssociator") << ">>> RecHit does not have an associated cluster!" << " file: " << __FILE__ << " line: " << __LINE__; | ||
returnValue.push_back(ph2Hit->omniClusterRef()); | ||
} | ||
else { | ||
auto const & thit = static_cast<BaseTrackerRecHit const&>(*rhit); | ||
if ( thit.isProjected() ) { | ||
} else { | ||
edm::LogError("TrackAssociator") << ">>> getMatchedClusters: TrackingRecHit not associated to any SiStripCluster! subdetid = " << subdetid; | ||
} | ||
} | ||
} | ||
else { | ||
edm::LogError("TrackAssociator") << ">>> getMatchedClusters: TrackingRecHit not associated to any cluster! subdetid = " << subdetid; | ||
} | ||
} | ||
} | ||
return returnValue; | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.