alcap-org / AlcapDAQ

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

Minor ExportPulse Improvements #172

Closed AndrewEdmonds11 closed 10 years ago

AndrewEdmonds11 commented 10 years ago

I'm currently using ExportPulse to debug the PulseCandidateFinder and there are a couple of things that would make it a bit easier but that I can find ways around for the time being:

As I said, this is not urgent but thought it worth mentioning for a later date when our priority is not actually getting some physics out

AndrewEdmonds11 commented 10 years ago

Oh and also have ExportPulse not have the bankname in the title since it's another thing I have to change in my ROOT macro when I want to look at a different detector (although maybe my ROOT macro should be recoded...)

benkrikler commented 10 years ago

have the pulses plotted in clock ticks and not real time (or at least the option to do so)

That's bitten me on the arse several times as well. I wanted pulses to be in real time since this is the 'high-level' analysis, but it's causing grief so let's change it. Maybe when we export TAPs we can change the axis to be in real time but for waveforms we keep it in clock ticks.

have the pulses exported with channel names "Ge-F" rather than "Ge_F", I can just code around this with my ROOT macro for now

What's the reason for this? The reason not to have a minus sign in outputted channel names is that if we make a branch or histogram from it, the name is no longer a valid c++ token so we can't call them from ROOT interactively. This was an issue for branches made in the SavePulses module I wrote this weekend and would mean we can only get histograms from the file by going through gDirectory->Get("branch-name"). For branches it's a show stopper as TTree::Draw just won't work, which is one of the main reasons for saving TAPs to a tree. For histograms it's only really a nuisance I guess.

Oh and also have ExportPulse not have the bankname in the title since it's another thing I have to change in my ROOT macro when I want to look at a different detector (although maybe my ROOT macro should be recoded...)

Why does your macro depend on the histogram title? I think it's useful to have it there so we can send each other the pulses and know straight away what they contain and where they're from.

AndrewEdmonds11 commented 10 years ago

So here's my macro with a few comments:

void PlotPulseCandidates() {

  TFile* file = new TFile("output.root", "READ");

  std::string bankname = "Nb83"; // if I want to change the channel I'm looking at, I also have to look up the bankname and change this too
  std::string islanddetname = "Ge_F"; // this and the line below could be different or the same
  std::string subpulsedetname = "Ge-F"; // I get this channel name from IDs::channel, which we changed recently...
  std::string event_number = "0";
  std::string pulse_number = "162";

  std::string islandname = "ExportPulse/Pulse_" + bankname + "_" + islanddetname + "_" + event_number + "_" + pulse_number;
  TH1D* hist2 = (TH1D*) file->Get(islandname.c_str());

  hist2->SetLineWidth(2);
  hist2->Draw("HIST");

  const int max_sub_pulses = 10;
  for (int i_subpulse = 0; i_subpulse < max_sub_pulses; ++i_subpulse) {
    std::stringstream subpulsename;
    subpulsename << "hSubPulse_" << subpulsedetname << "_Pulse" << pulse_number << "_SubPulse" << i_subpulse;

    TH1D* hist3 = (TH1D*) file->Get(subpulsename.str().c_str());
    if (hist3) {
      std::cout << subpulsename.str() << std::endl;
      hist3->SetLineWidth(2);
      hist3->Draw("SAMES");
    }
    else {
      break;
    }
  }
}

I understand what you're saying about the branch names so we should keep that as it is. But do we really need the bankname as well as the channel? At the moment, I say now, but I know that if we take it out then I'll want to put it back in for some obscure reason :)

benkrikler commented 10 years ago

Did you mean histogram name then not title:

Oh and also have ExportPulse not have the bankname in the title

I'd forgotten that we did that, and it does seem a bit daft. I think this has been there from the start and was a bit of a pain for the alcapana trend plots which did it as well ( for the web page viewer I have to make a ton of soft links to chop out the detector name or bank name which is why you end up with the two different options for how to view things). I agree we should take the bank-name out of the histogram name, but let's keep it in the title of the histogram for any discussion based on the plots.

AndrewEdmonds11 commented 10 years ago

Yes, sorry I meant histogram name. I was typing quicker than I was thinking...

benkrikler commented 10 years ago

These changes are now in place so:

I kept using underscores in place of hyphens though as we discussed. The PulseViewer is also working again, you'll be pleased to hear.