Changeset 6730 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 03/03/05 22:18:05 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r6727 r6730 62 62 63 63 // Other basic classes 64 #include "MExtractTimeAndCharge SlidingWindow.h"64 #include "MExtractTimeAndCharge.h" 65 65 66 66 // parameter containers … … 78 78 #include "MReadMarsFile.h" 79 79 #include "MRawFileRead.h" 80 #include "MRawEvtData.h" 80 81 #include "MGeomApply.h" 81 82 #include "MBadPixelsMerge.h" … … 83 84 #include "MPedCalcPedRun.h" 84 85 #include "MPedCalcFromLoGain.h" 86 #include "MFTriggerPattern.h" 85 87 86 88 #include <fstream> … … 978 980 979 981 MFillH fillped(&hpedcam, "MPedestalCamIntermediate", "FillPedCam"); 980 MFillH fillpul("MHCalibrationPulseTimeCam", "MExtractedSignalCam", "FillPulseTime");982 MFillH fillpul("MHCalibrationPulseTimeCam", "MRawEvtData", "FillPulseTime"); 981 983 // MFillH fillped(&fPedestalHist, "MPedestalCamIntermediate", "FillPedCam"); 982 984 fillped.SetBit(MFillH::kDoNotDisplay); … … 996 998 } 997 999 998 MExtractTimeAndChargeSlidingWindow exttest; 999 1000 if (fPulsePosCheck && fExtractionType != kFundamental) 1000 MFTriggerPattern fcalib("CalibFilter"); 1001 fcalib.RequireCalibration(); 1002 fcalib.SetInverted(); 1003 1004 if (fPulsePosCheck) 1001 1005 { 1002 exttest.SetRange(0,25,0,0); 1003 exttest.SetPedestals(&fPedestalCamIn); 1004 tlist.AddToList(&exttest); 1006 fillpul.SetFilter(&fcalib); 1005 1007 tlist.AddToList(&fillpul); 1006 1008 } … … 1186 1188 } 1187 1189 1188 if (fPulsePosCheck && fExtractionType != kFundamental) 1190 if (fDisplayType!=kDisplayNone) 1191 DisplayResult(plist); 1192 1193 if (!WriteResult()) 1194 return kFALSE; 1195 1196 if (fPulsePosCheck) 1189 1197 { 1198 1199 MHCalibrationPulseTimeCam *hcam = (MHCalibrationPulseTimeCam*)plist.FindObject("MHCalibrationPulseTimeCam"); 1200 if (fPixelCheck) 1201 { 1202 hcam->DrawClone(); 1203 MHCalibrationPix &pix = (*hcam)[fCheckedPixId]; 1204 pix.DrawClone(); 1205 } 1206 1190 1207 MCalibrationPulseTimeCam *cam = (MCalibrationPulseTimeCam*)plist.FindObject("MCalibrationPulseTimeCam"); 1208 MRawEvtData *data = (MRawEvtData*)plist.FindObject("MRawEvtData"); 1191 1209 if (cam) 1192 1210 { 1193 1211 const Float_t meanpulsetime = cam->GetAverageArea(0).GetHiGainMean(); 1194 const Float_t sigmapulsetime = cam->GetAverageArea(0).GetHiGainSigma(); 1195 *fLog << inf << "Mean pulse time (cosmics): " << meanpulsetime << "+-" << sigmapulsetime << endl; 1212 const Float_t rmspulsetime = cam->GetAverageArea(0).GetHiGainRms(); 1213 *fLog << inf << "Mean pulse time (cosmics): " << meanpulsetime << "+-" << rmspulsetime << endl; 1214 const Int_t newfirst = 1.5*rmspulsetime > 3. 1215 ? (Int_t)(meanpulsetime-1.5*rmspulsetime) 1216 : (Int_t)(meanpulsetime-3.); 1217 const Int_t wshigain = fExtractor->InheritsFrom("MExtractTimeAndCharge") 1218 ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain() 1219 : 6; 1220 const Int_t wslogain = fExtractor->InheritsFrom("MExtractTimeAndCharge") 1221 ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeLoGain() 1222 : 6; 1223 const Int_t newlast = 1.5*rmspulsetime > 3. 1224 ? (Int_t)(meanpulsetime+1.5*rmspulsetime) 1225 : (Int_t)(meanpulsetime+3.); 1226 *fLog << inf << "Try to set new range limits: ("<<newfirst<<","<<newlast+wshigain<<")"<<endl; 1227 if (newfirst < 0) 1228 { 1229 *fLog << err << "Pulse is too much to the left, cannot go below 0! " << endl; 1230 return kFALSE; 1231 } 1232 if (newlast+wshigain > data->GetNumHiGainSamples()) 1233 { 1234 *fLog << err << "Pulse is too much to the right, cannot go beyond higain limits! " 1235 << " Try to use a different extractor ... " << endl; 1236 return kFALSE; 1237 } 1238 if (newlast+wslogain > data->GetNumLoGainSamples()) 1239 { 1240 *fLog << err << "Pulse is too much to the right, cannot go beyond logain limits! " 1241 << " Try to use a different extractor ... " << endl; 1242 return kFALSE; 1243 } 1244 fExtractor->SetRange(newfirst,newlast+wshigain,newfirst,data->GetNumLoGainSamples()); 1245 } 1246 else 1247 { 1248 *fLog << err << "Could not determine mean pulse position, abort... " << endl; 1249 return kFALSE; 1196 1250 } 1197 1251 } 1198 1252 1199 1253 1200 if (fDisplayType!=kDisplayNone)1201 DisplayResult(plist);1202 1203 if (!WriteResult())1204 return kFALSE;1205 1206 1254 *fLog << all << GetDescriptor() << ": Done." << endl; 1207 1255 *fLog << endl << endl;
Note:
See TracChangeset
for help on using the changeset viewer.