Changeset 2251 for trunk/MagicSoft


Ignore:
Timestamp:
06/30/03 10:55:30 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2250 r2251  
    11                                                 -*-*- END OF LINE -*-*-
    22
     3 2003/06/30: Thomas Bretz
     4 
     5   * macros/pixfirerate.C:
     6     - changed to new style
     7     
     8   * manalysis/MCerPhotCalc.cc:
     9     - scale weight so that sum=1
     10     
     11   * mhist/MHCamera.h:
     12     - small change
     13
     14
     15
    316 2003/06/27: Abelardo Moralejo
    417
    5    * mmontecarlo/MMcCollectionAreaCalc.[h,cc]:
    6    * mhistmc/MHMcCollectionAreaCalc.[h,cc]:
    7 
     18   * mmontecarlo/MMcCollectionAreaCalc.[h,cc],
     19     mhistmc/MHMcCollectionAreaCalc.[h,cc]:
    820     - Adapted to allow their use with multiple files containing
    921       MC data generated with diffferent energy spectra, even with
     
    1325       is done by CalcEfficiency2(). Some simplifications and cleaning
    1426       are still possible.
     27
     28
    1529
    1630 2003/06/27: Thomas Bretz
  • trunk/MagicSoft/Mars/macros/pixfirerate.C

    r2162 r2251  
    3636/////////////////////////////////////////////////////////////////////////////
    3737
    38 void pixfirerate(TString filename="20030603_01731_D_cosmics_E.root")
     38void pixfirerate(TString filename="rawfile.root")
    3939{
    4040    //
     
    5757    // The tasklist is identified in the eventloop by its name
    5858    //
     59    MTaskList tlist;
    5960    MParList  plist;
    60     MTaskList tlist;
    6161    plist.AddToList(&tlist);
    6262
     
    7373    MReadMarsFile read("Events");
    7474    read.DisableAutoScheme();
     75    read.AddFile(filename);
     76    tlist.AddToList(&read);
    7577
    76     MHTrigLvl0 trigmap1(10.,"Above 10");
    77     MHTrigLvl0 trigmap2(20.,"Above 20");
    78     MHTrigLvl0 trigmap3(50.,"Above 50");
    79     MHTrigLvl0 trigmap4(100.,"Above 100");
    80     MHTrigLvl0 trigmap5(200.,"Above 200");
     78    Double_t threshold[] = { 10, 20, 100, 200, -1 };
    8179
    82     plist.AddToList(&trigmap1);
    83     plist.AddToList(&trigmap2);
    84     plist.AddToList(&trigmap3);
    85     plist.AddToList(&trigmap4);
    86     plist.AddToList(&trigmap5);
     80    Int_t cnt = 0;
     81    while (threshold[cnt]>0) cnt++;
    8782
    88     MFillH fill1("Above 10","MRawEvtData");
    89     MFillH fill2("Above 20","MRawEvtData");
    90     MFillH fill3("Above 50","MRawEvtData");
    91     MFillH fill4("Above 100","MRawEvtData");
    92     MFillH fill5("Above 200","MRawEvtData");
     83    for (int i=0; i<cnt; i++)
     84    {
     85        TString name = "Above ";
     86        TString num;
     87        num += threshold[i];
     88        name += num.Strip(TString::kBoth);
     89        TString title = "Firerate [%] of pixels with signal > ";
     90        title += num.Strip(TString::kBoth);
    9391
    94     read.AddFile(filename);
    95 
    96     tlist.AddToList(&read);
    97     tlist.AddToList(&fill1);
    98     tlist.AddToList(&fill2);
    99     tlist.AddToList(&fill3);
    100     tlist.AddToList(&fill4);
    101     tlist.AddToList(&fill5);
     92        MHTriggerLvl0 *trigmap = new MHTriggerLvl0(threshold[i], name, title);
     93        MFillH *fillh = new MFillH(trigmap, "MRawEvtData");
     94        trigmap->SetBit(kCanDelete);
     95        fillh->SetBit(kCanDelete);
     96        plist.AddToList(trigmap);
     97        tlist.AddToList(fillh);
     98    }
    10299
    103100    MEvtLoop evtloop;
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r2237 r2251  
    117117
    118118    // Calculate quadratic sum of weights:
    119     fSumWeights = 0;
     119    Doubla_t sum = 0;
     120
    120121    fSumQuadWeights = 0;
    121122    for (Int_t i=0; i<fWeight.GetSize(); i++)
    122     {
    123         fSumWeights += fWeight[i];
     123        sum += fWeight[i];
     124
     125    for (Int_t i=0; i<fWeight.GetSize(); i++)
     126    {
     127        fWeight[i] /= sum;
    124128        fSumQuadWeights += fWeight[i]*fWeight[i];
    125129    }
    126 
    127     fSumQuadWeights = sqrt(fSumQuadWeights);
    128130
    129131    return kTRUE;
     
    180182
    181183        const Double_t offset = fEnableFix ? ped.GetPedestal()-0.5 : ped.GetPedestal();
    182         ped.Set(offset*fSumWeights, ped.GetPedestalRms()*fSumQuadWeights);
     184        ped.Set(offset, ped.GetPedestalRms()*sqrt(fSumQuadWeights));
    183185    }
    184186
     
    195197    //fCerPhotEvt->InitSize(fRawEvt->GetNumPixels());
    196198
    197     if (fIsMcFile)
    198         ScalePedestals();
     199//    if (fIsMcFile)
     200//        ScalePedestals();
    199201
    200202    MRawEvtPixelIter pixel(fRawEvt);
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h

    r2237 r2251  
    3434
    3535    TArrayF         fWeight;  // Weights for adding up the ADC slices
    36     Float_t         fSumWeights;
    3736    Float_t         fSumQuadWeights;
    3837
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r2244 r2251  
    9393    virtual void     SetCamContent(const MCamEvent &evt, Int_t type=0) { Reset(); AddCamContent(evt, type); }
    9494    virtual void     SetCamContent(const TArrayD &evt, const TArrayC *used=NULL) { Reset(); AddCamContent(evt, used); }
    95     virtual void     SetCamContent(const MHCamera &d, Int_t type=0) { Reset(); fEntries=d.fEntries-1; AddCamContent(d, type); }
     95    virtual void     SetCamContent(const MHCamera &d, Int_t type=0) { Reset(); AddCamContent(d, type); fEntries=d.fEntries; }
    9696    virtual void     CntCamContent(const MCamEvent &evt, Double_t threshold, Int_t type=0);
    9797    virtual void     CntCamContent(const TArrayD &evt, Double_t threshold, Bool_t ispos=kTRUE);
Note: See TracChangeset for help on using the changeset viewer.