51 using namespace KM3NETDAQ;
73 JParser<> zap(
"Example program to check for sparks.");
76 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
87 catch(
const exception& error) {
88 FATAL(error.what() << endl);
103 unique_ptr<JDynamics> dynamics;
109 dynamics->load(calibrationFile);
111 catch(
const exception& error) {
112 if (!calibrationFile.empty()) {
121 TH1D h0(
"h0", NULL, 50, -1.0, 2.0);
123 JManager<int, TH2D> H2(
new TH2D(
"h2[%]", NULL, router.size(), -0.5, router.size() - 0.5,
range.getUpperLimit(), 1 - 0.5,
range.getUpperLimit() + 0.5));
125 for (Int_t
i = 1;
i <= H2->GetXaxis()->GetNbins(); ++
i) {
128 for (Int_t
i = 1;
i <= H2->GetYaxis()->GetNbins(); ++
i) {
138 for (
string file_name =
""; inputFile.hasNext(); ) {
140 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
142 const Evt* evt = inputFile.next();
147 dynamics->update(evt->
t.GetSec());
152 if (!evt->
w.empty()) {
158 if (file_name != inputFile.getFilename()) {
160 file_name = inputFile.getFilename();
166 if (
is_mupage(head)) { W = head.DAQ.livetime_s / head.livetime.numberOfSeconds; }
167 if (
is_pure_noise(head)) { W = head.DAQ.livetime_s / head.K40.livetime_s; }
169 catch(
const exception& error) {}
173 double Dmin = numeric_limits<double>::max();
183 for (
const auto& module : (dynamics ? dynamics->getDetector() :
detector)) {
185 if (module.getFloor() != 0) {
191 location = module.getLocation();
197 if (Dmin != numeric_limits<double>::max()) {
199 h0.Fill(
log10(Dmin), W);
201 const int i =
distance(Dmax_m.begin(), Dmax_m.lower_bound(Dmin));
203 H2 ->Fill((
double) router.getIndex(location.getString()), (
double) location.getFloor(), W);
204 H2[
i]->Fill((
double) router.getIndex(location.getString()), (
double) location.getFloor(), W);
216 for (
auto& h2 : H2) {
bool is_mupage(const JHead &header)
Check for generator.
Utility class to parse command line options.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
Auxiliary class for trigger mask.
JTrack3E getTrack(const Trk &track)
Get track.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Utility class to parse parameter values.
#define MAKE_CSTRING(A)
Make C-string.
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions) ...
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
floor_range getRangeOfFloors(const JDetector &detector)
Get range of floors.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
static const JDAQTriggerMask TRIGGER_MASK_ON
Trigger mask on;.
static const int WEIGHTLIST_RUN_BY_RUN_WEIGHT
w[1]*DAQ_livetime / MC_evts_summary::n_gen (gseagen; [GeV m2 sr s]) or DAQ_livetime/MC_evts_summary::...
Auxiliary class for defining the range of iterations of objects.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
bool is_pure_noise(const JHead &header)
Check for generator.
Logical location of module.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
set_variable E_E log10(E_{fit}/E_{#mu})"
bool hasTriggerMask(const JDAQTriggerMask &mask) const
Has trigger bit pattern.
const JPosition3D & getPosition() const
Get position.
static const int TRK_ST_UNDEFINED
status was not defined for this MC track (all reco tracks have this value)
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
Dynamic detector calibration.
TTimeStamp t
UTC time of the timeslice, or the event_time for MC. (default: 01 Jan 1970 00:00:00) ...
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Router for mapping of string identifier to index.
General purpose class for object reading from a list of file names.
const JLimit & getLimit() const
Get limit.
do set_variable DETECTOR_TXT $WORKDIR detector
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
do echo Generating $dir eval D
ULong64_t trigger_mask
trigger mask from raw data (i.e. the trigger bits)
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
#define DEBUG(A)
Message macros.