Ignore:
Timestamp:
03/31/03 10:37:56 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1800 r1880  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!   Author(s): Harald Kornmayer 1/2001
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2001
     21!   Copyright: MAGIC Software Development, 2000-2003
    2222!
    2323!   Modified 4/7/2002 Abelardo Moralejo: now the dimension of fTrigger is
     
    2727!
    2828\* ======================================================================== */
    29 
    3029#include "MMcTriggerRateCalc.h"
    3130
     
    105104    if (fMcRunHeader->GetAllEvtsTriggered())
    106105      {
    107         *fLog << endl << all << endl <<
    108           "WARNING: the input data file contains only the" << endl <<
    109           "events that triggered. I will assume the standard value" << endl <<
    110           "for maximum impact parameter (400 m)" <<endl;
    111 
    112 
    113         if (fTrigNSB[0] > 0)
    114           *fLog << endl << all <<
    115             "WARNING: NSB rate can be overestimated by up to 5%." << endl <<
    116             "For a precise estimate of the total rate including NSB" << endl <<
    117             "accidental triggers I need a file containing all event headers."
    118                 << endl;
    119         else
    120           *fLog << endl << all <<
    121             "WARNING: calculating only shower rate (no NSB accidental triggers)" << endl;
     106          *fLog << warn;
     107          *fLog << "WARNING - the input data file contains only the" << endl;
     108          *fLog << "events that triggered. I will assume the standard value" << endl;
     109          *fLog << "for maximum impact parameter (400 m)" <<endl;
     110
     111
     112          if (fTrigNSB[0] > 0)
     113          {
     114              *fLog << warn;
     115              *fLog << "WARNING - NSB rate can be overestimated by up to 5%." << endl;
     116              *fLog << "For a precise estimate of the total rate including NSB" << endl;
     117              *fLog << "accidental triggers I need a file containing all event headers." << endl;
     118          }
     119          else
     120          {
     121            *fLog << warn << "WARNING - calculating only shower rate (no NSB accidental triggers)" << endl;
     122          }
    122123      }
    123124
    124     *fLog << endl << all <<
     125    *fLog << endl << warn <<
    125126      "WARNING: I will assume the standard maximum off axis angle" << endl <<
    126127      "(5 degrees) for the original showers" << endl;
     
    168169//      rate:    rate of incident showers
    169170//
    170 
    171171MMcTriggerRateCalc::MMcTriggerRateCalc(float rate, int dim,
    172172                                       float *trigbg, float simbg,
     
    325325          if (fMcCorRunHeader->GetSlopeSpec() != -2.75)
    326326            {
    327               *fLog << err << dbginf <<
    328                 "Spectrum slope as read from  input file ("<<
    329                 fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected one (-2.75) for protons" << endl << "... aborting." << endl;
    330               return kFALSE;
    331             }
     327                *fLog << err << dbginf << "Spectrum slope as read from input file (";
     328                *fLog << fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected ";
     329                *fLog << "one (-2.75) for protons" << endl << "... aborting." << endl;
     330                return kFALSE;
     331            }
    332332          rate.SetFlux(0.1091, 2.75);
    333333          break;
     
    335335          if (fMcCorRunHeader->GetSlopeSpec() != -2.62)
    336336            {
    337               *fLog << err << dbginf <<
    338                 "Spectrum slope as read from  input file ("<<
    339                 fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected one (-2.75) for Helium" << endl << "... aborting." << endl;
    340               return kFALSE;
     337                *fLog << err << dbginf << "Spectrum slope as read from input file (";
     338                *fLog << fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected ";
     339                *fLog << "one (-2.75) for Helium" << endl << "... aborting." << endl;
     340                return kFALSE;
    341341            }
    342342          rate.SetFlux(0.0660, 2.62);
     
    363363void MMcTriggerRateCalc::Draw()
    364364{
     365    /*
     366     Commented out, because this is creating a memory leak!
     367     The histograms are neither deleted anywhere, nor it is made
     368     sure, that the histograms are not overwritten.
     369     Also the comment for the function doesn't match the rules.
     370
    365371  TCanvas *c = MH::MakeDefCanvas("Rate");
    366372
    367373  Float_t xmin = GetRate(0)->GetMeanThreshold()-0.55;
    368374  Float_t xmax = GetRate(fNum-1)->GetMeanThreshold()+0.55;
    369   Int_t  nbins = 10*(xmax-xmin);
     375  Int_t  nbins = (Int_t)((xmax-xmin)*10);
    370376
    371377  fHist[1] = new TH1F("Rate2","Trigger rate, mult. 2", nbins, xmin, xmax);
     
    412418  fHist[4]->Draw("same");
    413419  fHist[4]->SetMarkerColor(4);
    414 
    415   return;
    416 }
    417 
     420     */
     421}
     422
Note: See TracChangeset for help on using the changeset viewer.