BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEventHeader.cxx
Go to the documentation of this file.
1//
2// BesEventHeader.cxx
3//
4
5#include "BesVisLib/BesEventHeader.h"
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 : TObject() {
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//_____________________________________________________________
58void BesEventHeader::SetEventTrig( Int_t timeType, vector<Int_t>& trigConditionVector,
59 vector<Int_t>& trigChannelVector ) {
60
61 fTimeType = timeType;
62 fTrigChannelVector.clear();
63 fTrigConditionVector.clear();
64 fTrigChannelVector = trigChannelVector;
65 fTrigConditionVector = trigConditionVector;
66 //************************************
67 cout << "BesEventHeader::time Type: " << timeType << endl;
68 vector<Int_t>::iterator pTrigVector;
69 for ( pTrigVector = trigConditionVector.begin(); pTrigVector != trigConditionVector.end();
70 pTrigVector++ )
71 { cout << "BesEventHeader::trigCondition: " << *pTrigVector << endl; }
72 for ( pTrigVector = trigChannelVector.begin(); pTrigVector != trigChannelVector.end();
73 pTrigVector++ )
74 { cout << "BesEventHeader::trigChannel: " << *pTrigVector << endl; }
75 //************************************
76}
77//________________________________________________________
78
79void BesEventHeader::SetEventHeaderGeneral( Long64_t run, Long64_t event, Int_t time1,
80 Int_t time2 ) {
81 //
82 // Set general event header
83 fRun = run;
84 fEvent = event;
85
86 // modify date
87 if ( time1 > 0 )
88 {
89 int a, b;
90 a = time1 % 100;
91 fDay = a;
92
93 b = ( time1 - a ) % 10000;
94 fMonth = b / 100;
95
96 fYear = ( time1 - a - b ) / 10000;
97 }
98
99 // modify time
100 if ( time2 > 0 )
101 {
102 int c, d;
103 c = time2 % 100;
104 fSec = c;
105
106 d = ( time2 - c ) % 10000;
107 fMin = d / 100;
108
109 fHour = ( time2 - c - d ) / 10000;
110 }
111}
112
113//_____________________________________________________________
114
115void BesEventHeader::SetEventMC( Bool_t mc ) { fMC = mc; }
116
117//_____________________________________________________________
118// Long Peixun's update: for Rec flag
119void BesEventHeader::SetEventRec( Bool_t rec ) { fRec = rec; }
120
121//_____________________________________________________________
122
123void BesEventHeader::SetEventEvTime( Double_t time, Int_t status, Double_t quality ) {
124 fEvTime = time;
125 fEvTimeStatus = status;
126 fEvTimeQuality = quality;
127}
128
129//_____________________________________________________________
130
131void BesEventHeader::SetEventMdc( Double_t p, Double_t pt, Double_t px, Double_t py,
132 Double_t pz ) {
133 fP = p;
134 fPt = pt;
135 fPx = px;
136 fPy = py;
137 fPz = pz;
138}
139
140//_____________________________________________________________
141
142void BesEventHeader::SetEventTof( Double_t t ) { fT = t; }
143
144//_____________________________________________________________
145
146void BesEventHeader::SetEventEmc( Double_t e ) { fE = e; }
147
148//_____________________________________________________________
149void BesEventHeader::PrintWord( TString& word, Int_t nbits, Int_t trigger,
150 Int_t trigger2 ) const {
151 Int_t j;
152 if ( trigger != 0 )
153 {
154 for ( j = 0; j < nbits; j++ )
155 {
156 if ( ( trigger >> j ) & 0x1 ) word += Form( " %.2d", j + 1 );
157 }
158 }
159 if ( trigger2 != 0 )
160 {
161 for ( j = 0; j < nbits; j++ )
162 {
163 if ( ( trigger2 >> j ) & 0x1 ) word += Form( " %.2d", j + 17 );
164 }
165 }
166}
ClassImp(BesEventHeader) BesEventHeader
Double_t time
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 SetEventTrig(Int_t timeType, vector< Int_t > &trigConditionVector, vector< Int_t > &trigChannelVector)
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)
int t()
Definition t.c:1