Go to the documentation of this file.00001 #include "ScDigi.h"
00002
00003 #include "nxyter/Data.h"
00004
00005
00006 #include <iostream>
00007
00008 using namespace std;
00009
00010
00011 ScDigi::ScDigi() {
00012 fRoc = fNx = fTime = fChannel = fAdc = 0;
00013 fPileup = fOverflow = kFALSE;
00014 }
00015
00016
00017
00018 ScDigi::ScDigi(nxyter::Data* data, Long64_t hitTime) {
00019
00020
00021 if ( data->isHitMsg() ) {
00022 fRoc = Int_t(data->rocNumber());
00023 fNx = Int_t(data->getNxNumber());
00024 fChannel = Int_t(data->getChNum());
00025 fAdc = Int_t(data->getAdcValue());
00026 fPileup = Bool_t(data->getPileUp());
00027 fOverflow = Bool_t(data->getOverFlow());
00028 fTime = hitTime;
00029 }
00030
00031
00032 else if ( data->isAuxMsg() ) {
00033 fRoc = Int_t(data->rocNumber());
00034 fNx = -1;
00035 fChannel = Int_t(data->getAuxChNum());
00036 fAdc = -1;
00037 fPileup = data->getAuxFalling();
00038 fOverflow = kFALSE;
00039 fTime = hitTime;
00040 }
00041
00042
00043 else {
00044 cout << "--E-- !! Trying to instantiate ScDigi from non-hit message!" << endl;
00045 fRoc = -1;
00046 fNx = -1;
00047 fChannel = -1;
00048 fAdc = -1;
00049 fPileup = kFALSE;
00050 fOverflow = kFALSE;
00051 fTime = -1;
00052 }
00053
00054 }
00055
00056
00057
00058
00059 ScDigi::ScDigi(Int_t iRoc, Int_t iNx, Long64_t time, Int_t iChannel,
00060 Int_t adc, Bool_t isPileup, Bool_t isOverflow) {
00061 fRoc = iRoc;
00062 fNx = iNx;
00063 fTime = time;
00064 fChannel = iChannel;
00065 fAdc = adc;
00066 fPileup = isPileup;
00067 fOverflow = isOverflow;
00068 }
00069
00070
00071 void ScDigi::Print(Option_t* opt) const {
00072 cout << "ROC " << fRoc << ", NX " << fNx << ", Channel " << fChannel
00073 << ", Time " << fTime << ", ADC " << fAdc << endl;
00074 }
00075
00076
00077
00078 ClassImp(ScDigi)