Changeset 1809 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 03/08/03 14:00:30 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc
r1660 r1809 208 208 } 209 209 210 //fHadronness->SetHadronness(dg/(dg+dh)); 211 fHadronness->SetHadronness(exp(-dh/dg)); 210 Double_t arg; 211 212 if (dg+dh != 0.0) 213 arg = dg / (dg+dh); 214 else 215 arg = 1.e10; 216 //fHadronness->SetHadronness(arg); 217 218 if (dg != 0.0) 219 arg = exp(-dh/dg); 220 else 221 arg = 0.0; 222 fHadronness->SetHadronness(arg); 223 212 224 213 225 return kTRUE; -
trunk/MagicSoft/Mars/manalysis/MPadSchweizer.cc
r1772 r1809 1 2 1 /* ======================================================================== *\ 3 2 ! … … 102 101 fHDiffPixTheta = fHist3Diff; 103 102 103 fHSigmaTheta->SetDirectory(NULL); 104 fHSigmaPixTheta->SetDirectory(NULL); 105 fHDiffPixTheta->SetDirectory(NULL); 106 104 107 Print(); 105 108 } … … 239 242 fHDiffPixTh->SetZTitle("Sigma^2-Sigmabar^2"); 240 243 244 //-------------------------------------------------------------------- 245 246 memset(fErrors, 0, sizeof(fErrors)); 247 241 248 return kTRUE; 242 249 } … … 251 258 //*fLog << "Entry MPadSchweizer::Process();" << endl; 252 259 260 Int_t rc; 261 253 262 const UInt_t npix = fEvt->GetNumPixels(); 263 264 Double_t SigbarOld; 265 266 //*fLog << "before padding : " << endl; 267 //SigbarOld = fSigmabar->Calc(*fCam, *fPed, *fEvt); 268 //fSigmabar->Print(""); 269 254 270 255 271 //$$$$$$$$$$$$$$$$$$$$$$$$$$ 256 272 // to simulate the situation that before the padding the NSB and 257 273 // electronic noise are zero : set Sigma = 0 for all pixels 258 for (UInt_t i=0; i<npix; i++)259 {260 MCerPhotPix &pix = fEvt->operator[](i);261 Int_t j = pix.GetPixId();262 263 MPedestalPix &ppix = fPed->operator[](j);264 ppix.SetMeanRms(0.0);265 }274 //for (UInt_t i=0; i<npix; i++) 275 //{ 276 // MCerPhotPix &pix = fEvt->operator[](i); 277 // Int_t j = pix.GetPixId(); 278 279 // MPedestalPix &ppix = fPed->operator[](j); 280 // ppix.SetMeanRms(0.0); 281 //} 266 282 //$$$$$$$$$$$$$$$$$$$$$$$$$$ 267 283 … … 269 285 // Calculate average sigma of the event 270 286 // 271 Double_tSigbarOld = fSigmabar->Calc(*fCam, *fPed, *fEvt);287 SigbarOld = fSigmabar->Calc(*fCam, *fPed, *fEvt); 272 288 //fSigmabar->Print(""); 273 289 274 //if (SigbarOld > 0.0)275 //{290 if (SigbarOld > 0.0) 291 { 276 292 //*fLog << "MPadSchweizer::Process(); Sigmabar of event to be padded is > 0 : " 277 293 // << SigbarOld << ". Stop event loop " << endl; 278 294 // input data should have Sigmabar = 0; stop event loop 279 // return kFALSE; 280 //} 295 296 rc = 1; 297 fErrors[rc]++; 298 return kCONTINUE; 299 } 281 300 282 301 Double_t Theta = kRad2Deg*fMcEvt->GetTelescopeTheta(); … … 296 315 << Theta << ", " << binNumber << "; Skip event " << endl; 297 316 // event cannot be padded; skip event 317 318 rc = 2; 319 fErrors[rc]++; 298 320 return kCONTINUE; 299 321 } … … 308 330 // event cannot be padded; skip event 309 331 delete fHSigma; 332 333 rc = 3; 334 fErrors[rc]++; 310 335 return kCONTINUE; 311 336 } … … 331 356 *fLog << "MPadSchweizer::Process(); target Sigmabar is less than SigbarOld : " 332 357 << Sigmabar << ", " << SigbarOld << ", Skip event" << endl; 358 359 rc = 4; 360 fErrors[rc]++; 333 361 return kCONTINUE; 334 362 } … … 426 454 << binTheta << " and pixel bin " << binPixel 427 455 << " has no entries; aborting " << endl; 428 return kERROR; 456 457 rc = 5; 458 fErrors[rc]++; 459 return kCONTINUE; 429 460 } 430 461 … … 465 496 << binTheta << " and pixel bin " << binPixel 466 497 << " has no entries; aborting " << endl; 467 return kERROR; 498 499 rc = 6; 500 fErrors[rc]++; 501 return kCONTINUE; 468 502 } 469 503 … … 553 587 554 588 // Calculate Sigmabar again and crosscheck 589 555 590 Double_t SigbarNew = fSigmabar->Calc(*fCam, *fPed, *fEvt); 591 //*fLog << "after padding : " << endl; 556 592 //fSigmabar->Print(""); 557 593 … … 585 621 //*fLog << "Exit MPadSchweizer::Process();" << endl; 586 622 623 rc = 0; 624 fErrors[rc]++; 625 587 626 return kTRUE; 588 627 … … 594 633 Bool_t MPadSchweizer::PostProcess() 595 634 { 635 if (GetNumExecutions() != 0) 636 { 637 638 *fLog << inf << endl; 639 *fLog << GetDescriptor() << " execution statistics:" << endl; 640 *fLog << dec << setfill(' '); 641 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 642 << (int)(fErrors[1]*100/GetNumExecutions()) 643 << "%) Evts skipped due to: Sigmabar_old > 0" << endl; 644 645 *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) 646 << (int)(fErrors[2]*100/GetNumExecutions()) 647 << "%) Evts skipped due to: Zenith angle out of range" << endl; 648 649 *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) 650 << (int)(fErrors[3]*100/GetNumExecutions()) 651 << "%) Evts skipped due to: No data for generating Sigmabar" << endl; 652 653 *fLog << " " << setw(7) << fErrors[4] << " (" << setw(3) 654 << (int)(fErrors[4]*100/GetNumExecutions()) 655 << "%) Evts skipped due to: Target sigma <= Sigmabar_old" << endl; 656 657 *fLog << " " << setw(7) << fErrors[5] << " (" << setw(3) 658 << (int)(fErrors[5]*100/GetNumExecutions()) 659 << "%) Evts skipped due to: No data for generating Sigma^2-Sigmabar^2" << endl; 660 661 *fLog << " " << setw(7) << fErrors[6] << " (" << setw(3) 662 << (int)(fErrors[6]*100/GetNumExecutions()) 663 << "%) Evts skipped due to: No data for generating Sigma" << endl; 664 665 *fLog << " " << fErrors[0] << " (" 666 << (int)(fErrors[0]*100/GetNumExecutions()) 667 << "%) Evts survived the padding!" << endl; 668 *fLog << endl; 669 670 } 671 672 //--------------------------------------------------------------- 596 673 TCanvas &c = *(MH::MakeDefCanvas("PadSchweizer", "", 900, 1200)); 597 674 c.Divide(3, 4); … … 600 677 601 678 c.cd(1); 679 fHSigmaTheta->SetDirectory(NULL); 602 680 fHSigmaTheta->SetTitle("2D : Sigmabar, \\Theta (reference sample)"); 603 fHSigmaTheta->DrawC lone();681 fHSigmaTheta->DrawCopy(); 604 682 fHSigmaTheta->SetBit(kCanDelete); 605 683 606 684 //c.cd(1); 607 //fHSigmaPixTheta->DrawC lone();685 //fHSigmaPixTheta->DrawCopy(); 608 686 //fHSigmaPixTheta->SetBit(kCanDelete); 609 687 610 688 c.cd(4); 611 fHSigbarTheta->DrawClone(); 689 fHSigbarTheta->SetDirectory(NULL); 690 fHSigbarTheta->DrawCopy(); 612 691 fHSigbarTheta->SetBit(kCanDelete); 613 692 614 693 615 694 c.cd(7); 616 fHNSB->DrawClone(); 695 fHNSB->SetDirectory(NULL); 696 fHNSB->DrawCopy(); 617 697 fHNSB->SetBit(kCanDelete); 618 698 … … 625 705 c.cd(2); 626 706 l = (TH2D*) ((TH3*)fHDiffPixTh)->Project3D("zx"); 627 707 l->SetDirectory(NULL); 628 708 l->SetTitle("Sigma^2-Sigmabar^2 vs. \\Theta (all pixels)"); 629 709 l->SetXTitle("\\Theta [\\circ]"); 630 710 l->SetYTitle("Sigma^2-Sigmabar^2"); 631 711 632 *fLog << "before box" << endl; 633 634 l->Draw("box"); 712 l->DrawCopy("box"); 635 713 l->SetBit(kCanDelete);; 636 714 637 715 c.cd(5); 638 716 l = (TH2D*) ((TH3*)fHDiffPixTh)->Project3D("zy"); 717 l->SetDirectory(NULL); 639 718 l->SetTitle("Sigma^2-Sigmabar^2 vs. pixel number (all \\Theta)"); 640 719 l->SetXTitle("pixel"); 641 720 l->SetYTitle("Sigma^2-Sigmabar^2"); 642 721 643 l->Draw ("box");722 l->DrawCopy("box"); 644 723 l->SetBit(kCanDelete);; 645 724 … … 655 734 c.cd(3); 656 735 k = (TH2D*) ((TH3*)fHSigPixTh)->Project3D("zx"); 736 k->SetDirectory(NULL); 657 737 k->SetTitle("Sigma vs. \\Theta (all pixels)"); 658 738 k->SetXTitle("\\Theta [\\circ]"); 659 739 k->SetYTitle("Sigma"); 660 740 661 k->Draw ("box");741 k->DrawCopy("box"); 662 742 k->SetBit(kCanDelete); 663 743 664 744 c.cd(6); 665 745 k = (TH2D*) ((TH3*)fHSigPixTh)->Project3D("zy"); 746 k->SetDirectory(NULL); 666 747 k->SetTitle("Sigma vs. pixel number (all \\Theta)"); 667 748 k->SetXTitle("pixel"); 668 749 k->SetYTitle("Sigma"); 669 750 670 k->Draw ("box");751 k->DrawCopy("box"); 671 752 k->SetBit(kCanDelete);; 672 753 … … 677 758 678 759 c.cd(10); 679 fHSigmaPedestal->DrawClone(); 760 fHSigmaPedestal->SetDirectory(NULL); 761 fHSigmaPedestal->DrawCopy(); 680 762 fHSigmaPedestal->SetBit(kCanDelete); 681 763 682 764 c.cd(11); 683 fHPhotons->DrawClone(); 765 fHPhotons->SetDirectory(NULL); 766 fHPhotons->DrawCopy(); 684 767 fHPhotons->SetBit(kCanDelete); 685 768 -
trunk/MagicSoft/Mars/manalysis/MPadSchweizer.h
r1771 r1809 39 39 Int_t fRunType; 40 40 Int_t fGroup; 41 42 Int_t fErrors[7]; 41 43 42 44 // plots used for the padding -
trunk/MagicSoft/Mars/manalysis/MSelBasic.cc
r1762 r1809 44 44 #include "MGeomCam.h" 45 45 #include "MPedestalCam.h" 46 #include "MPedestalPix.h" 46 47 #include "MGeomPix.h" 47 48 … … 119 120 Bool_t MSelBasic::Process() 120 121 { 122 /* 123 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 124 *fLog << "=========================================================" << endl; 125 *fLog << "" << endl; 126 *fLog << "MmcEvt data : " << endl; 127 *fLog << "" << endl; 128 fMcEvt->Print(); 129 *fLog << "" << endl; 130 *fLog << "PartId() = " << fMcEvt->GetPartId() << endl; 131 *fLog << "Energy() = " << fMcEvt->GetEnergy() << endl; 132 *fLog << "Theta() = " << fMcEvt->GetTheta() << endl; 133 134 *fLog << "Phi() = " << fMcEvt->GetPhi() << endl; 135 //*fLog << "CoreD() = " << fMcEvt->GetCoreD() << endl; 136 //*fLog << "CoreX() = " << fMcEvt->GetCoreX() << endl; 137 138 //*fLog << "CoreY() = " << fMcEvt->GetCoreY() << endl; 139 *fLog << "Impact() = " << fMcEvt->GetImpact() << endl; 140 //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl; 141 142 //*fLog << "PassPhotAtm() = " << fMcEvt->GetPassPhotAtm() << endl; 143 //*fLog << "PassPhotRef() = " << fMcEvt->GetPassPhotRef() << endl; 144 //*fLog << "PassPhotCone() = " << fMcEvt->GetPassPhotCone() << endl; 145 146 //*fLog << "PhotElfromShower() = " << fMcEvt->GetPhotElfromShower() << endl; 147 //*fLog << "PhotElinCamera() = " << fMcEvt->GetPhotElinCamera() << endl; 148 *fLog << "TelescopePhi() = " << fMcEvt->GetTelescopePhi() << endl; 149 150 *fLog << "TelescopeTheta() = " << fMcEvt->GetTelescopeTheta() << endl; 151 *fLog << "Impact() = " << fMcEvt->GetImpact() << endl; 152 //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl; 153 *fLog << "" << endl; 154 *fLog << "=========================================================" << endl; 155 156 *fLog << "=========================================================" << endl; 157 *fLog << "" << endl; 158 *fLog << "MPedestalPix data : " << endl; 159 *fLog << "" << endl; 160 161 Int_t ntot; 162 ntot = fPed->GetSize(); 163 *fLog << "MeanRms() :" << endl; 164 for (Int_t i=0; i<ntot; i++) 165 { 166 MPedestalPix &pix = (*fPed)[i]; 167 //*fLog << "Mean() = " << i << ", " << pix.GetMean() << endl; 168 //*fLog << "Sigma() = " << i << ", " << pix.GetSigma() << endl; 169 *fLog << pix.GetMeanRms() << " "; 170 //*fLog << "SigmaRms()= " << i << ", " << pix.GetSigmaRms() << endl; 171 } 172 *fLog << "" << endl; 173 174 *fLog << "" << endl; 175 ntot = fEvt->GetNumPixels(); 176 *fLog << "MCerPhotPix : pix.GetNumPhotons()" << endl; 177 for (Int_t i=0; i<ntot; i++) 178 { 179 MCerPhotPix &pix = (*fEvt)[i]; 180 *fLog << pix.GetNumPhotons() << " "; 181 } 182 *fLog << "" << endl; 183 184 *fLog << "" << endl; 185 ntot = fEvt->GetNumPixels(); 186 *fLog << "MCerPhotPix : pix.GetErrorPhot()" << endl; 187 for (Int_t i=0; i<ntot; i++) 188 { 189 MCerPhotPix &pix = (*fEvt)[i]; 190 *fLog << pix.GetErrorPhot() << " "; 191 } 192 *fLog << "" << endl; 193 194 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 195 */ 196 197 121 198 Int_t rc = 0; 122 199 123 //if ( fRawRun->GetRunNumber() < 1 025)200 //if ( fRawRun->GetRunNumber() < 16279 ) 124 201 //{ 125 202 // rc = 1; … … 128 205 129 206 Double_t Theta = kRad2Deg*fMcEvt->GetTelescopeTheta(); 130 if (Theta > 45.0 || !SwTrigger() ) 131 { 132 //*fLog << "MSelBasic::Process; Theta = " << Theta << endl; 207 if ( Theta < 0.0 ) 208 { 209 *fLog << "MSelBasic::Process; Run, Event, Theta = " 210 << fRawRun->GetRunNumber()<< ", " 211 << fMcEvt->GetEvtNumber() << ", " << Theta << endl; 133 212 rc = 1; 213 } 214 215 else if ( Theta > 45.0 ) 216 { 217 rc = 2; 218 } 219 220 else if ( !SwTrigger() ) 221 { 222 //*fLog << "MSelBasic::Process; SwTrigger = " << SwTrigger << endl; 223 rc = 3; 134 224 } 135 225 … … 223 313 *fLog << GetDescriptor() << " execution statistics:" << endl; 224 314 *fLog << dec << setfill(' '); 225 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Basic selections are not fullfilled" << endl; 315 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Zenith angle < 0" << endl; 316 317 *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Zenith angle too high" << endl; 318 319 *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) << (int)(fErrors[3]*100/GetNumExecutions()) << "%) Evts skipped due to: Software trigger not fullfilled" << endl; 226 320 227 321 *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Basic selections!" << endl; … … 230 324 return kTRUE; 231 325 } 326 -
trunk/MagicSoft/Mars/manalysis/MSelBasic.h
r1762 r1809 30 30 const MRawRunHeader *fRawRun; 31 31 32 Int_t fErrors[ 2];32 Int_t fErrors[4]; 33 33 34 34 public: -
trunk/MagicSoft/Mars/manalysis/MSelFinal.cc
r1781 r1809 41 41 42 42 #include "MHillas.h" 43 #include "MHillasExt.h" 43 44 #include "MHillasSrc.h" 44 45 #include "MCerPhotEvt.h" … … 57 58 // Default constructor. 58 59 // 59 MSelFinal::MSelFinal( MHillas *parhil, MHillasSrc *parhilsrc,60 MSelFinal::MSelFinal(const char *HilName, const char *HilSrcName, 60 61 const char *name, const char *title) 61 62 { … … 63 64 fTitle = title ? title : "Task to evaluate the Final Cuts"; 64 65 65 fHil = parhil; 66 fHilsrc = parhilsrc; 66 fHilName = HilName; 67 fHilSrcName = HilSrcName; 68 69 fHadronnessCut = 0.2; 70 fAlphaCut = 100.0; //degrees 67 71 } 68 72 … … 75 79 Bool_t MSelFinal::PreProcess(MParList *pList) 76 80 { 81 fHil = (MHillasExt*)pList->FindObject(fHilName, "MHillasExt"); 82 if (!fHil) 83 { 84 *fLog << dbginf << "MHillasExt object " << fHilName << " not found... aborting." << endl; 85 return kFALSE; 86 } 87 88 fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc"); 89 if (!fHilSrc) 90 { 91 *fLog << dbginf << "MHillasSrc object " << fHilSrcName << " not found... aborting." << endl; 92 return kFALSE; 93 } 94 95 77 96 fHadronness = (MHadronness*)pList->FindObject("MHadronness"); 78 97 if (!fHadronness) … … 90 109 } 91 110 92 fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");93 if (!fEvt)94 {95 *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;96 return kFALSE;97 }98 99 100 fCam = (MGeomCam*)pList->FindObject("MGeomCam");101 if (!fCam)102 {103 *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;104 return kFALSE;105 }106 fMm2Deg = fCam->GetConvMm2Deg();107 108 *fLog << "fMm2Deg = " << fMm2Deg << endl;109 110 111 memset(fErrors, 0, sizeof(fErrors)); 111 112 … … 122 123 Bool_t MSelFinal::Process() 123 124 { 125 //*fLog << "Entry MSelFinal; fHilSrc = " << fHilSrc << endl; 126 127 128 124 129 Int_t rc = 0; 125 130 126 Double_t alphacut = 20.0;131 Double_t modalpha = fabs( fHilSrc->GetAlpha() ); 127 132 128 Double_t modalpha = fabs( fHilsrc->GetAlpha() );129 133 Double_t h = fHadronness->GetHadronness(); 130 134 131 if ( h> 0.5 || modalpha > alphacut )135 if ( h>fHadronnessCut ) 132 136 { 133 137 //*fLog << "MSelFinal::Process; h, alpha = " << h << ", " 134 // << fHil src->GetAlpha() << endl;138 // << fHilSrc->GetAlpha() << endl; 135 139 rc = 1; 140 } 141 142 else if ( modalpha > fAlphaCut ) 143 { 144 //*fLog << "MSelFinal::Process; h, alpha = " << h << ", " 145 // << fHilSrc->GetAlpha() << endl; 146 rc = 2; 136 147 } 137 148 … … 153 164 *fLog << GetDescriptor() << " execution statistics:" << endl; 154 165 *fLog << dec << setfill(' '); 155 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Final selections are not fullfilled" << endl; 166 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 167 << (int)(fErrors[1]*100/GetNumExecutions()) 168 << "%) Evts skipped due to: g/h separation cut (" << fHadronnessCut 169 << ")" << endl; 156 170 157 *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Final selections!" << endl; 171 *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) 172 << (int)(fErrors[2]*100/GetNumExecutions()) 173 << "%) Evts skipped due to: cut in ALPHA (" << fAlphaCut 174 << " degrees)" << endl; 175 176 *fLog << " " << fErrors[0] << " (" 177 << (int)(fErrors[0]*100/GetNumExecutions()) 178 << "%) Evts survived Final selections!" << endl; 158 179 *fLog << endl; 159 180 160 181 return kTRUE; 161 182 } 183 184 185 -
trunk/MagicSoft/Mars/manalysis/MSelFinal.h
r1781 r1809 28 28 MMcEvt *fMcEvt; 29 29 MHillas *fHil; 30 MHillasSrc *fHil src;30 MHillasSrc *fHilSrc; 31 31 MHadronness *fHadronness; 32 32 33 33 Double_t fMm2Deg; // conversion mm to degrees in camera 34 Int_t fErrors[2]; 34 Int_t fErrors[3]; 35 TString fHilName; 36 TString fHilSrcName; 37 38 Float_t fHadronnessCut; 39 Float_t fAlphaCut; 35 40 36 41 public: 37 MSelFinal( MHillas *fHil, MHillasSrc *fHilsrc,42 MSelFinal(const char *HilName, const char *HilSrcName, 38 43 const char *name=NULL, const char *title=NULL); 39 44 … … 42 47 Bool_t PostProcess(); 43 48 49 void SetHadronnessCut(Float_t hadcut) { fHadronnessCut = hadcut; } 50 void SetAlphaCut(Float_t alpha) { fAlphaCut = alpha; } 44 51 45 52 ClassDef(MSelFinal, 0) // Task to evaluate final cuts -
trunk/MagicSoft/Mars/manalysis/MSelStandard.cc
r1762 r1809 1 1 2 /* ======================================================================== *\ 2 3 ! … … 39 40 40 41 #include "MHillas.h" 42 #include "MHillasExt.h" 41 43 #include "MHillasSrc.h" 42 44 #include "MCerPhotEvt.h" … … 54 56 // Default constructor. 55 57 // 56 MSelStandard::MSelStandard(const MHillas *parhil, const MHillasSrc *parhilsrc,58 MSelStandard::MSelStandard(const char *HilName, const char *HilSrcName, 57 59 const char *name, const char *title) 58 60 { … … 60 62 fTitle = title ? title : "Task to evaluate the Standard Cuts"; 61 63 62 fHil = parhil;63 fHil src = parhilsrc;64 fHilName = HilName; 65 fHilSrcName = HilSrcName; 64 66 } 65 67 … … 72 74 Bool_t MSelStandard::PreProcess(MParList *pList) 73 75 { 76 fHil = (MHillasExt*)pList->FindObject(fHilName, "MHillasExt"); 77 if (!fHil) 78 { 79 *fLog << dbginf << "MHillasExt object " << fHilName << " not found... aborting." << endl; 80 return kFALSE; 81 } 82 83 fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc"); 84 if (!fHilSrc) 85 { 86 *fLog << dbginf << "MHillasSrc object " << fHilSrcName << " not found... aborting." << endl; 87 return kFALSE; 88 } 89 90 74 91 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt"); 75 92 if (!fMcEvt) … … 95 112 fMm2Deg = fCam->GetConvMm2Deg(); 96 113 97 *fLog << "fMm2Deg = " << fMm2Deg << endl;114 //*fLog << "fMm2Deg = " << fMm2Deg << endl; 98 115 99 116 memset(fErrors, 0, sizeof(fErrors)); … … 114 131 Int_t rc = 0; 115 132 116 //Double_t fLength = fHil->GetLength() * fMm2Deg;117 //Double_t fWidth = fHil->GetWidth() * fMm2Deg;118 Double_t fDist = fHil src->GetDist()* fMm2Deg;133 Double_t fLength = fHil->GetLength() * fMm2Deg; 134 Double_t fWidth = fHil->GetWidth() * fMm2Deg; 135 Double_t fDist = fHilSrc->GetDist()* fMm2Deg; 119 136 //Double_t fDelta = fHil->GetDelta() * kRad2Deg; 120 137 Double_t fSize = fHil->GetSize(); … … 122 139 Int_t fNumCorePixels = fHil->GetNumCorePixels(); 123 140 124 if ( fSize <= 60.0 || fDist< 0.4 || fDist > 1.1 125 || fNumUsedPixels >= 92 || fNumCorePixels < 4) 141 if ( fNumUsedPixels >= 92 || fNumCorePixels < 4 ) 126 142 { 127 143 //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = " … … 129 145 // << fNumCorePixels << endl; 130 146 rc = 1; 147 } 148 149 else if ( fSize <= 60.0 || fDist< 0.4 || fDist > 1.1 ) 150 { 151 //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = " 152 // << fSize << ", " << fDist << ", " << fNumUsedPixels << ", " 153 // << fNumCorePixels << endl; 154 rc = 2; 155 } 156 157 else if ( fLength <= 0.0 || fWidth <= 0.0 ) 158 { 159 //*fLog << "MSelStandard::Process; fLength, fWidth = " 160 // << fLength << ", " << fWidth << endl; 161 rc = 3; 131 162 } 132 163 … … 149 180 *fLog << GetDescriptor() << " execution statistics:" << endl; 150 181 *fLog << dec << setfill(' '); 151 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Standard selections are not fullfilled" << endl; 182 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Requirements on no.of used or core pxels not fullfilled" << endl; 183 184 *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Requirements on SIZE or DIST not fullfilled" << endl; 185 186 *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) << (int)(fErrors[3]*100/GetNumExecutions()) << "%) Evts skipped due to: Length or Width is <= 0" << endl; 152 187 153 188 *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Standard selections!" << endl; … … 156 191 return kTRUE; 157 192 } 193 194 -
trunk/MagicSoft/Mars/manalysis/MSelStandard.h
r1762 r1809 23 23 { 24 24 private: 25 constMGeomCam *fCam; // Camera Geometry26 constMCerPhotEvt *fEvt; // Cerenkov Photon Event27 constMMcEvt *fMcEvt;28 constMHillas *fHil;29 const MHillasSrc *fHilsrc;25 MGeomCam *fCam; // Camera Geometry 26 MCerPhotEvt *fEvt; // Cerenkov Photon Event 27 MMcEvt *fMcEvt; 28 MHillas *fHil; 29 MHillasSrc *fHilSrc; 30 30 31 Double_t fMm2Deg; // conversion mm to degrees in camera 32 Int_t fErrors[2]; 31 Double_t fMm2Deg; // conversion mm to degrees in camera 32 Int_t fErrors[4]; 33 TString fHilName; 34 TString fHilSrcName; 33 35 34 36 public: 35 MSelStandard(const MHillas *fHil, const MHillasSrc *fHilsrc,37 MSelStandard(const char *HilName, const char *HilSrcName, 36 38 const char *name=NULL, const char *title=NULL); 37 39
Note:
See TracChangeset
for help on using the changeset viewer.