Changeset 761


Ignore:
Timestamp:
04/23/01 14:37:08 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mraw
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r749 r761  
    6565ClassImp(MRawEvtData)
    6666
     67// --------------------------------------------------------------------------
     68//
     69// Default constructor. It initializes all arrays with zero size.
     70//
    6771MRawEvtData::MRawEvtData(const char *name, const char *title)
    6872{
     
    7377}
    7478
     79// --------------------------------------------------------------------------
     80//
     81// Destructor. Deletes all the arrays.
     82//
    7583MRawEvtData::~MRawEvtData()
    7684{
     
    7886}
    7987
     88// --------------------------------------------------------------------------
     89//
     90// reset all arrays
     91//
    8092void MRawEvtData::Clear(Option_t *)
    8193{
    82     //
    83     // reset all arrays
    84     //
    85 
    8694    /*
    8795     FIXME:
     
    95103}
    96104
     105// --------------------------------------------------------------------------
     106//
     107// return the number of hi gain samples per pixel
     108//
    97109Byte_t MRawEvtData::GetNumHiGainSamples() const
    98110{
     
    100112}
    101113
     114// --------------------------------------------------------------------------
     115//
     116// return the number of lo gain samples per pixel
     117//
    102118Byte_t MRawEvtData::GetNumLoGainSamples() const
    103119{
     
    105121}
    106122
     123// --------------------------------------------------------------------------
     124//
     125// return the number of stored pixel
     126//
    107127UShort_t MRawEvtData::GetNumPixels() const
    108128{
     
    111131
    112132
     133// --------------------------------------------------------------------------
     134//
     135//  Print out the onformation to *fLog.
     136//  Options:
     137//     "hex"      Prints the time slices hexadecimal (default)
     138//     "dec"      Prints the time slices decimal
     139//
    113140void MRawEvtData::Print(Option_t *opt)
    114141{
     
    171198}
    172199
     200// --------------------------------------------------------------------------
     201//
     202// Draw a pixel. A Histogram or Graph is created and it's draw function is
     203// called.
     204//  Options:
     205//     "GRAPH"      A graph is drawn
     206//     "HIST"       A histogram is drawn
     207//     number       The pixel with the given number is drawn
     208//
    173209void MRawEvtData::Draw(Option_t *opt)
    174210{
     
    176212
    177213    //
    178     // FIXME: BIG MEMORY LEAK!
     214    // FIXME: BIG MEMORY LEAK! (( How and when are the objects deleted?)
    179215    //
    180216
     
    244280}
    245281
     282// --------------------------------------------------------------------------
     283//
     284// Deletes all arrays describing the pixel Id and Samples in pixels.
     285// The flag is for future usage.
     286//
    246287void MRawEvtData::DeletePixels(Bool_t flag)
    247288{
    248     //
    249     // Deletes all arrays describing the pixel Id and Samples in pixels
    250     //
    251289    DeleteArrays();
    252290    InitArrays(flag);
    253291}
    254292
     293// --------------------------------------------------------------------------
     294//
     295//  Deletes all the arrays
     296//
    255297void MRawEvtData::DeleteArrays()
    256298{
     
    261303}
    262304
     305// --------------------------------------------------------------------------
     306//
     307//  Deletes all the arrays
     308//  The flag is for future usage.
     309//
    263310void MRawEvtData::InitArrays(Bool_t flag)
    264311{
     
    271318}
    272319
     320// --------------------------------------------------------------------------
     321//
     322//  This is to fill the data of one pixel to the MRawEvtHeader Class.
     323//  The parameters are the pixelnumber and the FADC_SLICES values of ADCs
     324//  Add to lo gains if lflag = 1
     325//
    273326void MRawEvtData::AddPixel(UShort_t nOfPixel, TArrayC *data, Bool_t lflag)
    274327{
    275     //
    276     //  This is to fill the data of one pixel to the MRawEvtHeader Class.
    277     //  The parameters are the pixelnumber and the FADC_SLICES values of ADCs
    278     //  Add to lo gains if lflag = 1
    279     //
    280328    MArrayS *arrpix = lflag ? fLoGainPixId       : fHiGainPixId;
    281329    MArrayB *arrsam = lflag ? fLoGainFadcSamples : fHiGainFadcSamples;
     
    315363}
    316364
     365// --------------------------------------------------------------------------
     366//
     367// Fills members with information from a magic binary file.
     368//   WARNING: you have to use Init() before you can do this
     369//
    317370void MRawEvtData::ReadEvt(istream &fin)
    318371{
    319     //
    320     // Fills members with information from a magic binary file.
    321     //   WARNING: you have to use Init() before you can do this
    322     //
    323372    const UShort_t nlo = fRunHeader->GetNumSamplesLoGain();
    324373    const UShort_t nhi = fRunHeader->GetNumSamplesHiGain();
  • trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc

    r749 r761  
    105105ClassImp(MRawEvtHeader)
    106106
    107 MRawEvtHeader::MRawEvtHeader(const char *name, const char *title)
     107// --------------------------------------------------------------------------
     108//
     109// Default constructor. Create the array to store the data.
     110//
     111MRawEvtHeader::MRawEvtHeader(const char *name, const char *title)
    108112{
    109113    *fName  = name  ? name  : "MRawEvtHeader";
     
    120124
    121125
     126// --------------------------------------------------------------------------
     127//
     128// Destructor. Deletes the array to store pixlogainon
     129//
    122130MRawEvtHeader::~MRawEvtHeader()
    123131{
    124 }
    125 
     132    delete fPixLoGainOn;
     133}
     134
     135// --------------------------------------------------------------------------
     136//
     137// you have to init the conatainer before you can read from
     138// a raw binary file
     139//
    126140void MRawEvtHeader::Init(MRawRunHeader *rh, MTime *t)
    127141{
    128     //
    129     // you have to init the conatainer before you can read from
    130     // a raw binary file
    131     //
    132 
    133142    //
    134143    // this is the number of entries in the array like specification
     
    148157}
    149158
     159// --------------------------------------------------------------------------
     160//
     161//   Implementation of the Clear function
     162//
     163//   Resets all members to zero, clear the list of Pixels
     164//
    150165void MRawEvtHeader::Clear(Option_t *)
    151166{
    152     //
    153     //   Implementation of the Clear function
    154     //
    155     //   Resets all members to zero, clear the list of Pixels
    156     //
    157167    fDAQEvtNumber   = 0;
    158168    fNumTrigLvl1    = 0;
     
    164174}
    165175
     176// --------------------------------------------------------------------------
     177//
     178//  This member function prints all Data of one Event to *fLog.
     179//
    166180void MRawEvtHeader::Print(Option_t *o)
    167181{
    168     //
    169     //  This member function prints all Data of one Event on screen.
    170     //
    171182    *fLog << "DAQEvtNr: " << dec << fDAQEvtNumber << "  (";
    172183    *fLog << "Trigger: ";
     
    208219}
    209220
     221// --------------------------------------------------------------------------
     222//
     223// used to set the header information (eg. from MC)
     224//
    210225void MRawEvtHeader::FillHeader(UInt_t uiN, Float_t ulTP)
    211226{
    212     //
    213     // used to set the header information (eg. from MC)
    214     //
    215227    fDAQEvtNumber = uiN;
    216228    fTrigPattern[0] = (UInt_t) (ulTP/4294967296.0) ;
     
    218230}
    219231
     232// --------------------------------------------------------------------------
     233//
     234// read the EVENT HEADER information from the input stream
     235// return FALSE if there is now header anymore, else TRUE
     236//
    220237int MRawEvtHeader::ReadEvt(istream &fin)
    221238{
    222     //
    223     // read the EVENT HEADER information from the input stream
    224     // return FALSE if there is now header anymore, else TRUE
    225     //
    226239    fin.read((Byte_t*)&fDAQEvtNumber, 4);
    227240
  • trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc

    r749 r761  
    5656ClassImp(MRawEvtPixelIter)
    5757
     58// --------------------------------------------------------------------------
     59//
     60// Return the number of stored pixels
     61//
    5862Byte_t MRawEvtPixelIter::GetNumPixels() const
    5963{
     
    6165}
    6266
     67// --------------------------------------------------------------------------
     68//
     69// It steps to the next pixel. If there is no next pixel NULL is returned.
     70// If a next pixel where found, a pointer to the primary given (constructor)
     71// data structur is returned.
     72//
    6373MRawEvtData *MRawEvtPixelIter::Next()
    6474{
     
    98108}
    99109
     110// --------------------------------------------------------------------------
     111//
     112// Reset the iteration. Jump to the first pixel.
     113//
    100114void MRawEvtPixelIter::Reset()
    101115{
     
    115129}
    116130
     131// --------------------------------------------------------------------------
     132//
     133// Calls the draw-function of the actual pixel (see MRawEvtData::Draw)
     134//
    117135void MRawEvtPixelIter::Draw(Option_t *t)
    118136{
    119   //
    120   // Draw the actual pixel (for options see: MRawEvtData::Draw)
    121   //
    122137  char *txt = new char[6+strlen(t)];
    123138  sprintf(txt, "%s%d", t, *fHiGainId);
     
    126141}
    127142
     143// --------------------------------------------------------------------------
     144//
     145// returns the sum of all hi gain fadc samples of the actual pixel
     146//
    128147ULong_t MRawEvtPixelIter::GetSumHiGainFadcSamples() const
    129148{
     
    142161}
    143162
     163// --------------------------------------------------------------------------
     164//
     165// returns the sum of all lo gain fadc samples of the actual pixel.
     166// if no lo gain information is available 0 is returned.
     167//
    144168ULong_t MRawEvtPixelIter::GetSumLoGainFadcSamples() const
    145169{
Note: See TracChangeset for help on using the changeset viewer.