Changeset 2946 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
01/28/04 16:55:40 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2945 r2946  
    1010
    1111
     12
    1213 2004/01/28: Markus Gaug
    1314
    14    * mcalib/MCalibrationCalc.[h,cc]
    15    * mcalib/MCalibrationCam.[h,cc]
     15   * mcalib/MCalibrationCalc.[h,cc], mcalib/MCalibrationCam.[h,cc]:
    1616     - included flags to indicate if Blind Pixel Method or PIn Diode
    1717       method was OK. Up to now, program stopped, if one of the two
    1818       methods was chosen but not able to being executed.
    1919
    20    * manalysis/MArrivalTimeCalc.cc
    21    * manalysis/MExtractSignals.cc
    22    * manalysis/MGeomApply.cc
     20   * manalysis/MArrivalTimeCalc.cc, manalysis/MExtractSignals.cc,
     21     manalysis/MGeomApply.cc:
    2322     - put all missing InitSize(npixels) into MGeomApply         
    2423
    2524
     25
    2626 2004/01/28: Abelardo Moralejo
    27 
    2827
    2928   * mcalib/MMcCalibration.cc
     
    4847       a workaround for a 'bug' in very old camera files, which is not
    4948       necessary anymore.
     49
     50   * manalysis/MCerPhotAnal2.[h,cc]:
     51     - replaced MPedestalCam by MPedPhotCam
     52     
     53   * manalysis/MExtractSignal.cc:
     54     - some small simplification to the signal extraction
     55     - removed some obsolete variables
     56     - replaced for by while
     57     - removed obsolete casts
     58     
     59   * mmain/MEventDisplay.cc:
     60     - gave names to the filters
     61     - removed adding MHCamera to fList because it was deleted twice
    5062
    5163
  • trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.cc

    r2386 r2946  
    3131//
    3232//  Input Containers:
    33 //   MRawEvtData, MPedestalCam
     33//   MRawEvtData, MPedPhotCam
    3434//
    3535//  Output Containers:
     
    4848#include "MRawEvtData.h"       // MRawEvtData::GetNumPixels
    4949#include "MCerPhotEvt.h"
    50 #include "MPedestalPix.h"
    51 #include "MPedestalCam.h"
     50#include "MPedPhotPix.h"
     51#include "MPedPhotCam.h"
    5252#include "MRawEvtPixelIter.h"
    5353
     
    7878//  - MRawRunHeader
    7979//  - MRawEvtData
    80 //  - MPedestalCam
     80//  - MPedPhotCam
    8181//
    8282// The following output containers are also searched and created if
     
    116116        }
    117117
    118     fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     118    fPedestals = (MPedPhotCam*)pList->FindCreateObj("MPedPhotCam");
    119119    if (runheader && !fPedestals)
    120120        return kFALSE;
  • trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.h

    r2265 r2946  
    1616
    1717class MRawEvtData;
    18 class MPedestalCam;
     18class MPedPhotCam;
    1919class MCerPhotEvt;
    2020class MRawRunHeader;
     
    2323{
    2424private:
    25     MPedestalCam  *fPedestals;  // Pedestals of all pixels in the camera
     25    MPedPhotCam   *fPedestals;  // Pedestals of all pixels in the camera
    2626    MRawEvtData   *fRawEvt;     // raw event data (time slices)
    2727    MCerPhotEvt   *fCerPhotEvt; // Cerenkov Photon Event used for calculation
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc

    r2944 r2946  
    102102    if (!fRawEvt)
    103103    {
    104       *fLog << err << AddSerialNumber("MRawEvtData") << " not found... aborting." << endl;
     104        *fLog << err << AddSerialNumber("MRawEvtData") << " not found... aborting." << endl;
    105105        return kFALSE;
    106106    }
     
    116116    fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
    117117    if (!fPedestals)
    118       {
     118    {
    119119        *fLog << err << AddSerialNumber("MPedestalCam") << " not found... aborting" << endl;
    120120        return kFALSE;
    121 
    122       }
     121    }
    123122
    124123    fArrivalTime = (MArrivalTime*)pList->FindCreateObj(AddSerialNumber("MArrivalTime"));
     124    if (!fArrivalTime)
     125        return kFALSE;
    125126   
    126127    return kTRUE;
     
    135136Bool_t MExtractSignal::ReInit(MParList *pList )
    136137{
    137 
    138138    MGeomCam *cam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    139139    if (!cam)
     
    143143    }
    144144
    145   return kTRUE;
    146 }
    147 
     145    return kTRUE;
     146}
    148147
    149148// --------------------------------------------------------------------------
     
    154153Int_t MExtractSignal::Process()
    155154{
    156 
    157155    MRawEvtPixelIter pixel(fRawEvt);
    158156    fSignals->Clear();
     
    165163        UShort_t satLo = 0;
    166164
    167         Byte_t *ptr   = pixel.GetHiGainSamples();
    168         Byte_t *first = ptr + fHiGainFirst;
    169         Byte_t *last  = ptr + fHiGainFirst + fNumHiGainSamples;
    170 
    171         UInt_t  sumHi   = 0;
    172         UInt_t  sumLo   = 0;
     165        UInt_t sumHi   = 0;
     166        UInt_t sumLo   = 0;
     167
     168        Byte_t maxhi   = 0;
     169        Byte_t midhi   = 0;
     170
     171        Byte_t *ptr  = pixel.GetHiGainSamples() + fHiGainFirst;
     172        Byte_t *last = ptr + fNumHiGainSamples;
     173
     174        while (ptr<last)
     175        {
     176            sumHi += *ptr;
     177
     178            if (*ptr > maxhi)
     179            {
     180                maxhi = *ptr;
     181                midhi = ptr-pixel.GetHiGainSamples();
     182            }
     183
     184            if (*ptr >= fSaturationLimit)
     185                satHi++;
     186
     187            ptr++;
     188        }
     189
     190        ptr  = pixel.GetLoGainSamples() + fLoGainFirst;
     191        last = ptr + fNumLoGainSamples;
     192
     193        Byte_t maxlo  = 0;
     194        Byte_t midlo  = 0;
     195
     196        while (ptr<last)
     197        {
     198            sumLo += *ptr;
     199
     200            if (*ptr > maxlo)
     201            {
     202                maxlo = *ptr;
     203                midlo = ptr-pixel.GetLoGainSamples();
     204            }
     205
     206            if (*ptr >= fSaturationLimit)
     207                satLo++;
     208
     209            ptr++;
     210        }
     211
     212        if (satLo)
     213            satlo++;
    173214
    174215        const Int_t pixid = pixel.GetPixelId();
     216
    175217        const MPedestalPix  &ped = (*fPedestals)[pixid];
    176218        MExtractedSignalPix &pix = (*fSignals)[pixid];
    177219
    178         const Float_t pedes   = ped.GetPedestal();
    179         const Float_t pedrms  = ped.GetPedestalRms();
    180 
    181         Byte_t maxhi  = 0;
    182         Byte_t midhi  = 0;
    183 
    184         for (ptr=first;ptr<last;ptr++)
    185           {
    186            
    187             if (*ptr > maxhi)
    188               {
    189                 maxhi = *ptr;
    190                 midhi = ptr-first;
    191               }
    192 
    193             sumHi += *ptr;
    194            
    195             if (*ptr >= fSaturationLimit)
    196               satHi++;
    197 
    198           }
    199 
    200         ptr   = pixel.GetLoGainSamples();
    201         first = ptr + fLoGainFirst;
    202         last  = ptr + fLoGainFirst + fNumLoGainSamples;
    203         Byte_t maxlo  = 0;
    204         Byte_t midlo  = 0;
    205 
    206         for (ptr=first;ptr<last;ptr++)
    207           {
    208 
    209             if (*ptr > maxlo)
    210               {
    211                 maxlo = *ptr;
    212                 midlo = ptr-first;
    213               }
    214 
    215             sumLo += *ptr;
    216 
    217             if (*ptr >= fSaturationLimit)
    218                 satLo++;
    219           }
    220 
    221         if (satLo)
    222             satlo++;
    223 
    224         pix.SetExtractedSignal((Float_t)sumHi - pedes*(Float_t)fNumHiGainSamples,
    225                                pedrms*fSqrtHiGainSamples,
    226                                (Float_t)sumLo - pedes*(Float_t)fNumLoGainSamples,
    227                                pedrms*fSqrtLoGainSamples);
     220        const Float_t pedes  = ped.GetPedestal();
     221        const Float_t pedrms = ped.GetPedestalRms();
     222
     223        pix.SetExtractedSignal(sumHi - pedes*fNumHiGainSamples, pedrms*fSqrtHiGainSamples,
     224                               sumLo - pedes*fNumLoGainSamples, pedrms*fSqrtLoGainSamples);
    228225
    229226        pix.SetGainSaturation(satHi, satHi, satLo);
    230227
    231         if (satHi)
    232           fArrivalTime->SetTime(pixid,(Float_t)(midlo+fLoGainFirst));
    233         else
    234           fArrivalTime->SetTime(pixid,(Float_t)(midhi+fHiGainFirst));
    235 
    236 
     228        fArrivalTime->SetTime(pixid, satHi?midlo:midhi);
    237229
    238230      } /* while (pixel.Next()) */
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.cc

    r2781 r2946  
    204204    MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5);
    205205    MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5);
     206    f1->SetName("MFMonteCarlo");
     207    f2->SetName("MFRealData");
    206208
    207209    ncalc->SetFilter(f1);
     
    210212    tlist->AddToList(f1);
    211213    tlist->AddToList(f2);
     214    tlist->AddToList(ncalc);
    212215    tlist->AddToList(pcopy);
    213216    tlist->AddToList(pdnsb);
    214     tlist->AddToList(ncalc);
    215217    tlist->AddToList(nanal);
    216218    tlist->AddToList(fill1);
     
    228230    tlist->AddToList(fill8);
    229231
    230 
    231232    //
    232233    // Now distribute Display to all tasks
     
    495496    cam->SetBit(TH1::kNoStats|MHCamera::kNoLegend|kCanDelete);
    496497    cam->Draw("pixelindex");
    497     fList->Add(cam);
    498498
    499499    c1.Modified();
     
    505505    cam->SetBit(TH1::kNoStats|MHCamera::kNoLegend|kCanDelete);
    506506    cam->Draw("sectorindex");
    507     fList->Add(cam);
    508507
    509508    c2.Modified();
Note: See TracChangeset for help on using the changeset viewer.