19 #include "TTreeIndex.h" 27 #include "icemc_random.h" 30 #include "TPostScript.h" 35 #include "TGraphErrors.h" 36 #include "TGraphAsymmErrors.h" 41 #include "TRotation.h" 43 #include "Math/InterpolationTypes.h" 44 #include "Math/Interpolator.h" 47 #include "EnvironmentVariable.h" 50 #include "Constants.h" 52 #include "position.hh" 54 #include "earthmodel.hh" 57 #include "roughness.hh" 60 #include "icemodel.hh" 64 #include "secondaries.hh" 66 #include "counting.hh" 67 #include "Primaries.h" 68 #include "Taumodel.hh" 70 #include "GlobalTrigger.h" 71 #include "ChanTrigger.h" 76 #if __cplusplus > 199711L 77 #include <type_traits> 82 #ifdef ANITA_UTIL_EXISTS 83 #include "UsefulAnitaEvent.h" 84 #include "AnitaGeomTool.h" 85 #include "AnitaConventions.h" 86 #include "RawAnitaHeader.h" 92 #ifdef ANITA3_EVENTREADER 93 #include "TruthAnitaEvent.h" 113 #ifdef ANITA_UTIL_EXISTS 114 int GetIceMCAntfromUsefulEventAnt(
Settings *settings1,
int UsefulEventAnt);
120 bool ABORT_EARLY =
false;
123 void interrupt_signal_handler(
int sig);
125 int main(
int argc,
char **argv) {
131 string input=
"inputs.txt";
136 if( (argc%3!=1)&&(argc%2!=1)) {
137 cout <<
"Syntax for options: -i inputfile -o outputdir -r run_number\n";
142 double trig_thresh=0.;
145 while ((clswitch = getopt(argc, argv,
"t:i:o:r:n:e:")) != EOF) {
148 nnu_tmp=atoi(optarg);
149 cout <<
"Changed number of simulated neutrinos to " << nnu_tmp << endl;
152 trig_thresh=atof(optarg);
156 cout <<
"Changed input file to: " << input << endl;
160 cout <<
"Changed output directory to: " << outputdir.Data() << endl;
161 stemp=
"mkdir " + string(outputdir.Data());
162 system(stemp.c_str());
165 exp_tmp=atof(optarg);
166 cout <<
"Changed neutrino energy exponent to " << exp_tmp << endl;
170 stringstream convert(run_num);
178 settings1->SEED=settings1->SEED +run_no;
179 cout <<
"seed is " << settings1->SEED << endl;
181 setSeed(settings1->SEED);
185 Anita *anita1=
new Anita();
195 double vmmhz[Anita::NFREQ];
197 double vmmhz_em[Anita::NFREQ];
199 stemp=string(outputdir.Data())+
"/output"+run_num+
".txt";
200 ofstream foutput(stemp.c_str(), ios::app);
203 double RANDOMISEPOL=0.;
205 int neutrinos_passing_all_cuts=0;
207 int discones_passing=0;
209 settings1->ReadInputs(input.c_str(), foutput, NNU, RANDOMISEPOL);
210 settings1->ApplyInputs(anita1, sec1, sig1, bn1, ray1);
213 settings1->SEED=settings1->SEED + run_no;
214 setSeed(settings1->SEED);
217 anita1->Initialize(settings1, foutput, inu, outputdir);
220 anita1->powerthreshold[4]=trig_thresh;
224 settings1->EXPONENT=exp_tmp;
228 Screen *panel1 =
new Screen(0);
230 time_t raw_start_time = time(NULL);
231 struct tm * start_time = localtime(&raw_start_time);
233 cout <<
"Date and time at start of run are: " << asctime (start_time) <<
"\n";
240 Tools::Zero(anita1->PHI_OFFSET, Anita::NLAYERS_MAX);
241 Tools::Zero(anita1->THETA_ZENITH, Anita::NLAYERS_MAX);
242 Tools::Zero(anita1->LAYER_VPOSITION, Anita::NLAYERS_MAX);
243 Tools::Zero(anita1->RRX, Anita::NLAYERS_MAX);
245 double volts_rx_rfcm_lab_e_all[48][512];
246 double volts_rx_rfcm_lab_h_all[48][512];
249 Vector n_eplane = const_z;
250 Vector n_hplane = -const_y;
251 Vector n_normal = const_x;
260 double e_component[Anita::NANTENNAS_MAX]={0};
261 double h_component[Anita::NANTENNAS_MAX]={0};
262 double n_component[Anita::NANTENNAS_MAX]={0};
264 double e_component_kvector[Anita::NANTENNAS_MAX]={0};
265 double h_component_kvector[Anita::NANTENNAS_MAX]={0};
266 double n_component_kvector[Anita::NANTENNAS_MAX]={0};
269 double hitangle_e, hitangle_h;
270 double hitangle_e_all[Anita::NANTENNAS_MAX];
271 double hitangle_h_all[Anita::NANTENNAS_MAX];
280 int l2trig[
Anita::NPOL][Anita::NTRIGGERLAYERS_MAX];
282 int l1trig[
Anita::NPOL][Anita::NTRIGGERLAYERS_MAX];
289 int nchannels_triggered = 0;
290 int nchannels_perrx_triggered[48];
293 Tools::Zero(count1->npass, 2);
297 #ifdef ANITA_UTIL_EXISTS 299 string outputAnitaFile =string(outputdir.Data())+
"/SimulatedAnitaEventFile"+run_num+
".root";
300 TFile *anitafileEvent =
new TFile(outputAnitaFile.c_str(),
"RECREATE");
302 TTree *eventTree =
new TTree(
"eventTree",
"eventTree");
303 eventTree->Branch(
"event", &realEvPtr );
304 eventTree->Branch(
"run", &run_no,
"run/I" );
305 eventTree->Branch(
"weight", &weight,
"weight/D");
307 outputAnitaFile =string(outputdir.Data())+
"/SimulatedAnitaHeadFile"+run_num+
".root";
308 TFile *anitafileHead =
new TFile(outputAnitaFile.c_str(),
"RECREATE");
310 TTree *headTree =
new TTree(
"headTree",
"headTree");
311 headTree->Branch(
"header", &rawHeaderPtr );
312 headTree->Branch(
"weight", &weight,
"weight/D");
314 outputAnitaFile =string(outputdir.Data())+
"/SimulatedAnitaGpsFile"+run_num+
".root";
315 TFile *anitafileGps =
new TFile(outputAnitaFile.c_str(),
"RECREATE");
317 TTree *adu5PatTree =
new TTree(
"adu5PatTree",
"adu5PatTree");
318 adu5PatTree->Branch(
"pat", &Adu5PatPtr );
319 adu5PatTree->Branch(
"eventNumber", &eventNumber,
"eventNumber/I");
320 adu5PatTree->Branch(
"weight", &weight,
"weight/D" );
324 #ifdef ANITA3_EVENTREADER 327 AnitaVersion::set(settings1->ANITAVERSION);
329 outputAnitaFile =string(outputdir.Data())+
"/SimulatedAnitaTruthFile"+run_num+
".root";
330 TFile *anitafileTruth =
new TFile(outputAnitaFile.c_str(),
"RECREATE");
332 TString icemcgitversion = TString::Format(
"%s", EnvironmentVariable::ICEMC_VERSION(outputdir));
333 printf(
"ICEMC GIT Repository Version: %s\n", icemcgitversion.Data());
334 unsigned int timenow = time(NULL);
336 TTree *configAnitaTree =
new TTree(
"configIcemcTree",
"Config file and settings information");
337 configAnitaTree->Branch(
"gitversion", &icemcgitversion );
338 configAnitaTree->Branch(
"startTime", &timenow );
340 configAnitaTree->Fill();
342 TTree *triggerSettingsTree =
new TTree(
"triggerSettingsTree",
"Trigger settings");
343 triggerSettingsTree->Branch(
"dioderms", anita1->bwslice_dioderms_fullband_allchan,
"dioderms[2][48][7]/D");
344 triggerSettingsTree->Branch(
"diodemean", anita1->bwslice_diodemean_fullband_allchan,
"diodemean[2][48][7]/D");
345 triggerSettingsTree->Fill();
347 TTree *truthAnitaTree =
new TTree(
"truthAnitaTree",
"Truth Anita Tree");
348 truthAnitaTree->Branch(
"truth", &truthEvPtr );
356 IceModel *antarctica =
new IceModel(settings1->ICE_MODEL + settings1->NOFZ*10, settings1->CONSTANTICETHICKNESS * 1000 + settings1->CONSTANTCRUST * 100 + settings1->FIXEDELEVATION * 10 + 0, settings1->WEIGHTABSORPTION);
359 anita1->GetBeamWidths(settings1);
362 anita1->Set_gain_angle(settings1, sig1->NMEDIUM_RECEIVER);
371 anita1->SetNoise(settings1, bn1, antarctica);
375 antarctica->GetMAXHORIZON(bn1);
378 antarctica->CreateHorizons(settings1, bn1, bn1->theta_bn, bn1->
phi_bn, bn1->altitude_bn, foutput);
379 cout <<
"Done with CreateHorizons.\n";
382 anita1->GetPayload(settings1, bn1);
384 if (settings1->TRIGGERSCHEME == 3 || settings1->TRIGGERSCHEME == 4 || settings1->TRIGGERSCHEME==5) {
387 anita1->calculate_all_offsets();
388 double angle_theta=16.;
390 Vector x =
Vector(cos(angle_theta * RADDEG) * cos((angle_phi+11.25) * RADDEG),
391 cos(angle_theta * RADDEG) * sin((angle_phi+11.25) * RADDEG),
392 sin(angle_theta * RADDEG));
393 anita1->GetArrivalTimes(x,bn1,settings1);
394 cout <<
"end of getarrivaltimes\n";
397 time_t raw_loop_start_time = time(NULL);
398 cout<<
"Starting loop over events. Time required for setup is "<<(int)((raw_loop_start_time - raw_start_time)/60)<<
":"<< ((raw_loop_start_time - raw_start_time)%60)<<endl;
402 signal(SIGINT, interrupt_signal_handler);
404 double justNoise_trig[2][48][512];
405 double justSignal_trig[2][48][512];
406 double justNoise_dig[2][48][512];
407 double justSignal_dig[2][48][512];
409 double thresholdsAnt[48][2][5];
411 int passes_thisevent=0;
418 for (inu = 0; inu < NNU; inu++) {
421 if (inu % (NNU / 100) == 0)
422 cout << inu <<
" neutrinos. " << (double(inu)/double(NNU)) * 100 <<
"% complete.\n";
425 cout << inu <<
" neutrinos. " << (double(inu) / double(NNU)) * 100 <<
"% complete.\n";
428 eventNumber=(UInt_t)(run_no)*NNU+inu;
431 setSeed(eventNumber);
433 anita1->passglobtrig[0]=0;
434 anita1->passglobtrig[1]=0;
440 for (
int i=0; i<Anita::NFREQ;i++) {
446 bn1->
PickBalloonPosition(antarctica, settings1, inu, anita1, getRNG(RNG_BALLOON_POSITION)->Rndm());
461 Tools::Zero(anita1->arrival_times[0], Anita::NLAYERS_MAX*
Anita::NPHI_MAX);
462 Tools::Zero(anita1->arrival_times[1], Anita::NLAYERS_MAX*
Anita::NPHI_MAX);
464 if(settings1->BORESIGHTS)
465 anita1->GetArrivalTimesBoresights(direction2bn_eachboresight);
467 anita1->GetArrivalTimes(direction2bn,bn1,settings1);
469 anita1->rx_minarrivaltime=Tools::WhichIsMin(anita1->arrival_times[0], settings1->NANTENNAS);
472 globaltrig1->volts_rx_rfcm_trigger.assign(16, vector <vector <double> >(3, vector <double>(0)));
473 anita1->rms_rfcm_e_single_event = 0;
477 for (
int ilayer=0; ilayer < settings1->NLAYERS; ilayer++) {
478 for (
int ifold=0;ifold<anita1->NRX_PHI[ilayer];ifold++) {
484 panel1->ResetParameters();
486 panel1->SetNvalidPoints(1);
490 for (
int k=0;k<Anita::NFREQ;k++) {
491 panel1->AddVmmhz_freq(vmmhz[k]);
493 panel1->AddDelay( 0. );
495 panel1->AddVec2bln(direction2bn);
497 panel1->AddPol(n_pol);
498 panel1->AddWeight( 1. );
499 panel1->SetWeightNorm( 1. );
502 sourceLon=sourceLat=sourceAlt=0;
508 if (!settings1->BORESIGHTS) {
509 bn1->
GetEcompHcompkvector(n_eplane, n_hplane, n_normal, direction2bn, e_component_kvector[count_rx], h_component_kvector[count_rx], n_component_kvector[count_rx]);
510 bn1->
GetEcompHcompEvector(settings1, n_eplane, n_hplane, n_pol, e_component[count_rx], h_component[count_rx], n_component[count_rx]);
513 bn1->
GetEcompHcompkvector(n_eplane, n_hplane, n_normal, ray1->n_exit2bn_eachboresight[2][ilayer][ifold], e_component_kvector[count_rx], h_component_kvector[count_rx], n_component_kvector[count_rx]);
514 bn1->
GetEcompHcompEvector(settings1, n_eplane, n_hplane, n_pol_eachboresight[ilayer][ifold], e_component[count_rx], h_component[count_rx], n_component[count_rx]);
516 bn1->
GetHitAngles(e_component_kvector[count_rx], h_component_kvector[count_rx], n_component_kvector[count_rx], hitangle_e, hitangle_h);
518 hitangle_h_all[count_rx]=hitangle_h;
519 hitangle_e_all[count_rx]=hitangle_e;
523 antNum = anita1->GetRxTriggerNumbering(ilayer, ifold);
525 chantrig1->
ApplyAntennaGain(settings1, anita1, bn1, panel1, antNum, n_eplane, n_hplane, n_normal);
527 chantrig1->
TriggerPath(settings1, anita1, antNum, bn1);
531 chantrig1->
TimeShiftAndSignalFluct(settings1, anita1, ilayer, ifold, volts_rx_rfcm_lab_e_all, volts_rx_rfcm_lab_h_all);
533 chantrig1->
saveTriggerWaveforms(anita1, justSignal_trig[0][antNum], justSignal_trig[1][antNum], justNoise_trig[0][antNum], justNoise_trig[1][antNum]);
534 chantrig1->
saveDigitizerWaveforms(anita1, justSignal_dig[0][antNum], justSignal_dig[1][antNum], justNoise_dig[0][antNum], justNoise_dig[1][antNum]);
537 double thresholds[2][5];
539 chantrig1->
WhichBandsPass(settings1, anita1, globaltrig1, bn1, ilayer, ifold, 0, 0, 0, thresholdsAnt[antNum]);
549 anita1->rms_rfcm_e_single_event = sqrt(anita1->rms_rfcm_e_single_event / (anita1->HALFNFOUR * settings1->NANTENNAS));
551 for (
int irx=0;irx<settings1->NANTENNAS;irx++) {
552 nchannels_perrx_triggered[irx]=globaltrig1->nchannels_perrx_triggered[irx];
555 nchannels_triggered=Tools::iSum(globaltrig1->nchannels_perrx_triggered, settings1->NANTENNAS);
565 globaltrig1->
PassesTrigger(settings1, anita1, discones_passing, 2, l3trig, l2trig, l1trig, settings1->antennaclump, loctrig, loctrig_nadironly, inu,
568 for (
int i=0;i<2;i++) {
569 for (
int j=0;j<16;j++) {
570 for (
int k=0;k<anita1->HALFNFOUR;k++) {
571 count1->nl1triggers[i][0]+=anita1->l1trig_anita3and4_inanita[i][j][k];
585 if ( (thispasses[0]==1 && anita1->pol_allowed[0]==1)
586 || (thispasses[1]==1 && anita1->pol_allowed[1]==1)
587 || (settings1->MINBIAS==1)) {
591 anita1->passglobtrig[0]=thispasses[0];
592 anita1->passglobtrig[1]=thispasses[1];
596 count1->npassestrigger[0]++;
601 #ifdef ANITA_UTIL_EXISTS 606 Adu5PatPtr->
latitude= bn1->latitude;
610 Adu5PatPtr->
heading = bn1->heading;
611 Adu5PatPtr->
pitch = bn1->pitch;
612 Adu5PatPtr->roll = bn1->roll;
613 Adu5PatPtr->run = run_no;
616 memset(realEvPtr->
fVolts, 0,
sizeof(realEvPtr->
fVolts) );
617 memset(realEvPtr->
fTimes, 0,
sizeof(realEvPtr->
fTimes) );
619 int fNumPoints = 260;
621 for (
int iant = 0; iant < settings1->NANTENNAS; iant++){
623 int IceMCAnt = GetIceMCAntfromUsefulEventAnt(settings1, iant);
626 realEvPtr->
fNumPoints[UsefulChanIndexV] = fNumPoints;
627 realEvPtr->
fNumPoints[UsefulChanIndexH] = fNumPoints;
628 realEvPtr->
chanId[UsefulChanIndexV] = UsefulChanIndexV;
629 realEvPtr->
chanId[UsefulChanIndexH] = UsefulChanIndexH;
631 for (
int j = 0; j < fNumPoints; j++) {
633 realEvPtr->
fTimes[UsefulChanIndexV][j] = j * anita1->TIMESTEP * 1.0E9;
634 realEvPtr->
fTimes[UsefulChanIndexH][j] = j * anita1->TIMESTEP * 1.0E9;
636 realEvPtr->
fVolts[UsefulChanIndexH][j] = volts_rx_rfcm_lab_h_all[IceMCAnt][j+128]*1000;
638 realEvPtr->
fVolts[UsefulChanIndexV][j] = volts_rx_rfcm_lab_e_all[IceMCAnt][j+128]*1000;
649 if (settings1->MINBIAS==1)
654 rawHeaderPtr->
run = run_no;
664 if (settings1->WHICH<9){
665 rawHeaderPtr->
phiTrigMask = (short) anita1->phiTrigMask;
671 Adu5PatPtr->
latitude= bn1->latitude;
675 Adu5PatPtr->
heading = bn1->heading;
676 Adu5PatPtr->
pitch = bn1->pitch;
677 Adu5PatPtr->roll = bn1->roll;
678 Adu5PatPtr->run = run_no;
680 #ifdef ANITA3_EVENTREADER 681 if (settings1->WHICH==9 || settings1->WHICH==10) {
684 rawHeaderPtr->setMask( (
short) anita1->l1TrigMask, (
short) anita1->phiTrigMask,
AnitaPol::kVertical);
685 rawHeaderPtr->setMask( (
short) anita1->l1TrigMaskH, (
short) anita1->phiTrigMaskH,
AnitaPol::kHorizontal);
691 truthEvPtr->
run = run_no;
692 truthEvPtr->
nuMom = 0;
694 memcpy(truthEvPtr->
e_component, e_component,
sizeof(e_component));
695 memcpy(truthEvPtr->
h_component, h_component,
sizeof(h_component));
696 memcpy(truthEvPtr->
n_component, n_component,
sizeof(n_component));
697 memcpy(truthEvPtr->
e_component_k ,e_component_kvector,
sizeof(e_component_kvector));
698 memcpy(truthEvPtr->
h_component_k ,h_component_kvector,
sizeof(h_component_kvector));
699 memcpy(truthEvPtr->
n_component_k ,n_component_kvector,
sizeof(n_component_kvector));
703 truthEvPtr->
weight = weight;
704 for (
int i=0;i<3;i++){
707 truthEvPtr->
nuPos[i] = 0;
708 truthEvPtr->
nuDir[i] = 0;
710 for (
int i=0;i<5;i++){
711 for (
int j=0;j<3;j++){
716 for (
int i=0;i<48;i++){
717 truthEvPtr->
hitangle_e[i] = hitangle_e_all[i];
718 truthEvPtr->
hitangle_h[i] = hitangle_h_all[i];
720 if(settings1->ROUGHNESS){
721 for (
int i=0;i<Anita::NFREQ;i++)
722 truthEvPtr->
vmmhz[i] = panel1->GetVmmhz_freq(i);
737 for (
int iant = 0; iant < settings1->NANTENNAS; iant++){
741 truthEvPtr->
SNRAtTrigger[UsefulChanIndexV] = Tools::calculateSNR(justSignal_trig[0][iant], justNoise_trig[0][iant]);
742 truthEvPtr->
SNRAtTrigger[UsefulChanIndexH] = Tools::calculateSNR(justSignal_trig[1][iant], justNoise_trig[1][iant]);
747 truthEvPtr->
SNRAtDigitizer[UsefulChanIndexV] = Tools::calculateSNR(justSignal_dig[0][iant], justNoise_dig[0][iant]);
748 truthEvPtr->
SNRAtDigitizer[UsefulChanIndexH] = Tools::calculateSNR(justSignal_dig[1][iant], justNoise_dig[1][iant]);
754 truthEvPtr->
thresholds[UsefulChanIndexV] = thresholdsAnt[iant][0][4];
755 truthEvPtr->
thresholds[UsefulChanIndexH] = thresholdsAnt[iant][1][4];
758 if (iant%2) irx = iant/2;
759 else irx = iant/2 + 1;
762 for (
int j = 0; j < fNumPoints; j++) {
763 truthEvPtr->
fTimes[UsefulChanIndexV][j] = j * anita1->TIMESTEP * 1.0E9;
764 truthEvPtr->
fTimes[UsefulChanIndexH][j] = j * anita1->TIMESTEP * 1.0E9;
766 truthEvPtr->
fSignalAtTrigger[UsefulChanIndexV][j] = justSignal_trig[0][iant][j+128]*1000;
767 truthEvPtr->
fSignalAtTrigger[UsefulChanIndexH][j] = justSignal_trig[1][iant][j+128]*1000;
768 truthEvPtr->
fNoiseAtTrigger[UsefulChanIndexV][j] = justNoise_trig[0][iant][j+128]*1000;
769 truthEvPtr->
fNoiseAtTrigger[UsefulChanIndexH][j] = justNoise_trig[1][iant][j+128]*1000;
770 truthEvPtr->
fSignalAtDigitizer[UsefulChanIndexV][j] = justSignal_dig[0][iant][j+128]*1000;
771 truthEvPtr->
fSignalAtDigitizer[UsefulChanIndexH][j] = justSignal_dig[1][iant][j+128]*1000;
772 truthEvPtr->
fNoiseAtDigitizer[UsefulChanIndexV][j] = justNoise_dig[0][iant][j+128]*1000;
773 truthEvPtr->
fNoiseAtDigitizer[UsefulChanIndexH][j] = justNoise_dig[1][iant][j+128]*1000;
775 truthEvPtr->
fDiodeOutput[UsefulChanIndexV][j] = anita1->timedomain_output_allantennas[0][irx][j];
776 truthEvPtr->
fDiodeOutput[UsefulChanIndexH][j] = anita1->timedomain_output_allantennas[1][irx][j];
782 truthAnitaTree->Fill();
795 neutrinos_passing_all_cuts++;
818 std::cout <<
"\n***********************************************************";
819 std::cout <<
"\n* SIGINT received, aborting loop over events early.";
820 std::cout <<
"\n* Stopped after event " << inu <<
" instead of " << NNU;
821 std::cout <<
"\n* Any output which relied on NNU should be corrected for.";
822 std::cout <<
"\n***********************************************************\n";
823 foutput <<
"\n***********************************************************";
824 foutput <<
"\n* SIGINT received, aborting loop over events early.";
825 foutput <<
"\n* Stopped after event " << inu <<
" instead of " << NNU;
826 foutput <<
"\n* Any output which relied on NNU should be corrected for.";
827 foutput <<
"\n***********************************************************\n";
837 #ifdef ANITA_UTIL_EXISTS 839 anitafileEvent->cd();
840 eventTree->Write(
"eventTree");
841 anitafileEvent->Close();
842 delete anitafileEvent;
845 headTree->Write(
"headTree");
846 anitafileHead->Close();
847 delete anitafileHead;
850 adu5PatTree->Write(
"adu5PatTree");
851 anitafileGps->Close();
854 #ifdef ANITA3_EVENTREADER 855 anitafileTruth->cd();
856 configAnitaTree->Write(
"configAnitaTree");
857 truthAnitaTree->Write(
"truthAnitaTree");
858 triggerSettingsTree->Write(
"triggerSettingsTree");
859 anitafileTruth->Close();
860 delete anitafileTruth;
874 void interrupt_signal_handler(
int sig){
875 signal(sig, SIG_IGN);
881 #ifdef ANITA_UTIL_EXISTS 883 int GetIceMCAntfromUsefulEventAnt(
Settings *settings1,
int UsefulEventAnt){
887 int IceMCAnt = UsefulEventAnt;
888 if ((settings1->WHICH==9 || settings1->WHICH==10) && UsefulEventAnt<16) {
889 IceMCAnt = (UsefulEventAnt%2==0)*UsefulEventAnt/2 + (UsefulEventAnt%2==1)*(UsefulEventAnt/2+8);
UInt_t eventNumber
Event number from software.
Double_t h_component_k[48]
Component of the e-field along the rx h-plane.
Double_t rfExitPos[5][3]
Position where the RF exits the ice- 5 iterations, 3 dimensions each.
Double_t fNoiseAtDigitizer[12 *9][260]
Array of noise at digitizer.
void PassesTrigger(Settings *settings1, Anita *anita1, int discones_passing, int mode, int *l3trig, int l2trig[Anita::NPOL][Anita::NTRIGGERLAYERS_MAX], int l1trig[Anita::NPOL][Anita::NTRIGGERLAYERS_MAX], int antennaclump, int loctrig[Anita::NPOL][Anita::NLAYERS_MAX][Anita::NPHI_MAX], int loctrig_nadironly[Anita::NPOL][Anita::NPHI_MAX], int inu, int *thispasses, bool noiseOnly=false)
Evaluate the full trigger simulation for a given payload configuration.
Double_t weight
Weight assigned by icemc.
Int_t nu_pdg
Neutrino PDG code.
Position r_bn
position of balloon
Double_t sourceLat
RF position when leaving the ice: Latitude (using icemc model)
double fVolts[12 *9][260]
Array of unwrapped (unless kNoCalib) voltages for each channel.
double phi_bn
theta,phi of balloon wrt south pole
void InitializeEachBand(Anita *anita1)
Initialize trigger bands.
Adu5Pat – The ADU5 Position and Attitude Data.
void TriggerPath(Settings *settings1, Anita *anita1, int ant, Balloon *bn1)
Apply trigger path.
static const int NPOL
number of polarizations
Double_t n_component_k[48]
Component of the e-field along the normal.
Double_t fDiodeOutput[12 *9][260]
Array of tunnel diode output.
Float_t latitude
In degrees.
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.
Radiation from interaction.
double fTimes[12 *9][260]
Array of unwrapped (unless kNoCalib) times for each channel.
Double_t sourceLon
RF position when leaving the ice: Longitude (using icemc model)
void PickBalloonPosition(Vector straightup, IceModel *antarctica, Settings *settings1, Anita *anita1)
This function picks the balloon position.
Double_t sourceAlt
RF position when leaving the ice: Altitude (using icemc model)
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.
Float_t longitude
In degrees.
Double_t thresholds[12 *9]
Channel thresholds used in icemc.
UInt_t realTime
Time from the GPS unit.
const char * ICEMC_SRC_DIR()
Double_t n_component[48]
Normal comp along polarization.
Double_t balloonPos[3]
Balloon position.
void saveTriggerWaveforms(Anita *anita1, double sig0[48], double sig1[48], double noise0[48], double noise1[48])
Save signal and noise waveforms at trigger.
Double_t vmmhz[128]
V/m/MHz at balloon (128 frequency bins)
Double_t SNRAtDigitizer[12 *9]
Array of SNR at digitizer.
Class that handles the channel trigger.
Reads in and stores input settings for the run.
Double_t fSignalAtTrigger[12 *9][260]
Array of signal at trigger.
Vector n_bn
normalized r_bn
Double_t maxSNRAtTriggerV
Max SNR at trigger V-POL.
void InitializeBalloon()
This function initializes the balloon or the specific flight.
This class is a 3-vector that represents a position on the Earth's surface.
void saveDigitizerWaveforms(Anita *anita1, double sig0[48], double sig1[48], double noise0[48], double noise1[48])
Save signal and noise waveforms at digitizer.
Double_t h_component[48]
H comp along polarization.
UInt_t realTime
unixTime of readout
Double_t rfExitNor[5][3]
Normal vector in direction of exit point to balloon - 5 iterations.
UsefulAnitaEvent – The Calibrated Useful Anita Event object.
void GetAntennaOrientation(Settings *settings1, Anita *anita1, int ilayer, int ifold, Vector &n_eplane, Vector &n_hplane, Vector &n_normal)
This function gets the antenna orientation.
Float_t altitude
In metres.
Double_t hitangle_h[48]
Hit angles rel. to h plane stored for each antenna.
void SetDefaultBalloonPosition(IceModel *antarctica1)
This function sets the default balloon position.
Double_t fSignalAtDigitizer[12 *9][260]
Array of signal at digitizer.
void DigitizerPath(Settings *settings1, Anita *anita1, int ant, Balloon *bn1)
Apply digitizer path.
TruthAnitaEvent – The Truth ANITA Event.
Double_t e_component[48]
E comp along polarization.
Shape of the earth, ice thicknesses, profiles of earth layers, densities, neutrino absorption...
static const int NLAYERS_MAX
max number of layers (in smex design, it's 4)
int fCapacitorNum[12 *9][260]
Array of capacitor numbers.
Double_t fNoiseAtTrigger[12 *9][260]
Array of noise at trigger.
Double_t nuDir[3]
Neutrino direction.
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 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.
Double_t e_component_k[48]
Component of e-field along the rx e-plane.
Double_t maxSNRAtDigitizerV
Max SNR at digitizer V-POL.
Double_t nuMom
Neutrino momentum.
int fNumPoints[12 *9]
Number of poins per channel.
Handles everything related to balloon positions, payload orientation over the course of a flight...
This class represents a three-vector. Operators are overloaded to provide for the familiar operations...
static const int NPHI_MAX
max number of antennas around in phi (in smex, 16)
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.
Float_t heading
0 is facing north, 180 is facing south
Double_t maxSNRAtTriggerH
Max SNR at trigger H-POL.
Handles event counting as cuts are made.
double dtryingposition
weighting factor: how many equivalent tries each neutrino counts for after having reduced possible in...
UInt_t eventNumber
Software event number.
Double_t nuPos[3]
Neutrino position.
Double_t fTimes[12 *9][260]
Array of unwrapped (unless kNoCalib) times for each channel.
Double_t hitangle_e[48]
Hit angles rel. to e plane stored for each antenna.
Double_t SNRAtTrigger[12 *9]
Array of SNR at trigger.
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_t maxSNRAtDigitizerH
Max SNR at digitizer H-POL.
Double_t balloonDir[3]
Balloon direction.
Ice thicknesses and water depth.
unsigned int realTime_flightdata
realtime from the flight data file