Skip to content

Commit

Permalink
address Slava's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeleo committed Jan 17, 2024
1 parent 3fae2e1 commit 6615820
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class SequentialPrimaryVertexFitterAdapter : public PrimaryVertexFitterBase {
public:
SequentialPrimaryVertexFitterAdapter() : fitter(nullptr){};
SequentialPrimaryVertexFitterAdapter(VertexFitter<5>* vertex_fitter) : fitter(vertex_fitter){};
SequentialPrimaryVertexFitterAdapter(const VertexFitter<5>* vertex_fitter) : fitter(vertex_fitter){};
~SequentialPrimaryVertexFitterAdapter() override = default;

std::vector<TransientVertex> fit(const std::vector<reco::TransientTrack>& dummy,
Expand All @@ -41,6 +41,6 @@ class SequentialPrimaryVertexFitterAdapter : public PrimaryVertexFitterBase {

protected:
// configuration
VertexFitter<5>* fitter; // Kalman or Adaptive
const VertexFitter<5>* fitter; // Kalman or Adaptive
};
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ namespace WeightedMeanFitter {

// adapter for the multiprimaryvertexfitter scheme
// this code was originally introduced as part of PrimaryVertexProducer.cc
// by Adriano Dee et.al., then moved here with minor modifications
// by Adriano Di Florio <AdrianoDee>, Giorgio Pizzati <giorgiopizz> et.al. in #39995, then moved here with minor modifications
class WeightedMeanPrimaryVertexEstimator : public PrimaryVertexFitterBase {
public:
WeightedMeanPrimaryVertexEstimator() = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,23 +205,22 @@ void PrimaryVertexProducer::produce(edm::Event& iEvent, const edm::EventSetup& i
std::vector<reco::TransientTrack> t_tks;

if (useTransientTrackTime_) {
edm::Handle<edm::ValueMap<float> > trackTimeResosH;
iEvent.getByToken(trkTimeResosToken, trackTimeResosH);
auto const& trackTimeResos_ = iEvent.get(trkTimeResosToken);
auto trackTimes_ = iEvent.get(trkTimesToken);

if (useMVASelection_) {
trackMTDTimeQualities_ = iEvent.get(trackMTDTimeQualityToken);

trackTimes_ = iEvent.get(trkTimesToken);
for (unsigned int i = 0; i < (*tks).size(); i++) {
const reco::TrackRef ref(tks, i);
auto const trkTimeQuality = trackMTDTimeQualities_[ref];
if (trkTimeQuality < minTrackTimeQuality_) {
trackTimes_[ref] = std::numeric_limits<double>::max();
}
}
t_tks = (*theB).build(tks, beamSpot, trackTimes_, *(trackTimeResosH.product()));
t_tks = (*theB).build(tks, beamSpot, trackTimes_, trackTimeResos_);
} else {
t_tks = (*theB).build(tks, beamSpot, iEvent.get(trkTimesToken), *(trackTimeResosH.product()));
t_tks = (*theB).build(tks, beamSpot, trackTimes_, trackTimeResos_);
}
} else {
t_tks = (*theB).build(tks, beamSpot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,19 +258,19 @@ double AdaptiveChisquarePrimaryVertexFitter::update(const reco::BeamSpot &beamsp

// initial value for S, 0 or inverse of the beamspot covariance matrix
Error3 S0;
double c0 = 0, c1 = 0, c2 = 0;
double c_beam[3] = {0, 0, 0};
if (beam_weight > 0) {
S0 = get_inverse_beam_covariance(beamspot);
c0 = -(S0(0, 0) * beamspot.x0() + S0(0, 1) * beamspot.y0() + S0(0, 2) * beamspot.z0());
c1 = -(S0(1, 0) * beamspot.x0() + S0(1, 1) * beamspot.y0() + S0(1, 2) * beamspot.z0());
c2 = -(S0(2, 0) * beamspot.x0() + S0(2, 1) * beamspot.y0() + S0(2, 2) * beamspot.z0());
for (unsigned int j = 0; j < 3; j++) {
c_beam[j] = -(S0(j, 0) * beamspot.x0() + S0(j, 1) * beamspot.y0() + S0(j, 2) * beamspot.z0());
}
}

for (unsigned int k = 0; k < nv; k++) {
rho_vtx = 0;
Error3 S(S0);
// sum track contributions
double c[3] = {c0, c1, c2};
double c[3] = {c_beam[0], c_beam[1], c_beam[2]};
for (unsigned int j = tkfirstv_[k]; j < tkfirstv_[k + 1]; j++) {
const unsigned int i = tkmap_[j];
const auto w = tkweight_[j];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ void VertexTimeAlgorithmFromTracksPID::fillPSetDescription(edm::ParameterSetDesc
VertexTimeAlgorithmBase::fillPSetDescription(iDesc);

iDesc.add<edm::InputTag>("trackMTDTimeVMapTag", edm::InputTag("trackExtenderWithMTD:generalTracktmtd"))
->setComment("");
->setComment("Input ValueMap for track time at MTD");
iDesc.add<edm::InputTag>("trackMTDTimeErrorVMapTag", edm::InputTag("trackExtenderWithMTD:generalTracksigmatmtd"))
->setComment("");
->setComment("Input ValueMap for track time uncertainty at MTD");
iDesc.add<edm::InputTag>("trackMTDTimeQualityVMapTag", edm::InputTag("mtdTrackQualityMVA:mtdQualMVA"))
->setComment("");
->setComment("Input ValueMap for track MVA quality value");
iDesc.add<edm::InputTag>("trackMTDTofPiVMapTag", edm::InputTag("trackExtenderWithMTD:generalTrackTofPi"))
->setComment("");
->setComment("Input ValueMap for track tof as pion");
iDesc.add<edm::InputTag>("trackMTDTofKVMapTag", edm::InputTag("trackExtenderWithMTD:generalTrackTofK"))
->setComment("");
->setComment("Input ValueMap for track tof as kaon");
iDesc.add<edm::InputTag>("trackMTDTofPVMapTag", edm::InputTag("trackExtenderWithMTD:generalTrackTofP"))
->setComment("");
->setComment("Input ValueMap for track tof as proton");

iDesc.add<double>("minTrackVtxWeight", 0.5)->setComment("");
iDesc.add<double>("minTrackTimeQuality", 0.8)->setComment("");
iDesc.add<double>("minTrackVtxWeight", 0.5)->setComment("Minimum track weight");
iDesc.add<double>("minTrackTimeQuality", 0.8)->setComment("Minimum MVA Quality selection on tracks");

iDesc.add<double>("probPion", 0.7)->setComment("");
iDesc.add<double>("probKaon", 0.2)->setComment("");
iDesc.add<double>("probProton", 0.1)->setComment("");
iDesc.add<double>("probPion", 0.7)->setComment("A priori probability pions");
iDesc.add<double>("probKaon", 0.2)->setComment("A priori probability kaons");
iDesc.add<double>("probProton", 0.1)->setComment("A priori probability protons");

iDesc.add<double>("Tstart", 256.)->setComment("");
iDesc.add<double>("coolingFactor", 0.5)->setComment("");
iDesc.add<double>("Tstart", 256.)->setComment("DA initial temperature T");
iDesc.add<double>("coolingFactor", 0.5)->setComment("DA cooling factor");
}

void VertexTimeAlgorithmFromTracksPID::setEvent(edm::Event& iEvent, edm::EventSetup const&) {
Expand Down

0 comments on commit 6615820

Please sign in to comment.