Changeset 2273


Ignore:
Timestamp:
07/12/03 16:44: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

    r2269 r2273  
    11                                                 -*-*- END OF LINE -*-*-
     2
     3 2003/07/12: Thomas Bretz
     4 
     5   * mhistmc/MHMcCT1CollectionArea.[h,cc]:
     6     - made the enum as FillType_t a public member of the class
     7
     8   * macros/CT1collarea.C
     9     - Updated accordingly. Can somebody please check whether it
     10       still works.
     11 
     12   * mbase/MArgs.h:
     13     - added some comment
     14     
     15   * mraw/MRawRunHeader.cc:
     16     - added an 'inf' to the log-stream
     17
     18
    219
    320 2003/07/08: Abelardo Moralejo
     
    926       distribution of the shower.
    1027
     28
     29
    1130 2003/07/06: Abelardo Moralejo
    1231
     
    2039     - Added example on how to use the new function
    2140       MHMcCT1CollectionArea::SetEaxis
     41
     42
    2243
    2344 2003/07/06: Thomas Bretz
  • trunk/MagicSoft/Mars/macros/CT1collarea.C

    r2268 r2273  
    2424\* ======================================================================== */
    2525
    26 #include "/home/magic/Mars/mhistmc/MHMcCT1CollectionArea.h"
    27 
    2826void CT1collarea(TString filename="MC_SC4.root", TString outname="")
    2927{
     
    4543    reader.DisableAutoScheme();
    4644
    47     MHMcCT1CollectionArea* collarea = new MHMcCT1CollectionArea();
     45    MHMcCT1CollectionArea collarea;
    4846
    4947    MBinning binsx("BinningE");
     
    5452    xed.Set(15,xedge);
    5553    binsx.SetEdges(xed);
    56     collarea->SetEaxis(kLog10Energy);
     54    collarea.SetEaxis(MHMcCollectionArea::kLog10);
    5755    */
    5856
     
    6462    //
    6563    binsx.SetEdgesLog(14,300,1.e5);
    66     collarea->SetEaxis(kEnergy);
     64    collarea.SetEaxis(MHMcCT1CollectionArea::kLinear);
    6765
    6866
     
    7371    binsy.SetEdges(yed);
    7472
    75     parlist.AddToList(collarea);
     73    parlist.AddToList(&collarea);
    7674    parlist.AddToList(&binsx);
    7775    parlist.AddToList(&binsy);
     
    103101    tasklist.PrintStatistics();
    104102
    105     collarea->CalcEfficiency();
     103    collarea.CalcEfficiency();
    106104
    107105    //
     
    109107    // filled and can be displayed
    110108    //
    111     collarea->DrawClone();
     109    collarea.DrawClone();
    112110
    113111    //
     
    119117
    120118    TFile f(outname,"recreate");
    121     collarea->GetHist()->Write();
    122     collarea->GetHAll()->Write();
    123     collarea->GetHSel()->Write();
    124     f.Close();
     119    collarea.GetHist()->Write();
     120    collarea.GetHAll()->Write();
     121    collarea.GetHSel()->Write();
    125122}
    126123
  • trunk/MagicSoft/Mars/mbase/MArgs.h

    r2267 r2273  
    3535    void Print(const Option_t *o="") const;
    3636
     37    // FIXME: Add max, min option
     38    // FIXME: Add default option
     39
    3740    Int_t    GetInt(const TString name) const;
    3841    Double_t GetFloat(const TString name) const;
  • trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.cc

    r2268 r2273  
    5252//   - collection area (result)
    5353//
    54 MHMcCT1CollectionArea::MHMcCT1CollectionArea(const char *name, const char *title)
     54MHMcCT1CollectionArea::MHMcCT1CollectionArea(const char *name, const char *title) :
     55    fEaxis(kLog10)
    5556{
    5657  //
     
    6667  fTitle = title ? title : "Collection Area vs. log10 Energy";
    6768
    68   fEaxis = kLog10Energy;
    69 
    7069  fHistAll = new TH2D;
    7170  fHistSel = new TH2D;
     
    8483  fHistCol->SetDirectory(NULL);
    8584
    86   fHistAll->SetXTitle("log10 E [GeV]");
    87   fHistAll->SetYTitle("theta [deg]");
    88   fHistAll->SetZTitle("N");
    89 
    90   fHistSel->SetXTitle("log10 E [GeV]");
    91   fHistSel->SetYTitle("theta [deg]");
    92   fHistSel->SetZTitle("N");
    93 
    94   fHistCol->SetXTitle("log10 E [GeV]");
     85  fHistAll->SetXTitle("log10(E [GeV])");
     86  fHistAll->SetYTitle("\\Theta [\\circ]");
     87  fHistAll->SetZTitle("Counts");
     88
     89  fHistSel->SetXTitle("log10(E [GeV])");
     90  fHistSel->SetYTitle("\\Theta [\\circ]");
     91  fHistSel->SetZTitle("Counts");
     92
     93  fHistCol->SetXTitle("log10(E [GeV])");
    9594  fHistCol->SetYTitle("theta [deg]");
    9695  fHistCol->SetZTitle("A [m^{2}]");
     
    133132    fHistCol->Sumw2();
    134133
    135     if (fEaxis == kEnergy)
    136       {
    137         fTitle = "Collection Area vs. Energy";
    138         fHistCol->SetTitle(fTitle);
    139         fHistAll->SetTitle("All showers - Theta vs Energy distribution");
    140         fHistSel->SetTitle("Selected showers - Theta vs Energy distribution");
    141         fHistCol->SetXTitle("E [GeV]");
    142         fHistAll->SetXTitle("E [GeV]");
    143         fHistSel->SetXTitle("E [GeV]");
    144       }
     134    if (fEaxis == kLinear)
     135    {
     136        fTitle = "Collection Area vs. Energy";
     137        fHistCol->SetTitle(fTitle);
     138        fHistAll->SetTitle("All showers - Theta vs Energy distribution");
     139        fHistSel->SetTitle("Selected showers - Theta vs Energy distribution");
     140        fHistCol->SetXTitle("E [GeV]");
     141        fHistAll->SetXTitle("E [GeV]");
     142        fHistSel->SetXTitle("E [GeV]");
     143    }
    145144
    146145    return kTRUE;
     
    156155  MMcEvt &mcevt = *(MMcEvt*)par;
    157156
    158   if (fEaxis == kLog10Energy)
    159     fHistSel->Fill(log10(mcevt.GetEnergy()), kRad2Deg*mcevt.GetTelescopeTheta(), w);
    160   else
    161     fHistSel->Fill(mcevt.GetEnergy(), kRad2Deg*mcevt.GetTelescopeTheta(), w);
     157  const Double_t E = fEaxis==kLinear ? mcevt.GetEnergy() : log10(mcevt.GetEnergy());
     158
     159  fHistSel->Fill(E, kRad2Deg*mcevt.GetTelescopeTheta(), w);
    162160
    163161  return kTRUE;
     
    211209
    212210  c.cd(1);
    213   if (fEaxis == kEnergy)
     211  if (fEaxis == kLinear)
    214212    gPad->SetLogx();
    215213  fHistCol->SetDirectory(NULL);
     
    217215
    218216  c.cd(2);
    219   if (fEaxis == kEnergy)
     217  if (fEaxis == kLinear)
    220218    gPad->SetLogx();
    221219  fHistSel->SetDirectory(NULL);
     
    223221
    224222  c.cd(3);
    225   if (fEaxis == kEnergy)
     223  if (fEaxis == kLinear)
    226224    gPad->SetLogx();
    227225  fHistAll->SetDirectory(NULL);
     
    462460          Float_t e2;
    463461
    464           if (fEaxis == kLog10Energy)
     462          if (fEaxis == kLog10)
    465463            {
    466464              e1 = pow(10.,fHistAll->GetXaxis()->GetBinLowEdge(i));
     
    547545          //
    548546
    549           Float_t area;
     547          Float_t area = dr;
    550548
    551549          if (theta < 50)
    552             area = dr * cos(theta*TMath::Pi()/180.);
    553           else
    554             area = dr;
     550            area *= cos(theta*TMath::Pi()/180.);
    555551
    556552          // Above 50 degrees MC was generated with Corsika 6.xx, and the cores
  • trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.h

    r2268 r2273  
    66#endif
    77
    8 enum {
    9   kLog10Energy,
    10   kEnergy
    11 };
    12 
    138class TH2D;
    149
    1510class MHMcCT1CollectionArea : public MH
    1611{
     12public:
     13    enum FillType_t {
     14        kLog10,
     15        kLinear
     16    };
     17
    1718private:
    1819    TH2D *fHistAll; //  all simulated showers
     
    2021    TH2D *fHistCol; //  the collection area
    2122
    22     Byte_t fEaxis;
     23    FillType_t fEaxis;
    2324
    2425public:
     
    3233    void DrawSel(Option_t *option="");
    3334
    34     void SetEaxis(Byte_t x) { fEaxis = x; }
     35    void SetEaxis(FillType_t x) { fEaxis = x; }
    3536
    3637    const TH2D *GetHist() const { return fHistCol; }
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc

    r2200 r2273  
    155155    *fLog << "Evt Counter:  " << fNumEvents << endl;
    156156
    157     *fLog << hex;
     157    *fLog << inf << hex;
    158158    for (int i=0; i<GetNumPixel(); i++)
    159159        *fLog << setfill('0') << setw(3) << (*fPixAssignment)[i] << " ";
Note: See TracChangeset for help on using the changeset viewer.