Changeset 9941 for trunk/Mars/msim
- Timestamp:
- 09/24/10 15:35:55 (14 years ago)
- Location:
- trunk/Mars/msim
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msim/MPhotonData.cc
r9937 r9941 47 47 48 48 #include <TMath.h> 49 #include <TRandom.h> 49 50 50 51 #include "MLog.h" … … 171 172 // -------------------------------------------------------------------------- 172 173 // 174 // Set the wavelength to a random lambda^-2 distributed value 175 // between wmin and wmax. 176 // 177 void MPhotonData::SimWavelength(Float_t wmin, Float_t wmax) 178 { 179 const Double_t w = gRandom->Uniform(wmin, wmax); 180 181 fWavelength = TMath::Nint(wmin*wmax / w); 182 } 183 184 185 // -------------------------------------------------------------------------- 186 // 173 187 // Set the data member according to the 8 floats read from a reflector-file. 174 188 // This function MUST reset all data-members, no matter whether these are … … 255 269 Int_t MPhotonData::FillEventIO(Float_t f[8]) 256 270 { 257 if (TMath::Nint(f[6])!=1) 258 { 259 gLog << err << "ERROR - Bunch sizes != 1 are not supported." << endl; 260 return kFALSE; 261 } 271 // photons in this bunch 272 const UInt_t n = TMath::Nint(f[6]); 273 if (n==0) 274 return 0; 275 276 f[6] = n-1; 262 277 263 278 fPosX = f[1]; // xpos relative to telescope [cm] … … 267 282 fTime = f[4]; // a relative arival time [ns] 268 283 fProductionHeight = f[5]; // altitude of emission [cm] 269 // fNumPhotons = TMath::Nint(f[6]); // photons in this bunch270 284 fWavelength = TMath::Nint(f[7]); // so far always zeor = unspec. [nm] 271 285 … … 275 289 fWeight = 1; 276 290 277 return kTRUE; 278 } 291 return n; 292 } 293 279 294 /* 280 295 // -------------------------------------------------------------------------- -
trunk/Mars/msim/MPhotonData.h
r9937 r9941 101 101 void SetTime(Double_t t) { fTime = t; } 102 102 103 void SimWavelength(Float_t wmin, Float_t wmax); 104 103 105 void Copy(TObject &obj) const; 104 106 -
trunk/Mars/msim/MPhotonEvent.h
r9937 r9941 39 39 Double_t GetMeanX() const; 40 40 Double_t GetMeanY() const; 41 Double_t GetMeanT() const; 41 42 42 43 TClonesArray &GetArray() { return fData; } … … 54 55 Int_t Shrink(Int_t n); 55 56 void Resize(Int_t n); 57 58 void AddXY(Double_t x, Double_t y); 59 void SimWavelength(Float_t wmin, Float_t wmax); 56 60 57 61 // I/O
Note:
See TracChangeset
for help on using the changeset viewer.