Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Merge misses
Browse files Browse the repository at this point in the history
  • Loading branch information
EinarElen committed Sep 14, 2023
1 parent da537d6 commit 67efe1a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
8 changes: 3 additions & 5 deletions include/Hcal/Event/HcalVetoResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ class HcalVetoResult {
bool passesVeto() const { return passesVeto_; };

/** @return The maximum PE HcalHit. */
inline ldmx::HcalHit getMaxPEHit() const { return maxPEHit_; }
ldmx::HcalHit getMaxPEHit() const { return maxPEHit_; }

/**
* Sets whether the Hcal veto was passed or not.
*
* @param passesVeto Veto result.
*/
inline void setVetoResult(const bool& passesVeto = true) {
void setVetoResult(const bool& passesVeto = true) {
passesVeto_ = passesVeto;
}

Expand All @@ -54,9 +54,7 @@ class HcalVetoResult {
*
* @param maxPEHit The maximum PE HcalHit
*/
inline void setMaxPEHit(const ldmx::HcalHit maxPEHit) {
maxPEHit_ = maxPEHit;
}
void setMaxPEHit(const ldmx::HcalHit maxPEHit) { maxPEHit_ = maxPEHit; }

private:
/** Reference to max PE hit. */
Expand Down
9 changes: 6 additions & 3 deletions include/Hcal/HcalVetoProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ class HcalVetoProcessor : public framework::Producer {
*
* @param parameters Set of parameters used to configure this processor.
*/
void configure(framework::config::Parameters &parameters) final override;
void configure(framework::config::Parameters &parameters) override;

/**
* Run the processor and create a collection of results which
* indicate if the event passes/fails the Hcal veto.
*
* @param event The event to process.
*/
void produce(framework::Event &event);
void produce(framework::Event &event) override;

private:
/** Total PE threshold. */
double totalPEThreshold_{8};
double totalPEThreshold_{5};

/** Maximum hit time that should be considered by the veto. */
float maxTime_{50}; // ns
Expand All @@ -73,6 +73,9 @@ class HcalVetoProcessor : public framework::Producer {
*/
ldmx::HcalHit defaultMaxHit_;

std::string outputCollName_;
std::string inputHitCollName_;
std::string inputHitPassName_;
}; // HcalVetoProcessor
} // namespace hcal

Expand Down
8 changes: 5 additions & 3 deletions src/Hcal/HcalVetoProcessor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ void HcalVetoProcessor::produce(framework::Event &event) {

// Loop over all of the Hcal hits and calculate to total photoelectrons
// in the event.
float totalPe{0};
[[maybe_unused]] float totalPe{0};
float maxPE{-1000};

const ldmx::HcalHit *maxPEHit{defaultMaxHit_};
const ldmx::HcalHit *maxPEHit{&defaultMaxHit_};
for (const ldmx::HcalHit &hcalHit : hcalRecHits) {
// If the hit time is outside the readout window, don't consider it.
if (hcalHit.getTime() >= maxTime_) {
Expand All @@ -76,14 +76,16 @@ void HcalVetoProcessor::produce(framework::Event &event) {
float pe = hcalHit.getPE();

// Keep track of the total PE
// TODO: This is currently not used anywhere
totalPe += pe;

// Check that both sides of the bar have a PE value above threshold.
// If not, don't consider the hit. Double sided readout is only
// being used for the back HCal bars. For the side HCal, just
// use the maximum PE as before.
ldmx::HcalID id(hcalHit.getID());
if ((id.section() == ldmx::HcalID::BACK) && (hcalHit.getMinPE() < minPE_))
if ((id.section() == ldmx::HcalID::BACK) &&
(hcalHit.getMinPE() < backMinPE_))
continue;

// Find the maximum PE in the list
Expand Down

0 comments on commit 67efe1a

Please sign in to comment.