FardetBeamSelect Class Reference

#include <FardetBeamSelect.h>

Inheritance diagram for FardetBeamSelect:
JobCModule

List of all members.

Public Member Functions

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

Private Attributes

Double_t fWindowSize
Double_t fAllowFakeSpillTriggers

Detailed Description

Definition at line 19 of file FardetBeamSelect.h.


Constructor & Destructor Documentation

FardetBeamSelect::FardetBeamSelect (  ) 

Definition at line 32 of file FardetBeamSelect.cxx.

00033 {
00034 }

FardetBeamSelect::~FardetBeamSelect (  ) 

Definition at line 38 of file FardetBeamSelect.cxx.

00039 {
00040 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Select candidate beam events. Return kPassed for IP (SpillServer) triggered events or if the event trigger time is within fWindowSize seconds of a beam spill

Reimplemented from JobCModule.

Definition at line 44 of file FardetBeamSelect.cxx.

References fAllowFakeSpillTriggers, fWindowSize, RawDaqSnarlHeader::GetRemoteSpillType(), RawDaqSnarlHeader::GetTrigSrc(), RecMinosHdr::GetVldContext(), header, SpillTimeFinder::Instance(), JobCResult::kFailed, JobCResult::kPassed, kSpillType_Fake, kSpillType_Local, and TRIGGER_BIT_SPILL_IP.

00045 {
00052 
00053   const RawDaqSnarlHeader* header = 
00054     DataUtil::GetRawHeader<RawDaqSnarlHeader>(mom);
00055 
00056   if(!header) return JobCResult::kFailed;
00057   
00058   // Look at trigger.
00059   Int_t trigger  = header->GetTrigSrc();
00060 
00061   if((trigger & TRIGGER_BIT_SPILL_IP)>0) {
00062 
00063     if((header->GetRemoteSpillType()==kSpillType_Fake) ||
00064        (header->GetRemoteSpillType()==kSpillType_Local) ) {
00065       if(fAllowFakeSpillTriggers==0) return JobCResult::kPassed;
00066       else                           return JobCResult::kFailed;
00067     }
00068 
00069     return JobCResult::kPassed;
00070   }
00071 
00072   // see if it's within the window.
00073   VldContext cx = header->GetVldContext();
00074   double dspill = SpillTimeFinder::Instance().
00075     GetTimeToNearestSpill(cx);
00076   if(fabs(dspill) < fWindowSize) return JobCResult::kPassed;
00077 
00078   
00079   return JobCResult::kFailed;
00080 }

void FardetBeamSelect::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 107 of file FardetBeamSelect.cxx.

References fAllowFakeSpillTriggers, fWindowSize, Registry::GetDouble(), and Registry::GetInt().

00108 {
00109   //======================================================================
00110   // Configure the module given the Registry r
00111   //======================================================================
00112 
00113   fWindowSize              = r.GetDouble("WindowSize");
00114   fAllowFakeSpillTriggers = r.GetInt("AllowFakeSpillTriggers");
00115 }

const Registry & FardetBeamSelect::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 84 of file FardetBeamSelect.cxx.

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

00085 {
00086   //======================================================================
00087   // Supply the default configuration for the module
00088   //======================================================================
00089   static Registry r; // Default configuration for module
00090 
00091   // Set name of config
00092   std::string name = this->GetName();
00093   name += ".config.default";
00094   r.SetName(name.c_str());
00095 
00096   // Set values in configuration
00097   r.UnLockValues();
00098   r.Set("WindowSize",             50e-6);
00099   r.Set("AllowFakeSpillTriggers", 1);
00100   r.LockValues();
00101 
00102   return r;
00103 }


Member Data Documentation

Definition at line 36 of file FardetBeamSelect.h.

Referenced by Ana(), and Config().

Double_t FardetBeamSelect::fWindowSize [private]

Definition at line 35 of file FardetBeamSelect.h.

Referenced by Ana(), and Config().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1