CMS 3D CMS Logo

Public Member Functions | Private Member Functions

L1CaloJetProducer Class Reference

Inheritance diagram for L1CaloJetProducer:
L1CaloAlgoBase< l1slhc::L1CaloRegionCollection, l1slhc::L1CaloJetCollection > edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Member Functions

void calculateJetPosition (l1slhc::L1CaloJet &lJet)

Detailed Description

Definition at line 9 of file L1CaloJetProducer.cc.


Constructor & Destructor Documentation

L1CaloJetProducer::L1CaloJetProducer ( const edm::ParameterSet aConfig)
L1CaloJetProducer::~L1CaloJetProducer ( )

Definition at line 33 of file L1CaloJetProducer.cc.

{
}

Member Function Documentation

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

Implements L1CaloAlgoBase< l1slhc::L1CaloRegionCollection, l1slhc::L1CaloJetCollection >.

Definition at line 41 of file L1CaloJetProducer.cc.

References l1slhc::L1CaloJet::addConstituent(), calculateJetPosition(), l1slhc::L1CaloJet::E(), L1CaloAlgoBase< l1slhc::L1CaloRegionCollection, l1slhc::L1CaloJetCollection >::fetch(), L1CaloAlgoBase< l1slhc::L1CaloRegionCollection, l1slhc::L1CaloJetCollection >::mCaloTriggerSetup, L1CaloAlgoBase< l1slhc::L1CaloRegionCollection, l1slhc::L1CaloJetCollection >::mInputCollection, and L1CaloAlgoBase< l1slhc::L1CaloRegionCollection, l1slhc::L1CaloJetCollection >::mOutputCollection.

{


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


        l1slhc::L1CaloJet lJet( lRegionEtaPhi.first, lRegionEtaPhi.second );

/*
        for ( int lRegionEta = aEta; lRegionEta <= aEta + 4; lRegionEta+=4 )
        {
                for ( int lRegionPhi = aPhi; lRegionPhi <= aPhi + 4; lRegionPhi+=4 )
                {

                        l1slhc::L1CaloRegionCollection::const_iterator lRegionItr = fetch( lRegionEta, lRegionPhi );
*/

        for ( int lRegionEta = 0; lRegionEta != 2; ++lRegionEta )
        {
                for ( int lRegionPhi = 0; lRegionPhi != 2; ++lRegionPhi )
                {
                        l1slhc::L1CaloRegionCollection::const_iterator lRegionItr = fetch( aEta+(lRegionEta<<2) , aPhi+(lRegionPhi<<2) );
                        if ( lRegionItr != mInputCollection->end(  ) )
                        {
                                l1slhc::L1CaloRegionRef lRef( mInputCollection, lRegionItr - mInputCollection->begin(  ) );
                                lJet.addConstituent( lRef );
                        }
                }
        }

        if ( lJet.E(  ) > 0 )
        {
                calculateJetPosition( lJet );
                mOutputCollection->insert( lRegionEtaPhi.first, lRegionEtaPhi.second, lJet );
        }

}
void L1CaloJetProducer::calculateJetPosition ( l1slhc::L1CaloJet lJet) [private]

Definition at line 86 of file L1CaloJetProducer.cc.

References abs, l1slhc::L1CaloJet::E(), eta, i, l1slhc::L1CaloJet::iEta(), l1slhc::L1CaloJet::iPhi(), phi, and l1slhc::L1CaloJet::setP4().

Referenced by algorithm().

{

        // Calculate float value of eta for barrel+endcap(L.Gray)
        double eta = -1982.;            // an important year...
        double etaOffset = 0.0435;  //0.087 / 2.0;
        int abs_eta = abs( lJet.iEta(  ) + 4 );

        if ( abs_eta <= 20 )
        {
                eta = ( abs_eta * 0.0870 ) - etaOffset;
        }
        else
        {
                const double endcapEta[8] = { 0.09, 0.1, 0.113, 0.129, 0.15, 0.178, 0.15, 0.35 };
                //int offset = abs( lJet.iEta(  ) + 4 ) - 21;
                abs_eta -= 21;
        
                eta = 1.74; //( 20 * 0.0870 );  // -etaOffset;
//              for ( int i = 0; i <= offset; ++i )
                for ( int i = 0; i <= abs_eta; ++i )
                {
                        eta += endcapEta[i];
                }
//              eta -= endcapEta[abs( lJet.iEta(  ) + 4 ) - 21] / 2.;
                eta -= endcapEta[abs_eta] / 2.;
        }

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

//      double phi = ( ( lJet.iPhi(  ) + 4 ) * 0.087 ) - 0.087 / 2.;
        double phi = ( lJet.iPhi(  ) * 0.087 ) + 0.3045;
        double Et = double( lJet.E(  ) ) / 2.;

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