Changeset 3142 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 02/13/04 16:52:50 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2947 r3142 35 35 // Be carefull: Entries in this context means Entries/bin or Events 36 36 // 37 // FIXME? Maybe MHCamera can take the fLog object from MGeomCam? 38 // 37 39 //////////////////////////////////////////////////////////////////////////// 38 40 #include "MHCamera.h" … … 83 85 84 86 fNotify = new TList; 87 fNotify->SetBit(kMustCleanup); 88 gROOT->GetListOfCleanups()->Add(fNotify); 85 89 86 90 #if ROOT_VERSION_CODE < ROOT_VERSION(3,01,06) … … 611 615 void MHCamera::Print(Option_t *) const 612 616 { 613 cout<< "Minimum: " << GetMinimum();617 gLog << all << "Minimum: " << GetMinimum(); 614 618 if (fMinimum==-1111) 615 cout<< " <autoscaled>";616 cout<< endl;617 cout<< "Maximum: " << GetMaximum();619 gLog << " <autoscaled>"; 620 gLog << endl; 621 gLog << "Maximum: " << GetMaximum(); 618 622 if (fMaximum==-1111) 619 cout<< " <autoscaled>";620 cout<< endl;623 gLog << " <autoscaled>"; 624 gLog << endl; 621 625 } 622 626 … … 718 722 if (ncolors>1 && ncolors<50) 719 723 { 720 cout<< "MHCamera::SetPalette: Only default palettes with 50 colors are allowed... ignored." << endl;724 gLog << err << "MHCamera::SetPalette: Only default palettes with 50 colors are allowed... ignored." << endl; 721 725 return; 722 726 } … … 1157 1161 void MHCamera::SavePrimitive(ofstream &out, Option_t *opt) 1158 1162 { 1159 cout<< "MHCamera::SavePrimitive: Must be rewritten!" << endl;1163 gLog << err << "MHCamera::SavePrimitive: Must be rewritten!" << endl; 1160 1164 /* 1161 1165 if (!gROOT->ClassSaved(TCanvas::Class())) … … 1257 1261 // ------------------------------------------------------------------------ 1258 1262 // 1263 // Add a MCamEvent which should be displayed when the user clicks on a 1264 // pixel. 1265 // Warning: The object MUST inherit from TObject AND MCamEvent 1266 // 1267 void MHCamera::AddNotify(TObject *obj) 1268 { 1269 // Make sure, that the object derives from MCamEvent! 1270 MCamEvent *evt = dynamic_cast<MCamEvent*>(obj); 1271 if (!evt) 1272 { 1273 gLog << err << "ERROR: MHCamera::AddNotify - TObject doesn't inherit from MCamEvent... ignored." << endl; 1274 return; 1275 } 1276 1277 // Make sure, that it is deleted from the list too, if the obj is deleted 1278 obj->SetBit(kMustCleanup); 1279 1280 // Add object to list 1281 fNotify->Add(obj); 1282 } 1283 1284 // ------------------------------------------------------------------------ 1285 // 1259 1286 // Execute a mouse event on the camera 1260 1287 // … … 1275 1302 return; 1276 1303 1277 cout<< GetTitle() << " <" << GetName() << ">" << endl;1278 cout<< "Software Pixel Index: " << idx << endl;1279 cout<< "Hardware Pixel Id: " << idx+1 << endl;1280 cout<< "Contents: " << GetBinContent(idx+1);1304 gLog << all << GetTitle() << " <" << GetName() << ">" << endl; 1305 gLog << "Software Pixel Index: " << idx << endl; 1306 gLog << "Hardware Pixel Id: " << idx+1 << endl; 1307 gLog << "Contents: " << GetBinContent(idx+1); 1281 1308 if (GetBinError(idx+1)>0) 1282 cout<< " +/- " << GetBinError(idx+1);1283 cout<< " <" << (IsUsed(idx)?"on":"off") << ">" << endl;1309 gLog << " +/- " << GetBinError(idx+1); 1310 gLog << " <" << (IsUsed(idx)?"on":"off") << ">" << endl; 1284 1311 1285 1312 if (fNotify && fNotify->GetSize()>0) … … 1306 1333 // FIXME: Make sure, that the old histograms are really deleted. 1307 1334 // Are they already deleted? 1308 fNotify->ForEach(MCamEvent, DrawPixelContent)(idx); 1335 1336 // The dynamic_cast is necessary here: We cannot use ForEach 1337 TIter Next(fNotify); 1338 MCamEvent *evt; 1339 while ((evt=dynamic_cast<MCamEvent*>(Next()))) 1340 evt->DrawPixelContent(idx); 1341 1309 1342 gPad->Modified(); 1310 1343 gPad->Update(); -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r2894 r3142 179 179 //void SetOptStat(Int_t os=-1) { fOptStat = os; } // *MENU* 180 180 181 void AddNotify( const MCamEvent &event) { fNotify->Add((TObject*)(&event)); }181 void AddNotify(TObject *event); 182 182 183 183 Stat_t GetMean(Int_t axis=-1) const; … … 187 187 188 188 TH1D *Projection(const char *name="_py") const; 189 190 //void SetStatusBar(TGStatusBar *bar) { fStatusBar = bar; }191 189 192 190 const MGeomCam &GetGeomCam() const { return *fGeomCam; } -
trunk/MagicSoft/Mars/mhist/MHEvent.cc
r2979 r3142 118 118 119 119 fHist = new MHCamera(*cam); 120 fHist->AddNotify( *fClone);120 fHist->AddNotify(fClone); 121 121 122 122 switch (fType) … … 182 182 switch (fType) 183 183 { 184 case kEvtSignal: 184 case kEvtSignal: // Get NumPhotons without pixel-size scaling 185 // fHist->SetCamContent(*event, 3); 186 // break; 185 187 case kEvtPedestal: 186 188 fHist->SetCamContent(*event, 0);
Note:
See TracChangeset
for help on using the changeset viewer.