BOSS 7.0.6
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 fRec = false; //Long Peixun's update: Reconstruction Event
39 fDay = 20; // Day of Event
40 fMonth = 7; // Month of Event
41 fYear = 2008; // Year of Event
42 fHour = 1; // Hour of Event
43 fMin = 4; // Minute of Event
44 fSec = 4; // Second of Event
45 fP = 0.0; // Total momentum of all Mdc Tracks (in GeV/c)
46 fPt = 0.0; // Transverse momentum
47}
48
49//_____________________________________________________________
50
52 //
53 // BesEventHeader default destructor
54 if ( gDebug ) cout << "BesEventHeader dtor called" << endl;
55
56}
57
58//_____________________________________________________________
59void BesEventHeader::SetEventTrig(Int_t timeType,
60 vector<Int_t>& trigConditionVector,
61 vector<Int_t>& trigChannelVector ){
62
63 fTimeType = timeType;
64 fTrigChannelVector.clear();
65 fTrigConditionVector.clear();
66 fTrigChannelVector = trigChannelVector;
67 fTrigConditionVector = trigConditionVector;
68 //************************************
69 cout << "BesEventHeader::time Type: " << timeType << endl;
70 vector<Int_t>::iterator pTrigVector;
71 for (pTrigVector = trigConditionVector.begin();
72 pTrigVector != trigConditionVector.end();
73 pTrigVector++){
74 cout << "BesEventHeader::trigCondition: " << *pTrigVector << endl;
75 }
76 for (pTrigVector = trigChannelVector.begin();
77 pTrigVector != trigChannelVector.end();
78 pTrigVector++){
79 cout << "BesEventHeader::trigChannel: " << *pTrigVector << endl;
80 }
81 //************************************
82}
83//________________________________________________________
84
85void BesEventHeader::SetEventHeaderGeneral(Long64_t run, Long64_t event,Int_t time1,Int_t time2) {
86 //
87 // Set general event header
88 fRun = run;
89 fEvent = event;
90
91
92 // modify date
93 if (time1 > 0) {
94 int a,b;
95 a=time1%100;
96 fDay=a;
97
98 b=(time1-a)%10000;
99 fMonth=b/100;
100
101 fYear=(time1-a-b)/10000;
102 }
103
104 //modify time
105 if (time2 > 0) {
106 int c,d;
107 c=time2%100;
108 fSec=c;
109
110 d=(time2-c)%10000;
111 fMin=d/100;
112
113 fHour=(time2-c-d)/10000;
114 }
115}
116
117//_____________________________________________________________
118
120{
121 fMC = mc;
122}
123
124//_____________________________________________________________
125//Long Peixun's update: for Rec flag
127{
128 fRec = rec;
129}
130
131//_____________________________________________________________
132
133void BesEventHeader::SetEventEvTime(Double_t time, Int_t status, Double_t quality)
134{
135 fEvTime = time;
136 fEvTimeStatus = status;
137 fEvTimeQuality = quality;
138}
139
140//_____________________________________________________________
141
142void BesEventHeader::SetEventMdc(Double_t p, Double_t pt, Double_t px, Double_t py, Double_t pz)
143{
144 fP = p;
145 fPt = pt;
146 fPx = px;
147 fPy = py;
148 fPz = pz;
149}
150
151//_____________________________________________________________
152
154{
155 fT = t;
156}
157
158//_____________________________________________________________
159
161{
162 fE = e;
163}
164
165//_____________________________________________________________
166void BesEventHeader::PrintWord(TString & word,Int_t nbits, Int_t trigger,Int_t trigger2) const {
167 Int_t j;
168 if (trigger!=0){
169 for (j=0;j<nbits;j++){
170 if ((trigger>>j)&0x1) word+=Form(" %.2d",j+1);
171 }
172 }
173 if (trigger2!=0){
174 for (j=0;j<nbits;j++){
175 if ((trigger2>>j)&0x1) word+=Form(" %.2d",j+17);
176 }
177 }
178}
ClassImp(BesEventHeader) BesEventHeader
TTree * t
Definition: binning.cxx:23
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 void SetEventRec(Bool_t rec)
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)
const double b
Definition: slope.cxx:9