Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Private Attributes | List of all members
JRunAnalyzer Class Reference

Class dedicated to the analysis of KM3NeT runs. More...

#include <JRunAnalyzer.hh>

Classes

struct  dom_type
 

Public Member Functions

 JRunAnalyzer (const JSingleFileScanner<> &file, const JDetector &detector, TFile *out, JLimit_t nTimeslices, JLimit_t nSummaryslices, JLimit_t nEvents, int analysislevel)
 Constructor. More...
 
 ~JRunAnalyzer ()
 Destructor. More...
 
void iterateEventTree (JTreeScanner< JDAQEvent > &scanner)
 
void iterateRecoEventTree (JParallelFileScanner< JTypeList< JDAQEvent, JFIT::JEvt > > &scanner, TFile &f)
 
void iterateSummarysliceTree (JTreeScanner< JDAQSummaryslice > &scanner)
 
template<class T >
void iterateTimesliceTree (JTreeScanner< T > &scanner)
 
void readSummaryData ()
 
template<class T >
void readTimesliceData ()
 
void readEvents ()
 
void readRecoEvents ()
 
void writeToFile (TFile *f, int analysis_level)
 

Private Attributes

JSingleFileScanner inputFile
 
JModuleRouter router
 
TFile * outputFile
 
JRA_Histograms histograms
 
JLimit_t numberOfTimeslices
 
JLimit_t numberOfSummaryslices
 
JLimit_t numberOfEvents
 
int analysis_level
 

Detailed Description

Class dedicated to the analysis of KM3NeT runs.

Definition at line 37 of file JRunAnalyzer.hh.

Constructor & Destructor Documentation

JRunAnalyzer::JRunAnalyzer ( const JSingleFileScanner<> &  file,
const JDetector detector,
TFile *  out,
JLimit_t  nTimeslices,
JLimit_t  nSummaryslices,
JLimit_t  nEvents,
int  analysislevel 
)
inline

Constructor.

Parameters
filefile name
detectordetector
outpointer to output file
nTimeslicesnumber of timeslices to be read
nSummaryslicesnumber of summary slices to be read
nEventsnumber of events to be read
analysisleveloption for analysis of PMT or reco data

Definition at line 61 of file JRunAnalyzer.hh.

62  :
63  inputFile (file),
64  router (detector),
65  outputFile (out),
66  numberOfTimeslices (nTimeslices),
67  numberOfSummaryslices (nSummaryslices),
68  numberOfEvents (nEvents),
69  analysis_level (analysislevel)
70  {
71  using namespace JPP;
72  using namespace std;
73 
74  histograms = JRA_Histograms(detector);
75  }
TFile * outputFile
Definition: JRunAnalyzer.hh:41
JRA_Histograms histograms
Definition: JRunAnalyzer.hh:42
JLimit_t numberOfTimeslices
Definition: JRunAnalyzer.hh:43
JSingleFileScanner inputFile
Definition: JRunAnalyzer.hh:39
JModuleRouter router
Definition: JRunAnalyzer.hh:40
JLimit_t numberOfEvents
Definition: JRunAnalyzer.hh:45
JLimit_t numberOfSummaryslices
Definition: JRunAnalyzer.hh:44
JRunAnalyzer::~JRunAnalyzer ( )
inline

Destructor.

Definition at line 80 of file JRunAnalyzer.hh.

80 {}

Member Function Documentation

void JRunAnalyzer::iterateEventTree ( JTreeScanner< JDAQEvent > &  scanner)
inline

Definition at line 88 of file JRunAnalyzer.hh.

88  {
89 
90  while (scanner.hasNext()) {
91 
92  JDAQEvent event = *(scanner.next());
93 
94  histograms.h_trigger.h_Snapshot_hits -> Fill((Double_t) event.size<JDAQSnapshotHit> ());
95  histograms.h_trigger.h_Triggered_hits -> Fill((Double_t) event.size<JDAQTriggeredHit> ());
96  histograms.h_trigger.h_Triggered_over_Snapshot_hits -> Fill((Double_t) event.size<JDAQTriggeredHit> () / event.size<JDAQSnapshotHit > ());
97  histograms.h_trigger.h_Number_of_overlays -> Fill(event.getOverlays());
98 
99  for (unsigned int i = 0; i != NUMBER_OF_TRIGGER_BITS; ++i) {
100 
101  if (event.hasTriggerBit(i)) {
102 
103  histograms.h_trigger.h_Trigger_bit_event -> Fill((Double_t) i);
104  }
105  }
106 
107  int counter_3dmuon = 0;
108  typedef JRange<double> JRange_t;
109  JRange_t range(JRange_t::DEFAULT_RANGE());
110 
111  for (JDAQEvent::const_iterator<JDAQTriggeredHit> hit = event.begin<JDAQTriggeredHit>(); hit != event.end<JDAQTriggeredHit>(); ++hit) {
112 
113  const JModule& module = router.getModule(hit->getModuleID());
114  const double t1 = getTime(hit->getT(), module.getPMT(hit->getPMT()));
115 
116  range.include(t1);
117 
118  JDAQTriggerMask trigger_mask(event.getTriggerMask(*hit));
119 
120  if(trigger_mask.hasTriggerBit(getTriggerBit<JTrigger3DMuon>())) counter_3dmuon++;
121 
122  if (router.hasModule(hit->getModuleID())) {
123 
124  const JModule& module = router.getModule (hit->getModuleID());
125 
128 
129  int String = module.getString();
130  int Floor = module.getFloor();
131 
132  histograms.h_trigger.h_Triggered_hits_per_module -> Fill(String , Floor);
133 
134  if(trigger_mask.hasTriggerBit(getTriggerBit<JTrigger3DMuon>())){
136  }
137 
138  for (unsigned int i = 0; i != NUMBER_OF_TRIGGER_BITS; ++i) {
139 
140  if (hit -> hasTriggerBit(i)) {
141 
142  histograms.h_trigger.h_Trigger_bit_hit->Fill((Double_t) i);
143  }
144  }
145  }else{
146  FATAL("JModuleRouter trying to access non existing identifier: "<< hit->getModuleID());
147  }
148  }
149 
150  histograms.h_trigger.h_event_duration->Fill(range.getLength());
151 
152  histograms.h_trigger.h_pmt_distribution_triggered_hits->Scale(1. / (Double_t) event.size<JDAQTriggeredHit> ());
153 
154  if(counter_3dmuon != 0) histograms.h_trigger.h_Triggered_hits_3dmuon->Fill(counter_3dmuon);
155 
156  for (JDAQEvent::const_iterator<JDAQSnapshotHit> hit = event.begin<JDAQSnapshotHit>() ; hit != event.end<JDAQSnapshotHit>() ; ++hit){
157 
158  if (router.hasModule(hit->getModuleID())) {
159 
160  const JModule& module = router.getModule (hit->getModuleID());
161 
162  int String = module.getString();
163  int Floor = module.getFloor();
164  int pmt = hit-> getPMT();
165 
166  if(analysis_level == 1){
167 
168  (*histograms.h_trigger.m_Snapshot_hits_per_pmt)[MAKE_STRING("Detector/DU" + to_string(String))] -> Fill(pmt, Floor);
169 
170  }
171 
172  histograms.h_trigger.h_pmt_distribution_snapshot_hits -> Fill(hit->getPMT());
174  histograms.h_trigger.h_Snapshot_hits_per_module -> Fill(String, Floor);
175 
176  }else{
177  FATAL("JModuleRouter trying to access non existing identifier: "<< hit->getModuleID());
178  }
179  }
180  }
181  }
TH1D * h_pmt_distribution_snapshot_hits
TH2D * h_Snapshot_hits_per_module
DAQ key hit.
Definition: JDAQKeyHit.hh:19
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits.
TH1D * h_pmt_distribution_triggered_hits
int getFloor() const
Get floor number.
Definition: JLocation.hh:145
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Definition: JModule.hh:67
Auxiliary class for trigger mask.
JRA_Histograms histograms
Definition: JRunAnalyzer.hh:42
TH2D * h_Triggered_hits_per_module
Template const_iterator.
Definition: JDAQEvent.hh:66
double getTime(const Hit &hit)
Get true time of hit.
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:127
Type definition of range.
Definition: JHead.hh:41
JModuleRouter router
Definition: JRunAnalyzer.hh:40
TH1D * h_tot_distribution_snapshot_hits
TriggerHistograms h_trigger
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:172
#define FATAL(A)
Definition: JMessage.hh:67
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
int getString() const
Get string number.
Definition: JLocation.hh:134
General purpose string class.
Definition: JHead.hh:152
std::string to_string(const T &value)
Convert value to string.
bool hasModule(const JObjectID &id) const
Has module.
TH1D * h_tot_distribution_triggered_hits
TH1D * h_Triggered_hits_3dmuon
TH2D * h_Triggered_hits_3dmuon_per_module
JManager< string, TH2D > * m_Snapshot_hits_per_pmt
TH1D * h_Triggered_over_Snapshot_hits
void JRunAnalyzer::iterateRecoEventTree ( JParallelFileScanner< JTypeList< JDAQEvent, JFIT::JEvt > > &  scanner,
TFile &  f 
)
inline

Definition at line 189 of file JRunAnalyzer.hh.

189  {
190 
191  TH1D* h_tres = new TH1D("h_tres", ";Time residuals [ns]; Entries", 100, -50, 150);
192  TH1D* h_likelihood = new TH1D ("h_likelihood", " ; Likelihood; Reconstructed Events ", 100, -1000, 1000);
193  TH1D* h_beta0 = new TH1D("h_beta0", "; beta0; Reconstructed Events", 20, 0, 1);
194  TH1D* h_energy = new TH1D ("h_energy", " ; Energy [GeV]; Reconstructed Events ", 65, 0, 9);
195  setLogarithmicX(h_energy);
196  TH1D* h_zenith = new TH1D("h_zenith", "; cosZenith; Reconstructed Events", 20, -1, 1);
197  TH1D* h_azimuth = new TH1D("h_azimuth", "; cosAzimuth; Reconstructed Events", 20, -1, 1);
198  TH1D* h_radial_position = new TH1D ("h_radial_position", "; Radial Position [m]; Reconstructed Events", 60, 0, 4.2);
199  setLogarithmicX(h_radial_position);
200  TH1D* h_z_position = new TH1D ("h_z_position", "; Z Position [m] ; Reconstructed Events", 50, 0, 3.2);
201  setLogarithmicX(h_z_position);
202 
203  while (scanner.hasNext()) {
204 
205  JParallelFileScanner< JTypeList<JDAQEvent, JFIT::JEvt> >::multi_pointer_type ps = scanner.next();
206 
207  JEvt* evt = ps;
208  JDAQEvent* event = ps;
209 
210  if (!evt->empty()) {
211 
212  JEvt::iterator best = evt->begin();
213  h_energy -> Fill(best->getE());
214  h_likelihood -> Fill(best->getQ());
215  h_z_position -> Fill(best->getZ());
216  h_radial_position -> Fill(sqrt(best->getX()*best->getX() + best->getY()*best->getY()));
217 
218  JTrack3D track = getTrack(*best);
219  h_zenith -> Fill(cos(track.getDirection().getTheta()));
220  h_azimuth -> Fill(cos(track.getDirection().getPhi()));
221  h_beta0 -> Fill(best->getW(JGANDALF_BETA0_RAD));
222 
223  std::vector<JHitL0> dataL0;
224  const JBuildL0<JHitL0> buildL0;
225  buildL0(JDAQTimeslice(*event, false), router, back_inserter(dataL0));
226 
227  for (std::vector<JHitL0>::const_iterator hit = dataL0.begin(); hit != dataL0.end(); ++hit) {
228 
229  h_tres -> Fill(hit->getT() - track.getT(hit->getPosition()));
230  }
231  }
232  }
233 
234  f.mkdir("Reco");
235  f.cd("Reco");
236 
237  h_energy->Write();
238  h_likelihood -> Write();
239  h_z_position -> Write();
240  h_radial_position -> Write();
241  h_zenith -> Write();
242  h_azimuth -> Write();
243  h_beta0 -> Write();
244  h_tres -> Write();
245  }
virtual const multi_pointer_type & next() override
Get next element.
JTrack3E getTrack(const Trk &track)
Get track.
Template specialisation of L0 builder for JHitL0 data type.
Definition: JBuildL0.hh:102
General purpose class for parallel reading of objects from a single file or multiple files...
double getPhi() const
Get phi angle.
Definition: JVersor3D.hh:144
JVersor3D getDirection(const JVector3D &pos) const
Get photon direction of Cherenkov light on PMT.
Definition: JTrack3D.hh:147
JModuleRouter router
Definition: JRunAnalyzer.hh:40
Acoustic event fit.
void setLogarithmicX(TList *list)
Make x-axis of objects in list logarithmic (e.g. after using log10()).
double getTheta() const
Get theta angle.
Definition: JVersor3D.hh:128
Data time slice.
static const int JGANDALF_BETA0_RAD
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition: JTrack3D.hh:126
then JHobbit a $DETECTOR f
void JRunAnalyzer::iterateSummarysliceTree ( JTreeScanner< JDAQSummaryslice > &  scanner)
inline

Definition at line 260 of file JRunAnalyzer.hh.

260  {
261 
262  using namespace std;
263  using namespace JPP;
264 
265  map<int, map<int, dom_type> > PMT_rate_quantiles;
266  map<int, map<int, JQuantile> > DOM_rate_quantiles;
267 
268  while (scanner.hasNext()){
269 
270  JDAQSummaryslice slice = *(scanner.next());
271 
272  for (JDAQSummaryslice::const_iterator frame = slice.begin() ; frame != slice.end() ; ++ frame) {
273 
274  if (router.hasModule(frame->getModuleID())) {
275 
276  const JModule& module = router.getModule (frame->getModuleID());
277 
278  int string = module.getString();
279  int floor = module.getFloor ();
280 
281  JDAQFrameStatus status = frame -> getDAQFrameStatus();
282  int nFIFOcount = status.countFIFOStatus();
283  int nHRVcount = status.countHighRateVeto();
284 
285  if (nHRVcount > 0) {
286  histograms.h_summary.h_hrv_per_dom->Fill(string , floor, nHRVcount);
287  }
288 
289  if (status.testDAQStatus() == false) {
290  histograms.h_summary.h_daq_status_per_dom->Fill(string , floor, (1./distance(scanner.begin(), scanner.end()))*100);
291  }
292 
293  histograms.h_summary.h_fifo_per_dom->Fill(string , floor , nFIFOcount);
294 
295  if(analysis_level == 1){
296 
297  TH2D* h2 = (*histograms.h_summary.m_summary_rate_distribution)[MAKE_STRING("Detector/DU" + to_string(string) + "/F" + to_string(floor))];
298 
299  double rate = 0;
300  const double factor = 1.0e-3; // [kHz]
301 
302  for (int i = 0 ; i < NUMBER_OF_PMTS ; i++){
303 
304  rate += frame->getRate(i, factor);
305 
306  h2->Fill(i , frame->getRate(i, factor));
307 
308  PMT_rate_quantiles[string][floor][i].put(frame->getRate(i, factor));
309 
310  histograms.h_summary.h_pmt_rate_distribution->Fill(frame->getRate(i, factor), frame->getWeight(i, factor));
311 
312  }
313 
315 
316  DOM_rate_quantiles[string][floor].put(rate);
317 
318  } else {
319 
320  double rate = 0;
321  const double factor = 1.0e-3; // [kHz]
322 
323  for (int i = 0 ; i < NUMBER_OF_PMTS ; i++){
324 
325  rate += frame->getRate(i, factor);
326 
327  histograms.h_summary.h_pmt_rate_distribution->Fill(frame->getRate(i, factor), frame->getWeight(i, factor));
328  }
329 
331 
332  DOM_rate_quantiles[string][floor].put(rate);
333 
334  }
335 
336  }else{
337  FATAL("JModuleRouter trying to access non existing identifier: "<< frame->getModuleID());
338  }
339  }
340  }
341 
342  for (const auto& i1 : DOM_rate_quantiles) {
343  for (const auto& i2 : i1.second) {
344  if (i2.second.getCount() > 0) {
345  histograms.h_summary.h_rate_summary->Fill(i1.first, i2.first, i2.second.getMean());
346  }
347  }
348  }
349 
350  if (analysis_level == 1){
351  for (const auto& i1 : PMT_rate_quantiles){
352 
353  TH2D* h2 = (*histograms.h_summary.m_mean_summary_rate) [MAKE_STRING("Detector/DU" + to_string(i1.first))];
354  TH1D* h1 = (*histograms.h_summary.m_mean_summary_rate_distribution)[MAKE_STRING("Detector/DU" + to_string(i1.first))];
355 
356  for (const auto& i2 : i1.second) {
357  for (int i3 = 0 ; i3 != NUMBER_OF_PMTS ; ++i3) {
358  if (i2.second[i3].getCount() > 0){
359  h2->Fill(i3, i2.first, i2.second[i3].getMean());
360  h1->Fill(i2.second[i3].getMean());
361  }
362  }
363  }
364  }
365  }
366  }
int countFIFOStatus() const
Count FIFO status.
JManager< string, TH1D > * m_mean_summary_rate_distribution
int getFloor() const
Get floor number.
Definition: JLocation.hh:145
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Definition: JModule.hh:67
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
JRA_Histograms histograms
Definition: JRunAnalyzer.hh:42
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
JManager< string, TH2D > * m_mean_summary_rate
TH1D * h_dom_rate_distribution
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:127
JModuleRouter router
Definition: JRunAnalyzer.hh:40
TH1D * h_pmt_rate_distribution
#define FATAL(A)
Definition: JMessage.hh:67
SummaryHistograms h_summary
int getString() const
Get string number.
Definition: JLocation.hh:134
int countHighRateVeto() const
Count high-rate veto status.
JManager< string, TH2D > * m_summary_rate_distribution
std::string to_string(const T &value)
Convert value to string.
bool hasModule(const JObjectID &id) const
Has module.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
bool testDAQStatus() const
Test DAQ status of packets.
template<class T >
void JRunAnalyzer::iterateTimesliceTree ( JTreeScanner< T > &  scanner)
inline

Definition at line 374 of file JRunAnalyzer.hh.

374  {
375 
377 
378  std::map < int , std::map <int , JQuantile> > DOM_rate_quantiles;
379 
380  double inverseFrameTimeSec = 1. / (1.0e-9 * getFrameTime());
381 
382  while (scanner.hasNext()){
383 
384  T slice = *(scanner.next());
385 
386  for(auto & frame : slice) {
387  if (router.hasModule(frame.getModuleID())) {
388 
389  const JModule& module = router.getModule (frame.getModuleID());
390  double rate = frame.numberOfHits * inverseFrameTimeSec;
391  int string = module.getString();
392  int floor = module.getFloor ();
393 
394  DOM_rate_quantiles[string][floor].put(rate);
395 
396  vector <int> pmt_hit_count (NUMBER_OF_PMTS , 0) ;
397 
398  if(analysis_level == 1){
399 
400  TH2D* h2 = (*histograms.h_timeslice.m_pmt_tot_distributions[ts_type])[MAKE_STRING("Detector/DU" + to_string(string) + "/F" + to_string(floor) + "/" + to_string(frame.getModuleID()))];
401 
402  for (JDAQSuperFrame::const_iterator hit = frame.begin() ; hit != frame.end() ; ++hit){
403 
404  h2 -> Fill(hit->getPMT() , hit->getToT()) ;
405 
406  pmt_hit_count[hit->getPMT()]++;
407 
408  }
409 
410  for (int pmt = 0 ; pmt != NUMBER_OF_PMTS ; ++pmt) {
411 
412  (*histograms.h_timeslice.m_pmt_rate_distributions[ts_type])[MAKE_STRING("Detector/DU" + to_string(string) + "/F" + to_string(floor))] -> Fill(pmt , 1e-3 * pmt_hit_count[pmt] * inverseFrameTimeSec);
413 
414  }
415 
416  }
417 
418  }else{
419  FATAL("JModuleRouter trying to access non existing identifier: "<< frame.getModuleID());
420  }
421  }
422  }
423 
424  for (std::map< int , std::map<int,JQuantile>>::const_iterator i = DOM_rate_quantiles.begin() ; i != DOM_rate_quantiles.end() ; i++){
425 
426  for (std::map<int , JQuantile>::const_iterator j = i->second.begin() ; j != i->second.end() ; j++){
427 
428  if (j->second.getCount() > 0) histograms.h_timeslice.h_dom_mean_rates[ts_type] -> Fill (i->first , j->first , j->second.getMean() ) ;
429  }
430  }
431  }
vector< JManager< string, TH2D > * > m_pmt_tot_distributions
int getFloor() const
Get floor number.
Definition: JLocation.hh:145
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Definition: JModule.hh:67
vector< TH2D * > h_dom_mean_rates
JRA_Histograms histograms
Definition: JRunAnalyzer.hh:42
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:127
TimesliceHistograms h_timeslice
JModuleRouter router
Definition: JRunAnalyzer.hh:40
Hit data structure.
Definition: JDAQHit.hh:34
double getFrameTime()
Get frame time duration.
Definition: JDAQClock.hh:162
do set_variable OUTPUT_DIRECTORY $WORKDIR T
#define FATAL(A)
Definition: JMessage.hh:67
int getString() const
Get string number.
Definition: JLocation.hh:134
std::string to_string(const T &value)
Convert value to string.
vector< JManager< string, TH2D > * > m_pmt_rate_distributions
bool hasModule(const JObjectID &id) const
Has module.
int j
Definition: JPolint.hh:792
Indexing of data type in type list.
Definition: JTypeList.hh:310
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
void JRunAnalyzer::readSummaryData ( )
inline

Definition at line 438 of file JRunAnalyzer.hh.

438  {
439 
441  if (scanner.hasNext()) {
443  scanner.rewind();
444  iterateSummarysliceTree(scanner);
445  }
446  }
JRA_Histograms histograms
Definition: JRunAnalyzer.hh:42
void initialize_summary_histograms()
JSingleFileScanner inputFile
Definition: JRunAnalyzer.hh:39
void iterateSummarysliceTree(JTreeScanner< JDAQSummaryslice > &scanner)
Template definition for direct access of elements in ROOT TChain.
JLimit_t numberOfSummaryslices
Definition: JRunAnalyzer.hh:44
template<class T >
void JRunAnalyzer::readTimesliceData ( )
inline

Definition at line 454 of file JRunAnalyzer.hh.

454  {
455 
457  if(scanner.hasNext()) {
458 
460  scanner.rewind();
461  iterateTimesliceTree(scanner);
462  }
463  }
void iterateTimesliceTree(JTreeScanner< T > &scanner)
JRA_Histograms histograms
Definition: JRunAnalyzer.hh:42
JLimit_t numberOfTimeslices
Definition: JRunAnalyzer.hh:43
JSingleFileScanner inputFile
Definition: JRunAnalyzer.hh:39
do set_variable OUTPUT_DIRECTORY $WORKDIR T
void initialize_timeslice_histograms()
void JRunAnalyzer::readEvents ( )
inline

Definition at line 470 of file JRunAnalyzer.hh.

470  {
471 
473 
474  if(scanner.hasNext()) {
475 
477  scanner.rewind();
478  iterateEventTree(scanner);
479  }
480  }
JRA_Histograms histograms
Definition: JRunAnalyzer.hh:42
JSingleFileScanner inputFile
Definition: JRunAnalyzer.hh:39
Template definition for direct access of elements in ROOT TChain.
void iterateEventTree(JTreeScanner< JDAQEvent > &scanner)
Definition: JRunAnalyzer.hh:88
JLimit_t numberOfEvents
Definition: JRunAnalyzer.hh:45
void initialize_trigger_histograms()
void JRunAnalyzer::readRecoEvents ( )
inline

Definition at line 486 of file JRunAnalyzer.hh.

486  {
487 
489 
490  if(scanner.hasNext()) {
491 
492  scanner.rewind();
493  iterateRecoEventTree(scanner, *outputFile);
494  }
495  }
TFile * outputFile
Definition: JRunAnalyzer.hh:41
General purpose class for parallel reading of objects from a single file or multiple files...
JSingleFileScanner inputFile
Definition: JRunAnalyzer.hh:39
void iterateRecoEventTree(JParallelFileScanner< JTypeList< JDAQEvent, JFIT::JEvt > > &scanner, TFile &f)
JLimit_t numberOfEvents
Definition: JRunAnalyzer.hh:45
void JRunAnalyzer::writeToFile ( TFile *  f,
int  analysis_level 
)
inline

Definition at line 501 of file JRunAnalyzer.hh.

501  {
502 
503  f->mkdir("Detector");
504  f->cd("Detector");
505 
512 
514 
515  for (typename vector < JManager < string , TH2D >* >::const_iterator i = histograms.h_timeslice.m_pmt_tot_distributions.begin();
517 
518  if ((*i)){
519 
520  for (typename JManager < string , TH2D >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
521 
522  j->second->Scale(1., "width");
523  }
524  }
525  }
526 
529 
531 
534 
536 
539 
540  f->mkdir ( MAKE_STRING ("JDAQEvent").c_str());
541  f->cd ("JDAQEvent");
542 
559 
560  }
TH1D * h_pmt_distribution_snapshot_hits
TH2D * h_Snapshot_hits_per_module
TH1D * h_pmt_distribution_triggered_hits
vector< JManager< string, TH2D > * > m_pmt_tot_distributions
JManager< string, TH1D > * m_mean_summary_rate_distribution
vector< TH2D * > h_dom_mean_rates
JRA_Histograms histograms
Definition: JRunAnalyzer.hh:42
TH2D * h_Triggered_hits_per_module
JManager< string, TH2D > * m_mean_summary_rate
TH1D * h_dom_rate_distribution
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:127
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Definition: JManager.hh:43
TimesliceHistograms h_timeslice
TH1D * h_tot_distribution_snapshot_hits
TriggerHistograms h_trigger
void Write_manager_table_in_key_dir(TFile &f, vector< JManager< T, V > * > table)
TH1D * h_pmt_rate_distribution
void Write_histogram_table_to_file(TFile &f, string dirname, vector< vector< T * > > table)
vector< JManager< string, TH1D > * > m_mean_ToT_distribution
SummaryHistograms h_summary
JManager< string, TH2D > * m_summary_rate_distribution
void Write_manager_in_key_dir(TFile &f, JManager< T, V > *manager)
then JHobbit a $DETECTOR f
vector< JManager< string, TH2D > * > m_mean_ToT
vector< JManager< string, TH2D > * > m_pmt_rate_distributions
TH1D * h_tot_distribution_triggered_hits
TH1D * h_Triggered_hits_3dmuon
int j
Definition: JPolint.hh:792
TH2D * h_Triggered_hits_3dmuon_per_module
JManager< string, TH2D > * m_Snapshot_hits_per_pmt
TH1D * h_Triggered_over_Snapshot_hits

Member Data Documentation

JSingleFileScanner JRunAnalyzer::inputFile
private

Definition at line 39 of file JRunAnalyzer.hh.

JModuleRouter JRunAnalyzer::router
private

Definition at line 40 of file JRunAnalyzer.hh.

TFile* JRunAnalyzer::outputFile
private

Definition at line 41 of file JRunAnalyzer.hh.

JRA_Histograms JRunAnalyzer::histograms
private

Definition at line 42 of file JRunAnalyzer.hh.

JLimit_t JRunAnalyzer::numberOfTimeslices
private

Definition at line 43 of file JRunAnalyzer.hh.

JLimit_t JRunAnalyzer::numberOfSummaryslices
private

Definition at line 44 of file JRunAnalyzer.hh.

JLimit_t JRunAnalyzer::numberOfEvents
private

Definition at line 45 of file JRunAnalyzer.hh.

int JRunAnalyzer::analysis_level
private

Definition at line 46 of file JRunAnalyzer.hh.


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