Changeset 4722
- Timestamp:
- 08/24/04 14:51:17 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4721 r4722 72 72 - for consistency renamed fWindowSize* to f*WindowSize 73 73 74 * msignal/MExtract FixedWindowPeakSearch.[h,cc]:74 * msignal/MExtractTimeHighestIntegral.[h,cc]: 75 75 - added ReadEnv 76 76 -
trunk/MagicSoft/Mars/Makefile
r4651 r4722 21 21 22 22 #PROGRAMS = readraw merpp mars test mona status 23 PROGRAMS = readdaq readraw merpp star status mars mona showlog23 PROGRAMS = readdaq readraw merpp mars mona showlog callisto showplot 24 24 SOLIB = libmars.so 25 25 CINT = M -
trunk/MagicSoft/Mars/mbase/MArgs.cc
r4452 r4722 231 231 // -------------------------------------------------------------------------- 232 232 // 233 // Returns GetIntAndRemove. If HasOption returns kFALSE def is returned. 234 // 235 Int_t MArgs::GetIntAndRemove(const TString name, Int_t def) 236 { 237 if (!HasOption(name)) 238 return def; 239 return GetIntAndRemove(name); 240 } 241 242 // -------------------------------------------------------------------------- 243 // 244 // Returns GetFloatAndRemove. If HasOption returns kFALSE def is returned. 245 // 246 Double_t MArgs::GetFloatAndRemove(const TString name, Double_t def) 247 { 248 if (!HasOption(name)) 249 return def; 250 return GetFloatAndRemove(name); 251 } 252 253 // -------------------------------------------------------------------------- 254 // 255 // Returns GetStringAndRemove. If HasOption returns kFALSE def is returned. 256 // 257 TString MArgs::GetStringAndRemove(const TString name, const TString def) 258 { 259 if (!HasOption(name)) 260 return def; 261 return GetStringAndRemove(name); 262 } 263 264 // -------------------------------------------------------------------------- 265 // 233 266 // Return the TString corresponding to the i-th argument. 234 267 // This is ment for enumerations like -
trunk/MagicSoft/Mars/mbase/MArgs.h
r3183 r4722 43 43 TString GetStringAndRemove(const TString name); 44 44 45 Int_t GetIntAndRemove(const TString name, Int_t def); 46 Double_t GetFloatAndRemove(const TString name, Double_t def); 47 TString GetStringAndRemove(const TString name, const TString def); 48 45 49 Bool_t Has(const TString name) const; 46 50 Bool_t HasOnly(const TString name) const; -
trunk/MagicSoft/Mars/mbase/MDirIter.cc
r4215 r4722 151 151 // -------------------------------------------------------------------------- 152 152 // 153 // Adds all entries from iter to this object 154 // 155 void MDirIter::Add(const MDirIter &iter) 156 { 157 TIter Next(&iter.fList); 158 TObject *o=0; 159 while ((o=Next())) 160 fList.Add(o->Clone()); 161 } 162 163 // -------------------------------------------------------------------------- 164 // 153 165 // Return the pointer to the current directory. If the pointer is NULL 154 166 // a new directory is opened. If no new directory can be opened NULL is -
trunk/MagicSoft/Mars/mbase/MDirIter.h
r4219 r4722 49 49 50 50 Int_t AddDirectory(const char *dir, const char *filter="", Int_t recursive=0); 51 void Add(const MDirIter &iter); 51 52 void Reset(); 52 53 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r4601 r4722 964 964 Bool_t MEvtLoop::ReadEnv(const char *config) 965 965 { 966 return config ? ReadEnv(TEnv(config)) : kTRUE; 966 if (!config) 967 return kTRUE; 968 969 const Bool_t fileexist = !gSystem->AccessPathName(config, kFileExists); 970 if (!fileexist) 971 { 972 *fLog << warn << "WARNING - resource file '" << config << "' not found... no resources applied." << endl; 973 return kFALSE; 974 } 975 976 return ReadEnv(TEnv(config)); 967 977 } 968 978 -
trunk/MagicSoft/Mars/mbase/MLog.cc
r4601 r4722 512 512 // -------------------------------------------------------------------------- 513 513 // 514 // Print usage information setup in Setup() 515 // 516 void MLog::Usage() 517 { 518 // 1 2 3 4 5 6 7 8 519 // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 520 *this << " -v# Verbosity level # [default=2]" << endl; 521 *this << " -a, --no-colors Do not use Ansii color codes" << endl; 522 *this << " --debug[=n] Enable root debugging [default: gDebug=1]" << endl; 523 } 524 525 // -------------------------------------------------------------------------- 526 // 514 527 // Setup MLog and global debug output from command line arguments. 515 528 // -
trunk/MagicSoft/Mars/mbase/MLog.h
r4452 r4722 185 185 186 186 void Setup(MArgs &arg); 187 void Usage(); 187 188 188 189 void ReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4695 r4722 186 186 : fEnv(0), fRuns(0), fSequence(0), fExtractor(NULL), fTimeExtractor(NULL), 187 187 fColor(MCalibrationCam::kNONE), fDisplayType(kNormalDisplay), 188 fRelTimes(kFALSE), fDataCheck(kFALSE), fDebug(kFALSE) 188 fRelTimes(kFALSE), fDataCheck(kFALSE), fDebug(kFALSE), fOverwrite(kFALSE) 189 189 { 190 190 … … 1247 1247 } 1248 1248 1249 // -------------------------------------------------------------------------- 1250 // 1251 // MJCalibration allows to setup several option by a resource file: 1252 // MJCalibration.OutputPath: path 1253 // MJCalibration.InputPath: path 1254 // MJCalibration.Display: full, datacheck, normal 1255 // MJCalibration.RelTimeCalibration: yes,no 1256 // MJCalibration.Datacheck: yes,no 1257 // MJCalibration.Debug: yes,no 1258 // MJCalibration.UseBlindPixel: yes,no 1259 // MJCalibration.UsePINDiode: yes,no 1260 // 1261 // For more details see the class description and the corresponding Getters 1262 // 1249 1263 void MJCalibration::CheckEnv() 1250 1264 { … … 1277 1291 SetUseBlindPixel(fEnv->GetValue("MJCalibration.UseBlindPixel", IsUseBlindPixel())); 1278 1292 SetUsePINDiode(fEnv->GetValue("MJCalibration.UsePINDiode", IsUsePINDiode())); 1293 1294 SetOverwrite(fEnv->GetValue("MJPedestal.AllowOverwrite", fOverwrite)); 1295 SetInputPath(fEnv->GetValue("MJPedestal.InputPath", fInputPath)); 1279 1296 } 1280 1297 … … 1415 1432 MDirIter iter; 1416 1433 if (fSequence) 1417 fSequence->SetupCalRuns(iter); 1434 { 1435 if (fSequence->SetupCalRuns(iter, fInputPath)==0) 1436 { 1437 *fLog << err << "ERROR - No input files of sequence found!" << endl; 1438 return kFALSE; 1439 } 1440 } 1418 1441 1419 1442 if (fDataCheck) … … 1666 1689 // -------------------------------------------------------------------------- 1667 1690 // 1691 // Set the path from which the sequence files are read 1692 // 1693 void MJCalibration::SetInputPath(const char *path) 1694 { 1695 fInputPath = path; 1696 if (fInputPath.EndsWith("/")) 1697 fInputPath = fInputPath(0, fInputPath.Length()-1); 1698 } 1699 1700 // -------------------------------------------------------------------------- 1701 // 1668 1702 // Set the useage of the Blind Pixel device 1669 1703 // … … 1702 1736 *fLog << inf << "Writing to file: " << oname << endl; 1703 1737 1704 TFile file(oname, "RECREATE"); 1738 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9); 1739 if (!file.IsOpen()) 1740 { 1741 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 1742 return kFALSE; 1743 } 1705 1744 1706 1745 *fLog << inf << " - MStatusDisplay..." << flush; -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r4695 r4722 91 91 MJPedestal::MJPedestal(const char *name, const char *title) 92 92 : fEnv(0), fRuns(0), fSequence(0), fExtractor(NULL), fDisplayType(kNormalDisplay), 93 fDataCheck(kFALSE), fUseData(kFALSE), f MaxEvents(0)93 fDataCheck(kFALSE), fUseData(kFALSE), fOverwrite(kFALSE), fMaxEvents(0) 94 94 { 95 95 fName = name ? name : "MJPedestal"; … … 451 451 *fLog << inf << "Writing to file: " << oname << endl; 452 452 453 TFile file(oname, "RECREATE"); 453 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJPedestal", 9); 454 if (!file.IsOpen()) 455 { 456 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 457 return kFALSE; 458 } 454 459 455 460 if (fDisplay && fDisplay->Write()<=0) … … 481 486 } 482 487 488 // -------------------------------------------------------------------------- 489 // 490 // Set the path from which the sequence files are read 491 // 492 void MJPedestal::SetInputPath(const char *path) 493 { 494 fInputPath = path; 495 if (fInputPath.EndsWith("/")) 496 fInputPath = fInputPath(0, fInputPath.Length()-1); 497 } 498 483 499 void MJPedestal::SetEnv(const char *env) 484 500 { … … 496 512 } 497 513 514 // -------------------------------------------------------------------------- 515 // 516 // MJPedestsl allows to setup several option by a resource file: 517 // MJPedestal.OutputPath: path 518 // MJPedestal.MaxEvents: 1000 519 // MJPedestal.AllowOverwrite: yes, no 520 // MJPedestal.UseData: yes, no (use DatRuns from sequence instead of PedRuns) 521 // 522 // For more details see the class description and the corresponding Getters 523 // 498 524 void MJPedestal::CheckEnv() 499 525 { … … 508 534 } 509 535 510 fMaxEvents = fEnv->GetValue("MJPedestal.MaxEvents", fMaxEvents); 511 fUseData = fEnv->GetValue("MJPedestal.UseData", fUseData); 536 SetMaxEvents(fEnv->GetValue("MJPedestal.MaxEvents", fMaxEvents)); 537 SetOverwrite(fEnv->GetValue("MJPedestal.AllowOverwrite", fOverwrite)); 538 539 fUseData = fEnv->GetValue("MJPedestal.UseData", fUseData); 512 540 } 513 541 … … 548 576 MDirIter iter; 549 577 if (fSequence) 550 fUseData ? fSequence->SetupDatRuns(iter) : fSequence->SetupPedRuns(iter); 578 { 579 const Int_t n = fUseData ? fSequence->SetupDatRuns(iter, fInputPath) : fSequence->SetupPedRuns(iter, fInputPath); 580 if (n==0) 581 { 582 *fLog << err << "ERROR - No input files of sequence found!" << endl; 583 return kFALSE; 584 } 585 } 551 586 552 587 if (fDataCheck) -
trunk/MagicSoft/Mars/mjobs/MSequence.cc
r4695 r4722 27 27 // MSequence 28 28 // 29 // This class describes a sequence. For sequences see: 30 // http://magic.astro.uni-wuerzburg.de/mars/db/queryseq.html 31 // 32 // A sequence is a collection of runs which should be used together. 33 // 29 34 ///////////////////////////////////////////////////////////////////////////// 30 35 #include "MSequence.h" … … 34 39 #include <TEnv.h> 35 40 #include <TRegexp.h> 41 #include <TSystem.h> // TSystem::ExpandPath 36 42 37 43 #include "MLog.h" … … 44 50 using namespace std; 45 51 52 // -------------------------------------------------------------------------- 53 // 54 // Copy the run numbers from the TString runs into the TArrayI data 55 // 46 56 void MSequence::Split(TString &runs, TArrayI &data) const 47 57 { … … 63 73 } 64 74 65 voidMSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path) const75 Int_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path) const 66 76 { 67 77 TString d(path); 68 78 69 79 // Setup path 70 if ( !path)80 if (d.IsNull()) 71 81 { 72 82 d = Form("/data/MAGIC/Period%03d/rootdata/", fPeriod); 73 83 d += fNight.GetStringFmt("%Y_%m_%d"); 74 84 } 85 86 Int_t num = 0; 75 87 76 88 for (int i=0; i<arr.GetSize(); i++) … … 83 95 84 96 // Add Path/File to TIter 85 iter.AddDirectory(d, n, 0); 86 } 87 } 88 97 num += iter.AddDirectory(d, n, 0); 98 } 99 return num; 100 } 101 102 // -------------------------------------------------------------------------- 103 // 104 // Read the file fname as setup file for the sequence. 105 // 89 106 MSequence::MSequence(const char *fname) 90 107 { … … 96 113 TString str; 97 114 98 fSequence = env.GetValue("Sequence", -1);99 fLastRun = env.GetValue("LastRun", -1);115 fSequence = env.GetValue("Sequence", -1); 116 fLastRun = env.GetValue("LastRun", -1); 100 117 fNumEvents = env.GetValue("NumEvents", -1); 101 fPeriod = env.GetValue("Period", -1);118 fPeriod = env.GetValue("Period", -1); 102 119 103 120 str = env.GetValue("Start", ""); … … 122 139 } 123 140 141 // -------------------------------------------------------------------------- 142 // 143 // Print the contents of the sequence 144 // 124 145 void MSequence::Print(Option_t *o) const 125 146 { 126 147 gLog << all; 148 if (!IsValid()) 149 { 150 gLog << "Sequence: " << fName << " <invalid>" << endl; 151 return; 152 } 127 153 gLog << "Sequence: " << fSequence << endl; 128 154 gLog << "Period: " << fPeriod << endl; … … 153 179 } 154 180 155 void MSequence::SetupPedRuns(MDirIter &iter, const char *path) const 156 { 157 SetupRuns(iter, fPedRuns, path); 158 } 159 160 void MSequence::SetupDatRuns(MDirIter &iter, const char *path) const 161 { 162 SetupRuns(iter, fDatRuns, path); 163 } 164 165 void MSequence::SetupAllRuns(MDirIter &iter, const char *path) const 166 { 167 SetupRuns(iter, fRuns, path); 168 } 169 170 void MSequence::SetupCalRuns(MDirIter &iter, const char *path) const 171 { 172 SetupRuns(iter, fCalRuns, path); 173 } 181 // -------------------------------------------------------------------------- 182 // 183 // Add all ped runs from the sequence to MDirIter. 184 // If path==0 the standard path of the data-center is assumed. 185 // If you have the runs locally use path="." 186 // Return the number of files added. 187 // 188 Int_t MSequence::SetupPedRuns(MDirIter &iter, const char *path) const 189 { 190 return SetupRuns(iter, fPedRuns, path); 191 } 192 193 // -------------------------------------------------------------------------- 194 // 195 // Add all data runs from the sequence to MDirIter. 196 // If path==0 the standard path of the data-center is assumed. 197 // If you have the runs locally use path="." 198 // Return the number of files added. 199 // 200 Int_t MSequence::SetupDatRuns(MDirIter &iter, const char *path) const 201 { 202 return SetupRuns(iter, fDatRuns, path); 203 } 204 205 // -------------------------------------------------------------------------- 206 // 207 // Add all runs from the sequence to MDirIter. 208 // If path==0 the standard path of the data-center is assumed. 209 // If you have the runs locally use path="." 210 // Return the number of files added. 211 // 212 Int_t MSequence::SetupAllRuns(MDirIter &iter, const char *path) const 213 { 214 return SetupRuns(iter, fRuns, path); 215 } 216 217 // -------------------------------------------------------------------------- 218 // 219 // Add all calibration runs from the sequence to MDirIter. 220 // If path==0 the standard path of the data-center is assumed. 221 // If you have the runs locally use path="." 222 // Return the number of files added. 223 // 224 Int_t MSequence::SetupCalRuns(MDirIter &iter, const char *path) const 225 { 226 return SetupRuns(iter, fCalRuns, path); 227 } -
trunk/MagicSoft/Mars/mjobs/MSequence.h
r4716 r4722 36 36 37 37 void Split(TString &runs, TArrayI &data) const; 38 voidSetupRuns(MDirIter &iter, const TArrayI &arr, const char *path) const;38 Int_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path) const; 39 39 40 40 public: … … 45 45 Bool_t IsValid() const { return fSequence!=(UInt_t)-1; } 46 46 47 voidSetupPedRuns(MDirIter &iter, const char *path=0) const;48 voidSetupDatRuns(MDirIter &iter, const char *path=0) const;49 voidSetupAllRuns(MDirIter &iter, const char *path=0) const;50 voidSetupCalRuns(MDirIter &iter, const char *path=0) const;47 Int_t SetupPedRuns(MDirIter &iter, const char *path=0) const; 48 Int_t SetupDatRuns(MDirIter &iter, const char *path=0) const; 49 Int_t SetupAllRuns(MDirIter &iter, const char *path=0) const; 50 Int_t SetupCalRuns(MDirIter &iter, const char *path=0) const; 51 51 52 52 // Getter -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r4714 r4722 248 248 fEvtLoop->SetOwner(); 249 249 fEvtLoop->SetParList(plist); 250 fEvtLoop->ReadEnv("mars.rc"); 250 251 251 252 MHEvent *evt01 = new MHEvent(MHEvent::kEvtSignalRaw); … … 254 255 MHEvent *evt04 = new MHEvent(MHEvent::kEvtPedestalRMS); 255 256 MHEvent *evt05 = new MHEvent(MHEvent::kEvtRelativeSignal); 256 MHEvent *evt06 = new MHEvent(MHEvent::kEvtCleaningLevels); 257 MHEvent *evt06a= new MHEvent(MHEvent::kEvtCleaningData); 258 MHEvent *evt06b= new MHEvent(MHEvent::kEvtCleaningLevels); 257 259 MHEvent *evt07 = new MHEvent(MHEvent::kEvtIdxMax); 258 260 MHEvent *evt08 = new MHEvent(MHEvent::kEvtArrTime); … … 265 267 evt04->SetName("PedRMS"); 266 268 evt05->SetName("Signal/PedRMS"); 267 evt06->SetName("CleanLevels"); 269 evt06a->SetName("CleanData"); 270 evt06b->SetName("CleanLevels"); 268 271 evt07->SetName("Max Slice Idx"); 269 272 evt08->SetName("Arrival Time"); … … 277 280 plist->AddToList(evt04); 278 281 plist->AddToList(evt05); 279 plist->AddToList(evt06); 282 plist->AddToList(evt06a); 283 plist->AddToList(evt06b); 280 284 plist->AddToList(evt07); 281 285 plist->AddToList(evt08); … … 290 294 MFillH *fill04 = new MFillH(evt04, "MPedPhotCam", "MFillH04"); 291 295 MFillH *fill05 = new MFillH(evt05, "MCameraData", "MFillH05"); 292 MFillH *fill06 = new MFillH(evt06, "MCameraData", "MFillH06"); 296 MFillH *fill06a= new MFillH(evt06a, "MCameraData", "MFillH06"); 297 MFillH *fill06b= new MFillH(evt06b, "MCameraData", "MFillH06"); 293 298 // MBlindPixelCalc *blind = new MBlindPixelCalc; 294 299 MHillasCalc *hcalc = new MHillasCalc; … … 357 362 tlist->AddToList(fill04); 358 363 tlist->AddToList(fill05); 359 tlist->AddToList(fill06); 364 tlist->AddToList(fill06a); 365 tlist->AddToList(fill06b); 360 366 // tlist->AddToList(blind); 361 367 tlist->AddToList(hcalc); -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.cc
r4340 r4722 1 1 /* ======================================================================== *\ 2 ! 3 ! * 4 ! * This file is part of MARS, the MAGIC Analysis and Reconstruction 5 ! * Software. It is distributed to you in the hope that it can be a useful 6 ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. 7 ! * It is distributed WITHOUT ANY WARRANTY. 8 ! * 9 ! * Permission to use, copy, modify and distribute this software and its 10 ! * documentation for any purpose is hereby granted without fee, 11 ! * provided that the above copyright notice appear in all copies and 12 ! * that both that copyright notice and this permission notice appear 13 ! * in supporting documentation. It is provided "as is" without express 14 ! * or implied warranty. 15 ! * 16 ! 17 ! 18 ! Author(s): Abelardo Moralejo,04/2004 <mailto:moralejo@pd.infn.it> 19 ! Markus Gaug ,04/2004 <mailto:markus@ifae.es> 20 ! Copyright: MAGIC Software Development, 2000-2004 21 ! 22 ! 23 \* ======================================================================== */ 2 ! 3 ! * 4 ! * This file is part of MARS, the MAGIC Analysis and Reconstruction 5 ! * Software. It is distributed to you in the hope that it can be a useful 6 ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. 7 ! * It is distributed WITHOUT ANY WARRANTY. 8 ! * 9 ! * Permission to use, copy, modify and distribute this software and its 10 ! * documentation for any purpose is hereby granted without fee, 11 ! * provided that the above copyright notice appear in all copies and 12 ! * that both that copyright notice and this permission notice appear 13 ! * in supporting documentation. It is provided "as is" without express 14 ! * or implied warranty. 15 ! * 16 ! 17 ! 18 ! Author(s): Abelardo Moralejo, 04/2004 <mailto:moralejo@pd.infn.it> 19 ! Author(s): Markus Gaug, 04/2004 <mailto:markus@ifae.es> 20 ! 21 ! Copyright: MAGIC Software Development, 2000-2004 22 ! 23 ! 24 \* ======================================================================== */ 24 25 25 26 ////////////////////////////////////////////////////////////////////////////// … … 55 56 // fLoGainWindowSize = fgLoGainWindowSize = 6 56 57 // fPeakSearchWindowSize = fgPeakSearchWindowSize = 4 57 // fLo wGainPeakShift = fgLowGainPeakShift= 058 // fLoGainPeakShift = fgLoGainPeakShift = 0 58 59 // 59 60 ////////////////////////////////////////////////////////////////////////////// … … 84 85 const Byte_t MExtractFixedWindowPeakSearch::fgPeakSearchWindowSize = 4; 85 86 const Byte_t MExtractFixedWindowPeakSearch::fgOffsetFromWindow = 1; 86 const Byte_t MExtractFixedWindowPeakSearch::fgLo wGainPeakShift= 0;87 const Byte_t MExtractFixedWindowPeakSearch::fgLoGainPeakShift = 0; 87 88 // -------------------------------------------------------------------------- 88 89 // … … 90 91 // 91 92 // Sets: 92 // - f WindowSizeHiGain to fgWindowSizeHiGain93 // - f WindowSizeLoGain to fgWindowSizeLoGain93 // - fHiGainWindowSize to fgHiGainWindowSize 94 // - fLoGainWindowSize to fgLoGainWindowSize 94 95 // - fPeakSearchWindowSize to fgPeakSearchWindowSize 95 // - fLo wGainPeakShift to fgLowGainPeakShift96 // - fLoGainPeakShift to fgLoGainPeakShift 96 97 // 97 98 // Calls: … … 100 101 // 101 102 MExtractFixedWindowPeakSearch::MExtractFixedWindowPeakSearch(const char *name, const char *title) 102 : f WindowSizeHiGain(fgHiGainWindowSize),103 f WindowSizeLoGain(fgLoGainWindowSize),103 : fHiGainWindowSize(fgHiGainWindowSize), 104 fLoGainWindowSize(fgLoGainWindowSize), 104 105 fPeakSearchWindowSize(fgPeakSearchWindowSize), 105 fLo wGainPeakShift(fgLowGainPeakShift)106 fLoGainPeakShift(fgLoGainPeakShift) 106 107 { 107 108 … … 119 120 // Calls: 120 121 // - MExtractor::SetRange(hifirst,hilast,lofirst,lolast); 121 // - SetWindows(f WindowSizeHiGain,fWindowSizeLoGain,fPeakSearchWindowSize);122 // - SetWindows(fHiGainWindowSize,fLoGainWindowSize,fPeakSearchWindowSize); 122 123 // 123 124 void MExtractFixedWindowPeakSearch::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t lofirst, Byte_t lolast) … … 129 130 // Redo the checks if the window is still inside the ranges 130 131 // 131 SetWindows(f WindowSizeHiGain,fWindowSizeLoGain,fPeakSearchWindowSize);132 SetWindows(fHiGainWindowSize,fLoGainWindowSize,fPeakSearchWindowSize); 132 133 133 134 } … … 141 142 // 142 143 // Sets: 143 // - fNumHiGainSamples to: (Float_t)f WindowSizeHiGain144 // - fNumLoGainSamples to: (Float_t)f WindowSizeLoGain144 // - fNumHiGainSamples to: (Float_t)fHiGainWindowSize 145 // - fNumLoGainSamples to: (Float_t)fLoGainWindowSize 145 146 // - fSqrtHiGainSamples to: TMath::Sqrt(fNumHiGainSamples) 146 147 // - fSqrtLoGainSamples to: TMath::Sqrt(fNumLoGainSamples) … … 149 150 { 150 151 151 f WindowSizeHiGain= windowh & ~1;152 f WindowSizeLoGain= windowl & ~1;152 fHiGainWindowSize = windowh & ~1; 153 fLoGainWindowSize = windowl & ~1; 153 154 fPeakSearchWindowSize = peaksearchwindow & ~1; 154 155 155 if (f WindowSizeHiGain!= windowh)156 if (fHiGainWindowSize != windowh) 156 157 *fLog << warn << GetDescriptor() << ": Hi Gain window size has to be even, set to: " 157 << int(f WindowSizeHiGain) << " samples " << endl;158 159 if (f WindowSizeLoGain!= windowl)158 << int(fHiGainWindowSize) << " samples " << endl; 159 160 if (fLoGainWindowSize != windowl) 160 161 *fLog << warn << GetDescriptor() << ": Lo Gain window size has to be even, set to: " 161 << int(f WindowSizeLoGain) << " samples " << endl;162 << int(fLoGainWindowSize) << " samples " << endl; 162 163 163 164 if (fPeakSearchWindowSize != peaksearchwindow) … … 168 169 const Byte_t availlorange = (fLoGainLast-fLoGainFirst+1) & ~1; 169 170 170 if (f WindowSizeHiGain> availhirange)171 if (fHiGainWindowSize > availhirange) 171 172 { 172 173 *fLog << warn << GetDescriptor() 173 << Form("%s%2i%s%2i%s%2i%s",": Hi Gain window size: ",(int)f WindowSizeHiGain,174 << Form("%s%2i%s%2i%s%2i%s",": Hi Gain window size: ",(int)fHiGainWindowSize, 174 175 " is bigger than available range: [",(int)fHiGainFirst,",",(int)fHiGainLast,"]") << endl; 175 176 *fLog << warn << GetDescriptor() 176 177 << ": Will set window size to: " << (int)availhirange << endl; 177 f WindowSizeHiGain= availhirange;178 } 179 180 181 if (f WindowSizeLoGain> availlorange)178 fHiGainWindowSize = availhirange; 179 } 180 181 182 if (fLoGainWindowSize > availlorange) 182 183 { 183 184 *fLog << warn << GetDescriptor() 184 << Form("%s%2i%s%2i%s%2i%s",": Lo Gain window size: ",(int)f WindowSizeLoGain,185 << Form("%s%2i%s%2i%s%2i%s",": Lo Gain window size: ",(int)fLoGainWindowSize, 185 186 " is bigger than available range: [",(int)fLoGainFirst,",",(int)fLoGainLast,"]") << endl; 186 187 *fLog << warn << GetDescriptor() 187 188 << ": Will set window size to: " << (int)availlorange << endl; 188 f WindowSizeLoGain= availlorange;189 } 190 191 if (f WindowSizeHiGain<2)192 { 193 f WindowSizeHiGain= 2;189 fLoGainWindowSize = availlorange; 190 } 191 192 if (fHiGainWindowSize<2) 193 { 194 fHiGainWindowSize = 2; 194 195 *fLog << warn << GetDescriptor() << ": Hi Gain window size set to two samples" << endl; 195 196 } 196 197 197 if (f WindowSizeLoGain<2)198 { 199 f WindowSizeLoGain= 2;198 if (fLoGainWindowSize<2) 199 { 200 fLoGainWindowSize = 2; 200 201 *fLog << warn << GetDescriptor() << ": Lo Gain window size set to two samples" << endl; 201 202 } … … 208 209 } 209 210 210 fNumHiGainSamples = (Float_t)f WindowSizeHiGain;211 fNumLoGainSamples = (Float_t)f WindowSizeLoGain;211 fNumHiGainSamples = (Float_t)fHiGainWindowSize; 212 fNumLoGainSamples = (Float_t)fLoGainWindowSize; 212 213 213 214 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); … … 295 296 // FindSignalHiGain: 296 297 // 297 // - Loop from ptr to (ptr+f WindowSizeHiGain)298 // - Loop from ptr to (ptr+fHiGainWindowSize) 298 299 // - Sum up contents of *ptr 299 300 // - If *ptr is greater than fSaturationLimit, raise sat by 1 … … 302 303 { 303 304 304 Byte_t *end = ptr + f WindowSizeHiGain-fHiLoLast;305 Byte_t *end = ptr + fHiGainWindowSize-fHiLoLast; 305 306 306 307 Int_t summ = 0; … … 316 317 317 318 // 318 // If part of the "lo w-Gain" slices are used,319 // If part of the "lo-Gain" slices are used, 319 320 // repeat steps one and two for the logain part until fHiLoLast 320 321 // … … 337 338 // FindSignalLoGain: 338 339 // 339 // - Loop from ptr to (ptr+f WindowSizeLoGain)340 // - Loop from ptr to (ptr+fLoGainWindowSize) 340 341 // - Sum up contents of *ptr 341 342 // - If *ptr is greater than fSaturationLimit, raise sat by 1 … … 349 350 Int_t summ = 0; 350 351 351 while (p<ptr+f WindowSizeLoGain)352 while (p<ptr+fLoGainWindowSize) 352 353 { 353 354 summ += *p; … … 400 401 401 402 402 loGainFirst = ( hiGainFirst+fLo wGainPeakShift > fLoGainFirst ) ?403 hiGainFirst+fLo wGainPeakShift : fLoGainFirst;403 loGainFirst = ( hiGainFirst+fLoGainPeakShift > fLoGainFirst ) ? 404 hiGainFirst+fLoGainPeakShift : fLoGainFirst; 404 405 405 406 // Make sure we will not integrate beyond the hi gain limit: 406 if (hiGainFirst+f WindowSizeHiGain> pixel.GetNumHiGainSamples())407 fHiLoLast = hiGainFirst+f WindowSizeHiGain- pixel.GetNumHiGainSamples();408 // hiGainFirst = pixel.GetNumHiGainSamples()-f WindowSizeHiGain;407 if (hiGainFirst+fHiGainWindowSize > pixel.GetNumHiGainSamples()) 408 fHiLoLast = hiGainFirst+fHiGainWindowSize - pixel.GetNumHiGainSamples(); 409 // hiGainFirst = pixel.GetNumHiGainSamples()-fHiGainWindowSize; 409 410 410 411 // Make sure we will not integrate beyond the lo gain limit: 411 if (loGainFirst+f WindowSizeLoGain> pixel.GetNumLoGainSamples())412 loGainFirst = pixel.GetNumLoGainSamples()-f WindowSizeLoGain;412 if (loGainFirst+fLoGainWindowSize > pixel.GetNumLoGainSamples()) 413 loGainFirst = pixel.GetNumLoGainSamples()-fLoGainWindowSize; 413 414 414 415 pixel.Reset(); … … 465 466 return kTRUE; 466 467 } 468 469 // -------------------------------------------------------------------------- 470 // 471 // In addition to the resources of the base-class MExtractor: 472 // MJPedestal.MExtractor.WindowSizeHiGain: 6 473 // MJPedestal.MExtractor.WindowSizeLoGain: 6 474 // MJPedestal.MExtractor.PeakSearchWindow: 4 475 // MJPedestal.MExtractor.OffsetFromWindow: 1 476 // MJPedestal.MExtractor.LoGainPeakShift: 0 477 // 478 Int_t MExtractFixedWindowPeakSearch::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 479 { 480 Byte_t hw = fHiGainWindowSize; 481 Byte_t lw = fLoGainWindowSize; 482 Byte_t pw = fPeakSearchWindowSize; 483 484 Bool_t rc = kFALSE; 485 486 if (IsEnvDefined(env, prefix, "PeakSearchWindow", print)) 487 { 488 pw = GetEnvValue(env, prefix, "PeakSearchWindow", pw); 489 rc = kTRUE; 490 } 491 if (IsEnvDefined(env, prefix, "HiGainWindowSize", print)) 492 { 493 hw = GetEnvValue(env, prefix, "HiGainWindowSize", hw); 494 rc = kTRUE; 495 } 496 if (IsEnvDefined(env, prefix, "LoGainWindowSize", print)) 497 { 498 lw = GetEnvValue(env, prefix, "LoGainWindowSize", lw); 499 rc = kTRUE; 500 } 501 502 if (rc) 503 SetWindows(hw, lw, pw); 504 505 506 if (IsEnvDefined(env, prefix, "OffsetFromWindow", print)) 507 { 508 SetOffsetFromWindow(GetEnvValue(env, prefix, "OffsetFromWindow", fOffsetFromWindow)); 509 rc = kTRUE; 510 } 511 512 if (IsEnvDefined(env, prefix, "LoGainPeakShift", print)) 513 { 514 SetLoGainPeakShift(GetEnvValue(env, prefix, "LoGainPeakShift", fLoGainPeakShift)); 515 rc = kTRUE; 516 } 517 518 rc = MExtractor::ReadEnv(env, prefix, print) ? kTRUE : rc; 519 520 return rc; 521 } -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.h
r4340 r4722 18 18 static const Byte_t fgPeakSearchWindowSize; // Default for fPeakSearchWindowSize (now set to: 4) 19 19 static const Byte_t fgOffsetFromWindow; // Default for fOffsetFromWindow (now set to: 1) 20 static const Byte_t fgLo wGainPeakShift;// Default for fLowGainPeakShift (now set to: 0)20 static const Byte_t fgLoGainPeakShift; // Default for fLowGainPeakShift (now set to: 0) 21 21 22 Byte_t f WindowSizeHiGain; // Number of Hi Gain slices in window23 Byte_t f WindowSizeLoGain; // Number of Lo Gain slices in window22 Byte_t fHiGainWindowSize; // Number of Hi Gain slices in window 23 Byte_t fLoGainWindowSize; // Number of Lo Gain slices in window 24 24 Byte_t fPeakSearchWindowSize; // Size of FADC window in the search for the highest peak of all pixels. 25 25 Byte_t fOffsetFromWindow; // Number of slices to start extraction before search window 26 Byte_t fLo wGainPeakShift;// Shift of the low gain pulse with respect to the high gain pulse, in slices: it is 0 if the low gain is delayed with respect to HG by 15 slices.26 Byte_t fLoGainPeakShift; // Shift of the low gain pulse with respect to the high gain pulse, in slices: it is 0 if the low gain is delayed with respect to HG by 15 slices. 27 27 28 28 void FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Float_t &sum, Byte_t &sat) const; … … 31 31 void FindPeak(Byte_t *ptr, Byte_t window, Byte_t &startslice, Int_t &signal, Int_t &sat) const; 32 32 33 Bool_t 33 Bool_t ReInit(MParList *pList); 34 34 Int_t Process(); 35 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 35 36 36 37 public: … … 43 44 void SetOffsetFromWindow(Byte_t offset=fgOffsetFromWindow) { fOffsetFromWindow = offset; } 44 45 45 void SetLo wGainPeakShift(Byte_t shift=fgLowGainPeakShift) { fLowGainPeakShift = shift; }46 void SetLoGainPeakShift(Byte_t shift=fgLoGainPeakShift) { fLoGainPeakShift = shift; } 46 47 47 48 ClassDef(MExtractFixedWindowPeakSearch, 0) // Signal Extractor for fixed size trigger-corrected extraction window -
trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc
r4371 r4722 17 17 ! 18 18 ! Author(s): Thomas Bretz, 02/2004 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 19 ! Author(s): Hendrik Bartko, 02/2004 <mailto:hbartko@mppmu.mpg.de> 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2004 … … 297 297 } 298 298 299 // -------------------------------------------------------------------------- 300 // 301 // In addition to the resources of the base-class MExtractor: 302 // MJPedestal.MExtractor.WindowSizeHiGain: 6 303 // MJPedestal.MExtractor.WindowSizeLoGain: 6 304 // 305 Int_t MExtractTimeHighestIntegral::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 306 { 307 Byte_t hw = fHiGainWindowSize; 308 Byte_t lw = fLoGainWindowSize; 309 310 Bool_t rc = kFALSE; 311 312 if (IsEnvDefined(env, prefix, "HiGainWindowSize", print)) 313 { 314 hw = GetEnvValue(env, prefix, "HiGainWindowSize", hw); 315 rc = kTRUE; 316 } 317 if (IsEnvDefined(env, prefix, "LoGainWindowSize", print)) 318 { 319 lw = GetEnvValue(env, prefix, "LoGainWindowSize", lw); 320 rc = kTRUE; 321 } 322 323 if (rc) 324 SetWindowSize(hw, lw); 325 326 rc = MExtractor::ReadEnv(env, prefix, print) ? kTRUE : rc; 327 328 return rc; 329 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.h
r3943 r4722 24 24 void FindTimeHiGain(Byte_t *first, Float_t &time, Float_t &dtime, Byte_t &sat, const MPedestalPix &ped) const; 25 25 void FindTimeLoGain(Byte_t *first, Float_t &time, Float_t &dtime, Byte_t &sat, const MPedestalPix &ped) const; 26 27 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 26 28 27 29 public:
Note:
See TracChangeset
for help on using the changeset viewer.