I am use three iff statements in a script. But when I run this script it will fill my histograms for a full loop. All histograms become equal. Kindly help me to resolve this issue.
I am attaching a part of my script.
given his loops is running [0, 3), this else if (mu3==2) was equivalent to original else { (oh, he had something else where - else () { …). and the missing ‘}’ I guess explained by “a part of my script”.
to the OP - your code is doing what you’ve asked for. and please, ask basic C/C++ questions elsewhere, this is a ROOT specific forum. your code is similar to this:
int a, b, c;
for (int i = 0; i < 3; ++i)
{
if (i == 0) a = 1;
else if (i == 1) b = 1;
else c = 1;
}