AlignmentModule Class Reference

#include <AlignmentModule.h>

Inheritance diagram for AlignmentModule:
JobCModule

List of all members.

Public Member Functions

 AlignmentModule ()
 ~AlignmentModule ()
const RegistryDefaultConfig () const
void Config (const Registry &reg)
JobCResult Ana (const MomNavigator *mom)
void EndJob ()

Private Member Functions

 AlignmentModule (const AlignmentModule &rhs)
AlignmentModuleoperator= (const AlignmentModule &rhs)
void Init (void)

Private Attributes

Registry fDefConfig
Registry fConfig
StraightTrackAlignment fSTA

Detailed Description

Definition at line 32 of file AlignmentModule.h.


Constructor & Destructor Documentation

AlignmentModule::AlignmentModule (  ) 

Definition at line 19 of file AlignmentModule.cxx.

References Init().

00020 {
00021     this->Init();
00022 }

AlignmentModule::~AlignmentModule (  ) 

Definition at line 24 of file AlignmentModule.cxx.

00025 {
00026 }

AlignmentModule::AlignmentModule ( const AlignmentModule rhs  )  [private]

Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 43 of file AlignmentModule.cxx.

References StraightTrackAlignment::AddTrack(), fConfig, fSTA, Registry::GetCharString(), CandHandle::GetDaughterIterator(), CandHandle::GetVldContext(), StraightTrackAlignment::Init(), and JobCResult::kAOK.

00044 {
00045 
00046     CandTrackListHandle* ctlh = DataUtil::GetCandidate<CandTrackListHandle>
00047         (mom, fConfig.GetCharString("TrackType"),
00048          fConfig.GetCharString("TrackName"));
00049 
00050     if (!ctlh) {
00051         cerr << "No track\n";
00052         return JobCResult::kAOK;
00053     }
00054 
00055     static bool been_here = false;
00056     if (!been_here) {           // need mom, o.w. would be in BeginJob.
00057         UgliGeomHandle ugh(*(ctlh->GetVldContext()));
00058         fSTA.Init(ugh,fConfig.GetCharString("HistFileName"));
00059         been_here = true;
00060     }
00061 
00062     CandTrackHandleItr cth_itr(ctlh->GetDaughterIterator());
00063     for (;cth_itr.IsValid();cth_itr.Next()) {
00064         CandTrackHandle* cth = *cth_itr;
00065         fSTA.AddTrack(*cth);
00066     }
00067 
00068     return JobCResult::kAOK;
00069 }

void AlignmentModule::Config ( const Registry r  )  [inline, 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 41 of file AlignmentModule.h.

References fConfig, Registry::LockValues(), Registry::Merge(), and Registry::UnLockValues().

00041                                      { 
00042         fConfig.UnLockValues();
00043         fConfig.Merge(reg); 
00044         fConfig.LockValues();
00045     }

const Registry& AlignmentModule::DefaultConfig ( void   )  const [inline, 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 40 of file AlignmentModule.h.

References fDefConfig.

00040 { return fDefConfig; }

void AlignmentModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 71 of file AlignmentModule.cxx.

References StraightTrackAlignment::ApplyAllOffsets(), StraightTrackAlignment::ApplyAllTracks(), count, and fSTA.

00072 {
00073     cerr << "AlignmentModule::EndJob\n";
00074     for (int count=0; count<3; ++count) {
00075         double ret = fSTA.ApplyAllTracks();
00076         fSTA.ApplyAllOffsets();
00077         cout << count << " returns: " << ret << endl;
00078     }
00079     cerr << "EndJob done\n";
00080 }

void AlignmentModule::Init ( void   )  [private]

Definition at line 29 of file AlignmentModule.cxx.

References fConfig, fDefConfig, JobCModule::GetName(), Registry::LockValues(), and Registry::Set().

Referenced by AlignmentModule().

00030 {
00031     std::string name = this->GetName();
00032     name += ".config.default";
00033     fDefConfig.SetName(name.c_str());
00034     // Paul's by default:
00035     fDefConfig.Set("TrackName","candfitthrumuonlist");
00036     fDefConfig.Set("TrackType","CandThruMuonListHandle");
00037     fDefConfig.Set("HistFileName","alignment-hists.root");
00038     fDefConfig.LockValues();
00039     fConfig = fDefConfig;
00040 }

AlignmentModule& AlignmentModule::operator= ( const AlignmentModule rhs  )  [private]

Member Data Documentation

Reimplemented from JobCModule.

Definition at line 59 of file AlignmentModule.h.

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

Definition at line 59 of file AlignmentModule.h.

Referenced by DefaultConfig(), and Init().

Definition at line 60 of file AlignmentModule.h.

Referenced by Ana(), and EndJob().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1