Changeset 9359 for trunk/MagicSoft/Mars
- Timestamp:
- 02/20/09 00:39:31 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9358 r9359 145 145 146 146 147 148 149 147 2009/02/18 Thomas Bretz 150 148 -
trunk/MagicSoft/Mars/NEWS
r9351 r9359 66 66 * The camera ''electronics'' can now be ''switched off'' 67 67 68 * A new tab '' info'' now display basic things like the reflector68 * A new tab ''Info'' now display basic things like the reflector 69 69 layout 70 70 … … 83 83 * For caluclating the displayed image parameters in ceres a basic 84 84 image cleaning removing isolated pixels is now done. 85 86 * The magnetic field direction (ARRANG) is now taken into account 87 88 * Added plot for the energy threshold after trigger ''Threshold'' 89 90 * Added plot for the effective collection area after trigger ''TrigArea'' 85 91 86 92 ;star -
trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.cc
r9352 r9359 183 183 // g[93] angle between array x-direction and magnetic north 184 184 185 186 fImpactMax = g[86]; 185 // This is a trick to use CERARY for storage of the 186 // maximum simulated impact 187 fImpactMax = -1; 188 if (TMath::Nint(g[84])==1 && TMath::Nint(g[85])==1 && 189 TMath::Nint(g[88])==1 && TMath::Nint(g[89])==1 && 190 g[86]==g[87]) 191 fImpactMax = g[86]; 187 192 188 193 fWavelengthMin = g[94]; // Cherenkov bandwidth lower end in nm … … 283 288 *fLog << " w.r.t. magnetic North." << endl; 284 289 } 290 291 if (fImpactMax>0) 292 *fLog << "Max.sim.Impact: " << fImpactMax << "cm" << endl; 285 293 286 294 *fLog << "Options used: "; -
trunk/MagicSoft/Mars/mhflux/MHCollectionArea.cc
r9301 r9359 19 19 ! Author(s): Harald Kornmayer 1/2001 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 821 ! Copyright: MAGIC Software Development, 2000-2009 22 22 ! 23 23 ! … … 67 67 // 68 68 MHCollectionArea::MHCollectionArea(const char *name, const char *title) 69 : fMcEvt(0), f McAreaRadius(-1), fIsExtern(kFALSE)69 : fMcEvt(0), fHeader(0), fMcAreaRadius(-1), fIsExtern(kFALSE) 70 70 { 71 71 // initialize the histogram for the distribution r vs E … … 148 148 MH::SetBinomialErrors(fHEnergy, *hsel, *hall); 149 149 #endif 150 151 fHEnergy.Scale(totalarea);150 if (fMcAreaRadius>0) 151 fHEnergy.Scale(totalarea); 152 152 153 153 delete hsel; … … 161 161 if (!fIsExtern) 162 162 fHistAll.Reset(); 163 164 fHeader = (MMcRunHeader*)pl->FindObject("MMcRunHeader"); 165 if (!fHeader) 166 { 167 *fLog << err << "MMcRunHeader not found... abort." << endl; 168 return kFALSE; 169 } 163 170 164 171 fMcEvt = (MMcEvt*)pl->FindObject("MMcEvt"); … … 202 209 } 203 210 211 void MHCollectionArea::GetImpactMax() 212 { 213 if (fHeader->GetImpactMax()<=fMcAreaRadius*100) 214 return; 215 216 fMcAreaRadius = 0.01*fHeader->GetImpactMax(); // cm->m 217 *fLog << inf << "Maximum simulated impact: " << fMcAreaRadius << "m" << endl; 218 } 219 204 220 Bool_t MHCollectionArea::ReInit(MParList *plist) 205 221 { 206 MMcRunHeader *runheader = (MMcRunHeader*)plist->FindObject("MMcRunHeader"); 207 if (!runheader) 208 { 209 *fLog << err << "MMcRunHeader not found... abort." << endl; 210 return kFALSE; 211 } 212 213 if (runheader->GetImpactMax()>fMcAreaRadius*100) 214 { 215 fMcAreaRadius = 0.01*runheader->GetImpactMax(); // cm->m 216 *fLog << inf << "Maximum simulated impact: " << fMcAreaRadius << "m" << endl; 217 } 218 219 if (fCorsikaVersion!=0 && fCorsikaVersion!=runheader->GetCorsikaVersion()) 222 GetImpactMax(); 223 224 if (fCorsikaVersion!=0 && fCorsikaVersion!=fHeader->GetCorsikaVersion()) 220 225 { 221 226 *fLog << warn; 222 227 *fLog << "Warning - Read files have different Corsika versions..." << endl; 223 *fLog << " Last file=" << fCorsikaVersion << " New file=" << runheader->GetCorsikaVersion() << endl;224 } 225 fCorsikaVersion = runheader->GetCorsikaVersion();228 *fLog << " Last file=" << fCorsikaVersion << " New file=" << fHeader->GetCorsikaVersion() << endl; 229 } 230 fCorsikaVersion = fHeader->GetCorsikaVersion(); 226 231 227 232 if (fIsExtern) 228 233 return kTRUE; 229 234 230 fTotalNumSimulatedShowers += runheader->GetNumSimulatedShowers();235 fTotalNumSimulatedShowers += fHeader->GetNumSimulatedShowers(); 231 236 *fLog << inf << "Total Number of Simulated showers: " << fTotalNumSimulatedShowers << endl; 232 237 233 fAllEvtsTriggered |= runheader->GetAllEvtsTriggered();238 fAllEvtsTriggered |= fHeader->GetAllEvtsTriggered(); 234 239 *fLog << inf << "Only triggered events avail: " << (fAllEvtsTriggered?"yes":"no") << endl; 235 240 … … 248 253 const Float_t emax = crh->GetEUppLim(); 249 254 const Float_t expo = 1 + crh->GetSlopeSpec(); 250 const Float_t k = runheader->GetNumSimulatedShowers() /255 const Float_t k = fHeader->GetNumSimulatedShowers() / 251 256 (pow(emax,expo) - pow(emin,expo)); 252 257 … … 271 276 272 277 const Float_t energy = (e1+e2)/2.; 273 fHistAll.Fill(20, energy, events); 278 for (int j=0; j<TMath::Nint(events); j++) 279 fHistAll.Fill(0., energy); 274 280 // you have MMcRunHeader.fShowerThetaMin and MMcRunHeader.fShowerThetaMax 275 281 } … … 280 286 void MHCollectionArea::Paint(Option_t *option) 281 287 { 282 if (TString(option)=="paint3") 283 { 284 /* 285 TH1 *h = dynamic_cast<TH1*>(gPad->FindObject("Efficiency")); 286 if (h) 287 { 288 const TString txt = Form("N/N_{0}=%.2f", 289 GetCollectionAreaEff(), 290 GetCollectionAreaAbs(), fMcAreaRadius); 291 292 TLatex text(0.31, 0.95, txt); 293 text.SetBit(TLatex::kTextNDC); 294 text.SetTextSize(0.04); 295 text.Paint();*/ 296 return; 297 } 298 if (TString(option)=="paint4") 299 { 300 //const TString txt = Form("A_{eff}=%.0fm^{2} A_{abs}=%.0fm^{2} r=%.0fm", 301 // GetCollectionAreaEff(), 302 // GetCollectionAreaAbs(), fMcAreaRadius); 288 if (TString(option)=="paint4" && fMcAreaRadius>0) 289 { 303 290 const TString txt = MString::Format("r_{max}=%.0fm --> A_{max}=%.0fm^{2}", 304 291 fMcAreaRadius, GetCollectionAreaAbs()); … … 445 432 MH::SetBinomialErrors(*h, *h2, *h1); 446 433 #endif 447 h->SetNameTitle("Efficiency", " Combined cut and trigger efficiency");434 h->SetNameTitle("Efficiency", "Efficiency"); 448 435 h->SetDirectory(NULL); 449 AppendPad("paint3");436 //AppendPad("paint3"); 450 437 } 451 438 else … … 477 464 Bool_t MHCollectionArea::Finalize() 478 465 { 466 GetImpactMax(); 467 479 468 *fLog << all << "Maximum simulated impact found: " << fMcAreaRadius << "m" << endl; 480 469 -
trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h
r9153 r9359 16 16 class MMcEvt; 17 17 class MParameterD; 18 class MMcRunHeader; 18 19 19 20 class MHCollectionArea : public MH … … 21 22 private: 22 23 MMcEvt *fMcEvt; //! 24 MMcRunHeader *fHeader; //! 23 25 //MParameterD *fEnergy; //! 24 26 … … 35 37 Bool_t fIsExtern; 36 38 39 void GetImpactMax(); 37 40 void Calc(TH2D &hsel, TH2D &hall); 38 41 void CalcEfficiency(); -
trunk/MagicSoft/Mars/mjobs/MJSimulation.cc
r9356 r9359 542 542 //MFillH fillx2("MHHillasExt", "", "FillHillasExt"); 543 543 MFillH fillx3("MHHillasSrc", "MHillasSrc", "FillHillasSrc"); 544 MFillH fillth("MHThreshold", "", "FillThreshold"); 545 MFillH fillca("MHCollectionArea", "", "FillTrigArea"); 544 546 //MFillH fillx4("MHImagePar", "MImagePar", "FillImagePar"); 545 547 //MFillH fillx5("MHNewImagePar", "MNewImagePar", "FillNewImagePar"); 548 549 fillth.SetNameTab("Threshold"); 550 fillca.SetNameTab("TrigArea"); 546 551 547 552 // ------------------------------------------------------------------- … … 648 653 //tasks.AddToList(&fillx2); 649 654 tasks.AddToList(&fillx3); 655 tasks.AddToList(&fillth); 656 tasks.AddToList(&fillca); 650 657 //tasks.AddToList(&fillx4); 651 658 //tasks.AddToList(&fillx5); -
trunk/MagicSoft/Mars/msim/MSimMMCS.cc
r9352 r9359 67 67 Int_t MSimMMCS::PreProcess(MParList *plist) 68 68 { 69 if (!plist->FindCreateObj("MMcRunHeader")) 69 fMcRunHeader = (MMcRunHeader*)plist->FindCreateObj("MMcRunHeader"); 70 if (!fMcRunHeader) 70 71 return kFALSE; 71 72 … … 105 106 } 106 107 107 108 108 return kTRUE; 109 109 } … … 126 126 // ---------------------------------------------------- 127 127 128 MMcRunHeader *mrh = (MMcRunHeader*)plist->FindObject("MMcRunHeader");129 if (!mrh)130 {131 *fLog << err << "MMcRunHeader not found... aborting." << endl;132 return kFALSE;133 }134 135 128 // fNumPheFromDNSB MMcPedestalNSBAdd // Number of phe/ns from diffuse NSB 136 129 137 130 // FIXME: Is there a way to write them as LAST entry in the file? 138 mrh->SetNumSimulatedShowers(fRunHeader->GetNumEvents()); 139 mrh->SetImpactMax(fRunHeader->GetImpactMax()); 140 mrh->SetCorsikaVersion(TMath::Nint(fRunHeader->GetProgramVersion()*100)); 131 fMcRunHeader->SetNumSimulatedShowers(fRunHeader->GetNumEvents()); 132 fMcRunHeader->SetCorsikaVersion(TMath::Nint(fRunHeader->GetProgramVersion()*100)); 133 134 if (fRunHeader->GetImpactMax()>0) 135 fMcRunHeader->SetImpactMax(fRunHeader->GetImpactMax()); 141 136 142 137 // ---------------------------------------------------- … … 185 180 fMcEvt->SetPhotElfromShower(0); 186 181 182 if (fRunHeader->GetImpactMax()<0 && 183 fEvtHeader->GetImpact()>fMcRunHeader->GetImpactMax()) 184 fMcRunHeader->SetImpactMax(fEvtHeader->GetImpact()); 185 187 186 return kTRUE; 188 187 } -
trunk/MagicSoft/Mars/msim/MSimMMCS.h
r9336 r9359 12 12 class MCorsikaEvtHeader; 13 13 class MCorsikaRunHeader; 14 class MMcRunHeader; 14 15 15 16 class MSimMMCS : public MTask … … 21 22 MCorsikaEvtHeader *fEvtHeader; 22 23 MCorsikaRunHeader *fRunHeader; 24 MMcRunHeader *fMcRunHeader; 23 25 24 26 // MTask
Note:
See TracChangeset
for help on using the changeset viewer.