34 const char* description,
35 const char* spec1,
const char* spec2,
37 const char* ch_name1,
const char* ch_name2,
38 const char* detname1,
const char* detname2)
40 fTrPads1(nullptr), fS2TrPath1(nullptr), fS2Times1(nullptr), fTrPath1(nullptr),
41 fTrPads2(nullptr), fS2TrPath2(nullptr), fS2Times2(nullptr), fTrPath2(nullptr),
69 if( detname2 && *detname2 ) {
89 if (stat !=
kOK)
return stat;
101 Error(
Here(
"Init"),
"Cannot get variables for spectrometer %s detector %s",
115 Error(
Here(
"Init"),
"Cannot get variables for spectrometer %s detector %s",
130 if( !
IsOK() )
return -1;
155 vector<Double_t>& Vxtime;
163 const vector<Spec_short> SpList = {
168 for(
const auto& sp : SpList ) {
169 Int_t Ntr = sp.Sp->GetNTracks();
170 if( Ntr <= 0)
continue;
173 THaVar* tr_pads = sp.trpads;
174 THaVar* s2trpath = sp.s2trpath;
175 THaVar* s2times = sp.s2times;
176 THaVar* trpath = sp.trpath;
178 if (!tr_pads || !s2trpath || !s2times || !trpath)
continue;
180 for (
Int_t i=0; i<Ntr; i++ ) {
181 assert(sp.Vxtime.empty());
185 Warning(
Here(
"Process"),
"non-THaTrack in %s's tracks array at %d.",
192 int pad =
static_cast<int>(tr_pads->
GetValue(i));
195 sp.Vxtime.push_back((i + 1) *
kBig);
206 sp.Vxtime.push_back((i + 1) *
kBig);
216 for(
size_t i = 0; i <
fVxTime1.size(); i++ ) {
217 for(
size_t j = 0; j <
fVxTime2.size(); j++ ) {
winID h TVirtualViewer3D TVirtualGLPainter p
R__EXTERN class THaVarList * gHaVars
char * Form(const char *fmt,...)
virtual const char * Here(const char *) const
THaSpectrometer * fSpect2
std::vector< Double_t > fVxTime2
std::vector< TimeCombo > fTimeCombos
std::unique_ptr< THaDetMap > fDetMap
THaSpectrometer * fSpect1
std::vector< Double_t > fVxTime1
UInt_t GetNumHits(UInt_t crate, UInt_t slot, UInt_t chan) const
UInt_t GetData(UInt_t crate, UInt_t slot, UInt_t chan, UInt_t hit) const
virtual Int_t Process(const THaEvData &)
virtual ~THaS2CoincTime()
THaS2CoincTime(const char *name, const char *description, const char *spec1="L", const char *spec2="R", Double_t mass1=.938272, Double_t mass2=0.000511, const char *ch_name1=nullptr, const char *ch_name2=nullptr, const char *detname1="s2", const char *detname2="")
virtual THaVar * Find(const char *name) const
Double_t GetValue(Int_t i=0) const
const char * GetName() const override
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Error(const char *method, const char *msgfmt,...) const
const char * Data() const
double beta(double x, double y)
Double_t Sqrt(Double_t x)