Skip to content

Commit

Permalink
Add histogram of number of triggered channels in muon candidate events
Browse files Browse the repository at this point in the history
  • Loading branch information
sfegan committed Oct 8, 2024
1 parent 5c436c6 commit 249a947
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/diagnostics/simple_charge_stats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,16 @@ class SimpleChargeStatsParallelEventVisitor:
num_channel_triggered_hist(new calin::math::histogram::Histogram1D(1.0)),
num_contiguous_channel_triggered_hist(new calin::math::histogram::Histogram1D(1.0)),
phys_trig_num_channel_triggered_hist(new calin::math::histogram::Histogram1D(1.0)),
phys_trig_num_contiguous_channel_triggered_hist(new calin::math::histogram::Histogram1D(1.0))
phys_trig_num_contiguous_channel_triggered_hist(new calin::math::histogram::Histogram1D(1.0)),
muon_candidate_num_channel_triggered_hist(new calin::math::histogram::Histogram1D(1.0))
{ /* nothing to see here */ }

~CameraHists() {
delete num_channel_triggered_hist;
delete num_contiguous_channel_triggered_hist;
delete phys_trig_num_channel_triggered_hist;
delete phys_trig_num_contiguous_channel_triggered_hist;
delete muon_candidate_num_channel_triggered_hist;
delete high_gain;
delete low_gain;
}
Expand All @@ -179,6 +181,7 @@ class SimpleChargeStatsParallelEventVisitor:
calin::math::histogram::Histogram1D* num_contiguous_channel_triggered_hist = nullptr;
calin::math::histogram::Histogram1D* phys_trig_num_channel_triggered_hist = nullptr;
calin::math::histogram::Histogram1D* phys_trig_num_contiguous_channel_triggered_hist = nullptr;
calin::math::histogram::Histogram1D* muon_candidate_num_channel_triggered_hist = nullptr;
};

void integrate_one_gain_partials(
Expand Down
7 changes: 7 additions & 0 deletions proto/diagnostics/simple_charge_stats.proto
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ message SimpleChargeStats {
calin.ix.math.histogram.Histogram1DData phy_trigger_num_contiguous_channel_triggered_hist = 35 [
(CFO).desc = "Histogram of number of channels triggered in physics events.",
(CFO).units = "channels (bin-units), events (weight-units)" ];
calin.ix.math.histogram.Histogram1DData muon_candidate_num_channel_triggered_hist = 36 [
(CFO).desc = "Histogram of number of channels triggered in muon-candidate events.",
(CFO).units = "channels (bin-units), events (weight-units)" ];
};

message PartialOneGainChannelSimpleChargeStats {
Expand Down Expand Up @@ -432,6 +435,10 @@ message PartialCameraSimpleChargeStats {
calin.ix.math.histogram.Histogram1DData phys_trig_num_contiguous_channel_triggered_hist = 25 [
(CFO).desc = "Histogram of number of channels triggered in physics-trigger events.",
(CFO).units = "channels (bin-units), events (weight-units)" ];
calin.ix.math.histogram.Histogram1DData muon_candidate_num_channel_triggered_hist = 26 [
(CFO).desc = "Histogram of number of channels triggered in muon-candidate events.",
(CFO).units = "channels (bin-units), events (weight-units)" ];

};

message PartialSimpleChargeStats {
Expand Down
9 changes: 9 additions & 0 deletions src/diagnostics/simple_charge_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ bool SimpleChargeStatsParallelEventVisitor::leave_telescope_run(
partials_.mutable_camera()->mutable_phys_trig_num_contiguous_channel_triggered_hist()->IntegrateFrom(*hp);
delete hp;

hp = camera_hists_->muon_candidate_num_channel_triggered_hist->dump_as_proto();
partials_.mutable_camera()->mutable_muon_candidate_num_channel_triggered_hist()->IntegrateFrom(*hp);
delete hp;

if(parent_)return true;

for(int ichan = 0; ichan<partials_.channel_size(); ichan++) {
Expand All @@ -541,6 +545,8 @@ bool SimpleChargeStatsParallelEventVisitor::leave_telescope_run(
partials_.camera().phys_trig_num_channel_triggered_hist());
results_.mutable_phy_trigger_num_contiguous_channel_triggered_hist()->IntegrateFrom(
partials_.camera().phys_trig_num_contiguous_channel_triggered_hist());
results_.mutable_muon_candidate_num_channel_triggered_hist()->IntegrateFrom(
partials_.camera().muon_candidate_num_channel_triggered_hist());

partials_.Clear();
return true;
Expand Down Expand Up @@ -775,6 +781,9 @@ bool SimpleChargeStatsParallelEventVisitor::visit_telescope_event(uint64_t seq_i
}
}
}
if(event->is_muon_candidate()) {
camera_hists_->muon_candidate_num_channel_triggered_hist->insert(event->trigger_map().hit_channel_id_size());
}
}
return true;
}
Expand Down

0 comments on commit 249a947

Please sign in to comment.