Changeset 851 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
06/13/01 15:29:47 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r850 r851  
    1717   * mgui/MParContainer.cc:
    1818     - made Copy-function more readable
     19
     20   * mhist/MHMcEnergies.[h,cc]:
     21     - files added as a container to make handling of several MHMcEnergy easier
     22   
     23   * mbase/MAGIC.h:
     24     - encapsulated include of TROOT
     25
     26   * mbase/MTaskList.cc:
     27     - added SetHasChange and Reset to PostProcess
     28
     29   * mhist/HistLinkDef.h
     30     - added MHMcEnergies
     31     
     32   * mhist/MHMcEnergy.[h,cc]:
     33     - added name and title to constructor
     34     - added number to name of container
     35   
     36   * mmontecarlo/MMcThresholdCalc.cc:
     37     - corrected typo in creation of the container names
     38   
     39   * mraw/MRawEvtData.cc:
     40     - Set kCanDelete in Draw function
     41   
    1942
    2043
  • trunk/MagicSoft/Mars/macros/getCollArea.C

    r753 r851  
    1 void getCollArea(char *filename = "/big0/Maggi/CamData/Gamma/gamma_15_on.root" )
     1void getCollArea(char *filename = "data/gamma_15_on.root" )
    22{
    33    // FIXME: Harald, you should tell the people what the result of
     
    2121    parlist.AddToList(&tasklist);
    2222
    23     MCollArea *collArea = new MCollArea();
     23    MHMcCollectionArea *collArea = new MHMcCollectionArea();
    2424    parlist.AddToList(collArea);
    2525
  • trunk/MagicSoft/Mars/macros/getThreshold.C

    r839 r851  
    11void getThreshold( char* filename = "/hdb1/users/jlopez/temp_loop.root")
    22{
     3    // This macro fill the container MMcEnerThre using the task
     4    // MMcEnerThreCalc and shows the results.
    35
    4   // This macro fill the container MMcEnerThre using the task
    5   // MMcEnerThreCalc and shows the results.
     6    MParList parlist;
     7    MTaskList tasklist;
    68
    7   MParList parlist;
    8   MTaskList tasklist;
     9    // Setup the parameter list
     10    // - You need create the container MMcEnerThre.
     11    //    + You need to put the number of trigger conditions when
     12    //      you declarete the MMcEnerThre
     13    //    + If you don't put any dimension to MMcEnerThre it works
     14    //      taking only the trigger information from MMcTrig
     15    // - You can control the number of bins in the energy distribution
     16    //   histogram used to compute the energy threshold using
     17    //   the SetBins() function.
    918
    10   // Setup the parameter list
    11   // - You need create the container MMcEnerThre.
    12   //    · You need to put the number of trigger conditions when
    13   //      you declarete the MMcEnerThre
    14   //    · If you don't put any dimension to MMcEnerThre it works
    15   //      taking only the trigger information from MMcTrig
    16   // - You can control the number of bins in the energy distribution
    17   //   histogram used to compute the energy threshold using
    18   //   the SetBins() function.
     19    Int_t numtrigcond = 5;
     20    MHMcEnergies *hists = new MHMcEnergies(numtrigcond);
    1921
    20   Int_t NumTrigCond = 5;
    21   MMcEnerThre enerthre(NumTrigCond);
    22   enerthre[0].SetBins(60);
    23   enerthre[1].SetBins(60);
    24   enerthre[2].SetBins(60);
    25   enerthre[3].SetBins(60);
    26   enerthre[4].SetBins(60);
     22    parlist.AddToList(&tasklist);
     23    hists->AddEntriesToList(&parlist);
    2724
    28   parlist.AddToList(&tasklist);
    29   parlist.AddToList(&enerthre);
     25    // Setup the task list
     26    // - You need the read and the MMcEnerThreCalc tasks
     27    //    + You need to put the number of trigger conditions when
     28    //      you declarete the MMcEnerThreCalc
     29    //    + If you don't put any dimension to MMcEnerThreCalc it works
     30    //      like one dimension MMcEnerThreCalc
    3031
    31   // Setup the task list
    32   // - You need the read and the MMcEnerThreCalc tasks
    33   //    · You need to put the number of trigger conditions when
    34   //      you declarete the MMcEnerThreCalc
    35   //    · If you don't put any dimension to MMcEnerThreCalc it works
    36   //      like one dimension MMcEnerThreCalc
     32    MReadTree read("Events", filename);
    3733
     34    MMcThresholdCalc tcalc(numtrigcond);
    3835
     36    tasklist.AddToList(&read);
     37    tasklist.AddToList(&tcalc);
    3938
    40   MReadTree read("Events",filename);
     39    MEvtLoop evtloop;
     40    evtloop.SetParList(&parlist);
    4141
    42   MMcEnerThreCalc enerthrecalc(NumTrigCond);
    43  
    44   tasklist.AddToList(&read);
    45   tasklist.AddToList(&enerthrecalc);
     42    // Begin the loop
    4643
    47   MEvtLoop evtloop;
    48   evtloop.SetParList(&parlist);
     44    evtloop.Eventloop();
    4945
    50   // Begin the loop
     46    // Now you can display the results
    5147
    52   evtloop.Eventloop();
     48    TCanvas *c;
    5349
    54   // Now you can display the results
     50    c=new TCanvas("c0","Energy distribution for triggered events", 50, 50, 850, 550);
     51    hists[0].Print();
     52    hists[0].Draw();
     53    c->Update();
    5554
    56   gROOT->Reset();
     55    c= new TCanvas("c1","Energy distribution for triggered events", 50, 50, 850, 550);
     56    hists[1].Print();
     57    hists[1].Draw();
     58    c->Update();
    5759
    58   c0= new TCanvas("c0","Energy distribution for triggered events",50,50,850,550);
    59   enerthre[0].Print();
    60   enerthre[0].Draw();
    61   c0->Update();
     60    c= new TCanvas("c2","Energy distribution for triggered events", 50, 50, 850, 550);
     61    hists[2].Print();
     62    hists[2].Draw();
     63    c->Update();
    6264
    63   c1= new TCanvas("c1","Energy distribution for triggered events",50,50,850,550);
    64   enerthre[1].Print();
    65   enerthre[1].Draw();
    66   c1->Update();
     65    c= new TCanvas("c3","Energy distribution for triggered events", 50, 50, 850, 550);
     66    hists[3].Print();
     67    hists[3].Draw();
     68    c->Update();
    6769
    68   c2= new TCanvas("c2","Energy distribution for triggered events",50,50,850,550);
    69   enerthre[2].Print();
    70   enerthre[2].Draw();
    71   c2->Update();
    72 
    73   c3= new TCanvas("c3","Energy distribution for triggered events",50,50,850,550);
    74   enerthre[3].Print();
    75   enerthre[3].Draw();
    76   c3->Update();
    77 
    78   c4= new TCanvas("c4","Energy distribution for triggered events",50,50,850,550);
    79   enerthre[4].Print();
    80   enerthre[4].Draw();
    81   c4->Update();
    82 
     70    c= new TCanvas("c4","Energy distribution for triggered events", 50, 50, 850, 550);
     71    hists[4].Print();
     72    hists[4].Draw();
     73    c->Update();
    8374}
    84 
    85 
    86 
    87 
  • trunk/MagicSoft/Mars/mbase/MAGIC.h

    r690 r851  
    99///////////////////////////////////////////////////////////////////////////////
    1010
     11#ifndef ROOT_TROOT
    1112#include <TROOT.h>
     13#endif
    1214
    1315//
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r849 r851  
    6565MParContainer& MParContainer::operator=(const MParContainer& rhs)
    6666{
    67     if (this != &rhs) {
    68         TObject::operator=(rhs);
    69         *fName  = *(rhs.fName);
    70         *fTitle = *(rhs.fTitle);
    71         fLog    = rhs.fLog;
    72         fHasChanged = rhs.fHasChanged;
    73     }
     67    if (this == &rhs)
     68        return *this;
     69
     70    TObject::operator=(rhs);
     71
     72    *fName  = *(rhs.fName);
     73    *fTitle = *(rhs.fTitle);
     74
     75    fLog        = rhs.fLog;
     76    fHasChanged = rhs.fHasChanged;
     77
    7478    return *this;
    7579}
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r843 r851  
    227227    *fLog << "Postprocessing... " << flush;
    228228
    229     // FIXME: At the moment all containers are post processed independ of
     229    // FIXME: At the moment all tasks are post processed independ of
    230230    // whether it was preprocessed or not.
     231
     232    //
     233    // Reset the HasChanged flag.
     234    // Reset all containers.
     235    //
     236    fParList->SetHasChanged(kFALSE);
     237    fParList->Reset();
    231238
    232239    //
  • trunk/MagicSoft/Mars/mhist/HistLinkDef.h

    r846 r851  
    1010#pragma link C++ class MHStarMap;
    1111#pragma link C++ class MHMcEnergy;
     12#pragma link C++ class MHMcEnergies;
     13#pragma link C++ class MHMcCollectionArea;
    1214
    1315#pragma link C++ class MFillHFadc;
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc

    r846 r851  
    3333ClassImp(MHMcEnergy)
    3434
    35 MHMcEnergy::MHMcEnergy(const UInt_t idx)
     35MHMcEnergy::MHMcEnergy(const UInt_t idx, const char *name, const char *title)
    3636{
    3737    //
    3838    //   default constructor
    3939    //
     40    char aux[15]="MHMcEnergy";
     41
     42    if (idx>0)
     43        sprintf(aux+10, ";%i", idx);
     44    *fName  = name  ? name  : aux;
     45    *fTitle = title ? title : "Container for a MC energy histogram" ;
    4046
    4147    //  - we initialize the histogram and the gaus function
     
    4349    //    root don't allow us to have diferent histograms with the same name
    4450
    45     char aux[15];
     51    strcpy(aux, "fLogEnergy");
     52    if (idx>0)
     53        sprintf(aux+10, ";%i", idx);
     54    fLogEner = new TF1(aux, "gaus", 1., 3.);
    4655
    4756    strcpy(aux, "hLogEnergy");
     
    4958        sprintf(aux+10, ";%i", idx);
    5059    hLogEner = new TH1F(aux, "", 100, 0.5, 4.5);
    51 
    52     strcpy(aux, "fLogEnergy");
    53     if (idx>0)
    54         sprintf(aux+10, ";%i", idx);
    55     fLogEner = new TF1(aux, "gaus", 1., 3.);
     60    //hLogEner->SetBins(60);
    5661}
    5762
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.h

    r846 r851  
    2121public:
    2222
    23     MHMcEnergy(const UInt_t idx=0);
     23    MHMcEnergy(const UInt_t idx=0, const char *name=NULL, const char *title=NULL);
    2424    ~MHMcEnergy();
    2525
  • trunk/MagicSoft/Mars/mhist/Makefile

    r846 r851  
    3535           MHHillas.cc \
    3636           MHStarMap.cc \
    37            MHMcEnergy.cc
     37           MHMcCollectionArea.cc \
     38           MHMcEnergy.cc \
     39           MHMcEnergies.cc
    3840
    3941SRCS    = $(SRCFILES)
  • trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc

    r846 r851  
    8787    {
    8888        if (fDimension>1)
    89             sprintf(auxname+7, ";%i.", i+1);
     89            sprintf(auxname+7, ";%i", i+1);
    9090
    9191        fMcTrig[i] = (MMcTrig*)pList->FindObject(auxname);
     
    105105    {
    106106        if (fDimension>1)
    107             sprintf(auxname+10, ";%i.", i+1);
     107            sprintf(auxname+10, ";%i", i+1);
    108108
    109109        fHMcEnergy[i] = (MHMcEnergy*)pList->FindObject(auxname);
  • trunk/MagicSoft/Mars/mmontecarlo/Makefile

    r846 r851  
    2828.SUFFIXES: .c .cc .cxx .h .hxx .o
    2929
    30 SRCFILES = MCollArea.cc \
    31            MCollAreaTrigger.cc \
     30SRCFILES = MMcCollectionAreaCalc.cc \
    3231           MMcThresholdCalc.cc
    3332
  • trunk/MagicSoft/Mars/mmontecarlo/MonteCarloLinkDef.h

    r846 r851  
    55#pragma link off all functions;
    66
    7 #pragma link C++ class MCollArea ;
    8 #pragma link C++ class MCollAreaTrigger ;
    9 #pragma link C++ class MMcThresholdCalc ;
     7#pragma link C++ class MMcThresholdCalc;
     8#pragma link C++ class MMcCollectionAreaCalc;
    109
    1110#endif
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r761 r851  
    244244        graph->SetMinimum (0) ;
    245245
     246        graph->SetBit(kCanDelete);
    246247        graph->Draw("AC*");
    247248
     
    272273            hist->Fill(0.5+i, (*fHiGainFadcSamples)[i + num*GetNumHiGainSamples()]);
    273274
     275        hist->SetBit(kCanDelete);
    274276        hist->Draw();
    275277
Note: See TracChangeset for help on using the changeset viewer.