#ifndef RUN_H #define RUN_H #include #include #include #include #include #include "stat.h" #include "const.h" #include "spin.h" #include "E03104.h" using std::string; using namespace std; class Run { public: Run(string); // constructor ~Run(); // destructor bool run_parameter_ok; bool beam_parameter_ok; bool calc_ok; string rootfile; int RunNumber; // e0, h, pLeft, thLeft, pRight, thRight, xfpp, AC, lambda were formerly floats double e0; double h; double pLeft; double thLeft; double pRight; double thRight; double xfpp; bool skip; // Ac and lambda[6] are calculated by calc_weights // lambda does not include the analyzing power. double Ac; double lambda[6]; // The kin_XXX variables are needed to calculate // the form factor ratio and the analyzing power // in the analysis of ep data. Double_t kin_Ebeam; Double_t kin_Ee; Double_t kin_theta_e; Double_t kin_tau; Double_t kin_epsilon; Double_t px_prime; Double_t pz_prime; Stat stat_chi; Stat stat_Q2; string kinematics; SpinTransportModel spin_transport_model; TString spin_transport_file; void set_next_run(Run*); Run* get_next_run(); bool is_next_event(); void open(TCut); void close(); void calc_kinematics(ReactionType); void calc_spin_transport(ReactionType); void calc_weights(); Double_t* get_address(string); friend ostream & operator <<(ostream &os, const Run* &obj); Double_t get_helicity() {return Helicity;}; Double_t get_phi_fpp() {return Ph_fpp;}; private: Run * next_run; // run dependent data Long_t nEventsBeforeCuts; Long_t nEventsAfterCuts; Long_t helicity_plus; Long_t helicity_minus; // event dependent data // the primary data are stored in the event_data class E03104 *event_data; // derived data are given below Double_t Helicity; Double_t Ph_tgt_e; Double_t Th_tgt_e; Double_t p_p; Double_t p_e; Double_t Delta_p; Double_t y_tgt_p; Double_t Ph_tgt_p; Double_t Th_tgt_p; Double_t Ph_tra_p; Double_t Th_tra_p; Double_t Th_fpp; Double_t Ph_fpp; Double_t Q2; Double_t omega; Double_t prmag; // recoil momentum Double_t prec; // recoil momentum (neg. along q) Double_t theta_pq; // angle between proton and q Double_t phi_x; // azimuthal angle Double_t precession_angle; Spin spin_matrix; void GetEvent(int); double Ac_McNaughton(double, double, double); double CalcEnergyLoss(double, double); void calc_weights(Double_t, Double_t); void add_event(); TFile *RunFile; TTree *this_tree; TEventList *evtList; int event_count; }; #endif