PandaRoot
PndMdtHitProducer.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 PNDMDTHITPRODUCER_H
14 #define PNDMDTHITPRODUCER_H 1
15 
16 #include "FairTask.h"
17 #include "PndMdtHit.h"
18 #include "TVector3.h"
19 #include "FairTSBufferFunctional.h"
20 
21 class TClonesArray;
22 class PndMdtDigi;
23 
24 using std::map;
25 using std::vector;
26 
27 class PndMdtHitProducer : public FairTask {
28 
29  public:
32 
35 
37  virtual InitStatus Init();
38 
39  virtual void RunTimeBased() { fTimeOrderedDigi = kTRUE; }
40  virtual void FinishTask();
42  virtual void Exec(Option_t *opt);
43 
44  PndMdtHit *AddHit(Int_t detID, Int_t stripID, TVector3 &pos, TVector3 &dpos, Int_t bIndex, Int_t sIndex);
45 
46  // Bool_t MdtMapping(); // Creates maps of MDT hits
47  // void Reset(); // reset maps
48 
49  private:
50  virtual void Exec_old(Option_t *opt);
51 
53  TClonesArray *fBoxArray;
54  TClonesArray *fStripArray;
55  TClonesArray *fDigiArray;
56 
57  TClonesArray *fBoxClusterArray;
58  TClonesArray *fStripClusterArray;
60  TClonesArray *fHitArray;
61 
62  Int_t fNumofBoxDigis;
63  Int_t fNumofStripDigis;
64  Int_t fNumofHits;
65  Int_t fNumofGroupedBoxDigis;
66  Int_t fNumofGroupedStripDigis;
67  /* map<Int_t, vector<Int_t> >mapBoxBarrel; */
68  /* map<Int_t, vector<Int_t> >mapBoxEndcap; */
69  /* map<Int_t, vector<Int_t> >mapBoxForward; */
70  /* map<Int_t, vector<Int_t> >mapStripBarrel; */
71  /* map<Int_t, vector<Int_t> >mapStripEndcap; */
72  /* map<Int_t, vector<Int_t> >mapStripForward; */
73  std::map<Int_t, Int_t> fMatchMap;
74  // statistics record
75  std::map<Int_t, Int_t> fBoxHitMapofLayer;
76  std::map<Int_t, Int_t> fStripHitMapofLayer;
77 
78  typedef std::vector<std::vector<PndMdtDigi *>> ClustersCollection;
79  typedef ClustersCollection::iterator ClustersColIter;
80  typedef std::vector<PndMdtDigi *> SingleCluster;
81  typedef SingleCluster::iterator SingleDigiIter;
82 
83  typedef std::vector<std::vector<PndMdtDigi *>> TrackletCollection;
84  typedef TrackletCollection::iterator TrackletColIter;
85  typedef std::vector<PndMdtDigi *> Tracklet;
86  typedef Tracklet::iterator TrackletDigiIter;
87 
88  typedef std::vector<PndMdtDigi *> VecDigi;
89  typedef VecDigi::iterator VecDigiIter;
90 
91  Bool_t fTimeOrderedDigi;
92  BinaryFunctor *fFunctor;
93  Int_t fEventCounter;
94  Double_t fTimeWindow;
95 
96  struct PndMdtDigiLess {
97  bool operator()(const PndMdtDigi *lv, const PndMdtDigi *rv) const;
98  };
99 
100  ClassDef(PndMdtHitProducer, 1);
101 };
102 
103 #endif
virtual void FinishTask()
virtual void Exec(Option_t *opt)
virtual void RunTimeBased()
virtual InitStatus Init()
PndMdtHit * AddHit(Int_t detID, Int_t stripID, TVector3 &pos, TVector3 &dpos, Int_t bIndex, Int_t sIndex)