-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Addition of the MTD to the tracker Navigation #33272
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
Changes from 4 commits
4f09087
e44fe17
35eeeeb
936dd6b
e5bea27
fe53a85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| #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); | ||
|
|
||
| // 08-Oct-2007 - Patrick Janot | ||
| // Allow several reco geometries to be created, corresponding to the labelled | ||
| // TrackerDigiGeometry's - that must created beforehand. Useful to handle an | ||
| // aligned and a misaligned geometry in the same job. | ||
| // The default parameter ("") makes this change transparent to the user | ||
| // See FastSimulation/Configuration/data/ for examples of cfi's. | ||
| 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_); | ||
|
Contributor
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. @parbol the clang-tidy warninbg reported refers to this line
Contributor
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. Sorry these were false positives. The original code (in ESProducers) is fine (and slightly better than going through |
||
| MTDGeometry const &mG = iRecord.get(mtdgeomToken_); | ||
|
Contributor
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_)); | ||
|
Contributor
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); | ||
| 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) |
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.
I understand that this was originally derived from RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc
However, the comments copy-pasted here do not fully apply to the current case: either update them, or simply remove them, in order to avoid possible future misunderstandings
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.
Hi Andrea,
Thanks. Yes, I have removed them in a later commit.