Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bcal_t.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: bcal_t.h
4 // Created: Wed Dec 30 13:23:49 EST 2009
5 // Creator: davidl (on Darwin harriet.jlab.org 9.8.0 i386)
6 //
7 
8 #ifndef _bcal_t_
9 #define _bcal_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 bcal_t:public TObject{
20  public:
21 
22  bcal_t(void){}
23 
24  TLorentzVector p; // 4-momentum vector of photon
25 
26  // This is used to sort the TClonesArray fcal in Event
27  Bool_t IsSortable(void) const { return kTRUE;}
28  Int_t Compare(const TObject *a) const{
29  // sort by decreasing energy
30  Double32_t diff = ((bcal_t*)a)->p.E() - ((bcal_t*)this)->p.E();
31  if(diff>0.0) return -1;
32  if(diff<0.0) return +1;
33  return 0;
34  }
35 
36  bcal_t& operator=(const bcal_t &ti){
37  this->p = ti.p;
38  return *this;
39  }
40 
41  private:
42  ClassDef(bcal_t,1);
43 };
44 
45 
46 
47 #endif // _bcal_t_
48 
Int_t Compare(const TObject *a) const
Definition: bcal_t.h:28
bcal_t(void)
Definition: bcal_t.h:22
ClassDef(bcal_t, 1)
Definition: bcal_t.h:19
bcal_t & operator=(const bcal_t &ti)
Definition: bcal_t.h:36
Bool_t IsSortable(void) const
Definition: bcal_t.h:27
TLorentzVector p
Definition: bcal_t.h:24