Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fcal_t.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: fcal_t.h
4 // Created: Thu Oct 22 19:28:29 EDT 2009
5 // Creator: davidl (on Darwin harriet.jlab.org 9.8.0 i386)
6 //
7 
8 #ifndef _fcal_t_
9 #define _fcal_t_
10 
11 #include <math.h>
12 
13 #include <iostream>
14 
15 #include <TObject.h>
16 #include <TVector3.h>
17 #include <TLorentzVector.h>
18 
19 class fcal_t:public TObject{
20  public:
21 
22  fcal_t(void){}
23 
24  TLorentzVector p; // 4-momentum vector of photon
25  TVector3 x; // position of photon in FCAL
26 
27  // This is used to sort the TClonesArray fcal in Event
28  Bool_t IsSortable(void) const { return kTRUE;}
29  Int_t Compare(const TObject *a) const{
30  Double32_t diff = ((fcal_t*)a)->p.E() - ((fcal_t*)this)->p.E();
31  Int_t idiff = diff>0.0 ? +1:(diff<0.0 ? -1:0);
32  return idiff;
33  }
34 
35  fcal_t& operator=(const fcal_t &ti){
36  this->p = ti.p;
37  this->x = ti.x;
38  return *this;
39  }
40 
41  private:
42  ClassDef(fcal_t,1);
43 };
44 
45 
46 
47 #endif // _fcal_t_
48 
Bool_t IsSortable(void) const
Definition: fcal_t.h:28
TLorentzVector p
Definition: fcal_t.h:24
Definition: fcal_t.h:19
fcal_t(void)
Definition: fcal_t.h:22
ClassDef(fcal_t, 1)
TVector3 x
Definition: fcal_t.h:25
Int_t Compare(const TObject *a) const
Definition: fcal_t.h:29
fcal_t & operator=(const fcal_t &ti)
Definition: fcal_t.h:35