Ignore:
Timestamp:
07/13/05 19:06:26 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7005 r7188  
    7171using namespace std;
    7272
    73 MMcCalibrationCalc::MMcCalibrationCalc(const char *name, const char *title)
     73// --------------------------------------------------------------------------
     74//
     75// Constructor. Default value for fMinSize is 1000 ADC counts. This must be
     76// set in general by the user (SetMinSize), since it depends among other things
     77// on the signal extractor used.
     78//
     79MMcCalibrationCalc::MMcCalibrationCalc(const char *name, const char *title): fMinSize(1000)
    7480{
    7581    fName  = name  ? name  : "MMcCalibrationCalc";
    7682    fTitle = title ? title : "Calculate and write conversion factors into MCalibrationChargeCam and MCalibrationQECam containers";
    77 
    78     fHistADC2PhotEl = new TH1F(AddSerialNumber("ADC2PhotEl"), "log10(fPhotElfromShower/fSize)", 1500, -3., 3.);
    79     fHistADC2PhotEl->SetXTitle("log_{10}(fPhotElfromShower / fSize) [photel/ADC count]");
    80 
    81 
    82     fHistPhot2PhotEl = new TH1F(AddSerialNumber("Phot2PhotEl"), "Photon conversion efficiency", 1000, 0., 1.);
    83     fHistPhot2PhotEl->SetXTitle("Overall photon conversion efficiency [photoelectron/photon]");
    84 
    8583}
    8684
     
    9391Bool_t MMcCalibrationCalc::CheckRunType(MParList *pList) const
    9492{
    95     const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     93    const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
    9694    if (!run)
    9795    {
    98         *fLog << warn << "Warning - cannot check file type, MRawRunHeader not found." << endl;
    99         return kTRUE;
     96      *fLog << warn << "Warning - cannot check file type, " << AddSerialNumber("MRawRunHeader")
     97            << " not found." << endl;
     98      return kTRUE;
    10099    }
    101100
     
    105104// --------------------------------------------------------------------------
    106105//
    107 // Make sure, that there is an MCalibrationCam Object in the Parameter List.
     106// Look for all necessary containers and create histograms
    108107//
    109108Int_t MMcCalibrationCalc::PreProcess(MParList *pList)
    110109{
    111     fHistADC2PhotEl->Reset();
    112     fHistPhot2PhotEl->Reset();
    113 
    114110    fADC2PhotEl = 0;
    115111    fPhot2PhotEl = 0;
     
    156152        return kFALSE;
    157153    }
     154
     155    //
     156    // Create histograms:
     157    //
     158
     159    fHistADC2PhotEl = new TH1F(AddSerialNumber("ADC2PhotEl"), "log10(fPhotElfromShower/fSize)", 1500, -3., 3.);
     160    fHistADC2PhotEl->SetXTitle("log_{10}(fPhotElfromShower / fSize) [photel/ADC count]");
     161
     162
     163    fHistPhot2PhotEl = new TH1F(AddSerialNumber("Phot2PhotEl"), "Photon conversion efficiency", 1000, 0., 1.);
     164    fHistPhot2PhotEl->SetXTitle("Overall photon conversion efficiency [photoelectron/photon]");
     165
    158166
    159167    return kTRUE;
     
    210218  // perpendicular to the camera plane.
    211219  //
    212   // FIXME! We should look for AddSerialNumber("MMcConfigRunHeader") but
    213   // for the moment the stereo version of camera does not write one such
    214   // header per telescope (it should!)
    215   //
    216   MMcConfigRunHeader* mcconfig = (MMcConfigRunHeader*) pList->FindObject("MMcConfigRunHeader");
     220  MMcConfigRunHeader* mcconfig = (MMcConfigRunHeader*) pList->FindObject(AddSerialNumber("MMcConfigRunHeader"));
    217221  if (!mcconfig)
    218222    {
    219       *fLog << err << "MMcConfigRunHeader" << " not found... aborting." << endl;
     223      *fLog << err << AddSerialNumber("MMcConfigRunHeader") << " not found... aborting." << endl;
    220224      return kFALSE;
    221225    }
     
    253257    //
    254258    // Exclude events with low Size (larger fluctuations)
    255     // FIXME? The present cut (1000 "inner-pixel-counts") is somehow
    256     // arbitrary. Might it be optimized?
    257259    //   
    258260
    259     if (size < 1000)
     261    if (size < fMinSize)
    260262        return kTRUE;
    261263
     
    288290    }
    289291
    290     fPhot2PhotEl = fHistPhot2PhotEl->GetMean();   // Average quantum efficiency
     292    fPhot2PhotEl = fHistPhot2PhotEl->GetMean();   
     293    // Average quantum efficiency. For now we will set this value for all pixels, although
     294    // even in MC there may be differences from pixel to pixel, if the .dat file containing
     295    // QE vs lambda, input of the camera simulation, has different QE curves for different
     296    // pixels. FIXME?
     297
     298    MCalibrationQEPix &avqepix = (MCalibrationQEPix&)(fQECam->GetAverageArea(0));
     299    avqepix.SetAverageQE(fPhot2PhotEl); // Needed by MCalibrateData!
    291300
    292301    //
     
    335344        // FIXME: we are now assuming that all inner pixels have the same gain, and all
    336345        // outer pixels have the same gain (different from inner ones though). This can
    337         // only be like this in camera 0.7, but may change in future versions of camera.
     346        // only be like this in camera 0.7, but might change in future versions of camera.
    338347        //
    339348
     
    347356    }
    348357
     358
    349359    return kTRUE;
    350360}
Note: See TracChangeset for help on using the changeset viewer.