Changeset 7210 for trunk/MagicSoft/Mars
- Timestamp:
- 07/22/05 13:18:44 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7209 r7210 44 44 - fixed a problem reading files with gkActiveLoadControlVersNum 45 45 - added a fix for report files before 200407070 46 47 * mhvstime/MHSectorVsTime.[h,cc]: 48 - added example to class reference 49 - fixed possible crash in SetName and SetTitle 50 - set default style to kFullDotMedium 51 - removed seconds from default axis labels 52 - changed default time labels size to 0.033 53 - moved Draw code to Paint as in MHVsTime 54 - fixed wrong return of kCONTINUE in Fill 55 56 * mhvstime/MHVsTime.cc: 57 - removed seconds from default axis labels 58 59 * mjobs/MJStar.cc: 60 - added Starguider info to output 61 - added MHSectorVsTime to display mean DC current 62 - allow skipping MHPointing for very old files without 63 starguider reports 64 65 * mpointing/MHPointing.cc: 66 - allow skipping MHPointing for very old files without 67 starguider reports 46 68 47 69 -
trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.cc
r6977 r7210 38 38 // YOU HAVE TWO SEMICOLON!) 39 39 // 40 // Example: 41 // -------- 42 // // Initialize histogram 43 // MHSectorVsTime hist1; 44 // hist1.SetNameTime("MTimeCurrents"); 45 // hist1.SetTitle("Title for your Graph;;Q [phe]"); 46 // 47 // // Define sectors you want to display the mean from 48 // TArrayI s0(3); 49 // s0[0] = 6; 50 // s0[1] = 1; 51 // s0[2] = 2; 52 // 53 // // Define area index [0=inner, 1=outer] 54 // TArrayI inner(1); 55 // inner[0] = 0; 56 // 57 // // Don't call this if you want to have all sectors 58 // hist1.SetSectors(s0); 59 // 60 // // Don't call this if you want to have all area indices 61 // hist1.SetAreaIndex(inner); 62 // 63 // // Task to fill the histogram 64 // MFillH fill1(&hist1, "MCameraDC"); 65 // 66 // 40 67 ///////////////////////////////////////////////////////////////////////////// 41 68 #include "MHSectorVsTime.h" … … 93 120 void MHSectorVsTime::SetName(const char *name) 94 121 { 95 fGraph->SetName(name); 122 if (fGraph) 123 fGraph->SetName(name); 96 124 MParContainer::SetName(name); 97 125 } … … 103 131 void MHSectorVsTime::SetTitle(const char *title) 104 132 { 105 fGraph->SetTitle(title); 133 if (fGraph) 134 fGraph->SetTitle(title); 106 135 MParContainer::SetTitle(title); 107 136 } … … 160 189 fGraph->SetName(fEvt ? dynamic_cast<TObject*>(fEvt)->GetName() : "MCamEvent"); 161 190 fGraph->SetTitle(fTitle==gsDefTitle?"Camera":fTitle.Data()); 191 fGraph->SetMarkerStyle(kFullDotMedium); 162 192 163 193 fMin = FLT_MAX; … … 191 221 const Double_t val0 = fHCamera.GetMeanSectors(fSectors, fAreaIndex); 192 222 193 if (TMath::IsNaN(val0) /* || TMath::IsNaN(rms0)*/)194 return k CONTINUE;223 if (TMath::IsNaN(val0)) 224 return kTRUE; 195 225 196 226 fGraph->SetPoint(fGraph->GetN(), t, val0); … … 200 230 const Double_t rms0 = fHCamera.GetRmsSectors(fSectors, fAreaIndex); 201 231 if (TMath::IsNaN(rms0)) 202 return k CONTINUE;232 return kTRUE; 203 233 ((TGraphErrors*)fGraph)->SetPointError(fGraph->GetN()-1, 0, rms0); 204 234 } … … 221 251 fGraph->SetMaximum(fMax+add); 222 252 223 *fLog << dbg << "Min=" << fMin << " " << fMin-add << endl;224 *fLog << dbg << "Max=" << fMax << " " << fMax+add << endl;225 226 253 return kTRUE; 227 254 } … … 236 263 } 237 264 238 void MHSectorVsTime:: Draw(Option_t *opt)265 void MHSectorVsTime::Paint(Option_t *opt) 239 266 { 240 267 if (!fGraph) … … 244 271 return; 245 272 246 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);247 pad->SetBorderMode(0);248 249 AppendPad("");250 251 273 TString str(opt); 252 253 274 if (!str.Contains("A")) 254 275 str += "A"; 255 if (!str.Contains("L")) 256 str += "L"; 257 276 if (!str.Contains("P")) 277 str += "P"; 258 278 if (str.Contains("same", TString::kIgnoreCase)) 259 279 { … … 269 289 { 270 290 TAxis *axe = h->GetXaxis(); 271 axe->SetTimeFormat("%H:%M :%S%F1995-01-01 00:00:00 GMT");291 axe->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT"); 272 292 axe->SetTimeDisplay(1); 273 axe->SetLabelSize(0.025); 274 } 275 276 fGraph->Draw(str); 277 } 293 axe->SetLabelSize(0.033); 294 h->GetYaxis()->SetTitleOffset(1.15); 295 } 296 297 // This is a workaround if the TGraph has only one point. 298 // Otherwise MStatusDisplay::Update hangs. 299 gPad->GetListOfPrimitives()->Remove(fGraph); 300 fGraph->Draw(fGraph->GetN()<2 ? "A" : str.Data()); 301 } 302 303 // -------------------------------------------------------------------------- 304 // 305 // This displays the TGraph like you expect it to be (eg. time on the axis) 306 // It should also make sure, that the displayed time always is UTC and 307 // not local time... 308 // 309 void MHSectorVsTime::Draw(Option_t *opt) 310 { 311 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fGraph); 312 pad->SetBorderMode(0); 313 AppendPad(opt); 314 } -
trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.h
r6977 r7210 47 47 TArrayI fAreaIndex; 48 48 49 // MH 49 50 Bool_t SetupFill(const MParList *pList); 50 51 Bool_t Fill(const MParContainer *par, const Stat_t w=1); … … 55 56 ~MHSectorVsTime(); 56 57 57 void SetName(const char *name); 58 void SetTitle(const char *title); 59 58 // Setter 60 59 void SetNameEvt(const TString name) { fNameEvt = name; } 61 60 void SetNameTime(const TString name) { fNameTime = name; } … … 64 63 void SetAreaIndex(const TArrayI &a) { fAreaIndex=a; } 65 64 65 // Getter 66 66 TH1 *GetHistByName(const TString name="") const; 67 67 //TGraph *GetGraph() { return fGraph; } 68 68 69 // TObject 70 void SetName(const char *name); 71 void SetTitle(const char *title); 72 69 73 void Draw(Option_t *o=NULL); 74 void Paint(Option_t *o=NULL); 70 75 71 76 ClassDef(MHSectorVsTime, 1) // Histogram to sum camera events -
trunk/MagicSoft/Mars/mhvstime/MHVsTime.cc
r7033 r7210 291 291 fGraph->GetHistogram()->SetXTitle("Time"); 292 292 fGraph->GetHistogram()->GetXaxis()->SetLabelSize(0.033); 293 fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M :%S%F1995-01-01 00:00:00 GMT");293 fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT"); 294 294 fGraph->GetHistogram()->GetXaxis()->SetTimeDisplay(1); 295 295 } -
trunk/MagicSoft/Mars/mjobs/MJStar.cc
r7202 r7210 47 47 #include "MH3.h" 48 48 #include "MHVsTime.h" 49 #include "MHSectorVsTime.h" 49 50 #include "MHCamEvent.h" 50 51 #include "MHCamEventRot.h" … … 195 196 readreal.AddTree("Drive", MReadReports::kRequired); 196 197 readreal.AddTree("Starguider", MReadReports::kRequired); 198 readreal.AddTree("Currents", MReadReports::kRequired); 197 199 readreal.AddTree("CC"); 198 200 readreal.AddFiles(iter); … … 219 221 clean.SetNamePedPhotCam("MPedPhotFromExtractorRndm"); 220 222 221 //MSrcPosCalc poscalc; 222 //MSrcPosCorrect poscorrect; 223 MHillasCalc hcalc; 223 MSrcPosCalc poscalc; 224 MHillasCalc hcalc; 224 225 hcalc.Disable(MHillasCalc::kCalcConc); 225 226 … … 233 234 MFillH fillp2("MHPointing", "MTimeStarguider", "FillStarguider"); 234 235 fillp1.SetBit(MFillH::kDoNotDisplay); 235 //fillp2.SetNameTab("Drive"); 236 fillp1.SetBit(MFillH::kCanSkip); 237 fillp2.SetBit(MFillH::kCanSkip); 236 238 237 239 MFillH fill0a(&evt0a, "MSignalCam", "FillSignalCam"); … … 258 260 259 261 // Data 260 write.AddContainer("MHillas", "Events");261 write.AddContainer("MHillasExt", "Events");262 write.AddContainer("MHillasSrc", "Events");263 write.AddContainer("MImagePar", "Events");264 write.AddContainer("MNewImagePar", "Events");265 write.AddContainer("MRawEvtHeader", "Events");266 write.AddContainer("MPointingPos", "Events");262 write.AddContainer("MHillas", "Events"); 263 write.AddContainer("MHillasExt", "Events"); 264 write.AddContainer("MHillasSrc", "Events"); 265 write.AddContainer("MImagePar", "Events"); 266 write.AddContainer("MNewImagePar", "Events"); 267 write.AddContainer("MRawEvtHeader", "Events"); 268 write.AddContainer("MPointingPos", "Events"); 267 269 268 270 // Run Header 269 write.AddContainer("MRawRunHeader", "RunHeaders");270 write.AddContainer("MBadPixelsCam", "RunHeaders");271 write.AddContainer("MGeomCam", "RunHeaders");272 write.AddContainer("MObservatory", "RunHeaders");271 write.AddContainer("MRawRunHeader", "RunHeaders"); 272 write.AddContainer("MBadPixelsCam", "RunHeaders"); 273 write.AddContainer("MGeomCam", "RunHeaders"); 274 write.AddContainer("MObservatory", "RunHeaders"); 273 275 274 276 // Muon Setup 275 write.AddContainer("BinningRadius", "RunHeaders");276 write.AddContainer("BinningArcWidth", "RunHeaders");277 write.AddContainer("BinningRingBroadening", "RunHeaders");278 write.AddContainer("BinningSizeVsArcRadius", "RunHeaders");279 write.AddContainer("MMuonSetup", "RunHeaders");277 write.AddContainer("BinningRadius", "RunHeaders"); 278 write.AddContainer("BinningArcWidth", "RunHeaders"); 279 write.AddContainer("BinningRingBroadening", "RunHeaders"); 280 write.AddContainer("BinningSizeVsArcRadius", "RunHeaders"); 281 write.AddContainer("MMuonSetup", "RunHeaders"); 280 282 281 283 if (ismc) 282 284 { 283 285 // Monte Carlo Data 284 write.AddContainer("MMcEvt", "Events");285 write.AddContainer("MMcTrig", "Events");286 write.AddContainer("MMcEvt", "Events"); 287 write.AddContainer("MMcTrig", "Events"); 286 288 // Monte Carlo Run Headers 287 write.AddContainer("MMcRunHeader", "RunHeaders");288 write.AddContainer("MMcTrigHeader", "RunHeaders");289 write.AddContainer("MMcFadcHeader", "RunHeaders");290 write.AddContainer("MMcConfigRunHeader", "RunHeaders");291 write.AddContainer("MMcCorsikaRunHeader", "RunHeaders");289 write.AddContainer("MMcRunHeader", "RunHeaders"); 290 write.AddContainer("MMcTrigHeader", "RunHeaders"); 291 write.AddContainer("MMcFadcHeader", "RunHeaders"); 292 write.AddContainer("MMcConfigRunHeader", "RunHeaders"); 293 write.AddContainer("MMcCorsikaRunHeader", "RunHeaders"); 292 294 } 293 295 else … … 298 300 write.AddContainer("MTimeDrive", "Drive"); 299 301 // Starguider 300 write.AddContainer("MReportStarguider", "Starguider" );301 write.AddContainer("MTimeStarguider", "Starguider" );302 write.AddContainer("MReportStarguider", "Starguider", kFALSE); 303 write.AddContainer("MTimeStarguider", "Starguider", kFALSE); 302 304 // Effective On Time 303 305 writet.AddContainer("MEffectiveOnTime", "EffectiveOnTime"); … … 306 308 307 309 // What to write in muon tree 308 writem.AddContainer("MMuonSearchPar", "Muons");309 writem.AddContainer("MMuonCalibPar", "Muons");310 writem.AddContainer("MHillas", "Muons");311 writem.AddContainer("MHillasExt", "Muons");312 writem.AddContainer("MHillasSrc", "Muons");313 writem.AddContainer("MImagePar", "Muons");314 writem.AddContainer("MNewImagePar", "Muons");315 writem.AddContainer("MRawEvtHeader", "Muons");316 writem.AddContainer("MPointingPos", "Muons");310 writem.AddContainer("MMuonSearchPar", "Muons"); 311 writem.AddContainer("MMuonCalibPar", "Muons"); 312 writem.AddContainer("MHillas", "Muons"); 313 writem.AddContainer("MHillasExt", "Muons"); 314 writem.AddContainer("MHillasSrc", "Muons"); 315 writem.AddContainer("MImagePar", "Muons"); 316 writem.AddContainer("MNewImagePar", "Muons"); 317 writem.AddContainer("MRawEvtHeader", "Muons"); 318 writem.AddContainer("MPointingPos", "Muons"); 317 319 if (ismc) 318 320 { 319 321 // Monte Carlo Data 320 writem.AddContainer("MMcEvt", "Muons");321 writem.AddContainer("MMcTrig", "Muons");322 writem.AddContainer("MMcEvt", "Muons"); 323 writem.AddContainer("MMcTrig", "Muons"); 322 324 } 323 325 … … 344 346 tlist2.AddToList(&fill0a); 345 347 tlist2.AddToList(&fill0b); 346 //tlist2.AddToList(&poscalc); 347 //tlist2.AddToList(&poscorrect); 348 tlist2.AddToList(&poscalc); 348 349 tlist2.AddToList(&hcalc); 349 350 tlist2.AddToList(&fill1); … … 389 390 // ------------------------------------------------------------ 390 391 392 // Initialize histogram 393 MHSectorVsTime histdc; 394 histdc.SetNameTime("MTimeCurrents"); 395 histdc.SetTitle("Mean of all DC Currents;;<I> [nA]"); 396 /* 397 // Define area index [0=inner, 1=outer] 398 // TArrayI inner(1); inner[0] = 0; histdc.SetAreaIndex(inner); 399 */ 400 401 // Task to fill the histogram 402 MFillH filldc(&histdc, "MCameraDC", "FillDC"); 403 filldc.SetNameTab("Currents"); 404 391 405 MFillH fillw("MHWeather", "MTimeCC", "FillWeather"); 392 //tlist2.AddToList(&fill6);393 //tlist2.AddToList(&fill7);394 //tlist2.AddToList(&fill9);395 406 396 407 MPointingPosCalc pcalc; 408 409 // ------------------------------------------------------------ 397 410 398 411 tlist.AddToList(ismc ? (MTask*)&readmc : (MTask*)&readreal); … … 404 417 tlist.AddToList(&fillp1, "Drive"); 405 418 tlist.AddToList(&fillp2, "Starguider"); 419 tlist.AddToList(&filldc, "Currents"); 406 420 } 407 421 tlist.AddToList(&write); -
trunk/MagicSoft/Mars/mpointing/MHPointing.cc
r7202 r7210 130 130 fReportSG = (MReportStarguider*)plist->FindObject("MReportStarguider"); 131 131 if (!fReportSG) 132 { 133 *fLog << warn << "MReportStarguider not found... abort." << endl; 134 return kFALSE; 135 } 132 *fLog << warn << "MReportStarguider not found..." << endl; 133 136 134 fReportCosy = (MReportDrive*)plist->FindObject("MReportDrive"); 137 135 if (!fReportCosy) 138 { 139 *fLog << warn << "MReportDrive not found... abort." << endl; 140 return kFALSE; 141 } 136 *fLog << warn << "MReportDrive not found..." << endl; 142 137 143 138 // Reset Graphs … … 166 161 if (t->GetName()==(TString)"MTimeStarguider") 167 162 { 163 if (!fReportSG) 164 { 165 *fLog << err << "ERROR: fReportSG==NULL... abort." << endl; 166 return kFALSE; 167 } 168 168 169 AddPoint(fBrightness, tm, fReportSG->GetSkyBrightness()); 169 170 AddPoint(fNumStars, tm, fReportSG->GetNumIdentifiedStars()); … … 184 185 } 185 186 186 if (t->GetName()==(TString)"MTimeDrive") 187 { 187 if (fReportCosy && t->GetName()==(TString)"MTimeDrive") 188 { 189 if (!fReportCosy) 190 { 191 *fLog << err << "ERROR: fReportCosy==NULL... abort." << endl; 192 return kFALSE; 193 } 194 188 195 AddPoint(fDevTimeCosy, tm, fReportCosy->GetAbsError()*60); 189 196 if (fPosZd.GetY()[fPosZd.GetN()-1] != fReportCosy->GetNominalZd())
Note:
See TracChangeset
for help on using the changeset viewer.