49int main(
int argc,
char **argv)
56 JLimit_t& numberOfEvents = inputFile.getLimit();
75 properties[
"QE"] = QE;
77 JParser<> zap(
"Auxiliary program to determine PMT parameters from OMGsim data.");
79 zap[
'f'] =
make_field(inputFile,
"input file.");
82 zap[
'a'] =
make_field(detectorFile,
"detector file.");
83 zap[
'T'] =
make_field(TMax_ns,
"time window [ns].") = 20.0;
84 zap[
'R'] =
make_field(R,
"radioactivity [Bq]");
91 catch(
const exception &error) {
92 FATAL(error.what() << endl);
96 gRandom->SetSeed(seed);
109 FATAL(
"Wrong number of modules " <<
detector.size() << endl);
119 const Double_t WS = 0.25;
122 const Double_t xmin = -0.5;
123 const Double_t xmax = nx - 0.5;
125 const Double_t ymin = -floor(TMax_ns) + 0.5*WS;
126 const Double_t ymax = +floor(TMax_ns) - 0.5*WS;
127 const Int_t ny = (Int_t) ((ymax - ymin) / WS);
136 for (
size_t i = 0; i !=
module.size(); ++i) {
137 router.put(module[i].getID(), i);
140 double numberOfPrimaries = 0.0;
146 STATUS(
"Extracting header data... " << flush);
150 const JHead buffer(header);
159 }
catch(
const exception& error) {
160 FATAL(error.what() << endl);
163 if (numberOfPrimaries == 0.0) {
164 FATAL(
"Number of primaries " << numberOfPrimaries << endl);
193 const Evt* evt = inputFile.
next();
195 if (evt->
mc_hits.size() >= 2u) {
199 for (
const auto& hit : evt->
mc_hits) {
201 if (router.has(hit.pmt_id)) {
203 const int pmt = router.get(hit.pmt_id);
212 for (
const auto& hit : output) {
213 buffer.push_back({pmt, hit.t_ns});
219 for (vector<hit_type>::const_iterator p = buffer.begin(); p != buffer.end(); ++p) {
220 for (vector<hit_type>::const_iterator q = buffer.begin(); p != q; ++q) {
221 h2r.Fill((
double) combinatorics.
getIndex(p->pmt,q->pmt),
230 for (Int_t ix = 1; ix <= h2r.GetXaxis()->GetNbins(); ++ix) {
231 for (Int_t iy = 1; iy <= h2r.GetYaxis()->GetNbins(); ++iy) {
232 if (h2r.GetBinError(ix,iy) == 0.0) {
233 h2r.SetBinError(ix, iy, 1.0);
238 const double W = R / (WS * numberOfPrimaries);
KM3NeT DAQ constants, bit handling, etc.
Data structure for detector geometry and calibration.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
General purpose messaging.
#define DEBUG(A)
Message macros.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
int main(int argc, char **argv)
PMT analogue signal processor.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
#define MAKE_CSTRING(A)
Make C-string.
ROOT TTree parameter settings of various packages.
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
Data structure for a composite optical module.
Template data structure for PMT I/O.
Data structure for PMT parameters.
double QE
relative quantum efficiency
double gainSpread
gain spread [unit]
double TTS_ns
transition time spread [ns]
JProperties getProperties(const JEquationParameters &equation=JPMTParameters::getEquationParameters())
Get properties of this class.
double PunderAmplified
probability of underamplified hit
bool slewing
time slewing of analogue signal
Utility class to parse parameter values.
int getID() const
Get identifier.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
static const char *const _2R
Name extension for 2D rate measured.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
JCalibration getCalibration(const JCalibration &first, const JCalibration &second)
Get calibration to go from first to second calibration.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
KM3NeT DAQ data structures and auxiliaries.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
std::vector< Hit > mc_hits
MC: list of MC truth hits.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
double numberOfPrimaries
Number of primaries.
Transmission with position.
Auxiliary class to sort pairs of PMT addresses within optical module.
PMT analogue signal processor.
Data structure for PMT analogue signal.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.