Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaCoincTime.h
Go to the documentation of this file.
1#ifndef Podd_THaCoincTime_h_
2#define Podd_THaCoincTime_h_
3
5//
6// THaCoincTime
7// Calculate coincidence times for all tracks for a pair of
8// spectrometers. Everything is calculated relative to the
9// common starts -- timing offsets for different paddles are NOT
10// taken into account here.
12
13#include "THaPhysicsModule.h"
14#include "TString.h"
15#include <vector>
16#include <memory>
17
18class THaSpectrometer;
19class THaScintillator;
20class THaDetMap;
21class THaTrack;
22
24
25public:
26 THaCoincTime( const char* name, const char* description,
27 const char* spec1="L", const char* spec2="R",
28 Double_t mass1 = .938272, Double_t mass2 = 0.000511,
29 const char* ch_name1=nullptr, const char* ch_name2= nullptr);
30
31 virtual ~THaCoincTime();
32
33 virtual void Clear( Option_t* opt="" );
34
35 virtual EStatus Init( const TDatime& run_time );
36 virtual Int_t Process( const THaEvData& );
37
38 Int_t GetNTr1() const { return fVxTime1.size(); }
39 Int_t GetNTr2() const { return fVxTime2.size(); }
40 Int_t GetNTimes() const { return fTimeCombos.size(); }
41
42 protected:
43
44 // Configuration
45 TString fSpectN1, fSpectN2; // Names of spectrometers to use
46 Double_t fpmass1, fpmass2; // masses to use for coinc. time
47
48 THaSpectrometer *fSpect1, *fSpect2; // pointers to spectrometers
49
50 TString fTdcLabels[2]; // detector names for reading out TDCs
51 // (should be obvious like "RbyL" or "LbyBB"
52
53 std::unique_ptr<THaDetMap> fDetMap;
54
55 // Calibrations
56 Double_t fTdcRes[2]; // TDC res. of TDC in spec1 and spec2
57 Double_t fTdcOff[2]; // timing offset (in seconds)
58
59 // per-event data
60 Double_t fTdcData[2]; // timing of trig sp2+delay after trig sp1,
61 // and timing of trig sp1+delay after trig sp2
62
63 std::vector<Double_t> fVxTime1; // times at vertex for tracks in spec1
64 std::vector<Double_t> fVxTime2; // times at vertex for tracks in spec2
65
66
67 class TimeCombo {
68 public:
70 : fTrInd1(i), fTrInd2(j), fDiffT2by1(t21), fDiffT1by2(t12) {}
71 Int_t fTrInd1; // track index from spec1 for fDiff*
72 Int_t fTrInd2; // track index from spec2 for fDiff*
73 Double_t fDiffT2by1; // overall time difference at vtx
74 Double_t fDiffT1by2; // overall time difference at vtx
75 };
76 std::vector<TimeCombo> fTimeCombos; // time combinations to consider
77
78 virtual Int_t DefineVariables( EMode mode = kDefine );
79 virtual Int_t ReadDatabase( const TDatime& date );
80
81
82 public:
83
84 ClassDef(THaCoincTime,0) //Single arm kinematics module
85};
86
87#endif
int Int_t
double Double_t
const char Option_t
#define ClassDef(name, id)
char name[80]
TimeCombo(Int_t i, Int_t j, Double_t t21, Double_t t12)
virtual Int_t ReadDatabase(const TDatime &date)
TString fSpectN1
THaSpectrometer * fSpect2
TString fSpectN2
virtual ~THaCoincTime()
virtual void Clear(Option_t *opt="")
std::vector< Double_t > fVxTime2
Int_t GetNTr2() const
Double_t fTdcRes[2]
TString fTdcLabels[2]
Double_t fTdcOff[2]
std::vector< TimeCombo > fTimeCombos
std::unique_ptr< THaDetMap > fDetMap
Double_t fpmass2
Double_t fpmass1
THaSpectrometer * fSpect1
virtual Int_t DefineVariables(EMode mode=kDefine)
Int_t GetNTimes() const
virtual Int_t Process(const THaEvData &)
std::vector< Double_t > fVxTime1
Int_t GetNTr1() const
Double_t fTdcData[2]