/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/EventDisplay/BesVisLib/BesVisLib-00-04-04/src/BesEventHeader.cxx

Go to the documentation of this file.
00001 //
00002 // BesEventHeader.cxx
00003 //
00004 
00005 #include "BesVisLib/BesEventHeader.h"
00006 #include <iostream>
00007 
00008 using namespace std;
00009 
00010 #ifndef __CINT__
00011 ClassImp(BesEventHeader)
00012 #endif
00013 
00014 //_____________________________________________________________
00015 // BesEventHeader
00016 // Bes event header class
00017 //
00018 // Event informations are handled in blocks with fixed order
00019 //
00020 // (0)  general block, handled by own access functions
00021 // (1)  CAL information           => GetContentCAL
00022 // (2)  FLT information           => GetContentFLT
00023 // (3a) Sinistra DA information   => GetContentSinDA
00024 // (3b) Sinistra EL information   => GetContentSinEL
00025 // (3c) Sinistra JB information   => GetContentSinDA
00026 //
00027 //
00028 
00029 BesEventHeader::BesEventHeader() : TObject()
00030 {
00031     //
00032     // BesEventHeader default constructor
00033     if ( gDebug ) cout << "BesEventHeader ctor called" << endl;
00034 
00035     fRun   = 0;             // Run number
00036     fEvent = 0;             // Event number
00037     fMC    = true;          // MC event
00038     fDay   = 20;             // Day of Event
00039     fMonth = 7;            // Month of Event
00040     fYear  = 2008;          // Year of Event
00041     fHour  = 1;             // Hour of Event
00042     fMin   = 4;             // Minute of Event
00043     fSec   = 4;             // Second of Event
00044     fP     = 0.0;           // Total momentum of all Mdc Tracks (in GeV/c)
00045     fPt    = 0.0;           // Transverse momentum
00046 }
00047 
00048 //_____________________________________________________________
00049 
00050 BesEventHeader::~BesEventHeader() {
00051     //
00052     // BesEventHeader default destructor
00053     if ( gDebug ) cout << "BesEventHeader dtor called" << endl;
00054 
00055 }
00056 
00057 //_____________________________________________________________
00058 void BesEventHeader::SetEventTrig(Int_t timeType, 
00059     vector<Int_t>& trigConditionVector, 
00060     vector<Int_t>& trigChannelVector ){
00061 
00062    fTimeType = timeType;
00063    fTrigChannelVector.clear();
00064    fTrigConditionVector.clear();
00065    fTrigChannelVector = trigChannelVector;
00066    fTrigConditionVector = trigConditionVector;
00067    //************************************
00068    cout << "BesEventHeader::time Type: " << timeType << endl;
00069    vector<Int_t>::iterator pTrigVector;
00070    for (pTrigVector = trigConditionVector.begin(); 
00071        pTrigVector != trigConditionVector.end(); 
00072        pTrigVector++){
00073      cout << "BesEventHeader::trigCondition: " << *pTrigVector << endl;
00074    }
00075    for (pTrigVector = trigChannelVector.begin(); 
00076        pTrigVector != trigChannelVector.end(); 
00077        pTrigVector++){
00078      cout << "BesEventHeader::trigChannel: " << *pTrigVector << endl;
00079    }
00080    //************************************
00081 }
00082 //________________________________________________________
00083 
00084 void BesEventHeader::SetEventHeaderGeneral(Long64_t run, Long64_t event,Int_t time1,Int_t time2) {
00085     //
00086     // Set general event header
00087     fRun = run;
00088     fEvent = event;
00089 
00090 
00091     // modify date
00092     if (time1 > 0) {
00093         int a,b;
00094         a=time1%100;
00095         fDay=a;
00096 
00097         b=(time1-a)%10000;
00098         fMonth=b/100;
00099 
00100         fYear=(time1-a-b)/10000;
00101     }
00102 
00103     //modify time
00104     if (time2 > 0) {
00105         int c,d;
00106         c=time2%100;
00107         fSec=c;
00108 
00109         d=(time2-c)%10000;
00110         fMin=d/100;
00111 
00112         fHour=(time2-c-d)/10000;
00113     }
00114 }
00115 
00116 //_____________________________________________________________
00117 
00118 void BesEventHeader::SetEventMC(Bool_t mc)
00119 {
00120     fMC = mc;
00121 }
00122 
00123 //_____________________________________________________________
00124 
00125 void BesEventHeader::SetEventEvTime(Double_t time, Int_t status, Double_t quality)
00126 {
00127     fEvTime  = time;
00128     fEvTimeStatus  = status;
00129     fEvTimeQuality = quality;
00130 }
00131 
00132 //_____________________________________________________________
00133 
00134 void BesEventHeader::SetEventMdc(Double_t p, Double_t pt, Double_t px, Double_t py, Double_t pz)
00135 {
00136     fP  = p;
00137     fPt = pt;
00138     fPx = px;
00139     fPy = py;
00140     fPz = pz;
00141 }
00142 
00143 //_____________________________________________________________
00144 
00145 void BesEventHeader::SetEventTof(Double_t t)
00146 {
00147     fT = t;
00148 }
00149 
00150 //_____________________________________________________________
00151 
00152 void BesEventHeader::SetEventEmc(Double_t e)
00153 {
00154     fE = e;
00155 }
00156 
00157 //_____________________________________________________________
00158 void BesEventHeader::PrintWord(TString & word,Int_t nbits, Int_t trigger,Int_t trigger2) const {
00159     Int_t j;
00160     if (trigger!=0){
00161         for (j=0;j<nbits;j++){
00162             if ((trigger>>j)&0x1) word+=Form(" %.2d",j+1);
00163         }
00164     }
00165     if (trigger2!=0){
00166         for (j=0;j<nbits;j++){
00167             if ((trigger2>>j)&0x1) word+=Form(" %.2d",j+17);
00168         }
00169     }
00170 }

Generated on Tue Nov 29 23:12:04 2016 for BOSS_7.0.2 by  doxygen 1.4.7