BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEventHeader.cxx
Go to the documentation of this file.
1//
2// BesEventHeader.cxx
3//
4
6#include <iostream>
7
8using namespace std;
9
10#ifndef __CINT__
12#endif
13
14//_____________________________________________________________
15// BesEventHeader
16// Bes event header class
17//
18// Event informations are handled in blocks with fixed order
19//
20// (0) general block, handled by own access functions
21// (1) CAL information => GetContentCAL
22// (2) FLT information => GetContentFLT
23// (3a) Sinistra DA information => GetContentSinDA
24// (3b) Sinistra EL information => GetContentSinEL
25// (3c) Sinistra JB information => GetContentSinDA
26//
27//
28
30{
31 //
32 // BesEventHeader default constructor
33 if ( gDebug ) cout << "BesEventHeader ctor called" << endl;
34
35 fRun = 0; // Run number
36 fEvent = 0; // Event number
37 fMC = true; // MC event
38 fDay = 20; // Day of Event
39 fMonth = 7; // Month of Event
40 fYear = 2008; // Year of Event
41 fHour = 1; // Hour of Event
42 fMin = 4; // Minute of Event
43 fSec = 4; // Second of Event
44 fP = 0.0; // Total momentum of all Mdc Tracks (in GeV/c)
45 fPt = 0.0; // Transverse momentum
46}
47
48//_____________________________________________________________
49
51 //
52 // BesEventHeader default destructor
53 if ( gDebug ) cout << "BesEventHeader dtor called" << endl;
54
55}
56
57//_____________________________________________________________
58void BesEventHeader::SetEventTrig(Int_t timeType,
59 vector<Int_t>& trigConditionVector,
60 vector<Int_t>& trigChannelVector ){
61
62 fTimeType = timeType;
63 fTrigChannelVector.clear();
64 fTrigConditionVector.clear();
65 fTrigChannelVector = trigChannelVector;
66 fTrigConditionVector = trigConditionVector;
67 //************************************
68 cout << "BesEventHeader::time Type: " << timeType << endl;
69 vector<Int_t>::iterator pTrigVector;
70 for (pTrigVector = trigConditionVector.begin();
71 pTrigVector != trigConditionVector.end();
72 pTrigVector++){
73 cout << "BesEventHeader::trigCondition: " << *pTrigVector << endl;
74 }
75 for (pTrigVector = trigChannelVector.begin();
76 pTrigVector != trigChannelVector.end();
77 pTrigVector++){
78 cout << "BesEventHeader::trigChannel: " << *pTrigVector << endl;
79 }
80 //************************************
81}
82//________________________________________________________
83
84void BesEventHeader::SetEventHeaderGeneral(Long64_t run, Long64_t event,Int_t time1,Int_t time2) {
85 //
86 // Set general event header
87 fRun = run;
88 fEvent = event;
89
90
91 // modify date
92 if (time1 > 0) {
93 int a,b;
94 a=time1%100;
95 fDay=a;
96
97 b=(time1-a)%10000;
98 fMonth=b/100;
99
100 fYear=(time1-a-b)/10000;
101 }
102
103 //modify time
104 if (time2 > 0) {
105 int c,d;
106 c=time2%100;
107 fSec=c;
108
109 d=(time2-c)%10000;
110 fMin=d/100;
111
112 fHour=(time2-c-d)/10000;
113 }
114}
115
116//_____________________________________________________________
117
119{
120 fMC = mc;
121}
122
123//_____________________________________________________________
124
125void BesEventHeader::SetEventEvTime(Double_t time, Int_t status, Double_t quality)
126{
127 fEvTime = time;
128 fEvTimeStatus = status;
129 fEvTimeQuality = quality;
130}
131
132//_____________________________________________________________
133
134void BesEventHeader::SetEventMdc(Double_t p, Double_t pt, Double_t px, Double_t py, Double_t pz)
135{
136 fP = p;
137 fPt = pt;
138 fPx = px;
139 fPy = py;
140 fPz = pz;
141}
142
143//_____________________________________________________________
144
146{
147 fT = t;
148}
149
150//_____________________________________________________________
151
153{
154 fE = e;
155}
156
157//_____________________________________________________________
158void BesEventHeader::PrintWord(TString & word,Int_t nbits, Int_t trigger,Int_t trigger2) const {
159 Int_t j;
160 if (trigger!=0){
161 for (j=0;j<nbits;j++){
162 if ((trigger>>j)&0x1) word+=Form(" %.2d",j+1);
163 }
164 }
165 if (trigger2!=0){
166 for (j=0;j<nbits;j++){
167 if ((trigger2>>j)&0x1) word+=Form(" %.2d",j+17);
168 }
169 }
170}
ClassImp(BesEventHeader) BesEventHeader
Double_t time
virtual void SetEventTrig(Int_t timeType, vector< Int_t > &trigConditionVector, vector< Int_t > &trigChannelVector)
virtual void SetEventMdc(Double_t p, Double_t pt, Double_t px, Double_t py, Double_t pz)
void PrintWord(TString &word, Int_t nbits, Int_t trigger, Int_t trigger2=0) const
virtual void SetEventHeaderGeneral(Long64_t run, Long64_t event, Int_t time1, Int_t time2)
virtual ~BesEventHeader()
virtual void SetEventEvTime(Double_t time, Int_t status, Double_t quality)
virtual void SetEventEmc(Double_t e)
virtual void SetEventTof(Double_t t)
virtual void SetEventMC(Bool_t mc)
int t()
Definition: t.c:1