SelectSpillTimes Class Reference

#include <SelectSpillTimes.h>

Inheritance diagram for SelectSpillTimes:
JobCModule

List of all members.

Public Member Functions

 SelectSpillTimes ()
 ~SelectSpillTimes ()
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)

Private Attributes

Double_t fWindow

Detailed Description

Definition at line 14 of file SelectSpillTimes.h.


Constructor & Destructor Documentation

SelectSpillTimes::SelectSpillTimes (  ) 

Definition at line 24 of file SelectSpillTimes.cxx.

References MuELoss::e, and fWindow.

00025 {
00026   fWindow = 100e-6;
00027 }

SelectSpillTimes::~SelectSpillTimes (  ) 

Definition at line 31 of file SelectSpillTimes.cxx.

00032 {
00033 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

====================================================================== Return true if the event in an SGATE snarl Return false if it's some other kind of trigger. Return kNoDecision if there is no snarl at all. ======================================================================

Reimplemented from JobCModule.

Definition at line 37 of file SelectSpillTimes.cxx.

References fWindow, MomNavigator::GetFragment(), RawRecord::GetRawHeader(), SpillTimeFinder::GetTimeToNearestSpill(), RecMinosHdr::GetVldContext(), SpillTimeFinder::Instance(), Msg::kInfo, MSG, JobCResult::SetFailed(), JobCResult::SetPassed(), and JobCResult::SetWarning().

00038 {
00044 
00045   JobCResult result;
00046 
00047   // Find raw data.
00048   const RawRecord* rr = dynamic_cast<const RawRecord*>(mom->GetFragment("RawRecord"));
00049   if(rr==0){
00050     MSG("SpillTiming",Msg::kInfo) << "No RawRecord in mom" << endl;
00051     result.SetWarning();
00052     return result;
00053   }
00054 
00055   const RawDaqSnarlHeader* snarlHead= dynamic_cast<const RawDaqSnarlHeader*>(rr->GetRawHeader());
00056   if(snarlHead==0) {
00057     MSG("SpillTiming",Msg::kInfo) << "No Snarl header in RawRecord." << endl;
00058     result.SetWarning();
00059     return result;
00060   }
00061   
00062   VldContext context = snarlHead->GetVldContext();
00063 
00064   SpillTimeFinder& finder = SpillTimeFinder::Instance();
00065   
00066   double t = finder.GetTimeToNearestSpill(context);
00067 
00068   if(TMath::Abs(t)<fWindow) result.SetPassed();
00069   else result.SetFailed();
00070     
00071   return result;
00072 }

void SelectSpillTimes::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.

Reimplemented from JobCModule.

Definition at line 88 of file SelectSpillTimes.cxx.

References fWindow, and Registry::Get().

00089 {
00090   r.Get("Window",fWindow);
00091 }

const Registry & SelectSpillTimes::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; }

Reimplemented from JobCModule.

Definition at line 75 of file SelectSpillTimes.cxx.

References MuELoss::e, JobCModule::GetName(), Registry::Set(), and Registry::UnLockValues().

00076 {
00077   static Registry r;
00078   std::string name=this->GetName();
00079   name += ".config.default";
00080   r.SetName(name.c_str());
00081 
00082   r.UnLockValues();
00083 
00084   r.Set("Window",100e-6);
00085   return r;
00086 }


Member Data Documentation

Double_t SelectSpillTimes::fWindow [private]

Definition at line 29 of file SelectSpillTimes.h.

Referenced by Ana(), Config(), and SelectSpillTimes().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1