forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from makortel/mkfit_1040p1
MkFit modules and test configs from makortel:mkfit_1040p1
- Loading branch information
Showing
36 changed files
with
10,937 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<use name="DataFormats/Provenance"/> | ||
<use name="DataFormats/TrackerCommon"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/MessageLogger"/> | ||
<use name="Geometry/TrackerGeometryBuilder"/> | ||
<use name="RecoTracker/TkDetLayers"/> | ||
<use name="mkfit"/> | ||
<use name="rootcore"/> | ||
<export> | ||
<lib name="RecoTrackerMkFit"/> | ||
</export> |
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,28 @@ | ||
#ifndef RecoTracker_MkFit_MkFitEventWrapper_h | ||
#define RecoTracker_MkFit_MkFitEventWrapper_h | ||
|
||
#include "RecoTracker/MkFit/interface/MkFitIndexLayer.h" | ||
|
||
namespace mkfit { | ||
class Event; | ||
class TrackVec; | ||
} | ||
|
||
class MkFitEventWrapper { | ||
public: | ||
MkFitEventWrapper(); | ||
MkFitEventWrapper(MkFitIndexLayer&& indexLayers); | ||
~MkFitEventWrapper(); | ||
|
||
MkFitEventWrapper(MkFitEventWrapper&&) = default; | ||
MkFitEventWrapper& operator=(MkFitEventWrapper&&) = default; | ||
|
||
MkFitIndexLayer const& indexLayers() const { return indexLayer_; } | ||
|
||
private: | ||
MkFitIndexLayuer indexLayers_; //! | ||
Event event_; //! | ||
TrackVec seeds_; //! | ||
}; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef RecoTracker_MkFit_MkFitGeometry_h | ||
#define RecoTracker_MkFit_MkFitGeometry_h | ||
|
||
#include <memory> | ||
#include <unordered_map> | ||
#include <vector> | ||
|
||
namespace mkfit { | ||
class LayerNumberConverter; | ||
} | ||
|
||
class DetLayer; | ||
class GeometricSearchTracker; | ||
class TrackerGeometry; | ||
class TrackerTopology; | ||
|
||
/** | ||
* Collection of geometry-related objects for mkFit | ||
*/ | ||
class MkFitGeometry { | ||
public: | ||
explicit MkFitGeometry(const TrackerGeometry& geom, const GeometricSearchTracker& tracker, const TrackerTopology& ttopo); | ||
~MkFitGeometry(); | ||
|
||
mkfit::LayerNumberConverter const& layerNumberConverter() const { return *lnc_; } | ||
const std::vector<const DetLayer *>& detLayers() const { return dets_; } | ||
unsigned int uniqueIdInLayer(int layer, unsigned int detId) const { | ||
return detIdToShortId_.at(layer).at(detId); | ||
} | ||
|
||
private: | ||
std::unique_ptr<mkfit::LayerNumberConverter> lnc_; // for pimpl pattern | ||
std::vector<const DetLayer *> dets_; | ||
std::vector<std::unordered_map<unsigned int, unsigned int>> detIdToShortId_; | ||
}; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#ifndef RecoTracker_MkFit_MkFitHitIndexMap_h | ||
#define RecoTracker_MkFit_MkFitHitIndexMap_h | ||
|
||
#include "DataFormats/Provenance/interface/ProductID.h" | ||
|
||
#include <vector> | ||
|
||
class TrackingRecHit; | ||
|
||
/** | ||
* This class provides mappings | ||
* - from CMSSW(ProductID, cluster index) to mkFit(layer index, hit index) | ||
* - from mkFit(layer index, hit index) to pointer to CMSSW hit | ||
*/ | ||
class MkFitHitIndexMap { | ||
public: | ||
// This class holds the index and layer of a hit in the hit data | ||
// structure passed to mkFit | ||
class MkFitHit { | ||
public: | ||
MkFitHit() = default; | ||
explicit MkFitHit(int i, int l) : index_{i}, layer_{l} {} | ||
|
||
int index() const { return index_; } | ||
int layer() const { return layer_; } | ||
|
||
private: | ||
int index_ = -1; | ||
int layer_ = -1; | ||
}; | ||
|
||
MkFitHitIndexMap() = default; | ||
|
||
/** | ||
* Can be used to preallocate the internal vectors for CMSSW->mkFit mapping | ||
*/ | ||
void resizeByClusterIndex(edm::ProductID id, size_t clusterIndex); | ||
|
||
/** | ||
* Can be used to preallocate the internal vectors for mkFit->CMSSW mapping | ||
* | ||
* \param layer Layer index (in mkFit convention) | ||
* \param additionalSize Number of additional elements to make space for | ||
*/ | ||
void increaseLayerSize(int layer, size_t additionalSize); | ||
|
||
/** | ||
* Inserts a new hit in the mapping | ||
* | ||
* \param id ProductID of the cluster collection | ||
* \param clusterIndex Index of the cluster in the cluster collection | ||
* \param hit Index and layer of the hit in the mkFit hit data structure | ||
* \param hitPtr Pointer to the TrackingRecHit | ||
*/ | ||
void insert(edm::ProductID id, size_t clusterIndex, MkFitHit hit, const TrackingRecHit* hitPtr); | ||
|
||
/// Get mkFit hit index and layer | ||
const MkFitHit& mkFitHit(edm::ProductID id, size_t clusterIndex) const; | ||
|
||
/// Get CMSSW hit pointer | ||
const TrackingRecHit* hitPtr(MkFitHit hit) const { return mkFitToCMSSW_.at(hit.layer()).at(hit.index()).ptr; } | ||
|
||
/// Get CMSSW cluster index (currently used only for debugging) | ||
size_t clusterIndex(MkFitHit hit) const { return mkFitToCMSSW_.at(hit.layer()).at(hit.index()).clusterIndex; } | ||
|
||
private: | ||
// Helper struct to map (edm::ProductID, cluster index) to MkFitHit | ||
struct ClusterToMkFitHit { | ||
explicit ClusterToMkFitHit(edm::ProductID id) : productID(id) {} | ||
edm::ProductID productID; | ||
std::vector<MkFitHit> mkFitHits; // indexed by cluster index | ||
}; | ||
|
||
// Helper struct to map MkFitHit to (TrackingRecHit *, cluster index) | ||
struct CMSSWHit { | ||
CMSSWHit() = default; | ||
explicit CMSSWHit(const TrackingRecHit* p, size_t i) : ptr{p}, clusterIndex{i} {} | ||
const TrackingRecHit* ptr = nullptr; | ||
size_t clusterIndex = 0; | ||
}; | ||
|
||
std::vector<ClusterToMkFitHit> cmsswToMkFit_; // mapping from CMSSW(ProductID, cluster index) -> mkFit(index, layer) | ||
std::vector<std::vector<CMSSWHit> > mkFitToCMSSW_; // reverse mapping, mkFit(layer, index) -> CMSSW hit | ||
}; | ||
|
||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef RecoTracker_MkFit_MkFitInputWrapper_h | ||
#define RecoTracker_MkFit_MkFitInputWrapper_h | ||
|
||
#include "RecoTracker/MkFit/interface/MkFitHitIndexMap.h" | ||
|
||
#include <memory> | ||
#include <vector> | ||
|
||
namespace mkfit { | ||
class Hit; | ||
class Track; | ||
class LayerNumberConverter; | ||
using HitVec = std::vector<Hit>; | ||
using TrackVec = std::vector<Track>; | ||
} | ||
|
||
class MkFitInputWrapper { | ||
public: | ||
MkFitInputWrapper(); | ||
MkFitInputWrapper(MkFitHitIndexMap&& hitIndexMap, | ||
std::vector<mkfit::HitVec>&& hits, | ||
mkfit::TrackVec&& seeds); | ||
~MkFitInputWrapper(); | ||
|
||
MkFitInputWrapper(MkFitInputWrapper const&) = delete; | ||
MkFitInputWrapper& operator=(MkFitInputWrapper const&) = delete; | ||
MkFitInputWrapper(MkFitInputWrapper&&); | ||
MkFitInputWrapper& operator=(MkFitInputWrapper&&); | ||
|
||
MkFitHitIndexMap const& hitIndexMap() const { return hitIndexMap_; } | ||
mkfit::TrackVec const& seeds() const { return *seeds_; } | ||
std::vector<mkfit::HitVec> const& hits() const { return hits_; } | ||
|
||
private: | ||
MkFitHitIndexMap hitIndexMap_; | ||
std::vector<mkfit::HitVec> hits_; | ||
std::unique_ptr<mkfit::TrackVec> seeds_; // for pimpl pattern | ||
}; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef RecoTracker_MkFit_MkFitOutputWrapper_h | ||
#define RecoTracker_MkFit_MkFitOutputWrapper_h | ||
|
||
#include <vector> | ||
|
||
namespace mkfit { | ||
class Track; | ||
using TrackVec = std::vector<Track>; | ||
} | ||
|
||
class MkFitOutputWrapper { | ||
public: | ||
MkFitOutputWrapper(); | ||
MkFitOutputWrapper(mkfit::TrackVec&& candidateTracks, mkfit::TrackVec&& fitTracks); | ||
~MkFitOutputWrapper(); | ||
|
||
MkFitOutputWrapper(MkFitOutputWrapper const&) = delete; | ||
MkFitOutputWrapper& operator=(MkFitOutputWrapper const&) = delete; | ||
MkFitOutputWrapper(MkFitOutputWrapper&&); | ||
MkFitOutputWrapper& operator=(MkFitOutputWrapper&&); | ||
|
||
mkfit::TrackVec const& candidateTracks() const { return candidateTracks_; } | ||
mkfit::TrackVec const& fitTracks() const { return fitTracks_; } | ||
|
||
private: | ||
mkfit::TrackVec candidateTracks_; //! | ||
mkfit::TrackVec fitTracks_; //! | ||
}; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<library file="*.cc" name="RecoTrackerMkFitPlugins"> | ||
<use name="DataFormats/TrackCandidate"/> | ||
<use name="DataFormats/TrackReco"/> | ||
<use name="DataFormats/TrackerCommon"/> | ||
<use name="DataFormats/TrackerRecHit2D"/> | ||
<use name="DataFormats/TrajectorySeed"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/MessageLogger"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/PluginManager"/> | ||
<use name="Geometry/Records"/> | ||
<use name="Geometry/TrackerGeometryBuilder"/> | ||
<use name="RecoTracker/MeasurementDet"/> | ||
<use name="RecoTracker/MkFit"/> | ||
<use name="RecoTracker/TkDetLayers"/> | ||
<use name="RecoTracker/TransientTrackingRecHit"/> | ||
<use name="TrackingTools/GeomPropagators"/> | ||
<use name="TrackingTools/KalmanUpdators"/> | ||
<use name="TrackingTools/MaterialEffects"/> | ||
<use name="TrackingTools/Records"/> | ||
<use name="TrackingTools/TrackFitters"/> | ||
<use name="TrackingTools/TrajectoryState"/> | ||
<use name="TrackingTools/TransientTrackingRecHit"/> | ||
<use name="mkfit"/> | ||
<use name="rootmath"/> | ||
<flags EDM_PLUGIN="1"/> | ||
</library> |
Oops, something went wrong.