FairRoot/PandaRoot
PndOnlineFilterInfo.cxx
Go to the documentation of this file.
1 // //
3 // PndOnlineFilterInfo //
4 // //
5 // Information Container for Online Filter Results //
6 // //
7 // Author: Klaus Goetzen, GSI, 2013 //
8 // //
10 
11 #include "PndOnlineFilterInfo.h"
12 #include "TClass.h"
13 #include <iostream>
14 #include <stdlib.h>
15 
17  fTag(false),
18  fNTagTotal(0),
19  fNModes(0)
20 {
21  for (int i=0;i<OFIMAXMODES;++i)
22  {
23  fMode[i]=-1;
24  fNTag[i]=0;
25  }
26 }
27 
28 // ---------------------------------------
29 
31 {
32 }
33 
34 // ---------------------------------------
35 // set number of tag candidates for trigger line with code 'mode'
37 {
38  for (int i=0;i<fNModes;++i)
39  {
40  if (fMode[i]==mode) // known mode code
41  {
43  fNTag[i] = tag;
44  return;
45  }
46  }
47 
48  // new mode code
49  if (fNModes>=OFIMAXMODES)
50  {
51  std::cout <<"[PndOnlineFilterInfo] **** Exceeding maximum number of "<<OFIMAXMODES<<" modes!"<<std::endl;
52  exit(1);
53  }
54 
55  fMode[fNModes] = mode;
56  fNTag[fNModes++] = tag;
57  fNTagTotal += tag;
58  fTag = (fNTagTotal>0);
59 }
60 
61 // ---------------------------------------
62 // get number of tag candidates for trigger line with code 'mode'
64 {
65  for (int i=0;i<fNModes;++i) if (fMode[i]==mode) return fNTag[i];
66 
67  return 0;
68 }
69 
70 // ---------------------------------------
71 
73 {
74  fTag=false;
75  fNTagTotal=0;
76  fNModes=0;
77 
78  for (int i=0;i<OFIMAXMODES;++i)
79  {
80  fMode[i]=-1;
81  fNTag[i]=0;
82  }
83 }
84 
85 // ---------------------------------------
86 
88 {
89  std::cout <<"PndOnlineFilterInfo found triggers: " <<std::endl;
90  std::cout <<"fNTagTotal : "<< fNTagTotal <<std::endl;
91 
92  for (int i=0;i<fNModes;++i)
93  {
94  std::cout <<"fN["<<fMode[i]<<"] :"<< fNTag[i]<<std::endl;
95  }
96 }
97 
98 
100 
#define OFIMAXMODES
int fMode[OFIMAXMODES]
Int_t i
Definition: run_full.C:25
exit(0)
Int_t tag
Definition: crosstag.C:23
Int_t mode
Definition: autocutx.C:47
void SetNTag(int mode, const int tag)
int fNTag[OFIMAXMODES]
ClassImp(PndAnaContFact)