Changeset 5307 for trunk/MagicSoft/Mars
- Timestamp:
- 10/22/04 15:59:02 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/callisto.cc
r5160 r5307 113 113 114 114 const Bool_t kPrintSeq = arg.HasOnlyAndRemove("--print-seq"); 115 const Bool_t kPrintFiles = arg.HasOnlyAndRemove("--print-files");116 const Bool_t kPrintOnly = arg.HasOnlyAndRemove("--print-only");115 //const Bool_t kPrintFiles = arg.HasOnlyAndRemove("--print-files"); 116 //const Bool_t kPrintOnly = arg.HasOnlyAndRemove("--print-only"); 117 117 const Bool_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env"); 118 118 … … 120 120 const Bool_t kBatch = arg.HasOnlyAndRemove("-b"); 121 121 const Bool_t kOverwrite = arg.HasOnlyAndRemove("-f"); 122 const Bool_t kForceExec = arg.HasOnlyAndRemove("-ff");122 //const Bool_t kForceExec = arg.HasOnlyAndRemove("-ff"); 123 123 124 124 const TString kInpathD = arg.GetStringAndRemove("--ind=", ""); … … 211 211 return -1; 212 212 } 213 213 /* 214 214 // 215 215 // Process print options … … 238 238 // 239 239 MDirIter iter; 240 const Int_t n0 = seq.SetupAllRuns(iter, kInpathD );240 const Int_t n0 = seq.SetupAllRuns(iter, kInpathD, "[DPC]"); 241 241 const Int_t n1 = seq.GetNumAllRuns(); 242 242 if (n0 != n1) … … 254 254 if (kPrintOnly) 255 255 return 0; 256 256 */ 257 257 // 258 258 // Initialize root -
trunk/MagicSoft/Mars/mbase/MDirIter.cc
r5299 r5307 202 202 // -------------------------------------------------------------------------- 203 203 // 204 // As the filter string may contain a + character, we have to replace 205 // this filter by a new filter contaning a \+ at all locations where a + 206 // was in the original filter. 207 // 208 // We replace: 209 // . by \\. 210 // + by \\+ 211 // * by [^\\/:]* 212 // ? by . 213 // 214 // And surround the filter by ^ and $. 215 // 216 // For more details you can have a look at the template: 217 // TRegexp::MakeWildcard 218 // 219 const TRegexp MDirIter::MakeRegexp(TString n) const 220 { 221 n.Prepend("^"); 222 n.ReplaceAll(".", "\\."); 223 n.ReplaceAll("+", "\\+"); 224 n.ReplaceAll("*", "[^\\/:]*"); 225 n.ReplaceAll("?", "."); 226 n.Append("$"); 227 228 return TRegexp(n, kFALSE); 229 } 230 231 // -------------------------------------------------------------------------- 232 // 204 233 // Check whether the given name n matches the filter f. 205 234 // Filters are of the form TRegexp(f, kTRUE) … … 207 236 Bool_t MDirIter::MatchFilter(const TString &n, const TString &f) const 208 237 { 209 // As the filter string may contain a + character, we have to replace 210 // this filter by a new filter contaning a \+ at all locations where a + 211 // was in the original filter. 212 TString nf(f); 213 nf.ReplaceAll("+","\\+"); 214 215 return f.IsNull() || !n(TRegexp(nf, kTRUE)).IsNull(); 238 239 return f.IsNull() || !n(MakeRegexp(f)).IsNull(); 216 240 } 217 241 -
trunk/MagicSoft/Mars/mbase/MDirIter.h
r5144 r5307 23 23 TString ConcatFileName(const char *dir, const char *name) const; 24 24 void PrintEntry(const TObject &o) const; 25 const TRegexp MakeRegexp(TString n) const; 25 26 26 27 public: -
trunk/MagicSoft/Mars/mbase/MRunIter.cc
r5141 r5307 53 53 54 54 // R. DeLosReyes and T. Bretz 55 // Changes to read the DAQ numbering format. Changes takes place 55 // Changes to read the DAQ numbering format. Changes takes place 56 56 // between runs 35487 and 00035488 (2004_08_30) 57 const char *fmt = run>35487 ? "*_%08d_*_%s" : "*_%05d_*_%s"; 57 58 58 MDirIter Next; 59 if(run<=35487) 60 Next.AddDirectory(p, Form("*_%05d_*_%s", run,fIsRawFile?"*.raw":"*.root"), -1); 61 else 62 Next.AddDirectory(p, Form("*_%08d_*_%s", run,fIsRawFile?"*.raw":"*.root"), -1); 59 MDirIter Next; 60 Next.AddDirectory(p, Form(fmt, run,fIsRawFile?"*.raw":"*.root"), -1); 63 61 64 62 const TString name(Next()); -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
r4766 r5307 1483 1483 if (TestBit(kExitLoopOnExit) || TestBit(kExitLoopOnClose)) 1484 1484 { 1485 gLog << dbg << "CloseWindow() calling ExitLoop." << endl;1485 //gLog << dbg << "CloseWindow() calling ExitLoop." << endl; 1486 1486 gSystem->ExitLoop(); 1487 1487 } … … 1491 1491 //gLog << dbg << "delete " << fName << ";" << endl; 1492 1492 delete this; 1493 } 1494 fStatus = kFileExit; 1495 //gLog << dbg << fName << ".fStatus=kFileExit;" << endl; 1493 // DO NOT EXECUTE ANY COMMAND AFTER this! 1494 } 1495 else 1496 { 1497 fStatus = kFileExit; 1498 //gLog << dbg << fName << ".fStatus=kFileExit;" << endl; 1499 } 1496 1500 } 1497 1501 -
trunk/MagicSoft/Mars/mbase/MTaskEnv.cc
r4732 r5307 215 215 { 216 216 if (!IsEnvDefined(env, prefix, print)) 217 return kFALSE;217 return fTask ? fTask->ReadEnv(env, prefix, print) : kFALSE; 218 218 219 219 TString task = GetEnvValue(env, prefix, ""); -
trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc
r3841 r5307 138 138 Int_t MCalibrateRelTimes::Process() 139 139 { 140 /* 141 if (fCalibrations->GetNumPixels() != (UInt_t)fSignals->GetSize()) 142 { 143 // FIXME: MArrivalTime must be of variable size - 144 // like MCerPhotEvt - because we must be able 145 // to reduce size by zero supression 146 // For the moment this check could be done in ReInit... 147 *fLog << err << "MArrivalTime and MCalibrationCam have different sizes... abort." << endl; 148 return kFALSE; 149 } 150 */ 140 151 141 /* 142 if (fCalibrations->GetNumPixels() != (UInt_t)fSignals->GetSize()) 152 const UInt_t npix = fSignals->GetSize(); 153 154 for (UInt_t pixidx=0; pixidx<npix; pixidx++) 143 155 { 144 // FIXME: MArrivalTime must be of variable size - 145 // like MCerPhotEvt - because we must be able 146 // to reduce size by zero supression 147 // For the moment this check could be done in ReInit... 148 *fLog << err << "MArrivalTime and MCalibrationCam have different sizes... abort." << endl; 149 return kFALSE; 150 } 151 */ 156 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*fCalibrations)[pixidx]; 152 157 153 UInt_t npix = fSignals->GetSize(); 158 if (fBadPixels && (*fBadPixels)[pixidx].IsUnsuitable()) 159 continue; 154 160 155 Float_t offset = 0.; 156 Float_t precision = 0.; 157 158 for (UInt_t pixidx=0; pixidx<npix; pixidx++) 159 { 161 const Float_t offset = pix.GetTimeOffset(); 162 const Float_t precision = pix.GetTimePrecision(); 160 163 161 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*fCalibrations)[pixidx]; 162 163 if (fBadPixels) 164 MArrivalTimePix &sig = (*fSignals)[pixidx]; 165 166 Float_t signal; 167 Float_t sigerr; 168 169 if (sig.IsLoGainUsed()) 164 170 { 165 MBadPixelsPix &bad = (*fBadPixels)[pixidx]; 166 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 167 continue; 171 signal = sig.GetArrivalTimeLoGain(); 172 sigerr = sig.GetArrivalTimeLoGainError(); 168 173 } 169 170 offset = pix.GetTimeOffset(); 171 precision = pix.GetTimePrecision(); 172 173 MArrivalTimePix &sig = (*fSignals)[pixidx]; 174 175 Float_t signal; 176 Float_t sigerr; 177 178 if (sig.IsLoGainUsed()) 174 else 179 175 { 180 signal = sig.GetArrivalTimeLoGain();181 sigerr = sig.GetArrivalTimeLoGainError();176 signal = sig.GetArrivalTimeHiGain(); 177 sigerr = sig.GetArrivalTimeHiGainError(); 182 178 } 183 else184 {185 signal = sig.GetArrivalTimeHiGain();186 sigerr = sig.GetArrivalTimeHiGainError();187 }188 189 const Float_t time = signal - offset;190 Float_t err = sigerr*sigerr + precision*precision;191 if (err > 0)192 err = TMath::Sqrt(err);193 179 194 fArrivalTime->SetTime(pixidx,time); 195 fArrivalTime->SetTimeErr(pixidx,err); 180 const Float_t time = signal - offset; 181 const Float_t err = sigerr*sigerr + precision*precision; 182 183 fArrivalTime->SetTime(pixidx, time); 184 fArrivalTime->SetTimeErr(pixidx, err>0 ? TMath::Sqrt(err) : 0); 196 185 197 186 } /* for (UInt_t pixidx=0; pixidx<npix; pixidx++) */ 198 199 fArrivalTime->SetReadyToSave();200 201 return kTRUE;187 188 fArrivalTime->SetReadyToSave(); 189 190 return kTRUE; 202 191 } -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r5298 r5307 1159 1159 const Double_t error = fSumw2.fArray[bin]/GetEntries(); 1160 1160 const Double_t val = fArray[bin]/GetEntries(); 1161 rc = TMath::Sqrt(error - val*val);1161 rc = val*val>error ? 0 : TMath::Sqrt(error - val*val); 1162 1162 } 1163 1163 else 1164 {1165 1164 rc = TH1D::GetBinError(bin); 1166 }1167 1165 1168 1166 return Profile(rc); -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r5298 r5307 94 94 // Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE 95 95 // 96 MJCalibrateSignal::MJCalibrateSignal(const char *name, const char *title) 96 MJCalibrateSignal::MJCalibrateSignal(const char *name, const char *title) 97 : fIsDataCheck(kFALSE) 97 98 { 98 99 fName = name ? name : "MJCalibrateSignal"; … … 170 171 cont.Add(&cam); 171 172 return ReadContainer(cont); 173 } 174 175 // -------------------------------------------------------------------------- 176 // 177 // MJCalibration allows to setup several option by a resource file: 178 // MJCalibration.Display: full, datacheck, normal 179 // MJCalibration.RelTimeCalibration: yes,no 180 // MJCalibration.DataCheck: yes,no 181 // MJCalibration.Debug: yes,no 182 // MJCalibration.Intensity: yes,no 183 // MJCalibration.UseBlindPixel: yes,no 184 // MJCalibration.UsePINDiode: yes,no 185 // MJCalibration.Geometry: MGeomCamMagic, MGeomCamECO1000 186 // 187 // For more details see the class description and the corresponding Getters 188 // 189 Bool_t MJCalibrateSignal::CheckEnvLocal() 190 { 191 SetDataCheck(GetEnv("DataCheck", IsDataCheck())); 192 return kTRUE; 172 193 } 173 194 … … 196 217 197 218 MDirIter iter; 198 const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData );219 const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D", IsDataCheck()); 199 220 const Int_t n1 = fSequence.GetNumDatRuns(); 200 221 if (n0==0) … … 300 321 readreal.AddFiles(iter); 301 322 302 MReadMarsFile readmc("Events"); 303 readmc.DisableAutoScheme(); 304 readmc.AddFiles(iter); 305 306 MRawFileRead readraw(NULL); 307 readraw.AddFiles(iter); 323 MReadMarsFile read("Events"); 324 read.DisableAutoScheme(); 325 MRawFileRead rawread(NULL); 326 if (IsDataCheck()) 327 rawread.AddFiles(iter); 328 else 329 read.AddFiles(iter); 308 330 309 331 MGeomApply apply; // Only necessary to create geometry … … 413 435 414 436 // Now setup main tasklist 415 switch (filetype) 416 { 417 case 1: tlist.AddToList(&readraw); break; 418 case 2: tlist.AddToList(&readreal); break; 419 case 3: tlist.AddToList(&readmc); break; 420 } 421 422 tlist.AddToList(&tlist2, "Events"); 423 tlist.AddToList(&pcalc, "Drive"); 437 tlist.AddToList(IsDataCheck() ? (MTask*)&rawread : (MTask*)&read); 438 tlist.AddToList(&tlist2, IsDataCheck()?"All":"Events"); 439 if (!IsDataCheck()) 440 tlist.AddToList(&pcalc, "Drive"); 424 441 tlist.AddToList(&write); 425 442 -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r5145 r5307 107 107 // Constructor. 108 108 // 109 MEventDisplay::MEventDisplay(const char *fname, const char *pname, const char *cname) : MStatusDisplay() 109 MEventDisplay::MEventDisplay(const char *fname, const char *pname, const char *cname) : MStatusDisplay(), fEvtLoop(0) 110 110 { 111 111 // … … 130 130 // Readin first event and display it 131 131 // 132 ReadFirstEvent(); 132 if (fEvtLoop) 133 ReadFirstEvent(); 133 134 134 135 SetNoContextMenu(kFALSE); … … 141 142 MEventDisplay::~MEventDisplay() 142 143 { 143 fEvtLoop->PostProcess(); 144 delete fEvtLoop; 144 if (fEvtLoop) 145 { 146 fEvtLoop->PostProcess(); 147 delete fEvtLoop; 148 } 145 149 } 146 150 … … 249 253 plist->AddToList(ccam); 250 254 255 //MArrivalTime *atime = new MArrivalTime; 256 //plist->AddToList(atime); 257 251 258 MHEvent *evt01 = new MHEvent(MHEvent::kEvtSignalRaw); 252 259 MHEvent *evt02 = new MHEvent(MHEvent::kEvtSignalRaw); -
trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
r5144 r5307 103 103 : fFileNames(NULL), fNumFile(0), fIn(NULL), fParList(NULL), fInterleave(1) 104 104 { 105 fName = name ? name : "MR awFileRead";105 fName = name ? name : "MRead"; 106 106 fTitle = title ? title : "Read task to read DAQ binary files"; 107 107 … … 122 122 if (fIn) 123 123 delete fIn; 124 } 125 126 Byte_t MRawFileRead::IsFileValid(const char *name) 127 { 128 ifstream fin(name); 129 if (!fin) 130 return 0; 131 132 Byte_t c[4]; 133 fin.read((char*)c, 4); 134 if (!fin) 135 return 0; 136 137 if (c[0]!=0xc0) 138 return 0; 139 140 if (c[1]==0xc0) 141 return 1; 142 143 if (c[1]==0xc1) 144 return 2; 145 146 return 0; 124 147 } 125 148 -
trunk/MagicSoft/Mars/mraw/MRawFileRead.h
r4694 r5307 32 32 ~MRawFileRead(); 33 33 34 static Byte_t IsFileValid(const char *name); 35 34 36 void SetInterleave(UInt_t i) { fInterleave = i; } 35 37 -
trunk/MagicSoft/Mars/msignal/MExtractTime.cc
r5280 r5307 148 148 Bool_t MExtractTime::ReInit(MParList *pList) 149 149 { 150 151 MExtractor::ReInit(pList); 152 153 fArrTime->SetUsedFADCSlices(fHiGainFirst, fHiGainLast+fHiLoLast, fLoGainFirst, fLoGainLast); 154 155 return kTRUE; 156 } 157 158 150 if (!MExtractor::ReInit(pList)) 151 return kFALSE; 152 153 fArrTime->SetUsedFADCSlices(fHiGainFirst, fHiGainLast+fHiLoLast, fLoGainFirst, fLoGainLast); 154 155 return kTRUE; 156 } 159 157 160 158 void MExtractTime::FindTimeHiGain(Byte_t *firstused, Float_t &time, Float_t &dtime, -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc
r5242 r5307 74 74 75 75 const Float_t MExtractTimeAndCharge::fgLoGainStartShift = -2.8; 76 76 77 // -------------------------------------------------------------------------- 77 78 // … … 83 84 MExtractTimeAndCharge::MExtractTimeAndCharge(const char *name, const char *title) 84 85 { 85 86 fName = name ? name : "MExtractTimeAndCharge"; 87 fTitle = title ? title : "Base class for signal and time extractors"; 88 89 SetLoGainStartShift(); 86 fName = name ? name : "MExtractTimeAndCharge"; 87 fTitle = title ? title : "Base class for signal and time extractors"; 88 89 SetLoGainStartShift(); 90 90 } 91 91 … … 105 105 Int_t MExtractTimeAndCharge::PreProcess(MParList *pList) 106 106 { 107 108 if (!MExtractTime::PreProcess(pList)) 109 return kFALSE; 110 111 fSignals = (MExtractedSignalCam*)pList->FindCreateObj(AddSerialNumber("MExtractedSignalCam")); 112 if (!fSignals) 113 { 114 *fLog << err << GetDescriptor() 115 << ": Could not find nor create MExtractedSignalCam,... aborting." << endl; 116 return kFALSE; 117 } 118 119 120 return kTRUE; 107 if (!MExtractTime::PreProcess(pList)) 108 return kFALSE; 109 110 fSignals = (MExtractedSignalCam*)pList->FindCreateObj(AddSerialNumber("MExtractedSignalCam")); 111 if (!fSignals) 112 return kFALSE; 113 114 return kTRUE; 121 115 } 122 116 … … 132 126 Bool_t MExtractTimeAndCharge::ReInit(MParList *pList) 133 127 { 134 135 MExtractTime::ReInit(pList);136 137 fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainLast+fHiLoLast, fNumHiGainSamples,138 fLoGainFirst, fLoGainLast, fNumLoGainSamples);139 140 *fLog << dec << endl;141 *fLog << inf << GetDescriptor() << ":Taking " << fNumHiGainSamples128 if (!MExtractTime::ReInit(pList)) 129 return kFALSE; 130 131 fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainLast+fHiLoLast, fNumHiGainSamples, 132 fLoGainFirst, fLoGainLast, fNumLoGainSamples); 133 134 *fLog << dec << endl; 135 *fLog << inf << "Taking " << fNumHiGainSamples 142 136 << " HiGain samples from slice " << (Int_t)fHiGainFirst 143 137 << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl; 144 *fLog << inf << GetDescriptor() << ":Taking " << fNumLoGainSamples138 *fLog << inf << "Taking " << fNumLoGainSamples 145 139 << " LoGain samples from slice " << (Int_t)fLoGainFirst 146 140 << " to " << (Int_t)fLoGainLast << " incl" << endl; 147 141 148 return kTRUE;142 return kTRUE; 149 143 } 150 144 … … 258 252 return MExtractTime::ReadEnv(env, prefix, print) ? kTRUE : rc; 259 253 } 254 255 void MExtractTimeAndCharge::Print(Option_t *o) const 256 { 257 *fLog << all; 258 if (IsA()==MExtractTimeAndCharge::Class()) 259 *fLog << GetDescriptor() << ":" << endl; 260 261 *fLog << " LoGainStartShift: " << fLoGainStartShift << endl; 262 MExtractTime::Print(o); 263 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.h
r5242 r5307 13 13 static const Float_t fgLoGainStartShift; // Default for fLoGainStartShift (now set to: -2.8) 14 14 15 Byte_t fLoGainFirstSave; //Temporary variable to store the original position of low-gain start slice15 Byte_t fLoGainFirstSave; //! Temporary variable to store the original position of low-gain start slice 16 16 Float_t fLoGainStartShift; // Shift to start searching the low-gain signal obtained from the high-gain times. 17 17 … … 36 36 37 37 void SetLoGainStartShift( const Float_t f=fgLoGainStartShift ) { fLoGainStartShift = f + fOffsetLoGain; } 38 39 void Print(Option_t *o) const; 38 40 39 ClassDef(MExtractTimeAndCharge, 0) // Time And Charge Extractor Base Class41 ClassDef(MExtractTimeAndCharge, 1) // Time And Charge Extractor Base Class 40 42 }; 41 43 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r5298 r5307 940 940 return kTRUE; 941 941 } 942 943 void MExtractTimeAndChargeDigitalFilter::Print(Option_t *o) const 944 { 945 *fLog << all; 946 *fLog << GetDescriptor() << ":" << endl; 947 948 *fLog << " Time Shift HiGain: " << fTimeShiftHiGain << endl; 949 *fLog << " Time Shift LoGain: " << fTimeShiftLoGain << endl; 950 *fLog << " Window Size HiGain: " << fWindowSizeHiGain << endl; 951 *fLog << " Window Size LoGain: " << fWindowSizeLoGain << endl; 952 *fLog << " Binning Res HiGain: " << fBinningResolutionHiGain << endl; 953 *fLog << " Binning Res LoGain: " << fBinningResolutionHiGain << endl; 954 955 MExtractTimeAndCharge::Print(o); 956 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h
r5298 r5307 86 86 fSignalStartBinLoGain = sl; 87 87 } 88 89 void Print(Option_t *o) const; 88 90 89 91 ClassDef(MExtractTimeAndChargeDigitalFilter, 1) // Hendrik's digital filter
Note:
See TracChangeset
for help on using the changeset viewer.