Ignore:
Timestamp:
02/19/09 15:38:48 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/msim
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc

    r9347 r9348  
    258258    */
    259259
    260     const Int_t f = fPermanentReset ? 2 : 1;
    261 
    262     Double_t xmin = h->GetWavelengthMin();
    263     Double_t xmax = h->GetWavelengthMax();
    264     Int_t    num  = TMath::CeilNint((xmax-xmin)/(5*f));
    265 
    266     MH::FindGoodLimits(num, num, xmin, xmax, kFALSE);
    267 
    268     MBinning(abs(num), xmin, xmax).Apply(fHistWL);
     260    const Int_t f = fPermanentReset ? 10 : 2;
     261
     262    Double_t xmin = h->GetWavelengthMin()-20;
     263    Double_t xmax = h->GetWavelengthMax()+20;
     264    Int_t    num  = TMath::CeilNint((xmax-xmin)/f);
     265
     266    MH::FindGoodLimits(num, num, xmin, xmax, kTRUE);
     267
     268    MBinning(abs(num), xmin-.5, xmax-.5).Apply(fHistWL);
    269269
    270270    return kTRUE;
  • trunk/MagicSoft/Mars/msim/MPhotonData.cc

    r9285 r9348  
    3030//  Storage container to store Corsika events
    3131//
     32// For details on the coordinate systems see our Wiki.
     33//
    3234//   Version 1:
    3335//   ----------
     
    9799// --------------------------------------------------------------------------
    98100//
     101// Return the square cosine of the Theta-angle == 1-CosU^2-CosV^2
     102//
     103Double_t MPhotonData::GetCosW2() const
     104{
     105    return 1 - GetSinW2();
     106}
     107
     108// --------------------------------------------------------------------------
     109//
     110// Return the square sine of the Theta-angle == CosU^2+CosV^2
     111//
     112Double_t MPhotonData::GetSinW2() const
     113{
     114    return fCosU*fCosU + fCosV*fCosV;
     115}
     116
     117// --------------------------------------------------------------------------
     118//
    99119// return the cosine of the Theta-angle == sqrt(1-CosU^2-CosV^2)
    100120//
    101121Double_t MPhotonData::GetCosW() const
    102122{
    103     return TMath::Sqrt(1 - fCosU*fCosU - fCosV*fCosV);
     123    return TMath::Sqrt(GetCosW2());
     124}
     125
     126// --------------------------------------------------------------------------
     127//
     128// return the sine of the Theta-angle == sqrt(CosU^2+CosV^2)
     129//
     130Double_t MPhotonData::GetSinW() const
     131{
     132    return TMath::Sqrt(GetSinW2());
    104133}
    105134
     
    110139Double_t MPhotonData::GetTheta() const
    111140{
    112     return TMath::ACos(GetCosW());
     141    return TMath::ASin(GetSinW());
    113142}
    114143
     
    186215    {
    187216        // FIXME: Could be done in MPhotonEvent::ReadCorsikaEvent
    188         gLog << err << "ERROR - MPhotonData::FillCorsika: fNummPhotons not 1, but " << fNumPhotons << endl;
     217        gLog << err << "ERROR - MPhotonData::FillCorsika: fNumPhotons not 1, but " << fNumPhotons << endl;
    189218        gLog << "        This is not yet supported." << endl;
    190219        return kERROR;
     
    196225    //fCosU = f[3];  // cos to x
    197226    //fCosV = f[4];  // cos to y
    198     // x=east, y=north
     227    // x=west, y=south
    199228    fPosX =  f[2];  // [cm]
    200229    fPosY = -f[1];  // [cm]
  • trunk/MagicSoft/Mars/msim/MPhotonData.h

    r9332 r9348  
    4949    Float_t fWeight; //! A weight for external use
    5050
    51 protected:
    52     virtual Int_t FillCorsika(Float_t f[7]);
    53     virtual Int_t FillRfl(Float_t f[8]);
    54 
    5551public:
    5652    MPhotonData(/*const char *name=NULL, const char *title=NULL*/);
     
    6460    Float_t  GetCosV()  const { return fCosV; }
    6561    Double_t GetCosW()  const;
     62    Double_t GetSinW()  const;
     63    Double_t GetCosW2()  const;
     64    Double_t GetSinW2()  const;
    6665    Double_t GetTheta() const;
    6766
     
    111110    Int_t GetTag() const { return fTag; }
    112111
     112    // TObject
    113113    //void Clear(Option_t * = NULL);
    114114    void Print(Option_t * = NULL) const;
     
    124124        return 0;
    125125    }
    126 /*
    127     void FillRad(TH1 &hist, Float_t scale=1) const;
    128     void FillRad(TH2 &hist, Double_t x, Float_t scale=1) const;
    129     void Fill(TH2 &hist, Float_t scale=1) const;
    130     void Fill(TH3 &hist, Double_t z, Float_t scale=1) const;
    131  */
     126
     127    // I/O
    132128    Int_t ReadCorsikaEvt(istream &fin);
    133129    Int_t ReadRflEvt(istream &fin);
    134130
     131    Int_t FillCorsika(Float_t f[7]);
     132    Int_t FillRfl(Float_t f[8]);
     133
    135134    ClassDef(MPhotonData, 1) //Container to store a cherenkov photon bunch from a CORSUKA file
    136135};
    137 /*
    138 class MPhotonDataWeighted : public MPhotonData
    139 {
    140 private:
    141     Float_t fWeight; // A weight for external use
    142136
    143 public:
    144     Float_t GetWeight() const { return fWeight; }
    145 
    146     ClassDef(MPhotonData, 1)
    147 };
    148 */
    149137#endif
  • trunk/MagicSoft/Mars/msim/MSimAbsorption.cc

    r9347 r9348  
    264264Bool_t MSimAbsorption::ReInit(MParList *pList)
    265265{
     266    if (fUseTheta)
     267        return kTRUE;
     268
    266269    MCorsikaRunHeader *h = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader");
    267270    if (!h)
Note: See TracChangeset for help on using the changeset viewer.