18 #include "Constants.h" 21 #include "ChanTrigger.h" 26 #include "GlobalTrigger.h" 27 #include "icemc_random.h" 31 #ifdef ANITA_UTIL_EXISTS 33 #include "SimulatedSignal.h" 41 lcp_component=sqrt((e_component*e_component+h_component*h_component)/2);
42 rcp_component=lcp_component;
47 lcp_component=(e_component+h_component)/2;
48 rcp_component=lcp_component;
57 if (settings1->USETIMEDEPENDENTTHRESHOLDS==1 && (settings1->WHICH==9 || settings1->WHICH==10 ) ) {
58 for(
int i=0;i<4;i++) thresholds[0][i] = thresholds[1][i] = anita1->powerthreshold[i];
59 int iring = (ilayer<2)*0 + (ilayer==2)*1 + (ilayer==3)*2;
61 if (ilayer==0) iphi = ifold*2;
62 else if (ilayer==1) iphi = ifold*2+1;
77 globaltrig1->volts[0][ilayer][ifold]=0.;
78 globaltrig1->volts[1][ilayer][ifold]=0.;
83 if (settings1->TRIGGERSCHEME <= 1){
86 }
else if (settings1->TRIGGERSCHEME >= 2){
89 WhichBandsPassTrigger2(settings1, anita1, globaltrig1, bn1, ilayer, ifold, dangle, emfrac, hadfrac, thresholds);
105 double volts_thischannel;
106 double energy_thischannel;
107 double voltagethresh_thischannel,energythresh_thischannel;
110 for (
int ibw=0;ibw<anita1->
NBANDS+1;ibw++) {
114 if (settings1->SIGNAL_FLUCT) {
115 bwslice_volts_pole[ibw] += getRNG(RNG_SIGNAL_FLUCT)->Gaus(0.,anita1->bwslice_vnoise[ilayer][ibw]);
116 bwslice_volts_polh[ibw] += getRNG(RNG_SIGNAL_FLUCT)->Gaus(0.,anita1->bwslice_vnoise[ilayer][ibw]);
129 for (
int ibw=0;ibw<anita1->
NBANDS+1;ibw++) {
135 globaltrig1->channels_passing[ilayer][ifold][0][ibw]=0;
136 globaltrig1->vchannels_passing[ilayer][ifold][0][ibw]=0;
142 if (settings1->LCPRCP ) {
159 energythresh_thischannel=thresholds[0][ibw];
163 voltagethresh_thischannel=anita1->bwslice_thresholds[ibw];
166 if (settings1->ZEROSIGNAL) {
167 volts_thischannel=0.;
168 energy_thischannel=0.;
171 if (settings1->TRIGGERSCHEME==0) {
182 if (settings1->TRIGGERSCHEME==1) {
196 if (anita1->pol_allowed[0] && anita1->bwslice_allowed[ibw]) {
197 globaltrig1->nchannels_perrx_triggered[anita1->
GetRx(ilayer,ifold)]++;
198 globaltrig1->channels_passing[ilayer][ifold][0][ibw]=1;
199 globaltrig1->vchannels_passing[ilayer][ifold][0][ibw]=1;
214 if (!settings1->JUSTVPOL) {
216 globaltrig1->channels_passing[ilayer][ifold][1][ibw]=0;
217 globaltrig1->vchannels_passing[ilayer][ifold][1][ibw]=0;
225 if (settings1->LCPRCP) {
234 energythresh_thischannel=thresholds[1][ibw];
239 voltagethresh_thischannel=anita1->bwslice_thresholds[ibw];
242 if (settings1->ZEROSIGNAL) {
243 volts_thischannel=0.;
244 energy_thischannel=0.;
248 if (settings1->TRIGGERSCHEME==0) {
253 if (settings1->TRIGGERSCHEME==1) {
262 if (anita1->pol_allowed[1] && anita1->bwslice_allowed[ibw]) {
263 globaltrig1->nchannels_perrx_triggered[anita1->
GetRx(ilayer,ifold)]++;
264 globaltrig1->channels_passing[ilayer][ifold][1][ibw]=1;
265 globaltrig1->vchannels_passing[ilayer][ifold][1][ibw]=1;
287 double psignal[2][5][Anita::NFOUR]; memset(psignal,0,
sizeof(psignal));
289 double mindiodeconvl[2][5]; memset(mindiodeconvl,0,
sizeof(mindiodeconvl));
291 double onediodeconvl[2][5]; memset(onediodeconvl,0,
sizeof(onediodeconvl));
293 double timedomain_output[2][5][Anita::NFOUR]; memset(timedomain_output,0,
sizeof(timedomain_output));
294 double timedomain_output_justNoise[2][5][Anita::NFOUR]; memset(timedomain_output_justNoise,0,
sizeof(timedomain_output_justNoise));
299 if (settings1->NOISEFROMFLIGHTTRIGGER){
300 anita1->bwslice_rmsdiode[0][4] = anita1->bwslice_dioderms_fullband_allchan[0][iant][anita1->tuffIndex];
301 anita1->bwslice_rmsdiode[1][4] = anita1->bwslice_dioderms_fullband_allchan[1][iant][anita1->tuffIndex];
302 anita1->bwslice_rmsdiode[1][4] = anita1->bwslice_rmsdiode[0][4];
307 int ibinshift=(anita1->NFOUR/4-(int)(anita1->maxt_diode/anita1->TIMESTEP));
311 double integrateenergy[5]={0.,0.,0.,0.,0.};
313 for (
int iband=0;iband<5;iband++) {
314 if (anita1->bwslice_allowed[iband]!=1)
continue;
316 if (settings1->TRIGGERSCHEME == 2 || settings1->TRIGGERSCHEME == 3 || settings1->TRIGGERSCHEME == 4 || settings1->TRIGGERSCHEME == 5){
317 for (
int itime=0;itime<anita1->NFOUR/2-(int)(anita1->maxt_diode/anita1->TIMESTEP);itime++) {
318 anita1->
maxbin_fortotal[iband]=anita1->NFOUR/2-(int)(anita1->maxt_diode/anita1->TIMESTEP);
321 int itimenoisebin=anita1->NFOUR/2-(int)(anita1->maxt_diode/anita1->TIMESTEP)-itime;
326 integrateenergy[iband]+=anita1->timedomainnoise_rfcm_banding[0][iband][itime]*anita1->timedomainnoise_rfcm_banding[0][iband][itime]*anita1->TIMESTEP;
327 if ( settings1->SIGNAL_FLUCT && (!settings1->NOISEFROMFLIGHTTRIGGER) ) {
329 justNoise_trigPath[0][itime] = anita1->timedomainnoise_rfcm_banding[0][iband][itimenoisebin];
330 justNoise_trigPath[1][itime] = anita1->timedomainnoise_rfcm_banding[1][iband][itimenoisebin];
335 for (
int itime=anita1->NFOUR/2-(
int)(anita1->maxt_diode/anita1->TIMESTEP);itime<anita1->NFOUR/2;itime++) {
341 else if ( settings1->SIGNAL_FLUCT && (!settings1->NOISEFROMFLIGHTTRIGGER) ) {
342 for (
unsigned int itime = 0; itime < anita1->HALFNFOUR; ++itime){
345 integrateenergy[iband]+=anita1->timedomainnoise_rfcm_banding[0][iband][itime]*anita1->timedomainnoise_rfcm_banding[0][iband][itime]*anita1->TIMESTEP;
355 int whichlayer,whichphisector;
358 for (
int iband=0;iband<5;iband++) {
359 if (anita1->bwslice_allowed[iband]!=1)
continue;
361 if (settings1->LCPRCP
372 for (
int itime=0;itime<anita1->NFOUR/2;itime++) {
383 for (
int itime=0;itime<anita1->NFOUR/2;itime++) {
392 for (
int itime=0;itime<Anita::NFOUR/2;itime++) {
397 DiodeConvolution(settings1, anita1, globaltrig1, ilayer, ifold, mindiodeconvl[0], onediodeconvl[0], psignal[0], timedomain_output[0], timedomain_output_justNoise[0], ibinshift, 0, thresholds);
398 DiodeConvolution(settings1, anita1, globaltrig1, ilayer, ifold, mindiodeconvl[1], onediodeconvl[1], psignal[1], timedomain_output[1], timedomain_output_justNoise[1], ibinshift, 1, thresholds);
406 int npass, npassnoise;
408 L1Trigger(anita1,timedomain_output_justNoise[0],timedomain_output_justNoise[1],thresholds,
409 globaltrig1->channels_passing_justNoise[ilayer][ifold][0],globaltrig1->channels_passing_justNoise[ilayer][ifold][1],npassnoise);
410 L1Trigger(anita1,timedomain_output[0],timedomain_output[1],thresholds,
411 globaltrig1->channels_passing[ilayer][ifold][0],globaltrig1->channels_passing[ilayer][ifold][1],npass);
418 int startbin=TMath::MinElement(5,anita1->
iminbin);
420 if (ilayer==anita1->GetLayer(anita1->rx_minarrivaltime) && ifold==anita1->GetIfold(anita1->rx_minarrivaltime)) {
421 for (
int iband=0;iband<5;iband++) {
422 if (anita1->bwslice_allowed[iband]!=1)
continue;
424 anita1->
ston[iband]=0.;
425 for (
int i=anita1->
iminbin[iband];i<anita1->imaxbin[iband];i++) {
430 if (timedomain_output[0][iband][i]/anita1->bwslice_rmsdiode[0][iband]<anita1->
ston[iband]) {
431 anita1->
ston[iband]=timedomain_output[0][iband][i]/anita1->bwslice_rmsdiode[0][iband];
438 for (
int i=0;i<anita1->HALFNFOUR;i++) {
439 anita1->flag_e_inanita[iband][i]=0;
440 anita1->flag_h_inanita[iband][i]=0;
445 for (
int i=0;i<(int)
flag_e[iband].size();i++) {
446 anita1->flag_e_inanita[iband][i+startbin]=
flag_e[iband][i];
448 for (
int i=0;i<(int)
flag_h[iband].size();i++) {
449 anita1->flag_h_inanita[iband][i+startbin]=
flag_h[iband][i];
458 for (
int iband=0;iband<5;iband++) {
459 if (anita1->bwslice_allowed[iband]!=1)
continue;
463 if (globaltrig1->channels_passing[ilayer][ifold][0][iband])
464 globaltrig1->nchannels_perrx_triggered[anita1->
GetRx(ilayer,ifold)]--;
465 globaltrig1->channels_passing[ilayer][ifold][0][iband]=0;
466 globaltrig1->channels_passing_justNoise[ilayer][ifold][0][iband]=0;
471 if (globaltrig1->channels_passing[ilayer][ifold][1][iband])
472 globaltrig1->nchannels_perrx_triggered[anita1->
GetRx(ilayer,ifold)]--;
473 globaltrig1->channels_passing[ilayer][ifold][1][iband]=0;
474 globaltrig1->channels_passing_justNoise[ilayer][ifold][1][iband]=0;
480 if (npass>=anita1->trigRequirements[0]) {
481 anita1->l1_passing=1;
484 anita1->l1_passing=0;
488 anita1->dangle_inanita=dangle;
489 anita1->emfrac_inanita=emfrac;
490 anita1->hadfrac_inanita=hadfrac;
494 anita1->irx=anita1->
GetRx(ilayer,ifold);
496 if (Anita::GetLayer(anita1->rx_minarrivaltime)==ilayer && Anita::GetIfold(anita1->rx_minarrivaltime)==ifold && anita1->tsignals->GetEntries()<settings1->HIST_MAX_ENTRIES && !settings1->ONLYFINAL && settings1->HIST==1) {
497 anita1->tsignals->Fill();
501 if (settings1->TRIGGERSCHEME == 3 || settings1->TRIGGERSCHEME == 4 || settings1->TRIGGERSCHEME == 5){
503 for (
unsigned int ichannel = 0; ichannel < 5; ichannel++){
504 globaltrig1->channels_passing[ilayer][ifold][0][ichannel] = 1;
505 globaltrig1->channels_passing[ilayer][ifold][1][ichannel] = 1;
510 unsigned int ilayer_trigger;
511 unsigned int iphisector_trigger;
514 iphisector_trigger = ifold * 2 + ilayer;
517 iphisector_trigger = ifold;
518 ilayer_trigger = ilayer - 1;
526 for (
int i=0;i<2;i++) {
528 for (
unsigned int ibin=0;ibin<globaltrig1->arrayofhitsall[whichlayer][whichphisector][i][4].size();ibin++) {
529 anita1->arrayofhits_inanita[whichlayer][whichphisector][i][ibin]=globaltrig1->arrayofhitsall[whichlayer][whichphisector][i][4][ibin];
531 for (
unsigned int ibin=globaltrig1->arrayofhitsall[whichlayer][whichphisector][i][4].size();ibin<HALFNFOUR;ibin++) {
532 anita1->arrayofhits_inanita[whichlayer][whichphisector][i][ibin]=0.;
546 void ChanTrigger::DiodeConvolution(
Settings *settings1,
Anita *anita1,
GlobalTrigger *globaltrig1,
int ilayer,
int ifold,
double mindiodeconvl[5],
double onediodeconvl[5],
double psignal[5][Anita::NFOUR],
double timedomain_output[5][Anita::NFOUR],
double timedomain_output_justNoise[5][Anita::NFOUR],
int ibinshift,
int ipol,
double thresholds[2][5]){
548 int tempChansPassing[5]={0,0,0,0,0};
549 int tempChansPassingNoise[5]={0,0,0,0,0};
554 int whichlayer,whichphisector;
559 for (
int iband=0;iband<5;iband++) {
563 if (anita1->bwslice_allowed[iband]!=1)
continue;
567 anita1->myconvlv(
vm_banding_rfcm_forfft_justNoise[ipol][iband],anita1->NFOUR,anita1->fdiode_real[iband],mindiodeconvl[iband],onediodeconvl[iband],psignal[iband],timedomain_output_justNoise[iband]);
568 anita1->myconvlv(
vm_banding_rfcm_forfft[ipol][iband],anita1->NFOUR,anita1->fdiode_real[iband],mindiodeconvl[iband],onediodeconvl[iband],psignal[iband],timedomain_output[iband]);
604 if (!settings1->APPLYIMPULSERESPONSETRIGGER){
605 Tools::ShiftRight(timedomain_output[iband],anita1->NFOUR,(
int)(anita1->arrival_times[ipol][anita1->
GetRx(ilayer,ifold)]/anita1->TIMESTEP));
606 Tools::ShiftRight(timedomain_output_justNoise[iband],anita1->NFOUR,(
int)(anita1->arrival_times[ipol][anita1->
GetRx(ilayer,ifold)]/anita1->TIMESTEP));
609 if (settings1->TRIGGERSCHEME == 2 || settings1->TRIGGERSCHEME == 3 || settings1->TRIGGERSCHEME == 4 || settings1->TRIGGERSCHEME == 5){
612 Tools::ShiftLeft(timedomain_output[iband],anita1->NFOUR,ibinshift);
613 Tools::ShiftLeft(timedomain_output_justNoise[iband],anita1->NFOUR,ibinshift);
617 for (
int itime=0;itime<Anita::NFOUR/2;itime++) {
630 int nextbreakpoint=(int)((
double)(whichtrigbin+1)*(globaltrig1->TRIGTIMESTEP/anita1->TIMESTEP));
637 while (nextbreakpoint<anita1->iminbin[iband]) {
638 nextbreakpoint=(int)((
double)(whichtrigbin+1)*(globaltrig1->TRIGTIMESTEP/anita1->TIMESTEP));
647 int thisisaonenoise=0;
649 for (
int ibin = anita1->
iminbin[iband]; ibin < anita1->imaxbin[iband]; ibin++) {
651 if (timedomain_output[iband][ibin] < thresholds[ipol][iband] * anita1->bwslice_rmsdiode[ipol][iband] && anita1->pol_allowed[ipol] && anita1->bwslice_allowed[iband]) {
653 tempChansPassing[iband] = 1;
660 if (timedomain_output_justNoise[iband][ibin] < thresholds[ipol][iband] * anita1->bwslice_rmsdiode[ipol][iband] && anita1->pol_allowed[ipol] && anita1->bwslice_allowed[iband]) {
662 tempChansPassingNoise[iband] = 1;
672 if (ibin>nextbreakpoint) {
676 globaltrig1->arrayofhitsall[whichlayer][whichphisector][ipol][iband].push_back(thisisaone);
677 globaltrig1->arrayofhitsnoise[whichlayer][whichphisector][ipol][iband].push_back(thisisaonenoise);
685 nextbreakpoint=(int)((
double)(whichtrigbin+1)*(globaltrig1->TRIGTIMESTEP/anita1->TIMESTEP));
699 if (tempChansPassing[iband]) {
701 globaltrig1->nchannels_perrx_triggered[anita1->
GetRx(ilayer,ifold)]++;
714 for (
int ipol=0;ipol<2;ipol++) {
715 for (
int iband=0;iband<anita1->
NBANDS+1;iband++) {
748 e_component_kvector=0;
749 h_component_kvector=0;
750 n_component_kvector=0;
757 double tmp_vhz[2][anita1->NFREQ];
758 double tmp_volts[2][anita1->NFOUR/2];
760 for (
int iband=0;iband<5;iband++) {
764 Tools::Zero(
vhz_rx[0][iband], anita1->NFREQ);
765 Tools::Zero(
vhz_rx[1][iband], anita1->NFREQ);
767 if (anita1->bwslice_allowed[iband]!=1)
continue;
770 anita1->imaxbin[iband]=anita1->NFOUR/2;
778 bn1->
GetHitAngles(e_component_kvector, h_component_kvector, n_component_kvector, hitangle_e, hitangle_h);
781 for (
int k=0;k<Anita::NFREQ;k++) {
782 if (anita1->freq[k]>=settings1->FREQ_LOW_SEAVEYS && anita1->freq[k]<=settings1->FREQ_HIGH_SEAVEYS){
785 tmp_vhz[0][k]=tmp_vhz[1][k]=panel1->
GetVmmhz_freq(jpt*Anita::NFREQ + k)/sqrt(2)/(anita1->TIMESTEP*1.E6);
787 anita1->AntennaGain(settings1, hitangle_e, hitangle_h, e_component, h_component, k, tmp_vhz[0][k], tmp_vhz[1][k]);
789 if (settings1->TUFFSTATUS==3){
801 anita1->MakeArrayforFFT(tmp_vhz[0],tmp_volts[0], 90.,
true);
802 anita1->MakeArrayforFFT(tmp_vhz[1],tmp_volts[1], 90.,
true);
806 Tools::realft(tmp_volts[0],-1,anita1->NFOUR/2);
807 Tools::realft(tmp_volts[1],-1,anita1->NFOUR/2);
811 Tools::NormalTimeOrdering(anita1->NFOUR/2,tmp_volts[0]);
812 Tools::NormalTimeOrdering(anita1->NFOUR/2,tmp_volts[1]);
814 numBinShift = int(panel1->
GetDelay(jpt) / anita1->TIMESTEP);
815 if(fabs(numBinShift) >= anita1->HALFNFOUR){
821 Tools::ShiftLeft(tmp_volts[0], anita1->NFOUR/2, numBinShift );
822 Tools::ShiftLeft(tmp_volts[1], anita1->NFOUR/2, numBinShift );
825 Tools::ShiftRight(tmp_volts[0], anita1->NFOUR/2, -1*numBinShift );
826 Tools::ShiftRight(tmp_volts[1], anita1->NFOUR/2, -1*numBinShift );
829 for (
int k=0;k<anita1->NFOUR/2;k++) {
838 for (
int k=0; k<anita1->NFOUR/2;k++){
846 Tools::realft(tmp_volts[0],1,anita1->NFOUR/2);
847 Tools::realft(tmp_volts[1],1,anita1->NFOUR/2);
851 anita1->GetArrayFromFFT(tmp_volts[0],
vhz_rx[0][iband]);
852 anita1->GetArrayFromFFT(tmp_volts[1],
vhz_rx[1][iband]);
858 #ifdef ANITA_UTIL_EXISTS 859 if (settings1->SIGNAL_FLUCT && (settings1->NOISEFROMFLIGHTDIGITIZER || settings1->NOISEFROMFLIGHTTRIGGER) )
862 if (settings1->ADDCW){
874 double integrate_energy_freq[5]={0.,0.,0.,0.,0.};
876 for (
int iband=0;iband<5;iband++) {
877 if (anita1->bwslice_allowed[iband]!=1)
continue;
880 anita1->imaxbin[iband]=anita1->NFOUR/2;
885 for (
int ifreq=0; ifreq<anita1->NFOUR/2; ifreq++){
893 if (!settings1->APPLYIMPULSERESPONSETRIGGER){
895 anita1->Banding(iband,anita1->freq,
v_banding_rfcm[0][iband],Anita::NFREQ);
896 anita1->Banding(iband,anita1->freq,
v_banding_rfcm[1][iband],Anita::NFREQ);
901 for (
int ifreq=0;ifreq<Anita::NFREQ;ifreq++) {
902 if (anita1->freq[ifreq]>=settings1->FREQ_LOW_SEAVEYS && anita1->freq[ifreq]<=settings1->FREQ_HIGH_SEAVEYS){
913 for (
int i=0;i<anita1->NFOUR/4;i++) {
914 for (
int ipol=0;ipol<2;ipol++){
920 for (
int k=i;k<i+10;k++) {
921 if (k<anita1->NFOUR/4) {
946 for (
int itime=0; itime<anita1->NFOUR/2; itime++){
954 for (
int itime=0; itime<anita1->NFOUR/2 ; itime++){
959 #ifdef ANITA_UTIL_EXISTS 967 if (settings1->ZEROSIGNAL) {
973 for (
int i=0;i<anita1->NFOUR/4;i++) {
978 for (
int k=0;k<anita1->NFOUR/2;k++) {
988 for (
int iband=0;iband<5;iband++) {
989 if (anita1->bwslice_allowed[iband]!=1)
continue;
990 for (
int ipol=0; ipol<2; ipol++) {
1007 double vhz_rx_rfcm_e[Anita::NFREQ];
1008 double vhz_rx_rfcm_h[Anita::NFREQ];
1010 int fNumPoints = anita1->HALFNFOUR;
1013 if (settings1->APPLYIMPULSERESPONSEDIGITIZER){
1014 anita1->GetNoiseWaveforms();
1015 for (
int i=0;i<fNumPoints;i++){
1020 #ifdef ANITA_UTIL_EXISTS 1025 if (settings1->SIGNAL_FLUCT > 0 && !settings1->NOISEFROMFLIGHTDIGITIZER){
1026 for (
int i=0;i<anita1->NFOUR/2;i++) {
1027 for (
int ipol=0;ipol<2;ipol++){
1036 for (
int ifreq=0; ifreq<anita1->NFREQ; ifreq++){
1037 vhz_rx_rfcm_e[ifreq]=
vhz_rx[0][4][ifreq];
1038 vhz_rx_rfcm_h[ifreq]=
vhz_rx[1][4][ifreq];
1045 if (settings1->TRIGGERSCHEME==1 || settings1->TRIGGERSCHEME==2 || settings1->TRIGGERSCHEME == 3 || settings1->TRIGGERSCHEME == 4 || settings1->TRIGGERSCHEME == 5) {
1046 anita1->RFCMs(1,1,vhz_rx_rfcm_e);
1047 anita1->RFCMs(1,1,vhz_rx_rfcm_h);
1052 if (settings1->PULSER) {
1053 scale=Tools::dMax(vhz_rx_rfcm_e,Anita::NFREQ)/Tools::dMax(anita1->v_pulser,anita1->NFOUR/4);
1056 for (
int i=0;i<Anita::NFREQ;i++) {
1057 ifour=Tools::Getifreq(anita1->freq[i],anita1->freq_forfft[0],anita1->freq_forfft[anita1->NFOUR/2-1],anita1->NFOUR/4);
1058 vhz_rx_rfcm_e[i]=scale*anita1->v_pulser[ifour];
1059 vhz_rx_rfcm_h[i]=0.;
1060 sumpower+=vhz_rx_rfcm_e[i]*vhz_rx_rfcm_e[i];
1065 for (
int ifreq=0;ifreq<Anita::NFREQ;ifreq++) {
1066 anita1->avgfreq_rfcm[ifreq]+=vhz_rx_rfcm_e[ifreq];
1070 anita1->MakeArrayforFFT(vhz_rx_rfcm_e,
volts_rx_rfcm[0], 90.,
true);
1071 anita1->MakeArrayforFFT(vhz_rx_rfcm_h,
volts_rx_rfcm[1], 90.,
true);
1081 anita1->GetNoiseWaveforms();
1087 if (settings1->SIGNAL_FLUCT) {
1088 for (
int i=0;i<anita1->NFOUR/2;i++) {
1089 for (
int ipol=0;ipol<2;ipol++){
1090 volts_rx_rfcm[ipol][i]+=anita1->timedomainnoise_rfcm[ipol][i];
1100 double vhz_rx_rfcm_lab_e[Anita::NFREQ];
1101 double vhz_rx_rfcm_lab_h[Anita::NFREQ];
1103 for (
int i=0;i<Anita::NFREQ;i++) {
1104 vhz_rx_rfcm_lab_e[i]=vhz_rx_rfcm_e[i];
1105 vhz_rx_rfcm_lab_h[i]=vhz_rx_rfcm_h[i];
1109 anita1->labAttn(vhz_rx_rfcm_lab_e);
1110 anita1->labAttn(vhz_rx_rfcm_lab_h);
1112 for (
int i=0;i<Anita::NFREQ;i++) {
1113 anita1->avgfreq_rfcm_lab[i]+=vhz_rx_rfcm_lab_e[i];
1131 if (settings1->SIGNAL_FLUCT > 0) {
1132 for (
int i=0;i<anita1->NFOUR/2;i++) {
1133 for (
int ipol=0;ipol<2;ipol++){
1154 if (!settings1->APPLYIMPULSERESPONSEDIGITIZER){
1156 Tools::ShiftRight(
volts_rx_rfcm_lab[0],anita1->NFOUR/2,
int(anita1->arrival_times[0][anita1->
GetRx(ilayer,ifold)]/anita1->TIMESTEP));
1157 Tools::ShiftRight(
volts_rx_rfcm_lab[1],anita1->NFOUR/2,
int(anita1->arrival_times[1][anita1->
GetRx(ilayer,ifold)]/anita1->TIMESTEP));
1160 for (
int i=0;i<anita1->NFOUR/2;i++) {
1191 for (
int i=0;i<n;i++) {
1192 if (fabs(waveform[i])>peak)
1193 peak=fabs(waveform[i]);
1203 (settings1->BW/(double)Anita::NFREQ/1.E6);
1207 (settings1->BW/(double)Anita::NFREQ/1.E6)*(settings1->BW/(double)Anita::NFREQ/1.E6)/50.*
1208 anita1->INTEGRATIONTIME;
1213 (settings1->BW/(double)Anita::NFREQ/1.E6);
1216 (settings1->BW/(double)Anita::NFREQ/1.E6)*(settings1->BW/(double)Anita::NFREQ/1.E6)/50.*
1217 anita1->INTEGRATIONTIME;
1228 double ChanTrigger::ADCCountstoPowerThreshold(
Anita *anita1,
int ipol,
int iant) {
1235 Float_t threshadc = (Float_t)anita1->
thresholds[ipol][iant];
1246 if (ipol==1 && iant==7){
1250 if (threshadc<anita1->minadcthresh[ipol][iant]) {
1252 cout <<
"Warning! ADC threshold is outside range of measured threshold scans.";
1253 cout <<
"It is below the minimum so set it to the minimum. Will not be warned again.\n";
1256 threshadc=anita1->minadcthresh[ipol][iant];
1258 if (threshadc>anita1->maxadcthresh[ipol][iant]) {
1260 cout <<
"Warning! ADC threshold is outside range of measured threshold scans.";
1261 cout <<
"It is higher than the maximum so set it to the maximum. Will not be warned again.\n";
1264 threshadc=anita1->maxadcthresh[ipol][iant];
1269 int index=TMath::BinarySearch(anita1->npointThresh, anita1->
threshScanThresh[ipol][iant], threshadc);
1273 thisrate=(
double)anita1->
scalers[ipol][iant];
1276 thisrate=thisrate/1.E3;
1285 if (thispowerthresh>999999)
return 5.40247;
1286 if (thispowerthresh<0.0001)
return 5.40247;
1291 return thispowerthresh;
1330 std::cerr<<
"[AnitaHardwareTrigger::rateToThreshold] : Unknown band selected (band "<<band<<
"?)!\n";
1334 return (log(rate) - constant) / slope;
1344 int whichband= Anita::WhichBand(ibw,ipol);
1346 int surf=Anita::AntennaNumbertoSurfNumber(ilayer,ifold);
1348 int antenna=Anita::GetAntennaNumber(ilayer,ifold);
1353 int antennaonsurf=(antenna-1)%4;
1355 unsigned short whichbit= 1 << (whichband-1);
1359 if (antennaonsurf<2) {
1360 if ((surfTrigBandMask[surf-1][0] & whichbit)>0)
1364 if ((surfTrigBandMask[surf-1][1] & whichbit)>0)
1377 void ChanTrigger::L1Trigger(
Anita *anita1,
double timedomain_output_1[5][Anita::NFOUR],
double timedomain_output_2[5][Anita::NFOUR],
double powerthreshold[2][5],
1378 int *channels_passing_e_forglob,
int *channels_passing_h_forglob,
int &npass) {
1380 int maxsample=TMath::MaxElement(5,anita1->imaxbin);
1381 int minsample=TMath::MinElement(5,anita1->
iminbin);
1383 for (
int j=0;j<5;j++) {
1387 for (
int i=minsample;i<maxsample;i++) {
1389 if (timedomain_output_1[j][i]<powerthreshold[0][j]*anita1->bwslice_rmsdiode[0][j] && anita1->bwslice_allowed[j]==1) {
1397 if (timedomain_output_2[j][i]<powerthreshold[1][j]*anita1->bwslice_rmsdiode[1][j] && anita1->bwslice_allowed[j]==1)
1405 int nstayhigh=(int)(anita1->l1window/anita1->TIMESTEP);
1407 for (
int j=0;j<5;j++) {
1408 for (
int i=minsample;i<maxsample;i++) {
1410 if (
flag_e[j][i-minsample]==1)
1411 for(
int k=nstayhigh-1; k>0 && i<maxsample-1; k--) {
1414 flag_e[j][i-minsample]=1;
1427 for (
int i=minsample;i<maxsample;i++) {
1428 if (
flag_h[j][i-minsample]==1)
1429 for(
int k=nstayhigh-1; k>0 && i<maxsample-1; k--) {
1431 flag_h[j][i-minsample]=1;
1448 for (
int i=minsample;i<maxsample;i++) {
1450 for (
int j=0;j<5;j++) {
1452 if (
flag_e[j][i-minsample]==1)
1454 if (
flag_h[j][i-minsample]==1)
1458 if (nbands_pass>maxbands) {
1460 maxbands=nbands_pass;
1461 for (
int j=0;j<5;j++) {
1462 channels_passing_e_forglob[j]=
flag_e[j][i-minsample];
1463 channels_passing_h_forglob[j]=
flag_h[j][i-minsample];
1484 double theta_signed=0;
1485 double theta_cant=theta_zenith-PI/2;
1486 double theta_horizon=acos(geoid/(geoid+altitude_bn));
1489 double theta_0=50*RADDEG;
1491 double integral_firsthalf=0;
1492 double integral_secondhalf=0;
1495 if (settings1->WHICH != 0) {
1497 for (
int i=0;i<NSTEPS;i++) {
1500 theta_pos=(double)fabs(-PI+(
double)i/(double)NSTEPS*2*PI);
1501 theta_signed=(double)(-PI+(
double)i/(double)NSTEPS*2*PI);
1503 if (theta_signed<theta_horizon-theta_cant) {
1504 vnoise=VSKY+VSYSTEM;
1505 integral_firsthalf+=exp(-2*ALOG2*pow(theta_pos/theta_0,2))*2*PI/NSTEPS;
1508 vnoise=VICE+VSYSTEM;
1509 integral_secondhalf+=exp(-2*ALOG2*pow(theta_pos/theta_0,2))*2*PI/NSTEPS;
1512 sum+=vnoise*exp(-2*ALOG2*pow(theta_pos/theta_0,2))*2*PI/NSTEPS;
1513 integral+=exp(-2*ALOG2*pow(theta_pos/theta_0,2))*2*PI/NSTEPS;
1519 return sqrt(sum*50.*KBOLTZ*bw);
1521 else if (settings1->WHICH == 0)
1522 return sqrt(temp*50.*KBOLTZ*bw);
1531 if (ilayer==3 && settings1->DISCONES==2)
1532 for (
int i=0;i<5;i++) {
1533 thresholds[0][i]=anita1->powerthreshold_nadir[i];
1534 thresholds[1][i]=anita1->powerthreshold_nadir[i];
1537 for (
int i=0;i<5;i++) {
1538 thresholds[0][i]=anita1->powerthreshold[i];
1539 thresholds[1][i]=anita1->powerthreshold[i];
1550 double f[3] = {250e6, 360e6, 460e6};
1551 double W[3] = { 45e6, 55e6, 50e6};
1552 double order[3] = { 2., 2., 2.};
1554 double denominator = 1.;
1555 for (
int i=0; i<3; i++){
1556 denominator += notchStatus[i]*pow(ff*W[i]/(ff*ff-f[i]*f[i]),2.*order[i]);
1559 return ampl/sqrt(denominator);
1567 #ifdef ANITA_UTIL_EXISTS 1573 if (ant<16) iring=0;
1574 else if (ant<32) iring=1;
1576 int iphi = ant - (iring*16);
1578 if (settings1->ADDCW){
1579 for (
int i=0;i<nPoints;i++){
1585 if (settings1->ZEROSIGNAL){
1586 for (
int i=0;i<nPoints;i++) y[i]=0;
1590 if (settings1->TRIGGEREFFSCAN && !pol){
1593 graph1 =
new TGraph(nPoints, x, y);
1605 if(settings1->TUFFSTATUS==0){
1611 surfSignal =
FFTtools::getConvolution(graphUp, anita1->fSignalChainResponseDigitizerTuffs[ipol][iring][iphi][anita1->tuffIndex]);
1617 if (ant%2==0) irx = ant/2;
1618 else irx = 8 + ant/2;
1628 if (settings1->SIGNAL_FLUCT && settings1->NOISEFROMFLIGHTDIGITIZER) {
1629 for (
int i=0;i<nPoints;i++){
1631 if(settings1->ADDCW){
1640 for (
int i=0;i<nPoints;i++)
justSig_digPath[ipol][i] = y[i] = surfSignalDown->Eval(x[i]);
1658 delete surfSignalDown;
1667 int nPoints = anita1->HALFNFOUR;
1668 double *x = anita1->fTimes;
1670 if (settings1->ZEROSIGNAL){
1671 for (
int i=0;i<nPoints;i++) y[i]=0;
1675 if (settings1->TRIGGEREFFSCAN && !pol){
1678 graph1 =
new TGraph(nPoints, x, y);
1684 double voltsArray[512];
1688 if (ant<16) iring=0;
1689 else if (ant<32) iring=1;
1691 int iphi = ant - (iring*16);
1697 if (settings1->TUFFSTATUS==0){
1703 surfSignal =
FFTtools::getConvolution(graphUp, anita1->fSignalChainResponseTriggerTuffs[ipol][iring][iphi][anita1->tuffIndex]);
1711 if (ant%2==0) irx = ant/2;
1712 else irx = 8 + ant/2;
1722 if (settings1->SIGNAL_FLUCT && settings1->NOISEFROMFLIGHTTRIGGER) {
1723 for (
int i=0;i<nPoints;i++){
1729 for (
int i=0;i<nPoints;i++)
justSig_trigPath[ipol][i] = y[i] = voltsArray[i] = surfSignalDown->Eval(x[i]);
1733 Tools::realft(voltsArray,1,anita1->NFOUR/2);
1736 anita1->GetArrayFromFFT(voltsArray, vhz);
1761 delete surfSignalDown;
1771 Int_t numFreqs = anita1->numFreqs;
1774 phasorsDig[0].setMagPhase(0,0);
1775 phasorsTrig[0].setMagPhase(0,0);
1776 double *freqs = anita1->freqs;
1777 Double_t sigma, realPart, imPart, trigNorm, digNorm;
1779 if (ant<16) iring=0;
1780 else if (ant<32) iring=1;
1781 TRandom * rng = getRNG(RNG_SIGNAL_FLUCT);
1783 int iphi = ant - (iring*16);
1785 for (
int ipol=0; ipol<2; ipol++){
1787 for(
int i=1;i<numFreqs;i++) {
1789 if (freqs[i]*1e6>=settings1->FREQ_LOW_SEAVEYS && freqs[i]*1e6<=settings1->FREQ_HIGH_SEAVEYS){
1790 trigNorm = anita1->fRatioTriggerToA3DigitizerFreqDomain[ipol][iring][iphi][anita1->tuffIndex][i];
1791 digNorm = anita1->fRatioDigitizerToA3DigitizerFreqDomain[ipol][iring][iphi][anita1->tuffIndex][i];
1792 sigma = anita1->RayleighFits[ipol][ant]->Eval(freqs[i])*4./TMath::Sqrt(numFreqs);
1793 realPart = rng->Gaus(0,sigma);
1794 imPart = rng->Gaus(0,sigma);
1796 trigNorm=digNorm=realPart=imPart=0.;
1798 phasorsDig[i] =
FFTWComplex(realPart*digNorm, imPart*digNorm );
1799 phasorsTrig[i] =
FFTWComplex(realPart*trigNorm, imPart*trigNorm );
1803 Double_t *justNoiseDig = rfNoiseDig->GetY();
1806 Double_t *justNoiseTrig = rfNoiseTrig->GetY();
1809 for (
int i=0; i<anita1->HALFNFOUR; i++){
1820 delete[] phasorsDig;
1821 delete[] phasorsTrig;
1830 for (
int itime=0; itime<anita1->HALFNFOUR; itime++){
1831 omega=TMath::Pi()*2.0*frequency;
1832 cw_digPath[0][itime]+=amplitude*TMath::Sin(omega*anita1->TIMESTEP*itime + phase);
1833 cw_digPath[1][itime]+=amplitude*TMath::Sin(omega*anita1->TIMESTEP*itime + phase);
1841 int phiIndex = anita1->trigEffScanPhi - (ant%16);
1842 if (phiIndex>8) phiIndex=phiIndex-16;
1843 double tmp_volts[10000];
1844 memset(tmp_volts, 0,
sizeof(tmp_volts));
1846 if (ant<16) iring=0;
1847 else if (ant<32) iring=1;
1851 if(TMath::Abs(phiIndex)<=2){
1852 att = anita1->trigEffScanAtt[phiIndex+2]-anita1->trigEffScanAtt[2];
1853 norm = (anita1->trigEffScanAtt[phiIndex+2]==0)*0 + (anita1->trigEffScanAtt[phiIndex+2]!=0)*1;
1854 norm *= anita1->trigEffScanRingsUsed[iring];
1856 int n = anita1->gPulseAtAmpa->GetN();
1858 for (
int i=0;i<n;i++){
1859 tmp_volts[i]=norm*anita1->gPulseAtAmpa->GetY()[i]*TMath::Power(10, att/20.);
1862 return new TGraph(n, anita1->gPulseAtAmpa->GetX(), tmp_volts);
1868 int phiIndex = anita1->trigEffScanPhi - (ant%16);
1869 if (phiIndex>8) phiIndex=phiIndex-16;
1870 int fNumPoints=anita1->HALFNFOUR;
1871 double tmp_volts[2][1000];
1873 if (ant<16) iring=0;
1874 else if (ant<32) iring=1;
1876 if(TMath::Abs(phiIndex)<=2){
1877 double att = anita1->trigEffScanAtt[phiIndex+2]-anita1->trigEffScanAtt[2];
1878 double norm = (anita1->trigEffScanAtt[phiIndex+2]==0)*0 + (anita1->trigEffScanAtt[phiIndex+2]!=0)*1;
1879 norm*=anita1->trigEffScanRingsUsed[iring];
1880 for (
int i=0;i<fNumPoints;i++){
1881 tmp_volts[0][i]=norm*anita1->trigEffScanPulseAtAmpa[i]*TMath::Power(10, att/20.);
1884 for (
int i=0;i<fNumPoints;i++){
1896 Tools::realft(tmp_volts[0],1,anita1->NFOUR/2);
1897 Tools::realft(tmp_volts[1],1,anita1->NFOUR/2);
1900 anita1->GetArrayFromFFT(tmp_volts[0],
vhz_rx[0][4]);
1901 anita1->GetArrayFromFFT(tmp_volts[1],
vhz_rx[1][4]);
1906 for (
int i=0;i<fNumPoints;i++){
1910 for (
int i=0;i<anita1->NFREQ;i++){
1920 int phiIndex = anita1->trigEffScanPhi - (ant%16);
1921 if (phiIndex>8) phiIndex=phiIndex-16;
1922 int fNumPoints=anita1->HALFNFOUR;
1924 if(TMath::Abs(phiIndex)<=2){
1925 int randomIndex=getRNG(RNG_INJECT)->Integer(250);
1926 double att = anita1->trigEffScanAtt[phiIndex+2];
1927 double norm = (anita1->trigEffScanAtt[phiIndex+2]==999)*0 + (anita1->trigEffScanAtt[phiIndex+2]!=999)*1;
1929 for (
int i=0;i<fNumPoints;i++){
1930 volts_triggerPath_e[i]=norm*anita1->trigEffScanPulseAtSurf[randomIndex][i]*TMath::Power(10, att/20);
1931 volts_triggerPath_h[i]=0;
1934 for (
int i=0;i<fNumPoints;i++){
1935 volts_triggerPath_e[i]=0;
1936 volts_triggerPath_h[i]=0;
1945 for (
int i=0; i<anita1->NFOUR/2; i++){
1955 for (
int i=0; i<anita1->NFOUR/2; i++){
double total_diodeinput_1_allantennas[48][HALFNFOUR]
this is across all antennas, just the full band
void injectImpulseAtSurf(Anita *anita1, double volts_triggerPath_e[Anita::HALFNFOUR], double volts_triggerPath_h[Anita::HALFNFOUR], int ant)
Inject pulse at the surf (used for trigger efficiency scans)
double cw_digPath[2][Anita::HALFNFOUR]
For digitizer path, time domain cw.
void WhichBandsPassTrigger2(Settings *settings1, Anita *anita1, GlobalTrigger *globaltrig1, Balloon *bn1, int ilayer, int ifold, double dangle, double emfrac, double hadfrac, double thresholds[2][5])
Which bands passes the trigger (for trigger scheme larger than 2)
double total_diodeinput_2_allantennas[48][HALFNFOUR]
needs comment
double justNoise_digPath[2][Anita::HALFNFOUR]
For digitizer path, time domain noise from flight.
double bwslice_energy_polh[5]
Square the sum of voltage for each slice in bandwidth for h polarization. The 5th element is the full...
unsigned short surfTrigBandMask[9][2]
Ryan's 16 bit masks for 9 surfs. 2x16 bit masks gives 32 channels per surf.
ChanTrigger()
Channel trigger constructur.
double justNoise_trigPath[2][Anita::HALFNFOUR]
For trigger path, time domain noise from flight.
double peak_v_banding_rfcm[2][5]
peak V in e/h polarization after rfcm's and banding
double getRate()
Returns the thisrate variable value (in MHz)
void InitializeEachBand(Anita *anita1)
Initialize trigger bands.
double bwslice_volts_pol0[5]
Sum voltage for each slice in bandwidth for the lcp polarization.
double bwslice_energy_pol0[5]
Square the sum of voltage for each slice in bandwidth for the 0th polarization.
void TriggerPath(Settings *settings1, Anita *anita1, int ant, Balloon *bn1)
Apply trigger path.
void WhichBandsPassTrigger1(Settings *settings1, Anita *anita1, GlobalTrigger *globaltrig1, Balloon *bn1, int ilayer, int ifold, double thresholds[2][5])
Which bands passes the trigger (for trigger scheme 0 and 1)
double rateToThreshold(double rate, int band)
Calculates the trigger threshold for an antenna via a fit from the "singles" rate and band identifier...
double bwslice_energy_pole[5]
Square the sum of voltage for each slice in bandwidth for e polarization. The 5th element is the full...
Float_t threshScanScaler[2][48][npointThresh]
scalers from threshold scan
vector< double > vthreshold_eachband[2]
Threshold in each band.
void L1Trigger(Anita *anita1, double timedomain_output_1[5][Anita::NFOUR], double timedomain_output_2[5][Anita::NFOUR], double powerthreshold[2][5], int *channels_passing_e_forglob, int *channels_passing_h_forglob, int &npass)
The L1 trigger of the Anita trigger scheme.
vector< int > flag_e[5]
Which bands pass trigger e.
double bwslice_volts_pol0_em[5]
Component of the voltage that comes from the em shower for 0th polarization.
void applyImpulseResponseDigitizer(Settings *settings1, Anita *anita1, int nPoints, int ant, double *x, double y[512], bool pol)
Apply impulse response to digitizer path.
void ApplyAntennaGain(Settings *settings1, Anita *anita1, Balloon *bn1, Screen *panel1, int ant, Vector &n_eplane, Vector &n_hplane, Vector &n_normal)
Apply the antenna gain.
int GetRxTriggerNumbering(int ilayer, int ifold)
get antenna number based on which layer and position it is
double vhz_rx[2][5][Anita::NFREQ]
Array of amplitudes in the Fourier domain (V/Hz) after the antenna gain. Indeces stand for [ipol][iba...
void applyImpulseResponseTrigger(Settings *settings1, Anita *anita1, int ant, double y[512], double *vhz, bool pol)
Apply impulse response to trigger path.
void TimeShiftAndSignalFluct(Settings *settings1, Anita *anita1, int ilayer, int ifold, double volts_rx_rfcm_lab_e_all[48][512], double volts_rx_rfcm_lab_h_all[48][512])
Time shift and fluctuate signal.
double bwslice_volts_pol1[5]
Sum voltage for each slice in bandwidth for the rcp polarization.
double total_diodeinput_1_inanita[5][HALFNFOUR]
this is the waveform that is input to the tunnel diode in the first (LCP or vertical) polarization ...
static void ConvertEHtoLREnergy(double, double, double &, double &)
Convert E and H to left and right energy.
double volts_rx_forfft[2][5][Anita::HALFNFOUR]
Array of time domain after the antenna gain. Indeces stand for [ipol][iband][itime].
This is a wrapper class for an RF Signal.
double GetVmmhz_freq(int i)
Get the Vmmhz value stored at the specified index.
vector< double > vnoise_eachband[2]
Noise in each band.
void saveTriggerWaveforms(Anita *anita1, double sig0[48], double sig1[48], double noise0[48], double noise1[48])
Save signal and noise waveforms at trigger.
double GetNvalidPoints()
Gets the total number of points.
UShort_t scalers[2][48]
scalers as read from the surf file: first index is pol, second is antenna number (only working for An...
double noise_eachband[2][Anita::NBANDS_MAX]
Noise in each band.
double volts_rx_rfcm_lab[2][Anita::HALFNFOUR]
For digitizer path, time domain voltage vs. time after rx, rfcm's and lab.
double applyButterworthFilter(double ff, double ampl, int notchStatus[3])
Apply Butterworth Filter.
Reads in and stores input settings for the run.
void GetAnitaLayerPhiSector(Settings *settings1, int i, int j, int &whichlayer, int &whichphisector)
Provides a mapping between the 4 layers and 16 phi sectors physically to the 3 layers and 16 sectors ...
static double GetNoise(Settings *settings1, double altitude_bn, double geoid, double theta, double bw, double temp)
Get Noise.
double peak_rx_rfcm_lab[2]
peaks of the previous arrays
double total_diodeinput_2_inanita[5][HALFNFOUR]
this is the waveform that is input to the tunnel diode in the second (RCP or horizontal) polarization...
void saveDigitizerWaveforms(Anita *anita1, double sig0[48], double sig1[48], double noise0[48], double noise1[48])
Save signal and noise waveforms at digitizer.
int NBANDS
number of frequency sub-bands (not counting full band)
int iminbin[5]
this is the minimum bin to start
UShort_t thresholds[2][48]
thresholds as read from the surf file: first index is pol, second is antenna number (only working for...
void getNoiseFromFlight(Settings *settings1, Anita *anita1, int ant, bool also_digi=true)
Add noise from ANITA-3 flight to the time domain waveforms.
double timedomain_output_inanita[2][5][HALFNFOUR]
this is just for writing out to the following tree
This is a wrapper class for a complex number.
double v_banding_rfcm[2][5][Anita::NFREQ]
This is Volts/m as a function of frequency after rfcm's and banding.
double integral_vmmhz
Electric field integral.
static void ConvertEHtoLREfield(double, double, double &, double &)
Convert E and H to left and right e field.
vector< int > vpasses_eachband[2]
Whether the signal passes or not each band.
Vector GetVec2bln(int i)
Gets the to-balloon vector at the specified index.
double GetDelay(int i)
Get the delay value stores at the specified index.
void DigitizerPath(Settings *settings1, Anita *anita1, int ant, Balloon *bn1)
Apply digitizer path.
Contains everything about positions within payload and signals it sees for each event, in both the trigger and signal paths.
void addToChannelSums(Settings *settings1, Anita *anita1, int ibw, int k)
Increment the volts in each band.
double justSig_trigPath[2][Anita::HALFNFOUR]
Just signal in trigger path.
double threshold_eachband[2][Anita::NBANDS_MAX]
Threshold in each band.
double bwslice_volts_pol1_em[5]
Component of the voltage that comes from the em shower for 1st polarization.
double peak_rx_rfcm_signalonly[2]
peak voltage in e/h polarization received by the antenna
static double FindPeak(double *waveform, int n)
Find peak voltage of a waveform.
double v_banding_rfcm_forfft[2][5][HALFNFOUR]
Starts out as V/s vs. freq after banding, rfcm, after fft it is V vs. t.
double justSig_digPath[2][Anita::HALFNFOUR]
Just signal in trigger path.
int passes_eachband[2][Anita::NBANDS_MAX]
Whether the signal passes or not each band.
double ston[5]
signal to noise;
double vm_banding_rfcm_forfft[2][5][HALFNFOUR]
Tunnel diode input (signal + noise)
int unwarned
Whether we have warned the user about resetting thresholds when they are beyond the measured bounds...
int GetRx(int ilayer, int ifold)
get antenna number based on which layer and position it is
double THERMALNOISE_FACTOR
factor to multiply thermal noise for error analysis
int channels_passing[2][5]
channels passing. This is reset for every antenna for every event
double bwslice_volts_polh[5]
Sum voltage for each slice in bandwidth for the h polarization.
double timedomain_output_allantennas[2][48][HALFNFOUR]
this is across all antennas, just the full band
TGraph * getPulserAtAMPA(Anita *anita1, int ant)
Get time domain graph of pulse at AMPA (used for trigger efficiency scans)
void WhichBandsPass(Settings *settings1, Anita *anita1, GlobalTrigger *globaltrig1, Balloon *bn1, int ilayer, int ifold, double dangle, double emfrac, double hadfrac, double thresholds[2][5])
Which bands passes the trigger.
void DiodeConvolution(Settings *settings1, Anita *anita1, GlobalTrigger *globaltrig1, int ilayer, int ifold, double mindiodeconvl[5], double onediodeconvl[5], double psignal[5][Anita::NFOUR], double timedomain_output[5][Anita::NFOUR], double timedomain_output_justNoise[5][Anita::NFOUR], int ibinshift, int ipol, double thresholds[2][5])
Apply the diode convolution.
void GetEcompHcompEvector(Settings *settings1, Vector n_eplane, Vector n_hplane, const Vector n_pol, double &e_component, double &h_component, double &n_component)
This function gets the e-component, h-component and e-vector.
static int IsItUnmasked(unsigned short surfTrigBandMask[9][2], int ibw, int ilayer, int ifold, int ipol)
Returns whether the indicated antenna and band are "masked".
vector< double > vsignal_eachband[2]
Signal in each band.
double peak_rx_rfcm[2]
peak voltage in e/h polarization received by the antenna
Handles everything related to balloon positions, payload orientation over the course of a flight...
Double_t fakeThresholds2[2][48]
Fake thresholds 2 (coming from converting flight scalers to thresholds)
This class represents a three-vector. Operators are overloaded to provide for the familiar operations...
Float_t threshScanThresh[2][48][npointThresh]
adc thresholds from threshold scan
void GetThresholds(Settings *settings1, Anita *anita1, int ilayer, double thresholds[2][5])
Sets the threshold values based on which payload and where the antenna is located physically...
double bwslice_volts_pole[5]
Sum voltage for each slice in bandwidth for the e polarization.
Vector GetPol(int i)
Gets the polarization vector at the specified index.
void GetHitAngles(double e_component_kvector, double h_component_kvector, double n_component_kvector, double &hitangle_e, double &hitangle_h)
This function gets the hit angles.
void injectImpulseAfterAntenna(Anita *anita1, int ant)
Inject pulse after the antenna (used for trigger efficiency scans)
vector< int > flag_h[5]
Which bands pass trigger h.
double bwslice_energy_pol1[5]
Square the sum of voltage for each slice in bandwidth for the 1st polarization.
double signal_vpol_inanita[5][HALFNFOUR]
this is the signal waveform in the vertical polarization, before converting to LCP, RCP where applicable
double v_banding_rfcm_forfft_temp[2][5][HALFNFOUR]
Use for the averaging over 10 neighboring bins.
double signal_eachband[2][Anita::NBANDS_MAX]
Signal in each band.
int maxbin_fortotal[5]
when it sums the noise and signal together it shortens the waveform
double total_vpol_inanita[5][HALFNFOUR]
this is the sum of the signal and noise in the vertical polarization, before converting to LCP...
void GetEcompHcompkvector(Vector n_eplane, Vector n_hplane, Vector n_normal, const Vector n_exit2bn, double &e_component_kvector, double &h_component_kvector, double &n_component_kvector)
This function gets the e-component, h-component and k-vector.
double vm_banding_rfcm_forfft_justNoise[2][5][HALFNFOUR]
Tunnel diode input (just noise)
double volts_rx_rfcm[2][Anita::HALFNFOUR]
For digitizer path, time domain voltage vs. time after rx, rfcm's.
void calculateCW(Anita *anita1, double frequency, double phase, double amplitude)
Add CW.
int channels_passing_justNoise[2][5]
channels passing. This is reset for every antenna for every event