9 std::string name,
int numberChannelsInGroups,
10 bool disableAutoUpdate):
12 fHistoArray(histoArray){
16 }
else if(numberChannelsInGroups > 1)
17 fNumberChannelsInGroups = numberChannelsInGroups;
19 fNumberChannelsInGroups = -1;
22 fChannelCounterButton = 0;
24 fChannelName =
"Histogram";
28 fGroupCounterButton = 0;
34 fMultiCanvasButton = 0;
35 fNCanvasButtonGroup =0;
40 fOverlayHistoButton = 0;
45 fNHistoLegend =
new TLegend(0.6,0.6,0.89,0.8);
46 fNHistoLegend->SetFillColor(10);
48 fDisableAutoUpdate = disableAutoUpdate;
67 fLabelframe =
new TGHorizontalFrame(compFrame,200,40);
68 compFrame->AddFrame(
fLabelframe,
new TGLayoutHints(kLHintsCenterX,2,2,2,2));
74 TGVerticalFrame *hframe1 =
new TGVerticalFrame(
fLabelframe, 120, 40, kFixedWidth);
75 fLabelframe->AddFrame(hframe1,
new TGLayoutHints(kLHintsLeft,2,2,2,2));
79 TGNumberFormat::kNEANonNegative,
80 TGNumberFormat::kNELLimitMinMax,
85 fGroupCounterButton->Connect(
"ValueSet(Long_t)",
"TRootanaDisplay", display,
"UpdatePlotsAction()");
86 fGroupCounterButton->GetNumberEntry()->Connect(
"ReturnPressed()",
"TRootanaDisplay", display,
"UpdatePlotsAction()");
90 hframe1->AddFrame(
fLabelGroup,
new TGLayoutHints(kLHintsLeft , 1, 1, 1, 1));
99 TGVerticalFrame *hframe2 =
new TGVerticalFrame(
fLabelframe, 120, 40, kFixedWidth);
100 fLabelframe->AddFrame(hframe2,
new TGLayoutHints(kLHintsLeft,2,2,2,2));
106 TGNumberFormat::kNEANonNegative,
107 TGNumberFormat::kNELLimitMinMax,
108 0, numberChannels-1);
112 fChannelCounterButton->Connect(
"ValueSet(Long_t)",
"TRootanaDisplay", display,
"UpdatePlotsAction()");
113 fChannelCounterButton->GetNumberEntry()->Connect(
"ReturnPressed()",
"TRootanaDisplay", display,
"UpdatePlotsAction()");
117 hframe2->AddFrame(
fLabelChannels,
new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
126 fMultiCanvasButton->Connect(
"Toggled(Bool_t)",
"TFancyHistogramCanvas",
this,
"ActivateMultiCanvasButton()");
127 fMultiCanvasButton->Connect(
"Toggled(Bool_t)",
"TRootanaDisplay", display,
"UpdatePlotsAction()");
136 for(
int i = 0; i < 4; i++)
151 fOverlayHistoButton->Connect(
"Toggled(Bool_t)",
"TFancyHistogramCanvas",
this,
"ActivateOverlayButton()");
152 fOverlayHistoButton->Connect(
"Toggled(Bool_t)",
"TRootanaDisplay", display,
"UpdatePlotsAction()");
157 TGVerticalFrame *hframe3 =
new TGVerticalFrame(
fLabelframe, 120, 40, kFixedWidth);
158 fLabelframe->AddFrame(hframe3,
new TGLayoutHints(kLHintsLeft,2,2,2,2));
160 fNHistoButton =
new TGNumberEntry(hframe3, 2, 9,999, TGNumberFormat::kNESInteger,
161 TGNumberFormat::kNEANonNegative,
162 TGNumberFormat::kNELLimitMinMax,
164 hframe3->AddFrame(
fNHistoButton,
new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
166 fNHistoButton->Connect(
"ValueSet(Long_t)",
"TRootanaDisplay", display,
"UpdatePlotsAction()");
167 fNHistoButton->GetNumberEntry()->Connect(
"ReturnPressed()",
"TRootanaDisplay", display,
"UpdatePlotsAction()");
170 labelNHisto =
new TGLabel(hframe3,
"# Histo in Canvas");
171 hframe3->AddFrame(
labelNHisto,
new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
210 TCanvas* c1 = embedCanvas->GetCanvas();
241 for(
int i = 0; i < ncanvas; i++){
243 int index = i + channel;
246 (*fHistoArray)[index]->SetLineColor(1);
252 int nhisto =
fNHistoButton->GetNumberEntry()->GetIntNumber();
256 int first_channel = channel;
257 int last_channel = channel + nhisto;
263 for(
int ichan = first_channel; ichan < last_channel; ichan++){
265 max_histo = (*fHistoArray)[ichan];
266 else if((*
fHistoArray)[ichan]->GetMaximum() > max_histo->GetMaximum())
267 max_histo = (*fHistoArray)[ichan];
276 for(
int ichan = first_channel; ichan < last_channel; ichan++){
278 (*fHistoArray)[ichan]->SetLineColor(ichan-channel+1);
279 sprintf(name,
"Histogram # %i",ichan);
296 (*fHistoArray)[channel]->SetLineColor(1);