54 for (
int i = 0; i < 8; i++) {
59 CreateRawHistograms(5000, 1., 5001.);
62 fCr1Ch1x2 = MakeTH2(
'I',
"Cr1Ch1x2",
"Crate 1 channel 1x2", 200, 1., 5001., 200, 1., 5001.);
63 fHis1 = MakeTH1(
'I',
"His1",
"Condition histogram", 5000, 1., 5001.);
64 fHis2 = MakeTH1(
'I',
"His2",
"Condition histogram", 5000, 1., 5001.);
65 fHis1gate = MakeTH1(
'I',
"His1g",
"Gated histogram", 5000, 1., 5001.);
66 fHis2gate = MakeTH1(
'I',
"His2g",
"Gated histogram", 5000, 1., 5001.);
69 fWinCon1 = MakeWinCond(
"wincon1", 50, 2000);
70 fWinCon2 = MakeWinCond(
"wincon2", 50, 70, 90, 120);
71 fconHis1 = MakeWinCond(
"cHis1", 100, 2000,
"His1");
72 fconHis2 = MakeWinCond(
"cHis2", 100, 2000,
"His2");
74 Double_t cutpnts[3][2] = { {400, 800}, {700, 900}, {600, 1100} };
75 fPolyCon1 = MakePolyCond(
"polycon", 3, cutpnts);
80 fConArr1->SetValues(100,500);
81 fConArr1->Disable(
true);
82 ((*fConArr1)[0])->SetValues(200,400);
83 ((*fConArr1)[1])->SetValues(700,1000);
84 ((*fConArr1)[2])->SetValues(1500,2000);
85 fConArr1->SetHistogram(
"Sum3");
86 AddAnalysisCondition(fConArr1);
88 fConArr1->ResetCounts();
95 Double_t xvalues[4] = { 1000, 2000, 1500, 1000 };
96 Double_t yvalues[4] = { 1000, 1000, 3000, 1000 };
97 TCutG *mycut =
new TCutG(
"cut2", 4, xvalues, yvalues);
99 fConArr2->SetValues(mycut);
100 fConArr2->Disable(
true);
102 AddAnalysisCondition(fConArr2);
105 fConArr2->ResetCounts();
110 fWinCon2->Disable(
true);
111 fWinCon2->Invert(kTRUE);
112 fWinCon1->PrintCondition(
true);
113 fconHis1->PrintCondition(
true);
114 fconHis2->PrintCondition(
true);
116 fPolyCon1->PrintCondition(
true);
117 ((*fConArr2)[0])->Enable();
118 ((*fConArr2)[1])->Enable();
120 fcondSet = GetPicture(
"condSet");
124 fcondSet =
new TGo4Picture(
"condSet",
"Set conditions");
125 fcondSet->SetDivision(2,2);
126 fcondSet->Pic(0,0)->AddObject(fHis1);
127 fcondSet->Pic(0,1)->AddObject(fHis2);
128 fcondSet->Pic(0,0)->AddCondition(fconHis1);
129 fcondSet->Pic(0,1)->AddCondition(fconHis2);
130 fcondSet->Pic(1,0)->AddObject(fHis1gate);
131 fcondSet->Pic(1,1)->AddObject(fHis2gate);
132 fcondSet->Pic(1,0)->SetFillAtt(4, 1001);
133 fcondSet->Pic(1,0)->SetLineAtt(4,1,1);
134 fcondSet->Pic(1,1)->SetFillAtt(9, 1001);
135 fcondSet->Pic(1,1)->SetLineAtt(9,1,1);
136 fcondSet->Pic(0,0)->SetTitleAttr(0.05, 0.85, 0.8, 0.95);
137 AddPicture(fcondSet);
140 fPicture1 = GetPicture(
"Picture1");
142 fPicture1 =
new TGo4Picture(
"Picture1",
"Picture example");
143 fPicture1->SetLinesDivision(3, 2,3,1);
144 fPicture1->LPic(0,0)->AddObject(fCr1Ch[0]);
145 fPicture1->LPic(0,0)->SetFillAtt(5, 3001);
146 fPicture1->LPic(0,0)->SetLineAtt(5,1,1);
147 fPicture1->LPic(0,1)->AddObject(fCr1Ch[1]);
148 fPicture1->LPic(0,1)->SetFillAtt(4, 3001);
149 fPicture1->LPic(0,1)->SetLineAtt(4,1,1);
150 fPicture1->LPic(1,0)->AddObject(fCr1Ch[2]);
151 fPicture1->LPic(1,0)->SetFillAtt(6, 1001);
152 fPicture1->LPic(1,0)->SetLineAtt(6,1,1);
153 fPicture1->LPic(1,1)->AddObject(fCr1Ch[3]);
154 fPicture1->LPic(1,1)->SetFillAtt(7, 1001);
155 fPicture1->LPic(1,1)->SetLineAtt(7,1,1);
156 fPicture1->LPic(1,2)->AddObject(fCr1Ch[4]);
157 fPicture1->LPic(3,0)->AddObject(fCr1Ch1x2);
158 fPicture1->LPic(3,0)->SetDrawOption(
"CONT");
159 fPicture1->LPic(3,0)->AddSpecialObject(
new TArrow(3500., 3500, 2000., 1500., 0.02));
160 fPicture1->LPic(3,0)->AddSpecialObject(
new TLatex(1500, 3500,
"Example of text label in the picture"));
162 AddPicture(fPicture1);
175 for (
int i = 0; i < 8; i++) {
187 TString hname = TString::Format(
"Crate1/Cr1Ch%02d", i + 1);
188 TString htitle = TString::Format(
"Crate 1 channel %2d", i + 1);
189 fCr1Ch[i] =
MakeTH1(
'I', hname.Data(), htitle.Data(), nbins, xmin, xmax);
190 hname = TString::Format(
"Crate2/Cr2Ch%02d", i + 1);
191 htitle = TString::Format(
"Crate 2 channel %2d", i + 1);
192 fCr2Ch[i] =
MakeTH1(
'I', hname.Data(), htitle.Data(), nbins, xmin, xmax);
215 Long_t loop = (
fEvCount / 1000000) % 5;
262 inp_evt->ResetIterator();
263 while (
auto psubevt = inp_evt->NextSubEvent())
265 Int_t *pdata = psubevt->GetDataField();
266 Int_t lwords = psubevt->GetIntLen();
267 Int_t subcrate=psubevt->GetSubcrate();
270 TGo4Log::Info(
"XXXUnpackProc: skip invalid subcrate %d", subcrate);
274 if(lwords >= 8) lwords=8;
276 for(Int_t i = 0; i<lwords; ++i)
283 TXXXUnpackEvent& ev=*out_evt;
284 TXXXModule* mod=
dynamic_cast<TXXXModule*
>(&ev[subcrate][i]);
296 TGo4Log::Info(
"XXXUnpackProc: WARNING: no output event module for crate %d, channel %d", subcrate, i);
304 fCr1Ch[i]->Fill((Float_t)(*pdata));
308 if(
fconHis1->Test((Double_t)*pdata))
310 fHis1->Fill((Float_t)(*pdata));
315 fHis2->Fill((Float_t)(*pdata));
317 if(
fPolyCon1->Test(*pdata,lastvalue))
fCr1Ch1x2->Fill((Float_t)(*pdata),(Float_t)lastvalue);
318 if(((*
fConArr2)[0])->Test(*pdata,lastvalue))
fCr1Ch1x2->Fill((Float_t)(*pdata),(Float_t)lastvalue);
319 if(((*
fConArr2)[1])->Test(*pdata,lastvalue))
fCr1Ch1x2->Fill((Float_t)(*pdata),(Float_t)lastvalue);
323 else if ( subcrate == 2)
325 fCr2Ch[i]->Fill((Float_t)(*pdata));
331 out_evt->SetValid(kTRUE);
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Abstract event processor.
TH1 * MakeTH1(char type, const char *fullname, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *xtitle=nullptr, const char *ytitle=nullptr)
Create one dimensional histogram of specified type.
TGo4Parameter * GetParameter(const char *name, const char *par_class=nullptr)
Get parameter from go4 framework.
TGo4EventElement * GetInputEvent()
Access to external raw event which is set as association member.
Bool_t RemoveHistogram(const char *name)
UnRegister histogram from go4 framework and delete it.
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
static void Error(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 3.
Wrapper for the standard gsi event structure as delivered from mbs.
Picture cconfiguration in Go4.
void SetCalibSpectrum(TH1 *h1)
Reset reference to calibration spectrum in fitter.
Bool_t BuildEvent(TGo4EventElement *dest) override
Fill the destination event dest.
TH1 * fCr1Ch[XXX_NUM_CHAN]
void CreateRawHistograms(int nbins, double xmin, double xmax)
TH1 * fCr2Ch[XXX_NUM_CHAN]
virtual ~TXXXUnpackProc()