00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #include "TClonesArray.h"
00021
00022 #include "DaqSnarlEvent.h"
00023 #include "RSM.h"
00024
00025 #include "MessageService/MsgService.h"
00026
00027 CVSID("$Id: DaqSnarlEvent.cxx,v 1.5 2005/02/22 21:47:38 bspeak Exp $");
00028
00029 ClassImp(DSChipEvent)
00030 DSChipEvent::DSChipEvent() {
00031 RSMVer << "DSChipEvent::DSChipEvent()" << endl;
00032 this->Reset();
00033 }
00034
00035 void DSChipEvent::LocalReset() {
00036 RSMVer << "DSChipEvent::LocalReset()" << endl;
00037 ADC=0;
00038 IsPulsed=false;
00039 IsShield=false;
00040 }
00041
00042 ClassImp(DaqSnarlEvent)
00043 DaqSnarlEvent::DaqSnarlEvent() {
00044 RSMVer << "DaqSnarlEvent::DaqSnarlEvent()" << endl;
00045 ChipEvents = new TClonesArray("DSChipEvent",2304);
00046 this->Reset();
00047 }
00048
00049 void DaqSnarlEvent::LocalReset() {
00050 RSMVer << "DaqSnarlEvent::LocalReset()" << endl;
00051 for(int i=0; i<NCRATE; i++) CrateADC[i]=0;
00052 for(int i=0; i<NMF; i++) MFADC[i]=0;
00053 PreTrigADC=0;
00054 PostTrigADC=0;
00055 TotalADC=0;
00056
00057 for(int i=0;i<2;i++) SMPlanesHit[i]=0;
00058
00059
00060 SMHitBlock=0;
00061 Hits=0;
00062 }
00063
00064 DSChipEvent* DaqSnarlEvent::ChipGen(Char_t Crate,
00065 Char_t Varc,
00066 Char_t Vmm,
00067 Char_t Vadc,
00068 Char_t Vachip) {
00069 RSMVer << "DaqSnarlEvent::ChipGen()" << endl;
00070 int ichip = this->IChip(Crate,Varc,Vmm,Vadc,Vachip);
00071
00072 DSChipEvent* chip = 0;
00073 if((chip=dynamic_cast<DSChipEvent*>(ChipEvents->At(ichip))))
00074 return chip;
00075
00076 chip = new((*ChipEvents)[ichip]) DSChipEvent();
00077 chip->PackLoc(Crate,Varc,Vmm,Vadc,Vachip);
00078 return chip;
00079 }