Changeset 9328 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 02/12/09 20:07:51 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MDataSet.cc
r9212 r9328 217 217 #include "MEnv.h" 218 218 #include "MAstro.h" 219 #include "MString.h" 219 220 #include "MDirIter.h" 220 221 #include "MSequence.h" … … 297 298 // Set default sequence file and dir name 298 299 if (name.IsNull()) 299 name = Form("%s%04d/sequence%08d.txt", sequences.Data(), num[i]/10000, num[i]);300 name = MString::Format("%s%04d/sequence%08d.txt", sequences.Data(), num[i]/10000, num[i]); 300 301 if (dir.IsNull()) 301 dir = Form("%s%04d/%08d", data.Data(), num[i]/10000, num[i]);302 dir = MString::Format("%s%04d/%08d", data.Data(), num[i]/10000, num[i]); 302 303 303 304 // Check if sequence information is contained in Dataset file … … 385 386 386 387 // Determin the prefix to access this resource 387 const TString prefix = num==(UInt_t)-1 ? "" : Form("%d", num);388 const TString prefix = num==(UInt_t)-1 ? "" : MString::Format("%d", num); 388 389 389 390 // Open and read the file … … 494 495 const Bool_t useds = seq.GetFileName()==fFileName; 495 496 496 out << "Sequence" << Form("%08d", seq.GetSequence()) << ".File: " << (useds?"-":seq.GetFileName()) << endl;497 out << "Sequence" << Form("%08d", seq.GetSequence()) << ".Dir: " << seq.GetDataPath() << endl;497 out << "Sequence" << MString::Format("%08d", seq.GetSequence()) << ".File: " << (useds?"-":seq.GetFileName()) << endl; 498 out << "Sequence" << MString::Format("%08d", seq.GetSequence()) << ".Dir: " << seq.GetDataPath() << endl; 498 499 if (!useds && seq.GetNumExclRuns()>0) 499 out << "Sequence" << Form("%08d", seq.GetSequence()) << ".Exclude: " << seq.GetExcludedRuns() << endl;500 out << "Sequence" << MString::Format("%08d", seq.GetSequence()) << ".Exclude: " << seq.GetExcludedRuns() << endl; 500 501 501 502 if (useds) -
trunk/MagicSoft/Mars/mjobs/MJSimulation.cc
r9319 r9328 152 152 153 153 cont.Add(plist.FindObject("MPulseShape")); 154 cont.Add(plist.FindObject(" MReflector"));154 cont.Add(plist.FindObject("Reflector")); 155 155 cont.Add(plist.FindObject("MGeomCam")); 156 cont.Add(plist.FindObject("Geom APDs"));156 cont.Add(plist.FindObject("GeomCones")); 157 157 158 158 if (fDisplay) … … 248 248 // -------------------------------------------------------------------------------- 249 249 250 // ---------- FIXME FIXME FIXME ----------- 251 // FIXME: Find a better name (What if both cams are identical?) 252 MParEnv env1("GeomAPDs"); // Inheritance! 253 MParEnv env2("MGeomCam"); // Inheritance! 250 // FIXME: Allow empty GeomCones! 251 MParEnv env0("Reflector"); 252 MParEnv env1("GeomCones"); 253 MParEnv env2("MGeomCam"); 254 env0.SetClassName("MReflector"); 254 255 env1.SetClassName("MGeomCam"); 255 256 env2.SetClassName("MGeomCam"); 257 plist.AddToList(&env0); 256 258 plist.AddToList(&env1); 257 259 plist.AddToList(&env2); 258 259 // FIXME: Allow the user to create other reflectors260 MReflector reflector;261 plist.AddToList(&reflector);262 260 263 261 plist.FindCreateObj("MPedPhotCam", "MPedPhotFromExtractorRndm"); … … 314 312 MSimMMCS simmmcs; 315 313 316 MSimAbsorption absapd(" AbsorptionAPDs");317 MSimAbsorption absmir(" AbsorptionMirrors");318 MSimAbsorption cones(" AbsorptionCones");314 MSimAbsorption absapd("PhotonDetectionEfficiency"); 315 MSimAbsorption absmir("MirrorReflectivity"); 316 MSimAbsorption cones("ConesAngularAcceptance"); 319 317 cones.SetUseTheta(); 320 318 … … 322 320 323 321 MSimReflector reflect; 324 reflect.SetNameGeomCam("Geom APDs");322 reflect.SetNameGeomCam("GeomCones"); 325 323 // MSimStarField stars; 326 324 … … 337 335 MBinning binszd( 70, 0, 70, "BinningZd"); 338 336 MBinning binsvc(155, 0, 31, "BinningViewCone"); 339 MBinning binsew(150, 0, 25, "BinningEvtWidth");337 MBinning binsew(150, 0, 50, "BinningEvtWidth"); 340 338 MBinning binstr("BinningTrigPos"); 341 339 … … 357 355 MH3 mhtp("TriggerPos.fVal-IntendedPulsePos.fVal-MPulseShape.GetPulseWidth"); 358 356 mhtp.SetName("TrigPos"); 359 mhtp.SetTitle("Trigger position w.r.t. the first photon hitting a n APD");357 mhtp.SetTitle("Trigger position w.r.t. the first photon hitting a detector"); 360 358 361 359 MH3 mhew("MPhotonStatistics.fTimeLast-MPhotonStatistics.fTimeFirst - MRawRunHeader.GetFreqSampling/1000.*MRawRunHeader.fNumSamplesHiGain - 2*MPulseShape.GetPulseWidth"); 362 360 mhew.SetName("EvtWidth"); 363 mhew.SetTitle("Time between first and last photon hitting a n APD");361 mhew.SetTitle("Time between first and last photon hitting a detector"); 364 362 365 363 MFillH fillh1(&mhn1, "", "FillH1"); … … 372 370 fillh3.SetNameTab("H3", "Distribution after trigger"); 373 371 filltp.SetNameTab("TrigPos", "TriggerPosition w.r.t the first photon"); 374 fillew.SetNameTab("EvtWidth", "Time between first and last photon hitting a n APD");372 fillew.SetNameTab("EvtWidth", "Time between first and last photon hitting a detector"); 375 373 376 374 MHPhotonEvent planeG(1); // Get from MaxImpact … … 387 385 MFillH fillG(&planeG, "MPhotonEvent", "FillGround"); 388 386 MFillH fill0(&plane0, "MirrorPlane0", "FillReflector"); 389 MFillH fill1(&plane1, "MirrorPlane1", "FillCamShadow");387 //MFillH fill1(&plane1, "MirrorPlane1", "FillCamShadow"); 390 388 MFillH fill2(&plane2, "MirrorPlane2", "FillCandidates"); 391 389 MFillH fill3(&plane3, "MirrorPlane3", "FillReflected"); 392 390 MFillH fill4(&plane4, "MirrorPlane4", "FillFocal"); 393 391 MFillH fillF1(&planeF1, "MPhotonEvent", "FillCamera"); 394 MFillH fillF2(&planeF2, "MPhotonEvent", "Fill APDs");392 MFillH fillF2(&planeF2, "MPhotonEvent", "FillCones"); 395 393 //MFillH fillP(&psf, "MPhotonEvent", "FillPSF"); 396 394 397 395 fillG.SetNameTab("Ground", "Photon distribution at ground"); 398 396 fill0.SetNameTab("Reflector", "Photon distribution at reflector plane w/o camera shadow"); 399 fill1.SetNameTab("CamShadow", "Photon distribution at reflector plane w/ camera shadow");397 //fill1.SetNameTab("CamShadow", "Photon distribution at reflector plane w/ camera shadow"); 400 398 fill2.SetNameTab("Candidates", "'Can hit' photon distribution at reflector plane w/ camera shadow"); 401 399 fill3.SetNameTab("Reflected", "Photon distribution after reflector projected to reflector plane"); 402 400 fill4.SetNameTab("Focal", "Photon distribution at focal plane"); 403 401 fillF1.SetNameTab("Camera", "Photon distribution which hit the detector"); 404 fillF2.SetNameTab(" APDs","Photon distribution after cones");402 fillF2.SetNameTab("Cones", "Photon distribution after cones"); 405 403 //fillP.SetNameTab("PSF", "Photon distribution after cones for all mirrors"); 406 404 407 405 // ------------------------------------------------------------------- 408 406 409 const TString rule1(Form("s/cer([0-9]+)/%s\\/ref$1.root/", Esc(fPathOut).Data())); 410 const TString rule2(Form("s/cer([0-9]+)/%s\\/sig$1.root/", Esc(fPathOut).Data())); 411 const TString rule3(Form("s/cer([0-9]+)/%s\\/cam$1.root/", Esc(fPathOut).Data())); 407 // FIXME: Pedestal and Calibration runs should get P and C 408 const TString rule1(Form("s/cer([0-9]+)/%s\\/00$1_R_MonteCarlo.root/", Esc(fPathOut).Data())); 409 const TString rule2(Form("s/cer([0-9]+)/%s\\/00$1_I_MonteCarlo.root/", Esc(fPathOut).Data())); 410 const TString rule3(Form("s/cer([0-9]+)/%s\\/00$1_D_MonteCarlo.root/", Esc(fPathOut).Data())); 412 411 413 412 MWriteRootFile write3a( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file"); … … 471 470 472 471 MSimGeomCam simgeom; 473 simgeom.SetNameGeomCam("Geom APDs");472 simgeom.SetNameGeomCam("GeomCones"); 474 473 475 474 MSimCalibrationSignal simcal; 476 simcal.SetNameGeomCam("Geom APDs");475 simcal.SetNameGeomCam("GeomCones"); 477 476 478 477 // Dark Current: 4MHz = 0.004 GHz … … 484 483 // simnsb.SetFreq(0.005, 0.004); // 5MHz/cm^2, 4MHz 485 484 simnsb.SetFreq(0, 0.04); // 40MHz fixed for each APD 486 simnsb.SetNameGeomCam("Geom APDs");485 simnsb.SetNameGeomCam("GeomCones"); 487 486 488 487 // FIXME: How do we handle star-light? We need the rate but we also … … 491 490 MSimAPD simapd; 492 491 simapd.SetFreq(0.04); // Must be identical to MSimRanodmPhotons!! 493 simapd.SetNameGeomCam("Geom APDs");492 simapd.SetNameGeomCam("GeomCones"); 494 493 495 494 MSimExcessNoise simexcnoise; … … 563 562 { 564 563 tasks.AddToList(&fill0); 565 tasks.AddToList(&fill1);564 //tasks.AddToList(&fill1); 566 565 tasks.AddToList(&fill2); 567 566 tasks.AddToList(&fill3); … … 645 644 return kFALSE; 646 645 646 // FIXME: If pedestal file given use the values from this file 647 647 //------------------------------------------- 648 648 … … 652 652 653 653 header.Print(); 654 655 // FIXME: Display acceptance curves! 654 656 655 657 if (fDisplay) … … 666 668 shape.DrawClone()->SetBit(kCanDelete); 667 669 668 if ( header.IsDataRun() || header.IsPointRun())670 if (env0.GetCont() && (header.IsDataRun() || header.IsPointRun())) 669 671 { 670 672 c.cd(3); … … 674 676 gPad->SetGridy(); 675 677 gROOT->SetSelectedPad(0); 676 reflector.DrawClone("line")->SetBit(kCanDelete);678 static_cast<MReflector*>(env0.GetCont())->DrawClone("line")->SetBit(kCanDelete); 677 679 678 680 } … … 680 682 if (fCamera) 681 683 { 682 if ( dynamic_cast<MGeomCam*>(env1.GetCont()))684 if (env1.GetCont()) 683 685 { 684 686 c.cd(2); … … 696 698 } 697 699 698 if ( dynamic_cast<MGeomCam*>(env2.GetCont()))700 if (env2.GetCont()) 699 701 { 700 702 c.cd(4); -
trunk/MagicSoft/Mars/mjobs/MSequence.cc
r9318 r9328 416 416 case kRoot: // mcdata 417 417 d += "rawfiles/"; 418 if (!fNight) 419 *fLog << "WARNING - No Night-resource... path not supported." << endl; 418 420 d += fNight.GetStringFmt("%Y/%m/%d"); 419 421 break; … … 423 425 break; 424 426 case kCalibrated: 425 d += Form("callisto/%04d/%08d", fSequence/10000, fSequence);427 d += MString::Format("callisto/%04d/%08d", fSequence/10000, fSequence); 426 428 break; 427 429 case kImages: 428 d += Form("star/%04d/%08d", fSequence/10000, fSequence);430 d += MString::Format("star/%04d/%08d", fSequence/10000, fSequence); 429 431 break; 430 432 } … … 477 479 478 480 // ------------- Create file name -------------- 479 TString n = night.GetStringFmt("%Y%m%d_"); 481 TString n; 482 483 if (night) 484 n += night.GetStringFmt("%Y%m%d_"); 480 485 481 486 // This is for MCs (FIXME!!!!) 482 487 if (run<0) 483 n += Form("%08d", -run);488 n += MString::Format("%08d", -run); 484 489 else 485 490 { 486 491 if (tel>0) 487 n += Form("M%d_", tel);492 n += MString::Format("M%d_", tel); 488 493 489 494 // R. DeLosReyes and T. Bretz 490 495 // Changes to read the DAQ numbering format. Changes takes place 491 496 // between runs 35487 and 00035488 (2004_08_30) 492 n += Form(run>limit ? "%08d" : "%05d", run);497 n += MString::Format(run>limit ? "%08d" : "%05d", run); 493 498 494 499 if (tel>0) 495 n += Form(".%03d", file);500 n += MString::Format(".%03d", file); 496 501 } 497 502 … … 876 881 fSequence = (UInt_t)env.GetValue("Sequence", (Int_t)seq); 877 882 878 const TString prefix = Form("Sequence%08d", fSequence);883 const TString prefix = MString::Format("Sequence%08d", fSequence); 879 884 880 885 fTelescope = GetEnvValue2(env, prefix, "Telescope", 1); … … 890 895 891 896 str = GetEnvValue2(env, prefix, "Night", ""); 892 if (str.IsNull()) 893 fNight = MTime(); 894 else 895 { 896 str += " 00:00:00"; 897 fNight.SetSqlDateTime(str); 898 } 899 900 fPeriod = fNight.GetMagicPeriod(); 897 SetNight(str); 901 898 902 899 fProject = GetEnvValue2(env, prefix, "Project", ""); … … 1160 1157 while (p<pos+n) 1161 1158 { 1162 str += Form(" %d", f[p]);1159 str += MString::Format(" %d", f[p]); 1163 1160 1164 1161 if (p==pos+n-1) … … 1171 1168 1172 1169 if (i>1) 1173 str += Form(":%d", f[p+i-1]);1170 str += MString::Format(":%d", f[p+i-1]); 1174 1171 1175 1172 p += i; … … 1212 1209 return str; 1213 1210 1214 str += Form(" %d", r[p]);1211 str += MString::Format(" %d", r[p]); 1215 1212 // p now points to the last entry which fits and 1216 1213 // has a file number == 0 … … 1219 1216 // More tahn one found (i-1>1) 1220 1217 str += i-1==1 ? " " : ":"; 1221 str += Form("%d", r[p]);1218 str += MString::Format("%d", r[p]); 1222 1219 1223 1220 // One step forward … … 1294 1291 str += '\n'; 1295 1292 str += pre; 1296 str += Form("Run%08d:", r[pos]);1293 str += MString::Format("Run%08d:", r[pos]); 1297 1294 str += GetNumSequence(pos, n, f); 1298 1295 } … … 1327 1324 const TString opt(o); 1328 1325 1329 const TString pre = opt.Contains("prefixed") ? Form("Sequence%08d.", fSequence) : "";1326 const TString pre = opt.Contains("prefixed") ? MString::Format("Sequence%08d.", fSequence) : ""; 1330 1327 1331 1328 if (!IsValid()) … … 1345 1342 if (fMonteCarlo) 1346 1343 out << pre << "MonteCarlo: Yes" << endl; 1347 if (fPeriod >=0)1344 if (fPeriod!=(UInt_t)-1) 1348 1345 out << pre << "Period: " << fPeriod << endl; 1349 1346 if (fNight!=MTime()) … … 1513 1510 { 1514 1511 TString night(txt); 1512 1513 if (night.IsNull()) 1514 { 1515 fNight = MTime(); 1516 fPeriod = UInt_t(-1); 1517 return; 1518 } 1519 1515 1520 night += " 00:00:00"; 1516 1521 fNight.SetSqlDateTime(night); … … 1574 1579 seq = "/magic/"; 1575 1580 if (ismc) 1576 seq += "montecarlo/";1577 seq += Form("sequences/%04d/sequence%08d.txt", numseq/10000, numseq);1581 seq += "montecarlo/"; 1582 seq += MString::Format("sequences/%04d/sequence%08d.txt", numseq/10000, numseq); 1578 1583 gLog << inf << "Inflated sequence file: " << seq << endl; 1579 1584 }
Note:
See TracChangeset
for help on using the changeset viewer.