LDMX Software
recon::RecoilMissesEcalSkimmer Class Reference

Public Member Functions

 RecoilMissesEcalSkimmer (const std::string &name, framework::Process &process)
 Constructor.
 
 ~RecoilMissesEcalSkimmer ()
 Destructor.
 
void produce (framework::Event &event) override
 Run the processor and select events where the recoil misses the Ecal.
 
void configure (framework::config::Parameters &parameters) override
 Configure the processor using the given user specified parameters.
 
- Public Member Functions inherited from framework::Producer
 Producer (const std::string &name, Process &process)
 Class constructor.
 
virtual void process (Event &event) final
 Processing an event for a Producer is calling produce.
 
- Public Member Functions inherited from framework::EventProcessor
 DECLARE_FACTORY (EventProcessor, EventProcessor *, const std::string &, Process &)
 declare that we have a factory for this class
 
 EventProcessor (const std::string &name, Process &process)
 Class constructor.
 
virtual ~EventProcessor ()=default
 Class destructor.
 
virtual void beforeNewRun (ldmx::RunHeader &run_header)
 Callback for Producers to add parameters to the run header before conditions are initialized.
 
virtual void onNewRun (const ldmx::RunHeader &run_header)
 Callback for the EventProcessor to take any necessary action when the run being processed changes.
 
virtual void onFileOpen (EventFile &event_file)
 Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened.
 
virtual void onFileClose (EventFile &event_file)
 Callback for the EventProcessor to take any necessary action when a event input ROOT file is closed.
 
virtual void onProcessStart ()
 Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.
 
virtual void onProcessEnd ()
 Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities.
 
template<class T >
const T & getCondition (const std::string &condition_name)
 Access a conditions object for the current event.
 
TDirectory * getHistoDirectory ()
 Access/create a directory in the histogram file for this event processor to create histograms and analysis tuples.
 
void setStorageHint (framework::StorageControl::Hint hint)
 Mark the current event as having the given storage control hint from this module_.
 
void setStorageHint (framework::StorageControl::Hint hint, const std::string &purposeString)
 Mark the current event as having the given storage control hint from this module and the given purpose string.
 
int getLogFrequency () const
 Get the current logging frequency from the process.
 
int getRunNumber () const
 Get the run number from the process.
 
std::string getName () const
 Get the processor name.
 
void createHistograms (const std::vector< framework::config::Parameters > &histos)
 Internal function which is used to create histograms passed from the python configuration @parma histos vector of Parameters that configure histograms to create.
 

Private Attributes

std::string ecal_sim_hits_pass_name_
 
std::string sim_particles_pass_name_
 

Additional Inherited Members

- Protected Member Functions inherited from framework::EventProcessor
void abortEvent ()
 Abort the event immediately.
 
- Protected Attributes inherited from framework::EventProcessor
HistogramPool histograms_
 helper object for making and filling histograms
 
NtupleManagerntuple_ {NtupleManager::getInstance()}
 Manager for any ntuples.
 
logging::logger the_log_
 The logger for this EventProcessor.
 

Detailed Description

Definition at line 21 of file RecoilMissesEcalSkimmer.h.

Constructor & Destructor Documentation

◆ RecoilMissesEcalSkimmer()

recon::RecoilMissesEcalSkimmer::RecoilMissesEcalSkimmer ( const std::string & name,
framework::Process & process )

Constructor.

Definition at line 12 of file RecoilMissesEcalSkimmer.cxx.

Base class for a module which produces a data product.
virtual void process(Event &event) final
Processing an event for a Producer is calling produce.

◆ ~RecoilMissesEcalSkimmer()

recon::RecoilMissesEcalSkimmer::~RecoilMissesEcalSkimmer ( )

Destructor.

Definition at line 16 of file RecoilMissesEcalSkimmer.cxx.

16{}

Member Function Documentation

◆ configure()

void recon::RecoilMissesEcalSkimmer::configure ( framework::config::Parameters & parameters)
overridevirtual

Configure the processor using the given user specified parameters.

Parameters
parametersSet of parameters used to configure this processor.

Reimplemented from framework::EventProcessor.

Definition at line 18 of file RecoilMissesEcalSkimmer.cxx.

19 {
20 ecal_sim_hits_pass_name_ = parameters.get<std::string>("ecalSimHitsPassName");
21
22 sim_particles_pass_name_ =
23 parameters.get<std::string>("sim_particles_pass_name");
24}
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:78

References framework::config::Parameters::get().

◆ produce()

void recon::RecoilMissesEcalSkimmer::produce ( framework::Event & event)
overridevirtual

Run the processor and select events where the recoil misses the Ecal.

Parameters
eventThe event to process.

Implements framework::Producer.

Definition at line 26 of file RecoilMissesEcalSkimmer.cxx.

26 {
27 // Get the collection of simulated particles from the event
28 auto particle_map{event.getMap<int, ldmx::SimParticle>(
29 "SimParticles", sim_particles_pass_name_)};
30
31 // Search for the recoil electron
32 auto [recoilTrackID, recoilElectron] = analysis::getRecoil(particle_map);
33
34 // Get the collection of simulated Ecal hits_ from the event.
35 const std::vector<ldmx::SimCalorimeterHit> ecal_sim_hits =
36 event.getCollection<ldmx::SimCalorimeterHit>("EcalSimHits",
37 ecal_sim_hits_pass_name_);
38
39 // Loop through the Ecal hits_ and check if the recoil electron is
40 // associated with any of them. If there are any recoil electron hits_
41 // in the Ecal, drop the event.
42 bool has_recoil_electron_hits = false;
43 for (const ldmx::SimCalorimeterHit &sim_hit : ecal_sim_hits) {
44 /*std::cout << "[ RecoilMissesEcalSkimmer ]: "
45 << "Number of hit contributions: "
46 << simHit->getNumberOfContribs() << std::endl;*/
47
48 for (int i_contrib = 0; i_contrib < sim_hit.getNumberOfContribs();
49 ++i_contrib) {
50 ldmx::SimCalorimeterHit::Contrib contrib = sim_hit.getContrib(i_contrib);
51
52 if (contrib.track_id_ == recoilTrackID) {
53 /*std::cout << "[ RecoilMissesEcalSkimmer ]: "
54 << "Ecal hit associated with recoil electron." << std::endl;
55 */
56
57 has_recoil_electron_hits = true;
58 }
59 }
60 }
61
62 // Tell the skimmer to keep or drop the event based on whether there
63 // were recoil electron hits_ found in the Ecal.
64 if (has_recoil_electron_hits) {
66 } else {
68 }
69}
std::tuple< int, const ldmx::SimParticle * > getRecoil(const std::map< int, ldmx::SimParticle > &particleMap)
Find and return the sim particle associated with the recoil electron.
void setStorageHint(framework::StorageControl::Hint hint)
Mark the current event as having the given storage control hint from this module_.
Stores simulated calorimeter hit information.
Class representing a simulated particle.
Definition SimParticle.h:23
constexpr StorageControl::Hint HINT_SHOULD_DROP
storage control hint alias for backwards compatibility
constexpr StorageControl::Hint HINT_SHOULD_KEEP
storage control hint alias for backwards compatibility
Information about a contribution to the hit in the associated cell.
int track_id_
track ID of this contributor

References framework::HINT_SHOULD_DROP, framework::HINT_SHOULD_KEEP, framework::EventProcessor::setStorageHint(), and ldmx::SimCalorimeterHit::Contrib::track_id_.

Member Data Documentation

◆ ecal_sim_hits_pass_name_

std::string recon::RecoilMissesEcalSkimmer::ecal_sim_hits_pass_name_
private

Definition at line 46 of file RecoilMissesEcalSkimmer.h.

◆ sim_particles_pass_name_

std::string recon::RecoilMissesEcalSkimmer::sim_particles_pass_name_
private

Definition at line 48 of file RecoilMissesEcalSkimmer.h.


The documentation for this class was generated from the following files: