Changeset 2953
- Timestamp:
- 01/29/04 15:14:17 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2951 r2953 4 4 5 5 -*-*- 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 6 16 2004/01/28: Javier Rico 7 17 -
trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc
r2509 r2953 58 58 59 59 Int_t MHMcTriggerLvl2::fColorLps = 1; 60 Int_t MHMcTriggerLvl2::fColorCps = 1; 60 61 Int_t MHMcTriggerLvl2::fColorSbc = 1; 61 62 Int_t MHMcTriggerLvl2::fColorPs = 1; 62 63 Int_t MHMcTriggerLvl2::fColorPsE = 1; 64 Int_t MHMcTriggerLvl2::fColorCPsE = 1; 63 65 Int_t MHMcTriggerLvl2::fColorLPsE = 1; 64 66 Int_t MHMcTriggerLvl2::fColorSBCE = 1; … … 79 81 fTitle = title ? title : "Trigger L2 image parameters"; 80 82 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); 88 92 89 93 fHistLutPseudoSize->SetDirectory(NULL); … … 93 97 fHistSizeBiggerCell->SetDirectory(NULL); 94 98 fHistSizeBiggerCellNorm->SetDirectory(NULL); 99 fHistCellPseudoSize->SetDirectory(NULL); 100 fHistCellPseudoSizeNorm->SetDirectory(NULL); 95 101 96 102 fHistLutPseudoSize->SetXTitle("Number of Pixels"); … … 100 106 fHistSizeBiggerCell->SetXTitle("Number of Pixels"); 101 107 fHistSizeBiggerCellNorm->SetXTitle("Number of Pixels"); 108 fHistCellPseudoSize->SetXTitle("Number of Pixels"); 109 fHistCellPseudoSizeNorm->SetXTitle("Number of Pixels"); 102 110 103 111 fHistLutPseudoSize->SetYTitle("Counts"); … … 107 115 fHistSizeBiggerCell->SetYTitle("Counts"); 108 116 fHistSizeBiggerCellNorm->SetYTitle("Counts/Total Counts"); 117 fHistCellPseudoSize->SetYTitle("Counts"); 118 fHistCellPseudoSizeNorm->SetYTitle("Counts/Total Counts"); 109 119 110 120 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); 111 122 fHistLutPseudoSizeEnergy = new TH2D("fHistLutPseudoSizeEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397); 112 123 fHistSizeBiggerCellEnergy = new TH2D("fHistSizeBiggerCellEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397); … … 117 128 fHistPseudoSizeEnergy->SetYTitle("PseudoSize"); 118 129 130 fHistCellPseudoSizeEnergy->SetName("fHistCellPseudoSizeEnergy"); 131 fHistCellPseudoSizeEnergy->SetTitle("CellPseudoSize vs. Energy"); 132 fHistCellPseudoSizeEnergy->SetXTitle("Log(E[GeV])"); 133 fHistCellPseudoSizeEnergy->SetYTitle("CellPseudoSize"); 134 119 135 fHistLutPseudoSizeEnergy->SetName("fHistLutPseudoSizeEnergy"); 120 136 fHistLutPseudoSizeEnergy->SetTitle("LutPseudoSize vs. Energy"); … … 141 157 delete fHistLutPseudoSize; 142 158 delete fHistPseudoSize; 159 delete fHistCellPseudoSize; 143 160 delete fHistSizeBiggerCell; 144 161 delete fHistLutPseudoSizeNorm; 145 162 delete fHistPseudoSizeNorm; 163 delete fHistCellPseudoSizeNorm; 146 164 delete fHistSizeBiggerCellNorm; 147 165 delete fHistPseudoSizeEnergy; 166 delete fHistCellPseudoSizeEnergy; 148 167 delete fHistLutPseudoSizeEnergy; 149 168 delete fHistSizeBiggerCellEnergy; … … 163 182 fHistLutPseudoSize->Fill(h.GetLutPseudoSize()); 164 183 fHistPseudoSize->Fill(h.GetPseudoSize()); 184 fHistCellPseudoSize->Fill(h.GetCellPseudoSize()); 165 185 fHistSizeBiggerCell->Fill(h.GetSizeBiggerCell()); 166 186 fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetPseudoSize()); 187 fHistCellPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetCellPseudoSize()); 167 188 fHistLutPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetLutPseudoSize()); 168 189 fHistSizeBiggerCellEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetSizeBiggerCell()); … … 255 276 256 277 if (!str.Contains("lps", TString::kIgnoreCase) && 278 !str.Contains("cps", TString::kIgnoreCase) && 257 279 !str.Contains("sbc", TString::kIgnoreCase) && 258 280 !str.Contains("ps", TString::kIgnoreCase) && 259 281 !str.Contains("lut-energy", TString::kIgnoreCase) && 260 282 !str.Contains("size-energy", TString::kIgnoreCase) && 283 !str.Contains("cellsize-energy", TString::kIgnoreCase) && 261 284 !str.Contains("big-energy", TString::kIgnoreCase)) 262 285 { 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; 264 287 return NULL; 265 288 } 266 289 267 290 if (str.Contains("lps",TString::kIgnoreCase)){ 268 TH1 *hist=NormalizeHist( fHistLutPseudoSizeNorm, fHistLutPseudoSize);291 TH1 *hist=NormalizeHist(*fHistLutPseudoSizeNorm, fHistLutPseudoSize); 269 292 return DrawHist(*fHistLutPseudoSize, *hist, "CanvasLPS", fColorLps); 270 293 } 271 294 295 if (str.Contains("cps",TString::kIgnoreCase)){ 296 TH1 *hist=NormalizeHist(*fHistCellPseudoSizeNorm, fHistCellPseudoSize); 297 return DrawHist(*fHistCellPseudoSize, *hist, "CanvasCPS", fColorCps); 298 } 299 272 300 if (str.Contains("sbc",TString::kIgnoreCase)){ 273 TH1 *hist=NormalizeHist( fHistSizeBiggerCellNorm, fHistSizeBiggerCell);301 TH1 *hist=NormalizeHist(*fHistSizeBiggerCellNorm, fHistSizeBiggerCell); 274 302 return DrawHist(*fHistSizeBiggerCell, *hist, "CanvasSBC", fColorSbc); 275 303 } 276 304 277 305 if (str.Contains("ps",TString::kIgnoreCase)){ 278 TH1 *hist=NormalizeHist( fHistPseudoSizeNorm, fHistPseudoSize);306 TH1 *hist=NormalizeHist(*fHistPseudoSizeNorm, fHistPseudoSize); 279 307 return DrawHist(*fHistPseudoSize, *hist, "CanvasPS", fColorPs); 280 308 } … … 282 310 if (str.Contains("size-energy",TString::kIgnoreCase)) 283 311 return Draw2DHist(*fHistPseudoSizeEnergy, "CanvasPSE", fColorPsE); 312 313 if (str.Contains("cellsize-energy",TString::kIgnoreCase)) 314 return Draw2DHist(*fHistCellPseudoSizeEnergy, "CanvasCPSE", fColorCPsE); 284 315 285 316 if (str.Contains("lut-energy",TString::kIgnoreCase)) … … 338 369 if (name.Contains("fHistPseudoSizeEnergy", TString::kIgnoreCase)) 339 370 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 341 383 if (name.Contains("fHistLutPseudoSize", TString::kIgnoreCase)) 342 384 return fHistLutPseudoSize; … … 345 387 if (name.Contains("fHistPseudoSize", TString::kIgnoreCase)) 346 388 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 355 393 return NULL; 356 394 } … … 365 403 // the copy (histNorm) on its integral. It returns histNorm. 366 404 // 367 TH1 *MHMcTriggerLvl2::NormalizeHist(TH1 *histNorm, TH1 *hist) const368 { 369 if ( histNorm == hist){405 TH1 *MHMcTriggerLvl2::NormalizeHist(TH1 &histNorm, TH1 *hist) const 406 { 407 if (&histNorm == hist){ 370 408 *fLog << "ARGH!@! You cannot pass the same histogram into each argument!" << endl; 371 409 return NULL; … … 377 415 } 378 416 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 19 19 TH1F *fHistPseudoSize; // Histogram of fPseudoSize 20 20 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 21 23 TH1F *fHistSizeBiggerCell; // Histogram of fSizeBiggerCell 22 24 TH1F *fHistSizeBiggerCellNorm; // Histogram of fSizeBiggerCell normalized on integral of distribution 23 25 TH2D *fHistPseudoSizeEnergy; // 2D-Histogram of fPseudoSize vs. Energy 24 26 TH2D *fHistLutPseudoSizeEnergy; // 2D-Histogram of fLutPseudoSize vs. Energy 27 TH2D *fHistCellPseudoSizeEnergy; // 2D-Histogram of fCellPseudoSize vs. Energy 25 28 TH2D *fHistSizeBiggerCellEnergy; // 2D-Histogram of fSizeBiggerCell vs. Energy 26 29 TF1* fFNorm; // Function used to normalize histograms … … 29 32 static Int_t fColorSbc; 30 33 static Int_t fColorPs; 34 static Int_t fColorCps; 31 35 static Int_t fColorPsE; 32 36 static Int_t fColorLPsE; 37 static Int_t fColorCPsE; 33 38 static Int_t fColorSBCE; 34 39 … … 49 54 TH1F *GetHistPseudoSize() const { return fHistPseudoSize; } 50 55 TH1F *GetHistPseudoSizeNorm() const { return fHistPseudoSizeNorm; } 56 TH1F *GetHistCellPseudoSize() const { return fHistCellPseudoSize; } 57 TH1F *GetHistCellPseudoSizeNorm() const { return fHistCellPseudoSizeNorm; } 51 58 TH1F *GetHistSizeBiggerCell() const { return fHistSizeBiggerCell; } 52 59 TH1F *GetHistSizeBiggerCellNorm() const { return fHistSizeBiggerCellNorm; } … … 59 66 TObject *DrawClone(Option_t *opt=NULL) const; 60 67 61 TH1 *NormalizeHist(TH1 *histNorm, TH1 *hist) const;68 TH1 *NormalizeHist(TH1 &histNorm, TH1 *hist) const; 62 69 63 70 ClassDef(MHMcTriggerLvl2, 1) // Container which holds histograms for the Trigger Level2 image parameters
Note:
See TracChangeset
for help on using the changeset viewer.