forked from JeffersonLab/SBS-offline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SBSBBTotalShower.h
103 lines (80 loc) · 3.65 KB
/
SBSBBTotalShower.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#ifndef ROOT_SBSBBTotalShower
#define ROOT_SBSBBTotalShower
///////////////////////////////////////////////////////////////////////////////
// //
// SBSBBTotalShower //
// //
///////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------//
//
// Debug Definitions
// place this section below any other head files
//
//------------------------------------------------------//
#ifdef DEBUG_LEVEL
# undef DEBUG_LEVEL
#endif
// DEBUG_LEVEL;
// =0 or not define: no debug, full speed
// >=1 enable debug extra warning (suggested setting)
// >=2 above + enable debug assert
// >=3 above + enable debug extra info
// >=4 above + massive info (in a for or while)
#define DEBUG_LEVEL 2
#include "DebugDef.h"
#include "THaPidDetector.h"
#include "SBSCalorimeter.h"
class SBSBBShower;
class SBSCalorimeter;
class SBSBBTotalShower : public SBSCalorimeter { //THaPidDetector {
public:
explicit SBSBBTotalShower( const char* name, const char* description = "",
THaApparatus* a = nullptr );
SBSBBTotalShower( const char* name, const char* shower_name,
const char* preshower_name, const char* description = "",
THaApparatus* a = nullptr );
virtual ~SBSBBTotalShower();
virtual void Clear( Option_t* opt="" );
virtual Int_t Decode( const THaEvData& );
virtual Int_t CoarseProcess( TClonesArray& tracks );
virtual Int_t FineProcess( TClonesArray& tracks );
SBSBBShower* GetShower() const { return fShower; }
SBSBBShower* GetPreShower() const { return fPreShower; }
int PSMatchClusIdx(uint SHclusIdx){ int val = SHclusIdx<fSHclusPSclusIDmap.size() ? fSHclusPSclusIDmap[SHclusIdx] : -1; return val; }
virtual EStatus Init( const TDatime& run_time );
virtual void SetApparatus( THaApparatus* );
void LoadMCHitAt( Double_t x, Double_t y, Double_t E );
protected:
// Maximum number of clusters
static const Int_t kMaxNClust = 16;
// Subdetectors
SBSBBShower* fShower; // Shower subdetector
SBSBBShower* fPreShower; // Preshower subdetector
// Parameters
Double_t fMaxDx; // Maximum dx between shower and preshower centers
Double_t fMaxDy; // Maximum dx between shower and preshower centers
Double_t fTotalSum_Threshold; //Software threshold for shower and (matched) pre-shower cluster energies
Int_t fPassedThreshold; //variable to indicate whether we were over threshold:
/*
// Per event data
Int_t fNclust; // Number of clusters
Double_t* fE; //[fNClust] Total shower energy
Double_t* fX; //[fNClust] Total shower X
Double_t* fY; //[fNClust] Total shower Y
Int_t* fID; //[fNClust] ID of Presh and Shower coincidence
*/
std::map<int, std::pair<int, int> > fPSSHmatchmapX;
std::map<int, std::pair<int, int> > fPSSHmatchmapY;
//key = SH cluster ID, value = PS cluster ID;
std::vector<int> fSHclusPSclusIDmap;
virtual Int_t ReadDatabase( const TDatime& date );
virtual Int_t DefineVariables( EMode mode = kDefine );
virtual Bool_t IsPid() { return true; }
private:
void Setup( const char* name, const char* desc,
const char* shnam, const char* psnam,
THaApparatus* app, bool mode );
ClassDef(SBSBBTotalShower,0) //A total shower detector (shower plus preshower)
};
///////////////////////////////////////////////////////////////////////////////
#endif