Changeset 19332 for trunk/Mars/mcorsika
- Timestamp:
- 10/30/18 15:39:36 (6 years ago)
- Location:
- trunk/Mars/mcorsika
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcorsika/MCorsikaRunHeader.cc
r18546 r19332 47 47 // + UInt_t fNumReuse 48 48 // 49 // Class Version 4: 50 // ---------------- 51 // + UInt_t fCerenkovFileOption 52 // + Float_t fEnergyCutoffHadrons 53 // + Float_t fEnergyCutoffMuons 54 // + Float_t fEnergyCutoffElectrons 55 // + Float_t fEnergyCutoffPhotons 56 // + Float_t fThinningEnergyFractionH 57 // + Float_t fThinningEnergyFractionEM 58 // + Float_t fThinningWeightLimitH 59 // + Float_t fThinningWeightLimitEM 60 // + Float_t fThinningMaxRadius 61 // 49 62 //////////////////////////////////////////////////////////////////////////// 50 63 … … 83 96 // Read in one run header from the binary file 84 97 // 85 Bool_t MCorsikaRunHeader::ReadEvt(MCorsikaFormat * fInFormat )86 { 87 Float_t f[272];88 if (!fInFormat->Read(f , 272 * sizeof(Float_t)))98 Bool_t MCorsikaRunHeader::ReadEvt(MCorsikaFormat * fInFormat, const uint32_t &blockLength) 99 { 100 vector<Float_t> f(blockLength); 101 if (!fInFormat->Read(f.data(), blockLength)) 89 102 return kFALSE; 90 103 … … 104 117 105 118 memset(fObsLevel, 0, 10*4); 106 memcpy(fObsLevel, f +4, fNumObsLevel*4);119 memcpy(fObsLevel, f.data()+4, fNumObsLevel*4); 107 120 108 121 fSlopeSpectrum = f[14]; … … 110 123 fEnergyMax = f[16]; 111 124 125 fEnergyCutoffHadrons = f[17]; 126 fEnergyCutoffMuons = f[18]; 127 fEnergyCutoffElectrons = f[19]; 128 fEnergyCutoffPhotons = f[20]; 129 112 130 // Implemented in CORSIKA Version >= 6.822 113 131 fImpactMax = -1; … … 129 147 130 148 // Implemented in CORSIKA Version >= 6.822 131 memcpy(fAtmosphericLayers, f +248, 5*4);132 133 memcpy(fAtmosphericCoeffA, f +253, 5*4);134 memcpy(fAtmosphericCoeffB, f +258, 5*4);135 memcpy(fAtmosphericCoeffC, f +263, 5*4);149 memcpy(fAtmosphericLayers, f.data()+248, 5*4); 150 151 memcpy(fAtmosphericCoeffA, f.data()+253, 5*4); 152 memcpy(fAtmosphericCoeffB, f.data()+258, 5*4); 153 memcpy(fAtmosphericCoeffC, f.data()+263, 5*4); 136 154 137 155 return kTRUE; … … 178 196 // WITH rounding: unbelievable! 179 197 fCerenkovFlag = TMath::Nint(g[75]); 198 fCerenkovFileOption = TMath::Nint(g[90]); 180 199 181 200 fZdMin = g[79]; // lower edge of theta in ° … … 207 226 fWavelengthMax = g[95]; // Cherenkov bandwidth upper end in nm 208 227 228 fThinningEnergyFractionH = g[146]; // EFRCTHN 229 fThinningEnergyFractionEM = g[147]; // EFRCTHN*THINRAT 230 fThinningWeightLimitH = g[148]; // WMAX 231 fThinningWeightLimitEM = g[149]; // WMAX*WEITRAT 232 fThinningMaxRadius = g[150]; // Max radial radius for thinning 233 209 234 fViewConeInnerAngle = g[151]; // inner angle of view cone (°) 210 235 fViewConeOuterAngle = g[152]; // outer angle of view cone (°) … … 285 310 if (fImpactMax>0) 286 311 *fLog << "Max.sim.Impact: " << fImpactMax << "cm" << endl; 312 313 *fLog << "Energy cutoff: "; 314 *fLog << fEnergyCutoffHadrons << "GeV (hadrons), "; 315 *fLog << fEnergyCutoffMuons << "GeV (muons), "; 316 *fLog << fEnergyCutoffElectrons << "GeV (electrons), "; 317 *fLog << fEnergyCutoffPhotons << "GeV (photons)"; 318 *fLog << endl; 319 320 *fLog << "Thinning: "; 321 if (fThinningWeightLimitH>0) 322 { 323 *fLog << "HADRONIC: E/Eth>" << fThinningEnergyFractionH << " (w>" << fThinningWeightLimitH << "), "; 324 *fLog << "EM: E/Eth>" << fThinningEnergyFractionEM << " (w>" << fThinningWeightLimitEM << "), "; 325 *fLog << "R>" << fThinningMaxRadius << "cm"; 326 *fLog << endl; 327 } 328 else 329 *fLog << "<off>" << endl; 287 330 288 331 *fLog << "Options used: "; … … 305 348 *fLog << " [" << hex << fCerenkovFlag << "]" << dec << endl; 306 349 350 if (Has(kCerenkov)) 351 { 352 *fLog << "File format: "; 353 switch (fCerenkovFileOption) 354 { 355 case 0: 356 *fLog << "Cerenkov photons written to DAT-file."; 357 break; 358 case 1: 359 *fLog << "Cerenkov photons written to CER-file"; 360 break; 361 case 2: 362 *fLog << "Cerenkov photons written to CER-file / Wavelength as 8th item in THIN option"; 363 break; 364 default: 365 *fLog << "Cerenkov photons written to CER-file / Prod. height replaced by distance to array center."; 366 break; 367 } 368 *fLog << " [MCERFI=" << fCerenkovFileOption << "]" << endl; 369 } 370 307 371 if (HasLayers()) 308 372 { -
trunk/Mars/mcorsika/MCorsikaRunHeader.h
r19088 r19332 69 69 70 70 UInt_t fCerenkovFlag; 71 UInt_t fCerenkovFileOption; // MCERFI 72 73 Float_t fEnergyCutoffHadrons; // [GeV] 74 Float_t fEnergyCutoffMuons; // [GeV] 75 Float_t fEnergyCutoffElectrons; // [GeV] 76 Float_t fEnergyCutoffPhotons; // [GeV] 77 78 Float_t fThinningEnergyFractionH; // Hadronic energy limit: EFRCTHN 79 Float_t fThinningEnergyFractionEM; // EM energy limit: EFRCTHN*THINRAT 80 Float_t fThinningWeightLimitH; // Hadronic weight limit: WMAX 81 Float_t fThinningWeightLimitEM; // EM weight limit: WMAX*WEITRAT 82 Float_t fThinningMaxRadius; // [cm] Max radial raius for thinning 71 83 72 84 public: … … 110 122 Bool_t Has(CerenkovFlag_t opt) const { return fCerenkovFlag&opt ? 1 : 0; } 111 123 124 UInt_t GetCerenkovFileOption() const { return fCerenkovFileOption; } 125 112 126 static Double_t EarthRadius() { return fgEarthRadius; } 113 127 … … 123 137 124 138 // I/O 125 Bool_t ReadEvt(MCorsikaFormat * fInFormat );139 Bool_t ReadEvt(MCorsikaFormat * fInFormat, const uint32_t &blockLength); 126 140 Bool_t ReadEventHeader(Float_t * g); 127 141 Bool_t ReadEvtEnd(MCorsikaFormat * fInFormat, Bool_t runNumberVerify); … … 130 144 void Print(Option_t *t=NULL) const; 131 145 132 ClassDef(MCorsikaRunHeader, 3) // storage container for general info146 ClassDef(MCorsikaRunHeader, 4) // storage container for general info 133 147 }; 134 148 #endif
Note:
See TracChangeset
for help on using the changeset viewer.