LDMX Software
RecoilMissesEcalSkimmer.cxx
Go to the documentation of this file.
1
9
10namespace recon {
11
13 framework::Process &process)
14 : framework::Producer(name, process) {}
15
17
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}
60} // namespace recon
61
62DECLARE_PRODUCER_NS(recon, RecoilMissesEcalSkimmer);
#define DECLARE_PRODUCER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Processor used to select events where the recoil electron misses the Ecal.
void setStorageHint(framework::StorageControl::Hint hint)
Mark the current event as having the given storage control hint from this module.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
Stores simulated calorimeter hit information.
Class representing a simulated particle.
Definition SimParticle.h:23
void produce(framework::Event &event)
Run the processor and select events where the recoil misses the Ecal.
RecoilMissesEcalSkimmer(const std::string &name, framework::Process &process)
Constructor.
All classes in the ldmx-sw project use this namespace.
Definition PerfDict.cxx:45
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