Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBCALUnifiedHit.h
Go to the documentation of this file.
1 // $Id$
2 
3 #ifndef _DBCALUnifiedHit_
4 #define _DBCALUnifiedHit_
5 
6 #include "BCAL/DBCALGeometry.h"
7 
8 #include <JANA/JObject.h>
9 #include <JANA/JFactory.h>
10 using namespace jana;
11 
12 class DBCALUnifiedHit : public JObject{
13 
14 //One DBCALUnifiedHit is created for each DBCALHit. When available, TDC hits
15 //are also incorporated. The class provides energy in GeV rather than ADC
16 //units (for now the conversion is just a constant factor) and timewalk
17 //corrections are also applied. With this class, these corrections only need
18 //to be applied once.
19 
20  public:
21  JOBJECT_PUBLIC(DBCALUnifiedHit);
22 
23  int module;
24  int layer;
25  int sector;
27  float E;
28 
29  //If there is a associated TDC hit, t is the timewalk-corrected TDC
30  //time, otherwise t is the same as t_ADC.
31  float t; ///< Unified time, obtained from ADC and/or TDC and used for further analysis
32  float t_ADC; ///< Time from fADC
33  float t_TDC; ///< Time of TDC hit that is closes t to the ADC time
34  bool has_TDC_hit; ///< Flag if the Unified Time is the TDC time
35 
36  int cellId;
37 
38  void toStrings(vector<pair<string,string> > &items)const{
39  AddString(items, "module", "%d", module);
40  AddString(items, "layer", "%d", layer);
41  AddString(items, "sector", "%d", sector);
42  AddString(items, "end", "%s", end==0 ? "upstream":"downstream" );
43  AddString(items, "E(GeV)", "%2.3f", E);
44  AddString(items, "t(ns)", "%4.2f", t);
45  AddString(items, "t_ADC(ns)", "%4.2f", t_ADC);
46  AddString(items, "t_TDC(ns)", "%4.2f", t_TDC);
47  }
48 };
49 
50 #endif // _DBCALUnifiedHit_
51 
float t_TDC
Time of TDC hit that is closes t to the ADC time.
Int_t layer
void toStrings(vector< pair< string, string > > &items) const
bool has_TDC_hit
Flag if the Unified Time is the TDC time.
float t_ADC
Time from fADC.
DBCALGeometry::End end
float t
Unified time, obtained from ADC and/or TDC and used for further analysis.