Commit d7d45705c43aac97bf76e56dd1683e3593586ad7

Authored by mimayer
1 parent 0b624dc3

minor corrections to ctpsfcube.par and ctbkgcube.cpp

src/ctbkgcube/ctbkgcube.cpp
@@ -256,16 +256,17 @@ void ctbkgcube::run(void) @@ -256,16 +256,17 @@ void ctbkgcube::run(void)
256 // container and put all removed components in the output 256 // container and put all removed components in the output
257 // container 257 // container
258 int num = m_bkgmdl.size(); 258 int num = m_bkgmdl.size();
  259 +
259 for (int i = num-1; i >= 0; --i) { 260 for (int i = num-1; i >= 0; --i) {
260 261
261 // Flag removal 262 // Flag removal
262 bool remove = true; 263 bool remove = true;
263 264
264 // Do we have a CTA, HESS, MAGIC or VERITAS specific model? 265 // Do we have a CTA, HESS, MAGIC or VERITAS specific model?
265 - if (m_bkgmdl[i]->is_valid("CTA", "") ||  
266 - m_bkgmdl[i]->is_valid("HESS", "") ||  
267 - m_bkgmdl[i]->is_valid("MAGIC", "") ||  
268 - m_bkgmdl[i]->is_valid("VERITAS", "")) { 266 + if (m_bkgmdl[i]->instruments() == "CTA" ||
  267 + m_bkgmdl[i]->instruments() == "HESS" ||
  268 + m_bkgmdl[i]->instruments() == "MAGIC" ||
  269 + m_bkgmdl[i]->instruments() == "VERITAS") {
269 270
270 // Do we have a background model? 271 // Do we have a background model?
271 if (dynamic_cast<GModelData*>(m_bkgmdl[i]) != NULL) { 272 if (dynamic_cast<GModelData*>(m_bkgmdl[i]) != NULL) {
@@ -562,6 +563,14 @@ void ctbkgcube::get_parameters(void) @@ -562,6 +563,14 @@ void ctbkgcube::get_parameters(void)
562 563
563 // Load event cube from filename 564 // Load event cube from filename
564 m_bkgcube.load(incube); 565 m_bkgcube.load(incube);
  566 + // Loop over all bins in background cube
  567 + for (int i = 0; i < m_bkgcube.size(); ++i) {
  568 +
  569 + // Get event bin
  570 + GCTAEventBin* bin = m_bkgcube[i];
  571 + bin->counts(0.0);
  572 +
  573 + }
565 574
566 } // endelse: cube was loaded from file 575 } // endelse: cube was loaded from file
567 576
@@ -589,6 +598,7 @@ void ctbkgcube::get_parameters(void) @@ -589,6 +598,7 @@ void ctbkgcube::get_parameters(void)
589 ***************************************************************************/ 598 ***************************************************************************/
590 void ctbkgcube::fill_cube(GCTAObservation* obs) 599 void ctbkgcube::fill_cube(GCTAObservation* obs)
591 { 600 {
  601 +
592 // Continue only if observation pointer is valid 602 // Continue only if observation pointer is valid
593 if (obs != NULL) { 603 if (obs != NULL) {
594 604
src/ctpsfcube/ctpsfcube.par
@@ -18,8 +18,8 @@ @@ -18,8 +18,8 @@
18 # Observational parameters 18 # Observational parameters
19 #=================== 19 #===================
20 inobs, f, a, "NONE",,, "Event list or observation definition file" 20 inobs, f, a, "NONE",,, "Event list or observation definition file"
21 -incube, f, a, "NONE",,, "Counts map for exposure cube definition"  
22 -outcube, f, a, "psfcube.fits",,, "Output exposure cube file" 21 +incube, f, a, "NONE",,, "Counts map for psf cube definition"
  22 +outcube, f, a, "psfcube.fits",,, "Output psf cube file"
23 caldb, s, a, "dummy",,, "Calibration database" 23 caldb, s, a, "dummy",,, "Calibration database"
24 irf, s, a, "cta_dummy_irf",,, "Instrument response function" 24 irf, s, a, "cta_dummy_irf",,, "Instrument response function"
25 edisp, b, h, no,,, "Apply energy dispersion?" 25 edisp, b, h, no,,, "Apply energy dispersion?"