Skip to content

Commit

Permalink
Follow-up to the review
Browse files Browse the repository at this point in the history
  • Loading branch information
tvami committed Aug 14, 2024
1 parent 15fa3c5 commit 52b062d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 24 deletions.
9 changes: 4 additions & 5 deletions Recon/include/Recon/Skims/EcalPreselectionSkimmer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,26 @@
//----------//
#include "Ecal/Event/EcalVetoResult.h"
#include "Framework/EventProcessor.h"
#include "Tools/AnalysisUtils.h"

namespace recon {

class EcalPreselectionSkimmer : public framework::Producer {
public:
// @param parameters Set of parameters used to configure this processor.
virtual void configure(framework::config::Parameters &);

/** Constructor */
EcalPreselectionSkimmer(const std::string &name, framework::Process &process);

/** Destructor */
~EcalPreselectionSkimmer() = default;

// Configure this processor with a set of parameters passed
virtual void configure(framework::config::Parameters &) final;

/**
* Run the processor and select events that pass pre-selection in ECAL
*
* @param event The event to process.
*/
void produce(framework::Event &event);
virtual void produce(framework::Event &event) final;

private:
/// Collection Name for veto object
Expand Down
11 changes: 4 additions & 7 deletions Recon/python/ecalPreselectionSkimmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@
Examples
--------
from LDMX.Recon.ecalPreselectionSkimmer import ecalPreselectionSkimmer
p.sequence.append( ecalPreselectionSkimmer )
from LDMX.Recon.ecalPreselectionSkimmer import EcalPreselectionSkimmer
ecal_pres_skimmer = EcalPreselectionSkimmer()
p.sequence.append( ecal_pres_skimmer )
"""

from LDMX.Framework import ldmxcfg

class EcalPreselectionSkimmer(ldmxcfg.Producer) :
"""Configuration for an ECAL-based pre-selection skimmer"""

def __init__(self, name) :
def __init__(self, name = "ecalPreselectionSkimmer") :
super().__init__(name,'recon::EcalPreselectionSkimmer','Recon')

self.ecal_veto_name = "EcalVeto"
Expand All @@ -57,7 +58,3 @@ def __init__(self, name) :
self.max_cell_dep_max = 9999.
self.std_layer_hit_max = 9999
self.n_straight_tracks_max = 9999


ecalPreselectionSkimmer = EcalPreselectionSkimmer("ecalPreselectionSkimmer")

4 changes: 3 additions & 1 deletion Recon/src/Recon/Skims/EcalPreselectionSkimmer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void EcalPreselectionSkimmer::configure(framework::config::Parameters &ps) {

void EcalPreselectionSkimmer::produce(framework::Event &event) {
bool passedPreselection{false};
auto ecalVeto{
const auto &ecalVeto{
event.getObject<ldmx::EcalVetoResult>(ecal_veto_name_, ecal_veto_pass_)};

// Boolean to check if we pass preselection
Expand All @@ -56,6 +56,8 @@ void EcalPreselectionSkimmer::produce(framework::Event &event) {
} else {
setStorageHint(framework::hint_shouldDrop);
}
// Add the boolean to the event
event.add("EcalPreselectionDecision", passedPreselection);
}
} // namespace recon

Expand Down
39 changes: 28 additions & 11 deletions Recon/test/ecal_preselection_skim.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
import os import sys
import os
import sys

thisPassName = "presel" inputName = sys.argv[1]
thisPassName = "presel"
inputName = sys.argv[1]

from LDMX.Framework import ldmxcfg p = ldmxcfg.Process(thisPassName)
from LDMX.Framework import ldmxcfg
p = ldmxcfg.Process(thisPassName)

p.termLogLevel = 0
p.termLogLevel = 0
p.inputFiles =[inputName]
p.outputFiles =["eventsPreskimmed.root"]

p.inputFiles =[inputName] p.histogramFile = "histosPreskimmed.root" p.outputFiles =["eventsPreskimmed.root"]

from LDMX.Recon.ecalPreselectionSkimmer import ecalPreselectionSkimmer ecalPreselectionSkimmer.summed_tight_iso_max = 1100. ecalPreselectionSkimmer.n_readout_hits_max = 90
''' ## #Reminder for the possible things to cut on
ecalPreselectionSkimmer.summed_det_max = 9999. ecalPreselectionSkimmer.summed_tight_iso_max = 9999. ecalPreselectionSkimmer.ecal_back_energy_max = 9999. ecalPreselectionSkimmer.n_readout_hits_max = 9999 ecalPreselectionSkimmer.shower_rms_max = 9999 ecalPreselectionSkimmer.shower_y_std_max = 9999 ecalPreselectionSkimmer.shower_x_std_max = 9999 ecalPreselectionSkimmer.max_cell_dep_max = 9999. ecalPreselectionSkimmer.std_layer_hit_max = 9999 ecalPreselectionSkimmer.n_straight_tracks_max = 9999
from LDMX.Recon.ecalPreselectionSkimmer import EcalPreselectionSkimmer
ecal_pres_skimmer = EcalPreselectionSkimmer()
ecal_pres_skimmer.summed_tight_iso_max = 1100.
ecal_pres_skimmer.n_readout_hits_max = 90
'''
## Reminder for the possible things to cut on
ecal_pres_skimmer.summed_det_max = 9999.
ecal_pres_skimmer.summed_tight_iso_max = 9999.
ecal_pres_skimmer.ecal_back_energy_max = 9999.
ecal_pres_skimmer.n_readout_hits_max = 9999
ecal_pres_skimmer.shower_rms_max = 9999
ecal_pres_skimmer.shower_y_std_max = 9999
ecal_pres_skimmer.shower_x_std_max = 9999
ecal_pres_skimmer.max_cell_dep_max = 9999.
ecal_pres_skimmer.std_layer_hit_max = 9999
ecal_pres_skimmer.n_straight_tracks_max = 9999
'''

p.sequence =[ecalPreselectionSkimmer] p.skimDefaultIsDrop() p.skimConsider(p.sequence[0].instanceName)
p.sequence =[ecal_pres_skimmer]
p.skimDefaultIsDrop()
p.skimConsider(p.sequence[0].instanceName)

0 comments on commit 52b062d

Please sign in to comment.