Changeset 2178 for trunk/MagicSoft/Mars/mraw
- Timestamp:
- 06/16/03 13:45:01 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mraw
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r2173 r2178 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 118 ! Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 22 ! … … 45 45 // -------------------------- 46 46 // see fHiGainFadcSaples 47 // 48 // 49 // Version 2: Derives from MCamEvent now 47 50 // 48 51 ///////////////////////////////////////////////////////////////////////////// … … 232 235 if (!pix.Jump(id)) 233 236 { 234 *fLog << warn << "Pixel Id #" << id << " doesn't exist!" << endl;237 *fLog << warn << "Pixel Idx #" << id << " doesn't exist!" << endl; 235 238 return; 236 239 } 237 240 238 241 const Byte_t *higains = pix.GetHiGainSamples(); 239 240 const Int_t n = GetNumHiGainSamples(); 241 242 TString name = "Pixel No."; 242 const Byte_t *logains = pix.GetLoGainSamples(); 243 244 const Int_t nh = GetNumHiGainSamples(); 245 const Int_t nl = GetNumLoGainSamples(); 246 247 TString name = "Pixel Idx."; 243 248 name += pix.GetPixelId(); 244 249 250 Bool_t same = str.Contains("same", TString::kIgnoreCase); 251 245 252 if (str.BeginsWith("GRAPH", TString::kIgnoreCase)) 246 253 { 247 *fLog << inf << "Drawing Graph: Pixel Id #" << pix.GetPixelId();254 *fLog << inf << "Drawing Graph: Pixel Idx #" << pix.GetPixelId(); 248 255 *fLog << " of " << (int)GetNumPixels() << "Pixels" << endl; 249 256 250 257 TGraph *graph = new TGraph; 251 258 252 for (int i=0; i<n ; i++)259 for (int i=0; i<nh; i++) 253 260 graph->SetPoint(graph->GetN(), i, higains[i]); 254 261 … … 257 264 258 265 graph->SetBit(kCanDelete); 259 graph->Draw( "AC*");266 graph->Draw(same ? "C*" : "AC*"); 260 267 261 268 TH1F *hist = graph->GetHistogram(); … … 269 276 if (str.BeginsWith("HIST", TString::kIgnoreCase)) 270 277 { 271 *fLog << "Drawing Histogram of Pixel with Id " << pix.GetPixelId() << endl; 272 273 TH1F *hist = new TH1F(name, "Hi Gain Samples FADC", n, 0, n); 274 hist->SetXTitle("Time/FADC Slices"); 275 hist->SetYTitle("Signal/FADC Units"); 276 277 for (int i=0; i<n; i++) 278 hist->Fill(0.5+i, higains[i]); 279 280 hist->SetBit(kCanDelete); 281 hist->Draw(); 282 278 // FIXME: Add Legend 279 *fLog << "Drawing Histogram of Pixel with Idx " << pix.GetPixelId() << endl; 280 281 TH1F *histh = new TH1F(name, "FADC Samples", nh, -0.5, nh-.5); 282 histh->SetXTitle("Time [FADC Slices]"); 283 histh->SetYTitle("Signal [FADC Units]"); 284 histh->SetDirectory(NULL); 285 for (int i=0; i<nh; i++) 286 histh->Fill(i, higains[i]); 287 histh->SetBit(kCanDelete); 288 histh->Draw(same ? "same" : ""); 289 290 if (nh>0) 291 { 292 TH1F *histl = new TH1F(name+";2", "FADC Samples", nl, -0.5, nl-.5); 293 histl->SetLineColor(kBlue); 294 histl->SetDirectory(NULL); 295 for (int i=0; i<nl; i++) 296 histl->Fill(i, logains[i]); 297 histl->SetBit(kCanDelete); 298 histl->Draw("same"); 299 } 283 300 return; 284 301 } … … 447 464 } 448 465 466 Bool_t MRawEvtData::GetPixelContent(Float_t &val, Int_t idx, Float_t ratio, Int_t type) const 467 { 468 MRawEvtPixelIter Next(const_cast<MRawEvtData*>(this)); 469 if (!Next.Jump(idx)) 470 return kFALSE; 471 472 val = Next.GetSumHiGainSamples(); 473 return kTRUE; 474 } -
trunk/MagicSoft/Mars/mraw/MRawEvtData.h
r2173 r2178 2 2 #define MARS_MRawEvtData 3 3 4 #ifndef MARS_M ParContainer5 #include "M ParContainer.h"4 #ifndef MARS_MCamEvent 5 #include "MCamEvent.h" 6 6 #endif 7 7 … … 16 16 class MArrayB; 17 17 18 class MRawEvtData : public MParContainer 18 #include <iostream.h> 19 20 class MRawEvtData : public MCamEvent 19 21 { 20 22 friend class MRawEvtPixelIter; … … 63 65 void ReadEvt(istream &fin); 64 66 65 ClassDef(MRawEvtData, 1) //Container to store the raw Event Data 67 Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const; 68 void DrawPixelContent(Int_t num) const 69 { 70 TString s("HIST"); 71 s += num; 72 const_cast<MRawEvtData*>(this)->Draw(s); 73 } 74 75 ClassDef(MRawEvtData, 2) //Container to store the raw Event Data 66 76 }; 67 77 -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
r1548 r2178 187 187 } 188 188 189 Float_t MRawEvtPixelIter::GetVarHiGainSamples() const 190 { 191 Byte_t *ptr = fHiGainPos; 192 const Byte_t *end = ptr + fNumHiGainSamples; 193 194 ULong_t sum=0; 195 ULong_t sqsum=0; 196 197 do { 198 sum += *ptr; 199 sqsum += (*ptr)*(*ptr); 200 } while (++ptr != end); 201 202 return (sqsum-(Float_t)sum*sum/fNumHiGainSamples)/(fNumHiGainSamples-1); 203 } 204 189 205 // -------------------------------------------------------------------------- 190 206 // -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
r2123 r2178 79 79 ULong_t GetSumHiGainSamples() const; 80 80 ULong_t GetSumSqrHiGainSamples() const; 81 Float_t GetVarHiGainSamples() const; 81 82 82 83 Bool_t HasLoGain() const -
trunk/MagicSoft/Mars/mraw/Makefile
r1160 r2178 22 22 # connect the include files defined in the config.mk file 23 23 # 24 INCLUDES = -I. -I../mbase -I../MBase 24 INCLUDES = -I. -I../mbase -I../MBase -I../mgui 25 25 26 26 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.