Changeset 1914 for trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
- Timestamp:
- 04/07/03 17:28:54 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r1082 r1914 62 62 #include "MArrayB.h" 63 63 #include "MRawRunHeader.h" 64 #include "MRawEvtPixelIter.h" 64 65 65 66 ClassImp(MRawEvtData); … … 217 218 TString str(opt); 218 219 219 UInt_t num= 0;220 UInt_t id = 0; 220 221 221 222 if (str.BeginsWith("GRAPH", TString::kIgnoreCase)) 222 {223 223 if (str.Length()>5) 224 sscanf(&str[5], "%d", &num); 225 226 if (num>=GetNumPixels()) 227 num= GetNumPixels(); 228 229 *fLog << inf << "Drawing Graph: Pixel #" << num << " of " << (int)GetNumPixels() << endl; 230 231 const Int_t n = GetNumHiGainSamples(); 232 233 Float_t *x = new Float_t[n]; 234 Float_t *y = new Float_t[n]; 224 sscanf(&str[5], "%d", &id); 225 if (str.BeginsWith("HIST", TString::kIgnoreCase)) 226 if (str.Length()>4) 227 sscanf(&str[4], "%d", &id); 228 229 MRawEvtPixelIter pix(this); 230 if (!pix.Jump(id)) 231 { 232 *fLog << warn << "Pixel Id #" << id << " doesn't exist!" << endl; 233 return; 234 } 235 236 const Byte_t *higains = pix.GetHiGainSamples(); 237 238 const Int_t n = GetNumHiGainSamples(); 239 240 TString name = "Pixel No."; 241 name += pix.GetPixelId(); 242 243 if (str.BeginsWith("GRAPH", TString::kIgnoreCase)) 244 { 245 *fLog << inf << "Drawing Graph: Pixel Id #" << pix.GetPixelId(); 246 *fLog << " of " << (int)GetNumPixels() << "Pixels" << endl; 247 248 TGraph *graph = new TGraph; 235 249 236 250 for (int i=0; i<n; i++) 237 { 238 x[i] = i; 239 y[i] = (*fHiGainFadcSamples)[i + num*GetNumHiGainSamples()]; 240 } 241 242 TGraph *graph = new TGraph(n, x, y); 251 graph->SetPoint(graph->GetN(), i, higains[i]); 252 243 253 graph->SetMaximum(256); 244 254 graph->SetMinimum(0); … … 257 267 if (str.BeginsWith("HIST", TString::kIgnoreCase)) 258 268 { 259 *fLog << "Length: " << str.Length() << endl; 260 261 if (str.Length()>4) 262 sscanf(&str[4], "%d", &num); 263 264 if (num>=GetNumPixels()) 265 num= GetNumPixels(); 266 267 *fLog << "Drawing Histogram of Pixel " << num << endl; 268 269 const Int_t n = GetNumHiGainSamples(); 270 271 char *name = new char[16]; 272 273 sprintf(name, "Pixel No.%d", (*fHiGainPixId)[num]); 269 *fLog << "Drawing Histogram of Pixel with Id " << pix.GetPixelId() << endl; 274 270 275 271 TH1F *hist = new TH1F(name, "Hi Gain Samples FADC", n, 0, n); … … 278 274 279 275 for (int i=0; i<n; i++) 280 hist->Fill(0.5+i, (*fHiGainFadcSamples)[i + num*GetNumHiGainSamples()]);276 hist->Fill(0.5+i, higains[i]); 281 277 282 278 hist->SetBit(kCanDelete);
Note:
See TracChangeset
for help on using the changeset viewer.