StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFttClusterMaker.h
1 /***************************************************************************
2  * StFttClusterMaker.h
3  * Author: Daniel Brandenburg Feb, 2022
4  ***************************************************************************/
5 #ifndef STFTTCLUSTERMAKER_H
6 #define STFTTCLUSTERMAKER_H
7 #include "StMaker.h"
8 #include <vector>
9 #include <map>
10 
11 
12 
13 class StFttDb;
14 class StEvent;
15 class StFttCollection;
16 class StFttRawHit;
17 class StFttCluster;
18 
19 class StFttClusterMaker: public StMaker {
20 
21 public:
22  StFttClusterMaker( const char* name = "stgcCluster" );
23 
25 
26 
27  int Init();
28  int InitRun( int );
29  int FinishRun( int );
30  int Finish();
31  int Make();
32 
33  void SetTimeCut( int mode, int min, int max ) {
34  mTimeCutMode = mode;
35  mTimeCutMin = min;
36  mTimeCutMax = max;
37  }
38 
39 private:
40  void ApplyHardwareMap();
41  std::vector<StFttCluster*> FindClusters( std::vector<StFttRawHit * > );
42  StFttRawHit * FindMaxAdc( std::vector<StFttRawHit *>, size_t &pos );
43 
44  void InjectTestData();
45  void SearchClusterEdges( std::vector< StFttRawHit * > hits,
46  size_t start, // start index at MaxADC
47  size_t &left, size_t &right);
48  void CalculateClusterInfo( StFttCluster * clu );
49 
50  // selection of raw hits for cluster building
51  float GetThresholdFor( StFttRawHit * hit ) { return 0.0;}
52  bool PassTimeCut( StFttRawHit * hit );
53 
54  StEvent* mEvent;
55  StFttCollection* mFttCollection;
56  int mRunYear;
57  bool mDebug;
58  StFttDb* mFttDb;
59 
60  enum HitTimeModes {
61  kHitCalibratedTime = 0,
62  kHitTimebin = 1
63  };
64  enum TimeCutModes {
65  kTimeCutModeDB = 0,
66  kTimeCutModeAcceptAll = 1,
67  kTimeCutModeCalibratedTime = 2,
68  kTimeCutModeTimebin = 3
69  };
70  int mTimeCutMin = -40; // value from Run22 - Run24 online QA approximately 1 bx
71  int mTimeCutMax = 100; // value from Run22 - Run24 online QA approximately 1 bx
72  int mTimeCutMode = 0; //default - kTimeCutModeDB, CINT cant use the enum directly
73 
74 
75  ClassDef( StFttClusterMaker, 0 )
76 };
77 
78 #endif // STFTTCLUSTERMAKER_H