Ignore:
Timestamp:
10/30/03 18:12:46 (21 years ago)
Author:
stamerra
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc

    r2365 r2446  
    6969// the standard spiral counting
    7070// (Note: Pixels start to count from 1 instead of 0)
     71//
     72// This correspondence is valid only for MAGIC-like geometries!
    7173//
    7274const  Int_t  MMcTriggerLvl2::gsPixelsInCell[36][19] = {
     
    123125//  Default constructor
    124126//
    125 MMcTriggerLvl2::MMcTriggerLvl2(const char *name, const char *title)
     127MMcTriggerLvl2::MMcTriggerLvl2(const char *name, const char *title):fCompactNN(2),fTriggerPattern(0)
    126128{
    127129  fName = name ? name : ClassName();
     
    138140  // create a new camera
    139141  SetNewCamera(new MGeomCamMagic);
     142
    140143}
    141144
     
    181184            }
    182185          *fLog << endl;
    183         }
     186        }     
    184187    }
    185188  else if (str.Contains("cell", TString::kIgnoreCase))
     
    201204      *fLog << "   - PseudoSize     = " << fPseudoSize << endl;
    202205      *fLog << "   - BiggerCellSize = " << fSizeBiggerCell << endl;
     206      *fLog << "   - TriggerPattern = " << fTriggerPattern << endl;
    203207    }
    204208 
     
    755759
    756760
    757 void MMcTriggerLvl2::CalcEnergy(MMcEvt *fMcEvt)
     761// --------------------------------------------------------------------------
     762// 
     763//  The Energy has to be given by this class to the Energy-PSSize correlation
     764//   histogram (MHMcTriggerLvl2) 
     765//
     766void MMcTriggerLvl2::GetEnergy(MMcEvt *fMcEvt)
    758767{
    759768  const MMcEvt &h = *(MMcEvt *)fMcEvt;
     
    762771
    763772
    764 
     773// --------------------------------------------------------------------------
     774// 
     775//   Looks for a x-NN compact pattern in the whole camera
     776//   We have x-NN compact pattern when a triggered pix has
     777//   x-1 triggered neighbor pixels. 
     778//   The variable fTriggerPattern = x is computed
     779//   (x= 3,4,5,6,7) 
     780//
     781//   x=3   * *
     782//          *        *
     783//            x=4   * *
     784//                   *       
     785//                       * *
     786//                 x=5  * * *
     787//          *
     788//   x=6   * * *
     789//          * *
     790//               * *
     791//          x=7 * * *
     792//               * *
     793//
     794void MMcTriggerLvl2::CalcTriggerPattern(MGeomCam *geom)
     795{
     796  fTriggerPattern=0; //initialize
     797
     798  for(UInt_t pixid=0;pixid<397;pixid++)
     799    {
     800      // Look if the pixel is fired, otherwise continue
     801      if (!fFiredPixel[pixid])
     802        continue;
     803     
     804      const MGeomPix &pix=(*geom)[pixid];
     805     
     806      // Look for x-NN compact pattern
     807      // If a x-NN pattern exists then a pixel must have
     808      // at least x-1 adjacent neighbors (look at patterns)
     809      // For each triggered pixel the number of adjacent triggered pixels is counted.
     810      //
     811      int j=1;
     812      for (int i=0;i<pix.GetNumNeighbors();i++)
     813        if (fFiredPixel[pix.GetNeighbor(i)]==1) j++;
     814             
     815      if (j > fTriggerPattern)
     816        fTriggerPattern=j;       
     817
     818      if (fTriggerPattern==7)
     819          break;         // the 7-NN (max) pattern was found: exit 
     820
     821    } // next pixel
     822}
     823
  • trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.h

    r2365 r2446  
    3939  Double_t fEnergy;  // Energy of the shower
    4040
     41  Int_t fTriggerPattern; // x-NN compact trigger pattern;
    4142
    4243  MMcTrig *fMcTrig;
     
    7475  void CalcCompactPixels(MGeomCam *fCam);
    7576
    76   void CalcEnergy(MMcEvt *fMcEvt = NULL);
     77  void GetEnergy(MMcEvt *fMcEvt = NULL);
    7778
    7879  Double_t GetEnergy() const    {return fEnergy;}
     80 
     81  void CalcTriggerPattern(MGeomCam *fCam);
     82  Int_t GetTriggerPattern() const {return fTriggerPattern;}
    7983
    8084
  • trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc

    r2365 r2446  
    9595        return kFALSE;
    9696    }
    97 
     97    // Check if fCam is a Magic geometry: only MGeomCamMagic geometry and
     98    // geometries with 577 pixels are now accepted by MMcTriggerLvl2
     99    if (fCam->GetNumPixels()!= 577)
     100      {
     101        *fLog << dbginf << "MGeomCam has a wrong geometry; only MAGIC geometry (577 pixels) is accepted by now... aborting" <<endl;
     102        return kFALSE;
     103      }
    98104    fMMcTriggerLvl2 = (MMcTriggerLvl2*)pList->FindObject("MMcTriggerLvl2");
    99105    if (!fMMcTriggerLvl2)
     
    132138Int_t MMcTriggerLvl2Calc::Process()
    133139{
    134   fMMcTriggerLvl2->CalcEnergy(fMcEvt);
     140  fMMcTriggerLvl2->GetEnergy(fMcEvt);
    135141
    136142  fMMcTriggerLvl2->SetLv1(fMcTrig);
     
    139145
    140146  fMMcTriggerLvl2->Calc();
     147
     148  fMMcTriggerLvl2->CalcTriggerPattern(fCam);
    141149
    142150  return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.