- Timestamp:
- 01/18/05 10:53:10 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mifae
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/Changelog
r5775 r5879 19 19 -*-*- END OF LINE -*-*- 20 20 21 2005/01/18 Javier Rico & Markus Gaug 22 * programs/controlPlot.cc, programs/controlplot.datacard, 23 programs/Makefile 24 - correct bugs: cuts in the proper units; separate ON and OFF 25 task lists since before it was reading who knows what 26 * library/MControlPlots.[h,cc] 27 - add Clear() method and remove some (minor) memory leaks 28 * library/MIslands.cc 29 - place call to SetOwner() in the correct place 30 21 31 2005/01/10 Javier Rico 22 32 * programs/makeHillas, programs/makehillas.datacard -
trunk/MagicSoft/Mars/mtemp/mifae/library/MControlPlots.cc
r5379 r5879 63 63 fCameraHisto[kOn] = NULL; 64 64 fCameraHisto[kOff] = NULL; 65 65 66 } 66 67 // ------------------------------------------------------------------------- … … 70 71 MControlPlots::~MControlPlots() 71 72 { 72 if(fGeomCam) 73 delete fGeomCam; 73 Clear(); 74 74 75 75 if(fCameraHisto[kOn]) … … 79 79 } 80 80 81 void MControlPlots::Clear(const Option_t *o) 82 { 83 84 if(fGeomCam) 85 delete fGeomCam; 86 87 fGeomCam = NULL; 88 } 89 81 90 82 91 // ------------------------------------------------------------------------- … … 86 95 Int_t MControlPlots::PreProcess(MParList* pList) 87 96 { 97 98 Reset(); 99 88 100 // FIXME! only valid for Magic geometry for the time being! 89 101 fGeomCam = new MGeomCamMagic; … … 94 106 *fLog << warn << AddSerialNumber("MIslands") << " [MIslands] not found... Some control plots will not be produced" << endl; 95 107 else 96 fCameraHisto[fMode] = new MHCamera(*fGeomCam,"Survive","Pixels surviving Image Cleaning"); 108 { 109 if (fCameraHisto[fMode]) 110 { 111 *fLog << err << GetDescriptor() 112 << "Camera with mode " << fMode << " already existing " << endl; 113 return kFALSE; 114 } 115 TString name = ""; 116 switch (fMode) 117 { 118 case kOn: 119 name += "On"; 120 break; 121 case kOff: 122 name += "Off"; 123 break; 124 } 125 fCameraHisto[fMode] = new MHCamera(*fGeomCam, 126 name.Data(), 127 "Pixels surviving Image Cleaning"); 128 } 97 129 return kTRUE; 98 130 } … … 105 137 if(!fIslands) return kTRUE; 106 138 107 MImgIsland *imgIsl = new MImgIsland;139 MImgIsland *imgIsl = NULL; 108 140 TIter Next(fIslands->GetList()); 109 141 … … 111 143 Int_t idPix = -1; 112 144 113 while ((imgIsl=(MImgIsland*)Next())) {114 115 pixNum = imgIsl->GetPixNum();116 117 for(Int_t k = 0; k<pixNum; k++)118 119 idPix = imgIsl->GetPixList(k);120 fCameraHisto[fMode]->Fill(idPix,1);121 fCameraHisto[fMode]->SetUsed(idPix);122 123 }145 while ((imgIsl=(MImgIsland*)Next())) 146 { 147 pixNum = imgIsl->GetPixNum(); 148 149 for(Int_t k = 0; k<pixNum; k++) 150 { 151 idPix = imgIsl->GetPixList(k); 152 fCameraHisto[fMode]->Fill(idPix,1.); 153 fCameraHisto[fMode]->SetUsed(idPix); 154 } 155 } 124 156 125 157 /* for (UInt_t i=0;i<fGeomCam->GetNumPixels();i++) … … 142 174 Int_t MControlPlots::PostProcess() 143 175 { 144 fCameraHisto[fMode]->SetEntries(fGeomCam->GetNumPixels());145 146 176 if(!fProduceFile) return kTRUE; 147 177 if(fProduceFile && !fFileName.Length()) … … 165 195 if(fCameraHisto[kOn] && fCameraHisto[kOff]) 166 196 { 167 diff = new MHCamera(*fGeomCam,"Diff"," Pixels surviving Image Cleaning");197 diff = new MHCamera(*fGeomCam,"Diff","Difference of pixels surviving Image Cleaning"); 168 198 169 199 // Normalize Off to On -
trunk/MagicSoft/Mars/mtemp/mifae/library/MControlPlots.h
r5170 r5879 15 15 { 16 16 public: 17 enum OnOffMode_t {kOn=0,kOff };17 enum OnOffMode_t {kOn=0,kOff=1}; 18 18 19 19 private: … … 34 34 virtual ~MControlPlots(); 35 35 36 void Reset() { Clear(); } 37 void Clear(const Option_t *o=""); 38 36 39 void SetFilename(TString fname) {fFileName=fname;} 37 40 void SetMode(OnOffMode_t mode) {fMode=mode;} -
trunk/MagicSoft/Mars/mtemp/mifae/library/MIslands.cc
r5186 r5879 24 24 25 25 fIslands = new TList; 26 26 fIslands->SetOwner(); 27 27 } 28 28 … … 33 33 MIslands::~MIslands() 34 34 { 35 fIslands->SetOwner();36 35 fIslands->Delete(); 37 36 } -
trunk/MagicSoft/Mars/mtemp/mifae/programs/Makefile
r5775 r5879 18 18 include ../../../Makefile.conf.general 19 19 20 PROGRAMS = makeHillas 20 PROGRAMS = makeHillas controlPlot 21 21 #psffit falseSource srcPos optimizeCuts controlPlot 22 22 SOLIB = $(MARSSYS)/libmars.so -
trunk/MagicSoft/Mars/mtemp/mifae/programs/controlPlot.cc
r4395 r5879 64 64 //----------------------------------------------------------------------------- 65 65 66 const TString defaultcard=" srcpos.datacard";66 const TString defaultcard="controlplot.datacard"; 67 67 const Float_t conver = 189./0.6; // conversion factor degrees to mm 68 68 … … 112 112 // include containers in parameter list 113 113 plist.AddToList(&tlist); 114 plist.AddToList(&islands);115 114 116 115 MF cut(filter); … … 127 126 MControlPlots controlplots(outputFile); 128 127 controlplots.SetProduceFile(kFALSE); 128 controlplots.SetMode(MControlPlots::kOn); 129 129 130 130 MContinue applycutS(&cutS); … … 157 157 if(widthcut.Length()) 158 158 tlist.AddToList(&applycutW); 159 if(filter.Length()) 160 tlist.AddToList(&applycut); 159 161 if(centercut.Length()) 160 162 tlist.AddToList(&applycutC); 161 if(filter.Length())162 tlist.AddToList(&applycut);163 163 tlist.AddToList(&controlplots); 164 164 … … 175 175 return; 176 176 177 178 // containers 179 MParList plist2; 180 MTaskList tlist2; 181 MIslands islands2; 182 183 // include containers in parameter list 184 plist2.AddToList(&tlist2); 185 186 // tasks 177 187 MReadTree read2("Parameters", offFile); 178 188 read2.DisableAutoScheme(); 179 tlist.AddToListBefore(&read2, &read, "All"); 180 tlist.RemoveFromList(&read); 189 tlist2.AddToList(&read2); 181 190 182 191 controlplots.SetMode(MControlPlots::kOff); 183 192 controlplots.SetProduceFile(kTRUE); 184 185 if (!evtloop.Eventloop(nmaxevents)) 193 controlplots.Reset(); 194 195 // include tasks in task list 196 if(sizecut.Length()) 197 tlist2.AddToList(&applycutS); 198 if(distcut.Length()) 199 tlist2.AddToList(&applycutD); 200 if(lengthcut.Length()) 201 tlist2.AddToList(&applycutL); 202 if(widthcut.Length()) 203 tlist2.AddToList(&applycutW); 204 if(filter.Length()) 205 tlist2.AddToList(&applycut); 206 if(centercut.Length()) 207 tlist2.AddToList(&applycutC); 208 tlist2.AddToList(&controlplots); 209 210 // Eventloop 211 MEvtLoop evtloop2; 212 evtloop2.SetParList(&plist2); 213 if (!evtloop2.Eventloop(nmaxevents)) 186 214 return; 187 188 tlist.PrintStatistics(); 215 216 tlist2.PrintStatistics(); 217 218 // do off-data if input file was specified 219 if(!offFile.Length()) 220 return; 221 189 222 } 223 190 224 //----------------------------------------------------------------------- 191 225 … … 268 302 ifun >> ch; 269 303 distcut+=ch; 304 distcut+="*"; 305 distcut+=conver; 270 306 distcut+=") && (MHillasSrc.fDist<"; 271 307 ifun >> ch; 272 308 distcut+=ch; 309 distcut+="*"; 310 distcut+=conver; 273 311 distcut+=")"; 274 312 } … … 281 319 ifun >> ch; 282 320 widthcut+=ch; 321 widthcut+="*"; 322 widthcut+=conver; 283 323 widthcut+=") && (MHillas.fWidth<"; 284 324 ifun >> ch; 285 325 widthcut+=ch; 326 widthcut+="*"; 327 widthcut+=conver; 286 328 widthcut+=")"; 287 329 } … … 294 336 ifun >> ch; 295 337 lengthcut+=ch; 338 lengthcut+="*"; 339 lengthcut+=conver; 296 340 lengthcut+=") && (MHillas.fLength<"; 297 341 ifun >> ch; 298 342 lengthcut+=ch; 343 lengthcut+="*"; 344 lengthcut+=conver; 299 345 lengthcut+=")"; 300 346 } … … 304 350 cout << "readDataCards Warning: overriding existing center cut" << endl; 305 351 char ch[10]; 306 centercut="sqrt(MHillas.fMeanX*MHillas.fMeanX+MHillas.fMeanY*MHillas.fMeanY) < 0.00317*";352 centercut="sqrt(MHillas.fMeanX*MHillas.fMeanX+MHillas.fMeanY*MHillas.fMeanY)<"; 307 353 ifun >> ch; 308 354 centercut+=ch; 355 centercut+="*"; 356 centercut+=conver; 309 357 } 310 358 } -
trunk/MagicSoft/Mars/mtemp/mifae/programs/controlplot.datacard
r4395 r5879 1 1 2 2 // Maximun number of on and off events to be processed) 3 NEVENTS 9999 99993 NEVENTS 9999 4 4 5 5 // On-data file name pattern 6 ONFILES ./srcPosPrueba.root6 ONFILES /mnt/users/jrico/magic/hillasCrab_200411_new.root 7 7 8 8 // Off-data file name pattern 9 OFFFILES ./srcPosOffPrueba.root9 OFFFILES /mnt/users/jrico/magic/hillasCrab_200411_new.root 10 10 11 11 // output file name 12 HITSFILE ./ rotateprueba2.ps12 HITSFILE ./prueba.ps 13 13 14 14 ////////// … … 16 16 ////////// 17 17 18 // Size cut (lower and upper) in # of photons19 SIZECUT 2000 999999918 // Size cut (lower and upper) 19 SIZECUT 0 9999999 20 20 21 21 // Dist cut (lower and upper) in degrees 22 DISTCUT 0.2 1.122 DISTCUT 0.2 1.2 23 23 24 24 // Width cut (lower and upper) in degrees 25 WIDTHCUT 0 0.1 225 WIDTHCUT 0 0.15 26 26 27 27 // Length cut (lower and upper) in degrees 28 LENGTHCUT 0 0.2 628 LENGTHCUT 0 0.25 29 29 30 30 // maxX and maxY upper cut in degrees 31 CENTERCUT 1. 131 CENTERCUT 1.2 32 32 33 33 // Other Additional cut
Note:
See TracChangeset
for help on using the changeset viewer.