Public Member Functions | Private Attributes | List of all members
GFRecoHitProducer< hit_T, recoHit_T > Class Template Reference

Template class for a hit producer module. More...

#include <GFRecoHitProducer.h>

Inheritance diagram for GFRecoHitProducer< hit_T, recoHit_T >:
GFAbsRecoHitProducer

Public Member Functions

 GFRecoHitProducer (TClonesArray *)
 Constructor takes pointer to the cluster array. More...
 
virtual ~GFRecoHitProducer ()
 
virtual GFAbsRecoHit * produce (int index)
 Create a RecoHit from the cluster at position index in TClonesArray. More...
 
- Public Member Functions inherited from GFAbsRecoHitProducer
virtual ~GFAbsRecoHitProducer ()
 

Private Attributes

TClonesArray * hitArrayTClones
 pointer to array with cluster data More...
 

Detailed Description

template<class hit_T, class recoHit_T>
class GFRecoHitProducer< hit_T, recoHit_T >

Template class for a hit producer module.

A GFRecoHitProducer module is used by RecoHitFactory to create RecoHits for one specific detector type.

It is assumed that each detector has as output of its digitization / clustering some sort of cluster class which stores all information that corresponds to a measured hit in that detector. The RecoHit producer converts this information into a class that can be handled by genfit. This class is realized as a RecoHit (a class inherting from GFAbsRecoHit).

In order to use the GFRecoHitProducer facility a RecoHit has to implement a constructor which takes as an argument a pointer to the cluster class. This constructor serves as the initializing constructor for the RecoHit.

The GFRecoHitProducer will fetch the cluster objects from a TClonesArray and use the initializing constructor to build the corresponding RecoHit.

Parameters
hit_ttemplate parameter specifying cluster class
recoHit_ttemplate parameter specifying recoHit

Definition at line 77 of file GFRecoHitProducer.h.

Constructor & Destructor Documentation

template<class hit_T , class recoHit_T >
GFRecoHitProducer< hit_T, recoHit_T >::GFRecoHitProducer ( TClonesArray *  theArr)

Constructor takes pointer to the cluster array.

Definition at line 97 of file GFRecoHitProducer.h.

97  {
98  hitArrayTClones = theArr;
99  //hitArrayVector = NULL;
100 }
TClonesArray * hitArrayTClones
pointer to array with cluster data
template<class hit_T , class recoHit_T >
GFRecoHitProducer< hit_T, recoHit_T >::~GFRecoHitProducer ( )
virtual

Definition at line 110 of file GFRecoHitProducer.h.

110  {
111  //we dont assume ownership over the hit arrays
112 }

Member Function Documentation

template<class hit_T , class recoHit_T >
GFAbsRecoHit * GFRecoHitProducer< hit_T, recoHit_T >::produce ( int  index)
virtual

Create a RecoHit from the cluster at position index in TClonesArray.

Implements GFAbsRecoHitProducer.

Definition at line 116 of file GFRecoHitProducer.h.

116  {
117  if (!hitArrayTClones)
118  throw GFException("GFRecoHitProducer(): no hit set up", __LINE__, __FILE__);
119  //assert(hitArrayTClones!=NULL || hitArrayVector!=NULL);//at least one exists
120  //assert(!(hitArrayTClones!=NULL && hitArrayVector!=NULL));//but not both
121  //if(hitArrayTClones!=NULL){
122  //the ROOT guys really use 0 and not NULL grrr...
123  if(hitArrayTClones->At(index) == 0) {
124  throw GFException("In GFRecoHitProducer: index for hit in TClonesArray out of bounds",__LINE__,__FILE__).setFatal();
125  }
126  return ( new recoHit_T( (hit_T*) hitArrayTClones->At(index) ) );
127  //}
128  //else{//after assertions this is save: the hitArrayVector is good
129  // if(index >= hitArrayVector->size()) {
130  // GFException e("In GFRecoHitProducer: index for hit in std::vector out of bounds",__LINE__,__FILE__);
131  // e.setFatal();
132  // throw e;
133  // }
134  // return ( new recoHit_T( (hit_T*) hitArrayVector->at(index) ) );
135  //}
136 }
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:48
TClonesArray * hitArrayTClones
pointer to array with cluster data
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:78

Member Data Documentation

template<class hit_T , class recoHit_T >
TClonesArray* GFRecoHitProducer< hit_T, recoHit_T >::hitArrayTClones
private

pointer to array with cluster data

Definition at line 80 of file GFRecoHitProducer.h.


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