alcap-org / AlcapDAQ

Alcap DAQ
alcap-org.github.io
8 stars 0 forks source link

New Pulse Viewer module #69

Closed benkrikler closed 10 years ago

benkrikler commented 10 years ago

Hey guys,

I figured this would be a decent way to annouce that I've added a module called TriggerPlotter which can be configured to plot pulses with various qualities.

In the MODULES section of the modules file, add a line like:

TriggerPlotter(SiR2-S , amplitude> 100)

And all pulses with amplitude > 100 on the SiR2-S channel will be drawn.

At the moment it can only draw one channel at a time and the only values that can be checked are 'amplitude' and 'time' but I will be adding TPI length and integral to this shortly. Feel free to give me requests as well.

You can use any of the standard equality tests ('>', '<', '==', '<=', '>=') as well. At this point boolean operations are not allowed, but if there is enough demand I can try to add this.

Note that this might be a little buggy still, in particular I think the drawing of TAPs (issue #52 ) might not be working correctly, although I'm not sure if that's not a bug in the MaxBin APGenerator itself.

I'll document this more in the wiki shortly...

AndrewEdmonds11 commented 10 years ago

Cool. Thanks, Ben that looks really useful. But can I be a pain and ask that we rename the module to something else.

At the moment, it sounds like it's supposed to be plotting triggers (which I guess technically it is) but can we not just call it PulseViewer?

AndrewEdmonds11 commented 10 years ago

Also, Ben, a quick question. How is the amplitude defined for this module? Is it the pedestal subtracted one that's in the TPusleIsland class or the simple ADC value like in the MDQ_IslandAmplitude module?

benkrikler commented 10 years ago

But can I be a pain and ask that we rename the module to something else. At the moment, it sounds like it's supposed to be plotting triggers (which I guess technically it is) but can we not just call it PulseViewer?

I hadn't thought of that issue. I'll rename name it as you suggest.

How is the amplitude defined for this module?

I'm using the amplitude in TAnalysedPulse which means that it's up to the generator to define. If it's coming from the MaxBin method it should be the pedestal subtracted one, but I'm not sure how reliable this generator is at this point. It's only through this module that I've started debugging it and things seemed strange on the SiR1-S channel at least....

AndrewEdmonds11 commented 10 years ago

Ok. I didn't realise that this was for the TAPs and thought it was for the TPIs. But it makes sense to do it your way when we have a concrete definition of the amplitude etc. after we've done the waveform analysis.

So how are you going to get TPI length? Is that going to be a new variables in the standard TAP?

In what way is the SiR1-S channel looking strange?

benkrikler commented 10 years ago

So how are you going to get TPI length? Is that going to be a new variables in the standard TAP?

That's one way to do it, and I was tempted. Another way would be to retrieve the TPI that the TAP says made it and check that length, or to just have the module loop over either TAPs or TPIs depending the type of property you ask it to draw. I think the last option is my preferred method cause we don't inflate the TAP class.

In what way is the SiR1-S channel looking strange?

I'm not very sure yet, cause this could be a problem with the new TAnalysedPulse::Draw method, but when I first tried plotting the TAP pulse over the TPI ( which should just pick out the maximum bin of the TPI), I was unable to see the TAP at all. I then realised the TPI was drawn with sample number on the x-axis and not real time, so the TAP was not finding the right bin. When I changed the TPI to be drawn in real clock time though, I was still unable to see the pulse. I did some simple checks and couldn't see why that would be. One thought I had was that there was an issue with the MaxBin generator finding the edge of the pulse, but I need to dig deeper to confirm this.

benkrikler commented 10 years ago

Wiki entry is up: https://github.com/alcap-org/AlcapDAQ/wiki/rootana-module-PulseViewer Let me know if anything is unclear.

I'm going to close this now, but we can reopen it or comment still if people hit problems with usage or bugs.

litchfld commented 10 years ago

In the MODULES section of the modules file, add a line like: TriggerPlotter(SiR2-S , amplitude> 100)

Isn't there a way to leverage ROOTs TCut Descriptors? They are more powerful and better tested than anything we could homebrew.

benkrikler commented 10 years ago

I did think about that but I thought it would take me about a day to write what we've now got and a lot longer to figure out the ROOT interface for TCut and plug it in.

But given your prompt, I've checked anyway and it seems TCut only does the string manipulation. It only seems to go from c++ code to a TString and not TString to c++ which would be more useful as that's where the effort is in this. There's a thing called TSelector, but it's very tied in to TTrees which we're not quite working with here.

The ideal would be a tool that took a string and returns a list of operations (in something like reverse polish notation for ease I suppose). I could just implement the actual operations and we'd be done. The more I write, the more I realise that must exist somewhere... Boost?