Ignore:
Timestamp:
10/29/01 13:22:33 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmontecarlo
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc

    r1005 r1007  
    4444    fTitle = title ? title : "Task to calculate the collection area";
    4545
    46     fObjName = input ? input : "MMcTrig";
     46    if (input)
     47    {
     48        fObjName = input;
     49        AddToBranchList(Form("%s.fNumFirstLevel", input));
     50    }
     51    else
     52    {
     53        fObjName = "MMcTrig";
     54        AddToBranchList("fNumFirstLevel");
     55    }
     56
     57    AddToBranchList("fEnergy");
     58    AddToBranchList("fImpact");
    4759}
    4860
     
    7486Bool_t MMcCollectionAreaCalc::Process()
    7587{
    76     const Float_t energy = log10(fMcEvt->GetEnergy());
     88    const Float_t energy = fMcEvt->GetEnergy();
    7789    const Float_t impact = fMcEvt->GetImpact()/100.;
    7890
  • trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc

    r1004 r1007  
    6767MMcThresholdCalc::MMcThresholdCalc(const Int_t dim, const char* name,
    6868                                   const char* title)
    69     : fDimension(dim), fMcTrig(NULL), fEnergy(NULL)
     69    : fMcTrig(NULL), fEnergy(NULL)
    7070{
    7171    fName  = name  ? name  : "MMcThresholdCalc";
    7272    fTitle = title ? title : "Task to calculate the energy threshold from Monte Carlo";
     73
     74    fFirst = dim>0 ?   1 : -dim;
     75    fLast  = dim>0 ? dim : -dim;
     76
     77    fNum = fLast-fFirst+1;
     78
     79    AddToBranchList("fEnergy");
     80    AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast);
    7381}
    7482
     
    103111    }
    104112
    105     UInt_t from = fDimension>0 ?          1 : -fDimension;
    106     UInt_t to   = fDimension>0 ? fDimension : -fDimension;
     113    UInt_t num;
    107114
    108     fNum = to-from+1;
    109 
    110     Int_t num;
    111 
    112     fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, to));
     115    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", fFirst, fLast));
    113116    num = fMcTrig->GetEntriesFast();
    114117    if (num != fNum)
     
    119122    }
    120123
    121     fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", from, to));
     124    fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", fFirst, fLast));
    122125    num = fMcTrig->GetEntriesFast();
    123126    if (num != fNum)
     
    143146    const Float_t reciproc = 1./energy;
    144147
    145     for (Int_t i=0; i<fNum; i++)
     148    for (UInt_t i=0; i<fNum; i++)
    146149        if (GetTrig(i)->GetFirstLevel()>0)
    147150            GetHEnergy(i)->Fill(lg10, reciproc);
     
    157160Bool_t MMcThresholdCalc::PostProcess()
    158161{
    159     for (Int_t i=0; i<fNum; i++)
     162    for (UInt_t i=0; i<fNum; i++)
    160163    {
    161164        MHMcEnergy &hist = *GetHEnergy(i);
  • trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.h

    r984 r1007  
    2424{
    2525private:
    26     Int_t fDimension;
    27     Int_t fNum;
     26    UInt_t fFirst;
     27    UInt_t fLast;
     28
     29    UInt_t fNum;
    2830
    2931    const MMcEvt  *fMcEvt;       // Container with Monte Carlo information
  • trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc

    r1004 r1007  
    4747    fMcRate = NULL;
    4848
    49     fDimension = dim;
    50 
    5149    for (int i=0;i<10;i++)
    5250        fTrigger[i] = dim&&trigbg ? trigbg[i] : 0;
     
    5654
    5755    fPartId=part;
     56
     57
     58    fFirst = dim>0 ?   1 : -dim;
     59    fLast  = dim>0 ? dim : -dim;
     60
     61    fNum = fLast-fFirst+1;
     62
     63    AddToBranchList("fImpact");
     64    AddToBranchList("fEnergy");
     65    AddToBranchList("fPhi");
     66    AddToBranchList("fTheta");
     67    AddToBranchList("fPhotElfromShower");
     68    AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast);
    5869}
    5970
     
    124135    }
    125136
    126     UInt_t from = fDimension>0 ?          1 : -fDimension;
    127     UInt_t to   = fDimension>0 ? fDimension : -fDimension;
    128 
    129     fNum = to-from+1;
    130 
    131     Int_t num;
    132 
    133     fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, to));
     137    UInt_t num;
     138
     139    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", fFirst, fLast));
    134140    num = fMcTrig->GetEntriesFast();
    135141    if (num != fNum)
     
    140146    }
    141147
    142     fMcRate = new TObjArray(pList->FindObjectList("MHMcRate", from, to));
     148    fMcRate = new TObjArray(pList->FindObjectList("MHMcRate", fFirst, fLast));
    143149    num = fMcRate->GetEntriesFast();
    144150    if (num != fNum)
     
    149155    }
    150156
    151     for (int i=0; i<fNum; i++)
     157    for (UInt_t i=0; i<fNum; i++)
    152158    {
    153159        MHMcRate &rate = *GetRate(i);
     
    191197    //  Counting number of triggers
    192198    //
    193     for (int i=0; i<fNum; i++)
     199    for (UInt_t i=0; i<fNum; i++)
    194200    {
    195201        fTrigger[i] += GetTrig(i)->GetFirstLevel();
     
    210216    // Computing trigger rate
    211217    //
    212     for (int i=0; i<fNum; i++)
     218    for (UInt_t i=0; i<fNum; i++)
    213219        GetRate(i)->CalcRate(fTrigger[i], fAnalShow, fShowers);
    214220
  • trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h

    r988 r1007  
    2525    TObjArray *fMcTrig;
    2626
    27     Int_t      fDimension;     // Information about the trigger conditions
    28                                // in the root file to be read.
    29     Int_t      fNum;           // decoded dimension
     27    UInt_t     fNum;           // decoded dimension
     28    UInt_t     fFirst;
     29    UInt_t     fLast;
    3030
    3131    Float_t    fTrigger[10];   // Number of triggered showers
Note: See TracChangeset for help on using the changeset viewer.