Changeset 17148 for trunk/Mars
- Timestamp:
- 09/09/13 12:39:18 (11 years ago)
- Location:
- trunk/Mars
- Files:
-
- 14 edited
- 10 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars
-
Property svn:mergeinfo
set to
/branches/Mars_MC merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Mars/mextralgo/MExtralgoSpline.cc
r14854 r17148 207 207 // at x, until x==0. If y is not found or out of range -2 is returned. 208 208 // 209 Double_t MExtralgoSpline::SearchYdn( Float_t x, Float_t y) const209 Double_t MExtralgoSpline::SearchYdn(Double_t x, Double_t y) const 210 210 { 211 211 if (x>=fNum-1) … … 228 228 // at x, until x==fNum-1. If y is not found or out of range -2 is returned. 229 229 // 230 Double_t MExtralgoSpline::SearchYup( Float_t x, Float_t y) const230 Double_t MExtralgoSpline::SearchYup(Double_t x, Double_t y) const 231 231 { 232 232 if (x<0) -
trunk/Mars/mextralgo/MExtralgoSpline.h
r14854 r17148 347 347 Float_t Deriv1(const Float_t x) const; 348 348 349 Double_t SearchYdn( Float_t maxpos, Float_t y) const;350 Double_t SearchYup( Float_t maxpos, Float_t y) const;349 Double_t SearchYdn(Double_t maxpos, Double_t y) const; 350 Double_t SearchYup(Double_t maxpos, Double_t y) const; 351 351 352 352 Double_t SearchYdn(Float_t y) const { return SearchYdn(fNum, y); } -
trunk/Mars/mfileio/MWriteFitsFile.cc
r15277 r17148 15 15 #include "MWriteFitsFile.h" 16 16 #include "MFitsArray.h" 17 18 #include "MTime.h" 17 19 18 20 //for find … … 337 339 return kTRUE; 338 340 } 341 342 void MWriteFitsFile::SetupHeaderKeys(MRawRunHeader &header) 343 { 344 const MTime now(-1); 345 SetHeaderKey("ISMC",true,"Bool if File is Montecarlo File"); 346 SetHeaderKey("TELESCOP", "FACT", ""); 347 SetHeaderKey("PACKAGE", "MARS Cheobs", ""); 348 SetHeaderKey("VERSION", "1.0", ""); 349 SetHeaderKey("CREATOR", "Ceres", ""); 350 SetHeaderKey("EXTREL", 1., ""); 351 SetHeaderKey("COMPILED", __DATE__" "__TIME__, ""); 352 //SetHeaderKey("REVISION", "0", ""); 353 SetHeaderKey("ORIGIN", "FACT", ""); 354 SetHeaderKey("DATE", now.GetStringFmt("%Y-%m-%dT%H:%M:%S").Data(), ""); 355 SetHeaderKey("NIGHT", now.GetNightAsInt(), ""); 356 SetHeaderKey("TIMESYS", "UTC", ""); 357 SetHeaderKey("TIMEUNIT", "d", ""); 358 SetHeaderKey("MJDREF", 40587, ""); 359 //SetHeaderKey("BLDVER", 1, ""); 360 SetHeaderKey("RUNID", header.GetRunNumber(), ""); 361 SetHeaderKey("NBOARD", 40, ""); 362 SetHeaderKey("NPIX", header.GetNumPixel(), ""); 363 SetHeaderKey("NROI", header.GetNumSamplesHiGain(), ""); 364 SetHeaderKey("NROITM", 0, ""); 365 SetHeaderKey("TMSHIFT", 0, ""); 366 SetHeaderKey("CAMERA", "MGeomCamFACT", "Montecarlo File"); 367 SetHeaderKey("DAQ", "DRS4", "Montecarlo File"); 368 369 // FTemme: ADCRANGE and ADC have to be calculated, using the values for 370 // the fadctype. 371 // SetHeaderKey("ADCRANGE", 2000, "Dynamic range in mV"); 372 // SetHeaderKey("ADC", 12, "Resolution in bits"); 373 374 switch(header.GetRunType()) 375 { 376 case MRawRunHeader::kRTData|MRawRunHeader::kRTMonteCarlo: 377 SetHeaderKey("RUNTYPE", "data", ""); 378 break; 379 case MRawRunHeader::kRTPedestal|MRawRunHeader::kRTMonteCarlo: 380 SetHeaderKey("RUNTYPE", "pedestal", ""); 381 break; 382 case MRawRunHeader::kRTCalibration|MRawRunHeader::kRTMonteCarlo: 383 SetHeaderKey("RUNTYPE", "calibration", ""); 384 break; 385 } 386 // SetHeaderKey("ID", 777, "Board 0: Board ID"); 387 // SetHeaderKey("FMVER", 532, "Board 0: Firmware Version"); 388 // SetHeaderKey("DNA", "0", ""); 389 // SetHeaderKey("BOARD", 0, ""); 390 // SetHeaderKey("PRESC", 40, ""); 391 // SetHeaderKey("PHASE", 0, ""); 392 // SetHeaderKey("DAC0", 26500, ""); 393 // SetHeaderKey("DAC1", 0, ""); 394 // SetHeaderKey("DAC2", 0, ""); 395 // SetHeaderKey("DAC3", 0, ""); 396 // SetHeaderKey("DAC4", 28800, ""); 397 // SetHeaderKey("DAC5", 28800, ""); 398 // SetHeaderKey("DAC6", 28800, ""); 399 // SetHeaderKey("DAC7", 28800, ""); 400 SetHeaderKey("REFCLK", header.GetFreqSampling(), ""); 401 SetHeaderKey("DRSCALIB", false, ""); 402 // SetHeaderKey("TSTARTI", 0, ""); 403 // SetHeaderKey("TSTARTF", 0., ""); 404 // SetHeaderKey("TSTOPI", 0, ""); 405 // SetHeaderKey("TSTOPF", 0., ""); 406 // SetHeaderKey("DATE-OBS", "1970-01-01T00:00:00", ""); 407 // SetHeaderKey("DATE-END", "1970-01-01T00:00:00", ""); 408 // SetHeaderKey("NTRG", 0, ""); 409 // SetHeaderKey("NTRGPED", 0, ""); 410 // SetHeaderKey("NTRGLPE", 0, ""); 411 // SetHeaderKey("NTRGTIM", 0, ""); 412 // SetHeaderKey("NTRGLPI", 0, ""); 413 // SetHeaderKey("NTRGEXT1", 0, ""); 414 // SetHeaderKey("NTRGEXT2", 0, ""); 415 // SetHeaderKey("NTRGMISC", 0, ""); 416 } 417 339 418 template<> 340 419 std::string MWriteFitsFile::GetFitsString(const double& value) … … 1127 1206 return kFALSE; 1128 1207 1208 1209 MRawRunHeader* header = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 1210 SetupHeaderKeys(*header); 1211 1129 1212 if (GetContainer(pList) == kFALSE) 1130 1213 return kFALSE; -
trunk/Mars/mfileio/MWriteFitsFile.h
r15277 r17148 19 19 #include "MFitsArray.h" 20 20 #endif 21 22 #ifndef MARS_MRawRunHeader 23 #include "MRawRunHeader.h" 24 #endif 25 26 class MRawRunHeader; 21 27 22 28 /////////////////////////////////////////////////////////////////////////////// … … 137 143 Int_t PreProcess(MParList *pList); 138 144 Int_t PostProcess(); 145 146 void SetupHeaderKeys(MRawRunHeader &header); 139 147 140 148 //Header keys related stuff -
trunk/Mars/mjobs/MJSimulation.cc
r15277 r17148 260 260 write.AddContainer("IncidentAngle", "Events", kFALSE); 261 261 } 262 263 void MJSimulation::SetupHeaderKeys(MWriteFitsFile &write,MRawRunHeader &header) const 264 { 265 const MTime now(-1); 266 write.SetHeaderKey("ISMC",true,"Bool if File is Montecarlo File"); 267 write.SetHeaderKey("TELESCOP", "FACT", ""); 268 write.SetHeaderKey("PACKAGE", "MARS Cheobs", ""); 269 write.SetHeaderKey("VERSION", "1.0", ""); 270 write.SetHeaderKey("CREATOR", "Ceres", ""); 271 write.SetHeaderKey("EXTREL", 1., ""); 272 write.SetHeaderKey("COMPILED", __DATE__" "__TIME__, ""); 273 write.SetHeaderKey("REVISION", "0", ""); 274 write.SetHeaderKey("ORIGIN", "FACT", ""); 275 write.SetHeaderKey("DATE", now.GetStringFmt("%Y-%m-%dT%H:%M:%S").Data(), ""); 276 write.SetHeaderKey("NIGHT", now.GetNightAsInt(), ""); 277 write.SetHeaderKey("TIMESYS", "UTC", ""); 278 write.SetHeaderKey("TIMEUNIT", "d", ""); 279 write.SetHeaderKey("MJDREF", 40587, ""); 280 //write.SetHeaderKey("BLDVER", 1, ""); 281 write.SetHeaderKey("RUNID", header.GetRunNumber(), ""); 282 write.SetHeaderKey("NBOARD", 40, ""); 283 write.SetHeaderKey("NPIX", header.GetNumPixel(), ""); 284 write.SetHeaderKey("NROI", header.GetNumSamplesHiGain(), ""); 285 write.SetHeaderKey("NROITM", 0, ""); 286 write.SetHeaderKey("TMSHIFT", 0, ""); 287 write.SetHeaderKey("CAMERA", "MGeomCamFACT", ""); 288 write.SetHeaderKey("DAQ", "DRS4", ""); 289 290 // FTemme: ADCRANGE and ADC have to be calculated, using the values for 291 // the fadctype. 292 // write.SetHeaderKey("ADCRANGE", 2000, "Dynamic range in mV"); 293 // write.SetHeaderKey("ADC", 12, "Resolution in bits"); 294 295 switch(header.GetRunType()) 296 { 297 case MRawRunHeader::kRTData|MRawRunHeader::kRTMonteCarlo: 298 write.SetHeaderKey("RUNTYPE", "data", ""); 299 break; 300 case MRawRunHeader::kRTPedestal|MRawRunHeader::kRTMonteCarlo: 301 write.SetHeaderKey("RUNTYPE", "pedestal", ""); 302 break; 303 case MRawRunHeader::kRTCalibration|MRawRunHeader::kRTMonteCarlo: 304 write.SetHeaderKey("RUNTYPE", "calibration", ""); 305 break; 306 } 307 // write.SetHeaderKey("ID", 777, "Board 0: Board ID"); 308 // write.SetHeaderKey("FMVER", 532, "Board 0: Firmware Version"); 309 // write.SetHeaderKey("DNA", "0", ""); 310 // write.SetHeaderKey("BOARD", 0, ""); 311 // write.SetHeaderKey("PRESC", 40, ""); 312 // write.SetHeaderKey("PHASE", 0, ""); 313 // write.SetHeaderKey("DAC0", 26500, ""); 314 // write.SetHeaderKey("DAC1", 0, ""); 315 // write.SetHeaderKey("DAC2", 0, ""); 316 // write.SetHeaderKey("DAC3", 0, ""); 317 // write.SetHeaderKey("DAC4", 28800, ""); 318 // write.SetHeaderKey("DAC5", 28800, ""); 319 // write.SetHeaderKey("DAC6", 28800, ""); 320 // write.SetHeaderKey("DAC7", 28800, ""); 321 write.SetHeaderKey("REFCLK", header.GetFreqSampling(), ""); 322 write.SetHeaderKey("DRSCALIB", false, ""); 323 // write.SetHeaderKey("TSTARTI", 0, ""); 324 // write.SetHeaderKey("TSTARTF", 0., ""); 325 // write.SetHeaderKey("TSTOPI", 0, ""); 326 // write.SetHeaderKey("TSTOPF", 0., ""); 327 // write.SetHeaderKey("DATE-OBS", "1970-01-01T00:00:00", ""); 328 // write.SetHeaderKey("DATE-END", "1970-01-01T00:00:00", ""); 329 // write.SetHeaderKey("NTRG", 0, ""); 330 // write.SetHeaderKey("NTRGPED", 0, ""); 331 // write.SetHeaderKey("NTRGLPE", 0, ""); 332 // write.SetHeaderKey("NTRGTIM", 0, ""); 333 // write.SetHeaderKey("NTRGLPI", 0, ""); 334 // write.SetHeaderKey("NTRGEXT1", 0, ""); 335 // write.SetHeaderKey("NTRGEXT2", 0, ""); 336 // write.SetHeaderKey("NTRGMISC", 0, ""); 337 } 338 339 void MJSimulation::SetupVetoColumns(MWriteFitsFile &write) const 340 { 341 write.VetoColumn("MParameterD.fVal"); 342 write.VetoColumn("MRawEvtData.fLoGainPixId"); 343 write.VetoColumn("MRawEvtData.fLoGainFadcSamples"); 344 write.VetoColumn("MRawEvtData.fABFlags"); 345 write.VetoColumn("MRawEvtHeader.fNumTrigLvl2"); 346 //write.VetoColumn("MRawEvtHeader.fTrigPattern"); 347 write.VetoColumn("MRawEvtHeader.fNumLoGainOn"); 348 } 349 262 350 Bool_t MJSimulation::Process(const MArgs &args, const MSequence &seq) 263 351 { … … 558 646 MTask &write3a = fWriteFitsFile ? static_cast<MTask&>(write3af) : static_cast<MTask&>(write3ar); 559 647 560 write3af.SetHeaderKey("DUMMY0", 3, "First dummy"); 561 write3af.SetHeaderKey("DUMMY1", 3.14159265358979323846, "Second dummy"); 562 write3af.SetHeaderKey("DUMMY2", true, "Third dummy"); 563 write3af.SetHeaderKey("DUMMY3", "one value", "Fourth dummy"); 564 565 write3af.VetoColumn("MParameterD.fVal"); 566 write3af.VetoColumn("MCorsikaEvtHeader.fEvtNumber"); 567 write3af.VetoColumn("MCorsikaEvtHeader.fNumReuse"); 568 write3af.VetoColumn("MCorsikaEvtHeader.fTotalEnergy"); 569 write3af.VetoColumn("MCorsikaEvtHeader.fStartAltitude"); 570 write3af.VetoColumn("MCorsikaEvtHeader.fFirstTargetNum"); 571 write3af.VetoColumn("MCorsikaEvtHeader.fFirstInteractionHeight"); 572 write3af.VetoColumn("MCorsikaEvtHeader.fMomentumX"); 573 write3af.VetoColumn("MCorsikaEvtHeader.fMomentumY"); 574 write3af.VetoColumn("MCorsikaEvtHeader.fMomentumZ"); 575 write3af.VetoColumn("MCorsikaEvtHeader.fAz"); 576 write3af.VetoColumn("MCorsikaEvtHeader.fWeightedNumPhotons"); 577 write3af.VetoColumn("MCorsikaEvtHeader.fZd"); 578 write3af.VetoColumn("MCorsikaEvtHeader.fAd"); 579 write3af.VetoColumn("MCorsikaEvtHeader.fX"); 580 write3af.VetoColumn("MCorsikaEvtHeader.fY"); 581 write3af.VetoColumn("MCorsikaEvtHeader.fWeightNumPhotons"); 582 write3af.VetoColumn("MMcEvt.fEvtNumber"); 583 write3af.VetoColumn("MMcEvt.fThick0"); 584 write3af.VetoColumn("MMcEvt.fFirstTarget"); 585 write3af.VetoColumn("MMcEvt.fZFirstInteraction"); 586 write3af.VetoColumn("MMcEvt.fCoreD"); 587 write3af.VetoColumn("MMcEvt.fCoreX"); 588 write3af.VetoColumn("MMcEvt.fCoreY"); 589 write3af.VetoColumn("MMcEvt.fTimeFirst"); 590 write3af.VetoColumn("MMcEvt.fTimeLast"); 591 write3af.VetoColumn("MMcEvt.fLongiNmax"); 592 write3af.VetoColumn("MMcEvt.fLongit0"); 593 write3af.VetoColumn("MMcEvt.fLongitmax"); 594 write3af.VetoColumn("MMcEvt.fLongia"); 595 write3af.VetoColumn("MMcEvt.fLongib"); 596 write3af.VetoColumn("MMcEvt.fLongic"); 597 write3af.VetoColumn("MMcEvt.fLongichi2"); 598 write3af.VetoColumn("MMcEvt.fPhotIni"); 599 write3af.VetoColumn("MMcEvt.fPassPhotAtm"); 600 write3af.VetoColumn("MMcEvt.fPassPhotRef"); 601 write3af.VetoColumn("MMcEvt.fPassPhotCone"); 602 write3af.VetoColumn("MMcEvt.fPhotElfromShower"); 603 write3af.VetoColumn("MMcEvt.fPhotElinCamera"); 604 write3af.VetoColumn("MMcEvt.fElecCphFraction"); 605 write3af.VetoColumn("MMcEvt.fMuonCphFraction"); 606 write3af.VetoColumn("MMcEvt.fOtherCphFraction"); 607 write3af.VetoColumn("MMcEvt.fFadcTimeJitter"); 608 write3af.VetoColumn("MMcEvt.fEventReuse"); 609 610 write3af.VetoColumn("MRawEvtData.fHiGainPixId"); 611 write3af.VetoColumn("MRawEvtData.fLoGainPixId"); 612 write3af.VetoColumn("MRawEvtData.fLoGainFadcSamples"); 613 write3af.VetoColumn("MRawEvtData.fABFlags"); 614 write3af.VetoColumn("MRawEvtData.fStartCells"); 615 write3af.VetoColumn("MRawEvtData.fNumBytesPerSample"); 616 write3af.VetoColumn("MRawEvtData.fIsSigned"); 617 write3af.VetoColumn("MRawEvtHeader.fDAQEvtNumber"); //EventNum ? 618 write3af.VetoColumn("MRawEvtHeader.fNumTrigLvl1"); 619 write3af.VetoColumn("MRawEvtHeader.fNumTrigLvl2"); 620 write3af.VetoColumn("MRawEvtHeader.fTrigPattern"); 621 write3af.VetoColumn("MRawEvtHeader.fNumLoGainOn"); 648 //SetupHeaderKeys(write3af,header); 649 SetupVetoColumns(write3af); 622 650 623 651 write3af.SetBytesPerSample("Data", 2); … … 649 677 write3af.AddContainer("IntendedPulsePos", "RunHeaders"); 650 678 write3af.AddContainer("MRawEvtData", "Events"); 679 write3af.AddContainer("MMcEvtBasic", "Events"); 680 write3af.AddContainer("MPhotonEvent","Events"); 651 681 652 682 write3ar.AddContainer("ElectronicNoise", "RunHeaders"); -
trunk/Mars/mjobs/MJSimulation.h
r14864 r17148 12 12 class MWriteRootFile; 13 13 class MWriteFitsFile; 14 class MRawRunHeader; 14 15 15 16 class MJSimulation : public MJob … … 34 35 void SetupCommonFileStructure(MWriteRootFile &write) const; 35 36 void SetupCommonFileStructure(MWriteFitsFile& write) const; 37 void SetupHeaderKeys(MWriteFitsFile& write, MRawRunHeader &header) const; 38 void SetupVetoColumns(MWriteFitsFile& write) const; 36 39 37 40 public: -
trunk/Mars/mmc/MMcEvt.hxx
r9937 r17148 10 10 { 11 11 private: 12 UInt_t fEvtNumber; 12 UInt_t fEvtNumber; // [fits: name=EventNum ; unit=uint32] 13 13 Float_t fThick0; // [g/cm2] 14 14 Float_t fFirstTarget; // [] -
trunk/Mars/mraw/MRawEvtData.cc
r11870 r17148 114 114 // 115 115 MRawEvtData::MRawEvtData(const char *name, const char *title) 116 : fRunHeader(0), fNumBytesPerSample(1), f IsSigned(false)116 : fRunHeader(0), fNumBytesPerSample(1), fTriggerType(0), fIsSigned(false) 117 117 { 118 118 fName = name ? name : "MRawEvtData"; … … 359 359 360 360 fNumBytesPerSample = fRunHeader ? fRunHeader->GetNumBytesPerSample() : 1; 361 362 363 if (fRunHeader == 0) 364 { 365 fTriggerType = 0x0000; 366 } 367 else 368 { 369 switch(fRunHeader->GetRunType()) 370 { 371 case MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTData: 372 fTriggerType = 0x0004; break; 373 case MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPedestal: 374 fTriggerType = 0x0400; break; 375 case MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTCalibration: 376 fTriggerType = 0x0164; break; 377 default: 378 fTriggerType = 0x0000; break; 379 } 380 } 361 381 362 382 fHiGainPixId = new MArrayS(numconnected); -
trunk/Mars/mraw/MRawEvtData.h
r14870 r17148 12 12 //class ifstream; 13 13 #include <iosfwd> 14 #include <stdint.h> 14 15 15 16 class MRawRunHeader; … … 36 37 37 38 MArrayB *fABFlags; //-> A information about the exact trigger position 38 MArrayS *fStartCells; // 39 MArrayS *fStartCells; // {fits: unit=uint16 ; name=StartCellData } 40 41 UShort_t fTriggerType; // {fits: unit=uint16 ; name=TriggerType } 39 42 40 43 UShort_t fNumBytesPerSample; -
trunk/Mars/mraw/MRawEvtHeader.h
r14792 r17148 53 53 MTime *fTime; //! object to store the time in (ReadEvt) 54 54 55 UInt_t fDAQEvtNumber; // Number of Event [fits: name=EventNum]55 UInt_t fDAQEvtNumber; // Number of Event {fits: name=EventNum ; unit=uint32} 56 56 57 57 UInt_t fNumTrigLvl1; // Number of 1st level tiggers between 2 events -
trunk/Mars/msimcamera/MSimCamera.cc
r10167 r17148 43 43 #include <TF1.h> 44 44 #include <TRandom.h> 45 #include <TRandom3.h> 45 46 46 47 #include "MLog.h" … … 63 64 #include "MMcEvt.hxx" // To be replaced by a CheObs class 64 65 #include "MRawRunHeader.h" 66 67 #include "math.h" 65 68 66 69 ClassImp(MSimCamera); … … 75 78 : fEvt(0), fStat(0), fRunHeader(0), fElectronicNoise(0), fGain(0), 76 79 fCamera(0), fMcEvt(0), fSpline(0), fBaselineGain(kFALSE), 77 fDefaultOffset(-1), fDefaultNoise(-1), fDefaultGain(-1) 80 fDefaultOffset(-1), fDefaultNoise(-1), fDefaultGain(-1), fACFudgeFactor(0), 81 fACTimeConstant(0) 78 82 79 83 { … … 135 139 return kFALSE; 136 140 141 fAccidentalPhotons = (MPedestalCam*)pList->FindObject("AccidentalPhotonRates","MPedestalCam"); 142 if(!fAccidentalPhotons) 143 { 144 *fLog << err << "AccidentalPhotonRates [MPedestalCam] not found... aborting." << endl; 145 return kFALSE; 146 } 147 137 148 MParSpline *pulse = (MParSpline*)pList->FindObject("PulseShape", "MParSpline"); 138 149 if (!pulse) … … 142 153 } 143 154 144 if (fRunHeader->GetFreqSampling()!=1000)145 {146 *fLog << err << "ERROR - Sampling frequencies others than 1GHz are not yet supported." << endl;147 *fLog << warn << "FIXME - SCALE MPulsShape WITH THE SAMPLING FREQUENCY." << endl;148 return kFALSE;149 }155 // if (fRunHeader->GetFreqSampling()!=1000) 156 // { 157 // *fLog << err << "ERROR - Sampling frequencies others than 1GHz are not yet supported." << endl; 158 // *fLog << warn << "FIXME - SCALE MPulsShape WITH THE SAMPLING FREQUENCY." << endl; 159 // return kFALSE; 160 // } 150 161 151 162 fSpline = pulse->GetSpline(); … … 238 249 const Double_t rms = pix.GetPedestalRms(); 239 250 251 // FTemme: Implementation of AC-coupling: 252 // to calculate the value of the accoupling per slice I use the 253 // following equation: 254 // accouplingPerSlice = accidentalPhotonRate * (1 + crossTalkProb) 255 // * areaOfOnePulse / samplingRate; 256 // Therefore I need the following variables 257 Double_t accidentalPhotonRate = 0; // [MHz] 258 Float_t crossTalkProb = 0; // [1] 259 Double_t areaOfOnePulse = 0; // [ADC-Counts * s] 260 Double_t samplingRate = 0; // [slices * MHz] 261 262 // The accidental photon rate is stored in GHz, so we have to multiply 263 // with 1E3 to get MHz: 264 MPedestalPix &accPhoPix = (*fAccidentalPhotons)[i]; 265 accidentalPhotonRate = accPhoPix.GetPedestal() * 1E3; 266 Double_t currentAccidentalPhotonRate = accidentalPhotonRate; 267 268 if(fACTimeConstant!=0) 269 { 270 Double_t accidentalPhotons = fACTimeConstant * accidentalPhotonRate; 271 Double_t sigmaAccidentalPhotons = sqrt(accidentalPhotons); 272 273 TRandom3 *random = new TRandom3(0); 274 Double_t gaus = random->Gaus(accidentalPhotons,sigmaAccidentalPhotons); 275 currentAccidentalPhotonRate = gaus / fACTimeConstant; 276 } 277 278 // I don't know how to get the variable fCrosstalkProb from 279 // the class APD (see MAvalanchePhotoDiode.h), because there is no 280 // getter for the APD array(fAPDs) in MSimAPD. 281 // So I set the crossTalkProb hardcoded to the value 0.15, which is 282 // equal to the value of the apd of type 4 283 crossTalkProb = 0.15; 284 285 // To get the area of one Pulse, I only need to calculate the Integral 286 // of the Pulse Shape, which is stored in fSpline. Because the spline is 287 // normalized to a maximal amplitude of 1.0, I had to multiply it with 288 // the Default gain: 289 areaOfOnePulse = fSpline->Integral() * fDefaultGain; 290 291 // The sampling rate I get from the RunHeader: 292 samplingRate = fRunHeader->GetFreqSampling(); 293 294 Double_t accouplingPerSlice = currentAccidentalPhotonRate 295 * (1 + crossTalkProb + fACFudgeFactor) 296 * areaOfOnePulse / samplingRate; 297 298 // The accoupling is substracted from the timeline by decreasing the 299 // mean of the gaussian noise which is added 300 240 301 if (!fBaselineGain) 241 302 { 242 (*fCamera)[i].AddGaussianNoise(rms, val );303 (*fCamera)[i].AddGaussianNoise(rms, val - accouplingPerSlice); 243 304 continue; 244 305 } … … 250 311 // FIXME: How stable is the offset? 251 312 // FIXME: Should we write a container AppliedGain for MSImTrigger? 252 (*fCamera)[i].AddGaussianNoise(rms*gain, val*gain); 313 314 (*fCamera)[i].AddGaussianNoise(rms*gain, (val - accouplingPerSlice)*gain); 253 315 } 254 316 … … 323 385 fDefaultGain = GetEnvValue(env, prefix, "DefaultGain", fDefaultGain); 324 386 } 387 if (IsEnvDefined(env, prefix, "fACFudgeFactor", print)) 388 { 389 rc = kTRUE; 390 fACFudgeFactor = GetEnvValue(env, prefix, "fACFudgeFactor", fACFudgeFactor); 391 } 392 if (IsEnvDefined(env, prefix, "fACTimeConstant", print)) 393 { 394 rc = kTRUE; 395 fACTimeConstant = GetEnvValue(env, prefix, "fACTimeConstant", fACTimeConstant); 396 } 325 397 326 398 return rc; -
trunk/Mars/msimcamera/MSimCamera.h
r9625 r17148 24 24 MPedestalCam *fElectronicNoise; //! Electronic noise (baseline and rms) 25 25 MPedestalCam *fGain; //! Electronic noise (baseline and rms) 26 MPedestalCam *fAccidentalPhotons;//! Accidental photon rates 26 27 27 28 MAnalogChannels *fCamera; //! Output of the analog signals 28 29 MMcEvt *fMcEvt; //! For information stored in MMcEvt 29 30 30 const MSpline3 *fSpline; // Pulse Shape 31 const MSpline3 *fSpline; // Pulse Shape 31 32 32 33 Bool_t fBaselineGain; // Should the gain be applied to baseline and electronic noise? … … 35 36 Double_t fDefaultNoise; // Default noise (RMS) added to all samples 36 37 Double_t fDefaultGain; // Default gain (multiplication factor to the given/used pulse shape) 38 39 Double_t fACFudgeFactor; 40 41 Double_t fACTimeConstant; 37 42 38 43 // MParContainer -
trunk/Mars/msimcamera/MSimReadout.cc
r9422 r17148 145 145 fData->InitRead(fRunHeader); 146 146 fData->ResetPixels(); 147 fData->InitStartCells(); 147 148 fData->SetIndices(); 148 149 … … 202 203 203 204 // Check if the whole requested signal can be digitized 204 if (trig+nslices> =nsamp)205 if (trig+nslices>nsamp) 205 206 { 206 207 *fLog << err << "ERROR - Trigger position beyond valid analog signal range." << endl;
Note:
See TracChangeset
for help on using the changeset viewer.