HALL A C++/ROOT Parity Analyzer Pan VaAnalysis.cc (implementation) Author: R. Holmes <http://mep1.phy.syr.edu/~rsholmes>, A. Vacheret <http://www.jlab.org/~vacheret>, R. Michaels <http://www.jlab.org/~rom>, K.Paschke @(#)pan/src:$Name: $:$Id: VaAnalysis.cc,v 1.63 2006/04/16 11:11:31 moffit Exp $ Abstract base class of analysis. Derived classes include TaADCCalib (for computation of pedestals and DAC noise slopes), TaBeamAna (for analysis of beam characteristics), and TaPromptAna (for prompt physics analysis). Each of these is responsible for some treatment of VaEvents from a TaRun. The type of analysis to be done is specified in the database, and the TaAnalysisManager instantiates the appropriate analysis class accordingly. VaAnalysis has initialization and termination routines for both the overall analysis and the analysis of a particular run. At present Pan is designed to analyze only a single run, but these routines provide for a possible future version that will handle multiple runs. The main event loop is inside the ProcessRun method. The three main methods called from here are PreProcessEvt, ProcessEvt, and ProcessPair. The first of these places the most recently read event into a delay queue until the true helicity information for that event becomes available. Cut conditions are checked for here. Once the helicity information is added the event is pushed onto a second delay queue, while the events are used to construct pairs which are pushed onto a third delay queue. These two delay queues are used to hold events and pairs until we can tell whether they fall within a cut interval caused by a cut condition arising later. Events and pairs which emerge from the ends of these queues are analyzed in ProcessEvt and ProcessPair, respectively. Analysis results are added to the events and pairs themselves.
| virtual | ~VaAnalysis() |
| static TClass* | Class() |
| virtual void | Finish() |
| virtual void | Init(const Bool_t&) |
| virtual ErrCode_t | InitLastPass() |
| virtual TClass* | IsA() const |
| size_t | PairsLeft() const |
| virtual ErrCode_t | ProcessRun() |
| virtual void | RunFini() |
| virtual ErrCode_t | RunIni(TaRun&) |
| virtual ErrCode_t | RunReIni(TaRun&) |
| virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
| virtual void | Streamer(TBuffer& b) |
| void | StreamerNVirtual(TBuffer& b) |
| virtual void | AutoPairAna() |
| vector<AnaList> | ChanList(const string& devtype, const string& channel, const string& other, const UInt_t flags = 0) |
| virtual vector<AnaList> | ChanListFromName(const string& chanbase, const string& other, const UInt_t flags = 0) |
| virtual void | ComputeData(EFeedbackType fdbk, UInt_t timescale, Int_t devicekey) |
| virtual void | ComputeLastData(EFeedbackType fdbk, UInt_t timescale, Int_t devicekey) |
| virtual void | EventAnalysis() |
| virtual void | GetLastSetPt() |
| virtual void | InitChanLists() |
| virtual void | InitFeedback() |
| virtual void | InitTree(const TaCutList&) |
| ErrCode_t | NewPrePair() |
| VaAnalysis& | operator=(const VaAnalysis& assign) |
| virtual void | PairAnalysis() |
| virtual ErrCode_t | PreProcessEvt() |
| virtual void | ProceedFeedback() |
| virtual void | ProceedLastFeedback() |
| virtual ErrCode_t | ProcessEvt() |
| virtual ErrCode_t | ProcessPair() |
| virtual void | PZTSendEPICS(Int_t fdbkoption) |
| virtual void | SendEPICS(EFeedbackType fdbk, Int_t fdbkoption) |
| virtual void | SendVoltagePZT() |
| Bool_t | WtsOK(vector<Double_t> wts) |
| static const UInt_t | fgASY | Store asymmetry as result |
| static const UInt_t | fgASYN | Store normalized asymmetry as result |
| static const UInt_t | fgAVE | Use average asymmetry, not sum |
| static const UInt_t | fgAVG | Store average as result |
| static const UInt_t | fgAVGN | Store normalized average as result |
| static const UInt_t | fgBLIND | Blind this result |
| static const UInt_t | fgBLINDSIGN | Blind sign only of this result |
| static const UInt_t | fgCOPY | Store right and left values as results |
| static const UInt_t | fgDIFF | Store R-L difference as result |
| static const UInt_t | fgNO_BEAM_C_NO_ASY | Do not compute asym if lobeamc cut fails |
| static const UInt_t | fgNO_BEAM_NO_ASY | Do not compute asym if lobeam cut fails |
| static const UInt_t | fgNumBpmFdbk | |
| static const UInt_t | fgORDERED | Also do order dependent stats |
| static const EventNumber_t | fgSLICELENGTH | events in a statistics slice |
| static const UInt_t | fgSTATS | Print statistics |
| static const ErrCode_t | fgVAANA_ERROR | returned on error |
| static const ErrCode_t | fgVAANA_OK | returned on success |
| TaBlind* | fBlind | For blinding |
| UInt_t | fCurMon | Index for current monitor for normalization |
| Int_t* | fCutArray | Array of cut condition values for tree |
| Int_t* | fCutIntArray | Array of cut interval values for tree |
| Bool_t | fDoRoot | To control whether ROOT file is made |
| Bool_t | fDoRun | To control if run stats are kept |
| Bool_t | fDoSlice | To control if slice stats are kept |
| deque<VaEvent> | fEDeque | Cut delay event deque |
| size_t | fEDequeMax | Max size of cut delay event deque |
| deque<VaEvent> | fEHelDeque | Helicity delay event deque |
| size_t | fEHelDequeMax | Max size of helicity delay event deque |
| VaEvent* | fEvt | Event being analyzed |
| UInt_t | fEvtProc | Number of events processed |
| string | fFdbkName[5] | Feedback name |
| Int_t | fFeedNum[5] | feedback number |
| Bool_t | fFirstPass | Pass 1 or not? |
| Double_t | fIAHallCslope | IA feedback calibration slope for Hall-C |
| Double_t | fIAslope | IA feedback calibration slope |
| Double_t | fLast[5] | Last value of the voltage for feeback i |
| Bool_t | fLastPass | Last pass or not? |
| UInt_t | fMaxNumEv | Max number of events to analyze |
| Double_t | fMean1[5] | Feedback Mean value 1st pass |
| Double_t | fMean2[5] | Feedback Mean value 2st pass |
| string | fMonitor[5] | Current/postion Monitor name used for feedback |
| UInt_t | fMonitorKey[5] | Current/position Monitor key |
| UInt_t | fNCuts | Size of cut array |
| UInt_t | fNPair[5] | Number of pair for type i feedback |
| Bool_t | fOnlFlag | Flag whether data are online or not. |
| deque<VaPair*> | fPDeque | Cut delay pair deque |
| size_t | fPDequeMax | Max size of cut delay pair deque |
| Double_t | fPITAslope | PITA feedback calibration slope |
| Double_t* | fPZTMatrix | PZT matrix |
| Bool_t | fPZTQcoupling | Enable correction for PZT Q coupling |
| Double_t | fPZTQslopes[2] | PZT Q coupling slopes |
| VaPair* | fPair | Pair being analyzed |
| UInt_t | fPairProc | Number of pairs processed |
| TTree* | fPairTree | Pair tree for Root file |
| EPairType | fPairType | Type of beam helicity structure |
| VaEvent* | fPreEvt | Event being preprocessed |
| VaPair* | fPrePair | Pair being built |
| Double_t | fRMS[5] | Feedback RMS |
| Double_t | fResult[5] | (asy or diff) result for feedback i |
| Double_t | fResultError[5] | (asy or diff) result error for feedback i |
| TaRun* | fRun | Run being analyzed |
| Int_t | fRunNum | current run number |
| Bool_t | fSend[5] | Enable send voltage value for feedback |
| EventNumber_t | fSliceLimit | Event number at end of next slice |
| Int_t | fStartPair[5] | Feedback pair start |
| Int_t | fStopPair[5] | IA feedback pair stop |
| vector<Double_t> | fSum[5] | Sum of value for feedback i |
| Bool_t | fSwitch[5] | Enable compute vlaue for feedback |
| UInt_t | fTimeScale[5] | Timescale of feedback |
| Int_t | fTreeLEvNum | Left ev number for tree |
| vector<AnaList> | fTreeList | Quantities to put in the pair results and pair tree |
| Double_t | fTreeMEvNum | Mean ev number for tree |
| Int_t | fTreeOKCCut | Pair not in cut interval (hallC) |
| Int_t | fTreeOKCond | Pair passes cut conditions |
| Int_t | fTreeOKCut | Pair not in cut interval |
| Int_t | fTreePrevHel | True helicity of prev event |
| Int_t | fTreePrevROHel | Readout helicity of prev event |
| Int_t | fTreeREvNum | Right ev number for tree |
| Double_t* | fTreeSpace | Other data for tree |
| Inheritance Chart: | |||||||||||||||||||
|
To be called at the start of each run. (Present structure of Pan is that each analysis handles only one run, so this is somewhat redundant with Init.) "Prime the pump" by getting a new empty pair and making sure fPair is null; set maximum fEDeque and fPDeque length, which depends on trigger rate, and maximum fEHelDeque length, which depends on delay value and oversampling factor. Find out pair type and set fPairType accordingly.
Main analysis routine -- this is the event loop. Get an event, preprocess it; if the event deque is full, pop off an event, analyze it, and pass it to the run to be accumulated; likewise for the pair deque.
To be called at the end of each run. (Present structure of Pan is that each analysis handles only one run, so this is somewhat redundant with Finish.) Clear out the queues, get rid of all pairs, and get rid of the pair tree. But write it out first...
Preprocess event, checking for cut conditions, and putting event in helicity delay queue. If that fills up, take an event off the end, insert true helicity, and put it on the event delay queue. Package these events into pairs. If a pair is completed, push it onto pair delay queue.
Handle analysis of an event that has been through the event delay queue, putting results into the event.
Handle analysis of a pair that has been through the pair delay queue, putting results into the pair.
Routine a derived class can call to do some of the analysis automatically. Place into the tree space copies, difference, and/or asymmetries for channels listed in fTreeList, depending on flags. Also put these into the pair as labelled quantities. These lists are created in InitChanLists; different analyses can produce different lists, then just call AutoPairAna to handle some if not all of the pair analysis. At the end, call feedback routines if enabled.
Last feedback at the end of the run. To have a chance to send a feedback, this function needs enough pairs. It checks the data vector size and computes an error.
keep this one aside to the other because the X and Y feedback are correlated. Send position feedback value to EPICS
Send position feedback value will write the function when hardware defined ....