StripSRListModule Class Reference

#include <StripSRListModule.h>

Inheritance diagram for StripSRListModule:

JobCModule List of all members.

Public Member Functions

 StripSRListModule ()
 ~StripSRListModule ()
void BeginJob ()
void EndJob ()
JobCResult Reco (MomNavigator *mom)
const RegistryDefaultConfig () const

Private Attributes

StripStat fStats
TFolder * fTFolder

Detailed Description

Definition at line 60 of file StripSRListModule.h.


Constructor & Destructor Documentation

StripSRListModule::StripSRListModule (  ) 

Definition at line 64 of file StripSRListModule.cxx.

References Msg::kDebug, and MSG.

00064                                     :
00065         fTFolder(0)
00066 {
00067 
00068         //fStats=new StripStat();
00069 
00070         //from George Irwin:
00071 // Put CandStripSRList's statistics object in /Loon/CandStripSR folder
00072 
00073 
00074    if (fTFolder==0) {
00075      TFolder *lf = dynamic_cast<TFolder *>(gROOT->FindObject("Loon"));
00076      if (lf==0) {
00077        MSG("StripSR", Msg::kDebug) << "Creating Loon TFolder" << endl;
00078        lf = gROOT->GetRootFolder()->AddFolder("Loon", "Loon analysis");
00079        gROOT->GetListOfBrowsables()->Add(lf, "Loon");
00080      }
00081      fTFolder = lf->AddFolder("CandStripSR", "CandStripSR statistics");
00082      fTFolder->Add(&fStats);
00083    }
00084    
00085 
00086 
00087 
00088 
00089 }

StripSRListModule::~StripSRListModule (  ) 

Definition at line 92 of file StripSRListModule.cxx.

00093 {
00094 }


Member Function Documentation

void StripSRListModule::BeginJob (  )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 97 of file StripSRListModule.cxx.

00098 { 
00099 }

const Registry & StripSRListModule::DefaultConfig (  )  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 109 of file StripSRListModule.cxx.

References JobCModule::GetName(), and Registry::Set().

00110 {
00111 //
00112 //  Purpose:    Method to set default module configuration.
00113 //  
00114 //  Arguments:  n/a
00115 //  
00116 //  Return:     Registry item containing default configuration.
00117 //  
00118 
00119   static Registry def_cfg;
00120   static bool been_here = false;
00121   if(been_here)return def_cfg;
00122   been_here=true;
00123 
00124   string name = this->JobCModule::GetName();
00125   name += ".config.default";
00126   def_cfg.SetName(name.c_str());
00127 
00128   // Set defaults
00129   def_cfg.Set("StripListAlgorithm","AlgStripSRList");
00130   def_cfg.Set("StripListAlgConfig","default");
00131   def_cfg.Set("ListIn","canddigitlist");
00132   def_cfg.Set("ListOut","CandStripList");
00133   def_cfg.Set("LogLevel","Fatal");
00134   def_cfg.Set("UseDeMuxQualityWord", 0); 
00135   return def_cfg;
00136 }

void StripSRListModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 101 of file StripSRListModule.cxx.

References fStats, and StripStat::Print().

00102 { 
00103 
00104         fStats.Print();
00105 
00106 }

JobCResult StripSRListModule::Reco ( MomNavigator mom  )  [virtual]

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 139 of file StripSRListModule.cxx.

References CandRecord::FindCandHandle(), Registry::Get(), AlgFactory::GetAlgHandle(), JobCModule::GetConfig(), VldContext::GetDetector(), MomNavigator::GetFragment(), AlgFactory::GetInstance(), CandHandle::GetName(), CandHandle::GetNDaughters(), CandHandle::GetVldContext(), Msg::kDebug, CandDeMuxDigitList::kEventFailedFilter, Detector::kFar, JobCResult::kPassed, Msg::kWarning, CandStripList::MakeCandidate(), MSG, CandRecord::SecureCandHandle(), CandContext::SetDataIn(), JobCResult::SetFailed(), CandHandle::SetName(), CandHandle::SetTitle(), and JobCResult::SetWarning().

00140 {
00141   JobCResult result(JobCResult::kPassed);
00142     
00143   // load configuration 
00144   const char* tmps = 0;
00145   Int_t tmpi=0;  
00146   const char* alg_name = 0;
00147   const char* alg_config_name = 0;
00148   const char* list_in = 0;
00149   const char* list_out = 0;
00150   Int_t useDeMuxQualityWord=0;
00151 
00152   Registry& cfg = this->GetConfig();
00153   if (cfg.Get("StripListAlgorithm",tmps)) alg_name = tmps;
00154   if (cfg.Get("StripListAlgConfig",tmps)) alg_config_name = tmps;
00155   if (cfg.Get("ListIn",tmps)) list_in = tmps;
00156   if (cfg.Get("ListOut",tmps)) list_out = tmps;
00157   if (cfg.Get("UseDeMuxQualityWord",tmpi)) useDeMuxQualityWord = tmpi;
00158     
00159   // make sure raw record is available, in particular one from the DaqSnarl
00160   // stream to ensure that it has the RawDigitDataBlock (i.e. digits)
00161   RawRecord *rr = dynamic_cast<RawRecord *>(mom->GetFragment("RawRecord",0,"DaqSnarl"));
00162   if (rr == 0) {
00163     MSG("EventSR", Msg::kWarning) << "No RawRecord in MOM." << endl;
00164     return result;
00165   }
00166     
00167   // Find PrimaryCandidateRecord fragment in MOM.
00168   CandRecord *candrec = dynamic_cast<CandRecord *>
00169     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00170   if (candrec == 0) {
00171     MSG("StripSR", Msg::kWarning) << "No PrimaryCandidateRecord in MOM."
00172                                   << endl;
00173     result.SetWarning().SetFailed();
00174     return result;
00175   }
00176  
00177   CandDigitListHandle *cdlh = dynamic_cast<CandDigitListHandle *>
00178     (candrec->FindCandHandle("CandDigitListHandle", list_in));
00179   
00180   // Require number of CandDigits to be non-zero.
00181    if (!cdlh || cdlh->GetNDaughters() < 1) {
00182      MSG("StripSR", Msg::kDebug)
00183                   << "Null CandDigit list.  Bail out of event." << endl;
00184      result.SetFailed();
00185      return result;
00186    }
00187 
00188    // if the demux quality usage is enabled, continue processing
00189    // only in the case of a successful demuxing step
00190    if(useDeMuxQualityWord == 1 
00191       && cdlh->GetVldContext()->GetDetector() == Detector::kFar){
00192      const CandDeMuxDigitListHandle *ddlh = 0;
00193      if(cdlh->InheritsFrom("CandDeMuxDigitListHandle")){ 
00194        ddlh = dynamic_cast<const CandDeMuxDigitListHandle *>(cdlh);
00195        if(ddlh->GetDeMuxDigitListFlagWord() == CandDeMuxDigitList::kEventFailedFilter ){
00196          MSG("StripSR", Msg::kDebug) << "failed DeMuxDigitList filter" << endl;
00197          result.SetFailed();
00198          return result;
00199        }
00200      }
00201    }//end check on demux quality words
00202 
00203    AlgFactory &af = AlgFactory::GetInstance();
00204    AlgHandle adlh = af.GetAlgHandle(alg_name,alg_config_name);
00205    CandContext cx(this, mom);
00206    cx.SetDataIn(cdlh);
00207    CandStripListHandle cslh = CandStripList::MakeCandidate(adlh, cx);
00208 
00209    cslh.SetName(list_out);
00210    cslh.SetTitle(TString("Created by StripSRListModule from ").
00211                  Append(cdlh->GetName()));
00212    candrec->SecureCandHandle(cslh);
00213 
00214 
00215    return result;
00216 }


Member Data Documentation

StripStat StripSRListModule::fStats [private]

Definition at line 72 of file StripSRListModule.h.

Referenced by EndJob().

TFolder* StripSRListModule::fTFolder [private]

Definition at line 73 of file StripSRListModule.h.


The documentation for this class was generated from the following files:
Generated on Mon Nov 10 00:56:31 2014 for loon by  doxygen 1.4.7