-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addition of the MTD to the tracker Navigation #33272
Merged
cmsbuild
merged 6 commits into
cms-sw:master
from
parbol:TrackerMTDNavigationRebase_ver3
Apr 12, 2021
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4f09087
Rebasing the Tracker+MTD Navigation on top of latest changes on MTD l…
parbol e44fe17
Added code format checks
parbol 35eeeeb
Corrected ambiguity in << operator
parbol 936dd6b
Code-checks applied
parbol e5bea27
Update several comments in the PR
parbol fe53a85
Back to using get instead of get handle
parbol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
File renamed without changes.
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
...ers/plugins/BTLDetLayerGeometryBuilder.cc → ...tLayers/src/BTLDetLayerGeometryBuilder.cc
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
70 changes: 70 additions & 0 deletions
70
RecoTracker/GeometryESProducer/plugins/TrackerMTDRecoGeometryESProducer.cc
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,70 @@ | ||
#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" | ||
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" | ||
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" | ||
#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" | ||
#include "RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h" | ||
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" | ||
#include "Geometry/Records/interface/TrackerTopologyRcd.h" | ||
#include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h" | ||
#include "Geometry/MTDNumberingBuilder/interface/MTDTopology.h" | ||
#include "Geometry/Records/interface/MTDTopologyRcd.h" | ||
#include "Geometry/Records/interface/MTDDigiGeometryRecord.h" | ||
|
||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
#include "FWCore/Framework/interface/ESProducer.h" | ||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
class TrackerMTDRecoGeometryESProducer : public edm::ESProducer { | ||
public: | ||
TrackerMTDRecoGeometryESProducer(const edm::ParameterSet &p); | ||
|
||
std::unique_ptr<GeometricSearchTracker> produce(const TrackerRecoGeometryRecord &); | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); | ||
|
||
private: | ||
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; | ||
edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopToken_; | ||
edm::ESGetToken<MTDGeometry, MTDDigiGeometryRecord> mtdgeomToken_; | ||
edm::ESGetToken<MTDTopology, MTDTopologyRcd> mtdTopToken_; | ||
bool usePhase2Stacks_; | ||
}; | ||
|
||
using namespace edm; | ||
|
||
TrackerMTDRecoGeometryESProducer::TrackerMTDRecoGeometryESProducer(const edm::ParameterSet &p) | ||
: usePhase2Stacks_(p.getParameter<bool>("usePhase2Stacks")) { | ||
auto c = setWhatProduced(this); | ||
|
||
tTopToken_ = c.consumes(); | ||
geomToken_ = c.consumes(edm::ESInputTag("", p.getUntrackedParameter<std::string>("trackerGeometryLabel"))); | ||
mtdgeomToken_ = c.consumes(); | ||
mtdTopToken_ = c.consumes(); | ||
} | ||
|
||
std::unique_ptr<GeometricSearchTracker> TrackerMTDRecoGeometryESProducer::produce( | ||
const TrackerRecoGeometryRecord &iRecord) { | ||
TrackerGeometry const &tG = iRecord.get(geomToken_); | ||
MTDGeometry const &mG = iRecord.get(mtdgeomToken_); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this |
||
|
||
GeometricSearchTrackerBuilder builder; | ||
return std::unique_ptr<GeometricSearchTracker>( | ||
builder.build(tG.trackerDet(), &tG, &iRecord.get(tTopToken_), &mG, &iRecord.get(mtdTopToken_), usePhase2Stacks_)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this one. As this is fresh new code, it would be good IMHO to fix it immediately |
||
} | ||
|
||
void TrackerMTDRecoGeometryESProducer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { | ||
edm::ParameterSetDescription desc; | ||
|
||
desc.add<bool>("usePhase2Stacks", false); | ||
desc.addUntracked<std::string>("trackerGeometryLabel", ""); | ||
descriptions.addDefault(desc); | ||
} | ||
|
||
DEFINE_FWK_EVENTSETUP_MODULE(TrackerMTDRecoGeometryESProducer); |
8 changes: 8 additions & 0 deletions
8
RecoTracker/GeometryESProducer/python/TrackerMTDRecoGeometryESProducer_cfi.py
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,8 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
TrackerRecoGeometryESProducer = cms.ESProducer("TrackerMTDRecoGeometryESProducer", | ||
usePhase2Stacks = cms.bool(False) | ||
) | ||
|
||
from Configuration.ProcessModifiers.vectorHits_cff import vectorHits | ||
vectorHits.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parbol the clang-tidy warninbg reported refers to this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry these were false positives. The original code (in ESProducers) is fine (and slightly better than going through
getHandle()
).