Jpp  15.0.1-rc.2-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
JAnalysis Struct Reference

Example class for data analysis. More...

Inheritance diagram for JAnalysis:

Public Member Functions

 JAnalysis ()
 Constructor. More...
 
 ~JAnalysis ()
 Destructior. More...
 
virtual bool put (const JDAQTimeslice &timeslice)
 Process data. More...
 

Public Attributes

TH1D h0
 
TH1D h1
 
TH1D h2
 
counter_type counter
 

Detailed Description

Example class for data analysis.

Definition at line 43 of file JDAQTimesliceSelector.cc.

Constructor & Destructor Documentation

JAnalysis::JAnalysis ( )
inline

Constructor.

Definition at line 49 of file JDAQTimesliceSelector.cc.

49  :
50  //
51  // Book histograms
52  //
53  h0("h0", NULL, numeric_limits<JDAQHit::JPMT_t>::max(), -0.5, numeric_limits<JDAQHit::JPMT_t>::max() - 0.5),
54  h1("h1", NULL, numeric_limits<JDAQHit::JTOT_t>::max(), -0.5, numeric_limits<JDAQHit::JTOT_t>::max() - 0.5),
55  h2("h2", NULL, 100, -0.5, getFrameTime() + 0.5),
56  //
57  counter(0)
58  {}
double getFrameTime()
Get frame time duration.
Definition: JDAQClock.hh:162
counter_type counter
JAnalysis::~JAnalysis ( )
inline

Destructior.

Definition at line 64 of file JDAQTimesliceSelector.cc.

65  {
66  STATUS(endl);
67 
68  // save histograms
69 
70  TFile out(outputFile.c_str(), "recreate");
71 
72  out << h0 << h1 << h2;
73 
74  out.Write();
75  out.Close();
76  }
#define STATUS(A)
Definition: JMessage.hh:63
string outputFile

Member Function Documentation

virtual bool JAnalysis::put ( const JDAQTimeslice timeslice)
inlinevirtual

Process data.

Parameters
timeslicetimeslice
Returns
true

Definition at line 85 of file JDAQTimesliceSelector.cc.

86  {
87  STATUS("event: " << setw(10) << ++counter << '\r'); DEBUG(endl);
88 
89  for (JDAQTimeslice::const_iterator frame = timeslice.begin(); frame != timeslice.end(); ++frame) {
90  for (JDAQSuperFrame::const_iterator hit = frame->begin(); hit != frame->end(); ++hit) {
91 
92  if (JDAQPMTIdentifier::compare(PMT, JDAQPMTIdentifier(frame->getModuleID(), hit->getPMT()))) {
93  h0.Fill(hit->getPMT());
94  h1.Fill(hit->getToT());
95  h2.Fill(hit->getT());
96  }
97  }
98  }
99 
100  return true;
101  }
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
#define STATUS(A)
Definition: JMessage.hh:63
Hit data structure.
Definition: JDAQHit.hh:34
counter_type counter
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG

Member Data Documentation

TH1D JAnalysis::h0

Definition at line 103 of file JDAQTimesliceSelector.cc.

TH1D JAnalysis::h1

Definition at line 104 of file JDAQTimesliceSelector.cc.

TH1D JAnalysis::h2

Definition at line 105 of file JDAQTimesliceSelector.cc.

counter_type JAnalysis::counter

Definition at line 107 of file JDAQTimesliceSelector.cc.


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