- Timestamp:
- 09/29/03 17:39:49 (21 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2363 r2365 1 1 -*-*- END OF LINE -*-*- 2 2 2003/09/29: Nicola Galante & Antonio Stamerra 3 4 * mmc/MMcTrig.cxx: 5 - Fixed a bug in function IsPixelFired(): the binary shift, introduced 6 by T.B. to replace "pow" for power of two, was wrong. 7 The correct operator to be used is "<<" and not ">>"! 8 9 * manalysis/MMcTriggerLvl2.[h,cc]: 10 - Added method "CalcEnergy(MMcEvt *)" used to get correlation between 11 energy and size. 12 - Removed graphical functions "Drawcell" and "DrawLvl1" 13 - Fixed bug in the pixcell setting (pixel numbering in the cell starts 14 from 0 but gsPixelInLut starts from 1). 15 - Fixed bug in the "check" variable. 16 17 * manalysis/MMcTriggerCalc.[h,cc]: 18 - Added call to MMcTriggerLvl2::CalcEnergy() in Process() 19 - Removed 'const' from fMcEvt declaration 20 21 * mhistmc/MHMcTriggerLvl2.[h,cc]: 22 - Added method "Draw2DHist" (draw correlation between 23 energy and size) 24 - Fixed bug in "DrawClone" function (histogram normalization) 25 26 * macros/triglvl2.C: 27 - Fixed a bug in the task list order to apply correctly the filters 28 - Now it writes on disk a root file with some histograms 29 30 3 31 2003/09/26: Robert Wagner 4 32 * mfileio/MCT1ReadPreProc.cc -
trunk/MagicSoft/Mars/macros/triglvl2.C
r1991 r2365 24 24 parlist.AddToList(&tasklist); 25 25 26 MGeomCamMagic geocam;27 parlist.AddToList(&geocam);28 29 // MHillas hillas;30 // parlist.AddToList(&hillas);31 32 // An instance of the class MMcTriggerLvl2 is created and added to the33 // parameter list34 MMcTriggerLvl2 cell;35 parlist.AddToList(&cell);36 37 // Set the number of Next Neighbourhoods that define a compact pixel38 //39 cell.SetCompactNN(3);40 // USER: --^41 42 //43 // A filter to select events using the L2T parameters is created44 //45 MF lvl2filter("MMcTriggerLvl2.fLutPseudoSize > 8");46 47 //48 // A second filter is created using the class MFTriggerLvl249 //50 MFTriggerLvl2 fTrig("MMcTriggerLvl2", '>', 8);51 // USER: fValue to be compared --^52 53 //54 // A selection on the number and energy of the events55 //56 MF energyfilter("MMcEvt.fEnergy > 100");57 MFEventSelector selector;58 //selector.SetNumSelectEvts(4000);59 60 61 // Filter to select events according to a give slope62 MFEnergySlope eslope;63 64 eslope.SetMcMinEnergy(50.);65 eslope.SetMcMaxEnergy(400.);66 eslope.SetNewSlope(-3.91);67 68 // A filter list is created; the filters created can be added to the list69 //70 MFilterList flist;71 // flist.AddToList(&energyfilter);72 // flist.AddToList(&lvl2filter);73 // flist.AddToList(&selector);74 // flist.AddToList(&eslope);75 flist.AddToList(&fTrig);76 77 78 26 // 79 27 // Setup our tasks: … … 81 29 // - Then we can fill the efficiency histograms 82 30 // 31 32 83 33 MReadMarsFile reader("Events", filename); 84 34 reader.DisableAutoScheme(); … … 89 39 tasklist.AddToList(&reader); 90 40 41 MGeomCamMagic geocam; 42 parlist.AddToList(&geocam); 43 44 // MHillas hillas; 45 // parlist.AddToList(&hillas); 46 47 // An instance of the class MMcTriggerLvl2 is created and added to the 48 // parameter list 49 MMcTriggerLvl2 cell; 50 parlist.AddToList(&cell); 51 52 MMcEvt mevt; 53 parlist.AddToList(&mevt); 54 55 // Set the number of Next Neighbourhoods that define a compact pixel 56 // 57 cell.SetCompactNN(2); 58 // USER: --^ 59 60 // 61 // A filter to select events using the L2T parameters is created 62 // 63 64 // MF lvl2filter("MMcTriggerLvl2.fPseudoSize > 25 && MMcTriggerLvl2.fPseudoSize < 31"); 65 MF lvl2filter("MMcTriggerLvl2.fPseudoSize > 15"); 66 67 // 68 // A second filter is created using the class MFTriggerLvl2 69 // 70 MFTriggerLvl2 fTrig("MMcTriggerLvl2", '>', 8); 71 // USER: fValue to be compared --^ 72 73 // 74 // A selection on the number and energy of the events 75 // 76 MF energyfilter("MMcEvt.fEnergy > 100"); 77 MFEventSelector selector; 78 //selector.SetNumSelectEvts(4000); 79 80 81 // Filter to select events according to a give slope 82 MFEnergySlope eslope; 83 84 eslope.SetMcMinEnergy(50.); 85 eslope.SetMcMaxEnergy(400.); 86 eslope.SetNewSlope(-.5); 87 88 // A filter list is created; the filters created can be added to the list 89 // 90 MFilterList flist; 91 //flist.AddToList(&energyfilter); 92 //flist.AddToList(&lvl2filter); 93 // flist.AddToList(&selector); 94 // flist.AddToList(&eslope); 95 // flist.AddToList(&fTrig); 96 97 98 99 // 100 // The task to calculate the L2T parameter is added to the task list 101 // 102 MMcTriggerLvl2Calc calcps("MMcTriggerLvl2","MMcTriggerLvl2"); 103 tasklist.AddToList(&calcps); 104 91 105 // 92 106 // The filter list is added to the task list … … 98 112 // 99 113 MMcCollectionAreaCalc effi; 100 tasklist.AddToList(&effi); 101 114 tasklist.AddToList(&effi); 102 115 // 103 116 // The filter list selects events for the effective area calculation … … 105 118 effi.SetFilter(&flist); 106 119 107 //108 // The task to calculate the L2T parameter is added to the task list109 //110 MMcTriggerLvl2Calc fill("MMcTriggerLvl2","MMcTriggerLvl2");111 tasklist.AddToList(&fill);112 120 113 121 // … … 116 124 MFillH hfill1("MHMcTriggerLvl2","MMcTriggerLvl2"); 117 125 tasklist.AddToList(&hfill1); 118 126 //hfill1.SetFilter(&flist); 127 //MFillH hfill2("MHMcTriggerLvl2", &mevt, &cell); 128 //tasklist.AddToList(&hfill2); 129 //hfill2.SetFilter(&flist); 130 131 132 119 133 // 120 134 // set up the loop for the processing … … 123 137 magic.SetParList(&parlist); 124 138 139 125 140 // 126 141 // Start to loop over all events … … 129 144 magic.SetProgressBar(&bar); 130 145 146 131 147 if (!magic.Eventloop()) 132 148 return; 149 /* 150 if (!magic.PreProcess()) 151 return; 152 153 while (tasklist.Process()) 154 { 155 cout<< mevt.GetEnergy()<<endl; 156 157 cell.Print(); 158 } 159 */ 160 //fMcEvt = (MMcEvt*)parlist->FindObject("MMcEvt"); 161 //if (!fMcEvt) 162 //{ 163 //cout << "MMcEvt not found... exit." << endl; 164 //*fLog << err << dbginf << "MMcEvt not found... exit." << endl; 165 // return kFALSE; 166 //} 167 // cout << "fMcEvt = " << fMcEvt << endl; 168 169 //parlist.FindObject("MHMcTriggerLvl2")->Fill((Double_t) fMcEvt->GetEnergy(), cell); 170 133 171 134 172 tasklist.PrintStatistics(); … … 140 178 parlist.FindObject("MHMcCollectionArea")->DrawClone(); 141 179 180 parlist.FindObject("MHMcTriggerLvl2")->DrawClone("sbc"); 142 181 parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lps"); 143 // parlist.FindObject("MHMcTriggerLvl2")->DrawClone(); 182 parlist.FindObject("MHMcTriggerLvl2")->DrawClone(); 183 parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy"); 144 184 145 185 // Returns histogram of the class MHMcTriggerLvl2 146 // parlist.FindObject("MHMcTriggerLvl2")->GetHistByName("hfPseudoSize")); 147 186 187 MHMcTriggerLvl2 *htrig = (MHMcTriggerLvl2 *)parlist.FindObject("MHMcTriggerLvl2"); 188 TH1F *h1 = htrig->GetHistByName("fHistPseudoSize"); 189 TH2D *h2 = htrig->GetHistPseudoSizeEnergy(); 190 191 // h2->DrawClone(); 192 193 hfile = new TFile("HistFileLUT.root", "RECREATE"); 194 h1->Write(); 195 h2->Write(); 196 hfile->Close(); 197 148 198 } 149 199 -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc
r2229 r2365 18 18 ! Author(s): Antonio Stamerra 1/2003 <mailto:antono.stamerra@pi.infn.it> 19 19 ! Author(s): Marcos Lopez 1/2003 <mailto:marcos@gae.ucm.es> 20 ! Author(s): Nicola Galante 7/2003 <mailto:nicola.galante@pi.infn.it> 20 21 ! 21 22 ! Copyright: MAGIC Software Development, 2000-2003 … … 48 49 #include "MGeomPix.h" 49 50 #include "MGeomCamMagic.h" 50 #include "MHCamera.h"51 51 52 52 #include "MMcTrig.hxx" 53 54 #include "MMcEvt.hxx" 53 55 54 56 #include "MLog.h" … … 144 146 MMcTriggerLvl2::~MMcTriggerLvl2() 145 147 { 146 delete fCam;147 148 delete fGeomCam; 148 149 } … … 218 219 fMcTrig = trig; 219 220 220 //fMcTrig->PrintPixelsFirstLevel();221 222 221 for(int i=0; i<36; i++) 223 222 { … … 227 226 fPixels[i][j] = (fMcTrig->IsPixelFired(pixel,0)) ? 1 : 0; 228 227 fFiredPixel[pixel]=(fMcTrig->IsPixelFired(pixel,0)) ? 1 : 0; 229 } 230 } 228 //if (fFiredPixel[pixel]==1) 229 //*fLog << pixel<<","; 230 } 231 } 232 //*fLog<<endl<<"Fine evento"<<endl; 231 233 } 232 234 … … 269 271 fSizeBiggerCell = GetCellNumberFired(CalcBiggerFiredCell()); 270 272 271 } 272 273 274 // -------------------------------------------------------------------------- 275 // 276 // Display the MAGIC Camera a draw the pixels corresponding to a given cell 277 // (preliminary) <to be fixed> 278 // 279 void MMcTriggerLvl2::DrawCell(Int_t cell) 280 { 281 282 if(cell>18) return; 283 284 // 285 // Use MHCamera class variable for avoiding to create a MHCamera each 286 // time this function is called. Also, now all the hexagons are drawn in 287 // the same camera pad 288 // 289 if (!fGeomCam) 290 fGeomCam = new MGeomCamMagic; 291 if (!fCam) 292 { 293 fCam = new MHCamera(*fGeomCam); 294 fCam->Draw(); 295 fCam->DrawPixelIndices(); 296 } 297 298 //fCam->Draw(); 299 fCam->Reset(); 300 301 int color=0; 302 303 for(int i=0; i<36; i++) 304 { 305 color = (fPixels[i][cell]) ? 5 : 3; 306 fCam->SetPix( gsPixelsInCell[i][cell]-1, color, 1, 5 ); 307 } 308 309 // 310 // Update the display (paint the camera with the new colors) 311 // 312 gPad->Modified(); 313 gPad->Update(); 314 } 315 316 317 318 // -------------------------------------------------------------------------- 319 // 320 // Display the MAGIC camera and draw all the pixel fired after Lvl1 321 // (preliminary) <to be fixed> 322 // 323 // 324 void MMcTriggerLvl2::DrawLv1() 325 { 326 // 327 // Use MHCamera class variable for avoiding to create a MHCamera each 328 // time this function is called. Also, now all the hexagons are drawn in 329 // the same camera pad 330 // 331 // !FixMe! Delete this method when the trigger display is available! 332 // 333 if (!fGeomCam) 334 fGeomCam = new MGeomCamMagic; 335 if (!fCam) 336 { 337 fCam = new MHCamera(*fGeomCam); 338 fCam->Draw(); 339 fCam->DrawPixelIndices(); 340 } 341 342 // 343 // Set the array of colors for each pixel (that will be painted after 344 // updating the dispaly) 345 // 346 int color=0; 347 348 for(int i=0; i<577; i++) 349 { 350 color = (fMcTrig->IsPixelFired(i,0)) ? 1 : 2; 351 fCam->SetPix( i, color, 1, 5 ); 352 } 353 354 // 355 // Update the display (paint the camera with the new colors) 356 // 357 gPad->Modified(); 358 gPad->Update(); 359 360 } 273 //*fLog << "fLPS="<<fLutPseudoSize<<endl; 274 } 275 276 361 277 362 278 // -------------------------------------------------------------------------- … … 432 348 } 433 349 434 // 350 //*fLog <<"Max cell: " << cell+1 << " Max Lut: " << lut+1 << " PseudoSize: " << size <<endl; 435 351 436 352 return cell*10+lut; … … 708 624 int maxlut = cellut - maxcell*10; 709 625 int startpix; 626 //if (GetLutCompactPixel(maxcell,maxlut)==0) 627 //*fLog << "Max lut size:" << GetLutCompactPixel(maxcell,maxlut) <<endl; 710 628 711 629 // … … 715 633 for (int pixlut=0;pixlut<12;pixlut++) 716 634 { 717 int pixcell =gsPixelsInLut[maxlut][pixlut] ;635 int pixcell =gsPixelsInLut[maxlut][pixlut]-1; 718 636 startpix = gsPixelsInCell[pixcell][maxcell]-1; 719 *fLog << "pix, compact:" << startpix << "@"<<fCompactPixel[startpix];637 //*fLog << "pix, compact:" << startpix << "@"<<fCompactPixel[startpix]; 720 638 if (fCompactPixel[startpix]) // a starting pixel was found 721 639 break; … … 723 641 } 724 642 643 //*fLog << "check = " << check << endl; 725 644 // A LUT contains 12 pixels 726 if (check >= 12) 727 { 728 *fLog <<"Error: a starting pixels was not found!"<<endl; 729 return; 645 if (check > 12) 646 { 647 check=1; 648 // A starting pixel was not found using the LutPseudoSize. 649 // We look for it in the BiggerCell 650 maxcell=CalcBiggerFiredCell(); 651 for (int pixcell=0;pixcell<36;pixcell++) 652 { 653 startpix = gsPixelsInCell[pixcell][maxcell]-1; 654 //*fLog << "pix, compact:" << startpix << "@"<<fCompactPixel[startpix]; 655 if (fCompactPixel[startpix]) // a starting pixel was found 656 break; 657 check++; 658 } 659 if (check > 36) 660 { 661 *fLog <<"Error: a starting pixels was not found! - PseudoSize = "<< fPseudoSize << endl; 662 fPseudoSize=0; 663 return; 664 } 730 665 } 731 666 // … … 755 690 int pix_neigh = pix.GetNeighbor(i); 756 691 // check if pixel is fired and doesn't belong to cluster 757 if (fFiredPixel[pix_neigh] && !cluster[pix_neigh]) 692 if (fCompactPixel[pix_neigh] && !cluster[pix_neigh]) 693 //if (fCompactPixel[pix_neigh]) 758 694 { 759 695 cluster[pix_neigh] = 1; … … 765 701 766 702 fPseudoSize = pnt; 703 //if (fPseudoSize < 4) 704 // *fLog << "fPseudoSize = " << fPseudoSize << endl; 767 705 768 706 // *fLog << "ClusterID:" <<(*clust).GetClusterId() << " Mult:" << (*clust).GetMultiplicity()<<endl; 769 707 770 *fLog <<"PSize: "<< fPseudoSize << " in cell:" << maxcell << " lut:" <<maxlut <<endl;708 // *fLog <<"PSize: "<< fPseudoSize << " in cell:" << maxcell << " lut:" <<maxlut <<endl; 771 709 772 710 return; … … 786 724 { 787 725 memset (fCompactPixel,0,397*sizeof(Int_t)); 788 726 // *fLog << endl << "NEW Event!"; 789 727 for(UInt_t pixid=0;pixid<397;pixid++) 790 728 { … … 798 736 // A compact pixel must have at least fCompactNN adjacent neighbors 799 737 // It checks the 6 different configurations of neighbors pixels 738 int j=0; 800 739 for (int i=0;i<pix.GetNumNeighbors();i++) 801 740 { 802 int j=0;803 while ( fFiredPixel[pix.GetNeighbor(i+j)]==1 && j < fCompactNN)741 //*fLog << pixid <<"->"<< pix.GetNeighbor(i+j) << endl; 742 while ((fFiredPixel[pix.GetNeighbor(i+j)]==1) && (j < fCompactNN)) 804 743 j++; 805 744 if (j!=fCompactNN) continue; // configuration doesn't satisfy compact condition … … 807 746 fCompactPixel[pixid]=1; // pixel is compact 808 747 809 *fLog << ","<<pixid;748 // *fLog << ","<<pixid; 810 749 811 750 break; … … 816 755 817 756 757 void MMcTriggerLvl2::CalcEnergy(MMcEvt *fMcEvt) 758 { 759 const MMcEvt &h = *(MMcEvt *)fMcEvt; 760 fEnergy = h.GetEnergy(); 761 } 762 763 764 -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.h
r2210 r2365 8 8 class MMcTrig; 9 9 10 class MHCamera; 10 class MMcEvt; 11 11 12 class MGeomCamMagic; 12 13 … … 36 37 Int_t fCluster_pix[397]; //Array with pixel in cluster 37 38 39 Double_t fEnergy; // Energy of the shower 40 41 38 42 MMcTrig *fMcTrig; 39 43 MGeomCam *fGeomCam; 40 MHCamera *fCam;41 // MCluster *fClust;42 44 43 45 Int_t CalcBiggerFiredCell(); … … 52 54 ~MMcTriggerLvl2(); 53 55 54 void DrawCell(Int_t cell);55 void DrawLv1();56 56 57 57 virtual void Calc(); … … 74 74 void CalcCompactPixels(MGeomCam *fCam); 75 75 76 void CalcEnergy(MMcEvt *fMcEvt = NULL); 77 78 Double_t GetEnergy() const {return fEnergy;} 79 76 80 77 81 ClassDef(MMcTriggerLvl2,0) // Container for 2nd Level Trigger selection parameters -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc
r2206 r2365 132 132 Int_t MMcTriggerLvl2Calc::Process() 133 133 { 134 //const Float_t energy = fMcEvt->GetEnergy();134 fMMcTriggerLvl2->CalcEnergy(fMcEvt); 135 135 136 136 fMMcTriggerLvl2->SetLv1(fMcTrig); … … 139 139 140 140 fMMcTriggerLvl2->Calc(); 141 142 //fMMcTriggerLvl2->DrawLv1();143 //fMMcTriggerLvl2->DrawCell(fMMcTriggerLvl2->GetBiggerFiredCell() );144 //fMMcTriggerLvl2->Print();145 141 146 142 return kTRUE; -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.h
r2206 r2365 20 20 private: 21 21 22 constMMcEvt *fMcEvt;22 MMcEvt *fMcEvt; 23 23 MMcTrig *fMcTrig; 24 24 -
trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc
r2173 r2365 33 33 #include "MHMcTriggerLvl2.h" 34 34 35 #include <math.h> 36 35 #include <TMath.h> 36 37 #include <TH2.h> 37 38 #include <TH1.h> 38 39 #include <TF1.h> … … 48 49 49 50 #include "MMcTriggerLvl2.h" 50 #include "MGeomCam.h"51 #include "MBinning.h"52 51 53 52 using namespace std; 54 55 /*56 Please, DON'T USE IFDEFS IN SUCH A CONTEXT, Thomas.57 --------------------------------------------------58 #ifndef COLOR_LINELPS59 #define COLOR_LINELPS Int_t colorlps = 160 COLOR_LINELPS;61 #endif62 63 #ifndef COLOR_LINESBC64 #define COLOR_LINESBC Int_t colorsbc = 165 COLOR_LINESBC;66 #endif67 68 #ifndef COLOR_LINEPS69 #define COLOR_LINEPS Int_t colorps = 170 COLOR_LINEPS;71 #endif72 */73 53 74 54 /* Use this insteadif you want to have some value which is the same for all … … 80 60 Int_t MHMcTriggerLvl2::fColorSbc = 1; 81 61 Int_t MHMcTriggerLvl2::fColorPs = 1; 62 Int_t MHMcTriggerLvl2::fColorPsE = 1; 82 63 83 64 ClassImp(MHMcTriggerLvl2); … … 95 76 fTitle = title ? title : "Trigger L2 image parameters"; 96 77 97 fHistLutPseudoSize = new TH1F("fHistLutPseudoSize", "number of compact pixels in one lut", 1 3, 0, 12);98 fHistPseudoSize = new TH1F("fHistPseudoSize", "Multiplicity of the cluster identified by the L2T", 41, 0, 40);99 fHistSizeBiggerCell = new TH1F("fHistSizeBiggerCell", "Number of fired pixel in bigger cell", 3 7, 0, 36);100 101 fHistLutPseudoSizeNorm = new TH1F("fHistLutPseudoSizeNorm", "Normalized Number of compact pixels in one lut", 1 3, 0, 12);102 fHistPseudoSizeNorm = new TH1F("fHistPseudoSizeNorm", "Normalized Multiplicity of the cluster identified by the L2T", 41, 0, 40);103 fHistSizeBiggerCellNorm = new TH1F("fHistSizeBiggerCellNorm", "Normalized Number of fired pixel in bigger cell", 3 7, 0, 36);78 fHistLutPseudoSize = new TH1F("fHistLutPseudoSize", "number of compact pixels in one lut", 12, 0, 12); 79 fHistPseudoSize = new TH1F("fHistPseudoSize", "Multiplicity of the cluster identified by the L2T", 397, 0, 397); 80 fHistSizeBiggerCell = new TH1F("fHistSizeBiggerCell", "Number of fired pixel in bigger cell", 36, 0, 36); 81 82 fHistLutPseudoSizeNorm = new TH1F("fHistLutPseudoSizeNorm", "Normalized Number of compact pixels in one lut", 12, 0, 12); 83 fHistPseudoSizeNorm = new TH1F("fHistPseudoSizeNorm", "Normalized Multiplicity of the cluster identified by the L2T", 397, 0, 397); 84 fHistSizeBiggerCellNorm = new TH1F("fHistSizeBiggerCellNorm", "Normalized Number of fired pixel in bigger cell", 36, 0, 36); 104 85 105 86 fHistLutPseudoSize->SetDirectory(NULL); … … 124 105 fHistSizeBiggerCellNorm->SetYTitle("Counts/Total Counts"); 125 106 126 fFNorm = new TF1("FNorm", "1", -1, 40); 107 fHistPseudoSizeEnergy = new TH2D("fHistPseudoSizeEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397); 108 109 fHistPseudoSizeEnergy->SetName("fHistPseudoSizeEnergy"); 110 fHistPseudoSizeEnergy->SetTitle("PseudoSize vs. Energy"); 111 fHistPseudoSizeEnergy->SetXTitle("Log(E[GeV])"); 112 fHistPseudoSizeEnergy->SetYTitle("PseudoSize"); 113 114 fFNorm = new TF1("FNorm", "1", -1, 397); 127 115 } 128 116 … … 139 127 delete fHistPseudoSizeNorm; 140 128 delete fHistSizeBiggerCellNorm; 129 delete fHistPseudoSizeEnergy; 141 130 142 131 delete fFNorm; 143 132 } 133 144 134 145 135 // -------------------------------------------------------------------------- … … 155 145 fHistPseudoSize->Fill(h.GetPseudoSize()); 156 146 fHistSizeBiggerCell->Fill(h.GetSizeBiggerCell()); 147 //fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetPseudoSize()); 148 fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetLutPseudoSize()); 157 149 158 150 return kTRUE; 159 151 } 152 153 160 154 161 155 … … 186 180 histNorm.SetLineColor(col); 187 181 histNorm.DrawCopy(same?"same":""); 182 183 return c; 184 } 185 186 187 // -------------------------------------------------------------------------- 188 // 189 // This is the private function member which draw a clone of a 2D-histogram. 190 // This method is called by the DrawClone method. 191 // 192 TObject *MHMcTriggerLvl2::Draw2DHist(TH1 &hist, const TString &canvasname, Int_t &col) const 193 { 194 col++; 195 196 TCanvas *c = (TCanvas*)gROOT->FindObject(canvasname); 197 198 Bool_t same = kTRUE; 199 if (!c) 200 { 201 c = MakeDefCanvas(canvasname,canvasname, 800, 600); 202 same = kFALSE; 203 } 204 205 hist.SetLineColor(col); 206 hist.DrawCopy(same?"same":""); 188 207 189 208 return c; … … 213 232 if (!str.Contains("lps", TString::kIgnoreCase) && 214 233 !str.Contains("sbc", TString::kIgnoreCase) && 215 !str.Contains("ps", TString::kIgnoreCase)) 234 !str.Contains("ps", TString::kIgnoreCase) && 235 !str.Contains("energy", TString::kIgnoreCase)) 216 236 { 217 237 *fLog << "ARGH!@! Possible options are \"lps\", \"sbc\", \"ps\" or NULL!" <<endl; … … 219 239 } 220 240 221 TH1 *hist=NormalizeHist(fHistLutPseudoSizeNorm, fHistLutPseudoSize); 222 223 if (!hist) 224 return NULL; 225 226 if (str.Contains("lps",TString::kIgnoreCase)) 227 return DrawHist(*fHistLutPseudoSize, *hist, "CanvasLPS", fColorLps); 228 229 if (str.Contains("sbc",TString::kIgnoreCase)) 230 return DrawHist(*fHistSizeBiggerCell, *hist, "CanvasSBC", fColorSbc); 231 232 if (str.Contains("ps",TString::kIgnoreCase)) 233 return DrawHist(*fHistPseudoSize, *hist, "CanvasPS", fColorPs); 241 if (str.Contains("lps",TString::kIgnoreCase)){ 242 TH1 *hist=NormalizeHist(fHistLutPseudoSizeNorm, fHistLutPseudoSize); 243 return DrawHist(*fHistLutPseudoSize, *hist, "CanvasLPS", fColorLps); 244 } 245 246 if (str.Contains("sbc",TString::kIgnoreCase)){ 247 TH1 *hist=NormalizeHist(fHistSizeBiggerCellNorm, fHistSizeBiggerCell); 248 return DrawHist(*fHistSizeBiggerCell, *hist, "CanvasSBC", fColorSbc); 249 } 250 251 if (str.Contains("ps",TString::kIgnoreCase)){ 252 TH1 *hist=NormalizeHist(fHistPseudoSizeNorm, fHistPseudoSize); 253 return DrawHist(*fHistPseudoSize, *hist, "CanvasPS", fColorPs); 254 } 255 256 if (str.Contains("energy",TString::kIgnoreCase)) 257 return Draw2DHist(*fHistPseudoSizeEnergy, "CanvasPSE", fColorPsE); 234 258 235 259 return NULL; -
trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.h
r2043 r2365 6 6 #endif 7 7 8 class TH2D; 8 9 class TH1F; 9 10 class TF1; … … 20 21 TH1F *fHistSizeBiggerCell; // Histogram of fSizeBiggerCell 21 22 TH1F *fHistSizeBiggerCellNorm; // Histogram of fSizeBiggerCell normalized on integral of distribution 22 23 TH2D *fHistPseudoSizeEnergy; // 2D-Histogram of fPseudoSize vs. Energy 23 24 TF1* fFNorm; // Function used to normalize histograms 24 25 … … 26 27 static Int_t fColorSbc; 27 28 static Int_t fColorPs; 29 static Int_t fColorPsE; 28 30 29 31 TObject *DrawHist(TH1 &hist, TH1 &histNorm, const TString &canvasname, Int_t &colore) const; 32 TObject *Draw2DHist(TH1 &hist, const TString &canvasname, Int_t &col) const; 30 33 31 34 public: … … 34 37 35 38 Bool_t Fill(const MParContainer *par, const Stat_t w=1); 36 39 // Bool_t Fill(const Double_t energy, const MParContainer *par, const Stat_t w=1); 37 40 TH1 *GetHistByName(const TString name); 38 41 … … 43 46 TH1F *GetHistSizeBiggerCell() const { return fHistSizeBiggerCell; } 44 47 TH1F *GetHistSizeBiggerCellNorm() const { return fHistSizeBiggerCellNorm; } 48 TH2D *GetHistPseudoSizeEnergy() const { return fHistPseudoSizeEnergy; } 45 49 46 50 void Draw(Option_t *opt=NULL); -
trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx
r2173 r2365 1 1 #include "MMcTrig.hxx" 2 2 3 #include <iostream >3 #include <iostream.h> 4 4 5 5 … … 123 123 // first level trigger happened, 0 if not. 124 124 // 125 125 126 126 const Int_t body=npix/8; 127 const Byte_t reminder= 1 >>(npix%8);127 const Byte_t reminder= 1<<(npix%8); 128 128 129 129 return reminder&fPixelsFirst[body][nfirstlevel]; 130 /* 131 Byte_t ret=0; 132 Byte_t reminder; 133 Int_t body; 134 135 body=npix/8; 136 reminder=(Byte_t)(pow(2,npix%8)); 137 ret=reminder&fPixelsFirst[body][nfirstlevel]; 138 return(ret); 139 */ 130 140 }
Note:
See TracChangeset
for help on using the changeset viewer.