QwAnalysis
QwSoftwareMeantime.cc
Go to the documentation of this file.
1 /**
2  * \file QwSoftwareMeantime.cc
3  * \brief
4  * \author Jeong Han Lee, jhlee@jlab.org
5  * \date Wednesday, March 14 13:46:22 EDT 2012
6  */
7 
8 #include "QwSoftwareMeantime.h"
9 
12 
13 
18 
19 
20 
22 {
23 
24  fMeanTime = 0.0;
25  fSubtractTime = 0.0;
26 
27  fPositiveValue = 0.0;
28  fNegativeValue = 0.0;
29 
30  fDiffHardSoftMeanTime = 0.0; // Hardware MT - Software MT
31  fHardWareMeanTime = 0.0;
32 
33  fPositiveHitId = 0;
34  fNegativeHitId = 0;
35  fMeanTimeId = 0;
36 
37  fEventId = 0;
38  fDetectorType = "";
39  fHasValue = false;
40 
41 };
42 
43 
44 MeanTime::MeanTime(TString name, Long64_t ev_id, Double_t p_in, Double_t n_in, Int_t p_id, Int_t n_id)
45 {
46  fDetectorType = name;
47  fEventId = ev_id;
48  fDiffHardSoftMeanTime = 0.0;
49  fHardWareMeanTime = 0.0;
50 
51 
52  AddPNValues(p_in, n_in, p_id, n_id);
53 };
54 
55 
57 {
58 };
59 
60 void
61 MeanTime::AddPNValues(Double_t p_value, Double_t n_value, Int_t p_id, Int_t n_id)
62 {
63  fPositiveValue = p_value;
64  fNegativeValue = n_value;
65 
66  fPositiveHitId = p_id;
67  fNegativeHitId = n_id;
68 
71 
72  fHasValue = true;
73 
74  return;
75 }
76 
77 
78 void
79 MeanTime::Print(Bool_t on=true)
80 {
81  if (!on) return;
82 
83  TString output = "";
84  if (fDetectorType == "MD") output += "<<";
85  else if(fDetectorType == "TS") output += ">>";
86 
87  output += fDetectorType;
88 
89  if (fDetectorType == "MD") output += fPlane;
90  else if(fDetectorType == "TS") output += fPlane;
91 
92  output += Form("-- ID %d ------Event ", fMeanTimeId);
93  output += fEventId;
94  output += ": HitIndex[";
95  output += fPositiveHitId;
96  output += ",";
97  output += fNegativeHitId;
98  output += "]";
99 
100  if (fDetectorType == "MD") {
101  output += Form( " MDp%+9.2f MDm%+9.2f dMD%+9.2f MDsMT %+10.2f << ---------------------------- <<",
103  }
104  else if (fDetectorType == "TS") {
105  output += Form( " TSp%+9.2f TSm%+9.2f dTS%+9.2f TSsMT %+10.2f TShMT %+10.2f dTSMT %+8.2f >>",
107  }
108 
109  printf("%s\n", output.Data());
110 
111  return;
112 };
113 
114 
115 Bool_t
116 MeanTime::IsInTimeWindow(Double_t time_window)
117 {
118  Bool_t status = false;
119  status = ( fabs(fSubtractTime) < time_window ) ? true : false;
120  return status;
121 };
122 
123 
124 Bool_t
126 {
127  Bool_t status = false;
128  status = ( fPositiveHitId == fNegativeHitId ) ? true : false;
129  return status;
130 };
131 
132 
133 
134 void
135 MeanTime::SetHardwareMeanTime(Double_t hardware_meantime)
136 {
137  fHardWareMeanTime = hardware_meantime;
139  return;
140 }
141 
142 
143 
144 void
146 {
147  fHasValue = false;
148 
149  fMeanTime = 0.0;
150  fSubtractTime = 0.0;
151 
152  fDiffHardSoftMeanTime = 0.0;
153  fHardWareMeanTime = 0.0;
154 
155  fPositiveValue = 0.0;
156  fNegativeValue = 0.0;
157 
158  fPositiveHitId = 0;
159  fNegativeHitId = 0;
160  fMeanTimeId = 0;
161 
162  fEventId = 0;
163 
164  return;
165 }
166 
167 
168 
169 
170 
172 {
173  // default Time Window is 2000 ns, so
174  // accept all TDC data from F1TDCs
175 
176  fTimeWindowNs = 2000.0;
177 
178  fDetectorName = "";
179 
180  fMeanTimeList = new TObjArray();
181  fMeanTimeList -> Clear();
182  fMeanTimeList -> SetOwner(kTRUE);
183  fNMeanTimes = 0;
184 
185  fEventId = 0;
187 
188  for(Int_t i=0;i<7;i++)
189  {
190  fPositiveValue[i] = 0.0;
191  fNegativeValue[i] = 0.0;
192  fHardwareMeantimeValue[i] = 0.0;
193  }
194 
195 };
196 
197 
198 
200 {
201 
202  fTimeWindowNs = 2000.0;
203 
204  fDetectorName = name;
205 
206  fMeanTimeList = new TObjArray();
207  fMeanTimeList -> Clear();
208  fMeanTimeList -> SetOwner(kTRUE);
209  fNMeanTimes = 0;
210 
211  fEventId = 0;
212 
214 
215  for(Int_t i=0;i<7;i++)
216  {
217  fPositiveValue[i] = 0.0;
218  fNegativeValue[i] = 0.0;
219  fHardwareMeantimeValue[i] = 0.0;
220  }
221 
222 };
223 
224 
226 {
227  if(fMeanTimeList) delete fMeanTimeList; fMeanTimeList = NULL;
228 };
229 
230 
231 Int_t
232 MeanTimeContainer::AddMeanTime(TString name, Long64_t ev_id, Double_t p_in, Double_t n_in, Int_t p_id, Int_t n_id)
233 {
234 
235  Int_t pos = 0;
236  MeanTime *temp = NULL;
237  temp = new MeanTime(name, ev_id, p_in, n_in, p_id, n_id);
238 
239  if(temp->IsInTimeWindow(fTimeWindowNs)) {
240  temp -> SetMeanTimeId(fNMeanTimes);
241  pos = fMeanTimeList->AddAtFree(temp) ;
242  fNMeanTimes++;
243  }
244  else {
245  delete temp; temp = NULL;
246  }
247 
248  return pos;
249 }
250 
251 
252 Int_t
253 MeanTimeContainer::AddMeanTime(TString name, Int_t plane_id, Long64_t ev_id, Double_t p_in, Double_t n_in, Int_t p_id, Int_t n_id)
254 {
255 
256  Int_t pos = 0;
257  MeanTime *temp = NULL;
258  temp = new MeanTime(name, ev_id, p_in, n_in, p_id, n_id);
259 
260  if(temp->IsInTimeWindow(fTimeWindowNs)) {
261  temp -> SetMeanTimeId(fNMeanTimes);
262  temp -> SetPlane(plane_id);
263  pos = fMeanTimeList->AddAtFree(temp) ;
264  fNMeanTimes++;
265  }
266  else {
267  delete temp; temp = NULL;
268  }
269 
270  return pos;
271 }
272 
273 
274 void
275 MeanTimeContainer::Add(Double_t p_value, Double_t n_value, Int_t hit_id)
276 {
277  fPositiveValue[hit_id] = p_value;
278  fNegativeValue[hit_id] = n_value;
279 
280  return;
281 }
282 
283 
284 void
285 MeanTimeContainer::Add(Double_t p_value[7], Double_t n_value[7])
286 {
287  for(Int_t i=0; i<7; i++)
288  {
289  fPositiveValue[i] = p_value[i];
290  fNegativeValue[i] = n_value[i];
291  }
292 
293  return;
294 }
295 
296 void
297 MeanTimeContainer::Add(Int_t element, Int_t hit_number, Double_t time_ns)
298 {
299  if(time_ns!=0.0) {
300  if( element==1 ) {
301  fPositiveValue[hit_number] = time_ns;
302  fNPositive++;
303  }
304  else if (element == 2) {
305  fNegativeValue[hit_number] = time_ns;
306  fNNegative++;
307  }
308  // We don't need this to fill element == 0, because QwHit has hardware mt anyway....
309  // else if (element == 0) {
310  // // do we need this? QwHit has hardware mt anyway....
311  // fHardwareMeantimeValue[hit_number] = time_ns;
312  // fNHarewareMeanTimes++;
313  // }
314  }
315 
316  return;
317 }
318 
319 void
320 MeanTimeContainer::Add(Double_t p_value[7], Double_t n_value[7], Double_t hardware_meantime[7])
321 {
322  for(Int_t i=0; i<7; i++)
323  {
324  fPositiveValue[i] = p_value[i];
325  if(p_value[i]!=0.0) {
326  fNPositive++;
327  }
328 
329  fNegativeValue[i] = n_value[i];
330  if(n_value[i]!=0.0) {
331  fNNegative++;
332  }
333 
334  fHardwareMeantimeValue[i] = hardware_meantime[i];
335  if(hardware_meantime[i]!=0.0) {
337  }
338  }
339 
341 
342  // printf("positive %d negative %d and hardware %d\n", fNPositive, fNNegative, fNHarewareMeanTimes);
343  return;
344 }
345 
346 
347 // ProcessMeanTime function is very inefficient, because
348 // it uses all hit combinations, even if we don't need them.
349 // Anyway, this first attempt is good enough to see
350 // what I want.
351 
352 // But it would be better to add a better logic to exclude empty entries.
353 // If so, we will get a bit faster script.
354 
355 // Wednesday, February 29 09:20:10 EST 2012, jhlee
356 
357 void
359 {
360 
361  if (fNPositive == 1 && fNNegative == 1) {
363  }
364  else {
365 
366 
367  Bool_t local_debug = false;
368  Bool_t GS_Stable_marriage_debug = false;
369 
370  Double_t ini = 100000.0;
371 
372  Double_t nst[7][7] = {{ini}}; // [negative][positive]
373  Double_t pst[7][7] = {{ini}}; // [positive][negative]
374 
375  // TString p_name[7] = {"p0", "p1", "p2", "p3", "p4", "p5", "p6"};
376  // TString n_name[7] = {"n0", "n1", "n2", "n3", "n4", "n5", "n6"};
377 
378  Int_t p = 0;
379  Int_t n = 0;
380  Int_t rank = 0;
381 
382  Int_t n_preference_list[7][7] = {{0}};
383  Int_t p_preference_list[7][7] = {{0}};
384 
385 
386  // n_preference_list must be built according to negative channel,
387 
388  // nst [negative][positive] // abs (subtract)
389 
390 
391  for(n=0; n<7; n++)
392  {
393  for(p=0; p<7; p++)
394  {
395  nst[n][p] = fabs(fPositiveValue[p] - fNegativeValue[n]);
396  //
397  // if one of them is zero, fill st with unreasonable number ini
398  //
399  if( nst[n][p] == fabs(fPositiveValue[p]) || nst[n][p]== fabs(fNegativeValue[n]) ) {
400  nst[n][p] = ini;
401  }
402  if(local_debug) printf("neg [%d,%d], nst %f \n", n,p, nst[n][p]);
403  }
404  //
405  // sort n_preference_list in lowest st at the first place [n][0].
406  //
407  TMath::Sort(7, nst[n], n_preference_list[n], false);
408 
409  // if(local_debug) {
410  // for(j=0; j<maximum_hit_number; j++)
411  // {
412  // printf("Sort [%d,%d], index sorting %d st sorting %f\n", p,j, n_preference_list[p][j], nst[p][n_preference_list[p][j]]);
413  // }
414  // }
415  }
416 
417  // p_preference_list must be built according to positive channel,
418 
419  for(p=0; p<7; p++)
420  {
421  for(n=0; n<7; n++)
422  {
423  pst[p][n] = fabs(fPositiveValue[p] - fNegativeValue[n]);
424  //
425  // if one of them is zero, fill st with unreasonable number ini
426  //
427  if(pst[p][n] == fabs(fPositiveValue[p]) || pst[p][n]== fabs(fNegativeValue[n]) ) {
428  pst[p][n] = ini;
429  }
430  if(local_debug) printf("pos [%d,%d], pst %f \n", p,n,pst[p][n]);
431  }
432  //
433  // sort n_preference_list in lowest st at the first place [n][0].
434  //
435  TMath::Sort(7, pst[p], p_preference_list[p], false);
436 
437  // if(local_debug) {
438  // for(j=0; j<maximum_hit_number; j++)
439  // {
440  // printf("Sort [%d,%d], index sorting %d st sorting %f\n", p,j, n_preference_list[p][j], nst[p][n_preference_list[p][j]]);
441  // }
442  // }
443  }
444 
445 
446  if(local_debug) {
447  for(n=0; n<7; n++)
448  {
449  for(p=0; p<7; p++)
450  {
451  printf("Sort [%d,%d], index sorting %d st sorting %f\n", n,p, n_preference_list[n][p], nst[n][p]);
452  }
453  }
454  printf("\n");
455  }
456 
457 
458  if(local_debug) {
459  for(p=0; p<7; p++)
460  {
461  for(n=0; n<7; n++)
462  {
463  printf("Sort [%d,%d], index sorting %d st sorting %f\n", p,n, p_preference_list[p][n], nst[p][n]);
464  }
465  }
466  printf("\n");
467  }
468 
469  // rank of negative channels
470  // n_rank[negative channel][rank]
471  // we don't need to have rank of positive channels,
472  // because positive propose to negative
473  //
474  Int_t n_rank[7][7] = {{0}};
475 
476  for(n=0; n<7; n++)
477  {
478  for (rank=0; rank<7; rank++)
479  {
480  n_rank[n][n_preference_list[n][rank]] = rank;
481  // printf("n_rank[%d][%d] = %d\n", n, n_preference_list[n][rank], rank);
482  }
483  }
484 
485 
486  // p seems to be man, and n seems to be woman.
487 
488  Int_t fiancee [7]; // fiancee[p] = n , n with viewpoint of p.
489  Int_t suitor [7]; // suitor [n] = p , p with viewpoint of n.
490  Int_t decrease_rank[7];
491  Int_t getting_engaged = 0;
492 
493  // Initially all p s and all n s are free
494  // fiancee[0] = -1 means p 0 is solo
495 
496  for(p=0; p<7; p++)
497  {
498  decrease_rank[p] = 0; fiancee[p] = -1;
499  }
500 
501  for(n=0; n<7; n++)
502  {
503  suitor[n] = -1;
504  }
505 
506  while (getting_engaged < 7)
507  {
508  // While there is a positive channel p which is free and has not proposed to every negative
509  // Chose such a positive channel p which is free or solo
510  for (p=0; fiancee[p]!=-1; p++)
511  ;
512 
513  if(GS_Stable_marriage_debug) printf(">>> positive channel %d proposing:\n", p);
514 
515  while (fiancee[p] == -1) {
516 
517  // Let n be the highest-ranked negative in the preference list of positive.
518  // In the preference list, the first place is the highest-ranked negative number.
519  // decrease_rank[p] = 0 means the highest-ranked negative number
520 
521  n = p_preference_list[p][decrease_rank[p]];
522 
523  if(GS_Stable_marriage_debug) printf(" to negative %2d", n);
524 
525  // decrease the rank number, which means preparing the next highest-ranked negative number
526  // if highest-ranked negative will reject the propose of this positive p.
527  decrease_rank[p]++;
528 
529  // If negative is free or solo then
530  if (suitor[n] == -1) {
531  if(GS_Stable_marriage_debug) printf(" accepted\t(negative %2d previously free)\n", n);
532  suitor[n] = p; fiancee[p] = n;
533  getting_engaged++;
534  }
535  // Else negative is currently engaged to positive "suitor[n]"
536  else {
537  // if negative prefer positive_old(suitor[n]) to positive
538  // Greater rank means the lowest-ranked pixel.
539  if (n_rank[n][suitor[n]] < n_rank[n][p]) {
540  if(GS_Stable_marriage_debug) printf(" rejected\t(negative %2d prefers %d)\n", n, suitor[n]);
541  }
542  else {
543  // else pixel prefer f to f_old
544  if(GS_Stable_marriage_debug) printf(" accepted\t(negative %2d dumps positive %d)\n", n, suitor[n]);
545  // f_old becomes free
546  fiancee[suitor[n]] = -1;
547  // (f,p) become engaged
548  suitor[n] = p; fiancee[p] = n;
549  }
550  }
551  }
552  }
553 
554 
555  for(p=0; p<7; p++)
556  {
557  // if (local_debug) printf("%s %s\n", p_name[p].Data(), n_name[fiancee[p]].Data());
558  if(fPositiveValue[p] !=0.0 && fNegativeValue[fiancee[p]]!=0.0) {
559  AddMeanTime(fDetectorName, fPlane, fEventId, fPositiveValue[p], fNegativeValue[fiancee[p]], p, fiancee[p]);
560  }
561  }
562 
563 
565 
566  // // Int_t exclude_j = 0;
567  // // quick and dirty way
568  // for(Int_t i=0; i<7; i++)
569  // {
570  // for(Int_t j=exclude_j; j<7; j++)
571  // {
572  // subtract = fabs(fPositiveValue[i] - fNegativeValue[j]);
573  // meantime = 0.5*(fPositiveValue[i] + fNegativeValue[j]);
574 
575  // if ( subtract > fTimeWindowNs ) continue; // reject a meantime out of a reasonable time window
576  // if ( meantime == 0.0 ) continue; // skip when PositiveValue and NegativeValue are zero
577  // if ( (fabs(fPositiveValue[i])==subtract) || (fabs(fNegativeValue[j])==subtract)) continue; // skip to calculate a meantime when one of values is zero.
578  // // if(fDetectorName == "MD") {
579  // // printf("[%d,%d] P %8.2f N %8.2f, subtract %8.2f meantime %8.2f\n",
580  // // i, j, fPositiveValue[i], fNegativeValue[j], subtract, meantime);
581  // // }
582  // AddMeanTime(fDetectorName, fEventId, fPositiveValue[i], fNegativeValue[j], i,j);
583  // exclude_j = j;
584  // // if p[0] has its pair m[3], so we can ignore m[0], m[1], and m[2] in next i loop,
585  // // p[1] > p[0] and p[1] - m[0] > p[0] - m[0] > fTimeWindowNs yes
586  // // p[1] - m[1] > p[0] - m[1] > fTimeWindowNs yes
587  // // p[1] - m[2] > p[0] - m[2] > fTimeWindowNs yes
588 
589  // // And there is one addition case, we should care ....
590  // // p[1] - m[3] > p[0] - m[3] < fTimeWindowNs ... hmm... I am not sure....
591  // // alpha + p[0] - m[3] < fTimeWindowNs ?
592  // // alpha + p[0] - m[3] > fTimeWindowNs ?
593 
594  // // p[0]- m[4] could be < fTimeWindowNs also... hmm...
595  // // break;
596  // }
597 
598  // }
599 
600  }
601 
602  return;
603 }
604 
605 void
607 {
608  if (!on) return;
609 
610  printf("%s fNPositive %d fNNegative %d, fNMeanTimes %d fNHarewareMeanTimes %d\n",
612 
613  TObjArrayIter next(fMeanTimeList);
614  TObject* obj = NULL;
615  MeanTime * mean_time = NULL;
616 
617  while ( (obj = next()) )
618  {
619  mean_time = (MeanTime *) obj;
620  mean_time->Print();
621  }
622 
623  return;
624 };
625 
626 
627 
628 MeanTime*
630 {
631 
632  Int_t mt_index = 0;
633  TObjArrayIter next(fMeanTimeList);
634  TObject* obj = NULL;
635  MeanTime * mean_time = NULL;
636 
637  while ( (obj = next()) )
638  {
639  mean_time = (MeanTime *) obj;
640  mt_index = mean_time->GetMeanTimeId();
641  // printf("index %d and mt_index %d\n", index, mt_index);
642  if( mt_index == index ) {
643  // printf("can we see\n");
644  return mean_time;
645  }
646  }
647 
648  return NULL;
649 };
650 
651 
652 void
654 {
655  // we don't use this function into the main analyzer, it was used in F1TDCGoodMT.C script
656  // to check the reliability of a method to build software meantime for MD
657  // See https://qweak.jlab.org/elog/Detector/58
658  // Wednesday, March 14 13:57:37 EDT 2012, jhlee
659 
661  // printf("%s disable .....\n\n\n", fDetectorName.Data());
662  return;
663  }
664  // else {
665  // printf("%s enable ....\n\n\n", fDetectorName.Data());
666  // }
667 
668  Int_t mt_index = 0;
669 
670  TObjArrayIter next(fMeanTimeList);
671  TObject* obj = NULL;
672  MeanTime * mean_time = NULL;
673 
674  Double_t h_mt = 0.0;
675  Double_t h_mt_pos = 0.0;
676  Double_t h_mt_neg = 0.0;
677 
678  if( IsHarewareMatchSoftware() ) {
679  while ( (obj = next()) )
680  {
681  mean_time = (MeanTime *) obj;
682  mt_index = mean_time->GetMeanTimeId();
683  h_mt = fHardwareMeantimeValue[mt_index];
684  mean_time->SetHardwareMeanTime(h_mt);
685  }
686  }
687  else {
688 
690 
691  while ( (obj = next()) )
692  {
693  mean_time = (MeanTime *) obj;
694 
695  Double_t s_mt = 0.0;
696 
697  s_mt = mean_time -> GetMeanTime();
698  mt_index = mean_time->GetMeanTimeId();
699 
700  Int_t idx = mt_index;
701 
702  while(1)
703  {
704  h_mt = fHardwareMeantimeValue[idx];
705  // printf("%d %f %f \n", idx, s_mt, h_mt);
706  if ( fabs(s_mt - h_mt) <50 ) {
707  break;
708  }
709  idx++;
710 
711  }
712  mean_time->SetHardwareMeanTime(h_mt);
713 
714  }
715  }
716  else if (fNPositive == 2 && fNNegative == 1 && fNHarewareMeanTimes == 2){
717 
718  // ugly... only one meantime because of "if condition"
719  while ( (obj = next()) )
720  {
721  mean_time = (MeanTime *) obj;
722  Double_t s_mt = 0.0;
723  s_mt = mean_time -> GetMeanTime();
724  h_mt = fHardwareMeantimeValue[0];
725  if ( fabs(s_mt - h_mt) < 50 ) {
726  mean_time->SetHardwareMeanTime(h_mt);
727  }
728  else {
730  }
731  }
732 
733  }
734  else {
735  while ( (obj = next()) )
736  {
737  mean_time = (MeanTime *) obj;
738  Int_t negative_id = mean_time -> GetNegativeHitId();
739  Int_t positive_id = mean_time -> GetPositiveHitId();
740 
741  h_mt_pos = fHardwareMeantimeValue[positive_id];
742  h_mt_neg = fHardwareMeantimeValue[negative_id];
743 
744  if (h_mt_neg!=0.0) {
745  h_mt = h_mt_neg;
746  }
747  else {
748  // check whether TShMT[positive_id] is zero or not
749  // if it exists, use it as TShMT
750  if(h_mt_pos!=0.0) {
751  h_mt = h_mt_pos;
752  }
753  else {
754  h_mt = 0.0;
755  }
756  }
757  mean_time->SetHardwareMeanTime(h_mt);
758  }
759  }
760  }
761 
762 
763  return;
764 }
765 
766 Double_t
768 {
769 
770  Int_t mt_index = 0;
771  TObjArrayIter next(fMeanTimeList);
772  TObject* obj = NULL;
773  MeanTime * mean_time = NULL;
774 
775 
776  while ( (obj = next()) )
777  {
778  mean_time = (MeanTime *) obj;
779  mt_index = mean_time->GetMeanTimeId();
780  if( mt_index == index ) {
781  return mean_time->GetMeanTime();
782  }
783  }
784 
785  return 0.0;
786 };
787 
788 Bool_t
790 {
791  Bool_t status = false;
792  status = ( fNHarewareMeanTimes == fNMeanTimes ) ? true : false;
793  return status;
794 }
795 
796 
797 
798 void
800 {
801 
802  fMeanTimeList-> Clear();
803 
804  fNMeanTimes = 0;
805  fEventId = 0;
806 
807  fNPositive = 0;
808  fNNegative = 0;
810 
811  for(Int_t i=0;i<7;i++)
812  {
813  fPositiveValue[i] = 0.0;
814  fNegativeValue[i] = 0.0;
815  fHardwareMeantimeValue[i] = 0.0;
816  }
817 
818  TObjArrayIter next(fMeanTimeList);
819  TObject* obj = NULL;
820  MeanTime * mean_time = NULL;
821 
822  while ( (obj = next()) )
823  {
824  mean_time = (MeanTime *) obj;
825  mean_time->ClearEventData();
826  }
827 
828  return;
829 };
Int_t GetMeanTimeId() const
Int_t fNegativeHitId
static const Int_t fSoftwareNegativeHitElementID
static const Int_t fSoftwareSubtractHitElementID
static const Int_t fSoftwarePositiveHitElementID
Bool_t fHasValue
void Add(Double_t p_value, Double_t n_value, Int_t hit_id)
Double_t fDiffHardSoftMeanTime
Software Meantime container.
TString fDetectorType
void Print(Bool_t on)
Double_t fSubtractTime
Int_t fPositiveHitId
Bool_t IsHitIDsMatch()
Double_t fHardWareMeanTime
Double_t fNegativeValue
Double_t fPositiveValue[7]
Double_t fMeanTime
one software meantim holder
MeanTime * GetMeanTimeObject(Int_t index)
Bool_t IsInTimeWindow(Double_t time_window)
void Print(Bool_t on)
Bool_t fDisableMatchHardwareMeanTime
Double_t GetMeanTime(Int_t index)
void AddPNValues(Double_t p_value, Double_t n_value, Int_t p_id, Int_t n_id)
Long64_t fEventId
void ClearEventData()
void SetPlane(const Int_t in)
ClassImp(QwF1TDC)
Double_t fNegativeValue[7]
Double_t fPositiveValue
Double_t GetMeanTime() const
void SetHardwareMeanTime(Double_t hardware_meantime)
Double_t fHardwareMeantimeValue[7]
virtual ~MeanTime()
Int_t AddMeanTime(TString name, Long64_t ev_id, Double_t p_in, Double_t n_in, Int_t p_id, Int_t n_id)
void SetDisableMatchHardwareMeantime(const Bool_t disable)
static const Int_t fSoftwareMeantimeHitElementID