DmxDeMuxFilterModule Class Reference

#include <DmxDeMuxFilterModule.h>

Inheritance diagram for DmxDeMuxFilterModule:
JobCModule

List of all members.

Public Member Functions

 DmxDeMuxFilterModule ()
 ~DmxDeMuxFilterModule ()
void BeginJob ()
JobCResult Reco (MomNavigator *mom)
void HandleCommand (JobCommand *command)
void ClearStatusObject ()
void Help ()

Private Attributes

DmxStatus fStatus
bool fDontUseCandDigitMasks
Float_t fSignalFractionLimit

Detailed Description

Definition at line 24 of file DmxDeMuxFilterModule.h.


Constructor & Destructor Documentation

DmxDeMuxFilterModule::DmxDeMuxFilterModule (  ) 

Definition at line 65 of file DmxDeMuxFilterModule.cxx.

References Msg::kDebug, and MSG.

00065                                            :
00066   fDontUseCandDigitMasks(false),
00067   fSignalFractionLimit(0.1)
00068 {
00069 
00070   MSG("JobC", Msg::kDebug) << "DmxDeMuxFilterModule::Constructor" << endl;
00071   //MSG("DMX", Msg::kInfo) << fSignalFractionLimit << endl;
00072 
00073 }

DmxDeMuxFilterModule::~DmxDeMuxFilterModule (  ) 

Definition at line 76 of file DmxDeMuxFilterModule.cxx.

References Msg::kDebug, and MSG.

00077 {
00078   MSG("JobC", Msg::kDebug) << "DmxDeMuxFilterModule::Destructor" << endl;
00079 }


Member Function Documentation

void DmxDeMuxFilterModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 83 of file DmxDeMuxFilterModule.cxx.

References fStatus, AlgHandle::GetAlgConfig(), AlgFactory::GetAlgHandle(), AlgFactory::GetInstance(), Registry::LockKeys(), Registry::LockValues(), AlgFactory::Register(), Registry::Set(), and Registry::UnLockValues().

00084 {
00085   AlgFactory &af = AlgFactory::GetInstance();
00086   af.Register("AlgDeMuxCosmics", "default", "libDeMux.so", "AlgConfigDeMux");
00087   AlgHandle ah = af.GetAlgHandle("AlgDeMuxCosmics", "default");
00088   //MSG("DMX", Msg::kInfo) << fSignalFractionLimit << endl;
00089 
00090   //get the AlgConfigDeMux class and set some variables
00091   AlgConfig &acd = ah.GetAlgConfig();
00092   acd.UnLockValues();
00093   acd.Set("HoughInterceptLimit",1.5);
00094   acd.Set("HoughPeakLimit",0.66);
00095   acd.Set("HoughSlopeLimit",1.);
00096   acd.Set("HypothesisSize",24);
00097   acd.Set("MuonTrackSlopeLimit",0.09);
00098   acd.Set("NumberOfHypotheses",169);
00099   acd.Set("NumberOfStrips", 192);
00100   acd.Set("PlanesInSet",6);
00101   acd.Set("RatioMatedSignalForValid",0.3);
00102   acd.Set("UseCandDigitMask", 1);
00103   acd.Set("XTalkFractionLimit", 0.1);
00104   acd.Set("IgnoreFractionLimit", 0.05);
00105   acd.Set("AveragePEGainConversion", 55.);
00106   acd.Set("StrayDeltaStripLimit",6);
00107   acd.Set("StrayPlanesLimit",10);
00108   acd.Set("UseStrayPlaneCheck", 0);
00109   
00110   acd.LockValues();
00111   acd.LockKeys();
00112   
00113   //MSG("DMX", Msg::kInfo) << fSignalFractionLimit << endl;
00114 
00115   fStatus = DmxStatus();
00116 
00117   return;
00118 }

void DmxDeMuxFilterModule::ClearStatusObject (  ) 

Definition at line 257 of file DmxDeMuxFilterModule.cxx.

References DmxStatus::ClearPlaneArray(), and fStatus.

00258 {
00259   fStatus.ClearPlaneArray();
00260   return;
00261 }

void DmxDeMuxFilterModule::HandleCommand ( JobCommand command  )  [virtual]

Implement to handle a JobCommand

Reimplemented from JobCModule.

Definition at line 218 of file DmxDeMuxFilterModule.cxx.

References fDontUseCandDigitMasks, fSignalFractionLimit, Msg::kDebug, Msg::kWarning, MSG, JobCommand::PopCmd(), JobCommand::PopFloatOpt(), and JobCommand::PopOpt().

00219 {
00220   //
00221   //  Purpose:  Method to interpret module commands.
00222   //
00223   //  Arguments:
00224   //    command   in    Command to interpret.
00225   //
00226   //  Return:   n/a
00227   //
00228   //  Commands implemented:
00229   //    Set TestToMake  Set the test to make to obtain a figure of merit - fraction of
00230   //                    digits within n strips from a track, fraction of mated signal
00231   //                    DigitsAlongTrack, and MatedSignalFraction respectively
00232   //    Set DataType    Set the type of data to test - MonteCarlo or FarDetector
00233   //    Set MatedSignalLimit  Set the lower limit for fraction of signal coming from opposite
00234   //                          sides of the same strip in a plane.
00235   //    Set DeltaStripsFromTrack  Set the number of strips a digit can be off from a track and
00236   //                              still be considered along that track.
00237   //
00238   //  see http://beaker.astro.indiana.edu/brebel/demux_notes/how_to_demux.html for details
00239    MSG("JobC", Msg::kDebug) << "DeMuxFilterModule::HandleCommand" << endl;
00240 
00241    TString cmd = command->PopCmd();
00242    if(cmd == "Set"){   
00243      TString opt = command->PopOpt();
00244      if(opt == "DontUseCandDigitMasks"){ fDontUseCandDigitMasks = true;}
00245      else if(opt = "SignalFractionLimit"){ fSignalFractionLimit = command->PopFloatOpt();}
00246      else {
00247          MSG("JobC", Msg::kWarning)<< "DeMuxFilterModule: Unrecognized option " << opt << endl;
00248       }
00249    }
00250    else {
00251      MSG("JobC", Msg::kWarning)<< "DeMuxFilterModule: Unrecognized command " << cmd << endl;
00252    }
00253    return;
00254 }

void DmxDeMuxFilterModule::Help (  )  [virtual]

Implement to spew some useful help to cout

Reimplemented from JobCModule.

Definition at line 263 of file DmxDeMuxFilterModule.cxx.

References Msg::kInfo, and MSG.

00264 {
00265   MSG("JobC", Msg::kInfo) 
00266     << "DeMuxFilterModule::Help\n"
00267     <<"DmxDeMuxFilterModule is a module which demultiplexes events "
00268     <<"in the far detector." << endl
00269     << "see http://beaker.astro.indiana.edu/brebel/demux_notes/how_to_demux.html for details"
00270     << endl;
00271 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 122 of file DmxDeMuxFilterModule.cxx.

References DmxStatus::ClearPlaneArray(), CandRecord::FindCandHandle(), fStatus, AlgFactory::GetAlgHandle(), CandRecord::GetCandHeader(), DmxStatus::GetEventDeMuxed(), DmxStatus::GetEventNumber(), MomNavigator::GetFragment(), AlgFactory::GetInstance(), Msg::kDebug, JobCResult::kPassed, Msg::kWarning, MSG, AlgHandle::RunAlg(), CandContext::SetDataIn(), JobCResult::SetError(), DmxStatus::SetEventDeMuxed(), JobCResult::SetFailed(), and DmxStatus::SetMultipleMuon().

00123 {
00124   JobCResult result(JobCResult::kPassed);
00125 
00126   MSG("JobC", Msg::kDebug) << "DeMuxFilterModule::Reco\n";
00127 
00128   fStatus.ClearPlaneArray();
00129 
00130   // Check that mom exists.
00131   assert(mom);
00132 
00133   // Find PrimaryCandidateRecord fragment in MOM.
00134   CandRecord *candrec = dynamic_cast<CandRecord *>
00135     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00136   if (candrec == 0) {
00137     result.SetError().SetFailed();
00138     return result;
00139   }
00140   
00141   //*-* Find Raw Data CandDigitList fragment in PrimaryCandidateRecord.
00142   CandDigitListHandle *crdlh = dynamic_cast<CandDigitListHandle *>
00143     (candrec->FindCandHandle("CandDigitListHandle", "canddigitlist"));
00144   if (crdlh == 0) {
00145     result.SetError().SetFailed();
00146     return result;
00147   }
00148   
00149   Int_t event = fStatus.GetEventNumber();
00150   const CandHeader* chead = candrec->GetCandHeader();
00151   if (!chead) {
00152     MSG("JobC",Msg::kWarning) << "No CandHeader, but continuing" << endl;
00153   }
00154   ++event;// chead->GetEvent();
00155   //MSG("Dmx", Msg::kInfo) << "event = " << event << endl;
00156 
00157   AlgFactory &af = AlgFactory::GetInstance();
00158   AlgHandle ah = af.GetAlgHandle("AlgDeMuxCosmics", "default");
00159   //AlgConfigDeMux &acd = dynamic_cast<AlgConfigDeMux &>(ah.GetAlgConfig());
00160   
00161   //set fStatus.fEventDeMuxed to be true as a default, it gets reset to false
00162   //if there is no vertex found or no valid planes
00163   fStatus.SetEventDeMuxed(true);
00164   fStatus.SetMultipleMuon(false);
00165 
00166   CandContext cx(this, mom);
00167   cx.SetDataIn(&fStatus);
00168   
00169   ah.RunAlg(*crdlh, cx);
00170   
00171   if( !fStatus.GetEventDeMuxed() ){
00172     result.SetError().SetFailed();
00173     return result;
00174   }
00175   
00176   //MSG("JobC", Msg::kInfo) << "Event DeMuxed" << endl;
00177   
00178   //get the TObjArray of DmxPlane objects
00179   //  const TObjArray *planeArray = fStatus.GetPlaneArray();
00180   
00181 //    //create a TObjectItr
00182 //    TObjectItr planeItr(planeArray);
00183     
00184 //    //create a KeyFunc to sort planes by number
00185 //    TObjectKeyFunc *pnKF = planeItr.CreateKeyFunc();
00186   
00187 //    //program the KeyFunc with the sort function
00188 //    pnKF->SetFun(KeyOnPlaneNumber);
00189   
00190 //    //get the NavSet from the iterator and pass the KeyFunc to it
00191 //    planeItr.GetSet()->AdoptSortKeyFunc(pnKF);
00192   
00193 //    //clear the KF pointer because we no longer own the KeyFunc
00194 //    pnKF = 0;
00195   
00196 //    //zero values that need to start over with each event
00197 //    Int_t vertexPlane = fStatus.GetVertexPlaneNumber();
00198 //    Int_t endPlane = fStatus.GetEndPlaneNumber();
00199 
00200 //    if(!fStatus.GetMultipleMuon()){planeItr.GetSet()->Slice(vertexPlane, endPlane);}
00201 //    else if(fStatus.GetMultipleMuon()){planeItr.GetSet()->Slice(vertexPlane, 500);}
00202 
00203 //    Float_t fracStray = (1.*(fStatus.GetUStrayPlanes()+fStatus.GetVStrayPlanes())) / (1.*planeItr.SizeSelect());
00204 //    if( fStatus.GetUSlopeRMS()>15. && fracStray>0.3333){
00205 //      result.SetError().SetFailed();
00206 //      return result;
00207 //    }
00208 //    else if( fStatus.GetVSlopeRMS()>15. && fracStray>0.3333){
00209 //      result.SetError().SetFailed();
00210 //      return result;
00211 //    }
00212     
00213   return result;
00214 }


Member Data Documentation

Definition at line 39 of file DmxDeMuxFilterModule.h.

Referenced by HandleCommand().

Definition at line 40 of file DmxDeMuxFilterModule.h.

Referenced by HandleCommand().

Definition at line 38 of file DmxDeMuxFilterModule.h.

Referenced by BeginJob(), ClearStatusObject(), and Reco().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1