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// 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.