Changeset 2365 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 09/29/03 17:39:49 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.