Skip to content

Commit 6955884

Browse files
Copilotsimonge
andcommitted
Update beamlineAnalysis.C to also support arbitrary shape overlays
Co-authored-by: simonge <[email protected]>
1 parent b92f182 commit 6955884

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

benchmarks/beamline/beamlineAnalysis.C

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ int beamlineAnalysis( TString inFile = "/home/simong/EIC/detector_ben
178178
std::map<TString,double> pipeZPos;
179179
std::map<TString,double> pipeRotation;
180180
std::map<TString,bool> pipeIsConeSegment;
181+
std::map<TString,volParams> pipeParams;
181182

182183
// Queue up all actions
183184
auto xmin_ptr = d1.Min("xpos");
@@ -210,6 +211,7 @@ int beamlineAnalysis( TString inFile = "/home/simong/EIC/detector_ben
210211
.Define("ymomf","ymom[pipeID=="+std::to_string(i)+"]")
211212
.Define("pipeRadiusf","pipeRadius[pipeID=="+std::to_string(i)+"]")
212213
.Define("isConeSegmentf","isConeSegment[pipeID=="+std::to_string(i)+"]")
214+
.Define("pipeParametersf","pipeParameters[pipeID=="+std::to_string(i)+"]")
213215
.Define("xdetf","xdet[pipeID=="+std::to_string(i)+"]")
214216
.Define("zdetf","zdet[pipeID=="+std::to_string(i)+"]")
215217
.Define("rotationf","rotation[pipeID=="+std::to_string(i)+"]");
@@ -283,6 +285,7 @@ int beamlineAnalysis( TString inFile = "/home/simong/EIC/detector_ben
283285
pipeZPos[name] = filterDF.Max("zdetf").GetValue();
284286
pipeRotation[name] = filterDF.Max("rotationf").GetValue();
285287
pipeIsConeSegment[name] = filterDF.Max("isConeSegmentf").GetValue();
288+
pipeParams[name] = filterDF.Max("pipeParametersf").GetValue();
286289

287290
//Fit gaussian to the x, y, px and py distributions
288291
auto xhist = hHistsxy[name]->ProjectionX();
@@ -343,6 +346,9 @@ int beamlineAnalysis( TString inFile = "/home/simong/EIC/detector_ben
343346
circle->SetLineWidth(2);
344347
circle->SetFillStyle(0);
345348
circle->Draw("same");
349+
} else if (!pipeParams[name].shapeOutline.empty()) {
350+
// Draw arbitrary shape outline for non-cone segments
351+
drawShapeOutline(pipeParams[name].shapeOutline, kRed, 2);
346352
}
347353

348354
// Add zoomed version in the top-right corner

0 commit comments

Comments
 (0)