NueRead Class Reference

#include <NueRead.h>

Inheritance diagram for NueRead:
JobCModule

List of all members.

Public Member Functions

 NueRead ()
 ~NueRead ()
JobCResult Ana (const MomNavigator *mom)
void EndJob ()

Private Attributes

TFile * f
TH1F * hpar0
int counter
int passcounter

Detailed Description

Definition at line 17 of file NueRead.h.


Constructor & Destructor Documentation

NueRead::NueRead (  ) 

Definition at line 22 of file NueRead.cxx.

References f, and hpar0.

00022                 :
00023    counter(0),
00024    passcounter(0)
00025 {
00026    f=new TFile("testfile.root","RECREATE");
00027    f->cd();
00028    hpar0=new TH1F("hpar0","hpar0",100,0,100);
00029 }

NueRead::~NueRead (  ) 

Definition at line 33 of file NueRead.cxx.

References f.

00034 {
00035    if(f){
00036       if(f->IsOpen()){
00037          f->Write();
00038          f->Close();
00039       }
00040    }
00041 
00042 //======================================================================
00043 // FILL_IN: [Document your code!!]
00044 //======================================================================
00045 }


Member Function Documentation

JobCResult NueRead::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 49 of file NueRead.cxx.

References counter, MomNavigator::FragmentIter(), hpar0, Msg::kDebug, Msg::kError, JobCResult::kPassed, MSG, Shwfit::par_a, passcounter, and NueRecord::shwfit.

00050 {
00051    //get all NueRecords from mom 
00052    //may have more than one per go since mom reads in a snarl's worth of data
00053    //so, this is a little more complicated than just asking for a NueRecord
00054    TObject *obj=0;
00055    TIter objiter = mom->FragmentIter();
00056    while((obj=objiter.Next())){
00057       NueRecord *nr = static_cast<NueRecord *>(obj);
00058       if(nr){
00059          MSG("NueRead",Msg::kDebug)<<"Found a NueRecord in MOM"<<endl;
00060       }
00061       else{
00062          MSG("NueRead",Msg::kError)<<"Didn't find a NueRecord in MOM"<<endl;
00063          counter++;
00064          continue;
00065       }
00066       MSG("NueRead",Msg::kDebug)<<"Found a NueRecord "<<nr<<endl;
00067       counter++;
00068       
00069       //fill histogram
00070       hpar0->Fill(nr->shwfit.par_a);
00071       passcounter++;
00072    }
00073    return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00074 }

void NueRead::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 77 of file NueRead.cxx.

References counter, hpar0, Msg::kInfo, MSG, and passcounter.

00078 {
00079    MSG("NueRead",Msg::kInfo)<<"Counter "<<counter<<" passcounter "<<passcounter<<endl;
00080    MSG("NueRead",Msg::kInfo)<<"Entries in histogram "<<hpar0->GetEntries()<<endl;
00081 }


Member Data Documentation

int NueRead::counter [private]

Definition at line 31 of file NueRead.h.

Referenced by Ana(), and EndJob().

TFile* NueRead::f [private]

Definition at line 29 of file NueRead.h.

Referenced by NueRead(), and ~NueRead().

TH1F* NueRead::hpar0 [private]

Definition at line 30 of file NueRead.h.

Referenced by Ana(), EndJob(), and NueRead().

int NueRead::passcounter [private]

Definition at line 32 of file NueRead.h.

Referenced by Ana(), and EndJob().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1