Changeset 3503 for trunk/MagicSoft/Mars/mmain
- Timestamp:
- 03/15/04 15:12:34 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mmain
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc
r2498 r3503 19 19 ! Author(s): Harald Kornmayer 1/2001 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 321 ! Copyright: MAGIC Software Development, 2000-2004 22 22 ! 23 23 ! … … 90 90 { 91 91 case kButDisplay: 92 new MEventDisplay(fInputFile );92 new MEventDisplay(fInputFile, "ped.root", "cal.root"); 93 93 return kTRUE; 94 94 } -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r3440 r3503 32 32 // root 33 33 // 34 #include <TFile.h> // TFile 34 35 #include <TList.h> // TList::Add 35 36 #include <TStyle.h> // gStyle->SetOptStat … … 78 79 // Container 79 80 // 80 #include "MHillas.h" // MHillas::Print(const MGeomCam&) 81 #include "MHillasExt.h" // MHillasExt::Print(const MGeomCam&) 82 #include "MHillasSrc.h" // MHillasSrc::Print(const MGeomCam&) 83 #include "MHEvent.h" // MHEvent 84 #include "MHCamera.h" // MHCamera 85 #include "MRawEvtData.h" // MRawEvtData 86 #include "MArrivalTimeCam.h" // MArrivalTimeCam 87 #include "MBadPixelsCam.h" // MBadPixelsCam 81 #include "MHillas.h" // MHillas::Print(const MGeomCam&) 82 #include "MHillasExt.h" // MHillasExt::Print(const MGeomCam&) 83 #include "MHillasSrc.h" // MHillasSrc::Print(const MGeomCam&) 84 #include "MHEvent.h" // MHEvent 85 #include "MHCamera.h" // MHCamera 86 #include "MRawEvtData.h" // MRawEvtData 87 #include "MArrivalTimeCam.h" // MArrivalTimeCam 88 #include "MBadPixelsCam.h" // MBadPixelsCam 89 #include "MPedPhotCam.h" // MPedPhotCam 90 #include "MCalibrationChargeCam.h" // MCalibrationChargeCam 88 91 89 92 ClassImp(MEventDisplay); … … 93 96 // Constructor. 94 97 // 95 MEventDisplay::MEventDisplay(const char *f ilename) : MStatusDisplay()98 MEventDisplay::MEventDisplay(const char *fname, const char *pname, const char *cname) : MStatusDisplay() 96 99 { 97 100 // 98 101 // Setup Task list for hillas calculation 99 102 // 100 SetupTaskList("Events", f ilename);103 SetupTaskList("Events", fname, pname, cname); 101 104 102 105 // 103 106 // Add MEventDisplay GUI elements to the display 104 107 // 105 AddUserFrame(f ilename);108 AddUserFrame(fname); 106 109 107 110 // … … 134 137 // preprocess tasks and read in first event (process) 135 138 // 136 void MEventDisplay::SetupTaskList(const char *tname, const char *fname) 137 { 139 void MEventDisplay::SetupTaskList(const char *tname, const char *fname, 140 const char *pname, const char *cname) 141 { 142 MCalibrationChargeCam *ccam=0; 143 MPedPhotCam *pcam=0; 144 145 MBadPixelsCam *badpix = new MBadPixelsCam; 146 147 TFile file(pname, "READ"); 148 if (!file.IsZombie()) 149 pcam = new MPedPhotCam; 150 if (pcam) 151 { 152 if (pcam->Read()<=0) 153 { 154 delete pcam; 155 pcam = NULL; 156 } 157 158 if (file.FindKey("MBadPixelsCam")) 159 { 160 MBadPixelsCam bad; 161 if (bad.Read()>0) 162 badpix->Merge(bad); 163 } 164 } 165 file.Close(); 166 file.Open(cname, "READ"); 167 if (!file.IsZombie()) 168 ccam = new MCalibrationChargeCam; 169 if (ccam) 170 { 171 if (ccam->Read()<=0) 172 { 173 delete ccam; 174 ccam = NULL; 175 } 176 177 if (file.FindKey("MBadPixelsCam")) 178 { 179 MBadPixelsCam bad; 180 if (bad.Read()>0) 181 badpix->Merge(bad); 182 } 183 } 184 file.Close(); 185 138 186 // 139 187 // Setup an empty job, with a reader task only. … … 154 202 plist->SetOwner(); 155 203 plist->AddToList(tlist); 156 157 MBadPixelsCam *badpix = new MBadPixelsCam;158 204 plist->AddToList(badpix); 205 if (pcam) 206 plist->AddToList(pcam); 207 if (ccam) 208 plist->AddToList(ccam); 159 209 160 210 fEvtLoop = new MEvtLoop; … … 180 230 evt8->SetName("Arrival Time"); 181 231 232 // This makes sure, that the containers are deleted... 182 233 plist->AddToList(evt1); 183 234 plist->AddToList(evt2); … … 189 240 plist->AddToList(evt8); 190 241 191 192 MMcPedestalCopy *pcopy = new MMcPedestalCopy;193 MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd;194 242 MCerPhotAnal2 *nanal = new MCerPhotAnal2; 195 243 MFillH *fill1 = new MFillH(evt1, "MCerPhotEvt", "MFillH1"); … … 203 251 MHillasCalc *hcalc = new MHillasCalc; 204 252 MHillasSrcCalc *scalc = new MHillasSrcCalc; 205 MArrivalTimeCalc *tcalc = new MArrivalTimeCalc; 206 MFillH *fill7 = new MFillH(evt7, "MRawEvtData", "MFillH7"); 207 MFillH *fill8 = new MFillH(evt8, "MArrivalTimeCam", "MFillH8"); 208 209 MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5); 210 MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5); 211 f1->SetName("MFMonteCarlo"); 212 f2->SetName("MFRealData"); 213 214 MExtractSignal* sigextract = new MExtractSignal(); 215 sigextract->SetRange(5, 9, 5, 9); 216 217 MMcCalibrationUpdate* mccalibupdate = new MMcCalibrationUpdate; 218 mccalibupdate->SetOuterPixelsGainScaling(kFALSE); 219 MCalibrate* mccalib = new MCalibrate; 220 221 // MC 222 sigextract->SetFilter(f1); 223 mccalibupdate->SetFilter(f1); 224 mccalib->SetFilter(f1); 225 226 // Data 227 nanal->SetFilter(f2); 228 229 tlist->AddToList(f1); 230 tlist->AddToList(f2); 231 tlist->AddToList(pcopy); 232 tlist->AddToList(pdnsb); 233 234 tlist->AddToList(sigextract); 235 tlist->AddToList(mccalibupdate); 236 tlist->AddToList(mccalib); 237 238 tlist->AddToList(nanal); 253 254 // If no pedestal or no calibration file is availble 255 if (!pcam || !ccam) 256 { 257 MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5); 258 MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5); 259 f1->SetName("MFMonteCarlo"); 260 f2->SetName("MFRealData"); 261 262 MMcPedestalCopy *pcopy = new MMcPedestalCopy; 263 MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd; 264 265 MExtractSignal* extra = new MExtractSignal(); 266 extra->SetRange(5, 9, 5, 9); 267 268 MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate; 269 mcupd->SetOuterPixelsGainScaling(kFALSE); 270 271 MCalibrate* mccal = new MCalibrate; 272 273 // MC 274 extra->SetFilter(f1); 275 mcupd->SetFilter(f1); 276 mccal->SetFilter(f1); 277 278 // Data 279 nanal->SetFilter(f2); 280 281 // TaskList 282 tlist->AddToList(f1); 283 tlist->AddToList(f2); 284 tlist->AddToList(pcopy); 285 tlist->AddToList(pdnsb); 286 287 tlist->AddToList(extra); 288 tlist->AddToList(mcupd); 289 tlist->AddToList(mccal); 290 291 tlist->AddToList(nanal); 292 } 293 else 294 { 295 MCalibrate* calib = new MCalibrate; 296 tlist->AddToList(calib); 297 } 239 298 240 299 tlist->AddToList(fill1); … … 248 307 tlist->AddToList(hcalc); 249 308 tlist->AddToList(scalc); 250 tlist->AddToList(tcalc); 251 tlist->AddToList(fill7); 252 tlist->AddToList(fill8); 309 if (!pcam || !ccam) 310 { 311 MArrivalTimeCalc *tcalc = new MArrivalTimeCalc; 312 MFillH *fill7 = new MFillH(evt7, "MRawEvtData", "MFillH7"); 313 MFillH *fill8 = new MFillH(evt8, "MArrivalTimeCam", "MFillH8"); 314 tlist->AddToList(tcalc); 315 tlist->AddToList(fill7); 316 tlist->AddToList(fill8); 317 } 253 318 254 319 // … … 408 473 MGeomCam *geom = (MGeomCam*) plist->FindObject("MGeomCam"); 409 474 MRawEvtData *raw = (MRawEvtData*)plist->FindObject("MRawEvtData"); 410 if (!raw)411 return;412 475 413 476 // … … 436 499 reader->DecEventNum(); 437 500 438 } while (raw ->GetNumPixels()<1 && dir!=0);501 } while (raw && raw->GetNumPixels()<1 && dir!=0); 439 502 440 503 // -
trunk/MagicSoft/Mars/mmain/MEventDisplay.h
r2728 r3503 38 38 39 39 void UpdateDisplay(); 40 void SetupTaskList(const char *tname, const char *fname); 40 void SetupTaskList(const char *tname, const char *fname, 41 const char *pname=0, const char *cname=0); 41 42 42 43 void ReadFirstEvent(); … … 46 47 47 48 public: 48 MEventDisplay(const char *f ilename);49 MEventDisplay(const char *fname, const char *pname=0, const char *cname=0); 49 50 ~MEventDisplay(); 50 51
Note:
See TracChangeset
for help on using the changeset viewer.