Changeset 4950


Ignore:
Timestamp:
09/11/04 22:13:21 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4949 r4950  
    3737     - use new functions InitHiGainArrays and InitLoGainArrays
    3838 
     39   * mhcalib/MHCalibrationRelTimePix.[h,cc]
     40   * mhcalib/MHCalibrationTestPix.[h,cc]
     41   * mhcalib/MHCalibrationTestTimePix.[h,cc]
     42     - removed
     43
    3944
    4045 2004/09/10: Antonio Stamerra
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc

    r4947 r4950  
    154154using namespace std;
    155155
     156const Int_t   MHCalibrationChargeCam::fgChargeHiGainNbins =  550;
    156157const Axis_t  MHCalibrationChargeCam::fgChargeHiGainFirst = -100.5;
    157158const Axis_t  MHCalibrationChargeCam::fgChargeHiGainLast  = 999.5;
     159const Int_t   MHCalibrationChargeCam::fgChargeLoGainNbins =  325;
    158160const Axis_t  MHCalibrationChargeCam::fgChargeLoGainFirst = -150.5;
    159 const Axis_t  MHCalibrationChargeCam::fgChargeLoGainLast  = 499.5;
    160 
     161const Axis_t  MHCalibrationChargeCam::fgChargeLoGainLast  =  499.5;
     162const TString MHCalibrationChargeCam::gsHistName          = "Charge";
     163const TString MHCalibrationChargeCam::gsHistTitle         = "Signals";
     164const TString MHCalibrationChargeCam::gsHistXTitle        = "Signal [FADC counts]";
     165const TString MHCalibrationChargeCam::gsHistYTitle        = "Nr. events";
     166const TString MHCalibrationChargeCam::gsAbsHistName       = "AbsTime";
     167const TString MHCalibrationChargeCam::gsAbsHistTitle      = "Abs. Arr. Times";
     168const TString MHCalibrationChargeCam::gsAbsHistXTitle     = "Time [FADC slices]";
     169const TString MHCalibrationChargeCam::gsAbsHistYTitle     = "Nr. events";
    161170const Float_t MHCalibrationChargeCam::fgNumHiGainSaturationLimit = 0.01;
    162171const Float_t MHCalibrationChargeCam::fgNumLoGainSaturationLimit = 0.005;
     
    180189// - fTimeLowerLimit           to fgTimeLowerLimit
    181190// - fTimeUpperLimit           to fgTimeUpperLimit
    182 // - fNbins to fgChargeHiGainLast-fgChargeHiGainFirst
     191//
     192// - fNbins to fgChargeHiGainNbins
    183193// - fFirst to fgChargeHiGainFirst
    184194// - fLast  to fgChargeHiGainLast
     195//
     196// - fLoGainNbins to fgChargeLoGainNbins
     197// - fLoGainFirst to fgChargeLoGainFirst
     198// - fLoGainLast  to fgChargeLoGainLast
     199//
     200// - fHistName   to gsHistName 
     201// - fHistTitle  to gsHistTitle
     202// - fHistXTitle to gsHistXTitle
     203// - fHistYTitle to gsHistYTitle
     204//
     205// - fAbsHistName   to gsAbsHistName 
     206// - fAbsHistTitle  to gsAbsHistTitle
     207// - fAbsHistXTitle to gsAbsHistXTitle
     208// - fAbsHistYTitle to gsAbsHistYTitle
    185209//
    186210MHCalibrationChargeCam::MHCalibrationChargeCam(const char *name, const char *title)
     
    196220  SetTimeUpperLimit();
    197221
    198   SetNbins((Int_t)(fgChargeHiGainLast-fgChargeHiGainFirst)/2);
     222  SetNbins(fgChargeHiGainNbins);
    199223  SetFirst(fgChargeHiGainFirst);
    200224  SetLast (fgChargeHiGainLast );
    201225
    202   SetLoGainNbins((Int_t)(fgChargeLoGainLast-fgChargeLoGainFirst)/2);
     226  SetLoGainNbins(fgChargeLoGainNbins);
    203227  SetLoGainFirst(fgChargeLoGainFirst);
    204228  SetLoGainLast (fgChargeLoGainLast );
     229
     230  SetHistName  (gsHistName  .Data());
     231  SetHistTitle (gsHistTitle .Data());
     232  SetHistXTitle(gsHistXTitle.Data());
     233  SetHistYTitle(gsHistYTitle.Data());
     234
     235  SetAbsHistName  (gsAbsHistName  .Data());
     236  SetAbsHistTitle (gsAbsHistTitle .Data());
     237  SetAbsHistXTitle(gsAbsHistXTitle.Data());
     238  SetAbsHistYTitle(gsAbsHistYTitle.Data());
    205239}
    206240
     
    233267// into MCalibrationChargeCam and test for changes in that variable
    234268//
    235 // Initializes, if empty to MGeomCam::GetNumPixels():
    236 // - MHCalibrationCam::fHiGainArray, MHCalibrationCam::fLoGainArray
    237 // - MHCalibrationCam::fHiGainOverflow, MHCalibrationCam::fLoGainOverflow
    238 //
    239 // Initializes, if empty to MGeomCam::GetNumAreas() for:
    240 // - MHCalibrationCam::fAverageHiGainAreas, MHCalibrationCam::fAverageLoGainAreas
    241 //
    242 // Initializes, if empty to MGeomCam::GetNumSectors() for:
    243 // - MHCalibrationCam::fAverageHiGainSectors, MHCalibrationCam::fAverageLoGainSectors
    244 //
    245 // Calls MHCalibrationCam::InitHists() for every entry in:
    246 // - MHCalibrationCam::fHiGainArray, MHCalibrationCam::fLoGainArray
    247 // - MHCalibrationCam::fAverageHiGainAreas, MHCalibrationCam::fAverageLoGainAreas
    248 // - MHCalibrationCam::fAverageHiGainSectors, MHCalibrationCam::fAverageLoGainSectors
    249 //
    250 // Sets Titles and Names for the Charge Histograms:
    251 // - MHCalibrationCam::fAverageHiGainAreas
    252 // - MHCalibrationCam::fAverageHiGainSectors
     269// Calls:
     270// - InitHiGainArrays()
     271// - InitLoGainArrays()
    253272//
     273// Sets:
     274// - fSumhiarea   to nareas
     275// - fSumloarea   to nareas
     276// - fTimehiarea  to nareas
     277// - fTimeloarea  to nareas
     278// - fSumhisector to nsectors
     279// - fSumlosector to nsectors
     280// - fTimehisector to nsectors
     281// - fTimelosector to nsectors
     282// - fSathiarea   to nareas
     283// - fSatloarea   to nareas
     284// - fSathisector to nsectors
     285// - fSatlosector to nsectors
     286//
    254287Bool_t MHCalibrationChargeCam::ReInitHists(MParList *pList)
    255288{
     
    313346  */
    314347
    315  
    316348  const Int_t npixels  = fGeom->GetNumPixels();
    317349  const Int_t nsectors = fGeom->GetNumSectors();
    318350  const Int_t nareas   = fGeom->GetNumAreas();
    319351
     352  InitHiGainArrays(npixels,nareas,nsectors);
     353  InitLoGainArrays(npixels,nareas,nsectors);
     354
     355  fSumhiarea  .Set(nareas);
     356  fSumloarea  .Set(nareas);
     357  fTimehiarea .Set(nareas);
     358  fTimeloarea .Set(nareas);
     359  fSumhisector.Set(nsectors);
     360  fSumlosector.Set(nsectors);
     361  fTimehisector.Set(nsectors);
     362  fTimelosector.Set(nsectors);
     363
     364  fSathiarea  .Set(nareas);
     365  fSatloarea  .Set(nareas);
     366  fSathisector.Set(nsectors);
     367  fSatlosector.Set(nsectors);
     368
     369  return kTRUE;
     370}
     371
     372// --------------------------------------------------------------------------
     373//
     374// Retrieve:
     375// - fRunHeader->GetNumSamplesHiGain();
     376//
     377// Initializes the High Gain Arrays:
     378//
     379// - Expand fHiGainArrays to npixels
     380// - Expand fAverageHiGainAreas to nareas
     381// - Expand fAverageHiGainSectors to nsectors
     382//
     383// - For every entry in the expanded arrays:
     384//   * call new MHCalibrationPix(fHistName,fHistTitle)
     385//   * SetNbins(fNbins), SetFirst(fFirst), SetLast(fLast)
     386//   * SetAbsTimeNbins(samples hi gain), SetAbsTimeFirst(-0.5), SetAbsTimeLast(samples hi-gain-0.5)
     387//   * Set fHistName and fHistTitle in the Histogram of MHCalibrationPix
     388//   * Set Name and Title in the Abs Time Histogram of MHCalibrationPix
     389//   * Set X-axis and Y-axis titles with fHistXTitle and fHistYTitle
     390//   * Call InitHists
     391//
     392//
     393void MHCalibrationChargeCam::InitHiGainArrays(const Int_t npixels, const Int_t nareas, const Int_t nsectors)
     394{
     395 
     396  TH1F *h;
     397
    320398  const Int_t higainsamples = fRunHeader->GetNumSamplesHiGain();
    321   const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain();
    322399
    323400  if (fHiGainArray->GetEntries()==0)
     
    326403      for (Int_t i=0; i<npixels; i++)
    327404      {
    328         (*fHiGainArray)[i] = new MHCalibrationChargePix("ChargeHiGainPix","Signals of the HiGain");
     405        (*fHiGainArray)[i] = new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"HiGainPix"),
     406                                                  Form("%s%s",fHistTitle.Data()," High Gain Pixel"));
     407
    329408        MHCalibrationChargePix &pix = (MHCalibrationChargePix&)(*this)[i];
     409
     410        pix.SetNbins(fNbins);
     411        pix.SetFirst(fFirst);
     412        pix.SetLast (fLast);
    330413
    331414        pix.SetAbsTimeNbins(higainsamples);
     
    333416        pix.SetAbsTimeLast(higainsamples-0.5);
    334417
    335         pix.SetNbins(fNbins);
    336         pix.SetFirst(fFirst);
    337         pix.SetLast (fLast);
    338 
    339         TH1F *h =  pix.GetHGausHist();
    340 
    341         h->SetName ("HChargeHiGainPix");
    342         h->SetTitle("Signals High Gain Pixel "); 
    343         h->SetXTitle("Signal [FADC counts]");
    344         h->SetYTitle("Nr. of events");
    345 
    346         pix.GetHAbsTime()->SetName ("HAbsTimeHiGainPix");
    347         pix.GetHAbsTime()->SetTitle("Absolute Arrival Times High Gain Pixel "); 
     418        h = pix.GetHGausHist();
     419
     420        h->SetName (Form("%s%s%s","H",fHistName.Data(),"HiGainPix"));
     421        h->SetTitle(Form("%s%s",fHistTitle.Data()," High Gain Pixel ")); 
     422        h->SetXTitle(fHistXTitle.Data());
     423        h->SetYTitle(fHistYTitle.Data());
     424       
     425        h = pix.GetHAbsTime();
     426
     427        h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"HiGainPix"));
     428        h->SetTitle(Form("%s%s",fAbsHistTitle.Data()," High Gain Pixel "));
     429        h->SetXTitle(fAbsHistXTitle.Data());
     430        h->SetYTitle(fAbsHistYTitle.Data());
    348431
    349432        InitHists((*this)[i],(*fBadPixels)[i],i);
     
    351434  }
    352435
    353   if (fLoGainArray->GetEntries()==0 && IsLoGain())
     436
     437  if (fAverageHiGainAreas->GetEntries()==0)
     438  {
     439    fAverageHiGainAreas->Expand(nareas);
     440   
     441    for (Int_t j=0; j<nareas; j++)
     442      {
     443        (*fAverageHiGainAreas)[j] =
     444          new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"HiGainArea"),
     445                                     Form("%s%s",fHistTitle.Data()," High Gain Area Idx "));
     446       
     447        MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageHiGainArea(j);
     448       
     449        pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
     450        pix.SetFirst(fFirst);
     451        pix.SetLast (fLast);
     452       
     453        pix.SetAbsTimeNbins(higainsamples);
     454        pix.SetAbsTimeFirst(-0.5);
     455        pix.SetAbsTimeLast(higainsamples-0.5);
     456
     457        h =  pix.GetHGausHist();
     458       
     459        h->SetName (Form("%s%s%s","H",fHistName.Data(),"HiGainArea"));
     460        h->SetXTitle(fHistXTitle.Data());
     461        h->SetYTitle(fHistYTitle.Data());
     462       
     463        if (fGeom->InheritsFrom("MGeomCamMagic"))
     464          {
     465            h->SetTitle(Form("%s%s%s%s",fHistTitle.Data()," averaged on event-by-event basis ",
     466                             j==0 ? "Inner Pixels " : "Outer Pixels ","High Gain Runs: "));
     467            pix.InitBins();
     468            pix.SetEventFrequency(fPulserFrequency);
     469          }
     470        else
     471          {
     472            h->SetTitle(Form("%s%s",fHistTitle.Data(),
     473                             " averaged on event-by-event basis High Gain Area Idx "));
     474            InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j);
     475          }
     476
     477        h =  pix.GetHAbsTime();
     478       
     479        h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"HiGainArea"));
     480        h->SetTitle(Form("%s%s",fAbsHistTitle.Data(),
     481                         " averaged on event-by-event basis High Gain Area Idx "));
     482        h->SetXTitle(fAbsHistXTitle.Data());
     483        h->SetYTitle(fAbsHistYTitle.Data());
     484      }
     485  }
     486 
     487  if (fAverageHiGainSectors->GetEntries()==0)
     488  {
     489      fAverageHiGainSectors->Expand(nsectors);
     490
     491      for (Int_t j=0; j<nsectors; j++)
     492      {
     493          (*fAverageHiGainSectors)[j] =
     494            new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"HiGainSector"),
     495                                       Form("%s%s",fHistTitle.Data()," High Gain Sector "));
     496
     497          MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageHiGainSector(j);
     498
     499          pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
     500          pix.SetFirst(fFirst);
     501          pix.SetLast (fLast);
     502
     503          pix.SetAbsTimeNbins(higainsamples);
     504          pix.SetAbsTimeFirst(-0.5);
     505          pix.SetAbsTimeLast(higainsamples-0.5);
     506         
     507          h =  pix.GetHGausHist();
     508         
     509          h->SetName (Form("%s%s%s","H",fHistName.Data(),"HiGainSector"));
     510          h->SetTitle(Form("%s%s",fHistTitle.Data()," High Gain Sector ")); 
     511          h->SetXTitle(fHistXTitle.Data());
     512          h->SetYTitle(fHistYTitle.Data());
     513
     514          h =  pix.GetHAbsTime();
     515         
     516          h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"HiGainSector"));
     517          h->SetTitle(Form("%s%s",fAbsHistTitle.Data(),
     518                           " averaged on event-by-event basis High Gain Area Sector "));
     519          h->SetXTitle(fAbsHistXTitle.Data());
     520          h->SetYTitle(fAbsHistYTitle.Data());
     521         
     522          InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j);
     523      }
     524  }
     525}
     526
     527//--------------------------------------------------------------------------------------
     528//
     529// Return, if IsLoGain() is kFALSE
     530//
     531// Retrieve:
     532// - fRunHeader->GetNumSamplesHiGain();
     533//
     534// Initializes the Low Gain Arrays:
     535//
     536// - Expand fLoGainArrays to npixels
     537// - Expand fAverageLoGainAreas to nareas
     538// - Expand fAverageLoGainSectors to nsectors
     539//
     540// - For every entry in the expanded arrays:
     541//   * call new MHCalibrationPix(fHistName,fHistTitle)
     542//   * SetBins(fNbins), SetFirst(fFirst), SetLast(fLast)
     543//   * SetAbsTimeNbins(samples lo gain), SetAbsTimeFirst(-0.5), SetAbsTimeLast(samples lo-gain-0.5)
     544//   * Set fHistName and fHistTitle in the Histogram of MHCalibrationPix
     545//   * Set fHistName and fHistTitle in the Histogram of MHCalibrationPix
     546//   * Set X-axis and Y-axis titles with fHistXTitle and fHistYTitle
     547//   * Call InitHists
     548//
     549void MHCalibrationChargeCam::InitLoGainArrays(const Int_t npixels, const Int_t nareas, const Int_t nsectors)
     550{
     551
     552  if (!IsLoGain())
     553    return;
     554
     555  const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain();
     556
     557  TH1F *h;
     558
     559  if (fLoGainArray->GetEntries()==0 )
    354560    {
    355561      fLoGainArray->Expand(npixels);
     
    357563      for (Int_t i=0; i<npixels; i++)
    358564        {
    359           (*fLoGainArray)[i] = new MHCalibrationChargePix("ChargeLoGainPix","Signals of the LoGain");
     565          (*fLoGainArray)[i] =
     566            new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"LoGainPix"),
     567                                       Form("%s%s",fHistTitle.Data()," Low Gain Pixel"));
     568
    360569          MHCalibrationChargePix &pix = (MHCalibrationChargePix&)(*this)(i);
    361570
     571          pix.SetNbins(fLoGainNbins);
     572          pix.SetFirst(fLoGainFirst);
     573          pix.SetLast (fLoGainLast);
     574         
    362575          pix.SetAbsTimeNbins(logainsamples);
    363576          pix.SetAbsTimeFirst(-0.5);
    364577          pix.SetAbsTimeLast(logainsamples-0.5);
    365578         
    366           pix.SetNbins(fLoGainNbins);
    367           pix.SetFirst(fLoGainFirst);
    368           pix.SetLast (fLoGainLast);
    369          
    370           TH1F *h =  pix.GetHGausHist();
    371          
    372           h->SetName ("HChargeLoGainPix");
    373           h->SetTitle("Signals Low Gain Pixel "); 
    374           h->SetXTitle("Signal [FADC counts]");
    375           h->SetYTitle("Nr. of events");
    376        
    377           pix.GetHAbsTime()->SetName ("HAbsTimeLoGainPix");
    378           pix.GetHAbsTime()->SetTitle("Absolute Arrival Times Low Gain Pixel "); 
    379 
     579          h =  pix.GetHGausHist();
     580         
     581          h->SetName (Form("%s%s%s","H",fHistName.Data(),"LoGainPix"));
     582          h->SetTitle(Form("%s%s",fHistTitle.Data()," Low Gain Pixel ")); 
     583          h->SetXTitle(fHistXTitle.Data());
     584          h->SetYTitle(fHistYTitle.Data());
     585         
     586          h = pix.GetHAbsTime();
     587         
     588          h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"HiGainPix"));
     589          h->SetTitle(Form("%s%s",fAbsHistTitle.Data()," High Gain Pixel "));
     590          h->SetXTitle(fAbsHistXTitle.Data());
     591          h->SetYTitle(fAbsHistYTitle.Data());
    380592          //
    381593          // Adapt the range for the case, the intense blue is used:
     
    395607  }
    396608
    397   if (fAverageHiGainAreas->GetEntries()==0)
    398   {
    399     fAverageHiGainAreas->Expand(nareas);
    400    
    401     for (Int_t j=0; j<nareas; j++)
    402       {
    403         (*fAverageHiGainAreas)[j] = new MHCalibrationChargePix("ChargeAverageHiGainArea",
    404                                                                "Average HiGain FADC sums area idx ");
    405 
    406         MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageHiGainArea(j);
    407        
    408         pix.SetAbsTimeNbins(higainsamples);
    409         pix.SetAbsTimeFirst(-0.5);
    410         pix.SetAbsTimeLast(higainsamples-0.5);
    411 
    412         pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
    413         pix.SetFirst(fFirst);
    414         pix.SetLast (fLast);
    415        
    416         TH1F *h =  pix.GetHGausHist();
    417        
    418         h->SetName ("HChargeHiGainAreaIdx");
    419         h->SetXTitle("Signal [FADC counts]");
    420         h->SetYTitle("Nr. of events");
    421        
    422         pix.GetHAbsTime()->SetName ("HAbsTimeHiGainAreaIdx");
    423         pix.GetHAbsTime()->SetTitle("Absolute Arrival Times average Hi Gain Area Idx "); 
    424        
    425         if (fGeom->InheritsFrom("MGeomCamMagic"))
    426           {
    427             h->SetTitle(Form("%s%s%s","Signals averaged on event-by-event basis ",
    428                              j==0 ? "Inner Pixels " : "Outer Pixels ","High Gain Runs: "));
    429             pix.InitBins();
    430             pix.SetEventFrequency(fPulserFrequency);
    431           }
    432         else
    433           {
    434             h->SetTitle("Signals averaged on event-by-event basis High Gain Area Idx ");
    435             InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j);
    436           }
    437       }
    438   }
    439  
    440  
    441   if (fAverageLoGainAreas->GetEntries()==0 && IsLoGain())
     609  if (fAverageLoGainAreas->GetEntries()==0)
    442610    {
    443611      fAverageLoGainAreas->Expand(nareas);
     
    445613      for (Int_t j=0; j<nareas; j++)
    446614        {
    447           (*fAverageLoGainAreas)[j] = new MHCalibrationChargePix("ChargeAverageLoGainArea",
    448                                                                  "Average LoGain FADC sums area idx ");
    449 
     615          (*fAverageLoGainAreas)[j] =
     616            new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"LoGainArea"),
     617                                       Form("%s%s",fHistTitle.Data()," Low Gain Area Idx "));
     618       
    450619        MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageLoGainArea(j);
     620
     621        pix.SetNbins(fLoGainNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
     622        pix.SetFirst(fLoGainFirst);
     623        pix.SetLast (fLoGainLast);
    451624
    452625        pix.SetAbsTimeNbins(logainsamples);
     
    454627        pix.SetAbsTimeLast(logainsamples-0.5);
    455628
    456         pix.SetNbins(fLoGainNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
    457         pix.SetFirst(fLoGainFirst);
    458         pix.SetLast (fLoGainLast);
    459 
    460         TH1F *h =  pix.GetHGausHist();
    461        
    462         h->SetName ("HChargeLoGainAreaIdx");
    463         h->SetXTitle("Signal [FADC counts]");
    464         h->SetYTitle("Nr. of events");
    465        
    466         pix.GetHAbsTime()->SetName ("HAbsTimeLoGainAreaIdx");
    467         pix.GetHAbsTime()->SetTitle("Absolute Arrival Times average Low Gain Area Idx "); 
     629        h =  pix.GetHGausHist();
     630       
     631        h->SetName (Form("%s%s%s","H",fHistName.Data(),"LoGainArea"));
     632        h->SetXTitle(fHistXTitle.Data());
     633        h->SetYTitle(fHistYTitle.Data());
     634
    468635        //
    469636        // Adapt the range for the case, the intense blue is used:
     
    483650        if (fGeom->InheritsFrom("MGeomCamMagic"))
    484651          {
    485             h->SetTitle(Form("%s%s%s","Signals averaged on event-by-event basis ",
     652            h->SetTitle(Form("%s%s%s%s",fHistTitle.Data()," averaged on event-by-event basis ",
    486653                             j==0 ? "Inner Pixels " : "Outer Pixels ","Low Gain Runs: "));
    487654            pix.InitBins();
     
    490657        else
    491658          {
    492             h->SetTitle("Signals averaged on event-by-event basis Low Gain Area Idx ");
     659            h->SetTitle(Form("%s%s",fHistTitle.Data()," averaged on event-by-event basis Low Gain Area Idx "));
    493660            InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j);
    494661          }
     662
     663        h =  pix.GetHAbsTime();
     664       
     665        h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"LoGainArea"));
     666        h->SetTitle(Form("%s%s",fAbsHistTitle.Data(),
     667                         " averaged on event-by-event basis Low Gain Area Idx "));
     668        h->SetXTitle(fAbsHistXTitle.Data());
     669        h->SetYTitle(fAbsHistYTitle.Data());
     670
    495671        }
    496672    }
    497673 
    498   if (fAverageHiGainSectors->GetEntries()==0)
    499   {
    500       fAverageHiGainSectors->Expand(nsectors);
    501 
    502       for (Int_t j=0; j<nsectors; j++)
    503       {
    504           (*fAverageHiGainSectors)[j] = new MHCalibrationChargePix("ChargeAverageHiGainSector",
    505                                                                    "Averaged HiGain Signals Sector ");
    506 
    507           MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageHiGainSector(j);
    508 
    509           pix.SetAbsTimeNbins(higainsamples);
    510           pix.SetAbsTimeFirst(-0.5);
    511           pix.SetAbsTimeLast(higainsamples-0.5);
    512          
    513           pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
    514           pix.SetFirst(fFirst);
    515           pix.SetLast (fLast);
    516 
    517           TH1F *h =  pix.GetHGausHist();
    518          
    519           h->SetName ("HChargeHiGainSector");
    520           h->SetTitle("Signals averaged on event-by-event basis HiGain Sector "); 
    521           h->SetXTitle("Signal [FADC counts]");
    522           h->SetYTitle("Nr. of events");
    523        
    524           pix.GetHAbsTime()->SetName ("HAbsTimeHiGainPix");
    525           pix.GetHAbsTime()->SetTitle("Absolute Arrival Time average HiGain Sector "); 
    526 
    527           InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j);
    528       }
    529   }
    530674
    531675  if (fAverageLoGainSectors->GetEntries()==0 && IsLoGain())
     
    535679      for (Int_t j=0; j<nsectors; j++)
    536680      {
    537           (*fAverageLoGainSectors)[j] = new MHCalibrationChargePix("ChargeAverageLoGainSector",
    538                                                                    "Average LoGain Signals Sector ");
     681          (*fAverageLoGainSectors)[j] =
     682            new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"LoGainSector"),
     683                                       Form("%s%s",fHistTitle.Data()," Low Gain Sector "));
    539684
    540685          MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageLoGainSector(j);
     686
     687          pix.SetNbins(fLoGainNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
     688          pix.SetFirst(fLoGainFirst);
     689          pix.SetLast (fLoGainLast);
    541690
    542691          pix.SetAbsTimeNbins(logainsamples);
     
    544693          pix.SetAbsTimeLast(logainsamples-0.5);
    545694         
    546           pix.SetNbins(fLoGainNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
    547           pix.SetFirst(fLoGainFirst);
    548           pix.SetLast (fLoGainLast);
    549 
    550           TH1F *h =  pix.GetHGausHist();
    551          
    552           h->SetName ("HChargeLoGainSector");
    553           h->SetTitle("Signals averaged on event-by-event basis LoGain Sector "); 
    554           h->SetXTitle("Signal [FADC counts]");
    555           h->SetYTitle("Nr. of events");
    556        
    557           pix.GetHAbsTime()->SetName ("HAbsTimeLoGainPix");
    558           pix.GetHAbsTime()->SetTitle("Absolute Arrival Time average LoGain Sector "); 
    559 
     695          h =  pix.GetHGausHist();
     696         
     697          h->SetName (Form("%s%s%s","H",fHistName.Data(),"LoGainSector"));
     698          h->SetTitle(Form("%s%s",fHistTitle.Data()," Low Gain Sector ")); 
     699          h->SetXTitle(fHistXTitle.Data());
     700          h->SetYTitle(fHistYTitle.Data());
     701
     702          h =  pix.GetHAbsTime();
     703         
     704          h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"LoGainSector"));
     705          h->SetTitle(Form("%s%s",fAbsHistTitle.Data(),
     706                           " averaged on event-by-event basis Low Gain Area Sector "));
     707          h->SetXTitle(fAbsHistXTitle.Data());
     708          h->SetYTitle(fAbsHistYTitle.Data());
     709         
    560710          //
    561711          // Adapt the range for the case, the intense blue is used:
     
    576726      }
    577727  }
    578 
    579   fSumhiarea  .Set(nareas);
    580   fSumloarea  .Set(nareas);
    581   fTimehiarea .Set(nareas);
    582   fTimeloarea .Set(nareas);
    583   fSumhisector.Set(nsectors);
    584   fSumlosector.Set(nsectors);
    585   fTimehisector.Set(nsectors);
    586   fTimelosector.Set(nsectors);
    587 
    588   fSathiarea  .Set(nareas);
    589   fSatloarea  .Set(nareas);
    590   fSathisector.Set(nsectors);
    591   fSatlosector.Set(nsectors);
    592 
    593   return kTRUE;
    594728}
    595729
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h

    r4947 r4950  
    2424private:
    2525
    26   static const Axis_t  fgChargeHiGainFirst;          //! First Bin of HiGain Histograms (nw set to: -100.5)
    27   static const Axis_t  fgChargeHiGainLast;           //! Last Bin of HiGain Histograms (nw set to:   999.5)
    28   static const Axis_t  fgChargeLoGainFirst;          //! First Bin of LoGain Histograms (nw set to: -150.5)
    29   static const Axis_t  fgChargeLoGainLast;           //! Last Bin of LoGain Histograms (nw set to:   499.5)
     26  static const Int_t   fgChargeHiGainNbins;          //! Nr. bins of HiGain Histograms  (now set to:  550  )
     27  static const Axis_t  fgChargeHiGainFirst;          //! First Bin of HiGain Histograms (now set to: -100.5)
     28  static const Axis_t  fgChargeHiGainLast;           //! Last Bin of HiGain Histograms  (now set to:  999.5)
     29  static const Int_t   fgChargeLoGainNbins;          //! First Bin of LoGain Histograms (now set to:  325  )
     30  static const Axis_t  fgChargeLoGainFirst;          //! First Bin of LoGain Histograms (now set to: -150.5)
     31  static const Axis_t  fgChargeLoGainLast;           //! Last Bin of LoGain Histograms  (now set to:  499.5)
     32 
     33  static const TString gsHistName;                   //! Default Histogram names
     34  static const TString gsHistTitle;                  //! Default Histogram titles
     35  static const TString gsHistXTitle;                 //! Default Histogram x-axis titles
     36  static const TString gsHistYTitle;                 //! Default Histogram y-axis titles
     37 
     38  static const TString gsAbsHistName;               //! Default Histogram names abs.times
     39  static const TString gsAbsHistTitle;              //! Default Histogram titles abs.times
     40  static const TString gsAbsHistXTitle;             //! Default Histogram x-axis titles abs.times
     41  static const TString gsAbsHistYTitle;             //! Default Histogram y-axis titles abs.times
    3042 
    3143  static const Float_t fgNumHiGainSaturationLimit;   //! The default for fNumHiGainSaturationLimit (now at: 0.01)
     
    4355  Axis_t  fLoGainLast;                               // Upper histogram limit low gain 
    4456
     57  TString fAbsHistName;                              // Histogram names abs.times
     58  TString fAbsHistTitle;                             // Histogram titles abs. times
     59  TString fAbsHistXTitle;                            // Histogram x-axis titles abs. times
     60  TString fAbsHistYTitle;                            // Histogram y-axis titles abs. times
     61 
    4562  MArrayD fSumhiarea  ;                              //!
    4663  MArrayD fSumloarea  ;                              //!
     
    7087  Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
    7188
     89  void   InitHiGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors );
     90  void   InitLoGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors );
     91
    7292  void   FinalizeAbsTimes (MHCalibrationChargePix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad,
    7393                           Byte_t first, Byte_t last); 
     
    92112  void SetTimeUpperLimit    ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; }
    93113 
     114  void SetAbsHistName  ( const char *name )  { fAbsHistName  = name;  }
     115  void SetAbsHistTitle ( const char *name )  { fAbsHistTitle = name;  }
     116  void SetAbsHistXTitle( const char *name )  { fAbsHistXTitle = name; }
     117  void SetAbsHistYTitle( const char *name )  { fAbsHistYTitle = name; }
     118   
    94119  Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    95120  void   DrawPixelContent( Int_t num )  const;   
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.cc

    r4943 r4950  
    6363const Float_t MHCalibrationChargePINDiode::fgTimeLowerLimit  = 3.;
    6464const Float_t MHCalibrationChargePINDiode::fgTimeUpperLimit  = 4.;
     65const TString MHCalibrationChargePINDiode::gsHistName          = "Charge";
     66const TString MHCalibrationChargePINDiode::gsHistTitle         = "Signals";
     67const TString MHCalibrationChargePINDiode::gsHistXTitle        = "Signal [FADC counts]";
     68const TString MHCalibrationChargePINDiode::gsHistYTitle        = "Nr. events";
     69const TString MHCalibrationChargePINDiode::gsAbsHistName       = "AbsTime";
     70const TString MHCalibrationChargePINDiode::gsAbsHistTitle      = "Abs. Arr. Times";
     71const TString MHCalibrationChargePINDiode::gsAbsHistXTitle     = "Time [FADC slices]";
     72const TString MHCalibrationChargePINDiode::gsAbsHistYTitle     = "Nr. events";
    6573// --------------------------------------------------------------------------
    6674//
     
    95103// - the current style for fHRmsCharge (NULL)
    96104//
     105// - fHistName   to gsHistName 
     106// - fHistTitle  to gsHistTitle
     107// - fHistXTitle to gsHistXTitle
     108// - fHistYTitle to gsHistYTitle
     109//
     110// - fAbsHistName   to gsAbsHistName 
     111// - fAbsHistTitle  to gsAbsHistTitle
     112// - fAbsHistXTitle to gsAbsHistXTitle
     113// - fAbsHistYTitle to gsAbsHistYTitle
     114//
    97115// Initializes:
    98116// - fHRmsCharge()
     
    124142  SetTimeUpperLimit();
    125143
    126   fHGausHist.SetName("HCalibrationChargePINDiode");
    127   fHGausHist.SetTitle("Distribution of Summed FADC slices PIN Diode"); 
    128   fHGausHist.SetXTitle("Sum FADC Slices");
    129   fHGausHist.SetYTitle("Nr. of events");
    130 
    131   fHAbsTime.SetName("HAbsTimePINDiode");
    132   fHAbsTime.SetTitle("Distribution of Absolute Arrival Times PIN Diode"); 
    133   fHAbsTime.SetXTitle("Absolute Arrival Time [FADC slice nr]");
    134   fHAbsTime.SetYTitle("Nr. of events");
     144  SetHistName  (gsHistName  .Data());
     145  SetHistTitle (gsHistTitle .Data());
     146  SetHistXTitle(gsHistXTitle.Data());
     147  SetHistYTitle(gsHistYTitle.Data());
     148
     149  SetAbsHistName  (gsAbsHistName  .Data());
     150  SetAbsHistTitle (gsAbsHistTitle .Data());
     151  SetAbsHistXTitle(gsAbsHistXTitle.Data());
     152  SetAbsHistYTitle(gsAbsHistYTitle.Data());
    135153
    136154  fHRmsCharge.SetName("HRmsChargePINDiode");
     
    154172{
    155173
     174  TH1F *h = GetHGausHist();
     175
     176  h->SetName (fHistName.Data());
     177  h->SetTitle(fHistTitle.Data()); 
     178  h->SetXTitle(fHistXTitle.Data());
     179  h->SetYTitle(fHistYTitle.Data());
     180 
     181  h = GetHAbsTime();
     182
     183  h->SetName (fAbsHistName.Data());
     184  h->SetTitle(fAbsHistTitle.Data());
     185  h->SetXTitle(fAbsHistXTitle.Data());
     186  h->SetYTitle(fAbsHistYTitle.Data());
     187 
    156188  MHCalibrationPix::InitBins();
    157189
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.h

    r4943 r4950  
    2525  static const Float_t fgTimeLowerLimit;  //! Default for fTimeLowerLimit    (now set to: 1.)
    2626  static const Float_t fgTimeUpperLimit;  //! Default for fTimeUpperLimit    (now set to: 2.)
     27
     28  static const TString gsHistName;        //! Default Histogram names
     29  static const TString gsHistTitle;       //! Default Histogram titles
     30  static const TString gsHistXTitle;      //! Default Histogram x-axis titles
     31  static const TString gsHistYTitle;      //! Default Histogram y-axis titles
     32 
     33  static const TString gsAbsHistName;     //! Default Histogram names abs.times
     34  static const TString gsAbsHistTitle;    //! Default Histogram titles abs.times
     35  static const TString gsAbsHistXTitle;   //! Default Histogram x-axis titles abs.times
     36  static const TString gsAbsHistYTitle;   //! Default Histogram y-axis titles abs.times
     37 
     38  TString fHistName;                      // Histogram names
     39  TString fHistTitle;                     // Histogram titles
     40  TString fHistXTitle;                    // Histogram x-axis titles
     41  TString fHistYTitle;                    // Histogram y-axis titles
     42 
     43  TString fAbsHistName;                   // Histogram names abs.times
     44  TString fAbsHistTitle;                  // Histogram titles abs. times
     45  TString fAbsHistXTitle;                 // Histogram x-axis titles abs. times
     46  TString fAbsHistYTitle;                 // Histogram y-axis titles abs. times
    2747 
    2848  MCalibrationChargePINDiode *fPINDiode;  //! Storage container of the results
     
    80100  void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit     ) { fTimeUpperLimit = f;     }
    81101
     102  void SetAbsHistName  ( const char *name )  { fAbsHistName  = name;  }
     103  void SetAbsHistTitle ( const char *name )  { fAbsHistTitle = name;  }
     104  void SetAbsHistXTitle( const char *name )  { fAbsHistXTitle = name; }
     105  void SetAbsHistYTitle( const char *name )  { fAbsHistYTitle = name; }
     106   
     107  void SetHistName  ( const char *name )  { fHistName  = name;  }
     108  void SetHistTitle ( const char *name )  { fHistTitle = name;  }
     109  void SetHistXTitle( const char *name )  { fHistXTitle = name; }
     110  void SetHistYTitle( const char *name )  { fHistYTitle = name; }
     111   
    82112  ClassDef(MHCalibrationChargePINDiode, 1)  // Histogram class for Charge PIN Diode Calibration
    83113};
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePix.cc

    r4938 r4950  
    5050using namespace std;
    5151
    52 const Int_t   MHCalibrationChargePix::fgChargeNbins     = 2000;
    53 const Axis_t  MHCalibrationChargePix::fgChargeFirst     = -0.5;
    54 const Axis_t  MHCalibrationChargePix::fgChargeLast      = 1999.5;
    55 const Int_t   MHCalibrationChargePix::fgAbsTimeNbins    = 15;
    56 const Axis_t  MHCalibrationChargePix::fgAbsTimeFirst    = -0.5;
    57 const Axis_t  MHCalibrationChargePix::fgAbsTimeLast     = 14.5;
    5852// --------------------------------------------------------------------------
    5953//
     
    6155//
    6256// Sets:
    63 // - the default number for fNbins        (fgChargeNbins)
    64 // - the default number for fFirst        (fgChargeFirst)
    65 // - the default number for fLast         (fgChargeLast)
    66 // - the default number for fAbsTimeNbins (fgAbsTimeNbins)
    67 // - the default number for fAbsTimeFirst (fgAbsTimeFirst)
    68 // - the default number for fAbsTimeLast  (fgAbsTimeLast)
    69 //
    70 // - the default name of the  fHGausHist ("HCalibrationCharge")
    71 // - the default title of the fHGausHist ("Distribution of Summed FADC slices Pixel ")
    72 // - the default x-axis title for fHGausHist ("Sum FADC Slices")
    73 // - the default y-axis title for fHGausHist ("Nr. of events")
    74 //
    75 // - the default name of the  fHAbsTime ("HAbsTimePixel")
    76 // - the default title of the fHAbsTime ("Distribution of Absolute Arrival Times Pixel ")
    7757// - the default x-axis title for fHAbsTime ("Absolute Arrival Time [FADC slice nr]")
    7858// - the default y-axis title for fHAbsTime ("Nr. of events");
     
    8767//
    8868MHCalibrationChargePix::MHCalibrationChargePix(const char *name, const char *title)
    89     : fHAbsTime()
     69    : fHAbsTime(),
     70      fAbsTimeNbins(1), fAbsTimeFirst(0.), fAbsTimeLast(1.)
    9071{
    9172 
    9273  fName  = name  ? name  : "MHCalibrationChargePix";
    9374  fTitle = title ? title : "Statistics of the FADC sums of calibration events";
    94 
    95   SetNbins ( fgChargeNbins );
    96   SetFirst ( fgChargeFirst );
    97   SetLast  ( fgChargeLast  );
    98 
    99   SetAbsTimeNbins();
    100   SetAbsTimeFirst();
    101   SetAbsTimeLast();
    102 
    103   fHGausHist.SetName("HCalibrationCharge");
    104   fHGausHist.SetTitle("Distribution of Summed FADC slices Pixel"); 
    105   fHGausHist.SetXTitle("Sum FADC Slices");
    106   fHGausHist.SetYTitle("Nr. of events");
    107 
    108   fHAbsTime.SetName("HAbsTimePixel");
    109   fHAbsTime.SetTitle("Distribution of Absolute Arrival Times Pixel "); 
    110   fHAbsTime.SetXTitle("Absolute Arrival Time [FADC slice nr]");
    111   fHAbsTime.SetYTitle("Nr. of events");
    11275
    11376  fHAbsTime.UseCurrentStyle();
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePix.h

    r4937 r4950  
    88class MHCalibrationChargePix : public MHCalibrationPix
    99{
    10 
    11 private:
    12 
    13   static const Int_t   fgChargeNbins;        // Default for fNBins          (now set to: 2000  )
    14   static const Axis_t  fgChargeFirst;        // Default for fFirst          (now set to: -0.5  )
    15   static const Axis_t  fgChargeLast;         // Default for fLast           (now set to: 1999.5)
    16   static const Int_t   fgAbsTimeNbins;       // Default for fAbsTimeNbins   (now set to: 15    )
    17   static const Axis_t  fgAbsTimeFirst;       // Default for fAbsTimeFirst   (now set to: -0.5  )
    18   static const Axis_t  fgAbsTimeLast;        // Default for fAbsTimeLast    (now set to: 14.5  )
    1910
    2011protected:
     
    3728 
    3829  // Setters
    39   virtual void SetAbsTimeNbins(const Int_t  bins =fgAbsTimeNbins)  { fAbsTimeNbins = bins;  }
    40   virtual void SetAbsTimeFirst(const Axis_t first=fgAbsTimeFirst)  { fAbsTimeFirst = first; }
    41   virtual void SetAbsTimeLast( const Axis_t last =fgAbsTimeLast)   { fAbsTimeLast  = last;  }
     30  virtual void SetAbsTimeNbins(const Int_t  bins )  { fAbsTimeNbins = bins;  }
     31  virtual void SetAbsTimeFirst(const Axis_t first)  { fAbsTimeFirst = first; }
     32  virtual void SetAbsTimeLast( const Axis_t last )   { fAbsTimeLast  = last;  }
    4233
    4334  // Getters
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestCam.cc

    r4946 r4950  
    107107using namespace std;
    108108
    109 const Int_t   MHCalibrationTestCam::fgTestNbins    = 900;
    110 const Axis_t  MHCalibrationTestCam::fgTestFirst    = -5.;
    111 const Axis_t  MHCalibrationTestCam::fgTestLast     =  5.;
     109const Int_t   MHCalibrationTestCam::fgNbins    = 900;
     110const Axis_t  MHCalibrationTestCam::fgFirst    = -5.;
     111const Axis_t  MHCalibrationTestCam::fgLast     =  5.;
     112const TString MHCalibrationTestCam::gsHistName   = "Test";
     113const TString MHCalibrationTestCam::gsHistTitle  = "Calibrated Calibration Signals"; 
     114const TString MHCalibrationTestCam::gsHistXTitle = "Nr. Photons";
     115const TString MHCalibrationTestCam::gsHistYTitle = "Nr. events";
    112116// --------------------------------------------------------------------------
    113117//
     
    115119//
    116120// Sets:
    117 // - fNbins to fgTestNbins
    118 // - fFirst to fgTestFirst
    119 // - fLast  to fgTestLast
     121// - fNbins to fgNbins
     122// - fFirst to fgFirst
     123// - fLast  to fgLast
     124//
     125// - fHistName   to gsHistName 
     126// - fHistTitle  to gsHistTitle
     127// - fHistXTitle to gsHistXTitle
     128// - fHistYTitle to gsHistYTitle
    120129//
    121130MHCalibrationTestCam::MHCalibrationTestCam(const char *name, const char *title)
     
    125134  fTitle = title ? title : "Histogram class for testing the calibration";
    126135 
    127   SetNbins(fgTestNbins);
    128   SetFirst(fgTestFirst);
    129   SetLast (fgTestLast );
     136  SetNbins(fgNbins);
     137  SetFirst(fgFirst);
     138  SetLast (fgLast );
     139
     140  SetHistName  (gsHistName  .Data());
     141  SetHistTitle (gsHistTitle .Data());
     142  SetHistXTitle(gsHistXTitle.Data());
     143  SetHistYTitle(gsHistYTitle.Data());
     144
    130145}
    131146
     
    135150// - MCerPhotEvt
    136151//
    137 // Initializes, if empty to MGeomCam::GetNumAreas() for:
    138 // - MHCalibrationCam::fAverageHiGainAreas
    139 //
    140 // Initializes, if empty to MGeomCam::GetNumSectors() for:
    141 // - MHCalibrationCam::fAverageHiGainSectors
     152// Calls:
     153// - MHCalibrationCam::InitHiGainArrays()
    142154//
    143 // Calls MHCalibrationCam::InitHists() for every entry in:
    144 // - MHCalibrationCam::fHiGainArray
    145 // - MHCalibrationCam::fAverageHiGainAreas
    146 // - MHCalibrationCam::fAverageHiGainSectors
    147 //
    148 // Sets Titles and Names for the Histograms
    149 // - MHCalibrationCam::fAverageHiGainAreas
    150 // - MHCalibrationCam::fAverageHiGainSectors
    151 //
     155// Sets:
     156// - SetLoGain(kFALSE);
     157// - fMeanMeanPhotPerArea to nareas
     158// - fRmsMeanPhotPerArea  to nareas
     159// - fMeanSigmaPhotPerArea to nareas
     160// - fRmsSigmaPhotPerArea  to nareas
     161//
    152162Bool_t MHCalibrationTestCam::ReInitHists(MParList *pList)
    153163{
     
    165175  const Int_t nareas   = fGeom->GetNumAreas();
    166176
    167   if (fHiGainArray->GetEntries()==0)
    168   {
    169       fHiGainArray->Expand(npixels);
    170       for (Int_t i=0; i<npixels; i++)
    171       {
    172           (*fHiGainArray)[i] = new MHCalibrationPix("TestPix",
    173                                                 "Test Calibration Pixel");
    174 
    175           MHCalibrationPix &pix = (*this)[i];         
    176 
    177           pix.SetNbins(fNbins);
    178           pix.SetFirst(fFirst);
    179           pix.SetLast (fLast);
    180 
    181           TH1F *h =  pix.GetHGausHist();
    182        
    183           h->SetName ("HTestPix");
    184           h->SetTitle("Calibrated Calibration Signals Pixel "); 
    185           h->SetXTitle("Nr. Photons");
    186           h->SetYTitle("Nr. of events");
    187 
    188           InitHists((*this)[i],(*fBadPixels)[i],i);
    189       }
    190   }
    191 
    192 
    193   if (fAverageHiGainAreas->GetEntries()==0)
    194   {
    195     fAverageHiGainAreas->Expand(nareas);
    196    
    197     for (Int_t j=0; j<nareas; j++)
    198       {
    199         (*fAverageHiGainAreas)[j] =
    200           new MHCalibrationPix("TestArea",
    201                            "Average Test Calibrations Area Idx ");
    202 
    203         MHCalibrationPix &pix = GetAverageHiGainArea(j);
    204 
    205         pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
    206         pix.SetFirst(fFirst);
    207         pix.SetLast (fLast);
    208        
    209         pix.InitBins();
    210         pix.SetEventFrequency(fPulserFrequency);
    211            
    212         TH1F *h =  pix.GetHGausHist();
    213 
    214         h->SetName ("HTestArea");
    215         h->SetTitle("Calibrated Calibration Signals Area Idx ");
    216         h->SetXTitle("Nr. Photons");
    217         h->SetYTitle("Nr. of events");
    218 
    219         if (fGeom->InheritsFrom("MGeomCamMagic"))
    220           h->SetTitle(Form("%s%s%s","Calibrated Calibration Signals averaged on event-by-event basis ",
    221                            j==0 ? "Inner Pixels " : "Outer Pixels Runs: "));
    222         else
    223           {
    224             pix.ChangeHistId(j);
    225             h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));
    226           }
    227       }
    228   }
    229 
    230   if (fAverageHiGainSectors->GetEntries()==0)
    231   {
    232       fAverageHiGainSectors->Expand(nsectors);
    233 
    234       for (Int_t j=0; j<nsectors; j++)
    235       {
    236           (*fAverageHiGainSectors)[j] =
    237             new MHCalibrationPix("TestSector",
    238                                  "Average Test Calibrations Sector ");
    239 
    240         MHCalibrationPix &pix = GetAverageHiGainSector(j);
    241 
    242         pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nsectors));
    243         pix.SetFirst(fFirst);
    244         pix.SetLast (fLast);
    245        
    246         TH1F *h =  pix.GetHGausHist();
    247 
    248         h->SetName ("HTestSector");
    249         h->SetTitle("Calibrated Calibration Signals Sector ");
    250         h->SetXTitle("Nr. Photons");
    251         h->SetYTitle("Nr. of events");
    252 
    253         pix.InitBins();
    254         pix.ChangeHistId(j);
    255         pix.SetEventFrequency(fPulserFrequency);
    256 
    257         h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));
    258       }
    259   }
    260 
     177  InitHiGainArrays(npixels,nareas,nsectors);
    261178
    262179  fMeanMeanPhotPerArea.Set(nareas);   
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestCam.h

    r4946 r4950  
    1818private:
    1919
    20   static const Int_t   fgTestNbins;        // Default for fNBins  (now set to: 2000  )
    21   static const Axis_t  fgTestFirst;        // Default for fFirst  (now set to: -0.5  )
    22   static const Axis_t  fgTestLast;         // Default for fLast   (now set to: 1999.5)
     20  static const Int_t   fgNbins;        // Default for fNBins  (now set to: 2000  )
     21  static const Axis_t  fgFirst;        // Default for fFirst  (now set to: -0.5  )
     22  static const Axis_t  fgLast;         // Default for fLast   (now set to: 1999.5)
    2323
     24  static const TString gsHistName;     //! Default Histogram names
     25  static const TString gsHistTitle;    //! Default Histogram titles
     26  static const TString gsHistXTitle;   //! Default Histogram x-axis titles
     27  static const TString gsHistYTitle;   //! Default Histogram y-axis titles
     28 
    2429  TArrayF fMeanMeanPhotPerArea;
    2530  TArrayF fRmsMeanPhotPerArea   ;
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestTimeCam.cc

    r4946 r4950  
    106106using namespace std;
    107107
    108 const Int_t   MHCalibrationTestTimeCam::fgTestNbins     = 600;
    109 const Axis_t  MHCalibrationTestTimeCam::fgTestFirst     = -0.5;
    110 const Axis_t  MHCalibrationTestTimeCam::fgTestLast      = 29.5;
     108const Int_t   MHCalibrationTestTimeCam::fgNbins      = 600;
     109const Axis_t  MHCalibrationTestTimeCam::fgFirst      = -0.5;
     110const Axis_t  MHCalibrationTestTimeCam::fgLast       = 29.5;
     111const TString MHCalibrationTestTimeCam::gsHistName   = "TestTime";
     112const TString MHCalibrationTestTimeCam::gsHistTitle  = "Calibrated Calibration Arrival Times"; 
     113const TString MHCalibrationTestTimeCam::gsHistXTitle = "Arrival Time [FADC slices]";
     114const TString MHCalibrationTestTimeCam::gsHistYTitle = "Nr. events";
    111115// --------------------------------------------------------------------------
    112116//
     
    114118//
    115119// Sets:
    116 // - fNbins to fgTestNbins
    117 // - fFirst to fgTestFirst
    118 // - fLast  to fgTestLast
     120// - fNbins to fgNbins
     121// - fFirst to fgFirst
     122// - fLast  to fgLast
     123//
     124// - fHistName   to gsHistName 
     125// - fHistTitle  to gsHistTitle
     126// - fHistXTitle to gsHistXTitle
     127// - fHistYTitle to gsHistYTitle
    119128//
    120129MHCalibrationTestTimeCam::MHCalibrationTestTimeCam(const char *name, const char *title)
     
    124133  fTitle = title ? title : "Histogram class for testing the calibration of arrival times";
    125134
    126   SetNbins(fgTestNbins);
    127   SetFirst(fgTestFirst);
    128   SetLast (fgTestLast );
    129 
    130 }
    131 
    132 // --------------------------------------------------------------------------
    133 //
    134 // Gets or creates the pointers to:
     135  SetNbins(fgNbins);
     136  SetFirst(fgFirst);
     137  SetLast (fgLast );
     138
     139  SetHistName  (gsHistName  .Data());
     140  SetHistTitle (gsHistTitle .Data());
     141  SetHistXTitle(gsHistXTitle.Data());
     142  SetHistYTitle(gsHistYTitle.Data());
     143
     144}
     145
     146// --------------------------------------------------------------------------
    135147//
    136148// Searches pointer to:
    137149// - MArrivalTime
    138150//
    139 // Initializes, if empty to MGeomCam::GetNumAreas() for:
    140 // - MHCalibrationCam::fAverageHiGainAreas
    141 //
    142 // Initializes, if empty to MGeomCam::GetNumSectors() for:
    143 // - MHCalibrationCam::fAverageHiGainSectors
     151// Calls:
     152// - MHCalibrationCam::InitHiGainArrays()
    144153//
    145 // Calls MHCalibrationCam::InitHists() for every entry in:
    146 // - MHCalibrationCam::fHiGainArray
    147 // - MHCalibrationCam::fAverageHiGainAreas
    148 // - MHCalibrationCam::fAverageHiGainSectors
    149 //
    150 // Sets Titles and Names for the Histograms
    151 // - MHCalibrationCam::fAverageHiGainAreas
    152 // - MHCalibrationCam::fAverageHiGainSectors
    153 //
    154 // Sets number of bins to MHCalibrationCam::fAverageNbins for:
    155 // - MHCalibrationCam::fAverageHiGainAreas
    156 // - MHCalibrationCam::fAverageHiGainSectors
     154// Sets:
     155// - SetLoGain(kFALSE);
    157156//
    158157Bool_t MHCalibrationTestTimeCam::ReInitHists(MParList *pList)
     
    170169  const Int_t nareas   = fGeom->GetNumAreas();
    171170
    172   if (fHiGainArray->GetEntries()==0)
    173   {
    174       fHiGainArray->Expand(npixels);
    175       for (Int_t i=0; i<npixels; i++)
    176       {
    177           (*fHiGainArray)[i] = new MHCalibrationPix("TestTimePix",
    178                                                 "TestTime Calibration Pixel");
    179           MHCalibrationPix &pix = (*this)[i];         
    180 
    181           pix.SetNbins(fNbins);
    182           pix.SetFirst(fFirst);
    183           pix.SetLast (fLast);
    184 
    185           TH1F *h =  pix.GetHGausHist();
    186        
    187           h->SetName ("HTestHiGainPix");
    188           h->SetTitle("Calibrated Rel. Arrival Times Pixel "); 
    189           h->SetXTitle("Arrival Time [FADC slices]");
    190           h->SetYTitle("Nr. of events");
    191 
    192           InitHists((*this)[i],(*fBadPixels)[i],i);
    193       }
    194   }
    195 
    196   if (fAverageHiGainAreas->GetEntries()==0)
    197   {
    198     fAverageHiGainAreas->Expand(nareas);
    199    
    200     for (Int_t j=0; j<nareas; j++)
    201       {
    202         (*fAverageHiGainAreas)[j] =
    203           new MHCalibrationPix("TestTimeArea",
    204                            "Average TestTime Calibrations Area Idx ");
    205 
    206         MHCalibrationPix &pix = GetAverageHiGainArea(j);
    207 
    208         pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));
    209         pix.SetFirst(fFirst);
    210         pix.SetLast (fLast);
    211        
    212         pix.InitBins();
    213         pix.SetEventFrequency(fPulserFrequency);
    214            
    215         TH1F *h =  pix.GetHGausHist();
    216 
    217         h->SetName ("HTestTimeArea");
    218         h->SetTitle("Calibrated Rel. Arrival Times Area Idx ");
    219         h->SetXTitle("Arrival Time [FADC slices]");
    220         h->SetYTitle("Nr. of events");
    221 
    222         if (fGeom->InheritsFrom("MGeomCamMagic"))
    223           h->SetTitle(Form("%s%s%s","Calibrated Rel. Times averaged on event-by-event basis ",
    224                            j==0 ? "Inner Pixels " : "Outer Pixels Runs: "));
    225         else
    226           {
    227             pix.ChangeHistId(j);
    228             h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));
    229           }
    230       }
    231   }
    232 
    233 
    234   if (fAverageHiGainSectors->GetEntries()==0)
    235   {
    236       fAverageHiGainSectors->Expand(nsectors);
    237 
    238       for (Int_t j=0; j<nsectors; j++)
    239       {
    240           (*fAverageHiGainSectors)[j] =
    241             new MHCalibrationPix("TestTimeSector",
    242                              "Average TestTime Calibrations Sector ");
    243 
    244         MHCalibrationPix &pix = GetAverageHiGainSector(j);
    245 
    246         pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nsectors));
    247         pix.SetFirst(fFirst);
    248         pix.SetLast (fLast);
    249        
    250         TH1F *h =  pix.GetHGausHist();
    251 
    252         h->SetName ("HTestTimeSector");
    253         h->SetTitle("Calibrated Rel. Arr. Times Sector ");
    254         h->SetXTitle("Arrival Time [FADC slices]");
    255         h->SetYTitle("Nr. of events");
    256 
    257         pix.InitBins();
    258         pix.ChangeHistId(j);
    259         pix.SetEventFrequency(fPulserFrequency);
    260 
    261         h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));
    262       }
    263   }
     171  InitHiGainArrays(npixels,nareas,nsectors);
    264172
    265173  SetLoGain(kFALSE);
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestTimeCam.h

    r4946 r4950  
    1111private:
    1212
    13   static const Int_t   fgTestNbins;        // Default for fTestNBins  (now set to: 600  )
    14   static const Axis_t  fgTestFirst;        // Default for fTestFirst  (now set to: -0.5 )
    15   static const Axis_t  fgTestLast;         // Default for fTestLast   (now set to: 29.5)
     13  static const Int_t   fgNbins;        // Default for fNBins  (now set to: 600  )
     14  static const Axis_t  fgFirst;        // Default for fFirst  (now set to: -0.5 )
     15  static const Axis_t  fgLast;         // Default for fLast   (now set to: 29.5 )
    1616
     17  static const TString gsHistName;     //! Default Histogram names
     18  static const TString gsHistTitle;    //! Default Histogram titles
     19  static const TString gsHistXTitle;   //! Default Histogram x-axis titles
     20  static const TString gsHistYTitle;   //! Default Histogram y-axis titles
     21 
    1722  Bool_t ReInitHists(MParList *pList);
    1823  Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
Note: See TracChangeset for help on using the changeset viewer.