Changeset 18549 for trunk


Ignore:
Timestamp:
08/26/16 13:03:45 (8 years ago)
Author:
tbretz
Message:
The wavelength is now kept as a negative value so that it can be checked on the photon level if CEFFIC was turned on. It is however returned without sign for convenience. The loop to simulate the wavelength is only executed if the first photon has a zero wavelength -- it is assumed they are all consistent.
Location:
trunk/Mars/msim
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/msim/MPhotonData.cc

    r18545 r18549  
    177177void MPhotonData::SimWavelength(Float_t wmin, Float_t wmax)
    178178{
    179     if (fWavelength>0)
    180         return;
    181 
    182179    const Double_t w = gRandom->Uniform(wmin, wmax);
    183180
     
    288285    fTime             =  f[4]/10.;              // a relative arival time [ns]
    289286    fProductionHeight =  pow(10, f[5]/1000.);   // altitude of emission a.s.l. [cm]
    290     fWavelength       =  TMath::Abs(f[7]);      // wavelength [nm]: 0 undetermined, <0 already in p.e.
     287    fWavelength       =  f[7];                  // wavelength [nm]: 0 undetermined, <0 already in p.e.
    291288
    292289    // Now reset all data members which are not in the stream
     
    370367//    gLog << "Num Photons:      " << fNumPhotons << " from " << MMcEvtBasic::GetParticleName(fPrimary) << endl;
    371368    gLog << "Origin:           " << MMcEvtBasic::GetParticleName(fPrimary) << endl;
    372     gLog << "Wavelength:       " << dec << fWavelength << "nm" << endl;
     369    gLog << "Wavelength:       " << fWavelength << "nm" << endl;
    373370    gLog << "Pos X/Y  Cos U/V: " << fPosX << "/" << fPosY << "   " << fCosU << "/" << fCosV << endl;
    374371    gLog << "Time/Prod.Height: " << fTime << "ns/" << fProductionHeight/100 << "m" << endl;
  • trunk/Mars/msim/MPhotonData.h

    r18540 r18549  
    3737
    3838    Float_t fTime;                       // [ns] Time since first interaction or entrance into atmosphere
    39     UShort_t fWavelength;                // [nm] Wavelength
     39    Short_t fWavelength;                 // [nm] Wavelength
    4040//    UInt_t   fNumPhotons;                // Number of cherenkov photons ins bunch
    4141    Float_t  fProductionHeight;          // [cm] Height of bunch production
     
    7878
    7979    // Getter Others
    80     UShort_t GetWavelength() const { return fWavelength; }
     80    UShort_t GetWavelength() const { return TMath::Abs(fWavelength); }
    8181    Float_t GetProductionHeight() const { return fProductionHeight; }
    8282    MMcEvtBasic::ParticleId_t GetPrimary() const { return fPrimary; }
     83
     84    // Status of the simulation of photons
     85    Bool_t IncludesEfficiencies() const { return fWavelength<0; }
    8386
    8487    //virtual Float_t GetWeight() const { return 1; }
     
    97100
    98101    void SetPrimary(MMcEvtBasic::ParticleId_t p) { fPrimary=p; }
    99     void SetWavelength(UShort_t wl) { fWavelength=wl; }
     102    void SetWavelength(Short_t wl) { fWavelength=wl; }
    100103
    101104    void AddTime(Double_t dt) { fTime += dt; }
  • trunk/Mars/msim/MPhotonEvent.cc

    r18541 r18549  
    550550{
    551551    const UInt_t n = GetNumPhotons();
     552    if (n==0)
     553        return;
     554
     555    // Corsika has already produced and written the wavelength
     556    if (operator[](0).GetWavelength()>0)
     557        return;
    552558
    553559    for (UInt_t i=0; i<n; i++)
Note: See TracChangeset for help on using the changeset viewer.