Ignore:
Timestamp:
03/01/04 17:18:18 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r3353 r3374  
    164164    if (!fRawEvt)
    165165    {
    166       *fLog << err << dbginf << "MRawEvtData not found... aborting." << endl;
     166      *fLog << err << "MRawEvtData not found... aborting." << endl;
    167167      return kFALSE;
    168168    }
     
    170170    const MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    171171    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;
    173173    else
    174       if (runheader->GetRunType() == kRTMonteCarlo)
    175         {
     174      if (runheader->IsMonteCarloRun())
    176175          return kTRUE;
    177         }
    178176   
    179177    fCam = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam");
    180178    if (!fCam)
    181       {
    182         *fLog << err << dbginf << "MCalibrationChargeCam could not be created ... aborting." << endl;       
    183         return kFALSE;
    184       }
     179        return kFALSE;
    185180
    186181    fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode");
    187182    if (!fPINDiode)
    188       {
    189         *fLog << err << dbginf << "MCalibrationChargePINDiode could not be created ... aborting." << endl;       
    190         return kFALSE;
    191       }
     183        return kFALSE;
    192184
    193185    fCam->SetPINDiode(fPINDiode);
     
    195187    fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindCreateObj("MCalibrationChargeBlindPix");
    196188    if (!fBlindPixel)
    197       {
    198         *fLog << err << dbginf << "MCalibrationChargeBlindPix could not be created ... aborting." << endl;       
    199         return kFALSE;
    200       }
     189        return kFALSE;
    201190
    202191    fCam->SetBlindPixel(fBlindPixel);
    203192
    204     fEvtTime      = (MTime*)pList->FindObject("MTime");
     193    fEvtTime = (MTime*)pList->FindObject("MTime");
    205194
    206195    fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam");
    207196    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    }
    213201
    214202    fSignals = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
    215203    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    }
    220208
    221209    return kTRUE;
     
    230218Bool_t MCalibrationChargeCalc::ReInit(MParList *pList )
    231219{
    232  
    233220    fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    234221    if (!fRunHeader)
    235222    {
    236       *fLog << err << dbginf << ": MRawRunHeader not found... aborting." << endl;
     223      *fLog << err << "MRawRunHeader not found... aborting." << endl;
    237224      return kFALSE;
    238225    }
    239 
    240226
    241227    fGeom = (MGeomCam*)pList->FindObject("MGeomCam");
    242228    if (!fGeom)
    243229    {
    244       *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl;
    245       return kFALSE;
     230        *fLog << err << "No MGeomCam found... aborting." << endl;
     231        return kFALSE;
    246232    }
    247233
     
    255241
    256242    for (UInt_t i=0; i<npixels; i++)
    257       {
    258        
     243    {
    259244        MCalibrationChargePix &pix = (*fCam)[i];
    260245        pix.DefinePixId(i);
     
    264249        pix.SetAbsTimeBordersLoGain(fSignals->GetFirstUsedSliceLoGain(),
    265250                                    fSignals->GetLastUsedSliceLoGain());
    266        
    267      }
     251    }
    268252   
     253    if (fExcludedPixelsFile.IsNull())
     254        return kTRUE;
     255
    269256    //
    270257    // Look for file to exclude pixels from analysis
    271258    //
    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
    277284        //
    278         // Initialize reading the file
     285        // Check for out of range
    279286        //
    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
    327307    return kTRUE;
    328308}
     
    513493  return kTRUE;
    514494}
    515 
    516 
    517 
    518 
    519 
    520 
    521 
  • trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc

    r3265 r3374  
    8787    }
    8888
    89     return  run->GetRunType() == kRTMonteCarlo;
     89    return  run->IsMonteCarloRun();
    9090}
    9191
Note: See TracChangeset for help on using the changeset viewer.