Changeset 2333


Ignore:
Timestamp:
09/12/03 16:08:56 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2332 r2333  
    77       information can be found in the comments there.
    88
    9    * mhist/MHFadcCam.cc:
     9   * mhist/MHFadcCam.[h,cc]:
    1010     - skip MC events which have no FADC information stored
    1111     - better output in case of changes in the number of slices
    12      
    13    * mhist/MHFadcPix.cc:
     12     - added size argument to constructor to support ECO100, too.
     13     - removed all fixed numbers and replaced them by the corresponding
     14       function
     15     - fixed pixel numbering to be consistent with the software pixel
     16       numbering in the rest of Mars
     17
     18   * mhist/MHFadcPix.[h,cc]:
    1419     - fixed the missing y-axis (UseCurrentStyle())
     20     - fixed pixel numbering by changing default arument of pixid in
     21       constructor from 0 to -1
    1522
    1623   * mmain/MDataCheck.cc
    1724     - added 'Time Spectra of Cosmics' button
     25     - added size argument to instatiation of MHFadcCam
     26
    1827
    1928
  • trunk/MagicSoft/Mars/mhist/MHFadcCam.cc

    r2331 r2333  
    4949//  creates an a list of histograms for all pixels and both gain channels
    5050//
    51 MHFadcCam::MHFadcCam(MHFadcPix::Type_t t, const char *name, const char *title)
     51MHFadcCam::MHFadcCam(const Int_t n, MHFadcPix::Type_t t, const char *name, const char *title)
    5252    : fNumHiGains(-1), fNumLoGains(-1), fType(t)
    5353{
    5454    //
    55     //   set the name and title of this object
     55    // set the name and title of this object
    5656    //
    5757    fName  = name  ? name  : "MHFadcCam";
     
    5959
    6060    //
    61     //   loop over all Pixels and create two histograms
    62     //   one for the Low and one for the High gain
    63     //   connect all the histogram with the container fHist
     61    // loop over all Pixels and create two histograms
     62    // one for the Low and one for the High gain
     63    // connect all the histogram with the container fHist
    6464    //
    65     fArray = new TObjArray(577);
     65    fArray = new TObjArray(n);
    6666
    67     for (Int_t i=0; i<577; i++)
    68         (*fArray)[i] = new MHFadcPix(i+1, fType);
     67    for (Int_t i=0; i<n; i++)
     68        (*fArray)[i] = new MHFadcPix(i, fType);
    6969}
    7070
     
    8282TObject *MHFadcCam::Clone(const char *) const
    8383{
    84     MHFadcCam *cam = new MHFadcCam;
     84    const Int_t n = fArray->GetSize();
    8585
    86     for (int i=0; i<577; i++)
     86    //
     87    // FIXME, this might be done faster and more elegant, by direct copy.
     88    //
     89    MHFadcCam *cam = new MHFadcCam(n);
     90
     91    for (int i=0; i<n; i++)
    8792    {
    8893        delete (*cam->fArray)[i];
     
    100105Bool_t MHFadcCam::Fill(const MRawEvtData *par)
    101106{
     107    const Int_t n = fArray->GetSize();
     108
    102109    if (fType==MHFadcPix::kSlices)
    103110    {
     
    113120
    114121        //
    115         // First call
     122        // First call with nhi!=0
    116123        //
    117124        if (fNumHiGains<0)
    118             for (int i=0; i<577; i++)
     125            for (int i=0; i<n; i++)
    119126                (*this)[i].Init(nhi, nlo);
    120127        else
     
    136143    }
    137144
    138     for (int i=0; i<577; i++)
     145    for (int i=0; i<n; i++)
    139146        if (!(*this)[i].Fill(*par))
    140147            return kFALSE;
     
    145152void MHFadcCam::ResetHistograms()
    146153{
    147     for (Int_t i=0; i<577; i++)
     154    const Int_t n = fArray->GetSize();
     155    for (Int_t i=0; i<n; i++)
    148156        ResetEntry(i);
    149157}
     
    154162    GetHistLo(i)->Reset();
    155163}
    156 
  • trunk/MagicSoft/Mars/mhist/MHFadcCam.h

    r2173 r2333  
    3333
    3434public:
    35     MHFadcCam(MHFadcPix::Type_t t=MHFadcPix::kValue, const char *name=NULL, const char *title=NULL);
     35    MHFadcCam(const Int_t n=577, MHFadcPix::Type_t t=MHFadcPix::kValue, const char *name=NULL, const char *title=NULL);
    3636    ~MHFadcCam();
    3737
  • trunk/MagicSoft/Mars/mhist/MHFadcPix.cc

    r2331 r2333  
    4848// Creates the histograms for lo and hi gain of one pixel
    4949//
    50 MHFadcPix::MHFadcPix(UInt_t pixid, Type_t t)
     50MHFadcPix::MHFadcPix(Int_t pixid, Type_t t)
    5151    : fPixId(pixid), fType(t)
    5252{
    53     fHistHi.SetName(pixid ? Form("HiGain%03d", pixid) : "HiGain");
    54     fHistHi.SetTitle(pixid ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples");
     53    fHistHi.SetName(pixid>=0 ? Form("HiGain%03d", pixid) : "HiGain");
     54    fHistHi.SetTitle(pixid>=0 ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples");
    5555    fHistHi.SetDirectory(NULL);
    5656    fHistHi.UseCurrentStyle();
    5757
    58     fHistLo.SetName(pixid ? Form("LoGain%03d", pixid) : "LoGain");
    59     fHistLo.SetTitle(pixid ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples");
     58    fHistLo.SetName(pixid>=0 ? Form("LoGain%03d", pixid) : "LoGain");
     59    fHistLo.SetTitle(pixid>=0 ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples");
    6060    fHistLo.SetDirectory(NULL);
    6161    fHistLo.UseCurrentStyle();
  • trunk/MagicSoft/Mars/mhist/MHFadcPix.h

    r1652 r2333  
    2626
    2727public:
    28     MHFadcPix(UInt_t pixid=0, Type_t t=kValue);
     28    MHFadcPix(Int_t pixid=-1, Type_t t=kValue);
    2929
    3030    TH1F *GetHistHi() { return &fHistHi; }
  • trunk/MagicSoft/Mars/mmain/MDataCheck.cc

    r2331 r2333  
    120120    read.DisableAutoScheme();
    121121
    122     MHFadcCam hist(t);
     122    MHFadcCam hist(577, t);
    123123    plist.AddToList(&hist);
    124124
Note: See TracChangeset for help on using the changeset viewer.