5 #include "earthmodel.hh" 13 #include "position.hh" 19 #include "Primaries.h" 20 #include "EnvironmentVariable.h" 21 #include "icemc_random.h" 24 #if defined(ANITA_UTIL_EXISTS) and defined(VECTORIZE) 25 #include "vectormath_trig.h" 31 const string ICEMC_DATA_DIR=ICEMC_SRC_DIR+
"/data/";
32 const string anitaliteflight=ICEMC_DATA_DIR+
"/BalloonGPS.txt";
33 const string anitaflight=ICEMC_DATA_DIR+
"/anitagps.txt";
51 interaction1->banana_theta_obs = -0.5*PI/settings1->vertical_banana_points * ((int)(inu/settings1->horizontal_banana_points));
52 interaction1->banana_phi_obs = 2*PI/settings1->horizontal_banana_points * (inu%settings1->horizontal_banana_points);
53 interaction1->
banana_weight = (double)fabs(sin(interaction1->banana_theta_obs));
66 theta_bn =
r_bn.Theta();
85 if(BN_LATITUDE_SETTING==999)
88 theta_bn=(90-BN_LATITUDE_SETTING)*RADDEG;
90 if(BN_LONGITUDE_SETTING==999)
93 phi_bn=EarthModel::LongtoPhi_0isPrimeMeridian(BN_LONGITUDE_SETTING);
117 ifstream flightfile(anitaliteflight.c_str());
119 cout <<
"Flight file not found.\n";
139 getline(flightfile,junk);
140 getline(flightfile,junk);
141 getline(flightfile,junk);
142 getline(flightfile,junk);
148 while (!flightfile.eof()) {
151 flightfile >> srealtime >> junk >> slatitude >> slongitude >> saltitude >> sheading >> junk >> junk >> junk;
156 latitude=(double)atof(slatitude.c_str());
157 longitude=(double)atof(slongitude.c_str());
158 altitude=(double)atof(saltitude.c_str());
159 heading=(double)atof(sheading.c_str());
160 realtime=(double)atof(srealtime.c_str());
176 getline(flightfile,junk);
209 flightdatachain =
new TChain(
"foricemc");
210 flightdatachain->Add((ICEMC_DATA_DIR+
"/anita1flightdata.root").c_str());
213 flightdatachain->SetBranchAddress(
"powerthresh",
powerthresh);
214 flightdatachain->SetBranchAddress(
"meanp",
meanp);
215 flightdatachain->SetBranchAddress(
"longitude",&flongitude);
216 flightdatachain->SetBranchAddress(
"latitude",&flatitude);
217 flightdatachain->SetBranchAddress(
"altitude",&faltitude);
219 flightdatachain->SetBranchAddress(
"heading",&fheading);
225 flightdatachain =
new TChain(
"adu5PatTree");
226 flightdatachain->SetMakeClass(1);
227 flightdatachain->Add((ICEMC_DATA_DIR+
"/anita2gps_pitchandroll.root").c_str());
228 flightdatachain->SetBranchAddress(
"longitude",&flongitude);
229 flightdatachain->SetBranchAddress(
"latitude",&flatitude);
230 flightdatachain->SetBranchAddress(
"altitude",&faltitude);
231 flightdatachain->SetBranchAddress(
"heading",&fheading);
233 flightdatachain->SetBranchAddress(
"pitch",&fpitch);
234 flightdatachain->SetBranchAddress(
"roll",&froll);
239 string balloonFile=
"";
240 if (
WHICHPATH==8) balloonFile+=ICEMC_DATA_DIR+
"/anita3gps_pitchroll.root";
241 else balloonFile+=ICEMC_DATA_DIR+
"/anita4gps_pitchroll.root";
243 flightdatachain =
new TChain(
"adu5PatTree");
244 flightdatachain->SetMakeClass(1);
245 flightdatachain->Add(balloonFile.c_str());
246 flightdatachain->SetBranchAddress(
"longitude",&flongitude);
247 flightdatachain->SetBranchAddress(
"latitude",&flatitude);
248 flightdatachain->SetBranchAddress(
"altitude",&faltitude);
249 flightdatachain->SetBranchAddress(
"heading",&fheading);
251 flightdatachain->SetBranchAddress(
"pitch",&fpitch);
252 flightdatachain->SetBranchAddress(
"roll",&froll);
257 min_time = flightdatachain ? flightdatachain->GetMinimum(
WHICHPATH == 6 ?
"realTime_surfhk":
"realTime") : 0;
258 max_time = flightdatachain ? flightdatachain->GetMaximum(
WHICHPATH == 6 ?
"realTime_surfhk":
"realTime") : 0;
260 for (
int i=0;i<10000;i++) {
272 for (
int i=0;i<9;i++) {
273 for (
int j=0;j<2;j++) {
276 for (
int j=0;j<32;j++) {
291 phi_spin=heading*RADDEG;
294 phi_spin=getRNG(RNG_BALLOON_POSITION)->Rndm()*2*PI;
306 ibnposition_tmp = (int)(
r_bn.
Lon() / 2);
313 return ibnposition_tmp;
319 Vector thetazero(0.,0.,1.);
322 theta_bn=acos(straightup.Dot(thetazero));
324 if (straightup.GetX()==0 && straightup.GetY()==0)
327 phi_bn=acos((straightup.Cross(thetazero)).Dot(phizero));
341 r_bn = (antarctica1->Surface(r_bn)+altitude_bn) * r_bn.Unit();
371 if (settings1->BORESIGHTS)
377 int getTuffIndex(
int Curr_time) {
378 if((TUFFconfig_B_end_3 < Curr_time) && (Curr_time <= TUFFconfig_A_end_1)) {
381 else if(((0 < Curr_time) && (Curr_time <= TUFFconfig_B_end_1)) || ((TUFFconfig_P_end_3 < Curr_time) && (Curr_time <= TUFFconfig_B_end_2)) || ((TUFFconfig_P_end_4 < Curr_time) && (Curr_time <= TUFFconfig_B_end_3)) || ((TUFFconfig_A_end_1 < Curr_time) && (Curr_time <= TUFFconfig_B_end_4)) || ((TUFFconfig_P_end_5 < Curr_time) && (Curr_time <= TUFFconfig_B_end_5)) || ((TUFFconfig_P_end_6 < Curr_time) && (Curr_time <= TUFFconfig_B_end_6)) || (TUFFconfig_P_end_7 < Curr_time) ) {
384 else if((TUFFconfig_P_end_1 < Curr_time) && (Curr_time <= TUFFconfig_C_end_1)) {
387 else if( ((TUFFconfig_P_end_2 < Curr_time) && (Curr_time <= TUFFconfig_G_end_1)) || ((TUFFconfig_O_end_1 < Curr_time) && (Curr_time <= TUFFconfig_G_end_2)) ) {
390 else if( ((TUFFconfig_G_end_1 < Curr_time) && (Curr_time <= TUFFconfig_O_end_1)) || ((TUFFconfig_G_end_2 < Curr_time) && (Curr_time <= TUFFconfig_O_end_2)) ) {
393 else if( ((TUFFconfig_B_end_1 < Curr_time) && (Curr_time <= TUFFconfig_P_end_1)) || ((TUFFconfig_C_end_1 < Curr_time) && (Curr_time <= TUFFconfig_P_end_2)) || ((TUFFconfig_O_end_2 < Curr_time) && (Curr_time <= TUFFconfig_P_end_3)) || ((TUFFconfig_B_end_2 < Curr_time) && (Curr_time <= TUFFconfig_P_end_4)) || ((TUFFconfig_B_end_4 < Curr_time) && (Curr_time <= TUFFconfig_P_end_5)) || ((TUFFconfig_B_end_5 < Curr_time) && (Curr_time <= TUFFconfig_P_end_6)) || ((TUFFconfig_B_end_6 < Curr_time) && (Curr_time <= TUFFconfig_P_end_7)) ) {
430 static int start_igps = 0;
431 static int ngps = flightdatachain->GetEntries();
432 static int init_best = 0;
435 if (settings1->PAYLOAD_USE_SPECIFIC_TIME && !init_best)
437 int N = flightdatachain->Draw(
"realTime",
"",
"goff");
438 double * times = flightdatachain->GetV1();
440 int best_igps = TMath::BinarySearch(N, times, (
double) settings1->PAYLOAD_USE_SPECIFIC_TIME);
441 start_igps = best_igps;
442 int end_igps = best_igps;
444 while (times[start_igps] > settings1->PAYLOAD_USE_SPECIFIC_TIME - settings1->PAYLOAD_USE_SPECIFIC_TIME_DELTA)
449 while (times[end_igps] < settings1->PAYLOAD_USE_SPECIFIC_TIME + settings1->PAYLOAD_USE_SPECIFIC_TIME_DELTA)
454 ngps = end_igps - start_igps + 1;
458 igps = start_igps + int(randomNumber*ngps);
459 bool adjustedTime =
false;
464 igps=
igps%flightdatachain->GetEntries();
467 flightdatachain->GetEvent(
igps);
480 igps=
igps%flightdatachain->GetEntries();
481 flightdatachain->GetEvent(
igps);
487 if(settings1->TUFFSTATUS==1){
489 if(settings1->TRIGGEREFFSCAN){
490 anita1->tuffIndex = 6;
492 }
else if (
WHICHPATH==9 && settings1->TUFFSTATUS==2) anita1->tuffIndex = 6;
498 igps=
igps%flightdatachain->GetEntries();
500 flightdatachain->GetEvent(
igps);
511 latitude=(double)flatitude;
512 longitude=(double)flongitude;
513 altitude=(double)faltitude;
514 heading=(double)fheading;
516 pitch=(double)fpitch;
523 altitude_bn=altitude*12.*CMINCH/100.;
525 altitude_bn=altitude;
530 r_bn = (antarctica1->Geoid(
r_bn)+altitude_bn) *
r_bn.Unit();
537 phi_bn=getRNG(RNG_BALLOON_POSITION)->Rndm()*TWOPI;
544 r_bn = (antarctica1->Surface(
r_bn)+altitude_bn) *
r_bn.Unit();
563 r_bn = (antarctica1->Surface(
r_bn)+altitude_bn) *
r_bn.Unit();
577 double theta_max=0.2115;
578 double theta_min=0.2115-0.110;
581 theta_bn=theta_min+(theta_max-theta_min)*(
double)(inu%npositions)/(
double)npositions;
589 r_bn = (antarctica1->Surface(
r_bn)+altitude_bn) *
r_bn.Unit();
599 else if (settings1->UNBIASED_SELECTION == 2)
622 if (settings1->BORESIGHTS)
634 r_bn+=slacpositions[islacposition].GetX()*
n_east 635 +slacpositions[islacposition].GetY()*
n_bn;
657 if(settings1->WHICH==6 || settings1->WHICH==8 || settings1->WHICH==9 || settings1->WHICH==10) {
658 n_eplane = const_z.RotateY(anita1->
ANTENNA_DOWN[ilayer][ifold]);
659 n_hplane = (-const_y).RotateY(anita1->
ANTENNA_DOWN[ilayer][ifold]);
660 n_normal = const_x.RotateY(anita1->
ANTENNA_DOWN[ilayer][ifold]);
663 n_eplane = const_z.RotateY(anita1->
THETA_ZENITH[ilayer] - PI/2);
664 n_hplane = (-const_y).RotateY(anita1->
THETA_ZENITH[ilayer] - PI/2);
665 n_normal = const_x.RotateY(anita1->
THETA_ZENITH[ilayer] - PI/2);
671 if (settings1->CYLINDRICALSYMMETRY==1) {
679 n_eplane = n_eplane.RotateZ(phi);
680 n_hplane = n_hplane.RotateZ(phi);
681 n_normal = n_normal.RotateZ(phi);
694 e_component_kvector = -(n_exit2bn * n_eplane);
696 h_component_kvector = -(n_exit2bn * n_hplane);
698 n_component_kvector = -(n_exit2bn * n_normal);
707 e_component = n_pol*n_eplane;
711 h_component = n_pol*n_hplane;
714 if (settings1->REMOVEPOLARIZATION) {
716 e_component = n_pol * n_pol;
726 void Balloon::GetHitAngles(
double e_component_kvector,
double h_component_kvector,
double n_component_kvector,
double& hitangle_e,
double& hitangle_h) {
727 #if defined(ANITA_UTIL_EXISTS) and defined(VECTORIZE) 728 Vec2d y(e_component_kvector, h_component_kvector);
729 Vec2d x(n_component_kvector, n_component_kvector);
730 Vec2d answer = atan2(y,x);
731 hitangle_h = answer[0];
732 hitangle_e = answer[1];
735 hitangle_e=atan2(h_component_kvector,n_component_kvector);
736 hitangle_h=atan2(e_component_kvector,n_component_kvector);
746 theta_bn=(90+latitude)*RADDEG;
751 phi_bn=(-1*longitude+90.);
765 double phi=0,theta=0;
770 if (settings1->UNBIASED_SELECTION>=1) {
773 if ( (settings1->UNBIASED_SELECTION == 1 && antarctica1->PickUnbiased(interaction1,len_int_kgm2,
dtryingposition,settings1->UNBIASED_CHORD_STEP_M, force_dir)) ||
774 (settings1->UNBIASED_SELECTION == 2 && antarctica1->PickUnbiasedPointSourceNearBalloon(interaction1,&
r_bn,
775 settings1->UNBIASED_PS_MAX_DISTANCE_KM,
776 settings1->UNBIASED_CHORD_STEP_M,
777 len_int_kgm2,force_dir)) )
793 interaction1->posnu = interaction1->
nu_banana;
804 phi=EarthModel::LongtoPhi_0is180thMeridian(lon);
806 theta = latfromSP*RADDEG;
808 double elevation=antarctica1->SurfaceAboveGeoid(lon,latfromSP)-500.;
810 interaction1->posnu =
Vector((elevation+antarctica1->Geoid(latfromSP))*sin(theta)*cos(phi),(elevation+antarctica1->Geoid(latfromSP))*sin(theta)*sin(phi),(elevation+antarctica1->Geoid(latfromSP))*cos(theta));
816 else if (settings1->SLAC) {
820 interaction1->posnu=zaxis.RotateY(
r_bn.Theta()-settings1->SLAC_HORIZDIST/EarthModel::R_EARTH);
822 interaction1->posnu=interaction1->posnu.RotateZ(
r_bn.Phi());
824 interaction1->posnu=(antarctica1->Surface(interaction1->posnu)-settings1->SLAC_DEPTH)*interaction1->posnu;
832 static Position specific_position(settings1->SPECIFIC_NU_POSITION_LONGITUDE, 90 + settings1->SPECIFIC_NU_POSITION_LATITUDE, settings1->SPECIFIC_NU_POSITION_ALTITUDE + antarctica1->Geoid(settings1->SPECIFIC_NU_POSITION_LATITUDE));
837 interaction1->posnu = antarctica1->PickInteractionLocation(ibnposition, settings1,
r_bn, interaction1);
840 }
while(settings1->SPECIFIC_NU_POSITION && interaction1->posnu.
Distance(specific_position) > settings1->SPECIFIC_NU_POSITION_DISTANCE && nattempts<100000000);
851 ray1->rfexit[0] = antarctica1->Surface(interaction1->posnu) * interaction1->posnu.Unit();
854 ray1->n_exit2bn[0] = (
r_bn - ray1->rfexit[0]).Unit();
856 if (settings1->BORESIGHTS) {
857 for(
int ilayer=0;ilayer<settings1->NLAYERS;ilayer++) {
858 for(
int ifold=0;ifold<anita1->
NRX_PHI[ilayer];ifold++) {
859 ray1->rfexit_eachboresight[0][ilayer][ifold]=antarctica1->Surface(interaction1->posnu) * interaction1->posnu.Unit();
860 ray1->n_exit2bn_eachboresight[0][ilayer][ifold]=(
r_boresights[ilayer][ifold]- ray1->rfexit_eachboresight[0][ilayer][ifold]).Unit();
870 ray1->nrf_iceside[0] = interaction1->posnu.Unit();
872 if (settings1->BORESIGHTS) {
874 for(
int ilayer=0;ilayer<settings1->NLAYERS;ilayer++) {
875 for(
int ifold=0;ifold<anita1->
NRX_PHI[ilayer];ifold++) {
877 ray1->nrf_iceside_eachboresight[0][ilayer][ifold]=interaction1->posnu.Unit();
885 double r_down = 2*(antarctica1->Surface(interaction1->posnu)-antarctica1->IceThickness(interaction1->posnu))-interaction1->posnu.Mag();
886 interaction1->posnu_down = r_down * interaction1->posnu.Unit();
908 if (ray1->n_exit2bn[0].Angle(interaction1->posnu) > PI/2 && !(
WHICHPATH==3 ||
WHICHPATH==4))
919 sslacpositions[0]=
"phi 4-5";
920 slacpositions[0]=
Vector(0.3,179.7,223.8);
922 sslacpositions[1]=
"phi 1, start location";
923 slacpositions[1]=
Vector(3.1,158.8,222.3);
925 sslacpositions[2]=
"phi 13, start location";
926 slacpositions[2]=
Vector(3.5,158.4,226.2);
928 sslacpositions[3]=
"phi 9, start location";
929 slacpositions[3]=
Vector(8.9,158.2,225.6);
931 sslacpositions[4]=
"phi 5, start location";
932 slacpositions[4]=
Vector(6.0,157.2,219.6);
934 sslacpositions[5]=
"phi 1, X=0, Y=2m";
935 slacpositions[5]=
Vector(1.3,233.8,221.0);
937 sslacpositions[6]=
"phi 13 X=0, Y=0";
938 slacpositions[6]=
Vector(5.4,154.4,226.2);
940 sslacpositions[7]=
"phi 13, X=3m, Y=0";
941 slacpositions[7]=
Vector(107.3,150.5,226.7);
943 sslacpositions[8]=
"phi 5, X=3m, Y=0";
944 slacpositions[8]=
Vector(110.4,144.6,220.1);
946 sslacpositions[9]=
"phi 1, left ant. at X=0";
947 slacpositions[9]=
Vector(104.7,147.8,223.2);
949 sslacpositions[10]=
"phi 1, Y=2m, left ant at X=0";
950 slacpositions[10]=
Vector(104.8,232.4,220.8);
952 sslacpositions[11]=
"phi 13, Y=2m, left ant at X=0";
953 slacpositions[11]=
Vector(104.1,233.1,225.5);
955 sslacpositions[12]=
"phi 1, Y=0, right ant at X=0";
956 slacpositions[12]=
Vector(-102.5,155.8,222.5);
958 sslacpositions[13]=
"phi 13, right ant at X=0";
959 slacpositions[13]=
Vector(-101.6,157.0,230.4);
961 sslacpositions[14]=
"phi 13, X=0, Y=-2m";
962 slacpositions[14]=
Vector(1.7,81.3,230.6);
964 sslacpositions[15]=
"phi 13, X=3m, Y=-2m";
965 slacpositions[15]=
Vector(103.1,82.4,231.2);
967 sslacpositions[16]=
"phi 3, X=0, Y=0";
968 slacpositions[16]=
Vector(-0.5,156.1,225.8);
970 sslacpositions[17]=
"phi 7, X=0, Y=0";
971 slacpositions[17]=
Vector(3.3,157.3,226.7);
973 sslacpositions[18]=
"phi 11, X=0, Y=0";
974 slacpositions[18]=
Vector(2.2,159.2,230.0);
976 sslacpositions[19]=
"phi 15, X=0, Y=0";
977 slacpositions[19]=
Vector(-1.8,158.8,228.5);
979 sslacpositions[20]=
"phi 13, X=0, Y=2m";
980 slacpositions[20]=
Vector(-2.5,237.0,229.7);
982 sslacpositions[21]=
"phi 13, X=-3m, Y=2m";
983 slacpositions[21]=
Vector(-109.8,237.4,229.2);
985 sslacpositions[22]=
"phi 13, X=-3m, Y=-2m";
986 slacpositions[22]=
Vector(-101.8,88.7,231.4);
988 sslacpositions[22]=
"phi 14, X=0m, Y=0m";
989 slacpositions[22]=
Vector(-0.8,160.4,228.2);
991 sslacpositions[23]=
"phi 2, X=0m, Y=0m";
992 slacpositions[23]=
Vector(2.4,158.9,225.7);
994 sslacpositions[24]=
"phi 6, X=0m, Y=0m";
995 slacpositions[24]=
Vector(5.5,158.2,223.6);
997 sslacpositions[25]=
"phi 10, X=0m, Y=0m";
998 slacpositions[25]=
Vector(5.9,160.3,228.2);
1000 sslacpositions[26]=
"phi 12, X=0m, Y=0m";
1001 slacpositions[26]=
Vector(3.1,160.5,230.4);
1003 sslacpositions[27]=
"phi 8, X=0m, Y=0m";
1004 slacpositions[27]=
Vector(6.7,159.7,226.7);
1006 sslacpositions[28]=
"phi 4, X=0m, Y=0m";
1007 slacpositions[28]=
Vector(4.5,157.8,224.1);
1009 sslacpositions[29]=
"phi 16, X=0m, Y=0m";
1010 slacpositions[29]=
Vector(1.4,159.4,227.3);
1012 sslacpositions[30]=
"phi 13, X=0m, Y=-6m";
1013 slacpositions[30]=
Vector(3.5,21.1,231.1);
1016 for (
int i=0;i<=30;i++) {
1018 slacpositions[i]=
Vector(slacpositions[i].GetX()*CMINCH/100.,
1019 slacpositions[i].GetY()*CMINCH/100.,
1020 slacpositions[i].GetZ()*CMINCH/100.);
1030 for(
int ilayer=0;ilayer<settings1->NLAYERS;ilayer++) {
1031 for(
int ifold=0;ifold<anita1->
NRX_PHI[ilayer];ifold++) {
1033 Vector n_boresight(1,0,0);
1037 if (settings1->CYLINDRICALSYMMETRY==1) {
1045 n_boresight = n_boresight.RotateZ(phi);
1118 for(
int ilayer=0;ilayer<settings1->NLAYERS;ilayer++) {
1119 for(
int ifold=0;ifold<anita1->
NRX_PHI[ilayer];ifold++) {
1128 int number_all_antennas = 0;
1132 for (
int ipol=0; ipol<2; ipol++){
1133 number_all_antennas=0;
1134 for (
int ilayer = 0; ilayer < settings1->NLAYERS; ilayer++){
1135 for (
int ifold = 0; ifold < anita1->
NRX_PHI[ilayer]; ifold++){
1137 if (settings1->WHICH==6 || settings1->WHICH==8 || settings1->WHICH == 9 || settings1->WHICH == 10){
1141 if (settings1->CYLINDRICALSYMMETRY==1){
1144 phi = (double) ifold / (
double) anita1->
NRX_PHI[ilayer] * 2 * PI + anita1->
PHI_OFFSET[ilayer];
1157 number_all_antennas++;
1177 double BalloonTheta = BalloonPos.Theta();
1178 double BalloonPhi = BalloonPos.Phi();
1180 if(BalloonPhi > PI){
1181 BalloonPhi =BalloonPhi-TWOPI;
1184 Vector ant_pos = ant_pos_pre;
1194 ant_pos=ant_pos.Rotate(heading*RADDEG,zaxis);
1195 xaxis=xaxis.Rotate(heading*RADDEG,zaxis);
1196 yaxis=yaxis.Rotate(heading*RADDEG,zaxis);
1198 ant_pos=ant_pos.Rotate(pitch*RADDEG,yaxis);
1199 xaxis=xaxis.Rotate(pitch*RADDEG,yaxis);
1201 ant_pos=ant_pos.Rotate(roll*RADDEG,xaxis);
1205 ant_pos=ant_pos.RotateY(BalloonTheta);
1206 northaxis=northaxis.RotateY(BalloonTheta);
1207 eastaxis=eastaxis.RotateY(BalloonTheta);
1210 ant_pos=ant_pos.RotateZ(BalloonPhi);
1211 northaxis = northaxis.RotateZ(BalloonPhi);
1212 eastaxis = eastaxis.RotateZ(BalloonPhi);
1216 this->x_axis_rot = xaxis;
1217 this->y_axis_rot = yaxis;
1218 this->z_axis_rot = zaxis;
1234 double BalloonTheta = BalloonPos.Theta();
1235 double BalloonPhi = BalloonPos.Phi();
1238 if(BalloonPhi > PI){
1239 BalloonPhi =BalloonPhi-TWOPI;
1243 Vector ant_pos = ant_pos_pre;
1249 ant_pos=ant_pos.RotateZ(-1*BalloonPhi);
1251 ant_pos=ant_pos.RotateY(-1*BalloonTheta);
1253 ant_pos=ant_pos.Rotate(-1*roll*RADDEG,x_axis_rot);
1255 ant_pos=ant_pos.Rotate(-1*pitch*RADDEG,y_axis_rot);
1257 ant_pos=ant_pos.Rotate(-1*heading*RADDEG,z_axis_rot);
unsigned int realTime_flightdata_temp
realtime from the flight data file
double realtime_bn_anitalite[100000]
same for real life time
int WHICHPATH
0=fixed balloon position,1=randomized,2=ANITA-lite GPS data,3=banana plot
unsigned short surfTrigBandMask[9][2]
Ryan's 16 bit masks for 9 surfs. 2x16 bit masks gives 32 channels per surf.
int igps
which balloon position do we use out of the 25000 anitalite GPS positions.
void ReadAnitaliteFlight()
This function reads in the ANITA LITE flight.
Position r_bn
position of balloon
static const int MAX_POSITIONS
for the slac beam test
double r_fromballoon[2]
distance from interaction to balloon for each ray
double phi_bn
theta,phi of balloon wrt south pole
Vector RotatePayload(Vector ant_pos)
This function rotates the payload.
static constexpr double phi_nu_banana
Location in phi.
double Distance(const Position &second) const
Returns chord distance (direct distance between two vectors)
Position nu_banana_surface
The location of the surface above the forced neutrino interaction point.
double heading_bn_anitalite[100000]
same for heading of the balloon
double LAYER_VPOSITION[Anita::NLAYERS_MAX]
position of layers in z relative to vertical center of the payload
double MAXHORIZON
pick the interaction within this distance from the balloon so that it is within the horizon ...
double THETA_ZENITH[NLAYERS_MAX]
how the antenna is tilted in theta (in radians with 0=up)
int Getibnposition()
This function gets ith balloon position.
void PickBalloonPosition(Vector straightup, IceModel *antarctica, Settings *settings1, Anita *anita1)
This function picks the balloon position.
void AdjustSlacBalloonPosition(int inu)
This function adjusts the slac balloon position.
void CenterPayload(double &hitangle_e)
This function centers the payload.
double horizcoord_bn
x component of balloon position
int REDUCEBALLOONPOSITIONS
only take every 100th entry in the flight data file
const char * ICEMC_SRC_DIR()
double altitude_bn_anitalite[100000]
same for altitude
double dtryingdirection
weighting factor: how many equivalent tries each neutrino counts for after having reduced angular pha...
int NPOINTS_MIN
min and max index for gps positions we want to include in the simulation (to exclude launch and fall)...
double BN_LATITUDE
balloon latitude for fixed balloon location
void PickDownwardInteractionPoint(Interaction *interaction1, Anita *anita1, Settings *settings1, IceModel *antarctica1, Ray *ray1, int &beyondhorizon, double len_int_km2, Vector *force_dir=0)
This function picks downward interaction point.
Position r_bn_shadow
position of the balloon projected on earth surface - point just below balloon at surface of the earth...
double MINALTITUDE
minimum altitude balloon needs to be before we consider it a good event to read from the flight data ...
Reads in and stores input settings for the run.
static constexpr double banana_observation_distance
How far from the surface above the interaction are we when we measure the voltages? (meters) Note: Should be at least 100000 for best results.
void setr_bn(double latitude, double longitude)
This function sets r of the balloon.
int NPOINTS
number of GPS positions we're picking from.
double BN_ALTITUDE
pick balloon altitude
double BN_LONGITUDE
balloon longitude for fixed balloon location
double PHI_EACHLAYER[NLAYERS_MAX][NPHI_MAX]
phi of the center of each antenna on each layer
Vector n_bn
normalized r_bn
double PHI_OFFSET[NLAYERS_MAX]
antenna offset in phi for each layer (radians)
float powerthresh[9][32]
power threshold in Watts
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.
int RANDOMIZE_BN_ORIENTATION
0=fixed balloon orientation,1=randomized
Vector ANTENNA_POSITION_START[2][NLAYERS_MAX][NPHI_MAX]
antenna positions from Kurt's measurements
Stores everything about a particular neutrino interaction. Interaction.
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.
double RRX[Anita::NLAYERS_MAX]
radius that the antenna sits from the axis of the payload (feedpoint)
Vector n_north
north, as seen from the balloon position
double longitude_bn_anitalite[100000]
same for longitude
double GetBalloonSpin(double heading)
This function gets the spin of the balloon whatever that means.
double altitude_int_mirror
depth of the mirror point of interaction.
double phi_spin
orientation of the balloon
void SetDefaultBalloonPosition(IceModel *antarctica1)
This function sets the default balloon position.
Contains everything about positions within payload and signals it sees for each event, in both the trigger and signal paths.
void calculate_antenna_positions(Settings *settings1, Anita *anita1)
This function calculates antenna positions.
Vector unRotatePayload(Vector ant_pos)
This function UN-rotates the payload.
double surface_under_balloon
distance between center of the earth and the surface of earth under balloon
static const int NLAYERS_MAX
max number of layers (in smex design, it's 4)
double altitude_int
depth of interaction
Vector antenna_positions[2][NLAYERS_MAX *NPHI_MAX]
these are the antenna positions in space in a coordinate system where x=north and y=west and the orig...
double vertcoord_bn
y component of balloon position
double banana_volts
Total voltage measured at a spot on the sky.
double latitude_bn_anitalite[100000]
latitude at times along flightpath, equally distributed among gps data. This is filled with anita or ...
int iceinteraction
whether or not there is an interaction in the ice
void setObservationLocation(Interaction *interaction1, int inu, IceModel *antarctic, Settings *settings1)
This function sets the observation location.
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.
Vector n_east
east, as seen from the balloon position
static constexpr double theta_nu_banana
Location of banana neutrino in theta.
This class represents a three-vector. Operators are overloaded to provide for the familiar operations...
Position nu_banana
The forced interaction point of the neutrino for the banana plots.
double ANTENNA_DOWN[NLAYERS_MAX][NPHI_MAX]
down angles of antennas from Kurt's measurements
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.
int igps_previous
which entry from the flight data file the previous event was so we can just take the next one...
Vector banana_obs
Vector from the neutrino interaction to the observation point.
float meanp[9][32]
mean power in Watts
double dtryingposition
weighting factor: how many equivalent tries each neutrino counts for after having reduced possible in...
double LAYER_PHIPOSITION[Anita::NLAYERS_MAX]
phi corresponding to the position of each "layer" on the "payload"
double Lon() const
Returns longitude.
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.
int NRX_PHI[NLAYERS_MAX]
number of antennas around in each layer. (radians)
void GetBoresights(Settings *settings1, Anita *anita1, Position r_boresights[Anita::NLAYERS_MAX][Anita::NPHI_MAX])
This function gets the boresights.
double banana_weight
Weight measurement locations to account for phase space.
Position r_boresights[Anita::NLAYERS_MAX][Anita::NPHI_MAX]
position of antenna boresights
Ice thicknesses and water depth.
double d_effective_area
In unbaised mode, projection of surface onto nnu.
unsigned int realTime_flightdata
realtime from the flight data file
void GetSlacPositions(Anita *anita1)
This function gets the slac balloon positions.
double LAYER_HPOSITION[Anita::NLAYERS_MAX]
distance in horizontal plane between center axis of the "payload" and each "layer".