CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1TowerFwdJetProducer Class Reference

Inheritance diagram for L1TowerFwdJetProducer:
L1CaloAlgoBase< l1slhc::L1CaloTowerCollection, l1slhc::L1TowerJetCollection > edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

void algorithm (const int &, const int &)
 L1TowerFwdJetProducer (const edm::ParameterSet &)
 ~L1TowerFwdJetProducer ()

Private Member Functions

void calculateFwdJetPosition (l1slhc::L1TowerJet &lJet)

Private Attributes

std::vector< std::pair< int,
int > > 
mHFJetShapeMap
int mJetDiameter
l1slhc::L1TowerJet::tJetShape mJetShape

Detailed Description

Definition at line 13 of file L1TowerFwdJetProducer.cc.


Constructor & Destructor Documentation

L1TowerFwdJetProducer::L1TowerFwdJetProducer ( const edm::ParameterSet aConfig)

Definition at line 32 of file L1TowerFwdJetProducer.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), L1CaloAlgoBase< l1slhc::L1CaloTowerCollection, l1slhc::L1TowerJetCollection >::mEtaOffset, mHFJetShapeMap, mJetDiameter, L1CaloAlgoBase< l1slhc::L1CaloTowerCollection, l1slhc::L1TowerJetCollection >::mPhiOffset, AlCaHLTBitMon_QueryRunRegistry::string, x, and detailsBasic3DVector::y.

                                                                             :
L1CaloAlgoBase < l1slhc::L1CaloTowerCollection, l1slhc::L1TowerJetCollection > ( aConfig )

{
        mJetDiameter = aConfig.getParameter<unsigned>("JetDiameter");
        mPhiOffset = 0;
        //mEtaOffset = -mJetDiameter;
        mEtaOffset = 0;
        // mPhiIncrement = 1;
        // mEtaIncrement = 1;

        mHFJetShapeMap.reserve(256);

        std::string lJetShape = aConfig.getParameter< std::string >("JetShape");
        std::transform( lJetShape.begin() , lJetShape.end() , lJetShape.begin() , ::toupper ); //do the comparison in upper case so config

        std::cout<<" Creating HF jet map." <<std::endl;
        //Create the HF jet shape map: a square 2x2 jet
        for( int x = 0 ; x != mJetDiameter/4 ; ++x ){
                for( int y = 0 ; y != mJetDiameter ; ++y ){
                        mHFJetShapeMap.push_back( std::make_pair( x , y ) );
                }
        }


}
L1TowerFwdJetProducer::~L1TowerFwdJetProducer ( )

Definition at line 59 of file L1TowerFwdJetProducer.cc.

{
}

Member Function Documentation

void L1TowerFwdJetProducer::algorithm ( const int &  aEta,
const int &  aPhi 
) [virtual]

Implements L1CaloAlgoBase< l1slhc::L1CaloTowerCollection, l1slhc::L1TowerJetCollection >.

Definition at line 69 of file L1TowerFwdJetProducer.cc.

References calculateFwdJetPosition(), L1CaloAlgoBase< l1slhc::L1CaloTowerCollection, l1slhc::L1TowerJetCollection >::fetch(), L1CaloAlgoBase< l1slhc::L1CaloTowerCollection, l1slhc::L1TowerJetCollection >::mCaloTriggerSetup, mHFJetShapeMap, L1CaloAlgoBase< l1slhc::L1CaloTowerCollection, l1slhc::L1TowerJetCollection >::mInputCollection, mJetDiameter, mJetShape, and L1CaloAlgoBase< l1slhc::L1CaloTowerCollection, l1slhc::L1TowerJetCollection >::mOutputCollection.

{

  int lTowerIndex = mCaloTriggerSetup->getBin( aEta, aPhi );
  std::pair < int, int > lTowerEtaPhi = mCaloTriggerSetup->getTowerEtaPhi( lTowerIndex );

  l1slhc::L1TowerJet lJet( mJetDiameter, mJetShape , mHFJetShapeMap.size() , lTowerEtaPhi.first , lTowerEtaPhi.second  );


  if(aEta>=60 || aEta<4){
    for ( std::vector< std::pair< int , int > >::const_iterator lHFJetShapeMapIt = mHFJetShapeMap.begin() ; lHFJetShapeMapIt != mHFJetShapeMap.end() ; ++lHFJetShapeMapIt )
    {
    int lPhi = aPhi+(lHFJetShapeMapIt->second);
    if ( lPhi > mCaloTriggerSetup->phiMax(  ) ) lPhi -= 72;
      l1slhc::L1CaloTowerCollection::const_iterator lTowerItr = fetch( aEta+(lHFJetShapeMapIt->first) , lPhi );
//      std::cout<<"Fetching "<<aEta<<","<<lPhi<<" the tower "<< aEta+(lHFJetShapeMapIt->first) <<" , "<<lPhi<<" has energy "<<lTowerItr->E()<<std::endl;

      if ( lTowerItr != mInputCollection->end(  ) )
      {
        l1slhc::L1CaloTowerRef lRef( mInputCollection, lTowerItr - mInputCollection->begin(  ) );
        lJet.addConstituent( lRef );
      }
    }
  } 
  




  if ( lJet.E(  ) > 0 )
  {
    calculateFwdJetPosition( lJet );
    mOutputCollection->insert( lTowerEtaPhi.first, lTowerEtaPhi.second, lJet );
//     std::cout<<" jet "<< aEta<<" , "<< aPhi <<" has energy "<<lJet.E()<<std::endl;

  }

}
void L1TowerFwdJetProducer::calculateFwdJetPosition ( l1slhc::L1TowerJet lJet) [private]

Definition at line 110 of file L1TowerFwdJetProducer.cc.

References abs, l1slhc::L1TowerJet::E(), eta, l1slhc::L1TowerJet::iEta(), l1slhc::L1TowerJet::iPhi(), l1slhc::L1TowerJet::JetSize(), phi, pi, and l1slhc::L1TowerJet::setP4().

Referenced by algorithm().

{

  double eta;
  //double halfTowerOffset = 0.0435;

  double JetSize = double(lJet.JetSize()) / 2.0;

  if(  abs( lJet.iEta() ) == 29 ) eta = 3.5;
  if(  abs( lJet.iEta() ) == 30 ) eta = 4.0;
  if(  abs( lJet.iEta() ) == 31 ) eta = 4.5;
  if(  abs( lJet.iEta() ) == 32 ) eta = 5.0;  

  if(lJet.iEta()<0) eta = -eta;

  double phi = ( ( lJet.iPhi(  ) + JetSize ) * 0.0873 );
  //Need this because 72*0.087 != 2pi: else get uneven phi dist
  phi -= 0.0873;
  double pi=(72*0.0873)/2;
  if(phi>pi) phi-=2*pi; 
  double Et = double( lJet.E(  ) ) / 2.;

  lJet.setP4( math::PtEtaPhiMLorentzVector( Et, eta, phi, 0. ) );

} 

Member Data Documentation

std::vector< std::pair< int , int > > L1TowerFwdJetProducer::mHFJetShapeMap [private]

Definition at line 29 of file L1TowerFwdJetProducer.cc.

Referenced by algorithm(), and L1TowerFwdJetProducer().

Definition at line 26 of file L1TowerFwdJetProducer.cc.

Referenced by algorithm(), and L1TowerFwdJetProducer().

Definition at line 27 of file L1TowerFwdJetProducer.cc.

Referenced by algorithm().