Changeset 2370
- Timestamp:
- 10/01/03 14:45:34 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2367 r2370 1 1 -*-*- 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 2 17 3 18 -
trunk/MagicSoft/Mars/macros/triglvl2.C
r2365 r2370 181 181 parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lps"); 182 182 parlist.FindObject("MHMcTriggerLvl2")->DrawClone(); 183 parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy"); 183 //parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy"); 184 parlist.FindObject("MHMcTriggerLvl2")->DrawClone("size-energy"); 184 185 185 186 // Returns histogram of the class MHMcTriggerLvl2 186 187 187 188 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(); 192 194 193 195 hfile = new TFile("HistFileLUT.root", "RECREATE"); 194 196 h1->Write(); 195 197 h2->Write(); 198 h3->Write(); 196 199 hfile->Close(); 197 200 -
trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc
r2365 r2370 61 61 Int_t MHMcTriggerLvl2::fColorPs = 1; 62 62 Int_t MHMcTriggerLvl2::fColorPsE = 1; 63 Int_t MHMcTriggerLvl2::fColorLPsE = 1; 64 Int_t MHMcTriggerLvl2::fColorSBCE = 1; 65 63 66 64 67 ClassImp(MHMcTriggerLvl2); … … 106 109 107 110 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); 108 113 109 114 fHistPseudoSizeEnergy->SetName("fHistPseudoSizeEnergy"); … … 112 117 fHistPseudoSizeEnergy->SetYTitle("PseudoSize"); 113 118 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 114 132 fFNorm = new TF1("FNorm", "1", -1, 397); 115 133 } … … 128 146 delete fHistSizeBiggerCellNorm; 129 147 delete fHistPseudoSizeEnergy; 130 148 delete fHistLutPseudoSizeEnergy; 149 delete fHistSizeBiggerCellEnergy; 131 150 delete fFNorm; 132 151 } … … 145 164 fHistPseudoSize->Fill(h.GetPseudoSize()); 146 165 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()); 149 169 150 170 return kTRUE; … … 221 241 // "sbc" for the fSizeBiggerCell histogram; 222 242 // "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 // 223 247 // default: "ps" 224 248 // … … 233 257 !str.Contains("sbc", TString::kIgnoreCase) && 234 258 !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)) 236 262 { 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; 238 264 return NULL; 239 265 } … … 254 280 } 255 281 256 if (str.Contains(" energy",TString::kIgnoreCase))282 if (str.Contains("size-energy",TString::kIgnoreCase)) 257 283 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 258 291 259 292 return NULL; … … 293 326 // -------------------------------------------------------------------------- 294 327 // 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 // 331 TObject *MHMcTriggerLvl2::GetHistByName(const TString name) const 298 332 { 299 333 if (name.Contains("fHistLutPseudoSize", TString::kIgnoreCase)) … … 311 345 return fHistPseudoSizeNorm; 312 346 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 313 354 return NULL; 314 355 } -
trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.h
r2365 r2370 21 21 TH1F *fHistSizeBiggerCell; // Histogram of fSizeBiggerCell 22 22 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 24 26 TF1* fFNorm; // Function used to normalize histograms 25 27 … … 28 30 static Int_t fColorPs; 29 31 static Int_t fColorPsE; 32 static Int_t fColorLPsE; 33 static Int_t fColorSBCE; 34 30 35 31 36 TObject *DrawHist(TH1 &hist, TH1 &histNorm, const TString &canvasname, Int_t &colore) const; … … 37 42 38 43 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 T H1 *GetHistByName(const TString name);44 45 TObject *GetHistByName(const TString name) const; 41 46 42 47 TH1F *GetHistLutPseudoSize() const { return fHistLutPseudoSize; } … … 46 51 TH1F *GetHistSizeBiggerCell() const { return fHistSizeBiggerCell; } 47 52 TH1F *GetHistSizeBiggerCellNorm() const { return fHistSizeBiggerCellNorm; } 53 TH2D *GetHistLutPseudoSizeEnergy() const { return fHistLutPseudoSizeEnergy; } 48 54 TH2D *GetHistPseudoSizeEnergy() const { return fHistPseudoSizeEnergy; } 55 TH2D *GetHistSizeBiggerCellEnergy() const { return fHistSizeBiggerCellEnergy; } 56 49 57 50 58 void Draw(Option_t *opt=NULL);
Note:
See TracChangeset
for help on using the changeset viewer.