LISummaryAnalyser Class Reference

#include <LISummaryAnalyser.h>

Inheritance diagram for LISummaryAnalyser:
JobCModule

List of all members.

Public Member Functions

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

Private Attributes

TH1F * hTimestamp
TH1F * hTimestampCorrelated
TH1F ** hMeanPb
TH1F ** hMeanCorrelatedPb
TCanvas * cTimestamp
Int_t plottedOnce
Int_t numSummariesProcessed
Int_t msgLevel
Int_t calibPoint
Int_t calibType
Int_t led
Float_t mean
Int_t numEntries
Int_t period
Int_t pulseHeight
Int_t pulserBox
Int_t pulses
Int_t pulseWidth
Float_t rms
Int_t timeNanoSec
Int_t timeSec
VldTimeStamp timeStamp

Detailed Description

Definition at line 35 of file LISummaryAnalyser.h.


Constructor & Destructor Documentation

LISummaryAnalyser::LISummaryAnalyser (  ) 

Definition at line 43 of file LISummaryAnalyser.cxx.

References Form(), Msg::kDebug, and MSG.

00044 {
00045   MSG("LISummaryAnalyser", Msg::kDebug) 
00046     << "Running constructor..." << endl;
00047   
00048   //initialise data members
00049   calibPoint=-1;
00050   calibType=-1;
00051   led=-1;
00052   mean=-1;
00053   numEntries=-1;
00054   period=-1;
00055   pulseHeight=-1;
00056   pulserBox=-1;
00057   pulses=-1;
00058   pulseWidth=-1;
00059   rms=-1;
00060   timeNanoSec=-1; 
00061   timeSec=-1;
00062 
00064   plottedOnce=0;
00065   numSummariesProcessed=0;
00066   msgLevel=0;
00067 
00068   hMeanPb=new TH1F*[NUMPULSERBOXES];
00069   hMeanCorrelatedPb=new TH1F*[NUMPULSERBOXES];
00070   for (Int_t i=0;i<NUMPULSERBOXES;i++){
00071     string s="Trigger PMT Mean ADC (Pb ";
00072     string pB=Form("%d",i);
00073     s=s+pB+")";
00074     hMeanPb[i]=new TH1F(s.c_str(),s.c_str(),20000,-5,17005);
00075     hMeanPb[i]->GetXaxis()->SetTitle("Mean");
00076     hMeanPb[i]->GetXaxis()->CenterTitle();
00077     hMeanPb[i]->GetYaxis()->SetTitle("Num Entries");
00078     hMeanPb[i]->GetYaxis()->CenterTitle();
00079     hMeanPb[i]->SetFillColor(0);
00080     hMeanPb[i]->SetBit(TH1::kCanRebin);
00081 
00082     s="Trigger PMT Mean ADC (Correlated, Pb ";
00083     s=s+pB+")";
00084     hMeanCorrelatedPb[i]=new TH1F(s.c_str(),s.c_str(),150,-5,17005);
00085     hMeanCorrelatedPb[i]->GetXaxis()->SetTitle("Mean");
00086     hMeanCorrelatedPb[i]->GetXaxis()->CenterTitle();
00087     hMeanCorrelatedPb[i]->GetYaxis()->SetTitle("Num Entries");
00088     hMeanCorrelatedPb[i]->GetYaxis()->CenterTitle();
00089     hMeanCorrelatedPb[i]->SetFillColor(0);
00090     hMeanCorrelatedPb[i]->SetLineColor(2);
00091     hMeanCorrelatedPb[i]->SetBit(TH1::kCanRebin);
00092   }
00093 
00094   hTimestamp=new TH1F("hTimestamp","Timestamp",
00095                       6000000,1.0365e9,1.0370e9);
00096   hTimestamp->GetXaxis()->SetTitle("Timestamp");
00097   hTimestamp->GetXaxis()->CenterTitle();
00098   hTimestamp->GetYaxis()->SetTitle("Number of entries");
00099   hTimestamp->GetYaxis()->CenterTitle();
00100   hTimestamp->SetFillColor(0);
00101   hTimestamp->SetBit(TH1::kCanRebin);
00102   
00103   hTimestampCorrelated=new TH1F("hTimestampCorrelated",
00104                                 "TimestampCorrelated",
00105                                 3000000,1.035e9,1.038e9);
00106   hTimestampCorrelated->GetXaxis()->SetTitle("TimestampCorrelated");
00107   hTimestampCorrelated->GetXaxis()->CenterTitle();
00108   hTimestampCorrelated->GetYaxis()->SetTitle("Number of entries");
00109   hTimestampCorrelated->GetYaxis()->CenterTitle();
00110   hTimestampCorrelated->SetFillColor(0);
00111   hTimestampCorrelated->SetLineColor(2);
00112   hTimestampCorrelated->SetBit(TH1::kCanRebin);
00113 
00114   cTimestamp=new TCanvas("cTimestamp","Timestamp",
00115                                   0,0,1200,600);
00116   cTimestamp->SetFillColor(0);
00117   cTimestamp->cd();
00118   hTimestamp->Draw();
00119   //hTimestampCorrelated->Draw("same");
00120 
00121   MSG("LISummaryAnalyser", Msg::kDebug) 
00122     << "Finished constructor" << endl;
00123 }

LISummaryAnalyser::~LISummaryAnalyser (  ) 

Definition at line 127 of file LISummaryAnalyser.cxx.

References Msg::kDebug, and MSG.

00128 {
00129   MSG("LISummaryAnalyser", Msg::kDebug) 
00130     << "Running destructor..." << endl;
00131 
00132   MSG("LISummaryAnalyser", Msg::kDebug) 
00133     << "Finished destructor" << endl;
00134 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 138 of file LISummaryAnalyser.cxx.

References RawLIAdcSummaryBlock::At(), cTimestamp, MuELoss::e, RawRecord::FindRawBlock(), RawLIAdcSummary::GetChannel(), RawChannelId::GetCrate(), RawLIAdcSummary::GetEntries(), MomNavigator::GetFragment(), RawLIAdcSummaryBlock::GetLed(), RawLIAdcSummary::GetMean(), VldTimeStamp::GetNanoSec(), RawLIAdcSummaryBlock::GetNumberOfSummaries(), RawLIAdcSummaryBlock::GetPulseHeight(), RawLIAdcSummaryBlock::GetPulserBox(), RawLIAdcSummaryBlock::GetPulses(), RawLIAdcSummary::GetRms(), VldTimeStamp::GetSec(), RawLIAdcSummaryBlock::GetTimeStamp(), RawChannelId::GetVaAdcSel(), RawChannelId::GetVaChip(), RawChannelId::GetVarcId(), RawChannelId::GetVmm(), hTimestamp, Msg::kInfo, JobCResult::kPassed, led, mean, MSG, msgLevel, n, numEntries, numSummariesProcessed, pulseHeight, pulserBox, pulses, rms, JobCResult::SetError(), JobCResult::SetFailed(), timeNanoSec, timeSec, and timeStamp.

00139 {
00140   JobCResult result(JobCResult::kPassed);
00141 
00142   //check that mom exists.
00143   assert(mom);
00144   
00145   //find raw record in mom
00146   RawRecord *rawrec = dynamic_cast<RawRecord *>
00147     (mom->GetFragment("RawRecord"));
00148   
00149   if (!rawrec) {
00150     result.SetError().SetFailed();
00151     return result;
00152   }
00153 
00154   //get LI Summary block from rawdatablock
00155   const RawLIAdcSummaryBlock *rawliadcsummaryblock = 
00156     dynamic_cast<const RawLIAdcSummaryBlock*>
00157     (rawrec->FindRawBlock("RawLIAdcSummaryBlock"));
00158 
00159   //check li block exists
00160   if(!rawliadcsummaryblock){  
00161     result.SetError().SetFailed();
00162     return result;
00163   }
00164 
00165   // Work through rawliadcsummaryblock..  
00166   timeStamp=rawliadcsummaryblock->GetTimeStamp();
00167   timeSec=static_cast<Int_t>(timeStamp.GetSec());
00168   timeNanoSec=static_cast<Int_t>(timeStamp.GetNanoSec());
00169   pulserBox=rawliadcsummaryblock->GetPulserBox();
00170   led=rawliadcsummaryblock->GetLed();
00171   pulseHeight=rawliadcsummaryblock->GetPulseHeight();
00172   pulses=rawliadcsummaryblock->GetPulses();
00173      
00174   if (numSummariesProcessed>msgLevel){
00175     MSG("LIAnalysis",Msg::kInfo) 
00176       <<"Number of summaries processed = "<<numSummariesProcessed
00177       <<endl;
00178     msgLevel+=500000;
00179   }
00180   numSummariesProcessed+=rawliadcsummaryblock->GetNumberOfSummaries();
00181 
00182   //Work through all summaries
00183   for(Int_t n=0;n<rawliadcsummaryblock->GetNumberOfSummaries();n++){
00184     const RawLIAdcSummary *rawliadcsummary=
00185       rawliadcsummaryblock->At(n);
00186       
00187     mean=rawliadcsummary->GetMean();
00188     rms=rawliadcsummary->GetRms();
00189     numEntries=rawliadcsummary->GetEntries();
00190     
00191     Int_t crate=rawliadcsummary->GetChannel().GetCrate();
00192     Int_t varc=rawliadcsummary->GetChannel().GetVarcId();
00193     Int_t vfb=rawliadcsummary->GetChannel().GetVaAdcSel();
00194     Int_t vmm=rawliadcsummary->GetChannel().GetVmm();
00195     Int_t chip=rawliadcsummary->GetChannel().GetVaChip();
00196 
00197     //only fill if trigger pmt
00198     //lilookup.Pb2Channel(pulserBox)
00199     //only plot correct channel
00200     if (crate==1 && varc==2 && vmm==5 && vfb==0 && chip==1){
00201       hTimestamp->Fill(timeSec+(1e-9)*timeNanoSec);
00202       cout<<"seconds="<<timeSec<<", nano="<<timeNanoSec
00203           <<", sum="<<timeSec+(1e-9)*timeNanoSec
00204           <<endl;
00205     }
00206   }
00207 
00208   //if (crate>1 && plottedOnce==0){
00209 
00210   //plottedOnce=1;
00211   //}
00212   cTimestamp->Update();
00213 
00214   return result;
00215 }

void LISummaryAnalyser::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 219 of file LISummaryAnalyser.cxx.

00220 {
00221 
00222 }


Member Data Documentation

Definition at line 58 of file LISummaryAnalyser.h.

Definition at line 59 of file LISummaryAnalyser.h.

TCanvas* LISummaryAnalyser::cTimestamp [private]

Definition at line 52 of file LISummaryAnalyser.h.

Referenced by Ana().

Definition at line 50 of file LISummaryAnalyser.h.

TH1F** LISummaryAnalyser::hMeanPb [private]

Definition at line 49 of file LISummaryAnalyser.h.

Definition at line 47 of file LISummaryAnalyser.h.

Referenced by Ana().

Definition at line 48 of file LISummaryAnalyser.h.

Int_t LISummaryAnalyser::led [private]

Definition at line 60 of file LISummaryAnalyser.h.

Referenced by Ana().

Float_t LISummaryAnalyser::mean [private]

Definition at line 61 of file LISummaryAnalyser.h.

Referenced by Ana().

Int_t LISummaryAnalyser::msgLevel [private]

Definition at line 55 of file LISummaryAnalyser.h.

Referenced by Ana().

Definition at line 62 of file LISummaryAnalyser.h.

Referenced by Ana().

Definition at line 54 of file LISummaryAnalyser.h.

Referenced by Ana().

Int_t LISummaryAnalyser::period [private]

Definition at line 63 of file LISummaryAnalyser.h.

Definition at line 53 of file LISummaryAnalyser.h.

Definition at line 64 of file LISummaryAnalyser.h.

Referenced by Ana().

Definition at line 65 of file LISummaryAnalyser.h.

Referenced by Ana().

Int_t LISummaryAnalyser::pulses [private]

Definition at line 66 of file LISummaryAnalyser.h.

Referenced by Ana().

Definition at line 67 of file LISummaryAnalyser.h.

Float_t LISummaryAnalyser::rms [private]

Definition at line 68 of file LISummaryAnalyser.h.

Referenced by Ana().

Definition at line 69 of file LISummaryAnalyser.h.

Referenced by Ana().

Int_t LISummaryAnalyser::timeSec [private]

Definition at line 70 of file LISummaryAnalyser.h.

Referenced by Ana().

Definition at line 71 of file LISummaryAnalyser.h.

Referenced by Ana().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1