TV1190Histograms Class Reference

Class for making histograms of V1190 TDC data. More...

#include <TV1190Histogram.h>

Inheritance diagram for TV1190Histograms:
Inheritance graph
[legend]
Collaboration diagram for TV1190Histograms:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TV1190Histograms ()
 Reset the histograms for this canvas.
virtual ~TV1190Histograms ()
void UpdateHistograms (TDataContainer &dataContainer)
 Update the histograms for this canvas.
void BeginRun (int transition, int run, int time)
 Take actions at begin run.
void EndRun (int transition, int run, int time)
 Take actions at end run.
TH1 * GetHistogram (unsigned int i)
 A helper method for accessing each histogram. Does bounds checking.
void SetNumberChannelsInGroup (int numberChannelsInGroups)
const int GetNumberChannelsInGroup ()
void SetGroupName (std::string name)
 Set name for the 'group'.
const std::string GetGroupName ()
void SetChannelName (std::string name)
 Set name for the 'channel'.
const std::string GetChannelName ()
void DisableAutoUpdate (bool DisableautoUpdate=true)
const bool GetDisableAutoUpdate ()
const bool HasAutoUpdate ()

Private Member Functions

void CreateHistograms ()

Detailed Description

Class for making histograms of V1190 TDC data.

Definition at line 8 of file TV1190Histogram.h.


Constructor & Destructor Documentation

TV1190Histograms::TV1190Histograms (  ) 

Reset the histograms for this canvas.

Definition at line 9 of file TV1190Histogram.cxx.

References CreateHistograms().

00009                                   {  
00010   
00011   CreateHistograms();
00012 }

Here is the call graph for this function:

virtual TV1190Histograms::~TV1190Histograms (  )  [inline, virtual]

Definition at line 11 of file TV1190Histogram.h.

00011 {};


Member Function Documentation

void TV1190Histograms::BeginRun ( int  transition,
int  run,
int  time 
) [virtual]

Take actions at begin run.

Reimplemented from THistogramArrayBase.

Definition at line 70 of file TV1190Histogram.cxx.

References CreateHistograms().

00070                                                               {
00071 
00072   CreateHistograms();
00073 
00074 }

Here is the call graph for this function:

void TV1190Histograms::CreateHistograms (  )  [private]

Definition at line 15 of file TV1190Histogram.cxx.

References gDirectory, TDirectory::Get(), and Nchannels.

Referenced by BeginRun(), and TV1190Histograms().

00015                                        {
00016   
00017 
00018   // Otherwise make histograms
00019   clear();
00020   
00021   std::cout << "Create Histos" << std::endl;
00022   for(int i = 0; i < Nchannels; i++){ // loop over channels    
00023 
00024     char name[100];
00025     char title[100];
00026     sprintf(name,"V1190_%i_%i",0,i);
00027 
00028     // Delete old histograms, if we already have them
00029     TH1D *old = (TH1D*)gDirectory->Get(name);
00030     if (old){
00031       delete old;
00032     }
00033 
00034 
00035     // Create new histograms
00036     
00037     sprintf(title,"V1190 histogram for channel=%i",i);  
00038     
00039     TH1D *tmp = new TH1D(name,title,5000,0,500000);
00040     tmp->SetXTitle("TDC value");
00041     tmp->SetYTitle("Number of Entries");
00042     push_back(tmp);
00043   }
00044 
00045 }

Here is the call graph for this function:

Here is the caller graph for this function:

void THistogramArrayBase::DisableAutoUpdate ( bool  DisableautoUpdate = true  )  [inline, inherited]

Define whether the histogram gets automatically updated by rootana display. 'True' means that rootana display will NOT call UpdateHistograms automatically.

Definition at line 74 of file THistogramArrayBase.h.

References THistogramArrayBase::fDisableAutoUpdate, and THistogramArrayBase::fHasAutoUpdate.

Referenced by TAnaManager::TAnaManager().

00074 { fDisableAutoUpdate = DisableautoUpdate; fHasAutoUpdate = true;}  

Here is the caller graph for this function:

void TV1190Histograms::EndRun ( int  transition,
int  run,
int  time 
) [virtual]

Take actions at end run.

Reimplemented from THistogramArrayBase.

Definition at line 77 of file TV1190Histogram.cxx.

00077                                                             {
00078 
00079 }

const std::string THistogramArrayBase::GetChannelName (  )  [inline, inherited]

Definition at line 70 of file THistogramArrayBase.h.

References THistogramArrayBase::fChannelName.

00070 { return fChannelName;  }

const bool THistogramArrayBase::GetDisableAutoUpdate (  )  [inline, inherited]

Definition at line 75 of file THistogramArrayBase.h.

References THistogramArrayBase::fDisableAutoUpdate.

00075 { return fDisableAutoUpdate; }  

const std::string THistogramArrayBase::GetGroupName (  )  [inline, inherited]

Definition at line 66 of file THistogramArrayBase.h.

References THistogramArrayBase::fGroupName.

00066 { return fGroupName;  }

TH1* THistogramArrayBase::GetHistogram ( unsigned int  i  )  [inline, inherited]

A helper method for accessing each histogram. Does bounds checking.

Definition at line 44 of file THistogramArrayBase.h.

Referenced by TV1730RawWaveform::Reset(), TV1730DppWaveform::Reset(), TV1720Waveform::Reset(), TDT724Waveform::Reset(), TV792Histograms::UpdateHistograms(), TV1730RawWaveform::UpdateHistograms(), TV1730DppWaveform::UpdateHistograms(), TV1720Waveform::UpdateHistograms(), UpdateHistograms(), TL2249Histograms::UpdateHistograms(), TDT724Waveform::UpdateHistograms(), and TAgilentHistograms::UpdateHistograms().

00044                                    {
00045     if(i < 0 || i >= size()){
00046       std::cerr << "Invalid index (=" << i 
00047                 << ") requested in THistogramArrayBase::GetHistogram(int i) " << std::endl;
00048       return 0;
00049     }
00050     return (*this)[i];
00051   }

Here is the caller graph for this function:

const int THistogramArrayBase::GetNumberChannelsInGroup (  )  [inline, inherited]

Definition at line 62 of file THistogramArrayBase.h.

References THistogramArrayBase::fNumberChannelsInGroups.

00062 { return fNumberChannelsInGroups; }

const bool THistogramArrayBase::HasAutoUpdate (  )  [inline, inherited]

Definition at line 76 of file THistogramArrayBase.h.

References THistogramArrayBase::fHasAutoUpdate.

00076 { return fHasAutoUpdate; }  

void THistogramArrayBase::SetChannelName ( std::string  name  )  [inline, inherited]

Set name for the 'channel'.

Definition at line 69 of file THistogramArrayBase.h.

References THistogramArrayBase::fChannelName.

00069 {  fChannelName = name;  }

void THistogramArrayBase::SetGroupName ( std::string  name  )  [inline, inherited]

Set name for the 'group'.

Definition at line 65 of file THistogramArrayBase.h.

References THistogramArrayBase::fGroupName.

00065 {  fGroupName = name;  }

void THistogramArrayBase::SetNumberChannelsInGroup ( int  numberChannelsInGroups  )  [inline, inherited]

Function to define the number of channels in group and allow user to treat the array as 2D array.

Definition at line 61 of file THistogramArrayBase.h.

References THistogramArrayBase::fNumberChannelsInGroups.

00061 { fNumberChannelsInGroups = numberChannelsInGroups; }

void TV1190Histograms::UpdateHistograms ( TDataContainer dataContainer  )  [virtual]

Update the histograms for this canvas.

Get the Vector of ADC Measurements.

Implements THistogramArrayBase.

Definition at line 51 of file TV1190Histogram.cxx.

References TDataContainer::GetEventData(), THistogramArrayBase::GetHistogram(), and TV1190Data::GetMeasurements().

Referenced by TAnaManager::ProcessMidasEvent().

00051                                                                     {
00052 
00053 
00054   TV1190Data *data = dataContainer.GetEventData<TV1190Data>("TDC0");
00055   if(!data) return;
00056 
00057   /// Get the Vector of ADC Measurements.
00058   std::vector<TDCMeasurement> measurements = data->GetMeasurements();
00059   for(unsigned int i = 0; i < measurements.size(); i++){ // loop over measurements
00060         
00061     int chan = measurements[i].GetChannel();
00062     GetHistogram(chan)->Fill(measurements[i].GetMeasurement());
00063   }
00064 
00065 }

Here is the call graph for this function:

Here is the caller graph for this function:


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

Generated on 12 Feb 2016 for ROOT Analyzer by  doxygen 1.6.1