Skip to content

Commit ee2cd72

Browse files
authored
Update ParticleFlow.cxx
Added updates according to current version of trunk
1 parent d0d2227 commit ee2cd72

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

Recon/src/Recon/ParticleFlow.cxx

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ void ParticleFlow::configure(framework::config::Parameters& ps) {
1010
inputHcalCollName_ = ps.getParameter<std::string>("inputHcalCollName");
1111
inputTrackCollName_ = ps.getParameter<std::string>("inputTrackCollName");
1212
outputCollName_ = ps.getParameter<std::string>("outputCollName");
13+
14+
input_ecal_passname_ = ps.getParameter<std::string>("input_ecal_passname");
15+
input_hcal_passname_ = ps.getParameter<std::string>("input_hcal_passname");
16+
input_tracks_passname_ =
17+
ps.getParameter<std::string>("input_tracks_passname");
18+
19+
input_track_event_passname_ =
20+
ps.getParameter<std::string>("input_track_event_passname");
21+
input_ecal_event_passname_ =
22+
ps.getParameter<std::string>("input_ecal_event_passname");
23+
input_hcal_event_passname_ =
24+
ps.getParameter<std::string>("input_hcal_event_passname");
25+
1326
// Algorithm configuration
1427
singleParticle_ = ps.getParameter<bool>("singleParticle");
1528
tkHadCaloMatchDist_ = ps.getParameter<double>("tkHadCaloMatchDist");
@@ -57,10 +70,11 @@ void ParticleFlow::fillCandEMCalo(ldmx::PFCandidate& cand,
5770
const ldmx::CaloCluster& em) {
5871
float corr = 1.;
5972
float e = em.getEnergy();
73+
// update energy: use min or max factor if outside calibration range
6074
if (e < eCorr_->GetX()[0]) {
61-
corr = eCorr_->GetX()[0];
75+
corr = eCorr_->GetY()[0];
6276
} else if (e > eCorr_->GetX()[eCorr_->GetN() - 1]) {
63-
corr = eCorr_->GetX()[eCorr_->GetN() - 1];
77+
corr = eCorr_->GetY()[eCorr_->GetN() - 1];
6478
} else {
6579
corr = eCorr_->Eval(e);
6680
}
@@ -81,9 +95,9 @@ void ParticleFlow::fillCandHadCalo(ldmx::PFCandidate& cand,
8195
float corr = 1.;
8296
float e = had.getEnergy();
8397
if (e < hCorr_->GetX()[0]) {
84-
corr = hCorr_->GetX()[0];
98+
corr = hCorr_->GetY()[0];
8599
} else if (e > hCorr_->GetX()[hCorr_->GetN() - 1]) {
86-
corr = hCorr_->GetX()[hCorr_->GetN() - 1];
100+
corr = hCorr_->GetY()[hCorr_->GetN() - 1];
87101
} else {
88102
corr = hCorr_->Eval(e);
89103
}
@@ -101,16 +115,16 @@ void ParticleFlow::fillCandHadCalo(ldmx::PFCandidate& cand,
101115

102116
// produce track, ecal, and hcal linking
103117
void ParticleFlow::produce(framework::Event& event) {
104-
if (!event.exists(inputTrackCollName_)) return;
105-
if (!event.exists(inputEcalCollName_)) return;
106-
if (!event.exists(inputHcalCollName_)) return;
118+
if (!event.exists(inputTrackCollName_, input_track_event_passname_)) return;
119+
if (!event.exists(inputEcalCollName_, input_ecal_event_passname_)) return;
120+
if (!event.exists(inputHcalCollName_, input_hcal_event_passname_)) return;
107121
// get the track and clustering info
108-
const auto ecalClusters =
109-
event.getCollection<ldmx::CaloCluster>(inputEcalCollName_);
110-
const auto hcalClusters =
111-
event.getCollection<ldmx::CaloCluster>(inputHcalCollName_);
112-
const auto tracks =
113-
event.getCollection<ldmx::SimTrackerHit>(inputTrackCollName_);
122+
const auto ecalClusters = event.getCollection<ldmx::CaloCluster>(
123+
inputEcalCollName_, input_ecal_passname_);
124+
const auto hcalClusters = event.getCollection<ldmx::CaloCluster>(
125+
inputHcalCollName_, input_hcal_passname_);
126+
const auto tracks = event.getCollection<ldmx::SimTrackerHit>(
127+
inputTrackCollName_, input_tracks_passname_);
114128

115129
std::vector<ldmx::PFCandidate> pfCands;
116130
// multi-particle case
@@ -467,4 +481,4 @@ void ParticleFlow::onProcessEnd() {
467481

468482
} // namespace recon
469483

470-
DECLARE_PRODUCER_NS(recon, ParticleFlow);
484+
DECLARE_PRODUCER(recon::ParticleFlow);

0 commit comments

Comments
 (0)