-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update of mkFit for 12_1_0_pre4 #35492
Changes from 2 commits
2bd2518
349e25f
423b028
494a85d
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 | ||||
---|---|---|---|---|---|---|
|
@@ -6,35 +6,107 @@ | |||||
#include "RecoTracker/MkFit/interface/MkFitGeometry.h" | ||||||
|
||||||
// mkFit includes | ||||||
#include "Track.h" | ||||||
#include "TrackerInfo.h" | ||||||
#include "mkFit/HitStructures.h" | ||||||
#include "mkFit/IterationConfig.h" | ||||||
|
||||||
namespace { | ||||||
using namespace mkfit; | ||||||
|
||||||
void partitionSeeds0(const TrackerInfo &trk_info, | ||||||
const TrackVec &in_seeds, | ||||||
const EventOfHits &eoh, | ||||||
IterationSeedPartition &part) { | ||||||
const int size = in_seeds.size(); | ||||||
|
||||||
for (int i = 0; i < size; ++i) { | ||||||
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.
Suggested change
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. Done, thanks. |
||||||
const Track &S = in_seeds[i]; | ||||||
|
||||||
const bool z_dir_pos = S.pz() > 0; | ||||||
|
||||||
HitOnTrack hot = S.getLastHitOnTrack(); | ||||||
float eta = eoh[hot.layer].GetHit(hot.index).eta(); | ||||||
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.
Suggested change
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. Done, thanks. |
||||||
|
||||||
// Region to be defined by propagation / intersection tests | ||||||
TrackerInfo::EtaRegion reg; | ||||||
|
||||||
const LayerInfo &outer_brl = trk_info.outer_barrel_layer(); | ||||||
|
||||||
const LayerInfo &tib1 = trk_info.m_layers[4]; | ||||||
const LayerInfo &tob1 = trk_info.m_layers[10]; | ||||||
|
||||||
const LayerInfo &tecp1 = trk_info.m_layers[27]; | ||||||
const LayerInfo &tecn1 = trk_info.m_layers[54]; | ||||||
|
||||||
const LayerInfo &tec_first = z_dir_pos ? tecp1 : tecn1; | ||||||
|
||||||
float maxR = S.maxReachRadius(); | ||||||
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.
Suggested change
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. Done, thanks. |
||||||
float z_at_maxr; | ||||||
|
||||||
bool can_reach_outer_brl = S.canReachRadius(outer_brl.m_rout); | ||||||
float z_at_outer_brl; | ||||||
bool misses_first_tec; | ||||||
if (can_reach_outer_brl) { | ||||||
z_at_outer_brl = S.zAtR(outer_brl.m_rout); | ||||||
if (z_dir_pos) | ||||||
misses_first_tec = z_at_outer_brl < tec_first.m_zmin; | ||||||
else | ||||||
misses_first_tec = z_at_outer_brl > tec_first.m_zmax; | ||||||
} else { | ||||||
z_at_maxr = S.zAtR(maxR); | ||||||
if (z_dir_pos) | ||||||
misses_first_tec = z_at_maxr < tec_first.m_zmin; | ||||||
else | ||||||
misses_first_tec = z_at_maxr > tec_first.m_zmax; | ||||||
} | ||||||
|
||||||
if (misses_first_tec) { | ||||||
reg = TrackerInfo::Reg_Barrel; | ||||||
} else { | ||||||
if ((S.canReachRadius(tib1.m_rin) && tib1.is_within_z_limits(S.zAtR(tib1.m_rin))) || | ||||||
(S.canReachRadius(tob1.m_rin) && tob1.is_within_z_limits(S.zAtR(tob1.m_rin)))) { | ||||||
reg = z_dir_pos ? TrackerInfo::Reg_Transition_Pos : TrackerInfo::Reg_Transition_Neg; | ||||||
} else { | ||||||
reg = z_dir_pos ? TrackerInfo::Reg_Endcap_Pos : TrackerInfo::Reg_Endcap_Neg; | ||||||
} | ||||||
} | ||||||
|
||||||
part.m_region[i] = reg; | ||||||
part.m_sort_score[i] = 5.0f * (reg - 2) + eta; | ||||||
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. perhaps these magic numbers need to be put into a constexpr or clarified via a comment? 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. Done: a constexpr is now used and a comment has been added to explain the point of this line. Thanks! |
||||||
} | ||||||
} | ||||||
} // namespace | ||||||
|
||||||
class MkFitIterationConfigESProducer : public edm::ESProducer { | ||||||
public: | ||||||
MkFitIterationConfigESProducer(const edm::ParameterSet& iConfig); | ||||||
MkFitIterationConfigESProducer(const edm::ParameterSet &iConfig); | ||||||
|
||||||
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); | ||||||
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); | ||||||
|
||||||
std::unique_ptr<mkfit::IterationConfig> produce(const TrackerRecoGeometryRecord& iRecord); | ||||||
std::unique_ptr<mkfit::IterationConfig> produce(const TrackerRecoGeometryRecord &iRecord); | ||||||
|
||||||
private: | ||||||
const edm::ESGetToken<MkFitGeometry, TrackerRecoGeometryRecord> geomToken_; | ||||||
const std::string configFile_; | ||||||
}; | ||||||
|
||||||
MkFitIterationConfigESProducer::MkFitIterationConfigESProducer(const edm::ParameterSet& iConfig) | ||||||
MkFitIterationConfigESProducer::MkFitIterationConfigESProducer(const edm::ParameterSet &iConfig) | ||||||
: geomToken_{setWhatProduced(this, iConfig.getParameter<std::string>("ComponentName")).consumes()}, | ||||||
configFile_{iConfig.getParameter<edm::FileInPath>("config").fullPath()} {} | ||||||
|
||||||
void MkFitIterationConfigESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { | ||||||
void MkFitIterationConfigESProducer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { | ||||||
edm::ParameterSetDescription desc; | ||||||
desc.add<std::string>("ComponentName")->setComment("Product label"); | ||||||
desc.add<edm::FileInPath>("config")->setComment("Path to the JSON file for the mkFit configuration parameters"); | ||||||
descriptions.addWithDefaultLabel(desc); | ||||||
} | ||||||
|
||||||
std::unique_ptr<mkfit::IterationConfig> MkFitIterationConfigESProducer::produce( | ||||||
const TrackerRecoGeometryRecord& iRecord) { | ||||||
return mkfit::ConfigJson_Load_File(iRecord.get(geomToken_).iterationsInfo(), configFile_); | ||||||
const TrackerRecoGeometryRecord &iRecord) { | ||||||
auto it_conf = mkfit::ConfigJson_Load_File(configFile_); | ||||||
it_conf->m_partition_seeds = partitionSeeds0; | ||||||
return it_conf; | ||||||
} | ||||||
|
||||||
DEFINE_FWK_EVENTSETUP_MODULE(MkFitIterationConfigESProducer); |
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.
perhaps?
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.
Done, thanks.