Changeset 9441 for trunk/MagicSoft/Mars/mjobs/MJSimulation.cc
- Timestamp:
- 05/10/09 11:52:17 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJSimulation.cc
r9428 r9441 62 62 63 63 #include "MArgs.h" 64 //#include "MDirIter.h"64 #include "MDirIter.h" 65 65 #include "MParList.h" 66 66 #include "MTaskList.h" … … 126 126 // 127 127 MJSimulation::MJSimulation(const char *name, const char *title) 128 : fForceMode(kFALSE), fCamera(kTRUE) ,fForceTrigger(kFALSE) 128 : fForceMode(kFALSE), fCamera(kTRUE), fForceTrigger(kFALSE), 129 fOperationMode(kModeData) 129 130 { 130 131 fName = name ? name : "MJSimulation"; … … 140 141 return kTRUE; 141 142 } 142 143 Bool_t MJSimulation::WriteResult(const MParList &plist) 143 /* 144 TString MJSimulation::GetOutFile(const MSequence &seq) const 145 { 146 return seq.IsValid() ? Form("ceres%08d.root", seq.GetSequence()) : "ceres.root"; 147 } 148 */ 149 150 Bool_t MJSimulation::WriteResult(const MParList &plist, const MSequence &seq) 144 151 { 145 152 if (fPathOut.IsNull()) … … 151 158 TObjArray cont; 152 159 cont.Add(const_cast<TEnv*>(GetEnv())); 153 //cont.Add(const_cast<MSequence*>(&fSequence)); 160 if (seq.IsValid()) 161 cont.Add(const_cast<MSequence*>(&seq)); 154 162 155 163 cont.Add(plist.FindObject("PulseShape")); … … 160 168 if (fDisplay) 161 169 { 162 // TString title = "-- Reflector: "; 163 // title += fSequence.GetSequence(); 164 // title += " --"; 165 // fDisplay->SetTitle(title, kFALSE); 170 TString title = "-- Ceres"; 171 if (seq.IsValid()) 172 { 173 title += ": "; 174 title += seq.GetSequence(); 175 } 176 title += " --"; 166 177 fDisplay->SetTitle("Ceres", kFALSE); 167 178 … … 169 180 } 170 181 171 // const TString oname = Form("reflector%08d.root", fSequence.GetSequence()); 172 const TString oname = "ceres.root"; 173 return WriteContainer(cont, oname, "RECREATE"); 182 const TString name = seq.IsValid() ? Form("ceres%08d.root", seq.GetSequence()) : "ceres.root"; 183 return WriteContainer(cont, name, "RECREATE"); 174 184 } 175 185 … … 235 245 } 236 246 237 Bool_t MJSimulation::Process(const MArgs &args )247 Bool_t MJSimulation::Process(const MArgs &args, const MSequence &seq) 238 248 { 239 249 /* … … 245 255 */ 246 256 247 //if (!HasWritePermission(GetPathOut()))248 //return kFALSE;257 // if (!HasWritePermission(CombinePath(fPathOut, GetOutFile(seq)))) 258 // return kFALSE; 249 259 250 260 *fLog << inf; … … 254 264 return kFALSE; 255 265 256 *fLog << warn << "FIXME: Monte Carlo simulation: Sequences not supported yet."; 257 //*fLog << fSequence.GetFileName() << endl; 266 if (seq.IsValid()) 267 *fLog << fSequence.GetFileName() << endl; 268 else 269 *fLog << args.GetNumArguments() << "-files" << endl; 258 270 *fLog << endl; 259 271 272 MDirIter iter; 273 if (seq.IsValid() && seq.GetRuns(iter, MSequence::kCorsika)<=0) 274 { 275 *fLog << err << "ERROR - Sequence valid but without files." << endl; 276 return kFALSE; 277 } 278 260 279 // -------------------------------------------------------------------------------- 261 262 //MDirIter iter;263 //if (fSequence.GetRuns(iter, MSequence::kCalibrated)<=0)264 // return kFALSE;265 280 266 281 // Setup Parlist … … 297 312 //header.InitFadcType(3); 298 313 299 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTData); 300 if (args.GetNumArguments()==1) 301 { 302 if (!args.GetArgumentStr(0).CompareTo("pedestal", TString::kIgnoreCase)) 303 { 304 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPedestal); 305 header.SetSourceInfo("Pedestal"); 306 } 307 if (!args.GetArgumentStr(0).CompareTo("calibration", TString::kIgnoreCase)) 308 { 309 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTCalibration); 310 header.SetSourceInfo("Calibration"); 311 } 312 if (!args.GetArgumentStr(0).CompareTo("pointrun", TString::kIgnoreCase)) 313 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPointRun); 314 switch (fOperationMode) 315 { 316 case kModeData: 317 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTData); 318 break; 319 320 case kModePed: 321 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPedestal); 322 header.SetSourceInfo("Pedestal"); 323 break; 324 325 case kModeCal: 326 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTCalibration); 327 header.SetSourceInfo("Calibration"); 328 break; 329 330 case kModePointRun: 331 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPointRun); 332 break; 314 333 } 315 334 … … 333 352 read.SetForceMode(fForceMode); 334 353 335 for (int i=0; i<args.GetNumArguments(); i++) 336 read.AddFile(args.GetArgumentStr(i)); 354 if (!seq.IsValid()) 355 { 356 for (int i=0; i<args.GetNumArguments(); i++) 357 read.AddFile(args.GetArgumentStr(i)); 358 } 359 else 360 read.AddFiles(iter); 337 361 338 362 MSimMMCS simmmcs; … … 366 390 // ------------------------------------------------------------------- 367 391 368 MBinning binse( 1 00, 1, 100000, "BinningEnergy", "log");369 MBinning binsth( 70, 0.9, 900000, "BinningThreshold", "log");370 MBinning binsee( 3 5, 0.9, 900000, "BinningEnergyEst", "log");392 MBinning binse( 120, 1, 1000000, "BinningEnergy", "log"); 393 MBinning binsth( 60, 0.9, 900000, "BinningThreshold", "log"); 394 MBinning binsee( 36, 0.9, 900000, "BinningEnergyEst", "log"); 371 395 MBinning binss( 100, 1, 10000000, "BinningSize", "log"); 372 396 // MBinning binsi( 100, -500, 500, "BinningImpact"); 373 MBinning binsi( 55, 0, 1100, "BinningImpact");397 MBinning binsi( 32, 0, 800, "BinningImpact"); 374 398 MBinning binsh( 150, 0, 50, "BinningHeight"); 375 399 MBinning binsaz(720, -360, 360, "BinningAz"); 376 400 MBinning binszd( 70, 0, 70, "BinningZd"); 377 MBinning binsvc( 45, 0, 9, "BinningViewCone");401 MBinning binsvc( 35, 0, 7, "BinningViewCone"); 378 402 MBinning binsel(150, 0, 50, "BinningTotLength"); 379 403 MBinning binsew(150, 0, 15, "BinningMedLength"); … … 845 869 //------------------------------------------- 846 870 847 if (!WriteResult(plist ))871 if (!WriteResult(plist, seq)) 848 872 return kFALSE; 849 873
Note:
See TracChangeset
for help on using the changeset viewer.