- Timestamp:
- 02/16/04 11:18:25 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3180 r3183 4 4 5 5 -*-*- END OF LINE -*-*- 6 2004/02/14: Thomas Bretz 7 8 * manalysis/AnalysisLinkDef.h: 9 - added missing MCerPhotEvtIter 10 11 * merpp.cc: 12 - added possible usage of database 13 14 * star.cc: 15 - moved source code into new class MJStar - preliminary 16 17 * manalysis/MCerPhotPix.cc: 18 - updated class header 19 - fixed Print-output 20 21 * mbase/MAGIC.h: 22 - removed definition of MLog 23 24 * mbase/MArgs.h: 25 - removed include of MAGIC.h 26 27 * mbase/MLog.h: 28 - added extern definition of gLog 29 30 * mbase/MParContainer.[h,cc]: 31 - move body of constructors to source file 32 33 * mcalib/MCalibrate.cc, mcalib/MCalibrateData.cc, 34 mraw/MRawCrateArray.cc, mraw/MRawCrateData.cc, 35 mraw/MRawEvtData.cc, mraw/MRawEvtHeader.cc, mraw/MRawRead.cc, 36 mraw/MRawEvtPixelIter.cc, mraw/MRawFileWrite.cc: 37 - fixed documentation header 38 39 * mcalib/MMcCalibrationCalc.[h,cc]: 40 - fixed documentation header 41 - fixed usage of FindCreateObj and FindObject 42 - removed data member to count entries (use histogram instead) 43 - use TH1 function Integral instead of doing it manually 44 45 * mfilter/MFCosmics.cc: 46 - fixed documentation 47 48 * mimage/MHillas.cc, mimage/MImgCleanStd.cc, 49 mimage/MNewImagePar.[h,cc]: 50 - replaced for-loops by Iterators 51 52 * mraw/MRawFileRead.cc, mraw/MRawSocketRead.cc: 53 - fixed documentation header 54 - check return value of MRawRunHeader::ReadEvt 55 56 * mraw/mraw/MRawRunHeader.[h,cc]: 57 - fixed documentation header 58 - added return value to MRawRunHeader::ReadEvt 59 - added constant number for max format version - preliminary 60 (should by a static data member) 61 62 6 63 7 64 2004/02/16: Markus Gaug 8 65 9 * mcalib/Makefile 10 * mcalib/CalibLinkDef.h11 12 * mcalib/MHCalibrationRelTimePix.[h,cc] 13 * mcalib/MHCalibrationRelTimeCam.[h,cc]66 * mcalib/Makefile, mcalib/CalibLinkDef.h: 67 - added MHCalibrationRelTimePix 68 69 * mcalib/MHCalibrationRelTimePix.[h,cc], 70 mcalib/MHCalibrationRelTimeCam.[h,cc]: 14 71 - new classes to fit and display the relative arrival times. 15 72 - filled from MArrivalTime … … 23 80 24 81 82 25 83 2004/02/14: Markus Gaug 26 84 27 * mcalib/Makefile 28 * mcalib/CalibLinkDef.h85 * mcalib/Makefile, mcalib/CalibLinkDef.h: 86 - added MHCalibrationChargePINDiode 29 87 30 88 * mcalib/MHCalibrationChargePINDiode.[h,cc] … … 62 120 * macros/calibration.C 63 121 - changed pedestal displays accordingly 64 65 122 66 123 * mjobs/MJPedestal.h … … 78 135 * mcalib/MHGausEvent.[h,cc], mcalib/Makefile, mcalib/CalibLinkDef.h: 79 136 - replaced by the improved version: MHGausEvents.[h,cc] 80 81 137 82 138 -
trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc
r2860 r3183 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@ uni-sw.gwdg.de>19 ! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! Author(s): Harald Kornmayer 1/2001 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 121 ! Copyright: MAGIC Software Development, 2000-2004 22 22 ! 23 23 ! … … 31 31 // Storage container for the signal in a pixel in number of photons. 32 32 // 33 // NOTE: This container is NOT ment for I/O. Write it to a file on your own 34 // risk! 33 // NOTE: This container is NOT ment for I/O. Write it to a file on your 34 // own risk! 35 // 36 // fIsSaturated: boolean variable set to kTRUE whenever one or more of 37 // the low gain FADC slices of the pixel is in saturation. 35 38 // 36 39 // Version 2: 37 40 // ---------- 38 // Added fIsSaturated, boolean variable set to kTRUE whenever one or more of 39 // the low gain FADC slices of the pixel is in saturation. 41 // - added fIsSaturated 40 42 // 41 43 //////////////////////////////////////////////////////////////////////////// … … 67 69 gLog << (fRing>0?" Used ":" Unused "); 68 70 gLog << (fIsCore?" Core ":" "); 69 gLog << (fIsSaturated?" Saturated ":"Not Saturated");70 gLog << " Nphot= " << fPhot << " Error(Nphot)=" << fErrPhot << endl;71 gLog << (fIsSaturated?" ":"Not") << " saturated"; 72 gLog << " Nphot= " << fPhot << " Error(Nphot)=" << fErrPhot << endl; 71 73 } -
trunk/MagicSoft/Mars/mbase/MAGIC.h
r2711 r3183 44 44 const Double_t kRad2Deg = 180.0/3.1415926535897932384626433832795028841971693993751; 45 45 46 //47 // This is the definition of a global output stream, which by48 // default pipes all output to the stdout49 //50 51 #ifdef __LINUX__52 class MLog;53 #else54 #include "MLog.h"55 46 #endif 56 57 R__EXTERN MLog gLog;58 59 #endif -
trunk/MagicSoft/Mars/mbase/MArgs.h
r2728 r3183 1 1 #ifndef MARS_MArgs 2 2 #define MARS_MArgs 3 4 #ifndef MARS_MAGIC5 #include "MAGIC.h"6 #endif7 3 8 4 #ifndef ROOT_TNamed -
trunk/MagicSoft/Mars/mbase/MLog.h
r2784 r3183 201 201 }; 202 202 203 #endif 203 // 204 // This is the definition of a global output stream, which by 205 // default pipes all output to the stdout 206 // 207 R__EXTERN MLog gLog; 208 209 #endif -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r2490 r3183 60 60 using namespace std; 61 61 62 MParContainer::MParContainer(const char *name, const char *title) : 63 fName(name), fTitle(title), fLog(&gLog), fDisplay(NULL), fReadyToSave(kFALSE) 64 { 65 } 66 67 MParContainer::MParContainer(const TString &name, const TString &title) : 68 fName(name), fTitle(title), fLog(&gLog), fDisplay(NULL), fReadyToSave(kFALSE) 69 { 70 } 71 62 72 // -------------------------------------------------------------------------- 63 73 // -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r2772 r3183 12 12 #include "MAGIC.h" 13 13 #endif 14 15 14 #ifndef ROOT_TObject 16 15 #include <TObject.h> … … 28 27 class TDataMember; 29 28 class TMethodCall; 29 30 class MLog; 30 31 class MStatusDisplay; 31 32 … … 60 61 }; 61 62 62 MParContainer(const char *name="", const char *title="") : fName(name), fTitle(title), fLog(&gLog), fDisplay(NULL), fReadyToSave(kFALSE) { }63 MParContainer(const TString &name, const TString &title) : fName(name), fTitle(title), fLog(&gLog), fDisplay(NULL), fReadyToSave(kFALSE) { }63 MParContainer(const char *name="", const char *title=""); 64 MParContainer(const TString &name, const TString &title); 64 65 MParContainer(const MParContainer &named); 65 66 MParContainer& operator=(const MParContainer& rhs); -
trunk/MagicSoft/Mars/mcalib/MCalibrate.cc
r3116 r3183 17 17 ! 18 18 ! Author(s): Javier Lopez 12/2003 <mailto:jlopez@ifae.es> 19 ! Modified by: Javier Rico 01/2004 <mailto:jrico@ifae.es>19 ! Author(s): Javier Rico 01/2004 <mailto:jrico@ifae.es> 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2004 -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r3140 r3183 17 17 ! 18 18 ! Author(s): Javier Lopez 12/2003 <mailto:jlopez@ifae.es> 19 ! Modified by: Javier Rico01/2004 <mailto:jrico@ifae.es>20 ! 19 ! Author(s): Javier Rico 01/2004 <mailto:jrico@ifae.es> 20 ! Author(s): Wolfgang Wittek 02/2004 <mailto:wittek@mppmu.mpg.de> 21 21 ! 22 22 ! Copyright: MAGIC Software Development, 2000-2004 -
trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc
r3004 r3183 18 18 ! Author(s): Abelardo Moralejo, 12/2003 <mailto:moralejo@pd.infn.it> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 320 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 65 65 MMcCalibrationCalc::MMcCalibrationCalc(const char *name, const char *title) 66 66 { 67 fName = name ? name : "MMcCalibrationCalc"; 68 fTitle = title ? title : "Calculate and write conversion factors into MCalibrationCam Container"; 69 70 fADC2Phot = 0.; 71 fEvents = 0; 72 73 fHistRatio = new TH1F(AddSerialNumber("HistRatio"), "log10(fPassPhotCone/fSize)", 1500, -3., 3.); 74 fHistRatio->GetXaxis()->SetTitle("log_{10}(fPassPhotCone / fSize) (in photons/ADC count)"); 67 fName = name ? name : "MMcCalibrationCalc"; 68 fTitle = title ? title : "Calculate and write conversion factors into MCalibrationCam Container"; 69 70 fHistRatio = new TH1F(AddSerialNumber("HistRatio"), "log10(fPassPhotCone/fSize)", 1500, -3., 3.); 71 fHistRatio->SetXTitle("log_{10}(fPassPhotCone / fSize) [phot/ADC count]"); 75 72 } 76 73 … … 83 80 Bool_t MMcCalibrationCalc::CheckRunType(MParList *pList) const 84 81 { 85 const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");86 if (!run)87 { 88 *fLog << warn << dbginf<< "Warning - cannot check file type, MRawRunHeader not found." << endl;89 return kTRUE;90 } 91 92 return run->GetRunType() == kRTMonteCarlo;82 const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 83 if (!run) 84 { 85 *fLog << warn << "Warning - cannot check file type, MRawRunHeader not found." << endl; 86 return kTRUE; 87 } 88 89 return run->GetRunType() == kRTMonteCarlo; 93 90 } 94 91 … … 99 96 Int_t MMcCalibrationCalc::PreProcess(MParList *pList) 100 97 { 101 102 fCalCam = (MCalibrationCam*) pList->FindObject(AddSerialNumber("MCalibrationCam"));103 104 if ( !fCalCam )105 {106 *fLog << err << dbginf << "Cannot find " << AddSerialNumber("MCalibrationCam") << "... aborting." << endl;107 return kFALSE;108 }109 110 fHillas = (MHillas*) pList->FindCreateObj(AddSerialNumber("MHillas")); 111 if ( !fHillas)112 {113 *fLog << err << dbginf << "Cannot find " << AddSerialNumber("MHillas") << "... aborting." << endl;114 return kFALSE;115 }116 117 fNew = (MNewImagePar*) pList->FindCreateObj(AddSerialNumber("MNewImagePar")); 118 if ( !fNew)119 {120 *fLog << err << dbginf << "Cannot find " << AddSerialNumber("MNewImagePar") << "... aborting." << endl;121 return kFALSE;122 }123 124 fMcEvt = (MMcEvt*) pList->FindCreateObj(AddSerialNumber("MMcEvt")); 125 if ( !fMcEvt)126 {127 *fLog << err << dbginf << "Cannot find " << AddSerialNumber("MMcEvt") << "... aborting." << endl;128 return kFALSE;129 }130 131 return kTRUE; 132 98 fHistRatio->Reset(); 99 fADC2Phot = 0; 100 101 fCalCam = (MCalibrationCam*) pList->FindObject(AddSerialNumber("MCalibrationCam")); 102 if (!fCalCam) 103 { 104 *fLog << err << AddSerialNumber("MCalibrationCam") << "not found... aborting." << endl; 105 return kFALSE; 106 } 107 108 fHillas = (MHillas*) pList->FindObject(AddSerialNumber("MHillas")); 109 if ( !fHillas) 110 { 111 *fLog << err << AddSerialNumber("MHillas") << "not found... aborting." << endl; 112 return kFALSE; 113 } 114 115 fNew = (MNewImagePar*)pList->FindObject(AddSerialNumber("MNewImagePar")); 116 if (!fNew) 117 { 118 *fLog << err << AddSerialNumber("MNewImagePar") << "not found... aborting." << endl; 119 return kFALSE; 120 } 121 122 fMcEvt = (MMcEvt*) pList->FindObject(AddSerialNumber("MMcEvt")); 123 if (!fMcEvt) 124 { 125 *fLog << err << AddSerialNumber("MMcEvt") << "not found... aborting." << endl; 126 return kFALSE; 127 } 128 129 return kTRUE; 133 130 } 134 131 … … 144 141 // 145 142 if (!CheckRunType(pList)) 146 147 *fLog << err << dbginf << "This is no MC file... aborting." << endl;143 { 144 *fLog << err << "MMcCalibrationCalc can only used with MC files... aborting." << endl; 148 145 return kFALSE; 149 146 } 150 147 151 148 // 152 149 // Now check the existence of all necessary containers. 153 150 // 154 155 151 fGeom = (MGeomCam*) pList->FindObject(AddSerialNumber("MGeomCam")); 156 if ( ! fGeom)157 158 *fLog << err << dbginf << "Cannot find " << AddSerialNumber("MGeomCam") << "... aborting." << endl;152 if (!fGeom) 153 { 154 *fLog << err << AddSerialNumber("MGeomCam") << " mot found... aborting." << endl; 159 155 return kFALSE; 160 156 } 161 157 162 158 fHeaderFadc = (MMcFadcHeader*)pList->FindObject(AddSerialNumber("MMcFadcHeader")); 163 159 if (!fHeaderFadc) 164 165 *fLog << err << dbginf <<AddSerialNumber("MMcFadcHeader") << " not found... aborting." << endl;160 { 161 *fLog << err << AddSerialNumber("MMcFadcHeader") << " not found... aborting." << endl; 166 162 return kFALSE; 167 163 } 168 164 169 165 for (UInt_t ipix = 0; ipix < fGeom->GetNumPixels(); ipix++) 170 166 { 171 167 if (fHeaderFadc->GetPedestalRmsHigh(ipix) > 0 || 172 fHeaderFadc->GetPedestalRmsLow(ipix) > 0 ) 173 { 174 *fLog << err << endl << endl << dbginf << "You are trying to calibrate the data using a Camera file produced with added noise. Please use a noiseless file for calibration. Aborting..." << endl << endl; 168 fHeaderFadc->GetPedestalRmsLow(ipix) > 0 ) 169 { 170 *fLog << err << "Trying to calibrate the data using a Camera file produced with added noise." << endl; 171 *fLog << "Please use a noiseless file for calibration... aborting." << endl << endl; 175 172 return kFALSE; 176 177 173 } 174 } 178 175 179 176 return kTRUE; … … 187 184 Int_t MMcCalibrationCalc::Process() 188 185 { 189 190 // 191 // Exclude events with some saturated pixel 192 // 193 if ( fNew->GetNumSaturatedPixels() > 0 ) 186 // 187 // Exclude events with some saturated pixel 188 // 189 if (fNew->GetNumSaturatedPixels()>0) 190 return kTRUE; 191 192 // 193 // Exclude events with low Size (larger fluctuations) 194 // FIXME? The present cut (1000 "inner-pixel-counts") is somehow 195 // arbitrary. Might it be optimized? 196 // 197 if (fHillas->GetSize()<1000) 198 return kTRUE; 199 200 fADC2Phot += fMcEvt->GetPassPhotCone()/fHillas->GetSize(); 201 202 fHistRatio->Fill(TMath::Log10(fMcEvt->GetPassPhotCone()/fHillas->GetSize())); 203 194 204 return kTRUE; 195 196 // 197 // Exclude events with low Size (larger fluctuations) 198 // FIXME? The present cut (1000 "inner-pixel-counts") is somehow arbitrary. 199 // Might it be optimized? 200 // 201 if ( fHillas->GetSize() < 1000 ) 205 } 206 207 // -------------------------------------------------------------------------- 208 // 209 // Fill the MCalibrationCam object 210 // 211 Int_t MMcCalibrationCalc::PostProcess() 212 { 213 const Stat_t n = fHistRatio->GetEntries(); 214 if (n<1) 215 { 216 *fLog << err << "No events read... aborting." << endl; 217 return kFALSE; 218 } 219 220 fADC2Phot /= n; 221 222 // 223 // For the calibration we no longer use the mean, 224 // but the peak of the distribution: 225 // 226 const Int_t reach = 2; 227 228 Stat_t summax = 0; 229 Int_t mode = 0; 230 231 // FIXME: Is this necessary? We could use GetMaximumBin instead.. 232 for (Int_t ibin = 1+reach; ibin <= fHistRatio->GetNbinsX()-reach; ibin++) 233 { 234 const Stat_t sum = fHistRatio->Integral(ibin-reach, ibin+reach); 235 236 if (sum <= summax) 237 continue; 238 239 summax = sum; 240 mode = ibin; 241 } 242 243 fADC2Phot = TMath::Power(10, fHistRatio->GetBinCenter(mode)); 244 245 const Int_t num = fCalCam->GetSize(); 246 for (int i=0; i<num; i++) 247 { 248 MCalibrationPix &calpix = (*fCalCam)[i]; 249 250 const Float_t factor = fADC2Phot*calpix.GetMeanConversionBlindPixelMethod(); 251 252 calpix.SetConversionBlindPixelMethod(factor, 0., 0.); 253 } 254 202 255 return kTRUE; 203 204 fADC2Phot += fMcEvt->GetPassPhotCone() / fHillas->GetSize(); 205 fEvents ++; 206 207 fHistRatio->Fill(log10(fMcEvt->GetPassPhotCone()/fHillas->GetSize())); 208 209 return kTRUE; 210 } 211 212 // -------------------------------------------------------------------------- 213 // 214 // Fill the MCalibrationCam object 215 // 216 Int_t MMcCalibrationCalc::PostProcess() 217 { 218 219 if (fEvents > 0) 220 fADC2Phot /= fEvents; 221 else 222 { 223 *fLog << err << dbginf << "No events were read! Aborting." << endl; 224 return kFALSE; 225 } 226 227 // 228 // For the calibration we no longer use the mean, but thepeak of the distribution: 229 // 230 231 Float_t summax = 0.; 232 Int_t mode = 0; 233 Int_t reach = 2; 234 for (Int_t ibin = 1+reach; ibin <= fHistRatio->GetNbinsX()-reach; ibin++) 235 { 236 Float_t sum = 0; 237 for(Int_t k = ibin-reach; k <= ibin+reach; k++) 238 sum += fHistRatio->GetBinContent(k); 239 if (sum > summax) 240 { 241 summax = sum; 242 mode = ibin; 243 } 244 } 245 246 fADC2Phot = pow(10., fHistRatio->GetXaxis()->GetBinCenter(mode)); 247 248 const int num = fCalCam->GetSize(); 249 250 for (int i=0; i<num; i++) 251 { 252 MCalibrationPix &calpix = (*fCalCam)[i]; 253 254 Float_t factor = fADC2Phot*calpix.GetMeanConversionBlindPixelMethod(); 255 256 calpix.SetConversionBlindPixelMethod(factor, 0., 0.); 257 258 } 259 260 return kTRUE; 261 262 } 256 } -
trunk/MagicSoft/Mars/mfilter/MFCosmics.cc
r3112 r3183 33 33 // the outer pixels have some defect). 34 34 // 35 // ProProcess: Search for MPedestalCam, MExtractedSignalCam36 //37 // ReInit: Initialize number of used FADC slices38 //39 // Process: if fMaxEmptyPixels pixels lower than 3 pedRMS,40 // the event is supposed to41 // be a cosmic and kContinue is returned42 //43 //44 35 // Input Containers: 45 36 // MRawEvtData … … 120 111 // -------------------------------------------------------------------------- 121 112 // 122 // The ReInit searches the following input containers for information: 123 // - MExtractedSignalCam 113 // Initialize number of used FADC slices 124 114 // 125 115 Bool_t MFCosmics::ReInit(MParList *pList) -
trunk/MagicSoft/Mars/mimage/MHillas.cc
r2624 r3183 188 188 Int_t MHillas::Calc(const MGeomCam &geom, const MCerPhotEvt &evt) 189 189 { 190 const UInt_t npixevt = evt.GetNumPixels(); 191 192 // 193 // sanity check 194 // 195 if (npixevt < 3) 190 // 191 // sanity check 1 192 // 193 if (evt.GetNumPixels()<3) 196 194 return 1; 197 195 … … 209 207 fSize = 0; 210 208 211 Int_t numused = 0; 212 213 for (UInt_t i=0; i<npixevt; i++) 209 MCerPhotPix *pix = 0; 210 211 TIter Next(evt); 212 UInt_t numused = 0; 213 while ((pix=(MCerPhotPix*)Next())) 214 214 { 215 const MCerPhotPix &pix = evt[i]; 216 217 if (!pix.IsPixelUsed()) 218 continue; 219 220 const MGeomPix &gpix = geom[pix.GetPixId()]; 221 222 const Float_t nphot = pix.GetNumPhotons(); 215 const MGeomPix &gpix = geom[pix->GetPixId()]; 216 217 const Float_t nphot = pix->GetNumPhotons(); 223 218 224 219 fSize += nphot; // [counter] … … 230 225 231 226 // 232 // sanity check s227 // sanity check 2 233 228 // 234 229 if (fSize==0) … … 238 233 fMeanY /= fSize; // [mm] 239 234 235 // 236 // sanity check 3 237 // 240 238 if (numused<3) 241 239 return 3; … … 254 252 Double_t corryy=0; // [m^2] 255 253 256 for (UInt_t i=0; i<npixevt; i++) 254 Next.Reset(); 255 while ((pix=(MCerPhotPix*)Next())) 257 256 { 258 const MCerPhotPix &pix = evt[i]; 259 260 if (!pix.IsPixelUsed()) 261 continue; 262 263 const MGeomPix &gpix = geom[pix.GetPixId()]; 257 const MGeomPix &gpix = geom[pix->GetPixId()]; 264 258 265 259 const Float_t dx = gpix.GetX() - fMeanX; // [mm] 266 260 const Float_t dy = gpix.GetY() - fMeanY; // [mm] 267 261 268 const Float_t nphot = pix .GetNumPhotons();// [#phot]262 const Float_t nphot = pix->GetNumPhotons(); // [#phot] 269 263 270 264 corrxx += nphot * dx*dx; // [mm^2] … … 297 291 const Double_t d0 = corryy - corrxx; 298 292 const Double_t d1 = corrxy*2; 299 const Double_t d2 = d0 + sqrt(d0*d0 + d1*d1);293 const Double_t d2 = d0 + TMath::Sqrt(d0*d0 + d1*d1); 300 294 const Double_t tand = d2 / d1; 301 295 const Double_t tand2 = tand*tand; 302 296 303 fDelta = atan(tand);297 fDelta = TMath::ATan(tand); 304 298 305 299 const Double_t s2 = tand2+1; 306 const Double_t s = sqrt(s2);300 const Double_t s = TMath::Sqrt(s2); 307 301 308 302 fCosDelta = 1.0/s; // need these in derived classes 309 303 fSinDelta = tand/s; // like MHillasExt 310 304 311 Double_t axis1 = (tand2*corryy + d2 + corrxx)/s2/fSize;312 Double_t axis2 = (tand2*corrxx - d2 + corryy)/s2/fSize;305 const Double_t axis1 = (tand2*corryy + d2 + corrxx)/s2/fSize; 306 const Double_t axis2 = (tand2*corrxx - d2 + corryy)/s2/fSize; 313 307 314 308 // … … 320 314 // very small numbers can get negative by rounding 321 315 // 322 fLength = axis1<0 ? 0 : sqrt(axis1); // [mm]323 fWidth = axis2<0 ? 0 : sqrt(axis2); // [mm]316 fLength = axis1<0 ? 0 : TMath::Sqrt(axis1); // [mm] 317 fWidth = axis2<0 ? 0 : TMath::Sqrt(axis2); // [mm] 324 318 325 319 SetReadyToSave(); -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r2781 r3183 329 329 void MImgCleanStd::CleanStep1() 330 330 { 331 const Int_t entries = fEvt->GetNumPixels();332 331 const TArrayD &data = fData->GetData(); 333 332 … … 335 334 // check the number of all pixels against the noise level and 336 335 // set them to 'unused' state if necessary 337 // 338 for (Int_t i=0; i<entries; i++ )339 { 340 MCerPhotPix &pix = (*fEvt)[i];341 342 if (data[pix.GetPixId()] <= fCleanLvl1)343 pix.SetPixelUnused();344 }336 // 337 MCerPhotPix *pix; 338 339 // Loop over all pixels 340 MCerPhotEvtIter Next(fEvt, kFALSE); 341 while ((pix=static_cast<MCerPhotPix*>(Next()))) 342 if (data[pix->GetPixId()] <= fCleanLvl1) 343 pix->SetPixelUnused(); 345 344 } 346 345 … … 351 350 // neighbors). 352 351 // 353 // Takes the maximum pixel id from CleanStep1 as an argument354 //355 352 void MImgCleanStd::CleanStep2() 356 353 { 357 const Int_t entries = fEvt->GetNumPixels(); 358 359 // 360 // In the worst case we have to loop 6 times 577 times, to 361 // catch the behaviour of all next neighbors. Here we can gain 362 // much by using an array instead of checking through all pixels 363 // (MCerPhotEvt::IsPixelUsed) all the time. 364 // 365 // We allocate the array ourself because the TArrays always do 366 // range check which slows down the access to the array 367 // by 25-50% 368 // 369 Byte_t *ispixused = new Byte_t[fCam->GetNumPixels()]; 370 memset(ispixused, 0, sizeof(Byte_t)*fCam->GetNumPixels()); 371 372 for (Int_t i=0; i<entries; i++) 373 { 374 const MCerPhotPix &pix = (*fEvt)[i]; 375 ispixused[pix.GetPixId()] = pix.IsPixelUsed() ? 1 : 0 ; 376 } 377 378 for (Int_t i=0; i<entries; i++) 379 { 380 // get entry i from list 381 MCerPhotPix &pix = (*fEvt)[i]; 382 383 // get pixel id of this entry 384 const Int_t idx = pix.GetPixId(); 385 386 // check if pixel is in use, if not goto next pixel in list 387 if (ispixused[idx] == 0) 388 continue; 354 MCerPhotPix *pix; 355 356 // Loop over used pixels only 357 TIter Next(*fEvt); 358 while ((pix=static_cast<MCerPhotPix*>(Next()))) 359 { 360 // get pixel id of this entry 361 const Int_t idx = pix->GetPixId(); 389 362 390 363 // check for 'used' neighbors of this pixel … … 400 373 401 374 // when you find an used neighbor, break the loop 402 if ( ispixused[idx2] == 1)375 if (fEvt->IsPixelUsed(idx2)) 403 376 { 404 377 hasNeighbor = kTRUE; … … 408 381 409 382 if (hasNeighbor == kFALSE) 410 pix.SetPixelUnused(); 411 } 412 413 delete ispixused; 383 pix->SetPixelUnused(); 384 } 414 385 415 386 // 416 387 // now we declare all pixels that survive as CorePixels 417 388 // 418 for (Int_t i=0; i<entries; i++) 419 { 420 MCerPhotPix &pix = (*fEvt)[i]; 421 422 if (pix.IsPixelUsed()) 423 pix.SetPixelCore(); 424 } 389 Next.Reset(); 390 while ((pix=static_cast<MCerPhotPix*>(Next()))) 391 pix->SetPixelCore(); 425 392 } 426 393 … … 440 407 const Int_t idx2 = gpix.GetNeighbor(j); 441 408 442 if (!fEvt-> GetPixById(idx2) || !fEvt->IsPixelCore(idx2))409 if (!fEvt->IsPixelCore(idx2)) 443 410 continue; 444 411 … … 459 426 void MImgCleanStd::CleanStep4(UShort_t r, MCerPhotPix &pix) 460 427 { 461 // Skip events that have already a defined status; 462 if( pix.GetRing()!= 0) 463 return; 428 // 429 // Skip events that have already a defined status; 430 // 431 if (pix.GetRing() != 0) 432 return; 433 464 434 // 465 435 // check if the pixel's next neighbor is a used pixel. … … 478 448 479 449 MCerPhotPix *npix = fEvt->GetPixById(idx2); 480 481 450 if (!npix || !npix->IsPixelUsed() || npix->GetRing()>r-1 ) 482 451 continue; 483 452 484 453 pix.SetRing(r); … … 495 464 void MImgCleanStd::CleanStep3() 496 465 { 497 const Int_t entries = fEvt->GetNumPixels();498 466 const TArrayD &data = fData->GetData(); 499 467 500 468 for (UShort_t r=1; r<fCleanRings+1; r++) 501 469 { 502 for (Int_t i=0; i<entries; i++) 470 MCerPhotPix *pix; 471 472 // Loop over all pixels 473 MCerPhotEvtIter NextAll(fEvt, kFALSE); 474 while ((pix=static_cast<MCerPhotPix*>(NextAll()))) 503 475 { 504 //505 // get pixel as entry il from list506 //507 MCerPhotPix &pix = (*fEvt)[i];508 509 476 // 510 477 // if pixel is a core pixel go to the next pixel 511 478 // 512 if (pix .IsPixelCore())479 if (pix->IsPixelCore()) 513 480 continue; 514 481 515 if (data[pix .GetPixId()] <= fCleanLvl2)482 if (data[pix->GetPixId()] <= fCleanLvl2) 516 483 continue; 517 484 518 485 if (r==1) 519 CleanStep3b( pix);486 CleanStep3b(*pix); 520 487 else 521 CleanStep4(r, pix);488 CleanStep4(r, *pix); 522 489 } 523 490 } -
trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
r2849 r3183 18 18 ! Author(s): Wolfgang Wittek 03/2003 <mailto:wittek@mppmu.mpg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 320 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 31 31 // fLeakage1 ratio: (photons in most outer ring of pixels) over fSize 32 32 // fLeakage2 ratio: (photons in the 2 outer rings of pixels) over fSize 33 // fNumSaturatedPixels: number of pixels in which at least one slice 34 // of the low gain FADC was saturated. 33 35 // 34 36 // Version 2: 35 // Added fNumSaturatedPixels: number of pixels in which at least one slice36 // of the low gain FADC was saturated.37 // ---------- 38 // - added fNumSaturatedPixels 37 39 // 38 40 ///////////////////////////////////////////////////////////////////////////// … … 106 108 const MCerPhotPix &pix = evt[i]; 107 109 110 // count saturated pixels 108 111 if (pix.IsPixelSaturated()) 109 112 fNumSaturatedPixels++; 110 113 114 // skip unused pixels 111 115 if (!pix.IsPixelUsed()) 112 116 continue; 117 118 // count used and core pixels 119 if (pix.IsPixelCore()) 120 fNumCorePixels++; 121 122 // count used pixels 123 fNumUsedPixels++; 113 124 114 125 const Int_t pixid = pix.GetPixId(); … … 125 136 if (gpix.IsInOuterRing()) 126 137 edgepix2 += nphot; 127 128 //129 // count used and core pixels130 //131 if (pix.IsPixelCore())132 fNumCorePixels++;133 134 fNumUsedPixels++;135 138 136 139 // … … 172 175 *fLog << " - Used Pixels [#] = " << fNumUsedPixels << " Pixels" << endl; 173 176 *fLog << " - Core Pixels [#] = " << fNumCorePixels << " Pixels" << endl; 177 *fLog << " - Sat. Pixels [#] = " << fNumSaturatedPixels << " Pixels" << endl; 174 178 } -
trunk/MagicSoft/Mars/mimage/MNewImagePar.h
r2849 r3183 13 13 { 14 14 private: 15 Float_t fLeakage1; // (photons in most outer ring of pixels) over fSize16 Float_t fLeakage2; // (photons in the 2 outer rings of pixels) over fSize15 Float_t fLeakage1; // (photons in most outer ring of pixels) over fSize 16 Float_t fLeakage2; // (photons in the 2 outer rings of pixels) over fSize 17 17 18 Float_t fConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize19 Float_t fConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize18 Float_t fConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 19 Float_t fConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 20 20 21 Short_t fNumUsedPixels; // Number of pixels which survived the image cleaning 22 Short_t fNumCorePixels; // number of core pixels 23 24 Short_t fNumSaturatedPixels; // number of saturated pixels 21 Short_t fNumUsedPixels; // Number of pixels which survived the image cleaning 22 Short_t fNumCorePixels; // number of core pixels 23 Short_t fNumSaturatedPixels; // number of pixels with saturating lo-gains 25 24 26 25 public: … … 29 28 void Reset(); 30 29 31 Float_t GetLeakage1() const 32 Float_t GetLeakage2() const 30 Float_t GetLeakage1() const { return fLeakage1; } 31 Float_t GetLeakage2() const { return fLeakage2; } 33 32 34 Float_t GetConc() const { return fConc;}35 Float_t GetConc1() const 33 Float_t GetConc() const { return fConc; } 34 Float_t GetConc1() const { return fConc1; } 36 35 37 Int_t GetNumUsedPixels() const { return fNumUsedPixels; }38 Int_t GetNumCorePixels() const { return fNumCorePixels; }36 Short_t GetNumUsedPixels() const { return fNumUsedPixels; } 37 Short_t GetNumCorePixels() const { return fNumCorePixels; } 39 38 40 39 Short_t GetNumSaturatedPixels() const { return fNumSaturatedPixels; } … … 49 48 50 49 #endif 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 -
trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc
r2645 r3183 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mraw/MRawCrateData.cc
r2748 r3183 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r3047 r3183 18 18 ! Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 320 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
r3139 r3183 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 118 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
r3018 r3183 19 19 ! Author(s): Markus Gaus 10/2002 <mailto:markus@ifae.es> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 221 ! Copyright: MAGIC Software Development, 2000-2004 22 22 ! 23 23 ! -
trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
r2984 r3183 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@ uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 118 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 148 148 // Read RUN HEADER (see specification) from input stream 149 149 // 150 fRawRunHeader->ReadEvt(*fIn); 150 if (!fRawRunHeader->ReadEvt(*fIn)) 151 return kFALSE; 152 151 153 if (!(*fIn)) 152 154 { … … 154 156 return kFALSE; 155 157 } 156 if (fRawRunHeader->GetMagicNumber()!=kMagicNumber)157 return kFALSE;158 //if (fRawRunHeader->GetMagicNumber()!=kMagicNumber) 159 // return kFALSE; 158 160 159 161 fRawRunHeader->Print(); -
trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc
r2556 r3183 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@ uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 118 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mraw/MRawRead.cc
r3139 r3183 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 118 ! Author(s): Thomas Bretz 10/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r3047 r3183 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 118 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 101 101 // Read in one run header from the binary file 102 102 // 103 voidMRawRunHeader::ReadEvt(istream& fin)103 Bool_t MRawRunHeader::ReadEvt(istream& fin) 104 104 { 105 105 // … … 116 116 { 117 117 *fLog << err << "Error: Wrong Magic Number (0x" << hex << fMagicNumber << "): Not a Magic File!" << endl; 118 return ;118 return kFALSE; 119 119 } 120 120 … … 125 125 126 126 fin.read((char*)&fFormatVersion, 2); // Total=4 127 if (fFormatVersion>2) 128 *fLog << warn << "WARNING - Format version V" << fFormatVersion << " unknown!" << endl; 127 if (fFormatVersion>kMaxFormatVersion) 128 { 129 *fLog << err << "WARNING - File vormat V" << fFormatVersion << " not implemented!" << endl; 130 return kFALSE; 131 } 129 132 130 133 fin.read((char*)&fSoftVersion, 2); // Total=6 … … 165 168 fin.read((char*)fPixAssignment->GetArray(), nPixel*2); 166 169 fin.read((char*)&dummy, 16); 170 171 return kTRUE; 167 172 } 168 173 -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r3047 r3183 17 17 // Magic number to detect the magic file type 18 18 // 19 const UShort_t kMagicNumber = 0xc0c0; 19 const UShort_t kMagicNumber = 0xc0c0; 20 const Byte_t kMaxFormatVersion = 3; 20 21 21 22 // … … 106 107 void Print(Option_t *t=NULL) const; 107 108 108 voidReadEvt(istream& fin);109 Bool_t ReadEvt(istream& fin); 109 110 110 111 ClassDef(MRawRunHeader, 2) // storage container for general info -
trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc
r2748 r3183 18 18 ! Author(s): Thomas Bretz, 10/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 320 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 220 220 // 221 221 fLog->SetNullOutput(); 222 fRawRunHeader->ReadEvt(*fIn);222 const Bool_t rc = fRawRunHeader->ReadEvt(*fIn); 223 223 fLog->SetNullOutput(kFALSE); 224 224 225 if (fRawRunHeader->GetMagicNumber()!=kMagicNumber && fRawRunHeader->GetMagicNumber()!=kMagicNumber+1) 226 { 227 *fLog << err << "Error: Wrong Magic Number (0x" << hex << fRawRunHeader->GetMagicNumber() << "): Not a Magic File!" << endl; 228 return kFALSE; 229 } 225 if (!rc) 226 return kFALSE; 230 227 231 228 if (fRunNumber!=fRawRunHeader->GetRunNumber()) -
trunk/MagicSoft/Mars/star.cc
r2623 r3183 71 71 } 72 72 73 class MJStar : public MParContainer 74 { 75 private: 76 TString fInputFile; 77 TString fOutputFile; 78 79 Bool_t fIsUpdate; 80 Byte_t fComprLevel; 81 82 Byte_t fSerialIdx; 83 84 Bool_t CheckFiles() 85 { 86 if (fOutputFile.IsNull()) 87 { 88 fOutputFile = fInputFile; 89 90 if (fOutputFile.EndsWith(".raw")) 91 fOutputFile = fOutputFile(0, fOutputFile.Length()-4); 92 93 if (fOutputFile.EndsWith(".rep")) 94 fOutputFile = fOutputFile(0, fOutputFile.Length()-4); 95 96 if (fOutputFile.EndsWith(".txt")) 97 fOutputFile = fOutputFile(0, fOutputFile.Length()-4); 98 } 99 100 if (fInputFile.IsNull()) 101 { 102 *fLog << err << "Sorry, no input file." << endl; 103 return kFALSE; 104 } 105 106 if (fOutputFile.IsNull()) 107 { 108 *fLog << err << "Sorry, no output file." << endl; 109 return kFALSE; 110 } 111 112 if (!fInputFile.EndsWith(".root")) 113 fInputFile += ".root"; 114 115 if (!fOutputFile.EndsWith(".root")) 116 fOutputFile += ".root"; 117 118 // 119 // check whether the given files are OK. 120 // 121 if (gSystem->AccessPathName(fInputFile, kFileExists)) 122 { 123 *fLog << err << "Sorry, the input file '" << fInputFile << "' doesn't exist." << endl; 124 return kFALSE; 125 } 126 127 if (!gSystem->AccessPathName(fOutputFile, kFileExists)) 128 { 129 if (fIsUpdate) 130 gLog << warn << "Warning: File doesn't '" << fOutputFile << "' exist... recreating." << endl; 131 } 132 133 if (fIsUpdate || gSystem->AccessPathName(fOutputFile, kFileExists)) 134 if (!gSystem->AccessPathName(fOutputFile, kWritePermission)) 135 { 136 gLog << err << "Sorry, you don't have write permission for '" << fOutputFile << "'." << endl; 137 return kFALSE; 138 } 139 return kTRUE; 140 } 141 142 public: 143 MJStar(const char *name=0, const char *title=0) 144 : fIsUpdate(kFALSE), fComprLevel(1), fSerialIdx(0) 145 { 146 fName = name; 147 fTitle = title; 148 } 149 150 void SetInputFile(const char *f) { fInputFile = f; } 151 void SetOutputFile(const char *f) { fOutputFile = f; } 152 void SetSerialIdx(Byte_t i) { fSerialIdx = i; } 153 void SetComprLevel(Byte_t l) { fComprLevel = l; } 154 void SetUpdate(Bool_t u=kTRUE) { fIsUpdate = u; } 155 156 Bool_t Process() 157 { 158 if (!CheckFiles()) 159 return kFALSE; 160 161 // 162 // Create a empty Parameter List and an empty Task List 163 // The tasklist is identified in the eventloop by its name 164 // 165 MParList plist; 166 167 MTaskList tlist; 168 plist.AddToList(&tlist); 169 170 // PRELIMINARY: 171 /* 172 MReportDrive rep; 173 plist.AddToList(&rep); 174 MPointingPos pos; 175 plist.AddToList(&pos); 176 */ 177 178 // 179 // Now setup the tasks and tasklist: 180 // --------------------------------- 181 // 182 MReadMarsFile read("Events", fInputFile); 183 read.DisableAutoScheme(); 184 185 MGeomApply apply; 186 MMcPedestalCopy pcopy; 187 MMcPedestalNSBAdd pnsb; 188 189 //MPointingPosCalc pcalc; 190 191 MCerPhotCalc ncalc; 192 MCerPhotAnal2 nanal; 193 194 MFDataMember f1("MRawRunHeader.fRunType", '>', 255.5); 195 MFDataMember f2("MRawRunHeader.fRunType", '<', 255.5); 196 197 ncalc.SetFilter(&f1); 198 nanal.SetFilter(&f2); 199 200 MBlindPixelCalc blind; 201 MSigmabarCalc sgcal; 202 //MFillH fills("MHSigmaTheta", "", "FillSigmaTheta"); 203 //MFillH fillb("MHBlindPixels", "", "FillBlindPixels"); 204 MImgCleanStd clean; 205 MHillasCalc hcalc; 206 MHillasSrcCalc scalc; // !!Preliminary!! Will be removed later! 207 MWriteRootFile write(fOutputFile, fIsUpdate?"UPDATE":"RECREATE", "Star output", fComprLevel); 208 209 tlist.AddToList(&read); 210 tlist.AddToList(&f1); 211 tlist.AddToList(&f2); 212 tlist.AddToList(&apply); 213 tlist.AddToList(&pcopy); 214 tlist.AddToList(&pnsb); 215 //tlist.AddToList(&pcalc); 216 tlist.AddToList(&ncalc); 217 tlist.AddToList(&nanal); 218 tlist.AddToList(&blind); 219 tlist.AddToList(&sgcal); 220 //tlist.AddToList(&fills); 221 //tlist.AddToList(&fillb); 222 tlist.AddToList(&clean); 223 tlist.AddToList(&hcalc); 224 tlist.AddToList(&scalc); 225 tlist.AddToList(&write); 226 227 // 228 // Set the serial number for all tasks in the current tasklist 229 // 230 tlist.SetSerialNumber(fSerialIdx); 231 232 // 233 // Setup tasks 234 // 235 blind.SetUseInterpolation(); 236 237 write.AddContainer(write.AddSerialNumber("MMcEvt"), "Events", kFALSE); 238 write.AddContainer(write.AddSerialNumber("MSigmabar"), "Events"); 239 write.AddContainer(write.AddSerialNumber("MHillas"), "Events"); 240 write.AddContainer(write.AddSerialNumber("MHillasExt"), "Events"); 241 write.AddContainer(write.AddSerialNumber("MHillasSrc"), "Events"); 242 write.AddContainer(write.AddSerialNumber("MNewImagePar"), "Events"); 243 write.AddContainer(write.AddSerialNumber("MSrcPosCam"), "RunHeaders"); 244 //write.AddContainer(write.AddSerialNumber("MHSigmaTheta"), "RunHeaders"); 245 if (!fIsUpdate) 246 { 247 write.AddContainer("MRawRunHeader", "RunHeaders"); 248 write.AddContainer("MMcRunHeader", "RunHeaders", kFALSE); 249 } 250 251 // 252 // Create and set up the eventloop 253 // 254 MEvtLoop evtloop; 255 evtloop.SetParList(&plist); 256 257 // 258 // Execute your analysis 259 // 260 if (!evtloop.Eventloop()) 261 { 262 gLog << err << "ERROR: Star eventloop failed!" << endl; 263 return kFALSE; 264 } 265 266 tlist.PrintStatistics(); 267 268 //plist.FindObject("MHSigmaTheta")->Write(); 269 //plist.FindObject("MHBlindPixels")->Write(); 270 271 gLog << all << "Star finished successfull!" << endl; 272 273 return kTRUE; 274 } 275 // ClassDef(MJStar, 0) 276 }; 277 278 //ClassImp(MJStar); 279 280 73 281 int main(const int argc, char **argv) 74 282 { … … 102 310 103 311 // 312 // Initialize Non-GUI (batch) mode 313 // 314 gROOT->SetBatch(); 315 316 MArray::Class()->IgnoreTObjectStreamer(); 317 MParContainer::Class()->IgnoreTObjectStreamer(); 318 319 MJStar star; 320 star.SetInputFile(arg.GetArgumentStr(0)); 321 star.SetOutputFile(arg.GetArgumentStr(1)); 322 star.SetComprLevel(kComprlvl); 323 star.SetSerialIdx(kTelIndex); 324 star.SetUpdate(kUpdate); 325 326 if (!star.Process()) 327 { 328 gLog << err << "Star failed!" << endl; 329 return -1; 330 } 331 332 gLog << inf << "Star finished successfull!" << endl; 333 334 return 0; 335 /* 336 // 104 337 // This is to make argv[i] more readable inside the code 105 338 // … … 114 347 115 348 // 116 // Initialize Non-GUI (batch) mode117 //118 gROOT->SetBatch();119 120 //121 349 // check whether the given files are OK. 122 350 // … … 140 368 } 141 369 142 MArray::Class()->IgnoreTObjectStreamer();143 MParContainer::Class()->IgnoreTObjectStreamer();144 145 370 // 146 371 // Create a empty Parameter List and an empty Task List … … 153 378 154 379 // PRELIMINARY: 155 /* 156 MReportDrive rep; 157 plist.AddToList(&rep); 158 MPointingPos pos; 159 plist.AddToList(&pos); 160 */ 380 // MReportDrive rep; 381 // plist.AddToList(&rep); 382 // MPointingPos pos; 383 // plist.AddToList(&pos); 161 384 162 385 // … … 255 478 gLog << all << "Star finished successfull!" << endl; 256 479 return 0; 480 */ 257 481 }
Note:
See TracChangeset
for help on using the changeset viewer.