Ignore:
Timestamp:
07/12/03 16:44:56 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhistmc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified 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
  • TabularUnified 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; }
Note: See TracChangeset for help on using the changeset viewer.