本文整理汇总了C++中TLine::SetBit方法的典型用法代码示例。如果您正苦于以下问题:C++ TLine::SetBit方法的具体用法?C++ TLine::SetBit怎么用?C++ TLine::SetBit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLine
的用法示例。
在下文中一共展示了TLine::SetBit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddAnalysisMarkers
void RangePlotter::AddAnalysisMarkers(int a_iPanelIndex, SignalAnalyzer::AnalysisMarkers& a_analysisMarkers)
{
m_pCanvas->cd(a_iPanelIndex + 1);
// printf("pulse threshold: %f\n", a_analysisMarkers.GetPulseThreshold().Continuous());
TLine* pulseThresholdLine = new TLine(0, a_analysisMarkers.GetPulseThreshold().Continuous(), m_vpMultiGraph[a_iPanelIndex]->GetXaxis()->GetXmax(), a_analysisMarkers.GetPulseThreshold().Continuous());
pulseThresholdLine->SetLineStyle(2);
pulseThresholdLine->SetBit(kCanDelete);
// printf("edge threshold: %f\n", a_analysisMarkers.GetEdgeThreshold().Continuous());
TLine* edgeThresholdLine = new TLine(0, a_analysisMarkers.GetEdgeThreshold().Continuous(), m_vpMultiGraph[a_iPanelIndex]->GetXaxis()->GetXmax(), a_analysisMarkers.GetEdgeThreshold().Continuous());
edgeThresholdLine->SetLineStyle(2);
edgeThresholdLine->SetBit(kCanDelete);
/* int i = 0;
for (auto& it: a_analysisMarkers.m_vChannelsEdgeAndMinimum)
{
int color = ((TGraph*) m_vpMultiGraph[a_iPanelIndex]->GetListOfGraphs()->At(i))->GetLineColor();
float fYMin = m_vpMultiGraph[a_iPanelIndex]->GetYaxis()->GetXmin();
float fYMax = m_vpMultiGraph[a_iPanelIndex]->GetYaxis()->GetXmax();
if (std::get<EDGE_THRES_INDEX>(it).Exists())
{
TMarker* markerMin = new TMarker(std::get<MIN_PULSE_INDEX>(it).GetX(), std::get<MIN_PULSE_INDEX>(it).GetY(), 22);
markerMin->SetMarkerColor(color);
markerMin->SetMarkerSize(2);
markerMin->Draw();
TBox* pulseWindow = new TBox(std::get<EDGE_THRES_INDEX>(it).GetX(), fYMin, std::get<EDGE_THRES_INDEX>(it).GetX() + a_analysisMarkers.GetExpectedPulseWidth().Continuous(), fYMax);
pulseWindow->SetFillColor(color);
pulseWindow->SetFillStyle(3004);
pulseWindow->Draw();
}
i++;
}
*/
if (Configuration::Instance().TagPrimaryPulseStep())
{
for (auto& it: a_analysisMarkers.m_vChannelsWithPulse)
{
m_vpGraph[it]->SetLineWidth(3);
}
}
if (Configuration::Instance().ShowEdgeThresholdMarkerStep())
{
pulseThresholdLine->Draw();
}
if (Configuration::Instance().ShowPulseThresholdMarkerStep())
{
edgeThresholdLine->Draw();
}
m_pCanvas->Update();
}
示例2: drawResult
void HistoData::drawResult(TH1 *Summary, bool Vertical, bool SetBinLabel) {
// add label to the summary if desired
if (SetBinLabel) {
Summary->GetXaxis()->SetBinLabel(bin,getRefHisto()->GetTitle());
//Summary->GetXaxis()->SetBinLabel(bin,name.c_str());
}
else
Summary->GetXaxis()->SetBinLabel(bin,name.c_str());
double minimum = Summary->GetMinimum();
// determine where to draw the result (score axis)
// 1: solid bar starts
// 2: solid bar ends, hatched bar starts
// 3: hatched bar ends
double score1 = minimum;
double score2 = (lowScore == 10. || lowScore < minimum) ? minimum : lowScore;
double score3 = (lowScore == 10.) ? 1 : ((highScore < minimum) ? minimum : highScore);
// determine where to draw the result (binning axis)
double binCenter = Summary->GetBinCenter(bin);
double binWidth = Summary->GetBinWidth(bin);
double bin1 = binCenter - binWidth / 3;
double bin2 = binCenter + binWidth / 3;
// set coordinates of display based on plot alignment
double solidX1, solidY1, solidX2, solidY2;
double hatchedX1, hatchedY1, hatchedX2, hatchedY2;
double axisX1, axisY1, axisX2, axisY2;
if (Vertical) {
solidX1 = bin1; solidX2 = bin2;
solidY1 = score1; solidY2 = score2;
hatchedX1 = bin1; hatchedX2 = bin2;
hatchedY1 = score2; hatchedY2 = score3;
axisX1 = bin1; axisX2 = bin2;
axisY1 = minimum; axisY2 = minimum;
} else {
solidX1 = score1; solidX2 = score2;
solidY1 = bin1; solidY2 = bin2;
hatchedX1 = score2; hatchedX2 = score3;
hatchedY1 = bin1; hatchedY2 = bin2;
axisX1 = minimum; axisX2 = minimum;
axisY1 = bin1; axisY2 = bin2;
}
// a solid bar is drawn from zero to the lowest score
if (lowScore > minimum && lowScore != 10.) {
TPave *solidBar = new TPave(solidX1,solidY1,solidX2,solidY2,1,"");
solidBar->SetBit(kCanDelete);
solidBar->SetLineColor(lineUseFillColor ? solidFillColor : solidLineColor);
solidBar->SetFillColor(solidFillColor);
solidBar->SetFillStyle(solidFillStyle);
solidBar->Draw();
}
// a hatched bar is drawn from the lowest score to the highest score
if ((lowScore != highScore && highScore > minimum) || lowScore == 10.) {
TPave *hatchedBar = new TPave(hatchedX1,hatchedY1,hatchedX2,hatchedY2,1,"");
hatchedBar->SetBit(kCanDelete);
hatchedBar->SetLineColor(lineUseFillColor ? shadedFillColor : shadedLineColor);
hatchedBar->SetFillColor(shadedFillColor);
hatchedBar->SetFillStyle(3004);
hatchedBar->Draw();
}
// paste a line over the base axis to fix border color artifacts
TLine *axisLine = new TLine(axisX1,axisY1,axisX2,axisY2);
if (Vertical) axisLine->SetLineColor(Summary->GetAxisColor("X"));
else axisLine->SetLineColor(Summary->GetAxisColor("Y"));
axisLine->SetBit(kCanDelete);
axisLine->Draw("SAME");
//paste a line before (in this proceeding that means after) Barrel and Endcap Plots
if ( name == "ERPt" || name == "BRPt" ) {
axisY1=axisY2=binCenter+binWidth/2;
axisX2=Summary->GetMaximum();
axisX1=Summary->GetMinimum()-200;
TLine *regionLine = new TLine(axisX1,axisY1,axisX2,axisY2);
regionLine->SetLineColor(Summary->GetAxisColor("X"));
regionLine->SetBit(kCanDelete);
regionLine->SetLineWidth(3);
regionLine->Draw();
}
}