/* * Program: Analyze Lambda Electroproduction * * Author : Steve Barrow * * Date : Summer, 1998. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "accept.h" /* ----------- Function prototypes ------------------ */ int pe_sbarrow_(float beam_energy); void bh_sbarrow_(int runno, float beam_energy, float Q_live); void pl_1520_sbarrow_(float beam_energy); #define P_kaon_min 0.283 #define P_kaon_max 2.017 #define N_KAON_SPA_P 102 int kaon_in[N_KAON_SPA_P]; int kaon_index; #include "rho.h" /* --------------------------------------------------- */ void pl_1520_sbarrow_(float beam_energy) { int ind_1,ind_2,ind_3,ind_4,ind_5,ind_6; float theta_kaon_minus; hf1(1,RAD2DEG*get_rel_angle_spb(Kaon,Proton_SPB),1.0); if ((mag_spb(Kaon.space)>P_kaon_min)&&(mag_spb(Kaon.space) 0.0) { phi_kaon_minus=(float)RAD2DEG*acos((double)(k_minus_t.space.x/\ sqrt(pow(k_minus_t.space.x,2)+pow(k_minus_t.space.y,2)))); } if (k_minus_t.space.y < 0.0) { phi_kaon_minus=360-(float)RAD2DEG*acos((double)(k_minus_t.space.x/\ sqrt(pow(k_minus_t.space.x,2)+pow(k_minus_t.space.y,2)))); } /* end of sept. 16th stuff */ if ((mag_spb(Electron_SPB.space)>E_CUT)) { theta_kaon_minus = get_theta_rel(Missing,Missing_prot); ind_1 = get_index(W,W_MIN,W_MAX,N_W); ind_2 = get_index(Q2,Q2_MIN,Q2_MAX,N_Q2); ind_3 = get_index(theta_rel,PHI_REL_MIN,PHI_REL_MAX,N_PHI_REL); ind_4 = get_index(180 - theta_cm_kaon,THETA_CM_MIN,THETA_CM_MAX,N_THETA_CM); ind_5 = get_index(theta_kaon_minus,THETA_LAM_MIN,THETA_LAM_MAX,N_THETA_LAM); ind_6 = get_index(phi_kaon_minus,PHI_LAM_MIN,PHI_LAM_MAX,N_PHI_LAM); if ((current_run ==1)&&(mag_spb(Electron_SPB.space)>E_CUT)&&(Q2Q2_MIN)&&\ (W>W_MIN)&&(Whead[0].evtclass; } /* ------------------------------------------------------------ */ if(HEAD && TBID && PART ){ tracks = 0; Beam.space.x = Beam.space.y = 0.; Beam.space.z = beam_energy; Beam.t = beam_energy; Target.space.x = Target.space.y = Target.space.z = 0.0; Target.t = PROTON_MASS; beta_cm.x =0; beta_cm.y =0; beta_cm.z = (Beam.space.z)/(Beam.t+Target.t); Total = v4add(Beam,Target); for (j = 0; j < PART->bank.nrow; j++){ npart++; part_id = PART->part[j].pid; index_tbid = PART->part[j].trkid - 1; stat_sc = TBID->tbid[index_tbid].sc_stat; stat_ec = TBID->tbid[index_tbid].ec_stat; stat_cc = TBID->tbid[index_tbid].cc_stat; stat_trk = PART->part[j].qtrk; sector = TBID->tbid[index_tbid].sec; sc_nn = TBID->tbid[index_tbid].sc_id-1; if (PART->part[j].q != 0) tracks++; paddle = 0; if (SCRC = getGroup(&bcs_, "SCRC",sector)) { if (TBID->tbid[j].sc_stat) paddle = SCRC->scrc[sc_nn].id; } /* bad_sc_spb = 0; if ((paddle < 51) && (0< paddle)){ bad_sc_spb = bad_sc_arr[sector][paddle]; } */ /* if((part_id==3) && (bad_sc_spb != -13) && (paddle < 40) && stat_ec == (GOOD_MATCH)){ */ if((part_id==3) && (paddle < 40) && stat_ec == (GOOD_MATCH)){ /* ELECTRON STUFF */ Elec_p = mag_spb(PART->part[j].p.space); nelec++; Electron_SPB = PART->part[j].p; /* Vertex_elec = PART->part[j].vert; */ jj = PART->part[j].trkid; make_vert(); VERT = getBank(&bcs_,"VERT"); testvert = VERT->vert; testvert_x = (testvert + index_tbid)->vert.x; testvert_y = (testvert + index_tbid)->vert.y; testvert_z = (testvert + index_tbid)->vert.z; hf1(2,VERT->vert[PART->part[j].trkid].vert.z,1.0); if ((fabs(testvert_z-VERT_OFF)part[j].p; Nu = beam_energy - Electron_SPB.t; Q2 = -v4magsq(Photon); W = v4mass(Resonance); Xbrk = Q2/(2.0*PROTON_MASS*Nu); Ybrk = Nu/beam_energy; Particle_x = Particle.space.x; Particle_y = Particle.space.y; if (Particle_y > 0.0) { phi_elec=(float)RAD2DEG*acos((double)(Particle_x/\ sqrt(pow(Particle_x,2)+pow(Particle_y,2)))); } if (Particle_y < 0.0) { phi_elec=360-(float)RAD2DEG*acos((double)(Particle_x/\ sqrt(pow(Particle_x,2)+pow(Particle_y,2)))); } sect_elec = sector; sc_nn = TBID->tbid[index_tbid].sc_id; } } if(W > 1.5 && Q2 > 0.5 && stat_ec == (GOOD_MATCH) ){ printf("**************************************\n"); nkaon = 0; for (jj = 0; jj < PART->bank.nrow; jj++){ part_id = PART->part[jj].pid; index_tbid = PART->part[jj].trkid - 1; stat_sc = TBID->tbid[index_tbid].sc_stat; stat_ec = TBID->tbid[index_tbid].ec_stat; stat_cc = TBID->tbid[index_tbid].cc_stat; stat_trk = PART->part[jj].qtrk; sector = TBID->tbid[index_tbid].sec; sc_nn = TBID->tbid[index_tbid].sc_id -1; bad_sc_spb = 0; paddle = 0; if (SCRC = getGroup(&bcs_, "SCRC",sector)) { if (TBID->tbid[index_tbid].sc_stat) paddle = SCRC->scrc[sc_nn].id; } /* if ((paddle < 51) && (0< paddle)){ bad_sc_spb = bad_sc_arr[sector][paddle]; } */ /* ---------------- VERTEX ----------------------------------*/ /* Vertex_part = PART->part[jj].vert; */ /*-------------------------------------------------------------*/ Particle = PART->part[jj].p; charge = PART->part[jj].q; index_tbid = PART->part[jj].trkid - 1; Part_beta = TBID->tbid[index_tbid].beta; Particle_x = Particle.space.x; Particle_y = Particle.space.y; Particle_z = Particle.space.z; Particle_e = Particle.t; Part_mom = sqrt(Particle_x*Particle_x+Particle_y*Particle_y+Particle_z*Particle_z); if(Part_beta > 0.0 && Part_beta < 1.1 && charge != 0){ Part_mass = Part_mom * sqrt(1.0 - Part_beta*Part_beta)/Part_beta; if (charge == 1) hf2(10,Part_mass, Part_mom,1.0); /* if((bad_sc_spb != -13) && (paddle < 40) && (vert_good = 100)){ */ if((paddle < 40) && (vert_good = 100)){ /* KAONS */ /* 0.42 0.58 */ if((Part_mass > 0.42) && (Part_mass < 0.58) && (charge == 1) && stat_sc == (GOOD_MATCH)){ p_kaon = Part_mom; beta_kaon2 = Part_beta; kaon_mass = Part_mass; sect_kaon = sector; hf1(3,Q2,1.0); hf1(4,W,1.0); hf2(5,Q2,W,1.0); testvert_x = (testvert + index_tbid)->vert.x; testvert_y = (testvert + index_tbid)->vert.y; testvert_z = (testvert + index_tbid)->vert.z; if((fabs(testvert_x)<2.5)&&(fabs(testvert_y)<2.5)&&\ (fabs(testvert_z-VERT_OFF)part[jj].p; temp = v4add(Kaon,Electron_SPB); Missing = v4sub(Total,temp); hf1(11,v4mass(Missing),1.0); t = v4sub(Target,Missing); if (Particle_y > 0.0) { phi_kaon=(float)RAD2DEG*acos((double)(Particle_x/\ sqrt(pow(Particle_x,2)+pow(Particle_y,2)))); } if (Particle_y < 0.0) phi_kaon=360-(float)RAD2DEG*acos((double)(Particle_x/\ sqrt(pow(Particle_x,2)+pow(Particle_y,2)))); } hf2(2,Part_mass,phi_kaon,1.0); } /* end of cut on kaon vertex */ } /* end of cut on kaon mass */ } /* end of cut on good TOF paddles */ } /* cut on part_beta */ } /* end of loop over part bank */ } /* end of W, Q2 cut */ if (nkaon == 100) { for (j = 0; j < PART->bank.nrow; j++){ part_id = PART->part[j].pid; index_tbid = PART->part[j].trkid - 1; stat_sc = TBID->tbid[index_tbid].sc_stat; stat_ec = TBID->tbid[index_tbid].ec_stat; stat_cc = TBID->tbid[index_tbid].cc_stat; stat_trk = PART->part[j].qtrk; sector = TBID->tbid[index_tbid].sec; sc_nn = TBID->tbid[index_tbid].sc_id - 1; bad_sc_spb = 0; paddle = 0; if (SCRC = getGroup(&bcs_, "SCRC",sector)) { if (TBID->tbid[index_tbid].sc_stat) paddle = SCRC->scrc[sc_nn].id; } /* ------------------ VERTEX ----------------------------------*/ /* Vertex_part = PART->part[j].vert; */ /*-------------------------------------------------------------*/ /* if(bad_sc_spb != -13){ */ Particle = PART->part[j].p; charge = PART->part[j].q; Part_beta = TBID->tbid[index_tbid].beta; Particle_x = Particle.space.x; Particle_y = Particle.space.y; Particle_z = Particle.space.z; Particle_e = Particle.t; Part_mom = sqrt(Particle_x*Particle_x+Particle_y*Particle_y+Particle_z*Particle_z); if(Part_beta > 0.0 && Part_beta < 1.1 && charge != 0){ Part_mass = Part_mom * sqrt(1.0 - Part_beta*Part_beta)/Part_beta; /* PROTON */ /* 0.905 1.050 */ if((Part_mass > 0.905) && (Part_mass < 1.050) && (charge == 1) &&\ (stat_sc == (GOOD_MATCH))&&(tracks==3)){ beta_proton2 = Part_beta; proton_mass = Part_mass; sector = TBID->tbid[index_tbid].sec; sect_prot = sector; if ((nkaon == 100)&&(vert_good==100)) { nprot++; Proton_SPB = PART->part[j].p; Missing_prot = v4sub(Missing,Proton_SPB); m_miss = v4magsq(Missing_prot); if((m_miss<0.75) && (m_miss> -0.1) ) { testvert_x = (testvert + index_tbid)->vert.x; testvert_y = (testvert + index_tbid)->vert.y; testvert_z = (testvert + index_tbid)->vert.z; if((fabs(testvert_x)<2.5)&&(fabs(testvert_y)<2.5)&&\ (fabs(testvert_z-VERT_OFF)v4mass(Missing))&&(W>1.95)\ &&(sqrt(m_miss)>0.42)&&(sqrt(m_miss)<0.58)\ &&mag_spb(Electron_SPB.space)>E_CUT&&(side_low !=100)&&(side_high !=100)) { p_proton = Part_mom; S = v4add(Missing,Kaon); pl_1520_sbarrow_(beam_energy); } } /* end of cut on proton vertex */ } } /* end of nkaon==100, vert_good==100 */ } /*end of cut on proton mass */ } /*end of beta cut */ } /*end of loop over part bank */ p_kaon = 0; p_proton = 0; nkaon=0; npion=0; vert_good = 0; side_low = 0; side_high = 0; } /* } */ /* fclose(fp_part); */ return(1); } /* end file */