BmnRoot
Loading...
Searching...
No Matches
BmnHistNdet.h
Go to the documentation of this file.
1#ifndef BMNHISTNdet_H
2#define BMNHISTNdet_H 1
3
4#include "BmnHist.h"
5#include "BmnNdetDigi.h"
6#include "BmnNdetGeo.h"
7#include "TCanvas.h"
8#include "TChain.h"
9#include "TClonesArray.h"
10#include "TColor.h"
11#include "TFile.h"
12#include "TFolder.h"
13#include "TH1F.h"
14#include "TH2F.h"
15#include "THttpServer.h"
16#include "TString.h"
17
18#include <TNamed.h>
19#define Ndet_ROWS 1
20#define Ndet_COLS 2
21
22class BmnHistNdet : public BmnHist
23{
24 public:
25 BmnHistNdet(TString title = "Ndet", TString path = "", Int_t periodID = 8, BmnSetup setup = kBMNSETUP);
26 virtual ~BmnHistNdet();
28 void Reset();
29 void Register(THttpServer* serv);
30 void SetDir(TFile* outFile, TTree* recoTree);
31 void DrawBoth();
33 void FillFromDigi(DigiArrays* fDigiArrays);
35 void SetSelection(Int_t Cell, Int_t Layer, Int_t Trigger);
36 void SetGeometry(const std::string& path);
37
38 private:
39 static constexpr int kTOTAL_CELLS = 9; // Ndet Prototype 2022. Cells numerated from 1 to 9 inclusive
40 static constexpr int kTOTAL_COLS = 3; // Ndet Prototype 2022. Cols numerated from 1 to 3 inclusive
41 static constexpr int kTOTAL_ROWS = 3; // Ndet Prototype 2022. Rows numerated from 1 to 3 inclusive
42 static constexpr int kTOTAL_LAYRS = 16; // Ndet Prototype 2022. Layers numerated from 1 to 15 inclusive
43 static constexpr int kEM_LAYRS = 6; // Ndet Prototype 2022. Layers numerated from 1 to 6 inclusive
44 static constexpr int kHAD_LAYRS = 9; // Ndet Prototype 2022. Layers numerated from 1 to 6 inclusive
45 static constexpr int kTQDC_MAX_CHAN = 16; // Ndet Prototype 2022. Mx tqdc channels
46 static constexpr int kTQDC_MAX_MODULES = 9; // Ndet Prototype 2022. Mx tqdc modules
47 std::vector<unsigned int> MapCell2Ch = {0, 3, 6, 9, 2, 5, 8, 1, 4, 7}; // cells numerated from 1 to 9 inclusive
48
49 long int fEventCounter = 1;
50 float nEn;
51 float timemin;
52 BmnNdetGeo* fGeoHandler; // stores map with detector address to 3D position and error
53 Int_t fSelectedCell;
54 Int_t fSelectedLayer;
55 Int_t fSelectedTrigger;
56
57 TH1F* h1d_ECells;
58 TH2F* h2_grid;
59 TH1F* h1d_ProfileSlice; // profile over slices of detector (sum over cells in current layer)
60 TH1F* h1d_timemin; // minimum timestamp in event
61 TH1F* hChE; // amplitude in selected channel
62 TH1F* wfmCh; // waveform in selected channel
63 TH2F* h2_Layer_Cell;
64 TH2F* h2_hits;
65 TH2F* h2_mean_amp;
66 TH1F* h1_Cells;
67 TH1F* h1_CellsAmpl;
68 TH1F* h1_CellsTime;
69 TH2F* h2_lrampl;
70 TH2F* h2_lrtime;
71
72 TCanvas* canAmps;
73 TCanvas* canv_hProfCell;
74 TCanvas* canv_Slice;
75 TCanvas* canv_Cells;
76 TCanvas* canSelect;
77 TCanvas* canv_Ampl;
78 TCanvas* canv_Time;
79 TCanvas* canv_hAmplCell;
80 TCanvas* canv_hCellAmpEM;
81 TCanvas* canv_hCellAmpH;
82 TCanvas* canv_hCellTimeEM;
83 TCanvas* canv_hCellTimeH;
84 TCanvas* canv_hits;
85 vector<PadInfo*> canAmpsPads;
86 vector<PadInfo*> canv_hProfCellPads;
87 vector<PadInfo*> canv_SlicePads;
88 vector<PadInfo*> canv_CellsPads;
89 vector<PadInfo*> canv_hitsPads;
90 vector<PadInfo*> canSelectPads;
91 vector<PadInfo*> canv_AmplPads;
92 vector<PadInfo*> canv_TimePads;
93 vector<PadInfo*> canv_hAmplCellPads;
94 vector<PadInfo*> canv_hCellAmpEMPads;
95 vector<PadInfo*> canv_hCellAmpHPads;
96 vector<PadInfo*> canv_hCellTimeEMPads;
97 vector<PadInfo*> canv_hCellTimeHPads;
98 vector<TString> NamesAmps;
99 vector<TString> NamesProfs;
100 vector<TString> NamesSlice;
101 vector<TString> NamesCells;
102 vector<TString> NamesSelect;
103 vector<TString> NamesAmpl;
104 vector<TString> NamesTime;
105 vector<TString> NamesAmplCell;
106 vector<TString> NamesCellAmpEM;
107 vector<TString> NamesCellAmpH;
108 vector<TString> NamesCellTimeEM;
109 vector<TString> NamesCellTimeH;
110 vector<TString> NamesHits;
111
112 std::vector<TH1*> hProfCell =
113 std::vector<TH1*>(kTOTAL_CELLS + 1, nullptr); // Cells numerated from 1 to 9 inclusive
114 std::vector<TH1*> hCellAmpEM =
115 std::vector<TH1*>(kEM_LAYRS * kTOTAL_CELLS + 1, nullptr); // Cells numerated for EM channels
116 std::vector<TH1*> hCellAmpH =
117 std::vector<TH1*>(kHAD_LAYRS * kTOTAL_CELLS + 1, nullptr); // Cells numerated for Hadron channels
118 std::vector<TH1*> hCellTimeEM = std::vector<TH1*>(kEM_LAYRS * kTOTAL_CELLS + 1, nullptr);
119 std::vector<TH1*> hCellTimeH = std::vector<TH1*>(kHAD_LAYRS * kTOTAL_CELLS + 1, nullptr);
120 std::array<float, kTOTAL_CELLS * kTOTAL_LAYRS + 1> meanamp; // Cells numerated for all channels
121 std::array<std::array<float, kTQDC_MAX_CHAN + 1>, kTQDC_MAX_MODULES + 1>
122 meanamp_test; // Cells numerated for all channels
123 std::array<float, kTOTAL_CELLS * kTOTAL_LAYRS + 1> meantime;
124 std::array<float, kTOTAL_CELLS * kTOTAL_LAYRS + 1> ch_entries;
125 std::array<std::array<int, kTQDC_MAX_CHAN + 1>, kTQDC_MAX_MODULES + 1> ch_entries_test;
126
127 ClassDef(BmnHistNdet, 2)
128};
129
130#endif /* BMNHISTNdet_H */
BmnStatus
Definition BmnEnums.h:24
BmnSetup
Definition BmnEnums.h:89
@ kBMNSETUP
Definition BmnEnums.h:90
void DrawBoth()
void SetGeometry(const std::string &path)
void Reset()
BmnHistNdet(TString title="Ndet", TString path="", Int_t periodID=8, BmnSetup setup=kBMNSETUP)
void SetDir(TFile *outFile, TTree *recoTree)
void FillFromDigi(DigiArrays *fDigiArrays)
void CreateHistos()
virtual ~BmnHistNdet()
void Register(THttpServer *serv)
BmnStatus SetRefRun(Int_t id)
void SetSelection(Int_t Cell, Int_t Layer, Int_t Trigger)
void ClearRefRun()
Definition setup.py:1