Skip to content

Commit

Permalink
Persist if the recoil is fiducial, change cell width to come from geo…
Browse files Browse the repository at this point in the history
…m, misc logging changes
  • Loading branch information
tvami committed Aug 31, 2024
1 parent c545a43 commit 535af36
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
10 changes: 9 additions & 1 deletion Ecal/include/Ecal/Event/EcalVetoResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ class EcalVetoResult {

/** Checks if the event passes the Ecal veto. */
bool passesVeto() const { return passesVeto_; }

float getDisc() const { return discValue_; }

bool getFiducial() const { return fiducial_; }

int getDeepestLayerHit() const { return deepestLayerHit_; }

int getNReadoutHits() const { return nReadoutHits_; }
Expand Down Expand Up @@ -208,6 +211,7 @@ class EcalVetoResult {

void setVetoResult(bool passesVeto) { passesVeto_ = passesVeto; }
void setDiscValue(float discValue) { discValue_ = discValue; }
void setFiducial(bool fiducial) { fiducial_ = fiducial; }

/** Return the momentum of the recoil at the Ecal face. */
const std::vector<double> getRecoilMomentum() const {
Expand Down Expand Up @@ -301,8 +305,12 @@ class EcalVetoResult {
std::vector<std::vector<float>> oContLayerMean_;
std::vector<std::vector<float>> oContLayerStd_;

/** discriminator value from the BDT */
float discValue_{0};

/** is the recoil electron fiducial in ECAL?*/
bool fiducial_{false};

/** px of recoil electron at the Ecal face. */
double recoilPx_{-9999};

Expand All @@ -320,7 +328,7 @@ class EcalVetoResult {

std::vector<float> ecalLayerEdepReadout_;

ClassDef(EcalVetoResult, 6);
ClassDef(EcalVetoResult, 7);
};
} // namespace ldmx

Expand Down
13 changes: 9 additions & 4 deletions Ecal/src/Ecal/EcalVetoProcessor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,8 @@ void EcalVetoProcessor::produce(framework::Event &event) {
ldmx_log(debug) << "====== END OF Tracking hit list ======";
}

float cellWidth = 8.7;
// in v14 that this is 2*4.17 mm
float cellWidth = 2 * geometry_->getCellMinR();
for (int iHit = 0; iHit < trackingHitList.size(); iHit++) {
// list of hit numbers in track (34 = maximum theoretical length)
int track[34];
Expand Down Expand Up @@ -919,7 +920,8 @@ void EcalVetoProcessor::produce(framework::Event &event) {
}
nStraightTracks_ = track_list.size();
// print the track list
ldmx_log(info) << "Straight tracks found (after merge): " << nStraightTracks_;
ldmx_log(debug) << "Straight tracks found (after merge): "
<< nStraightTracks_;
for (int track_i = 0; track_i < track_list.size(); track_i++) {
ldmx_log(debug) << "Track " << track_i << ":";
for (int hit_i = 0; hit_i < track_list[track_i].size(); hit_i++) {
Expand All @@ -932,8 +934,8 @@ void EcalVetoProcessor::produce(framework::Event &event) {

// ------------------------------------------------------
// Linreg tracking:
ldmx_log(info) << "Finding linreg tracks from " << trackingHitList.size()
<< " hits";
ldmx_log(debug) << "Finding linreg tracks from " << trackingHitList.size()
<< " hits";

for (int iHit = 0; iHit < trackingHitList.size(); iHit++) {
int track[34];
Expand Down Expand Up @@ -1091,6 +1093,9 @@ void EcalVetoProcessor::produce(framework::Event &event) {
result.setDiscValue(pred);
ldmx_log(debug) << " The pred > bdtCutVal = " << (pred > bdtCutVal_);

// Persist in the event if the recoil ele is fiducial
result.setFiducial(inside);

// If the event passes the veto, keep it. Otherwise,
// drop the event.
if (result.passesVeto() && inside) {
Expand Down

0 comments on commit 535af36

Please sign in to comment.