Ignore:
Timestamp:
04/30/04 11:05:50 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r3899 r3903  
    108108
    109109using namespace std;
     110
     111const UInt_t MHCalibrationRelTimeCam::fgReferencePixel = 1;
    110112// --------------------------------------------------------------------------
    111113//
    112 // Default Constructor.
     114// Default Constructor.
     115//
     116// Sets:
     117// - fReferencePixel to fgReferencePixel
    113118//
    114119MHCalibrationRelTimeCam::MHCalibrationRelTimeCam(const char *name, const char *title)
     
    117122  fName  = name  ? name  : "MHCalibrationRelTimeCam";
    118123  fTitle = title ? title : "Histogram class for the relative time calibration of the camera";
    119  
     124
     125  SetReferencePixel();
    120126}
    121127
     
    183189      {
    184190          (*fHiGainArray)[i] = new MHCalibrationRelTimePix("MHCalibrationRelTimePixHiGain",
    185                                                           "Relative Arrival Time High Gain Pixel");
     191                                                          "Rel. Arr. Time Hi-Gain Pixel ");
    186192          InitHists((*this)[i],(*fBadPixels)[i],i);
    187193      }
    188194  }
    189 
     195 
     196  if (fRunHeader)
     197    for (Int_t i=0; i<npixels; i++)
     198      {
     199        TH1F *h = (*this)[i].GetHGausHist();
     200          h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
     201      }
     202 
    190203  if (fLoGainArray->GetEntries()==0)
    191204  {
     
    194207      {
    195208          (*fLoGainArray)[i] = new MHCalibrationRelTimePix("MHCalibrationRelTimePixLoGain",
    196                                                           "Relative Arrival Time Low Gain Pixel");
     209                                                          "Rel. Arr. Time Lo-Gain Pixel ");
    197210          InitHists((*this)(i),(*fBadPixels)[i],i);
    198211      }
    199212  }
     213
     214  if (fRunHeader)
     215    for (Int_t i=0; i<npixels; i++)
     216      {
     217        TH1F *h = (*this)(i).GetHGausHist();
     218        h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
     219      }
    200220
    201221  if (fAverageHiGainAreas->GetEntries()==0)
     
    207227        (*fAverageHiGainAreas)[j] =
    208228          new MHCalibrationRelTimePix("MHCalibrationRelTimeAverageAreaHiGain",
    209                                       "Average Relative Arrival Times High Gain Area Idx ");
     229                                      "Average Rel. Arr. Times Hi-Gain Area Idx ");
    210230
    211231        GetAverageHiGainArea(j).GetHGausHist()->SetTitle("Rel. Arr. Times HiGain Area Idx ");
     
    216236  }
    217237
     238  if (fRunHeader)
     239    for (Int_t j=0; j<nareas; j++)
     240      {
     241        TH1F *h = GetAverageHiGainArea(j).GetHGausHist();
     242        h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
     243      }
     244 
    218245  if (fAverageLoGainAreas->GetEntries()==0)
    219246  {
     
    224251        (*fAverageLoGainAreas)[j] =
    225252          new MHCalibrationRelTimePix("MHCalibrationRelTimeAverageAreaLoGain",
    226                                       "Average Relative Arrival Times Low Gain Area Idx ");
     253                                      "Average Rel. Arr. Times Lo-Gain Area Idx ");
    227254
    228255        GetAverageLoGainArea(j).GetHGausHist()->SetTitle("Rel. Arr. Times LoGain Area Idx ");
     
    232259      }
    233260  }
    234 
     261 
     262  if (fRunHeader)
     263    for (Int_t j=0; j<nareas; j++)
     264        {
     265          TH1F *h = GetAverageLoGainArea(j).GetHGausHist();
     266          h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
     267        }
     268 
    235269  if (fAverageHiGainSectors->GetEntries()==0)
    236   {
     270    {
    237271      fAverageHiGainSectors->Expand(nsectors);
    238272
    239273      for (Int_t j=0; j<nsectors; j++)
    240       {
     274        {
    241275          (*fAverageHiGainSectors)[j] =
    242276            new MHCalibrationRelTimePix("MHCalibrationRelTimeAverageSectorHiGain",
    243                                         "Average Relative Arrival Times High Gain Sector ");
    244 
     277                                        "Average Rel. Arr. Times Hi-Gain Sector ");
     278         
    245279          GetAverageHiGainSector(j).GetHGausHist()->SetTitle("Rel. Arr. Times HiGain Sector ");
    246280          GetAverageHiGainSector(j).SetNbins(fAverageNbins);
    247 
     281         
    248282          InitHists(GetAverageHiGainSector(j),fCam->GetAverageBadSector(j),j);
    249283      }
    250284  }
     285 
     286  if (fRunHeader)
     287    for (Int_t j=0; j<nsectors; j++)
     288      {
     289        TH1F *h = GetAverageHiGainSector(j).GetHGausHist();
     290        h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
     291      }
    251292
    252293  if (fAverageLoGainSectors->GetEntries()==0)
    253   {
     294    {
    254295      fAverageLoGainSectors->Expand(nsectors);
    255 
     296     
    256297      for (Int_t j=0; j<nsectors; j++)
    257       {
     298        {
    258299          (*fAverageLoGainSectors)[j] =
    259300            new MHCalibrationRelTimePix("MHCalibrationRelTimeAverageSectorLoGain",
    260                                         "Average Relative Arrival Times Low Gain Sector ");
    261 
     301                                        "Average Rel. Arr. Times Lo-Gain Sector ");
     302         
    262303          GetAverageLoGainSector(j).GetHGausHist()->SetTitle("Rel. Arr. Times LoGain Sector ");
    263304          GetAverageLoGainSector(j).SetNbins(fAverageNbins);
    264 
     305         
    265306          InitHists(GetAverageLoGainSector(j),fCam->GetAverageBadSector(j),j);
    266307         
    267       }
    268   }
    269 
     308        }
     309    }
     310
     311  if (fRunHeader)
     312    for (Int_t j=0; j<nsectors; j++)
     313      {
     314        TH1F *h = GetAverageLoGainSector(j).GetHGausHist();
     315        h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
     316      }
     317 
    270318  return kTRUE;
    271319}
     
    309357  memset(sumsectorhi, 0, nsectors*sizeof(Float_t));
    310358  memset(sumsectorlo, 0, nsectors*sizeof(Float_t));
    311  
    312   const MArrivalTimePix &refpix = (*arrtime)[1];
     359  memset(numareahi,   0, nareas * sizeof(Float_t));
     360  memset(numarealo,   0, nareas * sizeof(Float_t));
     361  memset(numsectorhi, 0, nsectors*sizeof(Float_t));
     362  memset(numsectorlo, 0, nsectors*sizeof(Float_t));
     363 
     364  const MArrivalTimePix &refpix = (*arrtime)[fReferencePixel];
    313365  const Float_t reftime = refpix.IsLoGainUsed()
    314366    ? refpix.GetArrivalTimeLoGain() : refpix.GetArrivalTimeHiGain();
     
    324376
    325377      const MArrivalTimePix &pix = (*arrtime)[i];
    326       const Float_t time    = pix.IsLoGainUsed()
    327         ? pix.GetArrivalTimeLoGain() : pix.GetArrivalTimeHiGain(); 
    328       const Float_t reltime = time - reftime;
    329      
    330378      const Int_t aidx   = (*fGeom)[i].GetAidx();
    331379      const Int_t sector = (*fGeom)[i].GetSector();
     
    333381      if (pix.IsLoGainUsed())
    334382        {
    335 
     383          const Float_t reltime = pix.GetArrivalTimeLoGain() - reftime;
    336384          histlo.FillHistAndArray(reltime);
    337385          sumarealo  [aidx]   += reltime;
     
    342390      else
    343391        {
    344 
     392          const Float_t reltime = pix.GetArrivalTimeHiGain() - reftime;
    345393          histhi.FillHistAndArray(reltime) ;
    346394          sumareahi  [aidx]   += reltime;
Note: See TracChangeset for help on using the changeset viewer.