Changeset 9348 for trunk


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9347 r9348  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2009/02/19 Thomas Bretz
     21
     22   * mcorsika/MCorsikaRunHeader.[h,cc]:
     23     - reformatted output
     24     - added "Options" to output
     25     - made Has const
     26
     27   * msim/MHPhotonEvent.cc:
     28     - improved automatic binning
     29
     30   * msim/MPhotonData.[h,cc]:
     31     - added GetCosW2
     32     - added GetSinW2
     33     - added GetSinW
     34
     35   * msim/MSimAbsorption.cc:
     36     - don't check wavelength range when theta should be used
     37
     38
     39
    2040 2009/02/18 Thomas Bretz
    2141
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.cc

    r9347 r9348  
    251251{
    252252    *fLog << all << endl;
    253     *fLog << "Run Number:    " << fRunNumber << "  (" << fRunStart.GetStringFmt("%d.%m.%Y") << ", V" << fProgramVersion << ")" << endl;
    254     *fLog << "Particle ID:   " << MMcEvt::GetParticleName(fParticleID) << endl;
     253    *fLog << "Run Number:     " << fRunNumber << "  (" << fRunStart.GetStringFmt("%d.%m.%Y") << ", V" << fProgramVersion << ")" << endl;
     254    *fLog << "Particle ID:    " << MMcEvt::GetParticleName(fParticleID) << endl;
    255255    if (fNumEvents>0)
    256         *fLog << "Num Events:    " << fNumEvents << endl;
    257     *fLog << "Obs Level:    ";
     256        *fLog << "Num Events:     " << fNumEvents << endl;
     257    *fLog << "Obs Level:     ";
    258258    for (Byte_t i=0; i<fNumObsLevel; i++)
    259259        *fLog << " " << fObsLevel[i]/100. << "m";
    260260    *fLog << endl;
    261261
    262     *fLog << "MagneticField: X/Z=(" << fMagneticFieldX << "/";
     262    *fLog << "MagneticField:  X/Z=(" << fMagneticFieldX << "/";
    263263    *fLog << fMagneticFieldZ << ")  Az=" << fMagneticFieldAz*TMath::RadToDeg() << "deg" << endl;
    264264
    265     *fLog << "Spectrum:      Slope=" << fSlopeSpectrum << "  (" << fEnergyMin << "GeV-" << fEnergyMax << "GeV)" <<  endl;
    266     *fLog << "Wavelength:    " << fWavelengthMin << "nm - " << fWavelengthMax << "nm" << endl;
     265    *fLog << "Spectrum:       Slope=" << fSlopeSpectrum << "  (" << fEnergyMin << "GeV-" << fEnergyMax << "GeV)" <<  endl;
     266    *fLog << "Wavelength:     " << fWavelengthMin << "nm - " << fWavelengthMax << "nm" << endl;
    267267
    268268    if (fViewConeOuterAngle>0)
    269         *fLog << "ViewCone:      " << fViewConeInnerAngle << "deg-" << fViewConeOuterAngle << "deg" << endl;
     269        *fLog << "ViewCone:       " << fViewConeInnerAngle << "deg-" << fViewConeOuterAngle << "deg" << endl;
    270270
    271271    if (fZdMax>=0)
    272272    {
    273         *fLog << "Zd/Az:         " << fZdMin << "deg";
     273        *fLog << "Zd/Az:          " << fZdMin << "deg";
    274274        if (fZdMin==fZdMax)
    275275            *fLog << " (fixed)";
     
    284284    }
    285285
    286     *fLog << "Atm.Coeff A:  ";
     286    *fLog << "Atm.Coeff A:   ";
    287287    for (int i=0; i<5; i++)
    288288        *fLog << " " << fAtmosphericCoeffA[i];
    289289    *fLog << endl;
    290     *fLog << "Atm.Coeff B:  ";
     290    *fLog << "Atm.Coeff B:   ";
    291291    for (int i=0; i<5; i++)
    292292        *fLog << " " << fAtmosphericCoeffB[i];
    293293    *fLog << endl;
    294     *fLog << "Atm.Coeff C:  ";
     294    *fLog << "Atm.Coeff C:   ";
    295295    for (int i=0; i<5; i++)
    296296        *fLog << " " << fAtmosphericCoeffC[i];
    297297    *fLog << endl;
    298 }
    299 
     298
     299    *fLog << "Options used:  ";
     300    if (Has(kCerenkov))
     301        *fLog << " CERENKOV";
     302    if (Has(kIact))
     303        *fLog << " IACT";
     304    if (Has(kCeffic))
     305        *fLog << " CEFFIC";
     306    if (Has(kAtmext))
     307        *fLog << " ATMEXT";
     308    if (Has(kRefraction))
     309        *fLog << " AtmRefraction";
     310    if (Has(kVolumedet))
     311        *fLog << " VOLUMEDET";
     312    if (Has(kCurved))
     313        *fLog << " CURVED";
     314    if (Has(kSlant))
     315        *fLog << " SLANT";
     316    *fLog << endl;
     317}
     318
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h

    r9347 r9348  
    102102    Float_t GetObsLevel(UInt_t i=0) const { return i>9 ? -1 : fObsLevel[i]; }
    103103
    104     Bool_t Has(CerenkovFlag_t opt) { return fCerenkovFlag&opt ? 1 : 0; }
     104    Bool_t Has(CerenkovFlag_t opt) const { return fCerenkovFlag&opt ? 1 : 0; }
    105105
    106106    static Double_t EarthRadius() { return fgEarthRadius; }
  • 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.