CMS 3D CMS Logo

L1GctTdrJetFinder Class Reference

3*3 sliding window algorithm jet finder. More...

#include <L1Trigger/GlobalCaloTrigger/interface/L1GctTdrJetFinder.h>

Inheritance diagram for L1GctTdrJetFinder:

L1GctJetFinderBase L1GctProcessor

List of all members.

Public Member Functions

virtual void fetchInput ()
 get input data from sources
 L1GctTdrJetFinder (int id)
 id is 0-8 for -ve Eta jetfinders, 9-17 for +ve Eta, for increasing Phi.
virtual void process ()
 process the data, fill output buffers
 ~L1GctTdrJetFinder ()

Protected Member Functions

virtual unsigned centralCol0 () const
virtual unsigned maxRegionsIn () const
virtual unsigned int nCols () const

Private Member Functions

ULong calcJetEnergy (const UShort centreIndex, const bool boundary=false) const
 Returns energy sum of the 9 regions centred (physically) about centreIndex. Set boundary = true if at edge of HCAL.
L1CaloRegionDetId calcJetPosition (const UShort centreIndex) const
 returns the encoded (eta, phi) position of the centre region
bool calcJetTauVeto (const UShort centreIndex, const bool boundary=false) const
 Returns combined tauVeto of the 9 regions centred (physically) about centreIndex. Set boundary = true if at edge of Endcap.
bool detectJet (const UShort centreIndex, const bool boundary=false) const
 Returns true if region index is the centre of a jet. Set boundary = true if at edge of HCAL.
void findJets ()
 Here is the TDR 3x3 sliding window jet finder algorithm.

Static Private Attributes

static const unsigned int CENTRAL_COL0 = 1
static const unsigned int MAX_REGIONS_IN = (((L1CaloRegionDetId::N_ETA)/2)+1)*L1GctTdrJetFinder::N_COLS
 The real jetFinders must define these constants.
static const unsigned int N_COLS = 4

Friends

std::ostream & operator<< (std::ostream &os, const L1GctTdrJetFinder &algo)
 Overload << operator.


Detailed Description

3*3 sliding window algorithm jet finder.

Locates the jets from 48 inputted L1CaloRegions. This uses the 3*3 sliding window algorithm.

The the filling of the input L1CaloRegions happens in the L1GctJetFinderBase class

Inputted regions are expected in a certain order with respect to the index i:

Regions should arrive running from the middle (eta=0) of the detector out towards the edge of the forward HCAL, and then moving across in columns like this but increasing in phi each time.

E.g. for 48 inputted regions: region 0: phi=0, other side of eta=0 line (shared data). region 1: phi=0, but correct side of eta=0 (shared data). region 11: phi=0, edge of Forward HCAL (shared data). region 12: phi=20, other side of eta=0 line (shared data) region 13: phi=20, start of jet search area region 23: phi=20, edge of HF (jet search area) etc.

In the event of neighbouring regions having the same energy, this will locate the jet in the region furthest from eta=0 that has the lowest value of phi.

The jet finder now stores jets with (eta, phi) information encoded in an L1CaloRegionDetId.

Modified to use L1GctJetFinderBase class by Greg Heath, June 2006.

Definition at line 54 of file L1GctTdrJetFinder.h.


Constructor & Destructor Documentation

L1GctTdrJetFinder::L1GctTdrJetFinder ( int  id  ) 

id is 0-8 for -ve Eta jetfinders, 9-17 for +ve Eta, for increasing Phi.

Definition at line 15 of file L1GctTdrJetFinder.cc.

References CENTRAL_COL0, L1GctJetFinderBase::m_id, L1GctJetFinderBase::m_minColThisJf, L1CaloRegionDetId::N_PHI, and L1GctProcessor::reset().

00015                                           :
00016   L1GctJetFinderBase(id)
00017 {
00018   this->reset();
00019   // Initialise parameters for Region input calculations in the 
00020   // derived class so we get the right values of constants.
00021   static const unsigned NPHI = L1CaloRegionDetId::N_PHI;
00022   m_minColThisJf = (NPHI + m_id*2 - CENTRAL_COL0) % NPHI;
00023 }

L1GctTdrJetFinder::~L1GctTdrJetFinder (  ) 

Definition at line 25 of file L1GctTdrJetFinder.cc.

00026 {
00027 }


Member Function Documentation

L1GctJetFinderBase::ULong L1GctTdrJetFinder::calcJetEnergy ( const UShort  centreIndex,
const bool  boundary = false 
) const [private]

Returns energy sum of the 9 regions centred (physically) about centreIndex. Set boundary = true if at edge of HCAL.

Definition at line 166 of file L1GctTdrJetFinder.cc.

References L1GctJetFinderBase::COL_OFFSET, relval_parameters_module::energy, and L1GctJetFinderBase::m_inputRegions.

Referenced by findJets().

00167 {
00168   ULong energy = 0;
00169     
00170   if(!boundary)
00171   {
00172     for(int column = -1; column <= +1; ++column)
00173     {
00174       energy += m_inputRegions.at(centreIndex-1 + (column*COL_OFFSET)).et() +
00175                 m_inputRegions.at( centreIndex  + (column*COL_OFFSET)).et() +
00176                 m_inputRegions.at(centreIndex+1 + (column*COL_OFFSET)).et();
00177     }
00178   }
00179   else
00180   {
00181     for(int column = -1; column <= +1; ++column)
00182     {
00183       energy += m_inputRegions.at(centreIndex-1 + (column*COL_OFFSET)).et() +
00184                 m_inputRegions.at( centreIndex  + (column*COL_OFFSET)).et();
00185     }
00186   }
00187 
00188   return energy;                                   
00189 }

L1CaloRegionDetId L1GctTdrJetFinder::calcJetPosition ( const UShort  centreIndex  )  const [private]

returns the encoded (eta, phi) position of the centre region

Definition at line 192 of file L1GctTdrJetFinder.cc.

References L1GctJetFinderBase::m_inputRegions.

Referenced by findJets().

00193 {
00194   return m_inputRegions.at(centreIndex).id();
00195 }

bool L1GctTdrJetFinder::calcJetTauVeto ( const UShort  centreIndex,
const bool  boundary = false 
) const [private]

Returns combined tauVeto of the 9 regions centred (physically) about centreIndex. Set boundary = true if at edge of Endcap.

Definition at line 198 of file L1GctTdrJetFinder.cc.

References L1GctJetFinderBase::COL_OFFSET, and L1GctJetFinderBase::m_inputRegions.

Referenced by findJets().

00199 {
00200   bool partial[3] = {false, false, false};
00201     
00202   if(!boundary)
00203   {
00204     for(int column = -1; column <= +1; ++column)
00205     {
00206       partial[column+1] = m_inputRegions.at(centreIndex-1 + (column*COL_OFFSET)).tauVeto() ||
00207                           m_inputRegions.at( centreIndex  + (column*COL_OFFSET)).tauVeto() ||
00208                           m_inputRegions.at(centreIndex+1 + (column*COL_OFFSET)).tauVeto();
00209     }
00210   }
00211   else
00212   {
00213     for(int column = -1; column <= +1; ++column)
00214     {
00215       partial[column+1] = m_inputRegions.at(centreIndex-1 + (column*COL_OFFSET)).tauVeto() ||
00216                           m_inputRegions.at( centreIndex  + (column*COL_OFFSET)).tauVeto();
00217     }
00218   }
00219   return partial[0] || partial[1] || partial[2];
00220 }

virtual unsigned L1GctTdrJetFinder::centralCol0 (  )  const [inline, protected, virtual]

Reimplemented from L1GctJetFinderBase.

Definition at line 77 of file L1GctTdrJetFinder.h.

References CENTRAL_COL0.

Referenced by findJets().

00077 { return CENTRAL_COL0; }

bool L1GctTdrJetFinder::detectJet ( const UShort  centreIndex,
const bool  boundary = false 
) const [private]

Returns true if region index is the centre of a jet. Set boundary = true if at edge of HCAL.

Definition at line 99 of file L1GctTdrJetFinder.cc.

References L1GctJetFinderBase::COL_OFFSET, and L1GctJetFinderBase::m_inputRegions.

Referenced by findJets().

00100 {
00101   if(!boundary)  //Not at boundary, so use 3*3 window of regions to determine if a jet
00102   {
00103     // Get the energy of the central region
00104     ULong testEt = m_inputRegions.at(centreIndex).et();
00105         
00106     //Test if our region qualifies as a jet by comparing its energy with the energies of the
00107     //surrounding eight regions.  In the event of neighbouring regions with identical energy,
00108     //this will locate the jet in the lower-most (furthest away from eta=0), left-most (least phi) region.
00109     if(testEt >  m_inputRegions.at(centreIndex-1-COL_OFFSET).et() &&
00110        testEt >  m_inputRegions.at(centreIndex - COL_OFFSET).et() &&
00111        testEt >  m_inputRegions.at(centreIndex+1-COL_OFFSET).et() &&
00112            
00113        testEt >= m_inputRegions.at(centreIndex - 1).et() &&
00114        testEt >  m_inputRegions.at(centreIndex + 1).et() &&
00115            
00116        testEt >= m_inputRegions.at(centreIndex-1+COL_OFFSET).et() &&
00117        testEt >= m_inputRegions.at(centreIndex + COL_OFFSET).et() &&
00118        testEt >= m_inputRegions.at(centreIndex+1+COL_OFFSET).et())
00119     {
00120       return true;
00121     }
00122 //USE THIS BLOCK INSTEAD IF YOU WANT OVERFLOW BIT FUNCTIONALITY        
00123 //*** BUT IT WILL NEED MODIFICATION SINCE L1GctRegion IS OBSOLETE ***
00124 /*    // Get the energy of the central region & OR the overflow bit to become the MSB
00125     ULong testEt = (m_inputRegions.at(centreIndex).et() | (m_inputRegions.at(centreIndex).getOverFlow() << L1GctRegion::ET_BITWIDTH));
00126         
00127     //Test if our region qualifies as a jet by comparing its energy with the energies of the
00128     //surrounding eight regions.  In the event of neighbouring regions with identical energy,
00129     //this will locate the jet in the lower-most (furthest away from eta=0), left-most (least phi) region.
00130     if(testEt >  (m_inputRegions.at(centreIndex-1-COL_OFFSET).et() | (m_inputRegions.at(centreIndex-1-COL_OFFSET).getOverFlow() << L1GctRegion::ET_BITWIDTH)) &&
00131        testEt >  (m_inputRegions.at(centreIndex - COL_OFFSET).et() | (m_inputRegions.at(centreIndex - COL_OFFSET).getOverFlow() << L1GctRegion::ET_BITWIDTH)) &&
00132        testEt >  (m_inputRegions.at(centreIndex+1-COL_OFFSET).et() | (m_inputRegions.at(centreIndex+1-COL_OFFSET).getOverFlow() << L1GctRegion::ET_BITWIDTH)) &&
00133            
00134        testEt >= (m_inputRegions.at(centreIndex - 1).et() | (m_inputRegions.at(centreIndex - 1).getOverFlow() << L1GctRegion::ET_BITWIDTH)) &&
00135        testEt >  (m_inputRegions.at(centreIndex + 1).et() | (m_inputRegions.at(centreIndex + 1).getOverFlow() << L1GctRegion::ET_BITWIDTH)) &&
00136            
00137        testEt >= (m_inputRegions.at(centreIndex-1+COL_OFFSET).et() | (m_inputRegions.at(centreIndex-1+COL_OFFSET).getOverFlow() << L1GctRegion::ET_BITWIDTH)) &&
00138        testEt >= (m_inputRegions.at(centreIndex + COL_OFFSET).et() | (m_inputRegions.at(centreIndex + COL_OFFSET).getOverFlow() << L1GctRegion::ET_BITWIDTH)) &&
00139        testEt >= (m_inputRegions.at(centreIndex+1+COL_OFFSET).et() | (m_inputRegions.at(centreIndex+1+COL_OFFSET).getOverFlow() << L1GctRegion::ET_BITWIDTH)))
00140     {
00141       return true;
00142     }
00143 */  //END OVERFLOW FUNCTIONALITY       
00144   }
00145   else    //...so only test surround 5 regions in our jet testing.
00146   {    
00147     // Get the energy of the central region
00148     // Don't need all the overflow bit adjustments as above, since we are in the HF here
00149     ULong testEt = m_inputRegions.at(centreIndex).et();        
00150         
00151     if(testEt >  m_inputRegions.at(centreIndex-1-COL_OFFSET).et() &&
00152        testEt >  m_inputRegions.at(centreIndex - COL_OFFSET).et() &&
00153        
00154        testEt >= m_inputRegions.at(centreIndex - 1).et() &&
00155            
00156        testEt >= m_inputRegions.at(centreIndex-1+COL_OFFSET).et() &&
00157        testEt >= m_inputRegions.at(centreIndex + COL_OFFSET).et())
00158     {
00159       return true;
00160     }
00161   }
00162   return false;           
00163 }

void L1GctTdrJetFinder::fetchInput (  )  [virtual]

get input data from sources

Implements L1GctJetFinderBase.

Definition at line 37 of file L1GctTdrJetFinder.cc.

00038 {
00039 }

void L1GctTdrJetFinder::findJets (  )  [private]

Here is the TDR 3x3 sliding window jet finder algorithm.

HERE IS THE JETFINDER CODE.

Definition at line 52 of file L1GctTdrJetFinder.cc.

References calcJetEnergy(), calcJetPosition(), calcJetTauVeto(), centralCol0(), L1GctJetFinderBase::COL_OFFSET, detectJet(), L1GctJetFinderBase::m_inputRegions, L1GctJetFinderBase::m_outputJets, L1GctJetFinderBase::MAX_JETS_OUT, MAX_REGIONS_IN, and row.

Referenced by process().

00053 {
00054   UShort jetNum = 0; //holds the number of jets currently found
00055   UShort centreIndex = COL_OFFSET*this->centralCol0();
00056   for(UShort column = 0; column <2; ++column)  //Find jets in the central search region
00057   {
00058     //don't include row zero as it is not in the search region
00059     ++centreIndex;
00060     for (UShort row = 1; row < COL_OFFSET; ++row)  
00061     {
00062       //Determine if we are at end of the HF or not (so need 3*2 window)
00063       bool hfBoundary = (row == COL_OFFSET-1);
00064       //Determine if we are at the end of the endcap HCAL regions, so need boundary condition tauveto
00065       bool heBoundary = (row == COL_OFFSET-5);
00066 
00067       //debug checks for improper input indices
00068       if ((centreIndex % COL_OFFSET != 0)  //Don't want the 4 regions from other half of detector
00069           && (centreIndex >= COL_OFFSET)  //Don't want the shared column to left of jet finding area
00070           && (centreIndex < (MAX_REGIONS_IN - COL_OFFSET))) { //Don't want column to the right either
00071                         
00072         if(detectJet(centreIndex, hfBoundary))
00073           {
00074             if (jetNum < MAX_JETS_OUT) {
00075             
00076               m_outputJets.at(jetNum).setRawsum(calcJetEnergy(centreIndex, hfBoundary));
00077               m_outputJets.at(jetNum).setDetId(calcJetPosition(centreIndex));
00078               m_outputJets.at(jetNum).setBx(m_inputRegions.at(centreIndex).bx());
00079               if(row < COL_OFFSET-4)  //if we are not in the HF, perform tauVeto analysis
00080                 {
00081                   m_outputJets.at(jetNum).setForward(false);
00082                   m_outputJets.at(jetNum).setTauVeto(calcJetTauVeto(centreIndex,heBoundary));
00083                 }
00084               else //can't be a tau jet because we are in the HF
00085                 {
00086                   m_outputJets.at(jetNum).setForward(true);
00087                   m_outputJets.at(jetNum).setTauVeto(true);
00088                 }
00089               ++jetNum;
00090             }
00091           }
00092         ++centreIndex;
00093       }
00094     }
00095   }
00096 }

virtual unsigned L1GctTdrJetFinder::maxRegionsIn (  )  const [inline, protected, virtual]

Reimplemented from L1GctJetFinderBase.

Definition at line 76 of file L1GctTdrJetFinder.h.

References MAX_REGIONS_IN.

00076 { return MAX_REGIONS_IN; }

virtual unsigned int L1GctTdrJetFinder::nCols (  )  const [inline, protected, virtual]

Reimplemented from L1GctJetFinderBase.

Definition at line 78 of file L1GctTdrJetFinder.h.

References N_COLS.

00078 { return N_COLS; }

void L1GctTdrJetFinder::process (  )  [virtual]

process the data, fill output buffers

Implements L1GctJetFinderBase.

Definition at line 41 of file L1GctTdrJetFinder.cc.

References L1GctJetFinderBase::doEnergySums(), findJets(), L1GctJetFinderBase::setupOk(), and L1GctJetFinderBase::sortJets().

00042 {
00043   if (setupOk()) {
00044     findJets();
00045     sortJets();
00046     doEnergySums();
00047   }
00048 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const L1GctTdrJetFinder algo 
) [friend]

Overload << operator.


Member Data Documentation

const unsigned int L1GctTdrJetFinder::CENTRAL_COL0 = 1 [static, private]

Reimplemented from L1GctJetFinderBase.

Definition at line 85 of file L1GctTdrJetFinder.h.

Referenced by centralCol0(), and L1GctTdrJetFinder().

const unsigned int L1GctTdrJetFinder::MAX_REGIONS_IN = (((L1CaloRegionDetId::N_ETA)/2)+1)*L1GctTdrJetFinder::N_COLS [static, private]

The real jetFinders must define these constants.

Dependent on number of rows and columns.

Reimplemented from L1GctJetFinderBase.

Definition at line 83 of file L1GctTdrJetFinder.h.

Referenced by findJets(), and maxRegionsIn().

const unsigned int L1GctTdrJetFinder::N_COLS = 4 [static, private]

Reimplemented from L1GctJetFinderBase.

Definition at line 84 of file L1GctTdrJetFinder.h.

Referenced by nCols().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:39 2009 for CMSSW by  doxygen 1.5.4