Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DPSPair.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DPSPair.h
4 // Created: Fri Mar 20 07:51:31 EDT 2015
5 // Creator: nsparks (on Linux cua2.jlab.org 2.6.32-431.5.1.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _DPSPair_
9 #define _DPSPair_
10 
11 #include <JANA/JObject.h>
12 #include <JANA/JFactory.h>
13 #include "DPSHit.h"
14 
15 class DPSPair:public jana::JObject{
16  public:
18 
20  // cout << " DPSPair destructor is called " << endl;
21  delete left;
22  delete right;
23  }
24 
25  typedef struct {
26  int column; // tile with the largest energy
27  double pulse_peak; // pulse peak of the tile with the largest energy
28  double integral; // total energy in the cluster
29  double t_tile; // time of the tile with the largest energy
30  int ntiles; // number of tiles in the cluster
31 
32 
33  double E; // Cluster energy
34  double t; // cluster time
35  } PSClust;
36 
37 
40 
41  pair<const PSClust*, const PSClust*> ee; // first:North(left); second:South(right)
42 
43 
44  void SetPair(int column_l, double pulse_peak_l, double integral_l, double t_tile_l, int ntiles_l, double E_l, double t_l,
45  int column_r, double pulse_peak_r, double integral_r, double t_tile_r, int ntiles_r, double E_r, double t_r){
46 
47 
48  left->column = column_l;
49  left->pulse_peak = pulse_peak_l;
50  left->integral = integral_l;
51  left->t_tile = t_tile_l;
52  left->ntiles = ntiles_l;
53  left->E = E_l;
54  left->t = t_l;
55 
56 
57  right->column = column_r;
58  right->pulse_peak = pulse_peak_r;
59  right->integral = integral_r;
60  right->t_tile = t_tile_r;
61  right->ntiles = ntiles_r;
62  right->E = E_r;
63  right->t = t_r;
64 
65  ee.first = left;
66  ee.second = right;
67 
68 
69  }
70 
71 
72  void toStrings(vector<pair<string,string> > &items)const{
73  AddString(items, "column_lhit", "%d", ee.first->column);
74  AddString(items, "column_rhit", "%d", ee.second->column);
75  AddString(items, "E_pair", "%f", ee.first->E+ee.second->E);
76  AddString(items, "E_lhit", "%f", ee.first->E);
77  AddString(items, "E_rhit", "%f", ee.second->E);
78  AddString(items, "t_lhit", "%f", ee.first->t);
79  AddString(items, "t_rhit", "%f", ee.second->t);
80  AddString(items, "integral_lhit", "%f", ee.first->integral);
81  AddString(items, "integral_rhit", "%f", ee.second->integral);
82  AddString(items, "pulse_peak_lhit", "%f", ee.first->pulse_peak);
83  AddString(items, "pulse_peak_rhit", "%f", ee.second->pulse_peak);
84  AddString(items, "t_tile_lhit", "%f", ee.first->t_tile);
85  AddString(items, "t_tile_rhit", "%f", ee.second->t_tile);
86  AddString(items, "ntiles_lhit", "%d", ee.first->ntiles);
87  AddString(items, "ntiles_rhit", "%d", ee.second->ntiles);
88  }
89 
90 
91 
92 };
93 
94 #endif // _DPSPair_
95 
pair< const PSClust *, const PSClust * > ee
Definition: DPSPair.h:41
Double_t t_r
PSClust * left
Definition: DPSPair.h:38
double t_tile
Definition: DPSPair.h:29
double integral
Definition: DPSPair.h:28
void toStrings(vector< pair< string, string > > &items) const
Definition: DPSPair.h:72
double pulse_peak
Definition: DPSPair.h:27
JOBJECT_PUBLIC(DPSPair)
~DPSPair()
Definition: DPSPair.h:19
PSClust * right
Definition: DPSPair.h:39
Double_t t_l
void SetPair(int column_l, double pulse_peak_l, double integral_l, double t_tile_l, int ntiles_l, double E_l, double t_l, int column_r, double pulse_peak_r, double integral_r, double t_tile_r, int ntiles_r, double E_r, double t_r)
Definition: DPSPair.h:44