Changeset 3374 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 03/01/04 17:18:18 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3353 r3374 164 164 if (!fRawEvt) 165 165 { 166 *fLog << err << dbginf <<"MRawEvtData not found... aborting." << endl;166 *fLog << err << "MRawEvtData not found... aborting." << endl; 167 167 return kFALSE; 168 168 } … … 170 170 const MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 171 171 if (!runheader) 172 *fLog << warn << dbginf <<"Warning - cannot check file type, MRawRunHeader not found." << endl;172 *fLog << warn << "Warning - cannot check file type, MRawRunHeader not found." << endl; 173 173 else 174 if (runheader->GetRunType() == kRTMonteCarlo) 175 { 174 if (runheader->IsMonteCarloRun()) 176 175 return kTRUE; 177 }178 176 179 177 fCam = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam"); 180 178 if (!fCam) 181 { 182 *fLog << err << dbginf << "MCalibrationChargeCam could not be created ... aborting." << endl; 183 return kFALSE; 184 } 179 return kFALSE; 185 180 186 181 fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode"); 187 182 if (!fPINDiode) 188 { 189 *fLog << err << dbginf << "MCalibrationChargePINDiode could not be created ... aborting." << endl; 190 return kFALSE; 191 } 183 return kFALSE; 192 184 193 185 fCam->SetPINDiode(fPINDiode); … … 195 187 fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindCreateObj("MCalibrationChargeBlindPix"); 196 188 if (!fBlindPixel) 197 { 198 *fLog << err << dbginf << "MCalibrationChargeBlindPix could not be created ... aborting." << endl; 199 return kFALSE; 200 } 189 return kFALSE; 201 190 202 191 fCam->SetBlindPixel(fBlindPixel); 203 192 204 fEvtTime 193 fEvtTime = (MTime*)pList->FindObject("MTime"); 205 194 206 195 fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam"); 207 196 if (!fPedestals) 208 { 209 *fLog << err << dbginf << "Cannot find MPedestalCam ... aborting" << endl; 210 return kFALSE; 211 } 212 197 { 198 *fLog << err << "MPedestalCam not found... aborting" << endl; 199 return kFALSE; 200 } 213 201 214 202 fSignals = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam"); 215 203 if (!fSignals) 216 217 *fLog << err << dbginf << "Cannot find MExtractedSignalCam... aborting" << endl;218 return kFALSE; 219 204 { 205 *fLog << err << "MExtractedSignalCam not found... aborting" << endl; 206 return kFALSE; 207 } 220 208 221 209 return kTRUE; … … 230 218 Bool_t MCalibrationChargeCalc::ReInit(MParList *pList ) 231 219 { 232 233 220 fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 234 221 if (!fRunHeader) 235 222 { 236 *fLog << err << dbginf << ":MRawRunHeader not found... aborting." << endl;223 *fLog << err << "MRawRunHeader not found... aborting." << endl; 237 224 return kFALSE; 238 225 } 239 240 226 241 227 fGeom = (MGeomCam*)pList->FindObject("MGeomCam"); 242 228 if (!fGeom) 243 229 { 244 *fLog << err << GetDescriptor() << ":No MGeomCam found... aborting." << endl;245 return kFALSE;230 *fLog << err << "No MGeomCam found... aborting." << endl; 231 return kFALSE; 246 232 } 247 233 … … 255 241 256 242 for (UInt_t i=0; i<npixels; i++) 257 { 258 243 { 259 244 MCalibrationChargePix &pix = (*fCam)[i]; 260 245 pix.DefinePixId(i); … … 264 249 pix.SetAbsTimeBordersLoGain(fSignals->GetFirstUsedSliceLoGain(), 265 250 fSignals->GetLastUsedSliceLoGain()); 266 267 } 251 } 268 252 253 if (fExcludedPixelsFile.IsNull()) 254 return kTRUE; 255 269 256 // 270 257 // Look for file to exclude pixels from analysis 271 258 // 272 if (!fExcludedPixelsFile.IsNull()) 273 { 274 275 fExcludedPixelsFile = gSystem->ExpandPathName(fExcludedPixelsFile.Data()); 276 259 gSystem->ExpandPathName(fExcludedPixelsFile); 260 261 // 262 // Initialize reading the file 263 // 264 ifstream in(fExcludedPixelsFile); 265 if (!in) 266 { 267 *fLog << warn << "Cannot open file '" << fExcludedPixelsFile << "'" << endl; 268 return kTRUE; 269 } 270 271 *fLog << inf << "Use excluded pixels from file: '" << fExcludedPixelsFile << "'" << endl; 272 273 // 274 // Read the file and count the number of entries 275 // 276 UInt_t pixel = 0; 277 278 while (++fNumExcludedPixels) 279 { 280 in >> pixel; 281 if (!in) 282 break; 283 277 284 // 278 // Initialize reading the file285 // Check for out of range 279 286 // 280 ifstream in(fExcludedPixelsFile.Data(),ios::in); 281 282 if (in) 283 { 284 *fLog << inf << "Use excluded pixels from file: '" << fExcludedPixelsFile.Data() << "'" << endl; 285 // 286 // Read the file and count the number of entries 287 // 288 UInt_t pixel = 0; 289 290 while (++fNumExcludedPixels) 291 { 292 293 in >> pixel; 294 295 if (!in.good()) 296 break; 297 // 298 // Check for out of range 299 // 300 if (pixel > npixels) 301 { 302 *fLog << warn << "WARNING: To be excluded pixel: " << pixel 303 << " is out of range " << endl; 304 continue; 305 } 306 // 307 // Exclude pixel 308 // 309 MCalibrationChargePix &pix = (*fCam)[pixel]; 310 pix.SetExcluded(); 311 312 *fLog << GetDescriptor() << inf << ": Exclude Pixel: " << pixel << endl; 313 314 } 315 316 if (--fNumExcludedPixels == 0) 317 *fLog << warn << "WARNING: File '" << fExcludedPixelsFile.Data() 318 << "'" << " is empty " << endl; 319 else 320 fCam->SetNumPixelsExcluded(fNumExcludedPixels); 321 322 } 323 else 324 *fLog << warn << dbginf << "Cannot open file '" << fExcludedPixelsFile.Data() << "'" << endl; 325 } 326 287 if (pixel > npixels) 288 { 289 *fLog << warn << "WARNING: To be excluded pixel: " << pixel << " is out of range " << endl; 290 continue; 291 } 292 // 293 // Exclude pixel 294 // 295 MCalibrationChargePix &pix = (*fCam)[pixel]; 296 pix.SetExcluded(); 297 298 *fLog << GetDescriptor() << inf << ": Exclude Pixel: " << pixel << endl; 299 300 } 301 302 if (--fNumExcludedPixels == 0) 303 *fLog << warn << "WARNING: File '" << fExcludedPixelsFile << "'" << " is empty " << endl; 304 else 305 fCam->SetNumPixelsExcluded(fNumExcludedPixels); 306 327 307 return kTRUE; 328 308 } … … 513 493 return kTRUE; 514 494 } 515 516 517 518 519 520 521 -
trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc
r3265 r3374 87 87 } 88 88 89 return run-> GetRunType() == kRTMonteCarlo;89 return run->IsMonteCarloRun(); 90 90 } 91 91
Note:
See TracChangeset
for help on using the changeset viewer.