icemc
 All Classes Namespaces Files Functions Variables Friends Macros Pages
balloon.hh
Go to the documentation of this file.
1 #ifndef BALLOON_H
2 #define BALLOON_H
3 
4 
6 //class Balloon:
8 
9 #include <iostream>
10 
11 
12 
13 class Position;
14 class Vector;
15 class TChain;
16 class TTree;
17 class TFile;
18 class TTreeIndex;
19 //class UShort_t;
20 class IceModel;
21 class Anita;
22 class Settings;
23 class TRandom3;
24 class Interaction;
25 class Ray;
26 class TH1F;
27 
28 using std::string;
29 using std::cout;
30 
32 class Balloon {
33 
34 private:
35 
36  // string anitaliteflight; // the gps path of the anita-lite flight
37  //string anitaflight;// gps path of anita flight
38 
39  TRandom3 Rand3;
40 public:
41  Balloon();
42 
43  void setObservationLocation(Interaction *interaction1,int inu,IceModel *antarctic,Settings *settings1);
45  // GPS positions of Anita-lite balloon flight
46 int igps; // which balloon position do we use out of the 25000 anitalite GPS positions.
48 double dtryingposition; // weighting factor: how many equivalent tries each neutrino counts for after having reduced possible interaction positions to within horizon
49 
50  void PickDownwardInteractionPoint(Interaction *interaction1,Anita *anita1,Settings *settings1,IceModel *antarctica1, int inu,
51  Ray *ray1,
52 
53  TH1F *h1, TH1F *h2, TH1F *h3, TH1F *h4,
54  TH1F *h5, int &beyondhorizon);
55 
56  void InitializeBalloon();
57 void ReadAnitaliteFlight();
58  void CenterPayload(Settings *settings1,Anita *anita1,Vector n_exit2bn,Vector n_pol,int whichlayer,int centerphi);
59 
60  void PickBalloonPosition(Vector straightup,IceModel *antarctica,Settings *settings1, Anita *anita1);
61  void PickBalloonPosition(IceModel *antarctica1,Settings *settings1,int inu,Anita *anita1); // position of spot under balloon
62 
63  int Getibnposition();
64 
65  double GetBalloonSpin(double heading); // get the azimuth of the balloon
66  void GetHitAngles(Settings *settings1,
67  Anita *anita1,
68  int inu,
69  const Vector &n_exit2bn,
70  const Vector &n_pol,
71  int ilayer,
72  int ifold,
73 
74  double& hitangle_e,
75  double& hitangle_h,
76  double& e_component,
77  double& h_component,
78  Vector &ant_normal);
79 
80  void SetDefaultBalloonPosition(IceModel *antarctica1);
81 
82 
83 
84  void setphiTrigMask(); // this sets phiTrigMask
85  void setr_bn(double latitude,double longitude);
86 
87 
88 
89 
90 
91 void AdjustSlacBalloonPosition(int inu); // move payload around like we did at slac
92 void GetSlacPositions(Anita *anita1);
93 
94 
95 
96 
97  // for the slac beam test
98  static const int MAX_POSITIONS=50;
102 
103  // TFile *flightdatafile;
104  //TTree *flightdatatree;
106  //TChain *turfratechain;
108  TFile *fturf;
109  TTreeIndex *tindex;
110  // double longitude,latitude,altitude
111  UShort_t phiTrigMask;
112 
113  unsigned int realTime_flightdata; // realtime from the flight data file
114  unsigned int realTime_turfrate; // realtime from the turf rate file
115  unsigned int realTime_tr_min; // min realtime from the turf rate file
116  unsigned int realTime_tr_max; // max realtime from the turf rate file
117  int iturf;// for indexing
121  double MINALTITUDE; // minimum altitude balloon needs to be before we consider it a good event to read from the flight data file
122  int igps_previous; // which entry from the flight data file the previous event was so we can just take the next one.
123  int REDUCEBALLOONPOSITIONS; // only take every 100th entry in the flight data file
124  int WHICHPATH; // 0=fixed balloon position,1=randomized,2=ANITA-lite GPS data,3=banana plot
125  int RANDOMIZE_BN_ORIENTATION;// 0=fixed balloon orientation,1=randomized
126  double BN_ALTITUDE; // pick balloon altitude
127  unsigned short surfTrigBandMask[9][2]; // Ryan's 16 bit masks for 9 surfs. 2x16 bit masks gives 32 channels per surf
128  float powerthresh[9][32]; // power threshold in Watts
129  float meanp[9][32]; // mean power in Watts
130 
131  int CENTER; // whether or not to center one phi sector of the payload on the incoming signal (for making signal efficiency curves)
132 
133  double altitude_bn;
134  double theta_bn;
135  double phi_bn;// theta,phi of balloon wrt south pole
136  Position r_bn; // position of balloon
137  double horizcoord_bn; // x component of balloon position
138  double vertcoord_bn; // y component of balloon position
139  Position r_boresights[Anita::NLAYERS_MAX][Anita::NPHI_MAX]; //position of antenna boresights
140 
141  void GetBoresights(Settings *settings1,Anita *anita1);
142 
143 
144  Vector n_bn; // normalized r_bn
145  Vector n_east; // east, as seen from the balloon position
146  Vector n_north; // north, as seen from the balloon position
147  double surface_under_balloon; // distance between center of the earth and the surface of earth under balloon
148  Position r_bn_shadow;//position of the balloon projected on earth surface - point just below balloon at surface of the earth
149 double MAXHORIZON; // pick the interaction within this distance from the balloon so that it is within the horizon
150 double phi_spin; // orientation of the balloon
151 
152 int NPOINTS; // number of GPS positions we're picking from.
153 int NPOINTS_MIN; // min and max index for gps positions we want to include in the simulation (to exclude launch and fall). These are set in ReadFlight
155 
156 double latitude_bn_anitalite[100000]; // latitude at times along flightpath, equally distributed among gps data. This is filled with anita or anita-lite data, depending on which the user specifies
157 double longitude_bn_anitalite[100000]; // same for longitude
158 double altitude_bn_anitalite[100000]; // same for altitude
159 double heading_bn_anitalite[100000]; // same for heading of the balloon
160 double realtime_bn_anitalite[100000]; // same for real life time
161 
162 
163  double BN_LONGITUDE; //balloon longitude for fixed balloon location
164  double BN_LATITUDE; //balloon latitude for fixed balloon location
165 }; //class Balloon
166 
167 
168 
169 
170 const string anitaliteflight="data/BalloonGPS.txt"; // the gps path of the anita-lite flight
171 const string anitaflight="data/anitagps.txt";// gps path of anita flight
172 
173 
174 #endif
175 
176