Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rho_p_hists/Event.cc
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: Event.cc
4 // Created: Tue Oct 13 09:55:12 EDT 2009
5 // Creator: davidl (on Darwin harriet.jlab.org 9.8.0 i386)
6 //
7 
8 
9 
10 #include "Event.h"
11 
12 
13 //------------------
14 // Clear
15 //------------------
16 void Event::Clear(void)
17 {
18  proton_thrown.SetXYZT(0.0, 0.0, 0.0, 0.0);
19  beam.SetXYZT(0.0, 0.0, 0.0, 0.0);
20  vertex.SetXYZ(0.0, 0.0, 65.0);
21  rho_thrown.m = 0.0;
22  rho_thrown.pip.SetXYZT(0.0, 0.0, 0.0, 0.0);
23  rho_thrown.pim.SetXYZT(0.0, 0.0, 0.0, 0.0);
24  rho_thrown.isfiducial = false;
25  rho->Clear(); // delete entries in TClonesArray (without freeing memory)
26  Nrho = 0;
27 }
28 
29 //------------------
30 // AddRho
31 //------------------
32 void Event::AddRho(TLorentzVector &pip, TLorentzVector &pim)
33 {
34  TClonesArray &rhos = *this->rho;
35  rho_t *rho = new(rhos[Nrho++]) rho_t();
36 
37  rho->m = (pip+pim).M();
38  rho->pip = pip;
39  rho->pim = pim;
40  rho->isfiducial = IsFiducial(pip) && IsFiducial(pim);
41 }
42 
43 //------------------
44 // IsFiducial
45 //------------------
46 bool Event::IsFiducial(TLorentzVector &pion)
47 {
48  double theta = pion.Theta()*TMath::RadToDeg();
49  if(theta<2.0 || theta>110.0)return false;
50  if(pion.P()<0.500)return false;
51 
52  return true;
53 }
54 
TClonesArray * rho
TLorentzVector pim
Definition: rho_t.h:26
TClonesArray * pip
Definition: mc_tree/Event.h:49
Definition: rho_t.h:19
void Clear(void)
Bool_t isfiducial
Definition: rho_t.h:27
Double32_t m
Definition: rho_t.h:24
bool IsFiducial(TLorentzVector &pion)
void AddRho(TLorentzVector &pip, TLorentzVector &pim)
TLorentzVector pip
Definition: rho_t.h:25
TClonesArray * pim
Definition: mc_tree/Event.h:50
UInt_t Nrho
TLorentzVector beam
TLorentzVector proton_thrown
TVector3 vertex
rho_t rho_thrown