Implementing Helicity in Podd

This file: http://www.jlab.org/~rom/helicity_podd.html

With thanks to Richard Holmes, Vince Sulkosky, and Rob Feuerbach who contributed to the code.

Last updated July 12, 2006

R. Michaels   rom@jlab.org

During running in the G0 era, helicity data are produced by the G0 electronics. This document explains the helicity decoding in the Hall A ROOT/C++ Analyzer ``Podd''. The code uses Ole's SDK (software development kit) to provide a modularized plug-in. Specifically, we use a wrapper class which is a ''detector'' that plugs into an apparatus ''beam''. This allows seperate development. The code is standalone in this sense and compiles to a shared-object library libHaHelicity.so. This library contains the wrapper class as well as the main class, which at the moment is called HaHelicity (in Spring 2006 it was GenHelicity, they are slightly different). At the moment this code is on the adaql1 computer on adev account in ~adev/bobana/SDK/helicity and it is run in ~adev/bobana, but of course this may change or be deleted soon, so you should ask me for an official version. Here are some lines in the analysis script to implement the helicity:
  // Helicity "detector" for LEDEX (Summer 2006)
   gSystem->Load("libHaHelicity.so");
   THaApparatus* a = new THaIdealBeam("Beam", "Ideal beam");
   THaHelicityDet *hleft = new THaHelicityDet("HL","Beam helicity L-arm");
   hleft->SetState (1, 8, -1, 0, 0);  // G0 mode; 8 window delay; sign -1;
                                      // left arm; no redund
   hleft->SetROC (0, 11, 0, 3, 0, 4); // "Left arm" is ROC 11
   a->AddDetector(hleft);
   THaHelicityDet *hright = new THaHelicityDet("HR","Beam helicity R-arm");
   hright->SetState (1, 8, -1, 1, 0);  // G0 mode; 8 window delay; sign -1;
                                       // right arm; no redund
   hright->SetROC (1, 10, 0, 3, 0, 4); // Right arm is ROC 10
   a->AddDetector(hright);
   gHaApps->Add( a );

And here is how to show results and some comments on the meaning:
// helicity on L-arm
T->Draw("Beam.HL.helicity:fEvtHdr.fEvtNum","fEvtHdr.fEvtNum<15000")
// helicity on R-arm
T->Draw("Beam.HR.helicity:fEvtHdr.fEvtNum","fEvtHdr.fEvtNum<15000")
Note, if triggers are random in time, we expect 1.5% of events to
have helicity==0 because the helicity is ``blanked off'' for 500 microsec
out of 33 msec.  This is normal.  Also note, if trigger T9 exists (it
is the MPS signal which intiates each helicity sequence) then since all
T9 come at the time when gate==0 they will all have helicity==0.
Don't panic, this is normal.