LDMX Software
OverlayProducer.h
1#ifndef RECON_OVERLAYPRODUCER_H
2#define RECON_OVERLAYPRODUCER_H
3
4//---< C++ StdLib >---//
5#include <map>
6#include <string>
7#include <vector>
8
9//---< ROOT >---//
10#include "TFile.h"
11#include "TRandom2.h"
12
13//---< Framework >---//
14#include "Framework/Configure/Parameters.h"
15#include "Framework/EventFile.h"
17
18namespace recon {
19
24 public:
25 OverlayProducer(const std::string &name, framework::Process &process)
26 : framework::Producer(name, process), overlayEvent_{"overlay"} {}
27
28 // Destructor
29 virtual ~OverlayProducer() = default;
30
34 void configure(framework::config::Parameters &parameters) override;
35
40 void onNewRun(const ldmx::RunHeader &) override; // ); //
41
59 void produce(framework::Event &event) override;
60
64 void onProcessStart() override;
65
66 private:
69
73 std::string overlayFileName_;
74
78 std::unique_ptr<framework::EventFile> overlayFile_;
79
84
89 std::vector<std::string> caloCollections_;
90
95 std::vector<std::string> trackerCollections_;
96
100 std::string overlayPassName_;
101
105 std::string simPassName_;
106
111 bool doPoissonIT_{false};
112
117 bool doPoissonOOT_{false};
118
122 double poissonMu_{0.};
123
129 std::unique_ptr<TRandom2> rndm_;
130
136 std::unique_ptr<TRandom2> rndmTime_;
137
142 double timeSigma_{0.};
143
149 double timeMean_{0.};
150
154 double bunchSpacing_{0.};
155
161 int nEarlier_{0};
162
168 int nLater_{0};
169
174
182 int overlayTrackID_{-1000};
183 int overlayPdgCode_{0};
184};
185} // namespace recon
186
187#endif /* RECON_OVERLAY_OVERLAYPRODUCER_H */
Base classes for all user event processing components to extend.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
Base class for a module which produces a data product.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:54
Class to overlay in-time pile-up events from an overlay file.
std::string simPassName_
To use for finding the sim event bus passengers, mostly a disambiguation.
std::unique_ptr< framework::EventFile > overlayFile_
Pileup overlay events input file.
std::string overlayPassName_
Pileup overlay events input pass name.
std::string overlayFileName_
Pileup overlay events input file name.
std::vector< std::string > caloCollections_
List of SimCalorimeterHit collection(s) to loop over and add hits from, combining sim and pileup.
int verbosity_
Local control of processor verbosity.
int overlayIncidentID_
For Ecal, overlay hits should be added as contribs.
std::unique_ptr< TRandom2 > rndmTime_
Random number generator for pileup event time offset.
int nEarlier_
Number of bunches before the sim event to pull pileup events from.
void onNewRun(const ldmx::RunHeader &) override
At the start of the run, the pileup overlay file is set up, and the starting event number is chosen,...
double bunchSpacing_
Spacing in time (in [ns]) between electron bunches.
double timeMean_
Average position in time (in [ns]) of pileup bunches, relative to the sim event.
framework::config::Parameters params_
The parameters used to configure this producer.
double poissonMu_
(average) total number of events
framework::Event overlayEvent_
The overlay ldmx event bus.
int nLater_
Number of bunches after the sim event to pull pileup events from.
bool doPoissonIT_
Let the total number of in-time events be poisson distributed, or fix at the chosen value,...
std::unique_ptr< TRandom2 > rndm_
Random number generator for number of overlaid events.
void produce(framework::Event &event) override
Based on the list of collections to overlay, and the desired number of events, loop through all relev...
double timeSigma_
Width of pileup bunch spread in time (in [ns]), specified as a sigma of a Gaussian distribution.
void configure(framework::config::Parameters &parameters) override
Configure the processor with input parameters from the python cofig.
bool doPoissonOOT_
Let the total number of out-of-time events be poisson distributed, or fix at the chosen value,...
void onProcessStart() override
At the start of processing, the pileup overlay file is set up.
std::vector< std::string > trackerCollections_
List of SimTrackerHit collection(s) to loop over and add hits from, combining sim and pileup.