- Timestamp:
- 02/19/09 15:38:48 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9347 r9348 18 18 19 19 -*-*- 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 20 40 2009/02/18 Thomas Bretz 21 41 -
trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.cc
r9347 r9348 251 251 { 252 252 *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; 255 255 if (fNumEvents>0) 256 *fLog << "Num Events: " << fNumEvents << endl;257 *fLog << "Obs Level: ";256 *fLog << "Num Events: " << fNumEvents << endl; 257 *fLog << "Obs Level: "; 258 258 for (Byte_t i=0; i<fNumObsLevel; i++) 259 259 *fLog << " " << fObsLevel[i]/100. << "m"; 260 260 *fLog << endl; 261 261 262 *fLog << "MagneticField: X/Z=(" << fMagneticFieldX << "/";262 *fLog << "MagneticField: X/Z=(" << fMagneticFieldX << "/"; 263 263 *fLog << fMagneticFieldZ << ") Az=" << fMagneticFieldAz*TMath::RadToDeg() << "deg" << endl; 264 264 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; 267 267 268 268 if (fViewConeOuterAngle>0) 269 *fLog << "ViewCone: " << fViewConeInnerAngle << "deg-" << fViewConeOuterAngle << "deg" << endl;269 *fLog << "ViewCone: " << fViewConeInnerAngle << "deg-" << fViewConeOuterAngle << "deg" << endl; 270 270 271 271 if (fZdMax>=0) 272 272 { 273 *fLog << "Zd/Az: " << fZdMin << "deg";273 *fLog << "Zd/Az: " << fZdMin << "deg"; 274 274 if (fZdMin==fZdMax) 275 275 *fLog << " (fixed)"; … … 284 284 } 285 285 286 *fLog << "Atm.Coeff A: ";286 *fLog << "Atm.Coeff A: "; 287 287 for (int i=0; i<5; i++) 288 288 *fLog << " " << fAtmosphericCoeffA[i]; 289 289 *fLog << endl; 290 *fLog << "Atm.Coeff B: ";290 *fLog << "Atm.Coeff B: "; 291 291 for (int i=0; i<5; i++) 292 292 *fLog << " " << fAtmosphericCoeffB[i]; 293 293 *fLog << endl; 294 *fLog << "Atm.Coeff C: ";294 *fLog << "Atm.Coeff C: "; 295 295 for (int i=0; i<5; i++) 296 296 *fLog << " " << fAtmosphericCoeffC[i]; 297 297 *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 102 102 Float_t GetObsLevel(UInt_t i=0) const { return i>9 ? -1 : fObsLevel[i]; } 103 103 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; } 105 105 106 106 static Double_t EarthRadius() { return fgEarthRadius; } -
trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc
r9347 r9348 258 258 */ 259 259 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, k FALSE);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); 269 269 270 270 return kTRUE; -
trunk/MagicSoft/Mars/msim/MPhotonData.cc
r9285 r9348 30 30 // Storage container to store Corsika events 31 31 // 32 // For details on the coordinate systems see our Wiki. 33 // 32 34 // Version 1: 33 35 // ---------- … … 97 99 // -------------------------------------------------------------------------- 98 100 // 101 // Return the square cosine of the Theta-angle == 1-CosU^2-CosV^2 102 // 103 Double_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 // 112 Double_t MPhotonData::GetSinW2() const 113 { 114 return fCosU*fCosU + fCosV*fCosV; 115 } 116 117 // -------------------------------------------------------------------------- 118 // 99 119 // return the cosine of the Theta-angle == sqrt(1-CosU^2-CosV^2) 100 120 // 101 121 Double_t MPhotonData::GetCosW() const 102 122 { 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 // 130 Double_t MPhotonData::GetSinW() const 131 { 132 return TMath::Sqrt(GetSinW2()); 104 133 } 105 134 … … 110 139 Double_t MPhotonData::GetTheta() const 111 140 { 112 return TMath::A Cos(GetCosW());141 return TMath::ASin(GetSinW()); 113 142 } 114 143 … … 186 215 { 187 216 // FIXME: Could be done in MPhotonEvent::ReadCorsikaEvent 188 gLog << err << "ERROR - MPhotonData::FillCorsika: fNum mPhotons not 1, but " << fNumPhotons << endl;217 gLog << err << "ERROR - MPhotonData::FillCorsika: fNumPhotons not 1, but " << fNumPhotons << endl; 189 218 gLog << " This is not yet supported." << endl; 190 219 return kERROR; … … 196 225 //fCosU = f[3]; // cos to x 197 226 //fCosV = f[4]; // cos to y 198 // x= east, y=north227 // x=west, y=south 199 228 fPosX = f[2]; // [cm] 200 229 fPosY = -f[1]; // [cm] -
trunk/MagicSoft/Mars/msim/MPhotonData.h
r9332 r9348 49 49 Float_t fWeight; //! A weight for external use 50 50 51 protected:52 virtual Int_t FillCorsika(Float_t f[7]);53 virtual Int_t FillRfl(Float_t f[8]);54 55 51 public: 56 52 MPhotonData(/*const char *name=NULL, const char *title=NULL*/); … … 64 60 Float_t GetCosV() const { return fCosV; } 65 61 Double_t GetCosW() const; 62 Double_t GetSinW() const; 63 Double_t GetCosW2() const; 64 Double_t GetSinW2() const; 66 65 Double_t GetTheta() const; 67 66 … … 111 110 Int_t GetTag() const { return fTag; } 112 111 112 // TObject 113 113 //void Clear(Option_t * = NULL); 114 114 void Print(Option_t * = NULL) const; … … 124 124 return 0; 125 125 } 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 132 128 Int_t ReadCorsikaEvt(istream &fin); 133 129 Int_t ReadRflEvt(istream &fin); 134 130 131 Int_t FillCorsika(Float_t f[7]); 132 Int_t FillRfl(Float_t f[8]); 133 135 134 ClassDef(MPhotonData, 1) //Container to store a cherenkov photon bunch from a CORSUKA file 136 135 }; 137 /*138 class MPhotonDataWeighted : public MPhotonData139 {140 private:141 Float_t fWeight; // A weight for external use142 136 143 public:144 Float_t GetWeight() const { return fWeight; }145 146 ClassDef(MPhotonData, 1)147 };148 */149 137 #endif -
trunk/MagicSoft/Mars/msim/MSimAbsorption.cc
r9347 r9348 264 264 Bool_t MSimAbsorption::ReInit(MParList *pList) 265 265 { 266 if (fUseTheta) 267 return kTRUE; 268 266 269 MCorsikaRunHeader *h = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader"); 267 270 if (!h)
Note:
See TracChangeset
for help on using the changeset viewer.