Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JAnalysis Struct Referenceabstract

Example class for data analysis. More...

Inheritance diagram for JAnalysis:
JLANG::JObjectOutput< JDAQTimeslice >

Public Member Functions

 JAnalysis ()
 Constructor.
 
 ~JAnalysis ()
 Destructior.
 
virtual bool put (const JDAQTimeslice &timeslice)
 Process data.
 
virtual bool put (const JDAQTimeslice &object)=0
 Object output.
 

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::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::~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 }
string outputFile
#define STATUS(A)
Definition JMessage.hh:63

Member Function Documentation

◆ put() [1/2]

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 }
JDAQPMTIdentifier PMT
Command line options.
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
Hit data structure.
Definition JDAQHit.hh:35
static bool compare(const JDAQPMTIdentifier &first, const JDAQPMTIdentifier &second)
Compare PMT identifiers.

◆ put() [2/2]

virtual bool JLANG::JObjectOutput< JDAQTimeslice >::put ( const JDAQTimeslice & object)
pure virtualinherited

Object output.

Parameters
objectobject
Returns
true if OK; else false

Member Data Documentation

◆ h0

TH1D JAnalysis::h0

Definition at line 103 of file JDAQTimesliceSelector.cc.

◆ h1

TH1D JAnalysis::h1

Definition at line 104 of file JDAQTimesliceSelector.cc.

◆ h2

TH1D JAnalysis::h2

Definition at line 105 of file JDAQTimesliceSelector.cc.

◆ counter

counter_type JAnalysis::counter

Definition at line 107 of file JDAQTimesliceSelector.cc.


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