Changeset 2953


Ignore:
Timestamp:
01/29/04 15:14:17 (21 years ago)
Author:
galante
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2951 r2953  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6 2004/01/29: Nicola Galante
     7
     8   * mhistmc/MHMcTriggerLvl2.[h,cc]:
     9     - In method MHMcTriggerLvl2::GetHistByName(const TString name) added
     10       string checking to return also fHistCellPseudoSize, fHistCellPseudoSizeNorm
     11       and fHistCellPseudoSizeEnergy.
     12     - Added inline functions GetHistCellPseudoSize() and
     13       GetHistCellPseudoSizeNorm().
     14
     15
    616 2004/01/28: Javier Rico
    717
  • trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc

    r2509 r2953  
    5858
    5959Int_t MHMcTriggerLvl2::fColorLps = 1;
     60Int_t MHMcTriggerLvl2::fColorCps = 1;
    6061Int_t MHMcTriggerLvl2::fColorSbc = 1;
    6162Int_t MHMcTriggerLvl2::fColorPs = 1;
    6263Int_t MHMcTriggerLvl2::fColorPsE = 1;
     64Int_t MHMcTriggerLvl2::fColorCPsE = 1;
    6365Int_t MHMcTriggerLvl2::fColorLPsE = 1;
    6466Int_t MHMcTriggerLvl2::fColorSBCE = 1;
     
    7981    fTitle = title ? title : "Trigger L2 image parameters";
    8082
    81     fHistLutPseudoSize  = new TH1F("fHistLutPseudoSize",  "number of compact pixels in one lut",                13,   0, 13);
    82     fHistPseudoSize     = new TH1F("fHistPseudoSize",   "Multiplicity of the cluster identified by the L2T",    397,   0, 397);
    83     fHistSizeBiggerCell  = new TH1F("fHistSizeBiggerCell",   "Number of fired pixel in bigger cell",            37,   0, 37);
    84 
    85     fHistLutPseudoSizeNorm  = new TH1F("fHistLutPseudoSizeNorm",  "Normalized Number of compact pixels in one lut",                13,   0, 13);
    86     fHistPseudoSizeNorm     = new TH1F("fHistPseudoSizeNorm",   "Normalized Multiplicity of the cluster identified by the L2T",    397,   0, 397);
    87     fHistSizeBiggerCellNorm  = new TH1F("fHistSizeBiggerCellNorm",   "Normalized Number of fired pixel in bigger cell",            37,   0, 37);
     83    fHistLutPseudoSize = new TH1F("fHistLutPseudoSize",  "Lut Pseudo Size",                13,   0, 13);
     84    fHistPseudoSize = new TH1F("fHistPseudoSize",   "Pseudo Size",    397,   0, 397);
     85    fHistCellPseudoSize = new TH1F("fHistCellPseudoSize",   "Cell Pseudo Size",    37,   0, 37);
     86    fHistSizeBiggerCell = new TH1F("fHistSizeBiggerCell",   "Size in Bigger Cell",            37,   0, 37);
     87
     88    fHistLutPseudoSizeNorm = new TH1F("fHistLutPseudoSizeNorm",  "Normalized Lut Pseudo Size",                13,   0, 13);
     89    fHistPseudoSizeNorm = new TH1F("fHistPseudoSizeNorm",   "Normalized Pseudo Size",    397,   0, 397);
     90    fHistSizeBiggerCellNorm = new TH1F("fHistSizeBiggerCellNorm",   "Normalized Size in Bigger Cell",            37,   0, 37);
     91    fHistCellPseudoSizeNorm = new TH1F("fHistCellPseudoSizeNorm",   "Normalized Cell Pseudo Size",    37,   0, 37);
    8892
    8993    fHistLutPseudoSize->SetDirectory(NULL);
     
    9397    fHistSizeBiggerCell->SetDirectory(NULL);
    9498    fHistSizeBiggerCellNorm->SetDirectory(NULL);
     99    fHistCellPseudoSize->SetDirectory(NULL);
     100    fHistCellPseudoSizeNorm->SetDirectory(NULL);
    95101
    96102    fHistLutPseudoSize->SetXTitle("Number of Pixels");
     
    100106    fHistSizeBiggerCell->SetXTitle("Number of Pixels");
    101107    fHistSizeBiggerCellNorm->SetXTitle("Number of Pixels");
     108    fHistCellPseudoSize->SetXTitle("Number of Pixels");
     109    fHistCellPseudoSizeNorm->SetXTitle("Number of Pixels");
    102110
    103111    fHistLutPseudoSize->SetYTitle("Counts");
     
    107115    fHistSizeBiggerCell->SetYTitle("Counts");
    108116    fHistSizeBiggerCellNorm->SetYTitle("Counts/Total Counts");
     117    fHistCellPseudoSize->SetYTitle("Counts");
     118    fHistCellPseudoSizeNorm->SetYTitle("Counts/Total Counts");
    109119
    110120    fHistPseudoSizeEnergy = new TH2D("fHistPseudoSizeEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397);
     121    fHistCellPseudoSizeEnergy = new TH2D("fHistCellPseudoSizeEnergy","CPS Size vs Energy", 40, 1, 5, 397, 0,397);
    111122    fHistLutPseudoSizeEnergy = new TH2D("fHistLutPseudoSizeEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397);
    112123    fHistSizeBiggerCellEnergy = new TH2D("fHistSizeBiggerCellEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397);
     
    117128    fHistPseudoSizeEnergy->SetYTitle("PseudoSize");
    118129
     130    fHistCellPseudoSizeEnergy->SetName("fHistCellPseudoSizeEnergy");
     131    fHistCellPseudoSizeEnergy->SetTitle("CellPseudoSize vs. Energy");
     132    fHistCellPseudoSizeEnergy->SetXTitle("Log(E[GeV])");
     133    fHistCellPseudoSizeEnergy->SetYTitle("CellPseudoSize");
     134
    119135    fHistLutPseudoSizeEnergy->SetName("fHistLutPseudoSizeEnergy");
    120136    fHistLutPseudoSizeEnergy->SetTitle("LutPseudoSize vs. Energy");
     
    141157    delete fHistLutPseudoSize;
    142158    delete fHistPseudoSize;
     159    delete fHistCellPseudoSize;
    143160    delete fHistSizeBiggerCell;
    144161    delete fHistLutPseudoSizeNorm;
    145162    delete fHistPseudoSizeNorm;
     163    delete fHistCellPseudoSizeNorm;
    146164    delete fHistSizeBiggerCellNorm;
    147165    delete fHistPseudoSizeEnergy;
     166    delete fHistCellPseudoSizeEnergy;
    148167    delete fHistLutPseudoSizeEnergy;
    149168    delete fHistSizeBiggerCellEnergy;
     
    163182  fHistLutPseudoSize->Fill(h.GetLutPseudoSize());
    164183  fHistPseudoSize->Fill(h.GetPseudoSize());
     184  fHistCellPseudoSize->Fill(h.GetCellPseudoSize());
    165185  fHistSizeBiggerCell->Fill(h.GetSizeBiggerCell());
    166186  fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetPseudoSize());
     187  fHistCellPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetCellPseudoSize());
    167188  fHistLutPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetLutPseudoSize());
    168189  fHistSizeBiggerCellEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetSizeBiggerCell());
     
    255276
    256277    if (!str.Contains("lps", TString::kIgnoreCase) &&
     278        !str.Contains("cps", TString::kIgnoreCase) &&
    257279        !str.Contains("sbc", TString::kIgnoreCase) &&
    258280        !str.Contains("ps",  TString::kIgnoreCase) &&
    259281        !str.Contains("lut-energy",  TString::kIgnoreCase) &&
    260282        !str.Contains("size-energy",  TString::kIgnoreCase) &&
     283        !str.Contains("cellsize-energy",  TString::kIgnoreCase) &&
    261284        !str.Contains("big-energy",  TString::kIgnoreCase))
    262285    {
    263         *fLog << "ARGH!@! Possible options are \"lps\", \"sbc\", \"ps\", \"lut-energy\", \"size-energy\", \"big-energy\" or NULL!" <<endl;
     286        *fLog << "ARGH!@! Possible options are \"lps\", \"cps\", \"sbc\", \"ps\", \"lut-energy\", \"size-energy\", \"cellsize-energy\", \"big-energy\" or NULL!" <<endl;
    264287        return NULL;
    265288    }
    266289
    267290    if (str.Contains("lps",TString::kIgnoreCase)){
    268       TH1 *hist=NormalizeHist(fHistLutPseudoSizeNorm, fHistLutPseudoSize);
     291      TH1 *hist=NormalizeHist(*fHistLutPseudoSizeNorm, fHistLutPseudoSize);
    269292      return DrawHist(*fHistLutPseudoSize, *hist, "CanvasLPS", fColorLps);
    270293    }
    271294
     295    if (str.Contains("cps",TString::kIgnoreCase)){
     296      TH1 *hist=NormalizeHist(*fHistCellPseudoSizeNorm, fHistCellPseudoSize);
     297      return DrawHist(*fHistCellPseudoSize, *hist, "CanvasCPS", fColorCps);
     298    }
     299
    272300    if (str.Contains("sbc",TString::kIgnoreCase)){
    273       TH1 *hist=NormalizeHist(fHistSizeBiggerCellNorm, fHistSizeBiggerCell);
     301      TH1 *hist=NormalizeHist(*fHistSizeBiggerCellNorm, fHistSizeBiggerCell);
    274302      return DrawHist(*fHistSizeBiggerCell, *hist, "CanvasSBC", fColorSbc);
    275303    }
    276304
    277305    if (str.Contains("ps",TString::kIgnoreCase)){
    278       TH1 *hist=NormalizeHist(fHistPseudoSizeNorm, fHistPseudoSize);
     306      TH1 *hist=NormalizeHist(*fHistPseudoSizeNorm, fHistPseudoSize);
    279307      return DrawHist(*fHistPseudoSize, *hist, "CanvasPS", fColorPs);
    280308    }
     
    282310    if (str.Contains("size-energy",TString::kIgnoreCase))
    283311      return Draw2DHist(*fHistPseudoSizeEnergy, "CanvasPSE", fColorPsE);
     312
     313    if (str.Contains("cellsize-energy",TString::kIgnoreCase))
     314      return Draw2DHist(*fHistCellPseudoSizeEnergy, "CanvasCPSE", fColorCPsE);
    284315
    285316    if (str.Contains("lut-energy",TString::kIgnoreCase))
     
    338369    if (name.Contains("fHistPseudoSizeEnergy", TString::kIgnoreCase))
    339370        return fHistPseudoSizeEnergy;
    340 
     371    if (name.Contains("fHistCellPseudoSizeEnergy", TString::kIgnoreCase))
     372        return fHistCellPseudoSizeEnergy;
     373
     374    if (name.Contains("fHistLutPseudoSizeNorm", TString::kIgnoreCase))
     375      return fHistLutPseudoSizeNorm;
     376    if (name.Contains("fHistSizeBiggerCellNorm", TString::kIgnoreCase))
     377        return fHistSizeBiggerCellNorm;
     378    if (name.Contains("fHistPseudoSizeNorm", TString::kIgnoreCase))
     379        return fHistPseudoSizeNorm;
     380    if (name.Contains("fHistCellPseudoSizeNorm", TString::kIgnoreCase))
     381        return fHistCellPseudoSizeNorm;
     382           
    341383    if (name.Contains("fHistLutPseudoSize", TString::kIgnoreCase))
    342384      return fHistLutPseudoSize;
     
    345387    if (name.Contains("fHistPseudoSize", TString::kIgnoreCase))
    346388        return fHistPseudoSize;
    347 
    348     if (name.Contains("fHistLutPseudoSizeNorm", TString::kIgnoreCase))
    349       return fHistLutPseudoSizeNorm;
    350     if (name.Contains("fHistSizeBiggerCellNorm", TString::kIgnoreCase))
    351         return fHistSizeBiggerCellNorm;
    352     if (name.Contains("fHistPseudoSizeNorm", TString::kIgnoreCase))
    353         return fHistPseudoSizeNorm;
    354            
     389    if (name.Contains("fHistCellPseudoSize", TString::kIgnoreCase))
     390        return fHistCellPseudoSize;
     391
     392   
    355393    return NULL;
    356394}
     
    365403// the copy (histNorm) on its integral. It returns histNorm.
    366404//
    367 TH1 *MHMcTriggerLvl2::NormalizeHist(TH1 *histNorm, TH1 *hist) const
    368 {
    369   if (histNorm == hist){
     405TH1 *MHMcTriggerLvl2::NormalizeHist(TH1 &histNorm, TH1 *hist) const
     406{
     407  if (&histNorm == hist){
    370408    *fLog << "ARGH!@! You cannot pass the same histogram into each argument!" << endl;
    371409    return NULL;
     
    377415  }
    378416 
    379   histNorm->Reset("ICE");
    380   histNorm->Add(hist, 1);
    381   histNorm->Divide(fFNorm, (Double_t)(hist->Integral()));
    382 
    383   return histNorm;
    384 }
     417  histNorm.Reset("ICE");
     418  histNorm.Add(hist, 1);
     419  histNorm.Divide(fFNorm, (Double_t)(hist->Integral()));
     420
     421  return &histNorm;
     422}
  • trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.h

    r2509 r2953  
    1919    TH1F *fHistPseudoSize;           // Histogram of fPseudoSize
    2020    TH1F *fHistPseudoSizeNorm;       // Histogram of fPseudoSize normalized on integral of distribution
     21    TH1F *fHistCellPseudoSize;           // Histogram of fCellPseudoSize
     22    TH1F *fHistCellPseudoSizeNorm;       // Histogram of fCellPseudoSize normalized on integral of distribution
    2123    TH1F *fHistSizeBiggerCell;       // Histogram of fSizeBiggerCell
    2224    TH1F *fHistSizeBiggerCellNorm;   // Histogram of fSizeBiggerCell normalized on integral of distribution
    2325    TH2D *fHistPseudoSizeEnergy;     // 2D-Histogram of fPseudoSize vs. Energy
    2426    TH2D *fHistLutPseudoSizeEnergy;  // 2D-Histogram of fLutPseudoSize vs. Energy
     27    TH2D *fHistCellPseudoSizeEnergy;  // 2D-Histogram of fCellPseudoSize vs. Energy
    2528    TH2D *fHistSizeBiggerCellEnergy; // 2D-Histogram of fSizeBiggerCell vs. Energy
    2629    TF1* fFNorm;                     // Function used to normalize histograms
     
    2932    static Int_t fColorSbc;
    3033    static Int_t fColorPs;
     34    static Int_t fColorCps;
    3135    static Int_t fColorPsE;
    3236    static Int_t fColorLPsE;
     37    static Int_t fColorCPsE;
    3338    static Int_t fColorSBCE;
    3439   
     
    4954    TH1F *GetHistPseudoSize()  const { return fHistPseudoSize; }
    5055    TH1F *GetHistPseudoSizeNorm()  const { return fHistPseudoSizeNorm; }
     56    TH1F *GetHistCellPseudoSize()  const { return fHistCellPseudoSize; }
     57    TH1F *GetHistCellPseudoSizeNorm()  const { return fHistCellPseudoSizeNorm; }
    5158    TH1F *GetHistSizeBiggerCell()  const { return fHistSizeBiggerCell; }
    5259    TH1F *GetHistSizeBiggerCellNorm()  const { return fHistSizeBiggerCellNorm; }
     
    5966    TObject *DrawClone(Option_t *opt=NULL) const;
    6067
    61     TH1 *NormalizeHist(TH1 *histNorm, TH1 *hist) const;
     68    TH1 *NormalizeHist(TH1 &histNorm, TH1 *hist) const;
    6269
    6370    ClassDef(MHMcTriggerLvl2, 1) // Container which holds histograms for the Trigger Level2 image parameters
Note: See TracChangeset for help on using the changeset viewer.