FairRoot/PandaRoot
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
RhoFactory Class Reference

#include <RhoFactory.h>

Inheritance diagram for RhoFactory:

Public Member Functions

virtual ~RhoFactory ()
 

Static Public Member Functions

static RhoFactoryInstance ()
 
static void Reset ()
 
static RhoCandidateNewCandidate ()
 
static RhoCandidateNewCandidate (const RhoCandidate &c)
 
static RhoCandidateNewCandidate (const RhoCandidate *c)
 
static RhoCandidateGetCandidate (Int_t)
 
static Int_t GetCandidateWatermark ()
 
static Int_t GetCandPointer ()
 

Private Member Functions

 RhoFactory ()
 

Static Private Attributes

static RhoFactoryfgInstance = 0
 
static TClonesArray * fgCandBuffer = 0
 Do not stream. More...
 
static Int_t fgCandPointer =0
 Candidate buffer. More...
 
static Int_t fgCandWatermark =0
 

Detailed Description

Definition at line 27 of file RhoFactory.h.

Constructor & Destructor Documentation

RhoFactory::~RhoFactory ( )
virtual

Definition at line 40 of file RhoFactory.cxx.

References fgCandBuffer, and fgInstance.

41 {
42  if(fgCandBuffer){
43  fgCandBuffer->Delete();
44  delete fgCandBuffer;
45  }
46  delete fgInstance;
47  fgInstance = 0;
48 }
static TClonesArray * fgCandBuffer
Do not stream.
Definition: RhoFactory.h:51
static RhoFactory * fgInstance
Definition: RhoFactory.h:50
RhoFactory::RhoFactory ( )
inlineprivate

Definition at line 49 of file RhoFactory.h.

Referenced by Instance().

49 {}

Member Function Documentation

RhoCandidate * RhoFactory::GetCandidate ( Int_t  i)
static

Definition at line 104 of file RhoFactory.cxx.

References fgCandBuffer, fgCandWatermark, and i.

Referenced by NewCandidate().

105 {
106  if ( fgCandBuffer==0 || i>fgCandWatermark ) { return 0; }
107  return ( RhoCandidate* ) ( *fgCandBuffer ) [i];
108 }
Int_t i
Definition: run_full.C:25
static Int_t fgCandWatermark
Definition: RhoFactory.h:53
static TClonesArray * fgCandBuffer
Do not stream.
Definition: RhoFactory.h:51
Int_t RhoFactory::GetCandidateWatermark ( )
static

Definition at line 110 of file RhoFactory.cxx.

References fgCandWatermark.

Referenced by PndMyAnalysisTask::Exec().

111 {
112  return fgCandWatermark;
113 }
static Int_t fgCandWatermark
Definition: RhoFactory.h:53
Int_t RhoFactory::GetCandPointer ( )
static

Definition at line 115 of file RhoFactory.cxx.

References fgCandPointer.

116 {
117  return fgCandPointer;
118 }
static Int_t fgCandPointer
Candidate buffer.
Definition: RhoFactory.h:52
RhoFactory * RhoFactory::Instance ( )
static
RhoCandidate * RhoFactory::NewCandidate ( )
static

Definition at line 52 of file RhoFactory.cxx.

References c.

Referenced by RhoBooster::Boost(), RhoCandidate::Combine(), RhoFitterBase::CopyCand(), NewCandidate(), RhoCandList::Put(), and DecayTreeFitter::Fitter::updateCand().

53 {
55  return NewCandidate ( c );
56 }
static RhoCandidate * NewCandidate()
Definition: RhoFactory.cxx:52
RhoCandidate * RhoFactory::NewCandidate ( const RhoCandidate c)
static

Definition at line 58 of file RhoFactory.cxx.

References NewCandidate().

59 {
60  return NewCandidate(&c);
61 // if ( fgCandBuffer==0 ) { fgCandBuffer = new TClonesArray ( "RhoCandidate" ); }
62 // int current = fgCandPointer++;
63 // if ( current>fgCandWatermark ) { fgCandWatermark = current; }
64 // if ( current<fgCandWatermark ) {
65 // RhoCandidate* b = GetCandidate ( current );
66 // b->RemoveAssociations();
67 // }
68 // new ( ( *fgCandBuffer ) [current] ) RhoCandidate ( c );
69 // return GetCandidate ( current );
70 }
static RhoCandidate * NewCandidate()
Definition: RhoFactory.cxx:52
RhoCandidate * RhoFactory::NewCandidate ( const RhoCandidate c)
static

Definition at line 72 of file RhoFactory.cxx.

References b, fgCandBuffer, fgCandPointer, fgCandWatermark, GetCandidate(), and RhoCandidate::RemoveAssociations().

73 {
74  if ( fgCandBuffer==0 ) { fgCandBuffer = new TClonesArray ( "RhoCandidate" ); }
75  int current = fgCandPointer++;
76  if ( current>fgCandWatermark ) { fgCandWatermark = current; }
77  if ( current<fgCandWatermark ) {
78  RhoCandidate* b = GetCandidate ( current );
79  b->RemoveAssociations();
80  }
81  new ( ( *fgCandBuffer ) [current] ) RhoCandidate ( *c );
82  return GetCandidate ( current );
83 }
TTree * b
static Int_t fgCandPointer
Candidate buffer.
Definition: RhoFactory.h:52
static Int_t fgCandWatermark
Definition: RhoFactory.h:53
void RemoveAssociations()
static TClonesArray * fgCandBuffer
Do not stream.
Definition: RhoFactory.h:51
static RhoCandidate * GetCandidate(Int_t)
Definition: RhoFactory.cxx:104
void RhoFactory::Reset ( )
static

Member Data Documentation

TClonesArray * RhoFactory::fgCandBuffer = 0
staticprivate

Do not stream.

Definition at line 51 of file RhoFactory.h.

Referenced by GetCandidate(), NewCandidate(), and ~RhoFactory().

Int_t RhoFactory::fgCandPointer =0
staticprivate

Candidate buffer.

Definition at line 52 of file RhoFactory.h.

Referenced by GetCandPointer(), and NewCandidate().

Int_t RhoFactory::fgCandWatermark =0
staticprivate

Definition at line 53 of file RhoFactory.h.

Referenced by GetCandidate(), GetCandidateWatermark(), and NewCandidate().

RhoFactory * RhoFactory::fgInstance = 0
staticprivate

Definition at line 50 of file RhoFactory.h.

Referenced by Instance(), and ~RhoFactory().


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