Changeset 3568 for trunk/MagicSoft/Mars/mimage
- Timestamp:
- 03/22/04 09:25:49 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mimage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MConcentration.cc
r3543 r3568 116 116 Int_t MConcentration::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, const MHillas &hillas) 117 117 { 118 const UInt_t npixevt = evt.GetNumPixels();119 120 118 Float_t maxpix[9] = {0,0,0,0,0,0,0,0,0}; // [#phot] 121 119 122 for (UInt_t i=0; i<npixevt; i++) 120 TIter Next(evt); 121 MCerPhotPix *pix = 0; 122 while ((pix=(MCerPhotPix*)Next())) 123 123 { 124 const MCerPhotPix &pix = evt[i]; 125 126 // skip unused pixels 127 if (!pix.IsPixelUsed()) 128 continue; 129 130 const Int_t pixid = pix.GetPixId(); 131 132 const MGeomPix &gpix = geom[pixid]; 133 134 Double_t nphot = pix.GetNumPhotons(); 135 136 // 137 // Now we are working on absolute values of nphot, which 138 // must take pixel size into account 139 // 140 nphot *= geom.GetPixRatio(pixid); 124 const Int_t pixid = pix->GetPixId(); 125 const Double_t nphot = pix->GetNumPhotons()* geom.GetPixRatio(pixid); 141 126 142 127 // Get number of photons in the 8 most populated pixels 128 if (maxpix[0]<=nphot) 129 { 130 for(int i=0;i<8;i++) 131 maxpix[8-i]=maxpix[7-i]; 132 maxpix[0]=nphot; 133 continue; 134 } 143 135 144 if(maxpix[0]<=nphot) { 145 for(int i=0;i<8;i++) 146 maxpix[8-i]=maxpix[7-i]; 147 maxpix[0]=nphot; 148 } 149 else 150 for(int i=0;i<8;i++){ 151 if (nphot<maxpix[7-i]){ 152 for(int j=0;j<i-1;j++){ 153 maxpix[7-j]=maxpix[6-j]; // [#phot] 154 } 155 maxpix[8-i]=nphot; 156 break; 157 } 158 } 136 // Check if the latest value is 'somewhere in between' 137 for (int i=0; i<8; i++) 138 { 139 if (nphot>=maxpix[7-i]) 140 continue; 159 141 142 for(int j=0;j<i-1;j++) 143 maxpix[7-j]=maxpix[6-j]; // [#phot] 144 145 maxpix[8-i]=nphot; 146 break; 147 } 160 148 } 161 149 162 150 // Compute concentrations from the 8 pixels with higher signal 163 164 151 fConc[0]=maxpix[0]; 165 for(int i=1;i<8;i++) 166 { 167 fConc[i]=fConc[i-1]+maxpix[i]; 168 } 169 170 for(int i=0;i<8;i++) 171 { 172 fConc[i]/=hillas.GetSize(); // [ratio] 173 } 152 153 // No calculate the integral of the n highest pixels 154 for(int i=1; i<8; i++) 155 fConc[i] = fConc[i-1]+maxpix[i]; 156 157 for(int i=0; i<8; i++) 158 fConc[i] /= hillas.GetSize(); // [ratio] 174 159 175 160 SetReadyToSave(); 176 161 162 return 0; 177 163 } 178 179 -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
r2414 r3568 65 65 fHistLeakage1.SetYTitle("Counts"); 66 66 fHistLeakage1.SetDirectory(NULL); 67 fHistLeakage1.UseCurrentStyle(); 67 68 fHistLeakage1.SetFillStyle(4000); 68 fHistLeakage1.UseCurrentStyle();69 69 70 70 fHistLeakage2.SetName("Leakage2"); … … 73 73 fHistLeakage2.SetYTitle("Counts"); 74 74 fHistLeakage2.SetDirectory(NULL); 75 fHistLeakage2.UseCurrentStyle(); 75 76 fHistLeakage2.SetLineColor(kBlue); 76 77 fHistLeakage2.SetFillStyle(4000); 77 fHistLeakage2.UseCurrentStyle();78 78 79 79 fHistUsedPix.SetName("UsedPix"); … … 82 82 fHistUsedPix.SetYTitle("Counts"); 83 83 fHistUsedPix.SetDirectory(NULL); 84 fHistUsedPix.SetLineColor(kGreen); 84 fHistUsedPix.UseCurrentStyle(); 85 fHistUsedPix.SetLineColor(kBlue); 85 86 fHistUsedPix.SetFillStyle(4000); 86 fHistUsedPix.UseCurrentStyle();87 87 88 88 fHistCorePix.SetName("CorePix"); … … 91 91 fHistCorePix.SetYTitle("Counts"); 92 92 fHistCorePix.SetDirectory(NULL); 93 fHistCorePix.SetLineColor(kRed); 93 fHistCorePix.UseCurrentStyle(); 94 fHistCorePix.SetLineColor(kBlack); 94 95 fHistCorePix.SetFillStyle(4000); 95 fHistCorePix.UseCurrentStyle();96 96 97 97 fHistConc.SetDirectory(NULL); … … 105 105 fHistConc.SetYTitle("Counts"); 106 106 fHistConc1.SetYTitle("Counts"); 107 fHistConc1.UseCurrentStyle(); 108 fHistConc.UseCurrentStyle(); 107 109 fHistConc.SetFillStyle(4000); 108 110 fHistConc1.SetFillStyle(4000); 109 111 fHistConc1.SetLineColor(kBlue); 110 112 fHistConc.SetFillStyle(0); 111 fHistConc1.UseCurrentStyle();112 fHistConc.UseCurrentStyle();113 113 114 114
Note:
See TracChangeset
for help on using the changeset viewer.