- Timestamp:
- 02/13/04 16:52:50 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3141 r3142 79 79 * macros/readMagic.C: 80 80 - changed to use MInteractiveTask 81 82 * mbase/MPrint.cc: 83 - fixed debugging level of some output 84 85 * mhist/MHCamera.[h,cc]: 86 - fixed handling in AddNotify (necessayr due to change of 87 inheritance from MCamEvent) 88 - replaced cout by gLog 89 - added fNotify to list of cleanups 90 91 * mhist/MHEvent.cc, mjobs/MJCalibration.cc, 92 mjobs/MJPedestal.cc: 93 - fixed usage of AddNotify 81 94 82 95 -
trunk/MagicSoft/Mars/mbase/MPrint.cc
r2580 r3142 131 131 // If it couldn't get found stop Eventloop 132 132 // 133 *fLog << err << dbginf << fObjName << " not found... ";134 133 if (TestBit(kSkip)) 135 134 { 136 *fLog << "removing task from list." << endl;135 *fLog << warn << fObjName << " not found... removing task from list." << endl; 137 136 return kSKIP; 138 137 } 139 138 else 140 139 { 141 *fLog << "aborting." << endl;140 *fLog << err << fObjName << " not found... aborting." << endl; 142 141 return kFALSE; 143 142 } -
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); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r3112 r3142 166 166 void MJCalibration::CamDraw(TCanvas &c, const Int_t x, const Int_t y, const MHCamera &cam1, const Int_t fit) 167 167 { 168 169 170 168 c.cd(x); 171 169 gPad->SetBorderMode(0); 172 170 MHCamera *obj1=(MHCamera*)cam1.DrawCopy("hist"); 173 obj1->AddNotify( fCalibrationCam);171 obj1->AddNotify(static_cast<TObject*>(&fCalibrationCam)); 174 172 175 173 c.cd(x+y); … … 177 175 obj1->Draw(); 178 176 179 if ( fit)180 {181 c.cd(x+2*y); 182 gPad->SetBorderMode(0);183 DrawProjection(obj1, fit);184 }177 if (!fit) 178 return; 179 180 c.cd(x+2*y); 181 gPad->SetBorderMode(0); 182 DrawProjection(obj1, fit); 185 183 } 186 184 -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r3069 r3142 174 174 gPad->SetBorderMode(0); 175 175 MHCamera *obj1=(MHCamera*)cam1.DrawCopy("hist"); 176 obj1->AddNotify( fPedestalCam);176 obj1->AddNotify(static_cast<TObject*>(&fPedestalCam)); 177 177 178 178 c.cd(x+y);
Note:
See TracChangeset
for help on using the changeset viewer.