Changeset 2300
- Timestamp:
- 08/19/03 10:49:06 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2299 r2300 1 1 -*-*- END OF LINE -*-*- 2 3 4 5 2003/08/19: Wolfgang Wittek 6 7 * manalysis/MCT1Supercuts.[h,cc] 8 - new class 9 - container for the supercut parameters 10 11 * manalysis/MCT1SupercutsCalc.[h,cc] 12 - get supercut parameters from container 'MCT1Supercuts' 13 14 * manalysis/MCT1FindSupercuts.[h,cc] 15 - new class 16 - optimizes the parameters for the supercuts 17 18 * manalysis/MMinuitInterface.[h,cc] 19 - new class 20 - interface for Minuit 21 22 * manalysis/Makefile 23 AnalysisLinkDef.h 24 - include MCT1FindSupercuts 25 MMinuitInterface 26 27 * mhist/MH3.cc 28 - reset fHist in SetupFill(); 29 this is necessary if the same MH3 object is used in more than one 30 eventloop 31 32 * mhist/MHMatrix.cc 33 - give name to the event loop 34 35 * mhist/MHFindSignificance.[h,cc] 36 - new class 37 - calculates the significance of the gamma signal in the alpha plot 38 39 * mhist/MHCT1Supercuts.[h,cc] 40 - new class 41 - plots various quantities during the optimization of the supercuts 42 43 * mhist/Makefile 44 HistLinkDef.h 45 - MHFindSignificance included 46 - MHCT1Supercuts included 47 48 2 49 2003/08/01: Thomas Bretz 3 50 … … 162 209 * mgeom/Makefile, GeomLinkDef.h 163 210 - add new class 211 212 164 213 165 214 -
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r2272 r2300 51 51 #pragma link C++ class MMcTriggerLvl2Calc+; 52 52 53 #pragma link C++ class MCT1Supercuts+; 53 54 #pragma link C++ class MCT1SupercutsCalc+; 55 #pragma link C++ class MCT1FindSupercuts+; 56 #pragma link C++ class MMinuitInterface+; 54 57 #pragma link C++ class MFiltercutsCalc+; 55 58 56 59 #endif 57 60 61 62 63 64 65 66 67 68 69 -
trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc
r2282 r2300 33 33 #include <fstream> 34 34 35 #include "TFile.h" 36 #include "TArrayD.h" 37 35 38 #include "MParList.h" 36 39 #include "MHillasExt.h" … … 41 44 #include "MHadronness.h" 42 45 #include "MHMatrix.h" 46 #include "MCT1Supercuts.h" 43 47 44 48 #include "MLog.h" … … 49 53 using namespace std; 50 54 51 void MCT1SupercutsCalc::InitParams() 52 { 53 fLengthUp.Set(8); 54 fLengthLo.Set(8); 55 fWidthUp.Set(8); 56 fWidthLo.Set(8); 57 fDistUp.Set(8); 58 fDistLo.Set(8); 59 fAsymUp.Set(8); 60 fAsymLo.Set(8); 61 fAlphaUp.Set(8); 62 63 //--------------------------------- 64 // cut parameters 65 fLengthUp[0] = 0.315585; 66 fLengthUp[1] = 0.001455; 67 fLengthUp[2] = 0.203198; 68 fLengthUp[3] = 0.005532; 69 fLengthUp[4] =-0.001670; 70 fLengthUp[5] =-0.020362; 71 fLengthUp[6] = 0.007388; 72 fLengthUp[7] =-0.013463; 73 74 fWidthUp[0] = 0.145412; 75 fWidthUp[1] =-0.001771; 76 fWidthUp[2] = 0.054462; 77 fWidthUp[3] = 0.022280; 78 fWidthUp[4] =-0.009893; 79 fWidthUp[5] = 0.056353; 80 fWidthUp[6] = 0.020711; 81 fWidthUp[7] =-0.016703; 82 83 fDistUp[0] = 1.787943; 84 fDistUp[1] = 0.; 85 fDistUp[2] = 2.942310; 86 fDistUp[3] = 0.199815; 87 fDistUp[4] = 0.; 88 fDistUp[5] = 0.249909; 89 fDistUp[6] = 0.189697; 90 fDistUp[7] = 0.; 91 92 fLengthLo[0] = 0.151530; 93 fLengthLo[1] = 0.028323; 94 fLengthLo[2] = 0.510707; 95 fLengthLo[3] = 0.053089; 96 fLengthLo[4] = 0.013708; 97 fLengthLo[5] = 2.357993; 98 fLengthLo[6] = 0.000080; 99 fLengthLo[7] =-0.007157; 100 101 fWidthLo[0] = 0.089187; 102 fWidthLo[1] =-0.006430; 103 fWidthLo[2] = 0.074442; 104 fWidthLo[3] = 0.003738; 105 fWidthLo[4] =-0.004256; 106 fWidthLo[5] =-0.014101; 107 fWidthLo[6] = 0.006126; 108 fWidthLo[7] =-0.002849; 109 110 fDistLo[0] = 0.589406; 111 fDistLo[1] = 0.; 112 fDistLo[2] =-0.083964; 113 fDistLo[3] =-0.007975; 114 fDistLo[4] = 0.; 115 fDistLo[5] = 0.045374; 116 fDistLo[6] =-0.001750; 117 fDistLo[7] = 0.; 118 119 fAsymUp[0] = 0.061267; 120 fAsymUp[1] = 0.014462; 121 fAsymUp[2] = 0.014327; 122 fAsymUp[3] = 0.014540; 123 fAsymUp[4] = 0.013391; 124 fAsymUp[5] = 0.012319; 125 fAsymUp[6] = 0.010444; 126 fAsymUp[7] = 0.008328; 127 128 fAsymLo[0] =-0.012055; 129 fAsymLo[1] = 0.009157; 130 fAsymLo[2] = 0.005441; 131 fAsymLo[3] = 0.000399; 132 fAsymLo[4] = 0.001433; 133 fAsymLo[5] =-0.002050; 134 fAsymLo[6] =-0.000104; 135 fAsymLo[7] =-0.001188; 136 137 fAlphaUp[0] = 13.123440; 138 fAlphaUp[1] = 0.; 139 fAlphaUp[2] = 0.; 140 fAlphaUp[3] = 0.; 141 fAlphaUp[4] = 0.; 142 fAlphaUp[5] = 0.; 143 fAlphaUp[6] = 0.; 144 fAlphaUp[7] = 0.; 145 //--------------------------------- 146 } 147 148 // -------------------------------------------------------------------------- 149 // 150 // Set the parameter values from vector 'par' 151 // 152 // Attention : it is assumed that there are (9*ncutpar) values 153 // 154 void MCT1SupercutsCalc::SetParams(Double_t *par) 155 { 156 UInt_t ncutpar = fLengthUp.GetSize(); 157 UInt_t k0 = 0; 158 159 TArrayD lup(ncutpar, par + k0); 160 fLengthUp = lup; 161 k0 += ncutpar; 162 163 TArrayD wup(ncutpar, par + k0); 164 fWidthUp = wup; 165 k0 += ncutpar; 166 167 TArrayD dup(ncutpar, par + k0); 168 fDistUp = dup; 169 k0 += ncutpar; 170 171 TArrayD llo(ncutpar, par + k0); 172 fLengthLo = llo; 173 k0 += ncutpar; 174 175 TArrayD wlo(ncutpar, par + k0); 176 fWidthLo = wlo; 177 k0 += ncutpar; 178 179 TArrayD dlo(ncutpar, par + k0); 180 fDistLo = dlo; 181 k0 += ncutpar; 182 183 TArrayD aup(ncutpar, par + k0); 184 fAsymUp = aup; 185 k0 += ncutpar; 186 187 TArrayD alo(ncutpar, par + k0); 188 fAsymLo = alo; 189 k0 += ncutpar; 190 191 TArrayD alphaup(ncutpar, par + k0); 192 fAlphaUp = alphaup; 193 } 194 195 // -------------------------------------------------------------------------- 196 // 197 // Get the parameter values 198 // 199 // Attention : it is assumed that there are (9*ncutpar) values 200 // 201 void MCT1SupercutsCalc::GetParams(Double_t *par) 202 { 203 UInt_t ncutpar = fLengthUp.GetSize(); 204 UInt_t k0 = 0; 205 206 for (UInt_t j=0; j<ncutpar; j++) 207 { 208 UInt_t k = k0 + j; 209 par[k] = fLengthUp[j]; 210 } 211 k0 += ncutpar; 212 213 for (UInt_t j=0; j<ncutpar; j++) 214 { 215 UInt_t k = k0 + j; 216 par[k] = fWidthUp[j]; 217 } 218 k0 += ncutpar; 219 220 for (UInt_t j=0; j<ncutpar; j++) 221 { 222 UInt_t k = k0 + j; 223 par[k] = fDistUp[j]; 224 } 225 k0 += ncutpar; 226 227 for (UInt_t j=0; j<ncutpar; j++) 228 { 229 UInt_t k = k0 + j; 230 par[k] = fLengthLo[j]; 231 } 232 k0 += ncutpar; 233 234 for (UInt_t j=0; j<ncutpar; j++) 235 { 236 UInt_t k = k0 + j; 237 par[k] = fWidthLo[j]; 238 } 239 k0 += ncutpar; 240 241 for (UInt_t j=0; j<ncutpar; j++) 242 { 243 UInt_t k = k0 + j; 244 par[k] = fDistLo[j]; 245 } 246 k0 += ncutpar; 247 248 for (UInt_t j=0; j<ncutpar; j++) 249 { 250 UInt_t k = k0 + j; 251 par[k] = fAsymUp[j]; 252 } 253 k0 += ncutpar; 254 255 for (UInt_t j=0; j<ncutpar; j++) 256 { 257 UInt_t k = k0 + j; 258 par[k] = fAsymLo[j]; 259 } 260 k0 += ncutpar; 261 262 for (UInt_t j=0; j<ncutpar; j++) 263 { 264 UInt_t k = k0 + j; 265 par[k] = fAlphaUp[j]; 266 } 267 } 268 269 // -------------------------------------------------------------------------- 270 // 55 56 // -------------------------------------------------------------------------- 57 // 58 // constructor 59 // 60 271 61 MCT1SupercutsCalc::MCT1SupercutsCalc(const char *hilname, 272 62 const char *hilsrcname, const char *name, const char *title) 273 : fHadronnessName("MHadronness"), fHilName(hilname), fHilSrcName(hilsrcname) 63 : fHadronnessName("MHadronness"), fHilName(hilname), fHilSrcName(hilsrcname), 64 fSuperName("MCT1Supercuts") 274 65 { 275 66 fName = name ? name : "MCT1SupercutsCalc"; 276 67 fTitle = title ? title : "Class to evaluate the Supercuts"; 277 68 278 InitParams();279 280 69 fMatrix = NULL; 281 70 } … … 301 90 } 302 91 92 fSuper = (MCT1Supercuts*)pList->FindObject(fSuperName, "MCT1Supercuts"); 93 if (!fSuper) 94 { 95 *fLog << err << fSuperName << " [MCT1Supercuts] not found... aborting." << endl; 96 return kFALSE; 97 } 98 99 303 100 if (fMatrix) 304 101 return kTRUE; 305 102 103 //----------------------------------------------------------- 306 104 fHil = (MHillas*)pList->FindObject(fHilName, "MHillas"); 307 105 if (!fHil) … … 325 123 } 326 124 125 327 126 return kTRUE; 328 127 } … … 332 131 // Calculation of upper and lower limits 333 132 // 334 Double_t MCT1SupercutsCalc::CtsMCut( 335 #if ROOT_VERSION_CODE > ROOT_VERSION(3,05,00) 336 const 337 #endif 338 TArrayD &a, Double_t ls, Double_t ct, 133 Double_t MCT1SupercutsCalc::CtsMCut(TArrayD &a, Double_t ls, Double_t ct, 339 134 Double_t ls2, Double_t dd2) 340 135 { … … 398 193 fMap[5] = fMatrix->AddColumn("MHillas.fMeanY"); 399 194 fMap[6] = fMatrix->AddColumn("MHillasSrc.fDist"); 400 fMap[7] = fMatrix->AddColumn(" MHillasSrc.fAlpha");195 fMap[7] = fMatrix->AddColumn("fabs(MHillasSrc.fAlpha)"); 401 196 } 402 197 … … 437 232 const Double_t width = width0 * fMm2Deg; 438 233 439 if (newdist < 1.05 &&440 newdist < CtsMCut (f DistUp, dmls, dmcza, dmls2, dd2) &&441 newdist > CtsMCut (f DistLo, dmls, dmcza, dmls2, dd2) &&442 dist < 1.05 &&443 length < CtsMCut (f LengthUp, dmls, dmcza, dmls2, dd2) &&444 length > CtsMCut (f LengthLo, dmls, dmcza, dmls2, dd2) &&445 width < CtsMCut (f WidthUp, dmls, dmcza, dmls2, dd2) &&446 width > CtsMCut (f WidthLo, dmls, dmcza, dmls2, dd2) &&447 //asym < CtsMCut ( asymup,dmls, dmcza, dmls2, dd2) &&448 //asym > CtsMCut ( asymlow, dmls, dmcza, dmls2, dd2) &&449 dist < CtsMCut (f DistUp, dmls, dmcza, dmls2, dd2) &&450 dist > CtsMCut (f DistLo, dmls, dmcza, dmls2, dd2) )234 if (newdist < 1.05 && 235 newdist < CtsMCut (fSuper->GetDistUp(), dmls, dmcza, dmls2, dd2) && 236 newdist > CtsMCut (fSuper->GetDistLo(), dmls, dmcza, dmls2, dd2) && 237 dist < 1.05 && 238 length < CtsMCut (fSuper->GetLengthUp(), dmls, dmcza, dmls2, dd2) && 239 length > CtsMCut (fSuper->GetLengthLo(), dmls, dmcza, dmls2, dd2) && 240 width < CtsMCut (fSuper->GetWidthUp(), dmls, dmcza, dmls2, dd2) && 241 width > CtsMCut (fSuper->GetWidthLo(), dmls, dmcza, dmls2, dd2) && 242 //asym < CtsMCut (fSuper->GetAsymUp(), dmls, dmcza, dmls2, dd2) && 243 //asym > CtsMCut (fSuper->GetAsymLo(), dmls, dmcza, dmls2, dd2) && 244 dist < CtsMCut (fSuper->GetDistUp(), dmls, dmcza, dmls2, dd2) && 245 dist > CtsMCut (fSuper->GetDistLo(), dmls, dmcza, dmls2, dd2) ) 451 246 fHadronness->SetHadronness(0.25); 452 247 else … … 458 253 } 459 254 //========================================================================== 255 256 257 258 -
trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.h
r2272 r2300 18 18 class MHadronness; 19 19 class MHMatrix; 20 class MCT1Supercuts; 20 21 21 22 … … 23 24 { 24 25 private: 25 MHillas *fHil; 26 MHillasSrc *fHilSrc; 27 MMcEvt *fMcEvt; 28 MHadronness *fHadronness; //! output container for hadronness 26 MHillas *fHil; 27 MHillasSrc *fHilSrc; 28 MMcEvt *fMcEvt; 29 MHadronness *fHadronness; //! output container for hadronness 30 MCT1Supercuts *fSuper; // container for supercut parameters 29 31 30 32 TString fHadronnessName; // name of container to store hadronness 31 33 TString fHilName; 32 34 TString fHilSrcName; 35 TString fSuperName; // name of container for supercut parameters 33 36 34 37 Double_t fMm2Deg; … … 37 40 MHMatrix *fMatrix; 38 41 39 //---------------------------------40 // cut parameters41 TArrayD fLengthUp;42 TArrayD fLengthLo;43 TArrayD fWidthUp;44 TArrayD fWidthLo;45 TArrayD fDistUp;46 TArrayD fDistLo;47 TArrayD fAsymUp;48 TArrayD fAsymLo;49 TArrayD fAlphaUp;50 //---------------------------------51 52 void InitParams();53 54 42 Int_t PreProcess(MParList *pList); 55 43 Int_t Process(); 56 44 57 void Set(TArrayD &a, const TArrayD &b) { if (a.GetSize()==b.GetSize()) a=b; }58 45 Double_t GetVal(Int_t i) const; 59 46 60 Double_t CtsMCut( 61 #if ROOT_VERSION_CODE > ROOT_VERSION(3,05,00) 62 const 63 #endif 64 TArrayD &a, Double_t ls, Double_t ct, 47 Double_t CtsMCut(TArrayD &a, Double_t ls, Double_t ct, 65 48 Double_t ls2, Double_t dd2); 66 49 … … 70 53 const char *name=NULL, const char *title=NULL); 71 54 72 void SetParams(Double_t *par);73 void GetParams(Double_t *par);74 75 55 void SetHadronnessName(const TString name) { fHadronnessName = name; } 76 56 TString GetHadronnessName() const { return fHadronnessName; } … … 79 59 void StopMapping() { InitMapping(NULL); } 80 60 81 void SetLengthUp(const TArrayD &d) { Set(fLengthUp, d); }82 void SetLengthLo(const TArrayD &d) { Set(fLengthLo, d); }83 void SetWidthUp (const TArrayD &d) { Set(fWidthUp, d); }84 void SetWidthLo (const TArrayD &d) { Set(fWidthLo, d); }85 void SetDistUp (const TArrayD &d) { Set(fDistUp, d); }86 void SetDistLo (const TArrayD &d) { Set(fDistLo, d); }87 void SetAsymUp (const TArrayD &d) { Set(fAsymUp, d); }88 void SetAsymLo (const TArrayD &d) { Set(fAsymLo, d); }89 void SetAlphaUp (const TArrayD &d) { Set(fAlphaUp, d); }90 91 const TArrayD &GetLengthUp() const { return fLengthUp; }92 const TArrayD &GetLengthLo() const { return fLengthLo; }93 const TArrayD &GetWidthUp() const { return fWidthUp; }94 const TArrayD &GetWithLo() const { return fWidthLo; }95 const TArrayD &GetDistUp() const { return fDistUp; }96 const TArrayD &GetDistLo() const { return fDistLo; }97 const TArrayD &GetAsymUp() const { return fAsymUp; }98 const TArrayD &GetAsymLo() const { return fAsymLo; }99 const TArrayD &GetAlphaUp() const { return fAlphaUp; }100 61 101 62 ClassDef(MCT1SupercutsCalc, 0) // A class to evaluate the Supercuts … … 111 72 112 73 74 75 76 77 78 79 -
trunk/MagicSoft/Mars/manalysis/Makefile
r2272 r2300 24 24 INCLUDES = -I. -I../mbase -I../mmc -I../mraw -I../mgeom -I../mfilter \ 25 25 -I../mdata -I../mhist -I../mgui -I../mimage -I../mhistmc \ 26 -I../mfileio 26 -I../mfileio -I../mmain 27 27 28 28 … … 60 60 MMcTriggerLvl2.cc \ 61 61 MMcTriggerLvl2Calc.cc \ 62 MCT1Supercuts.cc \ 62 63 MCT1SupercutsCalc.cc \ 64 MCT1FindSupercuts.cc \ 65 MMinuitInterface.cc \ 63 66 MFiltercutsCalc.cc 64 67 # MCT1PadONOFF.cc \ -
trunk/MagicSoft/Mars/mhist/HistLinkDef.h
r2244 r2300 39 39 #pragma link C++ class MHSigmaTheta+; 40 40 #pragma link C++ class MHSigmaPixel+; 41 #pragma link C++ class MHOnSubtraction+; 42 #pragma link C++ class MHFindSignificance+; 43 #pragma link C++ class MHCT1Supercuts+; 41 44 42 45 #pragma link C++ class MHCompProb+; … … 47 50 48 51 #endif 52 53 54 55 56 57 58 59 60 -
trunk/MagicSoft/Mars/mhist/MH3.cc
r2173 r2300 241 241 Bool_t MH3::SetupFill(const MParList *plist) 242 242 { 243 // reset histogram (necessary if the same eventloop is run more than once) 244 fHist->Reset(); 243 245 244 246 TString bname("Binning"); -
trunk/MagicSoft/Mars/mhist/MHMatrix.cc
r2296 r2300 635 635 MEvtLoop evtloop; 636 636 evtloop.SetParList(plist); 637 evtloop.SetName("EvtLoopMatrix"); 637 638 //evtloop.SetProgressBar(&bar); 639 638 640 639 641 if (!evtloop.Eventloop()) -
trunk/MagicSoft/Mars/mhist/Makefile
r2244 r2300 60 60 MHSigmaTheta.cc \ 61 61 MHTriggerLvl0.cc \ 62 MHOnSubtraction.cc \ 63 MHFindSignificance.cc \ 64 MHCT1Supercuts.cc \ 62 65 MHCamera.cc 63 66 # MHCurrents.cc \ 64 # MHOnSubtraction.cc \ 67 65 68 66 69 SRCS = $(SRCFILES)
Note:
See TracChangeset
for help on using the changeset viewer.