BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnHistTrigger.h
Go to the documentation of this file.
1/*
2 * File: BmnHistTrigger.h
3 * Author: ilnur
4 *
5 * Created on November 27, 2016, 4:18 PM
6 */
7
8#ifndef BMNHISTTRIGGER_H
9#define BMNHISTTRIGGER_H 1
10#include "BmnEventHeader.h"
11#include "BmnHist.h"
12#include "BmnRawDataDecoder.h"
13#include "BmnTrigDigit.h"
14#include "BmnTrigRaw2Digit.h"
15#include "BmnTrigWaveDigit.h"
16#include "TCanvas.h"
17#include "TChain.h"
18#include "TClonesArray.h"
19#include "TFile.h"
20#include "TH1D.h"
21#include "TH1F.h"
22#include "TH2F.h"
23#include "THttpServer.h"
24
25#include <TNamed.h>
26#include <algorithm>
27#include <exception>
28#include <memory>
29#include <regex>
30#include <stdlib.h>
31#include <vector>
32#define TRIG_TIME_WIN 6000
33#define TRIG_TIME_BEAM 2000
34#define TRIG_TIME_BINS 300
35#define TRIG_AMP_BINS 100
36#define TRIG_AMP_BINS_BD 25
37#define SCALER_TIME_WIN 5.5
38#define SCALER_TIME_BINS 1000
39#define AMP_WIN 3000
40#define TRIG_MULTIPL 40
41#define BD_CHANNELS 40
42#define SI_CHANNELS 64
43#define ND_CHANNELS 4
44#define TRIG_ROWS 3
45#define TRIG_COLS 3
46#define LIN_LOG_COLS 2
47
53
54class BmnHistTrigger : public BmnHist
55{
56 public:
57 BmnHistTrigger(TString title = "Triggers",
58 TString path = "",
59 Int_t periodID = 9,
60 BmnSetup = kBMNSETUP,
61 BmnTrigRaw2Digit* trigMapper = nullptr);
62 virtual ~BmnHistTrigger();
63
64 void Register(THttpServer* serv);
65 void SetDir(TFile* outFile, TTree* recoTree);
66 void FillFromDigi(DigiArrays* fDigiArrays);
67 void Reset();
68 void DrawBoth();
69 void ClearRefRun();
71
72 void SetBDChannel(Int_t iSelChannel);
73
75
76 private:
77 void InitHistsFromArr(vector<TClonesArray*>* trigAr);
78 void InitGrids();
79 void InitTrigMasked();
80 void InitScalers();
81 void SetDir(TDirectory* Dir);
82 const Int_t MaxTimeTDC = 6000;
83 const Int_t MaxAmpTDC = 50;
84 const Int_t MaxAmpTDC_BD = 25;
85 const Int_t MaxTimeTQDC = 600;
86 const Int_t MaxAmpTQDC = 15000;
87 const Int_t MaxAmpTQDC_Corr = 10000;
88 const Int_t MaxAmpTQDC_Beam = 35000;
89 const Int_t MaxAmpTQDC_BC2 = 15000;
90 const Int_t MaxAmpTQDC_Unit = 60000;
91 const Int_t MaxAmpTQDC_x10 = 33000;
92 const vector<string> ScalerNames{"BC1L_Busy", "pBT_Busy", "BT_Busy", "NiT_Busy",
93 "CCT1_Busy", "MBT_Busy", "BT&nBUSY_Busy", "CCT2_Busy"};
94 const vector<TrigStateDesc> TrigState{{"BT", kCyan}, {"MBT", kGreen + 1}, {"nFD", kRed}};
95 // const vector<TrigStateDesc> TrigState{{"BT", kCyan}, {"MBT", kGreen + 1}, {"CCT1", kRed}, {"CCT2", kBlue}};
96 vector<uint16_t> trig_state_bit_index;
100 vector<TString> trigNames;
101 vector<TString> shortNames;
112
113 const vector<pair<string, string>> TrigNameCorrTQDC{{"BC1T", "BC1B"}, {"BC2T", "BC2B"}, {"VCT", "VCB"},
114 {"BC1", "BC2"}, {"VC", "BC2"}, {"FD", "BC2"}};
115 vector<double> storeAmpTQDC; // store the TQDC amp in each event to use for correlation
116 vector<pair<uint32_t, uint32_t>> idxCorrTQDC; // indices in the store amp vector
117 vector<TH2I*> histCorrTQDC;
118
124 UInt_t indexBD;
125 unique_ptr<TCanvas> canGridBD;
126 unique_ptr<TCanvas> canGridND;
127 unique_ptr<TCanvas> canTrigStates;
128 unique_ptr<TCanvas> canCorrTQDC;
129 unique_ptr<TCanvas> canScalers;
130 map<string, UInt_t> mapArrayNames;
131 map<UInt_t, PadInfo*> mapGridND;
132 map<UInt_t, PadInfo*> mapAmpLin;
133 map<UInt_t, PadInfo*> mapAmpLog;
134 map<UInt_t, PadInfo*> mapTBLin;
135 map<UInt_t, PadInfo*> mapTBLog;
136 map<UInt_t, TH1*> mapTime;
137 vector<TH1*> histsGridBD;
138 vector<TH1*> hists;
139 vector<vector<TH1*>> histsAux;
140 vector<PadInfo*> padsGridBD;
141 vector<PadInfo*> padsGridND;
142 vector<PadInfo*> padsTrigStates;
143 vector<PadInfo*> padsCorrTQDC;
144 vector<PadInfo*> padsScalers;
145 vector<PadInfo*> canProfilePads;
146 vector<PadInfo*> canTimesPads;
147 vector<PadInfo*> can2dPads;
148 vector<PadInfo*> padsCanAmp;
150 // scaler auxillary data
151 vector<pair<uint16_t, PadInfo*>> fill_scaler_vec_profile;
152 vector<pair<uint16_t, PadInfo*>> fill_scaler_vec_spill;
155
157};
158
159#endif /* BMNHISTTRIGGER_H */
int Int_t
short Color_t
#define ClassDef(name, id)
kRed
kGreen
kCyan
BmnStatus
Define status code.
Definition BmnEnums.h:93
@ kBMNSETUP
Definition BmnEnums.h:166
const vector< TrigStateDesc > TrigState
vector< TString > shortNames
vector< TH1 * > histsGridBD
const Int_t MaxAmpTQDC_Beam
virtual ~BmnHistTrigger()
map< UInt_t, PadInfo * > mapTBLog
vector< PadInfo * > padsCanAmp
const Int_t MaxAmpTQDC_Corr
vector< PadInfo * > padsGridBD
vector< PadInfo * > can2dPads
map< UInt_t, PadInfo * > mapGridND
void SetDir(TFile *outFile, TTree *recoTree)
vector< TH2I * > histCorrTQDC
void InitHistsFromArr(vector< TClonesArray * > *trigAr)
vector< TH1 * > hists
vector< TString > trigNames
void SetBDChannel(Int_t iSelChannel)
map< string, UInt_t > mapArrayNames
vector< PadInfo * > padsCorrTQDC
const Int_t MaxAmpTDC
map< UInt_t, TH1 * > mapTime
BmnTrigRaw2Digit * fTrigMapper
unique_ptr< TCanvas > canTrigStates
TCanvas * canProfile
const Int_t MaxAmpTDC_BD
vector< vector< TH1 * > > histsAux
const Int_t MaxAmpTQDC_BC2
vector< pair< uint16_t, PadInfo * > > fill_scaler_vec_profile
const Int_t MaxTimeTDC
TTimeStamp fLastSpillStartTS
const vector< string > ScalerNames
vector< PadInfo * > padsGridND
void FillFromDigi(DigiArrays *fDigiArrays)
vector< PadInfo * > canTimesPads
vector< pair< uint16_t, PadInfo * > > fill_scaler_vec_spill
vector< pair< uint32_t, uint32_t > > idxCorrTQDC
void Register(THttpServer *serv)
const Int_t MaxAmpTQDC_Unit
unique_ptr< TCanvas > canGridND
vector< PadInfo * > padsScalers
unique_ptr< TCanvas > canGridBD
BmnHistTrigger(TString title="Triggers", TString path="", Int_t periodID=9, BmnSetup=kBMNSETUP, BmnTrigRaw2Digit *trigMapper=nullptr)
TH2I * histBDAmpByChannel
vector< uint16_t > trig_state_bit_index
map< UInt_t, PadInfo * > mapTBLin
BmnStatus SetRefRun(Int_t id)
vector< PadInfo * > canProfilePads
unique_ptr< TCanvas > canCorrTQDC
unique_ptr< TCanvas > canScalers
const Int_t MaxAmpTQDC_x10
vector< PadInfo * > padsTrigStates
map< UInt_t, PadInfo * > mapAmpLin
const Int_t MaxAmpTQDC
vector< double > storeAmpTQDC
const vector< pair< string, string > > TrigNameCorrTQDC
map< UInt_t, PadInfo * > mapAmpLog
const Int_t MaxTimeTQDC
BmnHist(Int_t periodID=7, BmnSetup setup=kBMNSETUP)
Definition BmnHist.cxx:3