Changeset 1809 for trunk/MagicSoft/Mars/manalysis/MSelFinal.cc
- Timestamp:
- 03/08/03 14:00:30 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.