PlotTAP_Integral Class Reference
[Modules]

A one line description of what your module does. More...

#include <PlotTAP_Integral.h>

Inheritance diagram for PlotTAP_Integral:
BaseModule

List of all members.

Public Member Functions

 PlotTAP_Integral (modules::options *opts)
 Constructor description. If necessary, add a details tag like above.
 ~PlotTAP_Integral ()
 Is anything done in the destructor?
int ProcessGenericEntry (TGlobalData *gData, const TSetupData *gSetup)
int Preprocess (TGlobalData *gData, const TSetupData *gSetup)
 Method called by the main pre-process loop.
int Postprocess (TGlobalData *gData, const TSetupData *gSetup)
 Method called by the main pre-process loop.
void SetAlias (const std::string &alias)
std::string GetAlias () const
const char * GetName () const
 Get the name of this module as given to the constructor of the base class.

Protected Member Functions

bool Debug () const
TDirectory * GetDirectory () const
 Get the TDirectory for this module.
TDirectory * GetDirectory (const std::string &name="")

Protected Attributes

TDirectory * dir

Private Types

typedef std::map< IDs::source,
TH1F * > 
PlotList_t

Private Member Functions

virtual int ProcessEntry (TGlobalData *gData, const TSetupData *gSetup)
 What's calculated for every entry? Don't hesitate to repeat what was said in the class description.
virtual int BeforeFirstEntry (TGlobalData *gData, const TSetupData *setup)
 What needes to be done before each run? Don't hesitate to repeat what was said in the class description.
virtual int AfterLastEntry (TGlobalData *gData, const TSetupData *setup)
 What needs to be done after each run? Don't hesitate to repeat what was said in the class description.

Private Attributes

PlotList_t fPlots

Detailed Description

A one line description of what your module does.

Author:
AuthorName

A longer, more descriptive block of text. Specifics like members and methods will be described later. You can add this to other groups instead of rootana_modules or in addition to rootana_modules by adding more of the ingroup tags.

Definition at line 25 of file PlotTAP_Integral.h.


Member Typedef Documentation

typedef std::map<IDs::source,TH1F*> PlotTAP_Integral::PlotList_t [private]

Definition at line 58 of file PlotTAP_Integral.h.


Constructor & Destructor Documentation

PlotTAP_Integral::PlotTAP_Integral ( modules::options opts  ) 

Constructor description. If necessary, add a details tag like above.

Parameters:
[in] opts Describe the options this module takes.

Definition at line 19 of file PlotTAP_Integral.cpp.

00019                                                       :
00020    BaseModule("PlotTAP_Integral",opts){
00021 }

PlotTAP_Integral::~PlotTAP_Integral (  ) 

Is anything done in the destructor?

Definition at line 23 of file PlotTAP_Integral.cpp.

00023                                    {
00024 }


Member Function Documentation

int PlotTAP_Integral::AfterLastEntry ( TGlobalData gData,
const TSetupData setup 
) [private, virtual]

What needs to be done after each run? Don't hesitate to repeat what was said in the class description.

Returns:
Non-zero to indicate a problem.

Implements BaseModule.

Definition at line 81 of file PlotTAP_Integral.cpp.

00081                                                                               {
00082   /*    for(PlotList_t::iterator i_plot=fPlots.begin();
00083             i_plot!=fPlots.end(); ++i_plot){
00084         i_plot->second->Draw();
00085     }
00086   */
00087   return 0;
00088 }

int PlotTAP_Integral::BeforeFirstEntry ( TGlobalData gData,
const TSetupData setup 
) [private, virtual]

What needes to be done before each run? Don't hesitate to repeat what was said in the class description.

Returns:
Non-zero to indicate a problem.

Implements BaseModule.

Definition at line 26 of file PlotTAP_Integral.cpp.

References fPlots, gAnalysedPulseMap, IDs::source::str(), and modules::parser::ToCppValid().

00026                                                                                 {
00027     // For each source,
00028     TH1F* hist=NULL;
00029     std::string name, title;
00030     const IDs::source* source=NULL;
00031     for(SourceAnalPulseMap::const_iterator i_source = gAnalysedPulseMap.begin();
00032             i_source!=gAnalysedPulseMap.end(); ++i_source){
00033         source=&i_source->first;
00034 
00035         // setup the name and title for the histogram
00036         name="h"+modules::parser::ToCppValid(source->str())+"_integrals";
00037         title="Integral of pulses coming from "+source->str();
00038 
00039         // make a histogram
00040         int x_min = -100000;
00041         int x_max = 5000000;
00042         int bin_width = 100;
00043         int n_bins = (x_max - x_min) / bin_width;
00044         hist=new TH1F(name.c_str(),title.c_str(),n_bins,x_min,x_max);
00045         hist->SetXTitle("Integral of each pulse (arb. units)");
00046 
00047         // register histogram with list
00048         fPlots[*source]=hist;
00049     }
00050   return 0;
00051 }

bool BaseModule::Debug (  )  const [inline, protected, inherited]
std::string BaseModule::GetAlias (  )  const [inline, inherited]

Returns a string for the alias of this module. May be empty if no alias was given in the modules file.

Definition at line 63 of file BaseModule.h.

References BaseModule::fAlias.

Referenced by BaseModule::BaseModule().

00063 {return fAlias;};

TDirectory * BaseModule::GetDirectory ( const std::string &  name = ""  )  [protected, inherited]

Definition at line 77 of file BaseModule.cpp.

References BaseModule::dir, and BaseModule::fDirectory.

00077                                                          {
00078   if(name.empty()) return fDirectory;
00079   TDirectory* dir=fDirectory->GetDirectory(name.c_str());
00080   if(dir) return dir;
00081   return fDirectory->mkdir(name.c_str());
00082 }

TDirectory* BaseModule::GetDirectory (  )  const [inline, protected, inherited]
const char* BaseModule::GetName (  )  const [inline, inherited]

Get the name of this module as given to the constructor of the base class.

Definition at line 66 of file BaseModule.h.

References BaseModule::fName.

Referenced by SavePulses::BeforeFirstEntry(), PlotTDPs::BeforeFirstEntry(), PlotTDP_TDiff::BeforeFirstEntry(), PlotTAP_Time::ProcessEntry(), PlotTAP_Energy::ProcessEntry(), PlotTAP_Amplitude::ProcessEntry(), and LoopSequence::Run().

00066 {return fName.c_str();};

int BaseModule::Postprocess ( TGlobalData gData,
const TSetupData gSetup 
) [inherited]

Method called by the main pre-process loop.

Does some simple work, then hooks into the derived class through AfterLastEntry.

Returns:
0 on sucess and non-zero if a problem occurred

Definition at line 66 of file BaseModule.cpp.

References BaseModule::AfterLastEntry(), and BaseModule::fDirectory.

Referenced by LoopSequence::Postprocess().

00066                                                                        {
00067   // This is called by our main routine and would allow later to split into different 
00068   // process routines if we have more than one Tree and hence different tpyes of data input.
00069 
00070   if(fDirectory) fDirectory->cd();
00071   int ret = AfterLastEntry(gData, gSetup);
00072   gDirectory->cd("/");
00073 
00074   return ret;
00075 }

int BaseModule::Preprocess ( TGlobalData gData,
const TSetupData gSetup 
) [inherited]

Method called by the main pre-process loop.

Does some simple work, then hooks into the derived class through BeforeFirstEntry.

Returns:
0 on sucess and non-zero if a problem occurred

Definition at line 55 of file BaseModule.cpp.

References BaseModule::BeforeFirstEntry(), and BaseModule::fDirectory.

Referenced by LoopSequence::Preprocess().

00055                                                                       {
00056   // This is called by our main routine and would allow later to split into different 
00057   // process routines if we have more than one Tree and hence different tpyes of data input.
00058 
00059   if(fDirectory) fDirectory->cd();
00060   int ret = BeforeFirstEntry(gData, gSetup);
00061   gDirectory->cd("/");
00062 
00063   return ret;
00064 }

int PlotTAP_Integral::ProcessEntry ( TGlobalData gData,
const TSetupData gSetup 
) [private, virtual]

What's calculated for every entry? Don't hesitate to repeat what was said in the class description.

Returns:
Non-zero to indicate a problem.

Implements BaseModule.

Definition at line 53 of file PlotTAP_Integral.cpp.

References fPlots, and gAnalysedPulseMap.

00053                                                                             {
00054 
00055     PlotList_t::iterator i_plot;
00056     const AnalysedPulseList* pulseList;
00057     const IDs::source* source;
00058     for(SourceAnalPulseMap::const_iterator i_source = gAnalysedPulseMap.begin();
00059             i_source!=gAnalysedPulseMap.end(); ++i_source){
00060         source=&i_source->first;
00061         pulseList=&i_source->second;
00062 
00063         // Find the corresponding histogram
00064         i_plot=fPlots.find(*source);
00065         if(i_plot==fPlots.end()){
00066             cout<<"PlotTAP_Integral: Error: Unable to find plot for source '"<<*source<<"'"<<endl;
00067             return 1;
00068         }
00069 
00070         // For each TAP 
00071         for(AnalysedPulseList::const_iterator i_pulse=pulseList->begin();
00072                 i_pulse!=pulseList->end();++i_pulse){
00073             // Fill integral histogram
00074             i_plot->second->Fill((*i_pulse)->GetIntegral());
00075         }
00076     }
00077 
00078   return 0;
00079 }

int BaseModule::ProcessGenericEntry ( TGlobalData gData,
const TSetupData gSetup 
) [inherited]

Method called by the main event loop for each entry in the input root tree. Does some simple work, then hooks into the derived class through ProcessEntry.

Returns:
0 on sucess and non-zero if a problem occurred

Definition at line 44 of file BaseModule.cpp.

References BaseModule::fDirectory, and BaseModule::ProcessEntry().

Referenced by LoopSequence::Process().

00044                                                                                {
00045   // This is called by our main routine and would allow later to split into different 
00046   // process routines if we have more than one Tree and hence different tpyes of data input.
00047 
00048   if(fDirectory) fDirectory->cd();
00049   int ret = ProcessEntry(gData, gSetup);
00050   gDirectory->cd("/");
00051 
00052   return ret;
00053 }

void BaseModule::SetAlias ( const std::string &  alias  )  [inline, inherited]

Sets the alias for this module, which should be provided in the modules file

Definition at line 59 of file BaseModule.h.

References BaseModule::fAlias.

Referenced by BaseModule::BaseModule().

00059 {fAlias=alias;};


Member Data Documentation

TDirectory* BaseModule::dir [protected, inherited]

Many modules use 'dir' still which was the old protected pointer to the modules directory. To prevent things being broken so soon, we keep this pointer available, but be warned that it will be removed shortly...

Definition at line 98 of file BaseModule.h.

Referenced by BaseModule::BaseModule(), FastSlowCompare::FastSlowCompare(), GeSpectrum::GeSpectrum(), BaseModule::GetDirectory(), MakeMuonEvents::MakeMuonEvents(), and PlotAmpVsTDiff::PlotAmpVsTDiff().

Definition at line 59 of file PlotTAP_Integral.h.

Referenced by BeforeFirstEntry(), and ProcessEntry().


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

Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1