JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwFakeHelicity.cc
Go to the documentation of this file.
1/**********************************************************\
2* File: QwFakeHelicity.C *
3* *
4* Author: B.Waidyawansa *
5* Time-stamp:03-06-2010 *
6\**********************************************************/
7
8
9
10#include "QwFakeHelicity.h"
11
12
14{
15 fGoodHelicity = kTRUE;
16 return fGoodHelicity;
17
18}
19
21{
22
23 Bool_t fake_the_counters=kFALSE;
24
25 // First get the information from the Input Register. Even though there are no helicity
26 // information we can still get the MPS, Pattern SYNC and Pattern phase.
27
29 // When we don't have the pattern information in the input register, fake them.
30 if(fake_the_counters){
31 if (fEventNumber == 1){ // first pattern
34 }
35 else if (fPatternPhaseNumber == fMaxPatternPhase){ // end of a pattern
38 }
39 else {
42 }
43 }
44
45 // When we do have the pattern information in the inputregister, use thm.
46 if( !fake_the_counters ){
49 }
50
51
53 fHelicityBitPlus=kTRUE;
54 fHelicityBitMinus=kFALSE;
56
57 return;
58}
59
61 {
62 for (size_t i=0;i<fWord.size();i++)
64
65 //reset data
69
70 //clear data
72 fHelicityBitPlus = kFALSE;
73 fHelicityBitMinus = kFALSE;
74 return;
75 }
76
77 UInt_t QwFakeHelicity::GetRandbit(UInt_t& ranseed){
78 Bool_t status = false;
79 status = GetRandbit24(ranseed);
80 return status;
81 }
82
84 {
85 static Bool_t firsttimethrough = kTRUE;
86
87 Bool_t ldebug = kFALSE;
88 UInt_t ranseed = 0x2535D5&0xFFFFFF; //put a mask.
89
90 /**The value of the radseed was picked up from the studies
91 Buddhini did on the 24 bit helicity generator back in 2008.
92 */
93 // A modification to set the random seeds that are usually generated by the first 24 patterns.
94 if(! firsttimethrough){
95 return kTRUE;
96 } else{
97 firsttimethrough = kFALSE;
98 fGoodHelicity = kFALSE; //reset before prediction begins
99 iseed_Delayed = ranseed;
100 // Go 24 patterns back to get the reported helicity at this event
101 for(UInt_t i=0;i<24;i++)
104
106 for(Int_t i=0; i<8; i++)
109 }
110
111 if(ldebug) std::cout<<"QwFakeHelicity::CollectRandBits24 => Done collecting ...\n";
112 return kTRUE;
113
114}
Fake helicity generator using pregenerated random seeds.
Bool_t IsGoodHelicity() override
UInt_t GetRandbit(UInt_t &ranseed) override
Bool_t CollectRandBits() override
void ClearEventData() override
void ProcessEvent() override
std::vector< QwWord > fWord
Int_t fActualPatternPolarity
True polarity of the current pattern.
UInt_t GetRandbit24(UInt_t &ranseed)
static const Int_t kUndefinedHelicity
Int_t fDelayedPatternPolarity
Reported polarity of the current pattern.
Int_t fPatternPhaseNumberOld