LDMX Software
Public Member Functions | List of all members
recon::RecoilMissesEcalSkimmer Class Reference

Public Member Functions

 RecoilMissesEcalSkimmer (const std::string &name, framework::Process &process)
 Constructor.
 
 ~RecoilMissesEcalSkimmer ()
 Destructor.
 
void produce (framework::Event &event)
 Run the processor and select events where the recoil misses the Ecal.
 
- Public Member Functions inherited from framework::Producer
 Producer (const std::string &name, Process &process)
 Class constructor.
 
virtual void beforeNewRun (ldmx::RunHeader &header)
 Handle allowing producers to modify run headers before the run begins.
 
- Public Member Functions inherited from framework::EventProcessor
 EventProcessor (const std::string &name, Process &process)
 Class constructor.
 
virtual ~EventProcessor ()
 Class destructor.
 
virtual void configure (framework::config::Parameters &parameters)
 Callback for the EventProcessor to configure itself from the given set of parameters.
 
virtual void onNewRun (const ldmx::RunHeader &runHeader)
 Callback for the EventProcessor to take any necessary action when the run being processed changes.
 
virtual void onFileOpen (EventFile &eventFile)
 Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened.
 
virtual void onFileClose (EventFile &eventFile)
 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from framework::EventProcessor
static void declare (const std::string &classname, int classtype, EventProcessorMaker *)
 Internal function which is part of the PluginFactory machinery.
 
- Static Public Attributes inherited from framework::Producer
static const int CLASSTYPE {1}
 Constant used to track EventProcessor types by the PluginFactory.
 
- Protected Member Functions inherited from framework::EventProcessor
void abortEvent ()
 Abort the event immediately.
 
- Protected Attributes inherited from framework::EventProcessor
HistogramHelper histograms_
 Interface class for making and filling histograms.
 
NtupleManagerntuple_ {NtupleManager::getInstance()}
 Manager for any ntuples.
 
logging::logger theLog_
 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.

14 : framework::Producer(name, process) {}
Base class for a module which produces a data product.

◆ ~RecoilMissesEcalSkimmer()

recon::RecoilMissesEcalSkimmer::~RecoilMissesEcalSkimmer ( )

Destructor.

Definition at line 16 of file RecoilMissesEcalSkimmer.cxx.

16{}

Member Function Documentation

◆ produce()

void recon::RecoilMissesEcalSkimmer::produce ( framework::Event event)
virtual

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

Parameters
eventThe event to process.

Implements framework::Producer.

Definition at line 18 of file RecoilMissesEcalSkimmer.cxx.

18 {
19 // Get the collection of simulated particles from the event
20 auto particleMap{event.getMap<int, ldmx::SimParticle>("SimParticles")};
21
22 // Search for the recoil electron
23 auto [recoilTrackID, recoilElectron] = Analysis::getRecoil(particleMap);
24
25 // Get the collection of simulated Ecal hits from the event.
26 const std::vector<ldmx::SimCalorimeterHit> ecalSimHits =
27 event.getCollection<ldmx::SimCalorimeterHit>("EcalSimHits");
28
29 // Loop through the Ecal hits and check if the recoil electron is
30 // associated with any of them. If there are any recoil electron hits
31 // in the Ecal, drop the event.
32 bool hasRecoilElectronHits = false;
33 for (const ldmx::SimCalorimeterHit &simHit : ecalSimHits) {
34 /*std::cout << "[ RecoilMissesEcalSkimmer ]: "
35 << "Number of hit contributions: "
36 << simHit->getNumberOfContribs() << std::endl;*/
37
38 for (int iContrib = 0; iContrib < simHit.getNumberOfContribs();
39 ++iContrib) {
40 ldmx::SimCalorimeterHit::Contrib contrib = simHit.getContrib(iContrib);
41
42 if (contrib.trackID == recoilTrackID) {
43 /*std::cout << "[ RecoilMissesEcalSkimmer ]: "
44 << "Ecal hit associated with recoil electron." << std::endl;
45 */
46
47 hasRecoilElectronHits = true;
48 }
49 }
50 }
51
52 // Tell the skimmer to keep or drop the event based on whether there
53 // were recoil electron hits found in the Ecal.
54 if (hasRecoilElectronHits) {
56 } else {
58 }
59}
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_shouldKeep
storage control hint alias for backwards compatibility
constexpr StorageControl::Hint hint_shouldDrop
storage control hint alias for backwards compatibility
Information about a contribution to the hit in the associated cell.
int trackID
track ID of this contributor

References framework::hint_shouldDrop, framework::hint_shouldKeep, framework::EventProcessor::setStorageHint(), and ldmx::SimCalorimeterHit::Contrib::trackID.


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