NavPrimerGenerator Class Reference

#include <NavPrimerGenerator.h>

Inheritance diagram for NavPrimerGenerator:

NavGenLattice NavGenTCollection List of all members.

Public Types

typedef NavKey(*) KeyFunc (TObject *)

Public Member Functions

 NavPrimerGenerator (const Char_t *leftClass, const Char_t *rightClass, Int_t rship=0)
virtual ~NavPrimerGenerator ()
virtual Bool_t Matches (const Char_t *leftClass, const Char_t *rightClass, Int_t rship=0) const
virtual LatticeGetLattice ()
virtual TCollection * GetTCollection ()

Protected Member Functions

virtual Bool_t IsOutOfDate () const
virtual Bool_t IsLattice () const =0
const Char_t * LeftClass () const
const Char_t * RightClass () const
virtual const void * GetSetPtr () const =0
virtual void Clear ()=0
virtual const void * GetSet ()
virtual void Rebuild ()=0

Private Member Functions

 NavPrimerGenerator (const NavPrimerGenerator &)
void GetCurrentRunEvent (Int_t &run, Int_t event) const

Private Attributes

Int_t fEventNumber
Int_t fRelShip
Int_t fRunNumber
std::string fLeftClass
std::string fRightClass

Detailed Description

Definition at line 24 of file NavPrimerGenerator.h.


Member Typedef Documentation

typedef NavKey(*) NavPrimerGenerator::KeyFunc(TObject *)

Reimplemented in NavGenLattice.

Definition at line 29 of file NavPrimerGenerator.h.


Constructor & Destructor Documentation

NavPrimerGenerator::NavPrimerGenerator ( const Char_t *  leftClass,
const Char_t *  rightClass,
Int_t  rship = 0 
)

Definition at line 239 of file NavPrimerGenerator.cxx.

References LEA_CTOR.

00241                                                              :
00242 
00243 fEventNumber(-1),
00244 fRelShip(rship),
00245 fRunNumber(-1),
00246 fLeftClass(leftClass),
00247 fRightClass(rightClass)
00248 
00249 {
00250 
00251 //  Purpose:  Constructor
00252 
00253 //  Arguments: 
00254 //    leftClass    in    Name of left or only class.
00255 //    rightClass   in    Name of right class or null string.
00256 //    rship        in    Relationship number or 0.
00257 
00258 //  Return:    n/a
00259 
00260 //  Contact:   N. West
00261 
00262 //  Specification:-
00263 //  =============
00264 
00265 //  o Create a NavPrimerGenerator.
00266 
00267 //  Program Notes:-
00268 //  =============
00269 
00270 //  None.
00271 
00272   LEA_CTOR //Leak Checker
00273 
00274 }

virtual NavPrimerGenerator::~NavPrimerGenerator (  )  [inline, virtual]

Definition at line 35 of file NavPrimerGenerator.h.

References LEA_DTOR.

00035 { LEA_DTOR; };

NavPrimerGenerator::NavPrimerGenerator ( const NavPrimerGenerator  )  [private]


Member Function Documentation

virtual void NavPrimerGenerator::Clear (  )  [protected, pure virtual]

Implemented in NavGenLattice, and NavGenTCollection.

void NavPrimerGenerator::GetCurrentRunEvent ( Int_t &  run,
Int_t  event 
) const [private]

Definition at line 45 of file NavPrimerGenerator.cxx.

Referenced by GetSet(), and IsOutOfDate().

00045                                                                           {
00046 
00047 
00048 //  Purpose:  Get current run and event.
00049 //  Arguments: 
00050 //    run          out   Current run number or =-1 in unknown.
00051 //    event        out   Current event number or =-1 in unknown.
00052 
00053 //  Return:    
00054 
00055 //  Contact:   N. West
00056 
00057 //  Specification:-
00058 //  =============
00059 
00060 //  o Get current run and event.
00061 
00062 //  Program Notes:-
00063 //  =============
00064 
00065 //  This is a single point interface to get the current run and event 
00066 //  number.  Its is currently disabled (was used when Q and REROOT
00067 //  classes were supported). The entire NavPrimer machinery will
00068 //  probably be removed at some point.
00069 
00070 
00071 
00072 //     if ( gMINFast ) {
00073 //       MINFHeader* head = gMINFast->GetHeader();
00074 //       event = head->GetEvent();
00075 //       run   = head->GetRun();
00076 //     }
00077 //     else {
00078       event = -1;
00079       run   = -1;
00080 //     }
00081 
00082 }

Lattice * NavPrimerGenerator::GetLattice (  )  [virtual]

Definition at line 85 of file NavPrimerGenerator.cxx.

References GetSet(), and IsLattice().

Referenced by NavPrimer::FindLattice().

00085                                         {
00086 
00087 
00088 //  Purpose:  Return up to date Lattice.
00089 
00090 //  Arguments: None.
00091 
00092 //  Return:    Up to date Lattice or =0 if not a Lattice Generator.
00093 
00094 //  Contact:   N. West
00095 
00096 //  Specification:-
00097 //  =============
00098 
00099 //  o Return up to date Lattice or =0 if not a Lattice Generator.
00100 
00101 //  Program Notes:-
00102 //  =============
00103 
00104 //  None.
00105 
00106   return ( IsLattice() ) ? (Lattice*) GetSet() : 0;
00107 }

const void * NavPrimerGenerator::GetSet (  )  [protected, virtual]

Definition at line 110 of file NavPrimerGenerator.cxx.

References fEventNumber, fRunNumber, GetCurrentRunEvent(), GetSetPtr(), IsOutOfDate(), and Rebuild().

Referenced by GetLattice(), and GetTCollection().

00110                                        {
00111 
00112 
00113 //  Purpose:  Get up to date version of set.
00114 
00115 //  Arguments: None.
00116 
00117 //  Return:   Set 
00118 
00119 //  Contact:   N. West
00120 
00121 //  Specification:-
00122 //  =============
00123 
00124 //  o If set is out of date rebuild it, update run and event and 
00125 //    return it.
00126 
00127 //  Program Notes:-
00128 //  =============
00129 
00130 //  None.
00131 
00132   if ( IsOutOfDate() ) { 
00133     Rebuild();
00134     GetCurrentRunEvent(fRunNumber,fEventNumber);
00135   }
00136 
00137   return GetSetPtr();
00138 
00139 
00140 }

virtual const void* NavPrimerGenerator::GetSetPtr (  )  const [protected, pure virtual]

Implemented in NavGenLattice, and NavGenTCollection.

Referenced by GetSet(), and IsOutOfDate().

TCollection * NavPrimerGenerator::GetTCollection (  )  [virtual]

Definition at line 143 of file NavPrimerGenerator.cxx.

References GetSet(), and IsLattice().

Referenced by NavPrimer::FindTCollection().

00143                                                 {
00144 
00145 
00146 //  Purpose:  Return up to date TCollection.
00147 
00148 //  Arguments: None.
00149 
00150 //  Return:    Up to date TCollection or =0 if not a TCollection Generator.
00151 
00152 //  Contact:   N. West
00153 
00154 //  Specification:-
00155 //  =============
00156 
00157 //  o Return up to date TCollection or =0 if not a TCollection Generator.
00158 
00159 //  Program Notes:-
00160 //  =============
00161 
00162 //  None.
00163 
00164   return ( ! IsLattice() ) ? (TCollection*) GetSet() : 0;
00165 
00166 }

virtual Bool_t NavPrimerGenerator::IsLattice (  )  const [protected, pure virtual]

Implemented in NavGenLattice, and NavGenTCollection.

Referenced by GetLattice(), and GetTCollection().

Bool_t NavPrimerGenerator::IsOutOfDate (  )  const [protected, virtual]

Definition at line 169 of file NavPrimerGenerator.cxx.

References fEventNumber, fRunNumber, GetCurrentRunEvent(), GetSetPtr(), and run().

Referenced by GetSet().

00169                                             {
00170 
00171 
00172 //  Purpose:  See if current set is out of date.
00173 
00174 //  Arguments: None.
00175 
00176 //  Return:    kTRUE if set is out of date.
00177 
00178 //  Contact:   N. West
00179 
00180 //  Specification:-
00181 //  =============
00182 
00183 //  o Return kFALSE unless set exists and is for current Run 
00184 //    and Event.
00185 
00186 //  Program Notes:-
00187 //  =============
00188 
00189 //  None.
00190 
00191 
00192   if ( ! GetSetPtr() ) return kTRUE;
00193 
00194   Int_t run = -1;
00195   Int_t event = -1;
00196   GetCurrentRunEvent(run, event);
00197   return ( event != fEventNumber || run != fRunNumber 
00198          ) ? kTRUE : kFALSE;
00199 
00200 }

const Char_t* NavPrimerGenerator::LeftClass (  )  const [inline, protected]

Definition at line 51 of file NavPrimerGenerator.h.

References fLeftClass.

Referenced by NavGenTCollection::Rebuild(), and NavGenLattice::Rebuild().

00051 { return fLeftClass.c_str(); }

Bool_t NavPrimerGenerator::Matches ( const Char_t *  leftClass,
const Char_t *  rightClass,
Int_t  rship = 0 
) const [virtual]

Definition at line 203 of file NavPrimerGenerator.cxx.

References fLeftClass, fRelShip, and fRightClass.

00205                                                                {
00206 
00207 
00208 //  Purpose:  See if set matches supplied left/right class names and
00209 //            relationship.
00210 
00211 //  Arguments: 
00212 //    leftClass    in    Name of left class.
00213 //    rightClass   in    Name of right class.
00214 //    rship        in    Relationship number or 0.
00215 
00216 //  Return:    kTRUE if encapsulated set matches the left and
00217 //             right classes.
00218 
00219 //  Contact:   N. West
00220 
00221 //  Specification:-
00222 //  =============
00223 
00224 //  o See if set matches supplied left/right class names.
00225 
00226 //  Program Notes:-
00227 //  =============
00228 
00229 //  None.
00230 
00231   return (     fLeftClass  == leftClass  
00232            &&  fRightClass == rightClass 
00233            &&  fRelShip    == rship
00234          ) ? kTRUE : kFALSE;
00235 
00236 }

virtual void NavPrimerGenerator::Rebuild (  )  [protected, pure virtual]

Implemented in NavGenLattice, and NavGenTCollection.

Referenced by GetSet().

const Char_t* NavPrimerGenerator::RightClass (  )  const [inline, protected]

Definition at line 52 of file NavPrimerGenerator.h.

References fRightClass.

Referenced by NavGenLattice::Rebuild().

00052 { return fRightClass.c_str(); }


Member Data Documentation

Int_t NavPrimerGenerator::fEventNumber [private]

Definition at line 71 of file NavPrimerGenerator.h.

Referenced by GetSet(), and IsOutOfDate().

std::string NavPrimerGenerator::fLeftClass [private]

Definition at line 75 of file NavPrimerGenerator.h.

Referenced by LeftClass(), and Matches().

Int_t NavPrimerGenerator::fRelShip [private]

Definition at line 72 of file NavPrimerGenerator.h.

Referenced by Matches().

std::string NavPrimerGenerator::fRightClass [private]

Definition at line 76 of file NavPrimerGenerator.h.

Referenced by Matches(), and RightClass().

Int_t NavPrimerGenerator::fRunNumber [private]

Definition at line 73 of file NavPrimerGenerator.h.

Referenced by GetSet(), and IsOutOfDate().


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:03:02 2014 for loon by  doxygen 1.4.7