MeuCalModule Class Reference

#include <MeuCalModule.h>

Inheritance diagram for MeuCalModule:
JobCModule

List of all members.

Public Member Functions

 MeuCalModule ()
virtual ~MeuCalModule ()
virtual void BeginJob ()
virtual void Config (const Registry &r)
virtual const RegistryDefaultConfig () const
virtual void EndJob ()
virtual JobCResult Ana (const MomNavigator *mom)

Private Attributes

MeuAnalysisfMeuAnalysis

Detailed Description

Definition at line 20 of file MeuCalModule.h.


Constructor & Destructor Documentation

MeuCalModule::MeuCalModule (  ) 

Definition at line 30 of file MeuCalModule.cxx.

References Msg::kDebug, and MSG.

00031 {
00032   MSG("MeuCalModule", Msg::kDebug) 
00033    <<"Running MeuCalModule constructor..."<<endl;
00034 
00035   //initialise data members
00036   fMeuAnalysis=0;
00037 
00038   MSG("MeuCalModule", Msg::kDebug) 
00039    <<"Finished constructor"<<endl;
00040 }

MeuCalModule::~MeuCalModule (  )  [virtual]

Definition at line 44 of file MeuCalModule.cxx.

References Msg::kDebug, and MSG.

00045 {
00046   MSG("MeuCalModule", Msg::kDebug) 
00047    <<"Running destructor..."<<endl;
00048 
00049   MSG("MeuCalModule", Msg::kDebug) 
00050    <<"Finished destructor"<<endl;
00051 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 55 of file MeuCalModule.cxx.

References fMeuAnalysis, MomNavigator::GetFragment(), Msg::kInfo, JobCResult::kPassed, Msg::kWarning, MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), MAXMSG, and MSG.

00056 {
00057   //to test number of entries
00058   //static Int_t counter=0;
00059   //counter++;
00060   //cout<<"counter="<<counter<<endl;
00061 
00062   //set default result to kPassed
00063   JobCResult result(JobCResult::kPassed);
00064   
00065   //check that mom exists.
00066   assert(mom);
00067   
00068   const NtpStRecord* pntp=dynamic_cast<NtpStRecord*>
00069     (mom->GetFragment("NtpStRecord"));
00070   if (!pntp){
00071     MSG("MeuCalModule",Msg::kWarning) 
00072       << "No NtpStRecord in Mom" << endl;
00073   }
00074   
00075   const NtpBDLiteRecord* pntpBD=dynamic_cast<NtpBDLiteRecord*>
00076     (mom->GetFragment("NtpBDLiteRecord"));
00077   if (!pntpBD){
00078     MAXMSG("MeuCalModule",Msg::kInfo,1)
00079       <<"No NtpBDLiteRecord in Mom (note: not present for MC)"<<endl;
00080   }
00081   
00082   //run the code to calc the meu values for events in this snarl
00083   fMeuAnalysis->MakeSummaryTreeWithNtpStOneSnarl(pntp,pntpBD);
00084   
00085   return result;
00086 }

void MeuCalModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 90 of file MeuCalModule.cxx.

References fMeuAnalysis, Msg::kInfo, and MSG.

00091 {
00092   MSG("MeuCalModule",Msg::kInfo)
00093     <<"Running MeuCalModule::BeginJob()..."<<endl;
00094 
00095   //construct the MeuAnalysis object
00096   fMeuAnalysis=new MeuAnalysis();
00097 
00098   MSG("MeuCalModule",Msg::kInfo)
00099     <<"Finished running MeuCalModule::BeginJob()"<<endl;
00100 }

void MeuCalModule::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Purpose: Configure the module given a registry.

Reimplemented from JobCModule.

Definition at line 145 of file MeuCalModule.cxx.

References Msg::kDebug, and MSG.

00146 {
00148 
00149   MSG("MeuCalModule",Msg::kDebug)<<"MeuCalModule::Config"<<endl;
00150 
00151   /*
00152     Int_t runSeqReq=-1;
00153     if (r.Get("LIRunSeqRequired",runSeqReq)) fLIRunSeqReq=runSeqReq;
00154   
00155   Int_t writeOnlyGainCurves=0;
00156   if (r.Get("WriteOnlyGainCurves",
00157   writeOnlyGainCurves)) fWriteOnlyGainCurves=writeOnlyGainCurves;
00158   */
00159 }

const Registry & MeuCalModule::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Purpose: Method to return default configuration.

Reimplemented from JobCModule.

Definition at line 121 of file MeuCalModule.cxx.

References JobCModule::GetName(), Msg::kDebug, Registry::LockValues(), MSG, and Registry::UnLockValues().

00122 {
00124 
00125   MSG("MeuCalModule", Msg::kDebug)
00126     << "Running MeuCalModule::DefaultConfig..." << endl;
00127   
00128   static Registry r;
00129   
00130   string name=this->JobCModule::GetName();
00131   name+=".config.default";
00132   r.SetName(name.c_str());
00133   r.UnLockValues();
00134   
00135   //r.Set("LIRunSeqRequired",-1);
00136   //r.Set("WriteOnlyGainCurves",0);
00137   
00138   r.LockValues();
00139   
00140   return r;
00141 }

void MeuCalModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 104 of file MeuCalModule.cxx.

References fMeuAnalysis, Msg::kInfo, MSG, MeuAnalysis::StoreOrFinishSummaryTree(), and MeuAnalysis::WriteOutHistos().

00105 {  
00106   MSG("MeuCalModule",Msg::kInfo)
00107     <<"Running MeuCalModule::EndJob()..."<<endl;
00108 
00109   //finish the job
00110   fMeuAnalysis->StoreOrFinishSummaryTree(NULL,NULL,1);
00111 
00112   //write out any histos if a file was opened
00113   fMeuAnalysis->WriteOutHistos();
00114   
00115   MSG("MeuCalModule",Msg::kInfo)
00116     <<"Finished running MeuCalModule::EndJob()"<<endl;
00117 }


Member Data Documentation

Definition at line 35 of file MeuCalModule.h.

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


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1