Changeset 2918 for trunk/MagicSoft/Mars
- Timestamp:
- 01/26/04 16:10:29 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2917 r2918 4 4 5 5 -*-*- END OF LINE -*-*- 6 7 2004/01/26: Nicola Galante 8 9 * manalisys/MMcTriggerLvl2.[cc,h]: 10 - Defined some static constants to avoid ugly "magic numbers" 11 in arrays: gsNCells, gsNTrigPixels, 12 gsNPixInCell, gsNLutInCell, gsNPixInLut, fNumPixCell. 13 - Added method MMcTriggerLvl2::GetCellCompactPixel(int cell, MGeomCam *fCam) 14 which computes compact pixels into a given L2T macrocell. 15 - Added method MMcTriggerLvl2::CalcBiggerCellPseudoSize() which 16 computes fCellPseudoSize, the maximum Pseudo Size into L2T macrocells 17 - Added method MMcTriggerLvl2::GetCellPseudoSize() const which 18 returns fCellPseudoSize 19 - Added method MMcTriggerLvl2::IsPixelInCell(Int_t pixel, Int_t cell), 20 which controls whether a pixel belongs to a given L2T cell. 21 - Added method MMcTriggerLvl2::GetMaxCell() const which returns fMaxCell, the cell with 22 the maximum fCellPseudoSize. 23 - Re-declared methods MMcTriggerLvl2::CalcCompactPixels(MGeomCam *fCam) 24 and MMcTriggerLvl2::CalcTriggerPattern(MGeomCam *fCam) as private. 25 26 6 27 2004/01/26: Markus Gaug 7 28 -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc
r2478 r2918 72 72 // This correspondence is valid only for MAGIC-like geometries! 73 73 // 74 const Int_t MMcTriggerLvl2::gsPixelsInCell[36][19] = { 74 // FIXME! These definitions should be included in a GeomTrig class 75 // 76 const Int_t MMcTriggerLvl2::gsPixelsInCell[gsNPixInCell][gsNCells] = { 75 77 {26, 91, 66, 71, 76, 81, 86, 269, 224, 233, 242, 251, 260, 391, 336, 347, 358, 369, 380}, 76 78 {25, 61, 41, 45, 49, 53, 57, 215, 175, 183, 191, 199, 207, 325, 275, 285, 295, 305, 315}, … … 114 116 // corrispondence between pixels in cell and lut (pix numbering starts from 1) 115 117 // 116 const Int_t MMcTriggerLvl2::gsPixelsInLut[ 3][12] = {118 const Int_t MMcTriggerLvl2::gsPixelsInLut[gsNLutInCell][gsNPixInLut] = { 117 119 { 1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 15}, 118 120 {34, 29, 23, 16, 30, 24, 17, 10, 25, 18, 11, 5}, … … 135 137 // Initialization of the fPixels array to zero 136 138 // 137 memset (fPixels,0, 36*19*sizeof(Int_t));138 memset (fFiredPixel,0, 397*sizeof(Int_t));139 memset (fPixels,0,gsNPixInCell*gsNCells*sizeof(Int_t)); 140 memset (fFiredPixel,0,gsNTrigPixels*sizeof(Int_t)); 139 141 140 142 // create a new camera … … 180 182 { 181 183 *fLog << " Status of cells 1-9" <<endl; 182 for(int i=0; i< 36; i++)184 for(int i=0; i<gsNPixInCell; i++) 183 185 { 184 186 for(int j=0; j<9; j++) … … 193 195 { 194 196 *fLog << " Pixel numbering in cells 1-9" <<endl; 195 for (int i=0;i< 36;i++)197 for (int i=0;i<gsNPixInCell;i++) 196 198 { 197 199 for(int j=0; j<9; j++) … … 210 212 else 211 213 { 212 *fLog << " L2T selection parameters: " << endl;214 *fLog << " L2T selection parameters: " << endl; 213 215 *fLog << " - LutPseudoSize = " << fLutPseudoSize << endl; 214 *fLog << " - PseudoSize = " << fPseudoSize << endl; 216 *fLog << " - CellPseudoSize = " << fCellPseudoSize << endl; 217 *fLog << " - PseudoSize = " << fPseudoSize << endl; 215 218 *fLog << " - BiggerCellSize = " << fSizeBiggerCell << endl; 216 219 *fLog << " - TriggerPattern = " << fTriggerPattern << endl; … … 233 236 fMcTrig = trig; 234 237 235 for(int i=0; i< 36; i++)236 { 237 for(int j=0; j< 19; j++)238 for(int i=0; i<gsNPixInCell; i++) 239 { 240 for(int j=0; j<gsNCells; j++) 238 241 { 239 242 int pixel = gsPixelsInCell[i][j]-1; … … 256 259 void MMcTriggerLvl2::SetPixelFired(Int_t pixel, Int_t fired) 257 260 { 258 for(int i=0; i< 36; i++)259 { 260 for(int j=0; j< 19; j++)261 for(int i=0; i<gsNPixInCell; i++) 262 { 263 for(int j=0; j<gsNCells; j++) 261 264 { 262 265 if(gsPixelsInCell[i][j]-1==pixel) fPixels[i][j]=fired; … … 277 280 // Find the Lut and cell with the higher LutPseudoSize. 278 281 int lutcell = CalcBiggerLutPseudoSize(); 279 int maxcell = lutcell/10; 280 int maxlut = lutcell-maxcell*10; 281 fLutPseudoSize = GetLutCompactPixel(maxcell,maxlut); 282 282 fMaxCell = lutcell/10; 283 int maxlut = lutcell-fMaxCell*10; 284 fLutPseudoSize = GetLutCompactPixel(fMaxCell,maxlut); 285 286 fMaxCell = CalcBiggerCellPseudoSize(); // fCellPseudoSize 287 // fMaxCell is used by the PseudoSize to find the starting pixel 283 288 CalcPseudoSize(); 284 289 … … 298 303 int size=0; 299 304 300 for(int i=0; i< 36; i++)305 for(int i=0; i<gsNPixInCell; i++) 301 306 { 302 307 size += fPixels[i][cell]; … … 318 323 int cell=-1; 319 324 320 for(int j=0; j< 19; j++)325 for(int j=0; j<gsNCells; j++) 321 326 { 322 327 if (GetCellNumberFired(j) > size) … … 349 354 int lut=-1; 350 355 351 for(int j=0; j< 19; j++)352 { 353 for(int i=0; i< 3; i++)356 for(int j=0; j<gsNCells; j++) 357 { 358 for(int i=0; i<gsNLutInCell; i++) 354 359 { 355 360 if (GetLutCompactPixel(j,i) >= size) … … 387 392 { 388 393 int size=0; 389 int lutpix, a[ 12];394 int lutpix, a[gsNPixInLut]; 390 395 int neighpix= (*this).fCompactNN; 391 396 … … 395 400 return(-1); 396 401 397 if (cell<0 || cell> 18)402 if (cell<0 || cell> gsNCells-1) 398 403 return(-2); 399 404 400 if (lut<0 || lut> 2)405 if (lut<0 || lut> gsNLutInCell-1) 401 406 return(-3); 402 407 403 408 409 // 410 // Warning!!! Following configurations are valid only for the standard MAGIC 411 // trigger geometry; FIXME! these should be coded somewhere else.... 412 // 413 404 414 // LUT 1 and 2 are similar; LUT 3 differs 405 415 406 for(int j=0; j< 12; j++)416 for(int j=0; j< gsNPixInLut; j++) 407 417 { 408 418 lutpix = gsPixelsInLut[lut][j]-1; … … 613 623 614 624 615 if(size<0 ||size> 12)625 if(size<0 ||size>gsNPixInLut) 616 626 *fLog << "*" << size <<"-"; 617 627 … … 634 644 // seek the LUT with higher number of compact pixels 635 645 // 636 int cellut = CalcBiggerLutPseudoSize(); 637 int maxcell = cellut/10; 638 int maxlut = cellut - maxcell*10; 646 //int fMaxCell = CalcBiggerCellPseudoSize(); 647 int sizetemp=0; 648 int maxlut=0; 649 650 for (int i=0;i<gsNLutInCell;i++) 651 if (GetLutCompactPixel(fMaxCell,i) > sizetemp) 652 { 653 maxlut=i; 654 sizetemp = GetLutCompactPixel(fMaxCell,i); 655 } 656 639 657 int startpix; 640 //if (GetLutCompactPixel(maxcell,maxlut)==0)641 //*fLog << "Max lut size:" << GetLutCompactPixel(maxcell,maxlut) <<endl;642 643 658 // 644 // seek a starting pixel in the lut for the iteration659 // seek a starting pixel for the iteration inside the lut 645 660 // 646 661 int check=1; 647 for (int pixlut=0;pixlut< 12;pixlut++)662 for (int pixlut=0;pixlut<gsNPixInLut;pixlut++) 648 663 { 649 664 int pixcell =gsPixelsInLut[maxlut][pixlut]-1; 650 startpix = gsPixelsInCell[pixcell][ maxcell]-1;665 startpix = gsPixelsInCell[pixcell][fMaxCell]-1; 651 666 //*fLog << "pix, compact:" << startpix << "@"<<fCompactPixel[startpix]; 652 667 if (fCompactPixel[startpix]) // a starting pixel was found 653 break;668 break; 654 669 check++; 655 670 } … … 657 672 //*fLog << "check = " << check << endl; 658 673 // A LUT contains 12 pixels 659 if (check > 12) 660 { 661 check=1; 662 // A starting pixel was not found using the LutPseudoSize. 663 // We look for it in the BiggerCell 664 maxcell=CalcBiggerFiredCell(); 665 for (int pixcell=0;pixcell<36;pixcell++) 666 { 667 startpix = gsPixelsInCell[pixcell][maxcell]-1; 668 //*fLog << "pix, compact:" << startpix << "@"<<fCompactPixel[startpix]; 669 if (fCompactPixel[startpix]) // a starting pixel was found 670 break; 671 check++; 672 } 673 if (check > 36) 674 { 675 // *fLog <<"Warning: a starting pixel was not found! - PseudoSize = "<< fPseudoSize << endl; 676 fPseudoSize=-1; 677 return; 678 } 679 } 674 if (check > gsNPixInLut) 675 { 676 *fLog <<"Warning: a starting pixel was not found! - PseudoSize = "<< fPseudoSize << endl; 677 fPseudoSize=-1; 678 return; 679 } 680 680 681 // 681 682 // Bulding cluster 682 683 // 683 Int_t cluster[ 397];684 Int_t cluster[gsNTrigPixels]; 684 685 int pnt=0; 685 686 int pnt2=0; //pointer in the array fCluster_pix, needed for filling 686 687 687 memset (cluster,0, 397*sizeof(Int_t));688 memset (fCluster_pix,-1, 397*sizeof(Int_t));688 memset (cluster,0,gsNTrigPixels*sizeof(Int_t)); 689 memset (fCluster_pix,-1,gsNTrigPixels*sizeof(Int_t)); 689 690 690 691 cluster[startpix]=1; … … 701 702 702 703 for (int i=0;i<pix.GetNumNeighbors();i++) 703 {704 int pix_neigh = pix.GetNeighbor(i);705 // check if pixel is fired and doesn't belong to cluster706 if (fCompactPixel[pix_neigh] && !cluster[pix_neigh])707 //if (fCompactPixel[pix_neigh])708 704 { 709 cluster[pix_neigh] = 1; 710 fCluster_pix[++pnt2] = pix_neigh; 705 int pix_neigh = pix.GetNeighbor(i); 706 // check if pixel is fired and doesn't belong to cluster 707 if (fCompactPixel[pix_neigh] && !cluster[pix_neigh]) 708 { 709 cluster[pix_neigh] = 1; 710 fCluster_pix[++pnt2] = pix_neigh; 711 } 711 712 } 712 }713 713 pnt++; 714 714 } 715 715 716 716 fPseudoSize = pnt; 717 717 718 //if (fPseudoSize < 4) 718 719 // *fLog << "fPseudoSize = " << fPseudoSize << endl; 719 720 720 721 // *fLog << "ClusterID:" <<(*clust).GetClusterId() << " Mult:" << (*clust).GetMultiplicity()<<endl; 721 722 // *fLog <<"PSize: "<< fPseudoSize << " in cell:" << maxcell << " lut:" <<maxlut <<endl; 723 722 /* 723 *fLog <<"PSize: "<< fPseudoSize << " in cell:" << fMaxCell << " lut:" <<maxlut << endl << " Pixels: "; 724 for (int i =0;i<fPseudoSize; i++) 725 *fLog << fCluster_pix[i]+1 <<"; "; 726 *fLog << endl; 727 */ 724 728 return; 725 729 } … … 737 741 void MMcTriggerLvl2::CalcCompactPixels(MGeomCam *geom) 738 742 { 739 memset (fCompactPixel,0, 397*sizeof(Int_t));743 memset (fCompactPixel,0,gsNTrigPixels*sizeof(Int_t)); 740 744 // *fLog << endl << "NEW Event!"; 741 for( UInt_t pixid=0;pixid<397;pixid++)745 for(Int_t pixid=0; pixid<gsNTrigPixels; pixid++) 742 746 { 743 747 // Look if the pixel is fired, otherwise continue 744 748 if (!fFiredPixel[pixid]) 745 continue;749 continue; 746 750 747 751 const MGeomPix &pix=(*geom)[pixid]; 748 752 753 // Reshuffle pixneighbour order, to arrange them (anti)clockwise 754 // around the current pixel (Bubble sorting) 755 // The NeighPixOrdered array has a doubledd size so that 756 // the content in the first index is repeated in the last one 757 // to have a closed loop 758 759 Int_t NeighPixOrdered[2*pix.GetNumNeighbors()]; 760 761 for (Int_t j=0; j<pix.GetNumNeighbors(); j++) 762 NeighPixOrdered[j] = pix.GetNeighbor(j); 763 764 for (Int_t j=0; j<pix.GetNumNeighbors()-1; j++) 765 { 766 for (Int_t jk=pix.GetNumNeighbors()-1;jk>j;--jk) 767 { 768 UInt_t tmp = NeighPixOrdered[j+1]; 769 const MGeomPix &pixneigh = (*geom)[NeighPixOrdered[j]]; 770 for (int k=0; k<pix.GetNumNeighbors(); k++) 771 if (NeighPixOrdered[jk] == pixneigh.GetNeighbor(k)) 772 { 773 NeighPixOrdered[j+1] = NeighPixOrdered[jk]; 774 NeighPixOrdered[jk] = tmp; 775 } 776 } 777 } 778 779 // Duplicate second half to take into account configurations 780 // containing tha last and first pixel 781 for (Int_t j=pix.GetNumNeighbors(); j<2*pix.GetNumNeighbors(); j++) 782 NeighPixOrdered[j] = NeighPixOrdered[j-pix.GetNumNeighbors()]; 783 749 784 // Look for compact pixels. 750 // A compact pixel must have at least fCompactNN adjacent neighbors 751 // It checks the 6 different configurations of neighbors pixels 752 int j=0; 785 // A compact pixel must have at least fCompactNN adjacent fired neighbors 786 // It checks the 6 different configurations of neighbors pixels; if 787 // one has fCompacNN adjacent fired pixels than the pixel pixid is 788 // promoted to compact pixel and saved into the fCompactPixel array. 789 // 753 790 for (int i=0;i<pix.GetNumNeighbors();i++) 754 { 755 //*fLog << pixid <<"->"<< pix.GetNeighbor(i+j) << endl; 756 while ((fFiredPixel[pix.GetNeighbor(i+j)]==1) && (j < fCompactNN)) 757 j++; 758 if (j!=fCompactNN) continue; // configuration doesn't satisfy compact condition 759 760 fCompactPixel[pixid]=1; // pixel is compact 761 762 // *fLog << ","<<pixid; 763 764 break; 765 } 766 } 767 } 768 769 791 { 792 int j=0; // j counts the adjacent fired pixels 793 //*fLog << pixid <<"->"<< pix.GetNeighbor(i+j) << endl; 794 while ((i+j < 2*pix.GetNumNeighbors()) && (fFiredPixel[NeighPixOrdered[i+j]]==1) && (j < fCompactNN)) 795 j++; 796 if (j>=fCompactNN) // configuration satisfies the compact condition 797 { 798 fCompactPixel[pixid]=1; // pixel is compact 799 // *fLog << ","<<pixid; 800 break; 801 } 802 } 803 } 804 805 } 770 806 771 807 // -------------------------------------------------------------------------- … … 778 814 const MMcEvt &h = *(MMcEvt *)fMcEvt; 779 815 fEnergy = h.GetEnergy(); 816 return; 780 817 } 781 818 … … 808 845 fTriggerPattern=0; //initialize 809 846 810 for( UInt_t pixid=0;pixid<397;pixid++)847 for(Int_t pixid=0;pixid<gsNTrigPixels;pixid++) 811 848 { 812 849 // Look if the pixel is fired, otherwise continue 813 850 if (!fFiredPixel[pixid]) 814 continue;851 continue; 815 852 816 853 const MGeomPix &pix=(*geom)[pixid]; … … 824 861 int j=1; 825 862 for (int i=0;i<pix.GetNumNeighbors();i++) 826 if (fFiredPixel[pix.GetNeighbor(i)]==1) j++;863 if (fFiredPixel[pix.GetNeighbor(i)]==1) j++; 827 864 828 865 if (j > fTriggerPattern) 829 fTriggerPattern=j;866 fTriggerPattern=j; 830 867 831 868 if (fTriggerPattern==7) 832 break; // the 7-NN (max) pattern was found: exit869 break; // the 7-NN (max) pattern was found: exit 833 870 834 871 } // next pixel 835 872 } 836 873 874 875 // -------------------------------------------------------------------------- 876 // Look for the cell with higher number of Compact pixels 877 // Return the cell number (starting from 0) 878 // 879 Int_t MMcTriggerLvl2::CalcBiggerCellPseudoSize() 880 { 881 Int_t fMaxCell=-1; 882 883 fCellPseudoSize=0; 884 885 for (Int_t i=0;i<gsNCells;i++) 886 { 887 int size = GetCellCompactPixel(i,fGeomCam); 888 if (size > fCellPseudoSize) 889 { 890 fCellPseudoSize = size; 891 fMaxCell = i; 892 } 893 } 894 895 //*fLog << "fCellPseudoSize = " << fCellPseudoSize << " in cell N. " << fMaxCell+1 << endl; 896 897 return fMaxCell; 898 } 899 900 // -------------------------------------------------------------------------- 901 // Compute the number of compact pixels in one cell 902 // 903 Int_t MMcTriggerLvl2::GetCellCompactPixel(int cell, MGeomCam *geom) 904 { 905 int size=0; 906 907 // check on input variables 908 909 if (cell<0 || cell>gsNCells-1) 910 return(-2); 911 912 //*fLog << " CNN:" << fCompactNN; 913 //*fLog << "Cell: " << cell+1 << " Compat Pixels:"; 914 915 for(Int_t id=0; id<gsNPixInCell; id++) 916 { 917 UInt_t pixid = gsPixelsInCell[id][cell]-1; 918 919 // Look if the pixel is fired, otherwise continue 920 if (!fFiredPixel[pixid]) 921 continue; 922 923 //*fLog << "Fired pix:"<<pixid+1 << " "; 924 925 const MGeomPix &pix=(*geom)[pixid]; 926 927 // Reshuffle pixneighbour order, to arrange them (anti)clockwise 928 // around the current pixel (Bubble sorting) 929 // The NeighPixOrdered has one index more so that 930 // the content in the first index is repeated in the last one 931 // to have a closed loop 932 Int_t NeighPixOrdered[2*pix.GetNumNeighbors()]; 933 for (Int_t j=0; j<pix.GetNumNeighbors(); j++) 934 NeighPixOrdered[j] = pix.GetNeighbor(j); 935 936 for (Int_t j=0; j<pix.GetNumNeighbors()-1; j++) 937 { 938 for (Int_t jk=pix.GetNumNeighbors()-1;jk>j;--jk) 939 { 940 UInt_t tmp = NeighPixOrdered[j+1]; 941 const MGeomPix &pixneigh = (*geom)[NeighPixOrdered[j]]; 942 for (int k=0; k<pix.GetNumNeighbors(); k++) 943 if (NeighPixOrdered[jk] == pixneigh.GetNeighbor(k)) 944 { 945 NeighPixOrdered[j+1] = NeighPixOrdered[jk]; 946 NeighPixOrdered[jk] = tmp; 947 } 948 } 949 } 950 951 // Duplicate second half of the array to take into account configurations 952 // containing tha last and first pixel 953 for (Int_t j=pix.GetNumNeighbors(); j<2*pix.GetNumNeighbors(); j++) 954 NeighPixOrdered[j] = NeighPixOrdered[j-pix.GetNumNeighbors()]; 955 956 // Look for compact pixels. 957 958 // A compact pixel must have at least fCompactNN adjacent neighbors 959 // It checks the 6 different configurations of neighbors pixels. 960 // The neighbour pixels must belong to the cell 961 962 // *fLog << "cell:"<< cell << " ordered pixels:"; 963 /* 964 for (int i=0;i<2*pix.GetNumNeighbors();i++) 965 { 966 if (fFiredPixel[NeighPixOrdered[i]]) 967 *fLog << NeighPixOrdered[i]+1 << "*;"; 968 else 969 *fLog << NeighPixOrdered[i]+1 << ";"; 970 } 971 */ 972 //*fLog <<endl; 973 //*fLog << pixid <<"->"<< pix.GetNumNeighbors() << " CNN="<< fCompactNN <<endl; 974 975 976 for (int i=0;i<pix.GetNumNeighbors();i++) 977 { 978 int j=0; 979 while ((i+j < 2*pix.GetNumNeighbors()) && (fFiredPixel[NeighPixOrdered[i+j]]==1) && (j < fCompactNN) && IsPixelInCell(NeighPixOrdered[i+j],cell) ) 980 j++; 981 982 if (j>=fCompactNN) //configuration satisfies the compact condition 983 { 984 size++; // pixel is compact 985 //*fLog << "->" << pixid+1; 986 break; // (new pixel) 987 } 988 } 989 } 990 991 //*fLog <<" - size:" << size << endl<<endl; 992 993 return size; 994 995 } 996 997 //--------------------------------------------------------------------- 998 // Check if a given pixel belongs to a given cell 999 // 1000 Bool_t MMcTriggerLvl2::IsPixelInCell(Int_t pixel, Int_t cell) 1001 { 1002 for (int i=0; i<gsNPixInCell; i++) 1003 if ((gsPixelsInCell[i][cell]-1) == pixel) 1004 return kTRUE; 1005 1006 return kFALSE; 1007 } 1008 -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.h
r2446 r2918 7 7 8 8 class MMcTrig; 9 10 9 class MMcEvt; 11 12 10 class MGeomCamMagic; 13 14 11 class MGeomCam; 15 12 class MGeomPix; … … 17 14 class MMcTriggerLvl2 : public MParContainer 18 15 { 16 private: 17 18 // Global trigger variables related to the geometry and trigger structures are here defined. 19 // FIXME! this is a temporary solution: these variables should be defined in a GeomTrg class 19 20 20 private:21 static const Int_t fNumPixCell = 36; // Number of pixels in one cell 21 22 22 Int_t fPixels[36][19]; // Array with flag for triggered pixels. 1st idx:pixels in trigger cell; 2nd idx:trigger cell number 23 static const Int_t gsNCells = 19; 24 static const Int_t gsNTrigPixels = 397; 25 static const Int_t gsNPixInCell = 36; 26 static const Int_t gsNLutInCell = 3; 27 static const Int_t gsNPixInLut = 12; 28 Int_t fPixels[gsNPixInCell][gsNCells]; 29 30 // Array with flag for triggered pixels. 1st idx:pixels in trigger cell; 2nd idx:trigger cell number 23 31 24 Int_t fFiredPixel[397]; // Array with flag for triggered pixel. idx: pixel id 32 Int_t fFiredPixel[gsNTrigPixels]; // Array with flag for triggered pixel. idx: pixel id 33 static const Int_t gsPixelsInCell[gsNPixInCell][gsNCells]; 34 static const Int_t gsPixelsInLut[gsNLutInCell][gsNPixInLut]; 25 35 26 static const Int_t gsPixelsInCell[36][19]; 27 static const Int_t gsPixelsInLut[3][12]; 36 Int_t fMaxCell; // Cell with maximum number of fired pixels 28 37 29 Int_t fLutPseudoSize; // number of compact pixels in one lut 30 Int_t fPseudoSize; // Multiplicity of the cluster identified by the L2T 31 Int_t fSizeBiggerCell; // Number of fired pixel in bigger cell 38 Int_t fLutPseudoSize; // number of compact pixels in one lut 39 Int_t fPseudoSize; // Multiplicity of the cluster identified by the L2T 40 Int_t fSizeBiggerCell; // Number of fired pixel in bigger cell 41 Int_t fCompactNN; //Number of NN pixels that define a compact pixel 42 Int_t fCompactPixel[gsNTrigPixels]; //Array with flag for compact pixels 43 Int_t fCluster_pix[gsNTrigPixels]; //Array with pixel in cluster 44 Double_t fEnergy; // Energy of the shower 45 Int_t fTriggerPattern; // x-NN compact trigger pattern; 46 Int_t fCellPseudoSize; // number of compact pixels in one cell 47 // Int_t fCellCompactPixels[fNumPixCell]; // Array with compact pixels in cell 32 48 33 Int_t fCompactNN; //Number of NN pixels that define a compact pixel 34 35 Int_t fCompactPixel[397]; //Array with flag for compact pixels 36 37 Int_t fCluster_pix[397]; //Array with pixel in cluster 38 39 Double_t fEnergy; // Energy of the shower 40 41 Int_t fTriggerPattern; // x-NN compact trigger pattern; 42 43 MMcTrig *fMcTrig; 44 MGeomCam *fGeomCam; 45 46 Int_t CalcBiggerFiredCell(); 47 Int_t CalcBiggerLutPseudoSize(); 48 void CalcPseudoSize(); 49 50 void SetNewCamera(MGeomCam *geom) {fGeomCam = geom;} 51 52 public: 53 54 MMcTriggerLvl2(const char* name = NULL, const char* title = NULL); 55 ~MMcTriggerLvl2(); 56 57 58 virtual void Calc(); 59 60 virtual void Print(Option_t *opt="") const; 61 62 void SetLv1(MMcTrig *trig = NULL); 63 void SetPixelFired(Int_t pixel, Int_t fired=1); 64 65 void SetCompactNN(Int_t neighpix) {fCompactNN=neighpix;} 66 67 Int_t GetPseudoSize() const {return fPseudoSize;} 68 Int_t GetLutPseudoSize() const {return fLutPseudoSize;} 69 Int_t GetSizeBiggerCell() const {return fSizeBiggerCell;} 70 Int_t GetCompactNN() const {return fCompactNN;} 71 72 Int_t GetCellNumberFired(int cell); 73 Int_t GetLutCompactPixel(int cell, int lut); 49 MMcTrig *fMcTrig; 50 MGeomCam *fGeomCam; 74 51 75 52 void CalcCompactPixels(MGeomCam *fCam); 53 void CalcTriggerPattern(MGeomCam *fCam); 54 Int_t CalcBiggerFiredCell(); 55 Int_t CalcBiggerLutPseudoSize(); 56 void CalcPseudoSize(); 57 Int_t CalcCellPseudoSize(); 58 Int_t CalcBiggerCellPseudoSize(); 59 Int_t GetCellCompactPixel(int cell, MGeomCam *fCam); 76 60 77 void GetEnergy(MMcEvt *fMcEvt = NULL);61 void SetNewCamera(MGeomCam *geom) {fGeomCam = geom;} 78 62 79 Double_t GetEnergy() const {return fEnergy;} 80 81 void CalcTriggerPattern(MGeomCam *fCam); 82 Int_t GetTriggerPattern() const {return fTriggerPattern;} 63 public: 83 64 65 MMcTriggerLvl2(const char* name = NULL, const char* title = NULL); 66 ~MMcTriggerLvl2(); 84 67 85 ClassDef(MMcTriggerLvl2,0) // Container for 2nd Level Trigger selection parameters86 }; 68 virtual void Calc(); 69 virtual void Print(Option_t *opt="") const; 87 70 88 #endif 71 void SetLv1(MMcTrig *trig = NULL); 72 void SetPixelFired(Int_t pixel, Int_t fired=1); 73 void SetCompactNN(Int_t neighpix) {fCompactNN=neighpix;} 89 74 75 Int_t GetPseudoSize() const {return fPseudoSize;} 76 Int_t GetLutPseudoSize() const {return fLutPseudoSize;} 77 Int_t GetSizeBiggerCell() const {return fSizeBiggerCell;} 78 Int_t GetCompactNN() const {return fCompactNN;} 79 Int_t GetCellPseudoSize() const {return fCellPseudoSize;} 80 Int_t GetMaxCell() const {return (fMaxCell+1);} // Returns 81 // cell with maximum number of compact pixels 82 Int_t GetCellNumberFired(int cell); 83 Int_t GetLutCompactPixel(int cell, int lut); 84 85 Int_t GetTriggerPattern() const {return fTriggerPattern;} 90 86 87 void GetEnergy(MMcEvt *fMcEvt = NULL); 88 Double_t GetEnergy() const {return fEnergy;} 91 89 90 Bool_t IsPixelInCell(Int_t pixel, Int_t cell); 92 91 93 92 ClassDef(MMcTriggerLvl2,0) // Container for 2nd Level Trigger selection parameters 93 }; 94 95 #endif 96
Note:
See TracChangeset
for help on using the changeset viewer.