- Timestamp:
- 04/28/03 16:36:20 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2026 r2030 100 100 - added MHillasExt to be displayed 101 101 - added MNewImagePar to be displayed 102 103 * manalysis/MCT1SupercutsCalc.[h,cc]: 104 - removed empty destructor 105 - fixed output in PreProcess 106 - changed MHillasExt to MHillas 102 107 103 108 -
trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc
r1949 r2030 147 147 // -------------------------------------------------------------------------- 148 148 // 149 MCT1SupercutsCalc::~MCT1SupercutsCalc()150 {151 }152 153 154 // --------------------------------------------------------------------------155 //156 149 Bool_t MCT1SupercutsCalc::PreProcess(MParList *pList) 157 150 { 151 fHil = (MHillas*)pList->FindObject(fHilName, "MHillas"); 152 if (!fHil) 153 { 154 *fLog << err << fHilName << " [MHillasExt] not found... aborting." << endl; 155 return kFALSE; 156 } 157 158 fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc"); 159 if (!fHilSrc) 160 { 161 *fLog << err << fHilSrcName << " [MHillasSrc] not found... aborting." << endl; 162 return kFALSE; 163 } 164 165 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt"); 166 if (!fMcEvt) 167 { 168 *fLog << err << "MMcEvt not found... aborting." << endl; 169 return kFALSE; 170 } 171 172 MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam"); 173 if (!cam) 174 { 175 *fLog << err << "MGeomCam (Camera Geometry) not found... aborting." << endl; 176 return kFALSE; 177 } 178 179 fMm2Deg = cam->GetConvMm2Deg(); 180 158 181 fHadronness = (MHadronness*)pList->FindCreateObj("MHadronness", fHadronnessName); 159 182 if (!fHadronness) 160 { 161 *fLog << dbginf << "MHadronness object " << fHadronnessName << " not found... aborting." << endl; 162 return kFALSE; 163 } 164 165 166 fHil = (MHillasExt*)pList->FindObject(fHilName, "MHillasExt"); 167 if (!fHil) 168 { 169 *fLog << dbginf << "MHillasExt object " << fHilName << " not found... aborting." << endl; 170 return kFALSE; 171 } 172 173 fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc"); 174 if (!fHilSrc) 175 { 176 *fLog << dbginf << "MHillasSrc object " << fHilSrcName << " not found... aborting." << endl; 177 return kFALSE; 178 } 179 180 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt"); 181 if (!fMcEvt) 182 { 183 *fLog << dbginf << "MMcEvt not found... aborting." << endl; 184 return kFALSE; 185 } 186 187 fCam = (MGeomCam*)pList->FindObject("MGeomCam"); 188 if (!fCam) 189 { 190 *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl; 191 return kFALSE; 192 } 193 194 fMm2Deg = fCam->GetConvMm2Deg(); 183 return kFALSE; 195 184 196 185 return kTRUE; … … 204 193 Double_t ls2, Double_t dd2) 205 194 { 206 // define cut-function207 //208 // dNOMLOGSIZE = 4.1 (=log(60.0)209 // dNOMCOSZA = 1.0210 //211 // a: array of cut parameters212 // ls: log(SIZE) - dNOMLOGSIZE213 // ls2: ls^2214 // ct: Cos(ZA.) - dNOMCOSZA215 // dd2: DIST^2195 // define cut-function 196 // 197 // dNOMLOGSIZE = 4.1 (=log(60.0) 198 // dNOMCOSZA = 1.0 199 // 200 // a: array of cut parameters 201 // ls: log(SIZE) - dNOMLOGSIZE 202 // ls2: ls^2 203 // ct: Cos(ZA.) - dNOMCOSZA 204 // dd2: DIST^2 216 205 217 206 const Double_t limit = 218 207 a[0] + a[1] * dd2 + a[2] * ct + 219 208 ls * (a[3] + a[4] * dd2 + a[5] * ct) + 220 209 ls2 * (a[6] + a[7] * dd2); 221 210 222 //*fLog << "MCT1SupercutsCalc::CtsMCut; *a = "223 // << *a << ", " << *(a+1) << ", " << *(a+2) << ", "224 // << *(a+3) << ", " << *(a+4) << ", " << *(a+5) << ", "225 // << *(a+6) << ", " << *(a+7) << endl;226 227 //*fLog << "MCT1SupercutsCalc::CtsMCut; ls, ls2, ct, dd2, limit = " << ls228 // << ", " << ls2 << ", " << ct << ", " << dd2 << ", "229 // << limit << endl;230 231 return limit;211 //*fLog << "MCT1SupercutsCalc::CtsMCut; *a = " 212 // << *a << ", " << *(a+1) << ", " << *(a+2) << ", " 213 // << *(a+3) << ", " << *(a+4) << ", " << *(a+5) << ", " 214 // << *(a+6) << ", " << *(a+7) << endl; 215 216 //*fLog << "MCT1SupercutsCalc::CtsMCut; ls, ls2, ct, dd2, limit = " << ls 217 // << ", " << ls2 << ", " << ct << ", " << dd2 << ", " 218 // << limit << endl; 219 220 return limit; 232 221 } 233 222 234 223 // --------------------------------------------------------------------------- 235 224 // 236 // Evaluate supercuts for CT1 Mkn421 2001 (Daniel Kranich) 225 // Evaluate dynamical supercuts for CT1 Mkn421 2001 (Daniel Kranich) 226 // optimized for mkn 421 2001 data 237 227 // 238 228 // set hadronness to 0.25 if cuts are fullfilled … … 241 231 Bool_t MCT1SupercutsCalc::Process() 242 232 { 243 // apply dynamical Scuts 244 // optimized for mkn 421 2001 data 245 246 Double_t dNOMLOGSIZE = 4.1; 247 Double_t dNOMCOSZA = 1.0; 248 249 250 Double_t newdist = fHilSrc->GetDist() * fMm2Deg; 251 252 Double_t xbar = fHil->GetMeanX(); 253 Double_t ybar = fHil->GetMeanY(); 254 Double_t dist = sqrt(xbar*xbar + ybar*ybar) * fMm2Deg; 255 Double_t dd2 = dist * dist; 256 257 Double_t dmls = log(fHil->GetSize()) - dNOMLOGSIZE; 258 Double_t dmls2 = dmls * dmls; 259 260 Double_t dmcza = cos(fMcEvt->GetTelescopeTheta()) - dNOMCOSZA; 261 262 Double_t length = fHil->GetLength() *fMm2Deg; 263 Double_t width = fHil->GetWidth() *fMm2Deg; 264 265 //*fLog << "MCT1SupercutsCalc::Process; dmls, dmcza, dmls2, dd2 = " 266 // << dmls << ", " << dmcza << ", " << dmls2 << ", " 267 // << dd2 << endl; 268 269 //*fLog << "MCT1SupercutsCalc::Process; newdist, dist, length, width = " 270 // << newdist << ", " << dist << ", " << length << ", " 271 // << width << endl; 272 273 if (newdist < 1.05 && 274 newdist < CtsMCut (fDistUp, dmls, dmcza, dmls2, dd2) && 275 newdist > CtsMCut (fDistLo, dmls, dmcza, dmls2, dd2) && 276 dist < 1.05 && 277 length < CtsMCut (fLengthUp, dmls, dmcza, dmls2, dd2) && 278 length > CtsMCut (fLengthLo, dmls, dmcza, dmls2, dd2) && 279 width < CtsMCut (fWidthUp, dmls, dmcza, dmls2, dd2) && 280 width > CtsMCut (fWidthLo, dmls, dmcza, dmls2, dd2) && 281 //asym < CtsMCut (asymup, dmls, dmcza, dmls2, dd2) && 282 //asym > CtsMCut (asymlow, dmls, dmcza, dmls2, dd2) && 283 dist < CtsMCut (fDistUp, dmls, dmcza, dmls2, dd2) && 284 dist > CtsMCut (fDistLo, dmls, dmcza, dmls2, dd2) ) 285 fHadronness->SetHadronness(0.25); 286 else 287 fHadronness->SetHadronness(0.75); 288 289 fHadronness->SetReadyToSave(); 290 291 return kTRUE; 292 } 293 // --------------------------------------------------------------------------- 294 295 296 297 298 299 300 301 302 303 304 233 const Double_t dNOMLOGSIZE = 4.1; 234 const Double_t dNOMCOSZA = 1.0; 235 236 const Double_t newdist = fHilSrc->GetDist() * fMm2Deg; 237 238 const Double_t xbar = fHil->GetMeanX(); 239 const Double_t ybar = fHil->GetMeanY(); 240 const Double_t dist = sqrt(xbar*xbar + ybar*ybar) * fMm2Deg; 241 const Double_t dd2 = dist * dist; 242 243 const Double_t dmls = log(fHil->GetSize()) - dNOMLOGSIZE; 244 const Double_t dmls2 = dmls * dmls; 245 246 const Double_t dmcza = cos(fMcEvt->GetTelescopeTheta()) - dNOMCOSZA; 247 248 const Double_t length = fHil->GetLength() * fMm2Deg; 249 const Double_t width = fHil->GetWidth() * fMm2Deg; 250 251 //*fLog << "MCT1SupercutsCalc::Process; dmls, dmcza, dmls2, dd2 = " 252 // << dmls << ", " << dmcza << ", " << dmls2 << ", " 253 // << dd2 << endl; 254 255 //*fLog << "MCT1SupercutsCalc::Process; newdist, dist, length, width = " 256 // << newdist << ", " << dist << ", " << length << ", " 257 // << width << endl; 258 259 if (newdist < 1.05 && 260 newdist < CtsMCut (fDistUp, dmls, dmcza, dmls2, dd2) && 261 newdist > CtsMCut (fDistLo, dmls, dmcza, dmls2, dd2) && 262 dist < 1.05 && 263 length < CtsMCut (fLengthUp, dmls, dmcza, dmls2, dd2) && 264 length > CtsMCut (fLengthLo, dmls, dmcza, dmls2, dd2) && 265 width < CtsMCut (fWidthUp, dmls, dmcza, dmls2, dd2) && 266 width > CtsMCut (fWidthLo, dmls, dmcza, dmls2, dd2) && 267 //asym < CtsMCut (asymup, dmls, dmcza, dmls2, dd2) && 268 //asym > CtsMCut (asymlow, dmls, dmcza, dmls2, dd2) && 269 dist < CtsMCut (fDistUp, dmls, dmcza, dmls2, dd2) && 270 dist > CtsMCut (fDistLo, dmls, dmcza, dmls2, dd2) ) 271 fHadronness->SetHadronness(0.25); 272 else 273 fHadronness->SetHadronness(0.75); 274 275 return kTRUE; 276 } -
trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.h
r1995 r2030 27 27 MHillasSrc *fHilSrc; 28 28 MMcEvt *fMcEvt; 29 MGeomCam *fCam;30 29 MHadronness *fHadronness; //! output container for hadronness 31 30 … … 51 50 void InitParams(); 52 51 52 Bool_t PreProcess(MParList *pList); 53 Bool_t Process(); 54 53 55 public: 54 MCT1SupercutsCalc(const char *hilname="MHillas ",56 MCT1SupercutsCalc(const char *hilname="MHillasExt", 55 57 const char *hilsrcname="MHillasSrc", 56 58 const char *name=NULL, const char *title=NULL); 57 ~MCT1SupercutsCalc();58 59 59 Double_t CtsMCut(Double_t *a, Double_t ls, Double_t ct, 60 Double_t CtsMCut(Double_t *a, Double_t ls, Double_t ct, 60 61 Double_t ls2, Double_t dd2); 61 62 … … 63 64 TString GetHadronnessName() const { return fHadronnessName; } 64 65 65 Bool_t PreProcess(MParList *pList);66 Bool_t Process();67 68 66 ClassDef(MCT1SupercutsCalc, 0) // A class to evaluate the Supercuts 69 67 }; 70 68 71 69 #endif 72 73 74 75 76
Note:
See TracChangeset
for help on using the changeset viewer.