Changeset 2370


Ignore:
Timestamp:
10/01/03 14:45:34 (21 years ago)
Author:
galante
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2367 r2370  
    11                                                 -*-*- END OF LINE -*-*-
     2
     3 
     4  2003/10/01: Nicola Galante
     5
     6   * mhistmc/MHMcTriggerLvl2.[h,cc]:
     7     - in method MHMcTriggerLvl2::Fill added filling of 2D histograms
     8       of fLutPseudoSize vs. energy and of fSizeBiggerCell vs. energy
     9     - modified method MHMcTriggerLvl2::GetHistByName which now
     10       can return any histogram (data member) of the class
     11       MHMcTriggerLvl2 (now it returns a (TObject *) not a (TH1F *))
     12     - Updated option list of the methid MHMcTriggerLvl2::DrawClone
     13
     14   * macros/triglvl2.C:
     15     - Updated according with changes in class MHMcTriggerLvl2
     16
    217
    318
  • trunk/MagicSoft/Mars/macros/triglvl2.C

    r2365 r2370  
    181181    parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lps");
    182182    parlist.FindObject("MHMcTriggerLvl2")->DrawClone();
    183     parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy");
     183    //parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy");
     184    parlist.FindObject("MHMcTriggerLvl2")->DrawClone("size-energy");
    184185
    185186    // Returns histogram of the class MHMcTriggerLvl2 
    186187
    187188    MHMcTriggerLvl2 *htrig = (MHMcTriggerLvl2 *)parlist.FindObject("MHMcTriggerLvl2");
    188     TH1F *h1 = htrig->GetHistByName("fHistPseudoSize");
    189     TH2D *h2 = htrig->GetHistPseudoSizeEnergy();
    190 
    191     // h2->DrawClone();
     189    TH1F *h1 = (TH1F *)htrig->GetHistByName("fHistPseudoSize");
     190    TH2D *h2 = htrig->GetHistSizeBiggerCellEnergy();
     191    TH2D *h3 = (TH2D *)htrig->GetHistByName("fHistLutPseudoSizeEnergy");
     192    //csbce = new TCanvas();
     193    //h2->DrawClone();
    192194
    193195    hfile = new TFile("HistFileLUT.root", "RECREATE");
    194196    h1->Write();
    195197    h2->Write();
     198    h3->Write();
    196199    hfile->Close();
    197200
  • trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc

    r2365 r2370  
    6161Int_t MHMcTriggerLvl2::fColorPs = 1;
    6262Int_t MHMcTriggerLvl2::fColorPsE = 1;
     63Int_t MHMcTriggerLvl2::fColorLPsE = 1;
     64Int_t MHMcTriggerLvl2::fColorSBCE = 1;
     65
    6366
    6467ClassImp(MHMcTriggerLvl2);
     
    106109
    107110    fHistPseudoSizeEnergy = new TH2D("fHistPseudoSizeEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397);
     111    fHistLutPseudoSizeEnergy = new TH2D("fHistLutPseudoSizeEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397);
     112    fHistSizeBiggerCellEnergy = new TH2D("fHistSizeBiggerCellEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397);
    108113 
    109114    fHistPseudoSizeEnergy->SetName("fHistPseudoSizeEnergy");
     
    112117    fHistPseudoSizeEnergy->SetYTitle("PseudoSize");
    113118
     119    fHistLutPseudoSizeEnergy->SetName("fHistLutPseudoSizeEnergy");
     120    fHistLutPseudoSizeEnergy->SetTitle("LutPseudoSize vs. Energy");
     121    fHistLutPseudoSizeEnergy->SetXTitle("Log(E[GeV])");
     122    fHistLutPseudoSizeEnergy->SetYTitle("LutPseudoSize");
     123
     124    fHistSizeBiggerCellEnergy->SetName("fHistSizeBiggerCellEnergy");
     125    fHistSizeBiggerCellEnergy->SetTitle("Size Bigger Cell vs. Energy");
     126    fHistSizeBiggerCellEnergy->SetXTitle("Log(E[GeV])");
     127    fHistSizeBiggerCellEnergy->SetYTitle("Size Bigger Cell");
     128
     129               
     130
     131               
    114132    fFNorm = new TF1("FNorm", "1", -1, 397);
    115133}
     
    128146    delete fHistSizeBiggerCellNorm;
    129147    delete fHistPseudoSizeEnergy;
    130 
     148    delete fHistLutPseudoSizeEnergy;
     149    delete fHistSizeBiggerCellEnergy;
    131150    delete fFNorm;
    132151}
     
    145164  fHistPseudoSize->Fill(h.GetPseudoSize());
    146165  fHistSizeBiggerCell->Fill(h.GetSizeBiggerCell());
    147   //fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetPseudoSize());
    148   fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetLutPseudoSize());
     166  fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetPseudoSize());
     167  fHistLutPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetLutPseudoSize());
     168  fHistSizeBiggerCellEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetSizeBiggerCell());
    149169
    150170  return kTRUE;
     
    221241//      "sbc" for the fSizeBiggerCell histogram;
    222242//      "ps" for the fPseudoSize histogram;
     243//      "lut-energy" for the fLutPseudoSize vs. energy 2D histogram
     244//      "size-energy" for the fPseudoSize vs. energy 2D histogram
     245//      "big-energy" for the fSizeBiggerCell vs. energy 2D histogram
     246//     
    223247//      default: "ps"
    224248//
     
    233257        !str.Contains("sbc", TString::kIgnoreCase) &&
    234258        !str.Contains("ps",  TString::kIgnoreCase) &&
    235         !str.Contains("energy",  TString::kIgnoreCase))
     259        !str.Contains("lut-energy",  TString::kIgnoreCase) &&
     260        !str.Contains("size-energy",  TString::kIgnoreCase) &&
     261        !str.Contains("big-energy",  TString::kIgnoreCase))
    236262    {
    237         *fLog << "ARGH!@! Possible options are \"lps\", \"sbc\", \"ps\" or NULL!" <<endl;
     263        *fLog << "ARGH!@! Possible options are \"lps\", \"sbc\", \"ps\", \"lut-energy\", \"size-energy\", \"big-energy\" or NULL!" <<endl;
    238264        return NULL;
    239265    }
     
    254280    }
    255281
    256     if (str.Contains("energy",TString::kIgnoreCase))
     282    if (str.Contains("size-energy",TString::kIgnoreCase))
    257283      return Draw2DHist(*fHistPseudoSizeEnergy, "CanvasPSE", fColorPsE);
     284
     285    if (str.Contains("lut-energy",TString::kIgnoreCase))
     286      return Draw2DHist(*fHistLutPseudoSizeEnergy, "CanvasLPSE", fColorLPsE);
     287
     288    if (str.Contains("big-energy",TString::kIgnoreCase))
     289      return Draw2DHist(*fHistSizeBiggerCellEnergy, "CanvasSBCE", fColorSBCE);
     290   
    258291
    259292    return NULL;
     
    293326// --------------------------------------------------------------------------
    294327//
    295 //  Return the histogram by its name
    296 //
    297 TH1 *MHMcTriggerLvl2::GetHistByName(const TString name)
     328//  Return the histogram by its name. This method returns a (TObject *)
     329//  so remember to cast the returned object if you want to work with it.
     330//
     331TObject *MHMcTriggerLvl2::GetHistByName(const TString name) const
    298332{
    299333    if (name.Contains("fHistLutPseudoSize", TString::kIgnoreCase))
     
    311345        return fHistPseudoSizeNorm;
    312346
     347    if (name.Contains("fHistLutPseudoSizeEnergy", TString::kIgnoreCase))
     348        return fHistLutPseudoSizeEnergy;
     349    if (name.Contains("fHistSizeBiggerCellEnergy", TString::kIgnoreCase))
     350        return fHistSizeBiggerCellEnergy;
     351    if (name.Contains("fHistPseudoSizeEnergy", TString::kIgnoreCase))
     352        return fHistPseudoSizeEnergy;
     353           
    313354    return NULL;
    314355}
  • trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.h

    r2365 r2370  
    2121    TH1F *fHistSizeBiggerCell;       // Histogram of fSizeBiggerCell
    2222    TH1F *fHistSizeBiggerCellNorm;   // Histogram of fSizeBiggerCell normalized on integral of distribution
    23     TH2D *fHistPseudoSizeEnergy;           // 2D-Histogram of fPseudoSize vs. Energy
     23    TH2D *fHistPseudoSizeEnergy;     // 2D-Histogram of fPseudoSize vs. Energy
     24    TH2D *fHistLutPseudoSizeEnergy;  // 2D-Histogram of fLutPseudoSize vs. Energy
     25    TH2D *fHistSizeBiggerCellEnergy; // 2D-Histogram of fSizeBiggerCell vs. Energy
    2426    TF1* fFNorm;                     // Function used to normalize histograms
    2527
     
    2830    static Int_t fColorPs;
    2931    static Int_t fColorPsE;
     32    static Int_t fColorLPsE;
     33    static Int_t fColorSBCE;
     34   
    3035
    3136    TObject *DrawHist(TH1 &hist, TH1 &histNorm, const TString &canvasname, Int_t &colore) const;
     
    3742
    3843    Bool_t Fill(const MParContainer *par, const Stat_t w=1);
    39     //    Bool_t Fill(const Double_t energy, const MParContainer *par, const Stat_t w=1);
    40     TH1 *GetHistByName(const TString name);
     44
     45    TObject *GetHistByName(const TString name) const;
    4146
    4247    TH1F *GetHistLutPseudoSize() const { return fHistLutPseudoSize; }
     
    4651    TH1F *GetHistSizeBiggerCell()  const { return fHistSizeBiggerCell; }
    4752    TH1F *GetHistSizeBiggerCellNorm()  const { return fHistSizeBiggerCellNorm; }
     53    TH2D *GetHistLutPseudoSizeEnergy() const { return fHistLutPseudoSizeEnergy; }
    4854    TH2D *GetHistPseudoSizeEnergy() const { return fHistPseudoSizeEnergy; }
     55    TH2D *GetHistSizeBiggerCellEnergy() const { return fHistSizeBiggerCellEnergy; }
     56   
    4957
    5058    void Draw(Option_t *opt=NULL);
Note: See TracChangeset for help on using the changeset viewer.