Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page holds a few example code-snippets for use in myana analysis. This analysis is written in C++ and the examples here use root for plotting. Compare with Pyana user examples to see how the same things can be done using the pyana analysis framework.

Acqiris waveform data

This method is good for any waveform data from the Acqiris digitizers, just replace the source name (here AmoITof for the AMO Ion Time of flight detector) with some other Acqiris waveform detector.

Beamline data (Bld)

To read out energy, charge and position of the beam from the beamline data, use getEBeam(). The function returns 0 if data is available and assignes values to its arguments from the current event. Call from within event().

Code Block
  double ebcharge; double ebenergy; double posx; double posy;
  double angx; double angy;
  int fail =  getEBeam(ebcharge, ebenergy, posx, posy, angx, angy);
  if (!fail) printf("ebeam: %f, %f, %f, %f, %f, %f \n", 
                     ebcharge, ebenergy, posx, posy, angx, angy);

...

Code Block
  double phaseCavityTime1, phaseCavityTime2, phaseCavityCharge1, phaseCavityCharge2;
  int fail = getPhaseCavity( phaseCavityTime1, phaseCavityTime2, phaseCavityCharge1, phaseCavityCharge2 );
  if (!fail) printf("PhaseCavity: %f, %f, %f, %f \n", 
                     phaseCavityTime1,  phaseCavityTime2, phaseCavityCharge1, phaseCavityCharge2);

...