Changeset 9308 for trunk/MagicSoft
- Timestamp:
- 02/09/09 11:30:54 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9303 r9308 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2009/02/08 Thomas Bretz 22 23 * Makefile.conf.linux: 24 - added -Winit-self 25 26 * msimcamera/MSimCalibrationSignal.[h,cc]: 27 - account for the pulse shape/width 28 - make number of photons settable 29 - make time jitter settable 30 - renamned fNumEntries to fNumEvents 31 - don't set daq event number (should be set by the "daq") 32 - set trigger pattern 33 - print number of events in PreProcess 34 35 * msimreflector/MSimReflector.[h,cc]: 36 - made the detector margin settable 37 38 * datacenter/macros/insertcacofile.C, datacenter/macros/insertsequence.C: 39 - print an error and exit 40 41 * macros/optim/optimdisp.C: 42 - set the default values as default 43 - added a short summary what a good strategy for optimization is 44 45 * mastro/MAstro.cc: 46 - replaced Form by MString::Form 47 48 * mcorsika/MCorsikaEvtHeader.[h,cc], mcorsika/MCorsikaRunHeader.[h,cc]: 49 - moved fParticleID from event header to run header 50 - increased Class Version accordingly 51 - added an error if more than one observation levels are read 52 53 * mhcalib/MHGausEvents.cc: 54 - replaced Form by MString::Form 55 - handle the creating of the TF1 fExpFit a bit more "root-safe" 56 57 * mhist/MHCamEvent.[h,cc]: 58 - added a new option to collect the maximum or minimum contents 59 60 * mhist/MHCamera.[h,cc]: 61 - added new functions SetMax/MinCamContent 62 63 * mraw/MRawEvtHeader.cc: 64 - initialize the data members in constructor 65 66 * mraw/MRawEvtHeader.h: 67 - removed bits for trigger type they were never used 68 69 * mraw/MRawRunHeader.cc: 70 - tiny cosmetics 71 72 * msim/MHPhotonEvent.[h,cc]: 73 - added a histogram to display the height 74 - don't fill kNightSky photons 75 76 * msim/MPhotonData.h: 77 - added getter for fProductionHeight 78 79 * msim/MPhotonEvent.h: 80 - commented IsValid (was not used anyhow) 81 82 * msimcamera/MSimGeomCam.[h,cc]: 83 - added one sample to the window to allow for time jitter of one sample 84 - make the code for the window indentical to MSimCalibrationSignal 85 86 * msimcamera/MSimReadout.[h,cc]: 87 - Set the daq event number (readout number) 88 89 * msimcamera/MSimTrigger.[h,cc]: 90 - added comments 91 - made the signal length settable 92 - made the coincidence time settable 93 - removed setting of the daq event number (should be done by the "daq") 94 - changed the trigger output from all to inf/inf2 95 96 * msimcamera/Makefile: 97 - added -I../mtrigger 98 99 100 101 20 102 21 103 2009/02/07 Thomas Bretz -
trunk/MagicSoft/Mars/NEWS
r9296 r9308 3 3 == <cvs> == 4 4 5 ;merpp 6 7 * added support for Arehucas Version >= 200812140 5 ;general 6 7 * fixed a few small bugs which could cause the display to crash in ganymed 8 and sponde 8 9 9 10 ;database … … 12 13 to set size of plot 13 14 15 ;merpp 16 17 * added support for Arehucas Version >= 200812140 18 19 ;ceres 20 21 * added a uniformly distributed one-bin time jitter for the start of the 22 digitization. Otherwise the first photon would be digitized always with 23 the same alignment to the bins 24 25 * Added a plot showing the production height of the photons 26 27 * Moved the particle id from the event header to the run header 28 29 * Added the possibility to simulate a psf on the camera plane (MSimPSF) 30 31 * Added a new plot ''SignalMax'' showing the maximum entry into the pixels 32 33 * Added many new options to control the tasks. For deatils see ''ceres.rc'' 34 35 * Removed obsolete plots in pedestal and calibration mode 36 37 * Removed the non-NightSky photons from the plots where they are just 38 disturbing 39 40 * Added a trigger pattern to the output (Ped, Cal or Lvl1) 41 42 * The daq event number now represents the readout number 14 43 15 44 -
trunk/MagicSoft/Mars/datacenter/macros/insertcacofile.C
r8996 r9308 68 68 int insertcacofile(TString runnumber, TString newrunnumber) 69 69 { 70 cout << "ERROR - TelescopeNumber and FileNumber not implemeted." << endl; 71 return 2; 72 /* 70 73 MSQLServer serv("sql.rc"); 71 74 if (!serv.IsConnected()) … … 96 99 delete res; 97 100 return 1; 101 */ 98 102 } 99 100 -
trunk/MagicSoft/Mars/datacenter/macros/insertsequence.C
r8108 r9308 60 60 int insertsequence(TString filename, Bool_t dummy=kTRUE) 61 61 { 62 cout << "ERROR - TelescopeNumber and FileNumber not implemeted." << endl; 63 return 2; 64 /* 62 65 TEnv env("sql.rc"); 63 66 TEnv sequ(filename); … … 220 223 221 224 return 1; 225 */ 222 226 } 223 227 -
trunk/MagicSoft/Mars/macros/optim/optimdisp.C
r8656 r9308 18 18 char *r = "M[0]*([0] + [1]*M[1] + [2]*M[2] + (M[3]>[3])*[4]*(M[3]-[3])^2)"; 19 19 20 opt.FixParameter(0, 1. 266195);21 opt.FixParameter(1, 0. 100577);22 opt.FixParameter(2, 1.80309);23 opt.FixParameter(3, 2.87177);24 opt.FixParameter(4, 0. 616823);20 opt.FixParameter(0, 1.15136); 21 opt.FixParameter(1, 0.0681437); 22 opt.FixParameter(2, 2.62932); 23 opt.FixParameter(3, 1.51279); 24 opt.FixParameter(4, 0.0507821); 25 25 26 26 opt.AddPreCut("MNewImagePar.fLeakage1>0"); 27 opt.AddPreCut("log10(MHillas.fSize)<3.2"); 27 //opt.AddPreCut("log10(MHillas.fSize)<2.5"); //3.2 28 29 opt.AddPreCut("MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*MGeomCam.fConvMm2Deg>-0.07"); 30 opt.AddPreCut("DataType.fVal>0.5"); 28 31 29 32 //opt.AddPreCut("abs(MHillasSrc.fDCA*MGeomCam.fConvMm2Deg)<0.2"); 30 33 //opt.AddPreCut("(MHillasSrc.fDist*MGeomCam.fConvMm2Deg-0.5)*7.2>MHillasExt.fSlopeLong*sign(MHillasSrc.fCosDeltaAlpha)/MGeomCam.fConvMm2Deg"); 31 opt.AddPreCut("MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*MGeomCam.fConvMm2Deg>-0.07");32 opt.AddPreCut("DataType.fVal>0.5");33 34 34 35 // -------------------- Run ---------------------------- … … 66 67 */ 67 68 69 // opt.SetPathOut("optimdisp.root"); 68 70 opt.RunDisp("ganymed00000001-summary.root", r); 69 71 } … … 73 75 Par | 0 1 2 3 4 | Cut 74 76 -------+---------------------------------+----------------------- 75 Fit 1 | 1.3 0. 8fix=0 fix=0 fix=0 | Leak1==0 lgSize<2.576 Fit 2 | fix fix fix=0 2. 4 0.3| Leak1==077 Fit 1 | 1.3 0.1 fix=0 fix=0 fix=0 | Leak1==0 lgSize<2.5 78 Fit 2 | fix fix fix=0 2.5 0.2 | Leak1==0 77 79 Fit 2 | fix fix 1.8 fix fix | Leak1>0 78 80 Fit 3 | free free fix fix fix | -/- 81 Fit 4 | fix fix fix free free | -/- 82 Fit 5 | fix fix free fix fix | -/- 79 83 -------+---------------------------------+----------------------- 80 84 */ -
trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.cc
r9252 r9308 26 26 // 27 27 // MCorsikaEvtHeader 28 // 28 // 29 // Class Version 2: 30 // ---------------- 31 // - UInt_t fParticleID 32 // 33 // 29 34 ///////////////////////////////////////////////////////////////////////////// 30 35 #include "MCorsikaEvtHeader.h" … … 38 43 #include "MLogManip.h" 39 44 40 #include "MMcEvt.hxx"45 //#include "MMcEvt.hxx" 41 46 42 47 ClassImp(MCorsikaEvtHeader); … … 71 76 *fLog << all; 72 77 *fLog << "Event Number: " << dec << fEvtNumber << endl; 73 *fLog << "Particle ID: " << MMcEvt::GetParticleName(fParticleID) << endl;78 // *fLog << "Particle ID: " << MMcEvt::GetParticleName(fParticleID) << endl; 74 79 *fLog << "Energy: " << fTotalEnergy << "GeV" << endl; 75 80 *fLog << "Starting Altitude: " << fStartAltitude << "g/cm²" << endl; … … 102 107 103 108 fEvtNumber = TMath::Nint(f[0]); 104 fParticleID = TMath::Nint(f[1]);109 // fParticleID = TMath::Nint(f[1]); 105 110 106 111 fTotalEnergy = f[2]; -
trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.h
r9292 r9308 18 18 private: 19 19 UInt_t fEvtNumber; // Event number 20 UInt_t fParticleID; // Particle ID (see MMcEvtBasic or CORSIKA manual)20 // UInt_t fParticleID; // Particle ID (see MMcEvtBasic or CORSIKA manual) 21 21 Float_t fTotalEnergy; // [GeV] 22 22 … … 44 44 45 45 UInt_t GetEvtNumber() const { return fEvtNumber; } 46 UInt_t GetParticleID() const { return fParticleID; }46 // UInt_t GetParticleID() const { return fParticleID; } 47 47 48 48 TVector3 GetMomentum() const { return TVector3(fMomentumX, fMomentumY, fMomentumZ); } -
trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.cc
r9229 r9308 30 30 // Root storage container for the RUN HEADER information 31 31 // 32 // Class Version 2: 33 // ---------------- 34 // + UInt_t fParticleID 35 // 32 36 //////////////////////////////////////////////////////////////////////////// 33 37 … … 39 43 #include "MLog.h" 40 44 #include "MLogManip.h" 45 46 #include "MMcEvt.hxx" 41 47 42 48 ClassImp(MCorsikaRunHeader); … … 81 87 fProgramVersion = f[2]; //FIXME: INT??? 82 88 fNumObsLevel = TMath::Nint(f[3]); 89 90 if (fNumObsLevel!=1) 91 { 92 *fLog << err << "ERROR - Currently only one observation level is allowed." << endl; 93 return kFALSE; 94 } 83 95 84 96 memset(fObsLevel, 0, 10*4); … … 127 139 fin.seekg(-274*4, ios::cur); 128 140 129 const Int_t n = TMath::Nint(g[96]); // Numb r i of uses of each cherenkov event141 const Int_t n = TMath::Nint(g[96]); // Number i of uses of each cherenkov event 130 142 if (n!=1) 131 143 { … … 133 145 return kFALSE; 134 146 } 147 148 fParticleID = TMath::Nint(g[1]); 135 149 136 150 //fImpactMax = g[86]; … … 208 222 *fLog << all << endl; 209 223 *fLog << "Run Number: " << fRunNumber << " (" << fRunStart.GetStringFmt("%d.%m.%Y") << ", V" << fProgramVersion << ")" << endl; 224 *fLog << "Particle ID: " << MMcEvt::GetParticleName(fParticleID) << endl; 210 225 if (fNumEvents>0) 211 226 *fLog << "Num Events: " << fNumEvents << endl; -
trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h
r9212 r9308 17 17 private: 18 18 UInt_t fRunNumber; // Run number 19 UInt_t fParticleID; // Particle ID (see MMcEvtBasic or CORSIKA manual) 19 20 UInt_t fNumEvents; // Number of events 20 21 MTime fRunStart; // Date of begin (yymmdd) … … 22 23 23 24 Byte_t fNumObsLevel; // Number of observation levels 24 Float_t fObsLevel[10]; // [fNumObsLevel]Observation levels [cm]25 Float_t fObsLevel[10]; // Observation levels [cm] 25 26 26 27 Float_t fSlopeSpectrum; // Slope of energy spectrum … … 56 57 Float_t GetWavelengthMax() const { return fWavelengthMax; } 57 58 59 UInt_t GetParticleID() const { return fParticleID; } 60 58 61 //Float_t GetImpactMax() const { return fImpactMax; } 59 62 … … 68 71 Bool_t SeekEvtEnd(istream &fin); 69 72 70 ClassDef(MCorsikaRunHeader, 1) // storage container for general info73 ClassDef(MCorsikaRunHeader, 2) // storage container for general info 71 74 }; 72 75 #endif -
trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc
r8907 r9308 90 90 91 91 #include "MFFT.h" 92 #include "MString.h" 92 93 #include "MArrayF.h" 93 94 … … 320 321 fPowerSpectrum = fourier.PowerSpectrumDensity(&fEvents); 321 322 fHPowerProbability = ProjectArray(*fPowerSpectrum, fPowerProbabilityBins, 322 Form("%s%s","PowerProb",GetName()),323 MString::Format("PowerProb%s", GetName()), 323 324 "Probability of Power occurrance"); 324 325 fHPowerProbability->SetXTitle("P(f)"); … … 332 333 const Double_t xmax = fHPowerProbability->GetXaxis()->GetXmax(); 333 334 334 fFExpFit = new TF1("FExpFit","exp([0]-[1]*x)",0.,xmax); 335 fFExpFit = new TF1("","exp([0]-[1]*x)",0.,xmax); 336 fFExpFit->SetName("FExpFit"); 337 gROOT->GetListOfFunctions()->Remove(fFExpFit); 338 335 339 336 340 const Double_t slope_guess = (TMath::Log(fHPowerProbability->GetEntries())+1.)/xmax; -
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r9303 r9308 159 159 if (!fTitle.Contains(";")) 160 160 fSum->SetYTitle("a.u."); 161 fSum->SetBit(MHCamera::kProfile); 161 if (fUseThreshold!=kCollectMin && fUseThreshold!=kCollectMax) 162 fSum->SetBit(MHCamera::kProfile); 162 163 if (!fErrorSpread) 163 164 fSum->SetBit(MHCamera::kErrorMean); … … 178 179 return kERROR; 179 180 } 180 if (fUseThreshold) 181 182 switch (fUseThreshold) 183 { 184 case kNoBound: 185 fSum->AddCamContent(*evt, fType); 186 break; 187 188 case kIsLowerBound: 189 case kIsUpperBound: 181 190 fSum->CntCamContent(*evt, fThreshold, fType, fUseThreshold>0); 182 else 183 fSum->AddCamContent(*evt, fType); 191 break; 192 193 case kCollectMin: 194 fSum->SetMinCamContent(*evt, /*fThreshold,*/ fType); 195 break; 196 197 case kCollectMax: 198 fSum->SetMaxCamContent(*evt, /*fThreshold,*/ fType); 199 break; 200 201 default: 202 *fLog << err << "ERROR - MHCamEvent::Fill: Unknown type." << endl; 203 return kERROR; 204 } 205 184 206 return kTRUE; 185 207 } -
trunk/MagicSoft/Mars/mhist/MHCamEvent.h
r9153 r9308 35 35 36 36 public: 37 enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0 };37 enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0, kCollectMin=-2, kCollectMax=2 }; 38 38 39 39 MHCamEvent(const char *name=NULL, const char *title=NULL); … … 57 57 58 58 void SetThreshold(Float_t f=0, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; } 59 void SetCollectMin() { fUseThreshold=kCollectMin; } 60 void SetCollectMax() { fUseThreshold=kCollectMax; } 59 61 void SetErrorSpread(Bool_t b=kTRUE) { fErrorSpread = b; } 60 62 void SetErrorRelative(Bool_t b=kTRUE) { fErrorRelative = b; } -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r9303 r9308 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.11 3 2009-02-07 20:47:41tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.114 2009-02-09 11:30:53 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 1591 1591 // 1592 1592 // Call this function to add a MCamEvent on top of the present contents. 1593 // 1 is added to each pixel if the contents of MCamEvent>threshold (in case isabove is set to kTRUE == default) 1594 // 1 is added to each pixel if the contents of MCamEvent<threshold (in case isabove is set to kFALSE) 1593 // 1 is added to each pixel if the contents of MCamEvent>threshold 1594 // (in case isabove is set to kTRUE == default) 1595 // 1 is added to each pixel if the contents of MCamEvent<threshold 1596 // (in case isabove is set to kFALSE) 1595 1597 // 1596 1598 // in unused pixel is not counted if it didn't fullfill the condition. … … 1658 1660 // 1659 1661 // Call this function to add a MCamEvent on top of the present contents. 1660 // 1 is added to each pixel if the contents of MCamEvent>threshold (in case isabove is set to kTRUE == default) 1661 // 1 is added to each pixel if the contents of MCamEvent<threshold (in case isabove is set to kFALSE) 1662 // 1 is added to each pixel if the contents of MCamEvent>threshold 1663 // (in case isabove is set to kTRUE == default) 1664 // 1 is added to each pixel if the contents of MCamEvent<threshold 1665 // (in case isabove is set to kFALSE) 1662 1666 // 1663 1667 // in unused pixel is not counted if it didn't fullfill the condition. … … 1702 1706 if (!ispos || fArray[idx+1]>0) 1703 1707 SetUsed(idx); 1708 } 1709 fEntries++; 1710 } 1711 1712 // ------------------------------------------------------------------------ 1713 // 1714 // Call this function to add a MCamEvent on top of the present contents. 1715 // 1 is added to each pixel if the contents of MCamEvent>threshold 1716 // (in case isabove is set to kTRUE == default) 1717 // 1 is added to each pixel if the contents of MCamEvent<threshold 1718 // (in case isabove is set to kFALSE) 1719 // 1720 // in unused pixel is not counted if it didn't fullfill the condition. 1721 // 1722 void MHCamera::SetMaxCamContent(const MCamEvent &event, Int_t type) 1723 { 1724 if (fNcells<=1 || IsFreezed()) 1725 return; 1726 1727 // FIXME: Security check missing! 1728 for (Int_t idx=0; idx<fNcells-2; idx++) 1729 { 1730 Double_t val=0; 1731 const Bool_t rc = event.GetPixelContent(val, idx, *fGeomCam, type); 1732 if (!rc) 1733 continue; 1734 1735 if (!IsUsed(idx)) 1736 { 1737 fArray[idx+1] = val; 1738 SetUsed(idx); 1739 fBinEntries.fArray[idx+1]=1; 1740 } 1741 else 1742 if (val>fArray[idx+1]) 1743 fArray[idx+1] = val; 1744 } 1745 fEntries++; 1746 } 1747 1748 // ------------------------------------------------------------------------ 1749 // 1750 // Call this function to add a MCamEvent on top of the present contents. 1751 // 1 is added to each pixel if the contents of MCamEvent>threshold 1752 // (in case isabove is set to kTRUE == default) 1753 // 1 is added to each pixel if the contents of MCamEvent<threshold 1754 // (in case isabove is set to kFALSE) 1755 // 1756 // in unused pixel is not counted if it didn't fullfill the condition. 1757 // 1758 void MHCamera::SetMinCamContent(const MCamEvent &event, Int_t type) 1759 { 1760 if (fNcells<=1 || IsFreezed()) 1761 return; 1762 1763 // FIXME: Security check missing! 1764 for (Int_t idx=0; idx<fNcells-2; idx++) 1765 { 1766 Double_t val=0; 1767 const Bool_t rc = event.GetPixelContent(val, idx, *fGeomCam, type); 1768 if (!rc) 1769 continue; 1770 1771 if (!IsUsed(idx)) 1772 { 1773 fArray[idx+1] = val; 1774 SetUsed(idx); 1775 fBinEntries.fArray[idx+1]=1; 1776 } 1777 else 1778 if (val<fArray[idx+1]) 1779 fArray[idx+1] = val; 1704 1780 } 1705 1781 fEntries++; -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r9186 r9308 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.6 6 2008-12-02 11:22:19tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.67 2009-02-09 11:30:53 tbretz Exp $ 3 3 \* ======================================================================== */ 4 4 #ifndef MARS_MHCamera … … 180 180 virtual void CntCamContent(const TArrayD &evt, Double_t threshold, Bool_t ispos=kTRUE); 181 181 virtual void CntCamContent(const MCamEvent &event, Int_t type1, const MCamEvent &thresevt, Int_t type2, Double_t threshold, Bool_t isabove); 182 183 virtual void SetMaxCamContent(const MCamEvent &evt, Int_t type=0); 184 virtual void SetMinCamContent(const MCamEvent &evt, Int_t type=0); 182 185 183 186 Stat_t GetBinContent(Int_t bin) const; -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
r8944 r9308 129 129 // 130 130 MRawEvtHeader::MRawEvtHeader(const char *name, const char *title) 131 : fTime(0), fNumTrigLvl1(0), fNumTrigLvl2(0), fNumLoGainOn(0), fPixLoGainOn(0) 131 132 { 132 133 fName = name ? name : "MRawEvtHeader"; -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h
r9229 r9308 23 23 // 24 24 // Trigger Type (TT) 25 / /25 /* 26 26 enum { 27 27 kTTEvent = 0, … … 30 30 kTTPinDiode = 3 31 31 }; 32 32 */ 33 33 enum CLColor_t 34 34 { -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r9272 r9308 1124 1124 { 1125 1125 case 1: 1126 fNumSamplesHiGain = 15; 1126 1127 fNumSamplesLoGain = 15; 1127 fNumSamplesHiGain = 15;1128 1128 fNumBytesPerSample = 1; // number of bytes per sample 1129 1129 fSamplingFrequency = 300; // Sampling Frequency [MHz] -
trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc
r9263 r9308 54 54 // Fill expects a MPhotonEvent (the second argumnet in MFillH). 55 55 // 56 // 57 // Class Version 2: 58 // ---------------- 59 // + TH1D fHistH; 60 // 61 // 56 62 ///////////////////////////////////////////////////////////////////////////// 57 63 #include "MHPhotonEvent.h" … … 113 119 fHistWL.SetDirectory(NULL); 114 120 121 fHistH.SetName("Height"); 122 fHistH.SetTitle("Production Height"); 123 fHistH.SetXTitle("h [km]"); 124 fHistH.SetYTitle("Counts"); 125 fHistH.SetDirectory(NULL); 126 115 127 // FIXME: Get this information from the corsika run-header 116 128 MBinning(70, 275, 625).Apply(fHistWL); 129 MBinning(100, 0, 25).Apply(fHistH); 117 130 } 118 131 … … 259 272 const MPhotonData &ph = (*evt)[idx]; 260 273 274 if (ph.GetPrimary()==MMcEvtBasic::kNightSky) 275 continue; 276 261 277 const Double_t x = ph.GetPosX(); 262 278 const Double_t y = ph.GetPosY(); … … 265 281 const Double_t t = ph.GetTime()-min; 266 282 const Double_t w = ph.GetWavelength(); 283 const Double_t h = ph.GetProductionHeight()/100000; 267 284 268 285 //TVector3 dir = dat->GetDir3(); … … 273 290 fHistT.Fill(x, y, t); 274 291 fHistWL.Fill(w); 292 fHistH.Fill(h); 275 293 } 276 294 … … 341 359 gPad->SetGrid(); 342 360 fHistWL.Draw(); 343 } 361 362 pad->cd(6); 363 gPad->SetBorderMode(0); 364 gPad->SetGrid(); 365 fHistH.Draw(); 366 } -
trunk/MagicSoft/Mars/msim/MHPhotonEvent.h
r9232 r9308 23 23 TProfile2D fHistT; 24 24 TH1D fHistWL; 25 TH1D fHistH; 25 26 26 27 Int_t fType; … … 40 41 void Paint(Option_t *o=""); 41 42 42 ClassDef(MHPhotonEvent, 1) // Histogram to display the information of MPhotonEvents43 ClassDef(MHPhotonEvent, 2) // Histogram to display the information of MPhotonEvents 43 44 }; 44 45 -
trunk/MagicSoft/Mars/msim/MPhotonData.h
r9252 r9308 83 83 // Getter Others 84 84 UShort_t GetWavelength() const { return fWavelength; } 85 Float_t GetProductionHeight() const { return fProductionHeight; } 85 86 MMcEvtBasic::ParticleId_t GetPrimary() const { return fPrimary; } 86 87 -
trunk/MagicSoft/Mars/msim/MPhotonEvent.h
r9301 r9308 157 157 Int_t GetMaxIndex() const { return fMaxIndex; } 158 158 159 Bool_t IsValid() const { return fTimeLast>=fTimeFirst; }159 // Bool_t IsValid() const { return fTimeLast>=fTimeFirst; } 160 160 161 161 ClassDef(MPhotonStatistics, 1) -
trunk/MagicSoft/Mars/msimcamera/MSimGeomCam.cc
r9274 r9308 170 170 } 171 171 172 const Float_t freq = fHeader->GetFreqSampling()/1000.; 173 174 // We add an additional sample at the end to support a possible shift 175 // of the start time of the first event by 0 to 1 sample. 176 const Int_t ns = fHeader->GetNumSamplesHiGain()+1; 177 172 178 const Float_t first = cnt>0 ? fEvt->GetFirst()->GetTime() : 0; 173 const Float_t last = cnt>0 ? fEvt->GetLast()->GetTime() : -1;179 const Float_t last = cnt>0 ? fEvt->GetLast()->GetTime() : ns*freq; 174 180 175 181 // Length (ns), Pulse position (Units ns) 176 const Float_t ns = fHeader->GetFreqSampling()/1000.*fHeader->GetNumSamplesHiGain(); 177 const Float_t pp = fPulsePos->GetVal(); 178 const Float_t pw = fPulse->GetPulseWidth(); 179 180 fStat->SetTime(first-pp-pw, last+(ns-pp)+pw); 182 const Float_t pp = fPulsePos->GetVal(); 183 const Float_t pw = fPulse->GetPulseWidth(); 184 185 fStat->SetTime(first-pp-pw, last-pp+pw + ns*freq); 181 186 fStat->SetMaxIndex(fGeom->GetNumPixels()-1); 182 187 fStat->SetReadyToSave(); -
trunk/MagicSoft/Mars/msimcamera/MSimReadout.cc
r9274 r9308 73 73 // 74 74 MSimReadout::MSimReadout(const char* name, const char *title) 75 : fRunHeader(0), f Camera(0), fPulsePos(0), fTrigger(0), fData(0)75 : fRunHeader(0), fEvtHeader(0), fCamera(0), fPulsePos(0), fTrigger(0), fData(0) 76 76 { 77 77 fName = name ? name : "MSimReadout"; … … 113 113 return kFALSE; 114 114 } 115 116 fEvtHeader = (MRawEvtHeader*)pList->FindCreateObj("MRawEvtHeader"); 117 if (!fEvtHeader) 118 return kFALSE; 115 119 116 120 fData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData"); … … 244 248 fData->SetReadyToSave(); 245 249 250 // Set the trigger/daq event number 251 fEvtHeader->SetDAQEvtNumber(GetNumExecutions()); 252 fEvtHeader->SetReadyToSave(); 253 246 254 // FIMXE: This will never be stored correctly :( 247 255 fRunHeader->SetNumEvents(fRunHeader->GetNumEvents()+1); -
trunk/MagicSoft/Mars/msimcamera/MSimReadout.h
r9270 r9308 10 10 class MRawEvtData; 11 11 class MRawRunHeader; 12 class MRawEvtHeader; 12 13 class MAnalogChannels; 13 14 … … 16 17 private: 17 18 MRawRunHeader *fRunHeader; //! Digitization window and frequency 19 MRawEvtHeader *fEvtHeader; //! Event header which is filled with the event number 18 20 MAnalogChannels *fCamera; //! Analog channes to be read out 19 21 MParameterD *fPulsePos; //! Intended pulse position -
trunk/MagicSoft/Mars/msimcamera/MSimTrigger.cc
r9278 r9308 36 36 // is calculated using a threshold and optional a fixed digital signal length. 37 37 // 38 // The signal length of the digital signal emitted by the discriminator 39 // can either be bound to the time the signal is above the threshold 40 // defined by fDiscriminatorThreshold if fDigitalSignalLength<0 or set to a 41 // fixed length (fDigitalSignalLength>0). 42 // 38 43 // With a second look-up table fCoincidenceMap the analog channels are 39 // checked for coincidences. The earliest coincide is then stored as 44 // checked for coincidences. The coincidense must at least be of the length 45 // defined by fCoincidenceTime. The earliest coincide is then stored as 40 46 // trigger position. 47 // 48 // 49 // For MAGIC1: 50 // - fDigitalSignalLength between 6ns and 12ns 51 // - fCoincidenceTime between 0.25ns to 1ns 41 52 // 42 53 // … … 69 80 #include "MDigitalSignal.h" 70 81 82 #include "MTriggerPattern.h" 83 71 84 ClassImp(MSimTrigger); 72 85 … … 79 92 MSimTrigger::MSimTrigger(const char *name, const char *title) 80 93 : fCamera(0), fPulsePos(0), fTrigger(0), fRunHeader(0), fEvtHeader(0), 81 fDiscriminatorThreshold(-1) 94 fDiscriminatorThreshold(-1), fDigitalSignalLength(8), fCoincidenceTime(0.5) 82 95 { 83 96 fName = name ? name : "MSimTrigger"; … … 189 202 fTrigger->SetVal(-1); 190 203 191 // FIXME: Set from somewhere else? (see also MSimCalibrationSignal)192 fEvtHeader->SetDAQEvtNumber(GetNumExecutions());193 fEvtHeader->SetReadyToSave();194 195 204 // ================== Simulate channel bundling ==================== 196 205 … … 204 213 for (UInt_t j=0; j<row.GetSize(); j++) 205 214 { 215 // FIXME: Simulate clipping 206 216 const UInt_t idx = row[j]; 207 217 patches[i].AddSignal((*fCamera)[idx]); … … 216 226 ttls.SetOwner(); 217 227 218 // MAGIC: Constant length of signals between 6ns and 12ns219 const Double_t siglen = 8; // Signal length (-1: As long as Signal-above-Threshold)220 221 228 for (UInt_t i=0; i<npatch; i++) 222 ttls.AddAt(patches[i].Discriminate(fDiscriminatorThreshold, siglen), i);229 ttls.AddAt(patches[i].Discriminate(fDiscriminatorThreshold, fDigitalSignalLength), i); 223 230 224 231 // FIXME: Write TTLs! … … 235 242 const Float_t max = fCamera->GetValidRangeMax()-(nsamp-pulspos); 236 243 237 // Define gate time (minimum coincidence time)238 const Double_t gate = 1; // MAGIC: minimum coincidence time 0.25ns to 1ns,239 240 244 // Create an array for the individual triggers 241 245 TObjArray triggers; … … 258 262 { 259 263 TObjArray *res = CalcCoincidence(*arr, *static_cast<TObjArray*>(ttls[idx[k]]), 260 gate);264 fCoincidenceTime); 261 265 262 266 // Delete the original array and keep the new one … … 303 307 { 304 308 if (rmlo>0 || rmhi>0) 305 *fLog << all<< rmlo << "/" << rmhi << " trigger out of valid range. No trigger raised." << endl;309 *fLog << inf2 << rmlo << "/" << rmhi << " trigger out of valid range. No trigger raised." << endl; 306 310 return kTRUE; 307 311 } … … 315 319 // FIXME: Jitter! (Own class?) 316 320 fTrigger->SetVal(static_cast<MDigitalSignal*>(triggers[0])->GetStart()); 321 fTrigger->SetReadyToSave(); 322 323 // Flag this event as triggered by the lvl1 trigger (FIXME?) 324 fEvtHeader->SetTriggerPattern((UInt_t)~(MTriggerPattern::kTriggerLvl1 | (MTriggerPattern::kTriggerLvl1<<8))); 325 fEvtHeader->SetReadyToSave(); 317 326 318 327 // inf2? 319 *fLog << all;328 *fLog << inf; 320 329 *fLog << cnt << " triggers left in " << triggers.GetEntriesFast() << " patches (" << rmlo << "/" << rmhi << " trigger out of valid range), T=" << fTrigger->GetVal(); 321 330 *fLog << endl; … … 329 338 // FileNameCoincidenceMap: coincidence.txt 330 339 // DiscriminatorTheshold: 3.5 340 // DigitalSignalLength: 8 341 // CoincidenceTime: 0.5 331 342 // 332 343 Int_t MSimTrigger::ReadEnv(const TEnv &env, TString prefix, Bool_t print) … … 351 362 } 352 363 364 if (IsEnvDefined(env, prefix, "DigitalSignalLength", print)) 365 { 366 rc = kTRUE; 367 fDigitalSignalLength = GetEnvValue(env, prefix, "DigitalSignalLength", fDigitalSignalLength); 368 } 369 370 if (IsEnvDefined(env, prefix, "CoincidenceTime", print)) 371 { 372 rc = kTRUE; 373 fCoincidenceTime = GetEnvValue(env, prefix, "CoincidenceTime", fCoincidenceTime); 374 } 375 353 376 return rc; 354 377 } -
trunk/MagicSoft/Mars/msimcamera/MSimTrigger.h
r9261 r9308 32 32 33 33 Float_t fDiscriminatorThreshold; // Discriminator threshold 34 Float_t fDigitalSignalLength; // Length of the output of the discriminator 35 Float_t fCoincidenceTime; // Minimum coincidence time (gate) 34 36 35 37 // MSimTrigger … … 50 52 51 53 void SetDiscriminatorThreshold(Float_t th) { fDiscriminatorThreshold=th; } 54 void SetDigitalSignalLength(Float_t ln) { fDigitalSignalLength=ln; } 55 void SetCoincidenceTime(Float_t tm) { fCoincidenceTime=tm; } 52 56 53 57 ClassDef(MSimTrigger, 0) // Task to simulate trigger electronics -
trunk/MagicSoft/Mars/msimcamera/Makefile
r9256 r9308 20 20 # 21 21 INCLUDES = -I. -I../mbase -I../mgeom -I../msim -I../msignal -I../mcorsika \ 22 -I../mmc -I../mgui -I../mcalib -I../mraw -I../mfileio -I../melectronics 22 -I../mmc -I../mgui -I../mcalib -I../mraw -I../mfileio -I../melectronics \ 23 -I../mtrigger 23 24 24 25 SRCFILES = MSimPSF.cc \
Note:
See TracChangeset
for help on using the changeset viewer.