Closed dmalexan closed 10 years ago
According to Wikipedia this is a SIGSEGV, or a segmentation fault. If you are processing a run that has an active CAEN channel (BU or UH) with no hits, this is coming from here. Examples of problem runs would be background ones. A fix is to add if (nPulses==0) return;
before the loop and after nPulses is defined. I came across this problem and just haven't pushed the fix yet. If this is not the issue, which runs are you processing?
I sometimes see that error when I've Ctrl-C'd alcapana and then run again. I think it's because the first run wasn't stopped properly (should use !
instead but even knowing that, I automatically go to Ctrl-C...).
I am also going through the code for the integral ratio TAP. I was trying to find the tail and full integral definitions.
So the whole method is defined in the TAPAlgorithms
file and contained in the Algorithm
namespace. You can see the algorithm being used to produce TAPs in the IntegralRatioAPGenerator
or used to apply a cut in the TemplateConvolveAPGenerator::PassesIntegralRatio
method.
To set the algorithm up, the constructor takes 4 arguments and one more optional one:
IntegralRatio(int begin,int tail, int end, int trig_pol,double ped=0.)
which are:
The reason the pedestal argument is currently ignored is because for the SiR2-F you have heavy undershoot so I set the pedestal on a pulse by pulse basis to be the minimum sample in the waveform. This is currently contained within the operator()
method but so that we can use the same algorithm I'll factor it out into another method.
The return of operator()
is the integral ratio itself. If you also want to get back the raw total and tail integrals then you should call GetTotal()
and GetTail()
after running the operator()
method.
I hope that makes sense but let me know if you have other questions and I'll let you know once I've factored out the pedestal calculation, which I'll probably include with merging of the template convolution branch.
Oh and to specify the end of the integrals, if you give last>0
(where last
is the 3rd argument to the constructor) the integral will go until samples.begin()+last
. If on the other hand you specify last<=0
then the integral will stop at samples.end() + last
(which since last
is negative is more like samples.end() - abs(last)
). The latter option means of course that the number of samples included in the integrals varies for each pulse.
If a given pulse has too few samples for the requested range to be evaluated, an std::out_of_range
exception is thrown. If you're aware that this could happen because your limits are quite large or there's a big variation on the pulse length on your channel, then I would enclose the operator()
method call in a try{...}catch(std::out_of_range& e){...}
block.
I've moved the setting of the pedestal to the minimum sample to a new SetPedestalToMinimum(const TPulseIsland*)
method which should be called before you call operator()
.
Thank you all. I have been running some of the calibration runs for NDet, and I believe the Germanium was turned off for these. I will give the recommendations a try.
Thank you for the brief introduction on the integral ratio TAP. It sounds good. I was curious if there was any effort to calculate the integral using partial integrals of the first and last bins? I've done this before, though I'm not sure of the accuracy of the results (might want to try with interpolation at a few points. I'll give this a shot later).
Whoa---
"The reason the pedestal argument is currently ignored is because for the SiR2-F you have heavy undershoot so I set the pedestal on a pulse by pulse basis to be the minimum sample in the waveform."
Suggests a (grizzly) design issue. The pedestal is most emphatically not the same concept as lowest bin. If you needs to refer back to the lowest bin, call it that, and if you can't then we are in dangerous waters.
The pedestal is most emphatically not the same concept as lowest bin.
Absolutely, you're right. But this is more likely a misnomer in this case or at least using the word in a non-typical way. By pedestal I mean the zero on the y-axis.
I was only using the integral ratio to characterise a pulse shape and not to estimate any energy or time, so I don't need a calibration to any other scale. If pulses are allowed to contain negative samples (after pedestal subtraction) then the integral ratio is unbound on the lower end of the scale. If you don't subtract pedestal at all, you end up with two large constants above and below when you take the ratio which smooths the distribution out. Taking the pedestal (read: y-axis origin) to be the lowest sample of a waveform was a way to solve both these issues, and empirically it seemed to work.
Relating to the original post and Andy's/my comments, I think the error is actually two in one. Signal 11 is a seg fault, the latter part of the message is when an analyzer crashes but is still registered in the ODB because previously a crash had also occurred. It cleans itself up. You will see the last part of the message if you run odbedit after a crash and run a command or two.
If pulses are allowed to contain negative samples (after pedestal subtraction) then the integral ratio is unbound on the lower end of the scale.
I think that is conceptually correct? But I guess you knew all that, and don't care because what you have works better.
My real point is that if it not a pedestal, and doesn't behave like one, don't call it a pedestal. Sod's law dictates that someone will eventually take a variable called "pedestal" and use it as if it were a pedestal (which in fairness to them is a perfectly logical thing to do) . Use a different variable, "minimum value" or something. And that goes double if you used "pedestal" because it already existed for another reason.
I can tell you from experience that collaborations (that will remain nameless) have lost weeks of graduate student time debugging, and eventually discovering that the variable name (or in one memorable case the variable type) was just co-opted from some existing code, and not actually appropriate.
I believe we know what caused the original problem, and I have pushed the suggested fix. Reopen this if I'm wrong.
I'm trying to run alcapana and keep getting the error : Caught signal 11, exiting...Client unknown on SYSMSG removed (idle 93.1s,TO 2s)
I've tried several runs and the message is always the same. It's listed under catatstrophe in analyzer.cpp, but I cant find what's triggering the problem. Any advice would be welcome.
I am also going through the code for the integral ratio TAP. I was trying to find the tail and full integral definitions. If they are options that works fine (I saw one option for % of max bin, though I had troubles with this particular definition before). I was just hoping for a quick explaination or example of f the generator call.