Changeset 900


Ignore:
Timestamp:
07/31/01 10:46:18 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHMcRate.cc

    r896 r900  
    5151    fBackSim=-1.0;          // Number of simulated showers for the background
    5252
    53     fTrigRate= -1.0;        // Trigger rate in Hz
    54     fTrigRateError= -1.0;   // Estimated error for the trigger rate in Hz
     53    fTriggerRate= -1.0;        // Trigger rate in Hz
     54    fTriggerRateError= -1.0;   // Estimated error for the trigger rate in Hz
    5555}
    5656
     
    6767    fFlux0=-1.0;            // dn/dE = fFlux0 * E^{-a}
    6868
    69     fShowRate= -1.0;        // Showers rate in Hz
    70     fShowRateError=0.0;     // Estimated error of shower rate in Hz
     69    fShowerRate= -1.0;        // Showers rate in Hz
     70    fShowerRateError=0.0;     // Estimated error of shower rate in Hz
    7171}
    7272
     
    8585    fFlux0=-1.0;            // dn/dE = fFlux0 * E^{-a}
    8686
    87     fShowRate= showrate;               // Showers rate in Hz
    88     fShowRateError=sqrt(showrate);     // Estimated error of shower rate in Hz
     87    fShowerRate= showrate;               // Showers rate in Hz
     88    fShowerRateError=sqrt(showrate);     // Estimated error of shower rate in Hz
    8989}
    9090
     
    103103    fFlux0=flux0;           // dn/dE = fFlux0 * E^{-a}
    104104
    105     fShowRate= -1.0;
    106     fShowRateError=0.0;
     105    fShowerRate= -1.0;
     106    fShowerRateError=0.0;
    107107}
    108108
     
    130130//  update the limits for energy, theta, phi and impact parameter
    131131//
    132 void MHMcRate::Boundaries(Float_t energy, Float_t theta,
    133                           Float_t phi, Float_t impact)
     132void MHMcRate::UpdateBoundaries(Float_t energy, Float_t theta,
     133                                Float_t phi, Float_t impact)
    134134{
    135135  // It updates the limit values
     
    163163    const Double_t epowmin = pow(fEnergyMin, specidx);
    164164
    165     fShowRate = fFlux0/specidx*(epowmax-epowmin);
     165    fShowerRate = fFlux0/specidx*(epowmax-epowmin);
    166166
    167167    if (fPartId!=1)
    168         fShowRate *= (fPhiMax-fPhiMin)*(cos(fThetaMax)-cos(fThetaMin));
     168        fShowerRate *= (fPhiMax-fPhiMin)*(cos(fThetaMax)-cos(fThetaMin));
    169169
    170170    const Double_t impactdiff = fImpactMax-fImpactMin;
    171171
    172     fShowRate *= TMath::Pi()*(impactdiff/100.0*impactdiff/100.0);
    173 
    174     fShowRateError = sqrt(fShowRate);
     172    fShowerRate *= TMath::Pi()*(impactdiff/100.0*impactdiff/100.0);
     173
     174    fShowerRateError = sqrt(fShowerRate);
    175175
    176176    const Double_t anal2 = 1.0-anal*160.0e-9;
     
    179179    // Then the trigger rate and its error is evaluated
    180180    if(fBackTrig<0){
    181         fTrigRateError = sqrt((trig*fShowRate*fShowRate/(simu*simu)) +
     181        fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) +
    182182                              (anal2*anal2*1/(fBackSim*back2*back2)));
    183183        fBackTrig=0;
    184184    }
    185185    else
    186         fTrigRateError = sqrt((trig*fShowRate*fShowRate/(simu*simu)) +
     186        fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) +
    187187                              (anal2*anal2*fBackTrig/(back2*back2)));
    188188
    189     fTrigRate = trig*fShowRate/simu + anal2*fBackTrig/back2;
     189    fTriggerRate = trig*fShowerRate/simu + anal2*fBackTrig/back2;
    190190}
    191191
     
    194194//  print the trigger rate
    195195//
    196 void MHMcRate::Print()
    197 {
    198     *fLog << "Incident rate " << fShowRate << " Hz " << endl;
    199     *fLog << "Trigger Rate " << fTrigRate << " +- " << fTrigRateError << " Hz" << endl;
     196void MHMcRate::Print(Option_t *)
     197{
     198    *fLog << "Incident rate " << fShowerRate << " Hz " << endl;
     199    *fLog << "Trigger Rate " << fTriggerRate << " +- " << fTriggerRateError << " Hz" << endl;
    200200}
    201201
     
    204204//  draw the trigger rate
    205205//
    206 void MHMcRate::Draw(Option_t* option)
     206void MHMcRate::Draw(Option_t *)
    207207{
    208208  *fLog << "To be iplemented" << endl;
  • trunk/MagicSoft/Mars/mhist/MHMcRate.h

    r896 r900  
    99#endif
    1010
    11 #define PI_NUMBER 3.1415926
     11class MHMcRate : public MParContainer
     12{
    1213
    13 class MHMcRate : public MParContainer {
     14private:
     15    UShort_t fPartId;           // Type of particle
    1416
    15  private:
    16   UShort_t fPartId;         // Type of particle
     17    Float_t fEnergyMax;         // Maximum Energy in GeV
     18    Float_t fEnergyMin;         // Minimum Energy in GeV
    1719
    18   Float_t fEnergyMax;       // Maximum Energy in GeV
    19   Float_t fEnergyMin;       // Minimum Energy in GeV
     20    Float_t fThetaMax;          // Maximum theta angle of run
     21    Float_t fThetaMin;          // Minimum theta angle of run
     22    Float_t fPhiMax;            // Maximum phi angle of run
     23    Float_t fPhiMin;            // Minimum phi angle of run
    2024
    21   Float_t fThetaMax;        // Maximum theta angle of run
    22   Float_t fThetaMin;        // Minimum theta angle of run
    23   Float_t fPhiMax;          // Maximum phi angle of run
    24   Float_t fPhiMin;          // Minimum phi angle of run
     25    Float_t fImpactMax;         // Maximum impact parameter
     26    Float_t fImpactMin;         // Minimum impact parameter
    2527
    26   Float_t fImpactMax;       // Maximum impact parameter
    27   Float_t fImpactMin;       // Minimum impact parameter
    28  
    29   Float_t fBackTrig;        // Number of triggers from background
    30   Float_t fBackSim;         // Number of simulated showers for the background
     28    Float_t fBackTrig;          // Number of triggers from background
     29    Float_t fBackSim;           // Number of simulated showers for the background
    3130
    32   Float_t fSpecIndex;       // dn/dE = k * e^{- fSpecIndex}
    33   Float_t fFlux0;           // dn/dE = fFlux0 * E^{-a}
     31    Float_t fSpecIndex;         // dn/dE = k * e^{- fSpecIndex}
     32    Float_t fFlux0;             // dn/dE = fFlux0 * E^{-a}
    3433
    35   Float_t fShowRate;        // Showers rate in Hz
    36   Float_t fShowRateError;   // Estimated error of shower rate in Hz
     34    Float_t fShowerRate;        // Showers rate in Hz
     35    Float_t fShowerRateError;   // Estimated error of shower rate in Hz
    3736
    38   Float_t fTrigRate;        // Trigger rate in Hz
    39   Float_t fTrigRateError;   // Estimated error for the trigger rate in Hz
     37    Float_t fTriggerRate;       // Trigger rate in Hz
     38    Float_t fTriggerRateError;  // Estimated error for the trigger rate in Hz
    4039
    41   void Init(const char *name, const char *title);
     40    void Init(const char *name, const char *title);
    4241
    43  public:
    44  
    45   MHMcRate(const char *name=NULL, const char *title=NULL) ;
    46   MHMcRate(Float_t ShowRate,
    47           const char *name=NULL, const char *title=NULL) ;
    48   MHMcRate(Float_t SpecIndex, Float_t Flux0,
    49           const char *name=NULL, const char *title=NULL) ;
    50   ~MHMcRate() ;
     42public:
    5143
    52   void SetParticle(UShort_t part);
    53   void SetBackground (Float_t Showers, Float_t Triggers);
     44    MHMcRate(const char *name=NULL, const char *title=NULL);
     45    MHMcRate(Float_t showrate,
     46             const char *name=NULL, const char *title=NULL);
     47    MHMcRate(Float_t specindex, Float_t flux0,
     48             const char *name=NULL, const char *title=NULL);
    5449
    55   void Boundaries(Float_t Energy, Float_t Theta, Float_t Phi, Float_t Impact);
     50    void SetParticle(UShort_t part);
     51    void SetBackground(Float_t showers, Float_t triggers);
    5652
    57   void CalcRate(Float_t trig, Float_t anal, Float_t simu);
     53    void UpdateBoundaries(Float_t energy, Float_t theta, Float_t phi, Float_t impact);
    5854
    59   void Print();
    60   void Draw(const Option_t *);
     55    void CalcRate(Float_t trig, Float_t anal, Float_t simu);
    6156
    62   ClassDef(MHMcRate, 1)  //  Data Container to calculate Collection Area
    63 } ;
     57    void Print(Option_t *o=NULL);
     58    void Draw(Option_t *o=NULL);
     59
     60    ClassDef(MHMcRate, 1)  //  Data Container to calculate Collection Area
     61};
    6462
    6563#endif
Note: See TracChangeset for help on using the changeset viewer.