PandaRoot
PndFtsRecoHitProducer.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef PNDFTSRECOHITPRODUCER_H
14 #define PNDFTSRECOHITPRODUCER_H
15 
16 #include <vector>
17 #include <map>
18 #include <assert.h>
19 #include <iostream>
20 
21 #include "TClonesArray.h"
22 #include "GFException.h"
23 #include "GFRecoHitProducer.h"
24 
25 class GFAbsRecoHit;
26 class TClonesArray;
27 
28 template <class hit_T, class recoHit_T>
30 
31  private:
32  TClonesArray *hitArrayTClones;
33  TClonesArray *tubeArrayTClones;
34 
35  public:
36  PndFtsRecoHitProducer(TClonesArray *, TClonesArray *);
37  virtual ~PndFtsRecoHitProducer();
38 
39  virtual GFAbsRecoHit *produce(int index);
40 };
41 
42 template <class hit_T, class recoHit_T>
43 PndFtsRecoHitProducer<hit_T, recoHit_T>::PndFtsRecoHitProducer(TClonesArray *theArr, TClonesArray *theTubeArr)
44 {
45  hitArrayTClones = theArr;
46  tubeArrayTClones = theTubeArr;
47 }
48 
49 template <class hit_T, class recoHit_T>
51 {
52 }
53 
54 template <class hit_T, class recoHit_T>
56 {
57  assert(hitArrayTClones != nullptr);
58  assert(tubeArrayTClones != nullptr);
59  if (hitArrayTClones->At(index) == 0) {
60  GFException e("In PndFtsRecoHitProducer: index for hit in TClonesArray out of bounds", __LINE__, __FILE__);
61  e.setFatal();
62  throw e;
63  }
64 
65  return (new recoHit_T((hit_T *)hitArrayTClones->At(index), tubeArrayTClones));
66 }
67 
68 #endif
virtual GFAbsRecoHit * produce(int index)
Virtual abstract method to produce a RecoHit. Implemented in GFRecoHitProducer.
Base Class for representing a Hit in GENFIT.
Definition: GFAbsRecoHit.h:83
Abstract interface class for GFRecoHitProducer.
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:56
PndFtsRecoHitProducer(TClonesArray *, TClonesArray *)
void setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:86