BlockEvent Class Reference

#include <BlockEvent.h>

Inheritance diagram for BlockEvent:
CrateMonitorEvent DaqSnarlEvent TPSinglesEvent

List of all members.

Public Member Functions

 BlockEvent ()
 ~BlockEvent ()
void Reset ()
virtual void LocalReset ()
ChipEventChipGen (Char_t Crate, Char_t Varc, Char_t Vmm, Char_t Vadc, Char_t Vachip=-1, Char_t Vachan=-1)
int IChip (Char_t Crate, Char_t Varc, Char_t Vmm, Char_t Vadc, Char_t Vachip=-1, Char_t Vachan=-1)
bool IsFilled ()
void GenerateAllChips ()
void CheckChips ()
 ClassDef (BlockEvent, 1)

Public Attributes

UInt_t RunNum
UChar_t SubRunNum
UInt_t Time
TClonesArray * ChipEvents

Detailed Description

Definition at line 15 of file BlockEvent.h.


Constructor & Destructor Documentation

BlockEvent::BlockEvent (  ) 

Definition at line 25 of file BlockEvent.cxx.

References RSMVer.

00025                        {
00026   RSMVer << "BlockEvent::BlockEvent" << endl;
00027   ChipEvents = new TClonesArray("ChipEvent",2304);
00028   this->Reset();
00029 }

BlockEvent::~BlockEvent (  ) 

Definition at line 31 of file BlockEvent.cxx.

References ChipEvents, Reset(), and RSMVer.

00031                         {
00032   RSMVer << "BlockEvent::~BlockEvent" << endl;
00033   this->Reset();
00034   delete ChipEvents;
00035 }


Member Function Documentation

void BlockEvent::CheckChips (  ) 

Definition at line 100 of file BlockEvent.cxx.

References ChipEvents.

Referenced by RateSummary::Ana().

00100                             {
00101   bool fix_this = false;
00102   for(int i=0;i<ChipEvents->GetLast();i++)
00103   if(! ChipEvents->At(i)) fix_this = true;
00104 
00105   if(fix_this) ChipEvents->Compress();
00106 
00107   fix_this=false;
00108   for(int i=0;i<ChipEvents->GetLast();i++)
00109   if(! ChipEvents->At(i)) fix_this = true;
00110 
00111   if(fix_this) cout << "Compressing ChipEvents Failed" << endl;
00112 }

ChipEvent * BlockEvent::ChipGen ( Char_t  Crate,
Char_t  Varc,
Char_t  Vmm,
Char_t  Vadc,
Char_t  Vachip = -1,
Char_t  Vachan = -1 
)

Definition at line 51 of file BlockEvent.cxx.

References ChipEvents, IChip(), and ChipEvent::PackLoc().

Referenced by GenerateAllChips().

00056                                               {
00057   int ichip = IChip(Crate,Varc,Vmm,Vadc,Vachip,Vachan);
00058 
00059   ChipEvent* chip = 0;
00060   if((chip=dynamic_cast<ChipEvent*>(ChipEvents->At(ichip))))
00061     return chip;
00062 
00063   chip = new((*ChipEvents)[ichip]) ChipEvent();
00064   chip->PackLoc(Crate,Varc,Vmm,Vadc,Vachip,Vachan);
00065   return chip;
00066 }

BlockEvent::ClassDef ( BlockEvent  ,
 
)

Reimplemented in CrateMonitorEvent.

void BlockEvent::GenerateAllChips (  ) 

Definition at line 90 of file BlockEvent.cxx.

References ChipGen(), NCRATE, NVACHIP, NVADC, NVARC, NVMM, and RSMWar.

00090                                   {
00091   for(int icrate=0;icrate<NCRATE;icrate++)
00092   for(int ivarc=0;ivarc<NVARC;ivarc++)
00093   for(int ivmm=0;ivmm<NVMM;ivmm++)
00094   for(int ivadc=0;ivadc<NVADC;ivadc++)
00095   for(int ivachip=0;ivachip<NVACHIP;ivachip++)
00096   if(! this->ChipGen(icrate,ivarc,ivmm,ivadc,ivachip))
00097     RSMWar << "ChipGen Failed" << endl;
00098 }

int BlockEvent::IChip ( Char_t  Crate,
Char_t  Varc,
Char_t  Vmm,
Char_t  Vadc,
Char_t  Vachip = -1,
Char_t  Vachan = -1 
)

Definition at line 68 of file BlockEvent.cxx.

References NVACHAN, NVACHIP, NVADC, NVARC, and NVMM.

Referenced by DaqSnarlEvent::ChipGen(), ChipGen(), TPSinglesEvent::ChipGen(), and CrateMonitorEvent::ChipGen().

00073                                      {
00074   int ichip = Crate;
00075   ichip = Varc + NVARC*ichip;
00076   ichip = Vmm + NVMM*ichip;
00077   ichip = Vadc + NVADC*ichip;
00078   if(Vachip>=0) ichip = Vachip + NVACHIP*ichip;
00079   if(Vachan>=0) ichip = Vachan + NVACHAN*ichip;
00080   return ichip;
00081 }

bool BlockEvent::IsFilled (  ) 

Definition at line 83 of file BlockEvent.cxx.

References RunNum, and Time.

Referenced by RateSummary::Ana().

00083                           {
00084   bool retval;
00085   retval = ((RunNum!=0)&&(Time!=0));
00086 
00087   return retval;
00088 }

virtual void BlockEvent::LocalReset (  )  [inline, virtual]

Reimplemented in CrateMonitorEvent, DaqSnarlEvent, and TPSinglesEvent.

Definition at line 20 of file BlockEvent.h.

Referenced by Reset().

00020 {return;}

void BlockEvent::Reset ( void   ) 

Definition at line 37 of file BlockEvent.cxx.

References ChipEvents, LocalReset(), RunNum, SubRunNum, and Time.

Referenced by RateSummary::Ana(), RateSummary::CloseFile(), and ~BlockEvent().

00037                        {
00038   RunNum = 0;
00039   SubRunNum = 0;
00040 
00041   Time = 0;
00042 
00043   for(int i=0; i<=ChipEvents->GetLast(); i++)
00044     if(ChipEvents->At(i))
00045       ChipEvents->At(i)->Clear();
00046   ChipEvents->Delete();
00047 
00048   this->LocalReset();
00049 }


Member Data Documentation

TClonesArray* BlockEvent::ChipEvents

Definition at line 40 of file BlockEvent.h.

Referenced by RateSummary::Ana(), IsFilled(), and Reset().

Definition at line 41 of file BlockEvent.h.

Referenced by RateSummary::Ana(), and Reset().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1