SND@LHC Software
Loading...
Searching...
No Matches
genfit::MeasurementProducer< hit_T, measurement_T > Class Template Reference

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

#include <MeasurementProducer.h>

Inheritance diagram for genfit::MeasurementProducer< hit_T, measurement_T >:
Collaboration diagram for genfit::MeasurementProducer< hit_T, measurement_T >:

Public Member Functions

 MeasurementProducer (TClonesArray *)
 Constructor takes pointer to the hit array.
 
virtual ~MeasurementProducer ()
 
virtual AbsMeasurementproduce (int index, const TrackCandHit *hit)
 Create a Measurement from the cluster at position index in TClonesArray.
 
- Public Member Functions inherited from genfit::AbsMeasurementProducer< genfit::AbsMeasurement >
virtual ~AbsMeasurementProducer ()
 

Private Attributes

TClonesArray * hitArrayTClones_
 pointer to array with cluster data
 

Detailed Description

template<class hit_T, class measurement_T>
class genfit::MeasurementProducer< hit_T, measurement_T >

Template class for a measurement producer module.

A MeasurementProducer module is used by MeasurementFactory to create Measurements for one specific detector type.

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

In order to use the MeasurementProducer facility, a Measurement has to implement a constructor which takes as an argument a pointer to the cluster class and a TrackCandHit. This constructor serves as the initializing constructor for the Measurement.

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

Parameters
hit_ttemplate parameter specifying hit/cluster class
measurement_Ttemplate parameter specifying Measurement

Definition at line 76 of file MeasurementProducer.h.

Constructor & Destructor Documentation

◆ MeasurementProducer()

template<class hit_T , class measurement_T >
genfit::MeasurementProducer< hit_T, measurement_T >::MeasurementProducer ( TClonesArray *  theArr)

Constructor takes pointer to the hit array.

Definition at line 94 of file MeasurementProducer.h.

94 {
95 hitArrayTClones_ = theArr;
96 //std::cout << "hit array with " << hitArrayTClones_->GetEntries() << " entries." << std::endl;
97}
TClonesArray * hitArrayTClones_
pointer to array with cluster data

◆ ~MeasurementProducer()

template<class hit_T , class measurement_T >
genfit::MeasurementProducer< hit_T, measurement_T >::~MeasurementProducer ( )
virtual

Definition at line 100 of file MeasurementProducer.h.

100 {
101 // we don't assume ownership over the hit arrays
102}

Member Function Documentation

◆ produce()

template<class hit_T , class measurement_T >
AbsMeasurement * genfit::MeasurementProducer< hit_T, measurement_T >::produce ( int  index,
const TrackCandHit hit 
)
virtual

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

Implements genfit::AbsMeasurementProducer< genfit::AbsMeasurement >.

Definition at line 105 of file MeasurementProducer.h.

105 {
106 assert(hitArrayTClones_ != NULL);
107 //std::cout << "hit array with " << hitArrayTClones_->GetEntries() << " entries, looking for entry " << index << "." << std::endl;
108 if(hitArrayTClones_->At(index) == 0) {
109 Exception e("In MeasurementProducer: index for hit in TClonesArray out of bounds",__LINE__,__FILE__);
110 e.setFatal();
111 throw e;
112 }
113 return ( new measurement_T( (hit_T*) hitArrayTClones_->At(index), hit ) );
114}

Member Data Documentation

◆ hitArrayTClones_

template<class hit_T , class measurement_T >
TClonesArray* genfit::MeasurementProducer< hit_T, measurement_T >::hitArrayTClones_
private

pointer to array with cluster data

Definition at line 79 of file MeasurementProducer.h.


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