Changeset 14727


Ignore:
Timestamp:
12/05/12 10:02:12 (12 years ago)
Author:
Jens Buss
Message:
rearangement of code, added comments
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/marsmacros/mc2csv/MonteCarlo.C

    r14726 r14727  
    11#include "MonteCarlo.h"
    22
     3// --------------------------------------------------------------------------
     4// Default constructor. Initiates Pointers and Variables to NULL or 0
     5//
    36MonteCarlo::MonteCarlo()
    47{
     
    6871}
    6972
     73// --------------------------------------------------------------------------
     74// Destructor
     75//
    7076MonteCarlo::~MonteCarlo(void)
    7177{
     
    7985}
    8086
     87// --------------------------------------------------------------------------
     88// Initiates Pointers and Variables to NULL or 0
     89//
    8190void
    8291MonteCarlo::InitVariables()
     
    121130}
    122131
     132// ==========================================================================
     133// Setters
     134//
     135
    123136void
    124137MonteCarlo::SetVerbosityLevel(int verbLvl)
     
    128141    return;
    129142}
     143
     144// ==========================================================================
     145// Getters
     146//
    130147
    131148int
     
    134151    return mVerbosityLvl;
    135152}
     153
     154// ==========================================================================
     155// Root file handling
     156//
    136157
    137158void
     
    159180    mpRootFile->Close("R");
    160181    mpRootFile=NULL;
    161 
    162     return;
    163 }
    164 
    165 void
    166 MonteCarlo::OpenCsvFile(TString fileName)
    167 {
    168     mCsvFileName    = fileName;
    169 
    170     if (mVerbosityLvl > 0) cout << "...opening csv file: " << mCsvFileName << endl;
    171 
    172     mCsv.open( mCsvFileName );
    173 
    174     return;
    175 }
    176 
    177 void
    178 MonteCarlo::CloseCsvFile()
    179 {
    180     if (mVerbosityLvl > 0) cout << "...closing csv file: " << mCsvFileName << endl;
    181 
    182     mCsv.close();
    183182
    184183    return;
     
    563562
    564563    int pix_first_sample;
    565 //    int pix_last_sample;
    566564
    567565    // -----------------------------------------------------------------------
     
    572570    {
    573571        all_raw_data    = (unsigned short*) mpRawEventData->GetSamples();
     572//  FADC samples (hi gain) of all pixels
     573//  This is an array of Byte_t variables. The value of a FADC sample has a
     574//  size of n=fNumBytesPerSample bytes. Therefore, a FADC sample value will
     575//  occupy n consecutive elements of this array (little endian ordering, i.e,
     576//  less significant bits (and bytes) go first.
     577//  If m = GetNumHiGainSamples(), the n bytes corresponding to the value of the
     578//  i-th FADC sample of the j-th pixel are stored in the n consecutive
     579//  positions of this array, starting from fHiGainFadcSamples[j*n*m+i*n]
    574580    }
    575581    else cout << "...cannot read event raw data" << endl;
     
    608614        // of pixel's first sample's adress
    609615        mpPixel[i].rawData      = &(all_raw_data[pix_first_sample]);
     616
    610617    }
    611618
     
    630637    ReadEventMetaData();
    631638    ReadEventRawData();
     639
     640    return;
     641}
     642
     643// ==========================================================================
     644// csv file handling
     645//
     646
     647void
     648MonteCarlo::OpenCsvFile(TString fileName)
     649{
     650    mCsvFileName    = fileName;
     651
     652    if (mVerbosityLvl > 0) cout << "...opening csv file: " << mCsvFileName << endl;
     653
     654    mCsv.open( mCsvFileName );
     655
     656    return;
     657}
     658
     659void
     660MonteCarlo::CloseCsvFile()
     661{
     662    if (mVerbosityLvl > 0) cout << "...closing csv file: " << mCsvFileName << endl;
     663
     664    mCsv.close();
    632665
    633666    return;
     
    903936
    904937
    905 //--------------------------------------------------------------------------------
    906 //
    907 //
    908 //
    909 //  FADC samples (hi gain) of all pixels
    910 //  This is an array of Byte_t variables. The value of a FADC sample has a
    911 //  size of n=fNumBytesPerSample bytes. Therefore, a FADC sample value will
    912 //  occupy n consecutive elements of this array (little endian ordering, i.e,
    913 //  less significant bits (and bytes) go first.
    914 //  If m = GetNumHiGainSamples(), the n bytes corresponding to the value of the
    915 //  i-th FADC sample of the j-th pixel are stored in the n consecutive
    916 //  positions of this array, starting from fHiGainFadcSamples[j*n*m+i*n]
    917 
    918 
    919 
    920 
     938
     939
     940
     941
     942
     943
Note: See TracChangeset for help on using the changeset viewer.