ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtCoreSpecMAT.h
Go to the documentation of this file.
1 // =================================================
2 // AtCore Class
3 // Original author : Genie Jhang ( geniejhang@majimak.com )
4 // Adapted for AtTPCROOT by Y. Ayyad (ayyadlim@nscl.msu.edu)
5 // =================================================
6 
7 #ifndef _ATCORESPECMAT_H_
8 #define _ATCORESPECMAT_H_
9 
10 #include "AtMap.h"
11 #include "AtPedestal.h"
12 #include "AtRawEvent.h"
13 #include "AtSpecMATMap.h"
14 #include "AtTpcMap.h"
15 #include "AtTpcProtoMap.h"
16 
17 #include <TClonesArray.h>
18 #include <TFile.h>
19 #include <TObject.h>
20 #include <TString.h>
21 #include <TTree.h>
22 #include <TTreeReader.h>
23 #include <TTreeReaderArray.h>
24 
25 #include "GETDecoder2.h"
26 
27 #include <tuple>
28 
29 class AtCoreSpecMAT : public TObject {
30 private:
31  Int_t fNumTbs;
32 
33  GETDecoder2 *fDecoderPtr[16];
34  Bool_t fIsData;
35 
36  AtPedestal *fPedestalPtr[16];
37  Bool_t fIsNegativePolarity[4];
38  Double_t fFPNSigmaThreshold;
39 
40  AtRawEvent *fRawEventPtr;
41  TClonesArray *fPadArray;
42 
43  Int_t fCurrentEventID[16];
44  Int_t fTargetFrameID;
45 
46  Bool_t fIsSeparatedData;
47 
48  /* old map style
49  Int_t kOpt;
50  TString fIniMap;
51  TString fLowgMap;
52  TString fXtalkMap;
53  Bool_t GetIsAuxChannel(Int_t val);
54  Bool_t kEnableAuxChannel;
55  std::vector<Int_t> fAuxChannels;
56  AtMap *fAtMapPtr;
57  */
58  // new map style
59  std::shared_ptr<AtSpecMATMap> fMap;
60 
61  TString fFileName;
62 
63  Int_t fNumCobo;
64 
65  Int_t fFPNChannels[4][4][4][4][512];
66  Bool_t fIsPadPlaneCobo[4];
67 
68 #ifndef __CINT__
69  typedef boost::multi_array<double, 3> multiarray;
70  typedef multiarray::index index;
71  multiarray AtPadCoordArr;
72 #endif //__CINT__
73 
74  Bool_t kDebug;
75 
76 public:
77  AtCoreSpecMAT();
78  AtCoreSpecMAT(std::shared_ptr<AtSpecMATMap> map);
79  AtCoreSpecMAT(TString filename, std::shared_ptr<AtSpecMATMap> map);
80  AtCoreSpecMAT(TString filename, Int_t numTbs, Int_t windowNumTbs = 512, Int_t windowStartTb = 0);
82 
83  void Initialize();
84 
85  // setters
86  Bool_t AddData(TString filename, Int_t coboIdx = 0);
87  void SetPositivePolarity(Bool_t *value);
88  Bool_t SetData(Int_t value);
89  Int_t GetNumData(Int_t coboIdx = 0);
90  TString GetDataName(Int_t index, Int_t coboIdx = 0);
91  void SetNumTbs(Int_t value);
92  void SetFPNPedestal(Double_t sigmaThreshold = 5);
93  void SetPseudoTopologyFrame(Int_t asadMask, Bool_t check = kFALSE);
94  void SetAuxChannel(std::vector<Int_t> AuxCh);
95  void SetNumCobo(Int_t numCobo);
96  void SetIsPadPlaneCobo(Bool_t *IsPadPlane); // Sets whether cobo belongs reads out padplane
97  // signals or scintillator signals
98 
99  void SetMap(std::shared_ptr<AtSpecMATMap> map) { fMap = map; }
100 
101  void GetFPNChannelsFromROOTFILE(Long64_t EventNr);
102  void ProcessROOTFILE(Long64_t EventNr);
103 
104  Bool_t SetWriteFile(TString filename, Int_t coboIdx = 0, Bool_t overwrite = kFALSE);
105  void WriteData();
106 
107  // getters
108  AtRawEvent *GetRawEvent(Long64_t eventID = -1);
109  Int_t GetEventID();
110  Int_t GetNumTbs(Int_t coboIdx = 0);
111  Int_t GetFPNChannel(Int_t chIdx);
112  TString GetFileName() const { return fFileName; }
113 
115 };
116 
117 #endif
AtCoreSpecMAT::AddData
Bool_t AddData(TString filename, Int_t coboIdx=0)
Definition: AtCoreSpecMAT.cxx:155
AtCoreSpecMAT::SetMap
void SetMap(std::shared_ptr< AtSpecMATMap > map)
Definition: AtCoreSpecMAT.h:99
AtRawEvent.h
AtCoreSpecMAT::ProcessROOTFILE
void ProcessROOTFILE(Long64_t EventNr)
Definition: AtCoreSpecMAT.cxx:312
AtPedestal.h
AtCoreSpecMAT::GetRawEvent
AtRawEvent * GetRawEvent(Long64_t eventID=-1)
Returns STRawEvent object filled with the data.
Definition: AtCoreSpecMAT.cxx:432
AtCoreSpecMAT::SetWriteFile
Bool_t SetWriteFile(TString filename, Int_t coboIdx=0, Bool_t overwrite=kFALSE)
Definition: AtCoreSpecMAT.cxx:410
AtCoreSpecMAT::SetIsPadPlaneCobo
void SetIsPadPlaneCobo(Bool_t *IsPadPlane)
Definition: AtCoreSpecMAT.cxx:227
AtCoreSpecMAT
Definition: AtCoreSpecMAT.h:29
AtCoreSpecMAT::GetEventID
Int_t GetEventID()
Returns the current event ID.
Definition: AtCoreSpecMAT.cxx:473
AtRawEvent
Definition: AtRawEvent.h:34
AtCoreSpecMAT::~AtCoreSpecMAT
~AtCoreSpecMAT()
Definition: AtCoreSpecMAT.cxx:52
AtCoreSpecMAT::GetNumData
Int_t GetNumData(Int_t coboIdx=0)
Definition: AtCoreSpecMAT.cxx:200
AtCoreSpecMAT::SetNumCobo
void SetNumCobo(Int_t numCobo)
Definition: AtCoreSpecMAT.cxx:505
GETDecoder2
Definition: GETDecoder2.h:38
AtCoreSpecMAT::SetPseudoTopologyFrame
void SetPseudoTopologyFrame(Int_t asadMask, Bool_t check=kFALSE)
Definition: AtCoreSpecMAT.cxx:499
AtCoreSpecMAT::SetData
Bool_t SetData(Int_t value)
Definition: AtCoreSpecMAT.cxx:168
AtCoreSpecMAT::SetFPNPedestal
void SetFPNPedestal(Double_t sigmaThreshold=5)
Definition: AtCoreSpecMAT.cxx:220
AtPedestal
Definition: AtPedestal.h:27
GETDecoder2.h
AtCoreSpecMAT::GetFPNChannel
Int_t GetFPNChannel(Int_t chIdx)
Definition: AtCoreSpecMAT.cxx:483
AtCoreSpecMAT::WriteData
void WriteData()
Definition: AtCoreSpecMAT.cxx:415
AtCoreSpecMAT::ClassDef
ClassDef(AtCoreSpecMAT, 2)
AtCoreSpecMAT::GetFPNChannelsFromROOTFILE
void GetFPNChannelsFromROOTFILE(Long64_t EventNr)
Definition: AtCoreSpecMAT.cxx:238
AtCoreSpecMAT::GetNumTbs
Int_t GetNumTbs(Int_t coboIdx=0)
Returns the number of time buckets of the data.
Definition: AtCoreSpecMAT.cxx:478
AtCoreSpecMAT::SetAuxChannel
void SetAuxChannel(std::vector< Int_t > AuxCh)
AtMap.h
AtSpecMATMap.h
AtCoreSpecMAT::AtCoreSpecMAT
AtCoreSpecMAT()
Definition: AtCoreSpecMAT.cxx:25
AtCoreSpecMAT::SetNumTbs
void SetNumTbs(Int_t value)
Definition: AtCoreSpecMAT.cxx:210
AtTpcProtoMap.h
AtCoreSpecMAT::GetDataName
TString GetDataName(Int_t index, Int_t coboIdx=0)
Definition: AtCoreSpecMAT.cxx:205
AtCoreSpecMAT::SetPositivePolarity
void SetPositivePolarity(Bool_t *value)
Definition: AtCoreSpecMAT.cxx:161
AtCoreSpecMAT::GetFileName
TString GetFileName() const
Definition: AtCoreSpecMAT.h:112
AtTpcMap.h
AtCoreSpecMAT::Initialize
void Initialize()
Definition: AtCoreSpecMAT.cxx:62