CbmRoot
CbmMuchFindHitsGem.h
Go to the documentation of this file.
1 /* CbmMuchFindHitsGem.h
2  *
3  *@author V.Singhal <vikas@vecc.gov.in>
4  *@version 2.0 (removeing fDaq Time stream mode as per CbmDaqNew Scheme)
5  *@define Clusterization and Hit creation is not dependend of EBE or Time Based mode.
6  * fClusterSeprationTime taken as 100 ns which will work with Time Based mode.
7  *@since 22.08.17
8  *
9  *@author E.Kryshen <e.kryshen@gsi.de>
10  *@version 2.0
11  *@since 31.07.12
12  *
13  *@author M.Ryzhinskiy <m.ryzhinskiy@gsi.de>
14  *@version 1.0
15  *@since 11.02.08
16  *
17  * Produces hits in GEM-like modules using different
18  * clustering algorithms. Clustering algorithms can be chosen
19  * by the switch SetAlgorithm(Int_t iAlgorithm)
20  * Several clustering algorithms are supported
21  * 0 - one hit per fired pad
22  * 1 - one hit per cluster
23  * 2 - simple cluster deconvolution with charge threshold
24  * 3 - local maxima finder
25  */
26 
27 #ifndef CBMMUCHFINDHITSGEM_H
28 #define CBMMUCHFINDHITSGEM_H 1
29 #include "CbmEvent.h"
30 #include "CbmMuchDigi.h"
31 #include "FairTask.h"
32 #include "TString.h"
33 #include <vector>
34 //#include "CbmStsReco.h"
35 
36 class CbmDigiManager;
37 class CbmMuchPad;
38 class CbmMuchCluster;
39 class TClonesArray;
40 class CbmMuchGeoScheme;
41 
42 // Root file for both the Event by Event Mode and Time Stream mode is same therefore
43 // Time based data can be read directly from the Root Tree ( One Tree entry = One Time Slice)
44 // class CbmTimeSlice;
45 
46 class CbmMuchFindHitsGem : public FairTask {
47 public:
48  CbmMuchFindHitsGem(const char* digiFileName, Int_t flag);
49  virtual ~CbmMuchFindHitsGem() {}
50  virtual void Exec(Option_t* opt);
51  void ProcessData(CbmEvent*);
52  void SetAlgorithm(Int_t iAlgorithm) { fAlgorithm = iAlgorithm; }
53  void SetThresholdRatio(Double_t thresholdRatio) {
54  fThresholdRatio = thresholdRatio;
55  }
56  void SetClusterSeparationTime(Double_t time) {
58  }
59  // Removing SetDaq functionality as Cluster and Hit Finder algorithm is same for both the Time Based and Event Based mode.
60  // void SetDaq(Bool_t daq) { fDaq = daq; }
61  // Set functionality for accepting CbmMuchBeamTimeDigi generated from mCBM data.
62  void SetBeamTimeDigi(Bool_t beam) { bBeamTimeDigi = beam; }
63 
64 private:
65  virtual InitStatus Init();
66  void FindClusters(CbmEvent*);
67  void CreateCluster(CbmMuchPad* pad);
69  Int_t iCluster,
70  CbmEvent* event);
71  void
72  ExecClusteringPeaks(CbmMuchCluster* cluster, Int_t iCluster, CbmEvent* event);
73  void CreateHits(CbmMuchCluster* cluster, Int_t iCluster, CbmEvent* event);
74  TString fDigiFile; // Digitization file
75  Int_t fFlag;
76  Int_t fAlgorithm; // Defines which algorithm to use
77  Double_t
78  fClusterSeparationTime; // Minimum required time between two clusters
79  Double_t
80  fThresholdRatio; // Charge threshold ratio relative to max cluster charge
81  Int_t fEvent; // Event counter
82  Int_t fNofTimeslices; // TimeSlice Counter
83  //TClonesArray* fDigis; // Input array of CbmMuchDigi
85  TClonesArray* fEvents; // Input array of CbmEvent after Event Building
86  std::vector<Int_t> fClusterCharges;
87  std::vector<Bool_t> fLocalMax;
88  std::vector<CbmMuchPad*> fClusterPads;
89  std::vector<std::vector<Int_t>> fNeighbours;
90 
91  TClonesArray* fClusters; // Output array of CbmMuchCluster objects
92  TClonesArray* fHits; // Output array of CbmMuchHit
93  CbmMuchGeoScheme* fGeoScheme; // Geometry scheme
94  // auxiliary maps and vectors
95  std::vector<Int_t> fDigiIndices;
96  std::vector<CbmMuchPad*> fFiredPads;
97  Bool_t fEventMode = kFALSE;
98  //ECbmMode fMode = kCbmTimeslice; // To Select CbmEvent Branch in Time Based Event building mode
99  // Removing SetDaq functionality as Cluster and Hit Finder algorithm is same for both the Time Based and Event Based mode.
100  //Bool_t fDaq; // To daq or not to daq // TODO
101  //CbmTimeSlice* fTimeSlice; // Time slice object in the DAQ approach
102  // according to the input branch , below need to be used so using auto, such that runtime it will decide
103  //std::vector<CbmMuchDigi> fDigiData; // Vector of digis
104 
105  // No need of fDigiDtata
106  //std::vector< auto > fDigiData; // Vector of digis
107  UInt_t fuClusters = 0; //Number of Clusters.
108  Bool_t bBeamTimeDigi = kFALSE; // Boolean for Using Beam Time Digi
109 
112 
114 };
115 
116 #endif
CbmMuchDigi.h
CbmMuchFindHitsGem::fGeoScheme
CbmMuchGeoScheme * fGeoScheme
Definition: CbmMuchFindHitsGem.h:93
CbmMuchGeoScheme
Definition: CbmMuchGeoScheme.h:43
CbmMuchFindHitsGem::CbmMuchFindHitsGem
CbmMuchFindHitsGem(const CbmMuchFindHitsGem &)
CbmMuchFindHitsGem::fClusters
TClonesArray * fClusters
Definition: CbmMuchFindHitsGem.h:91
CbmMuchFindHitsGem::Exec
virtual void Exec(Option_t *opt)
Definition: CbmMuchFindHitsGem.cxx:132
CbmMuchCluster
Data container for MUCH clusters.
Definition: CbmMuchCluster.h:20
CbmMuchFindHitsGem::fAlgorithm
Int_t fAlgorithm
Definition: CbmMuchFindHitsGem.h:76
CbmMuchFindHitsGem::ExecClusteringSimple
void ExecClusteringSimple(CbmMuchCluster *cluster, Int_t iCluster, CbmEvent *event)
Definition: CbmMuchFindHitsGem.cxx:420
CbmMuchFindHitsGem::fClusterSeparationTime
Double_t fClusterSeparationTime
Definition: CbmMuchFindHitsGem.h:78
CbmMuchFindHitsGem::fEventMode
Bool_t fEventMode
Definition: CbmMuchFindHitsGem.h:97
CbmMuchFindHitsGem::~CbmMuchFindHitsGem
virtual ~CbmMuchFindHitsGem()
Definition: CbmMuchFindHitsGem.h:49
CbmMuchFindHitsGem::fNeighbours
std::vector< std::vector< Int_t > > fNeighbours
Definition: CbmMuchFindHitsGem.h:89
CbmMuchFindHitsGem::ClassDef
ClassDef(CbmMuchFindHitsGem, 1)
CbmEvent.h
CbmMuchFindHitsGem::fuClusters
UInt_t fuClusters
Definition: CbmMuchFindHitsGem.h:107
CbmMuchFindHitsGem::fEvents
TClonesArray * fEvents
Interface to digi branch.
Definition: CbmMuchFindHitsGem.h:85
CbmMuchFindHitsGem::fClusterCharges
std::vector< Int_t > fClusterCharges
Definition: CbmMuchFindHitsGem.h:86
CbmMuchFindHitsGem::fDigiIndices
std::vector< Int_t > fDigiIndices
Definition: CbmMuchFindHitsGem.h:95
CbmMuchFindHitsGem::bBeamTimeDigi
Bool_t bBeamTimeDigi
Definition: CbmMuchFindHitsGem.h:108
CbmDigiManager
CbmDigiManager.
Definition: CbmDigiManager.h:37
CbmMuchFindHitsGem::ExecClusteringPeaks
void ExecClusteringPeaks(CbmMuchCluster *cluster, Int_t iCluster, CbmEvent *event)
Definition: CbmMuchFindHitsGem.cxx:484
CbmMuchFindHitsGem::fHits
TClonesArray * fHits
Definition: CbmMuchFindHitsGem.h:92
CbmMuchFindHitsGem::SetThresholdRatio
void SetThresholdRatio(Double_t thresholdRatio)
Definition: CbmMuchFindHitsGem.h:53
CbmMuchFindHitsGem::fDigiFile
TString fDigiFile
Definition: CbmMuchFindHitsGem.h:74
CbmMuchPad
Definition: CbmMuchPad.h:21
CbmMuchFindHitsGem::fLocalMax
std::vector< Bool_t > fLocalMax
Definition: CbmMuchFindHitsGem.h:87
CbmMuchFindHitsGem::fDigiManager
CbmDigiManager * fDigiManager
Definition: CbmMuchFindHitsGem.h:84
CbmMuchFindHitsGem::fEvent
Int_t fEvent
Definition: CbmMuchFindHitsGem.h:81
CbmMuchFindHitsGem::SetAlgorithm
void SetAlgorithm(Int_t iAlgorithm)
Definition: CbmMuchFindHitsGem.h:52
CbmMuchFindHitsGem
Definition: CbmMuchFindHitsGem.h:46
CbmMuchFindHitsGem::fThresholdRatio
Double_t fThresholdRatio
Definition: CbmMuchFindHitsGem.h:80
CbmMuchFindHitsGem::fFiredPads
std::vector< CbmMuchPad * > fFiredPads
Definition: CbmMuchFindHitsGem.h:96
CbmEvent
Class characterising one event by a collection of links (indices) to data objects,...
Definition: CbmEvent.h:30
CbmMuchFindHitsGem::operator=
CbmMuchFindHitsGem operator=(const CbmMuchFindHitsGem &)
CbmMuchFindHitsGem::fFlag
Int_t fFlag
Definition: CbmMuchFindHitsGem.h:75
CbmMuchFindHitsGem::SetClusterSeparationTime
void SetClusterSeparationTime(Double_t time)
Definition: CbmMuchFindHitsGem.h:56
CbmMuchFindHitsGem::fClusterPads
std::vector< CbmMuchPad * > fClusterPads
Definition: CbmMuchFindHitsGem.h:88
CbmMuchFindHitsGem::fNofTimeslices
Int_t fNofTimeslices
Definition: CbmMuchFindHitsGem.h:82
CbmMuchFindHitsGem::Init
virtual InitStatus Init()
Definition: CbmMuchFindHitsGem.cxx:69
CbmMuchFindHitsGem::ProcessData
void ProcessData(CbmEvent *)
Definition: CbmMuchFindHitsGem.cxx:215
CbmMuchFindHitsGem::CbmMuchFindHitsGem
CbmMuchFindHitsGem(const char *digiFileName, Int_t flag)
Definition: CbmMuchFindHitsGem.cxx:41
CbmMuchFindHitsGem::SetBeamTimeDigi
void SetBeamTimeDigi(Bool_t beam)
Definition: CbmMuchFindHitsGem.h:62
CbmMuchFindHitsGem::CreateHits
void CreateHits(CbmMuchCluster *cluster, Int_t iCluster, CbmEvent *event)
Definition: CbmMuchFindHitsGem.cxx:569
CbmMuchFindHitsGem::CreateCluster
void CreateCluster(CbmMuchPad *pad)
Definition: CbmMuchFindHitsGem.cxx:407
CbmMuchFindHitsGem::FindClusters
void FindClusters(CbmEvent *)
Definition: CbmMuchFindHitsGem.cxx:265