Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121023
b: "refs/heads/CMSSW_7_0_X"
c: e3ccbef
h: "refs/heads/CMSSW_7_0_X"
i:
  121021: b3f93fa
  121019: 48f2cc8
  121015: 87ade4d
  121007: 9abb7fc
  120991: 8edee59
  120959: 7aa1ab9
v: v3
  • Loading branch information
Robyn Elizabeth Lucas committed Oct 10, 2012
1 parent 6f96498 commit 426ff8f
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 77 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"refs/heads/hi_d20131223": d7335b053d7fe03e98f9f59af6a20004362628e8
refs/heads/gh-pages: a3d9046c56a3ca3dc64ad63f7295276c81ac876a
"refs/heads/analysis_53X_01": 3019419e9784b2b092fc6b5c503b2e0177cbe926
"refs/heads/CMSSW_7_0_X": 12b62293edbfaf76c8834be0b49f7acc2af313d4
"refs/heads/CMSSW_7_0_X": e3ccbef71c13a71b9b111bc87f24793e7d519b7b
Original file line number Diff line number Diff line change
Expand Up @@ -103,101 +103,90 @@ L1TowerJetProducer::~L1TowerJetProducer( )
void L1TowerJetProducer::algorithm( const int &aEta, const int &aPhi )
{


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


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

for ( std::vector< std::pair< int , int > >::const_iterator lJetShapeMapIt = mJetShapeMap.begin() ; lJetShapeMapIt != mJetShapeMap.end() ; ++lJetShapeMapIt )
{
int lPhi = aPhi+(lJetShapeMapIt->second);
if ( lPhi > mCaloTriggerSetup->phiMax( ) ) lPhi -= 72; //mCaloTriggerSetup->phiMax( );

l1slhc::L1CaloTowerCollection::const_iterator lTowerItr = fetch( aEta+(lJetShapeMapIt->first) , lPhi );
if ( lTowerItr != mInputCollection->end( ) )
{
l1slhc::L1CaloTowerRef lRef( mInputCollection, lTowerItr - mInputCollection->begin( ) );
lJet.addConstituent( lRef );
}
}

if ( lJet.E( ) > 0 )
{
calculateJetPosition( lJet );
mOutputCollection->insert( lTowerEtaPhi.first, lTowerEtaPhi.second, lJet );
//std::cout << "towerjet " << lJet.p4( ) << std::endl;
}
int lTowerIndex = mCaloTriggerSetup->getBin( aEta, aPhi );
std::pair < int, int > lTowerEtaPhi = mCaloTriggerSetup->getTowerEtaPhi( lTowerIndex );

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

for ( std::vector< std::pair< int , int > >::const_iterator lJetShapeMapIt = mJetShapeMap.begin() ; lJetShapeMapIt != mJetShapeMap.end() ; ++lJetShapeMapIt )
{
int lPhi = aPhi+(lJetShapeMapIt->second);
if ( lPhi > mCaloTriggerSetup->phiMax( ) ) lPhi -= 72; //mCaloTriggerSetup->phiMax( );

l1slhc::L1CaloTowerCollection::const_iterator lTowerItr = fetch( aEta+(lJetShapeMapIt->first) , lPhi );

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

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

}

}





// This function needs validating!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
void L1TowerJetProducer::calculateJetPosition( l1slhc::L1TowerJet & lJet )
{

double eta;
double halfTowerOffset = 0.0435;
double eta;
double halfTowerOffset = 0.0435;

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

int abs_eta = abs( lJet.iEta( ) + int(JetSize) );
int abs_eta =lJet.iEta( ) + int(JetSize);
if ( abs_eta < 21 )
{

if ( abs_eta < 21 )
{
// eta = ( abs_eta * 0.0870 ) - halfTowerOffset;
// if( lJet.JetSize() % 2 == 1 ){
// eta += halfTowerOffset;
// }
eta = ( abs_eta * 0.0870 );

if( lJet.JetSize() % 2 == 1 ){
eta += halfTowerOffset;
}

eta = ( abs_eta * 0.0870 );
if( lJet.JetSize() % 2 == 0 ){
eta -= halfTowerOffset;
}
}
else
{
const double endcapEta[8] = { 0.09, 0.1, 0.113, 0.129, 0.15, 0.178, 0.15, 0.35 };
abs_eta -= 21;

}
else
{
const double endcapEta[8] = { 0.09, 0.1, 0.113, 0.129, 0.15, 0.178, 0.15, 0.35 };
abs_eta -= 21;

eta = 1.74;

// for ( int i = 0; i <= abs_eta; ++i )
// {
// eta += endcapEta[i];
// }
// eta -= endcapEta[abs_eta] / 2.;
// if( lJet.JetSize() % 2 == 1 ){
// eta += endcapEta[i] / 2.;
// }

for ( int i = 0; i != abs_eta; ++i )
{
eta += endcapEta[i];
}
eta = 1.74;

if( lJet.JetSize() % 2 == 0 ){
eta += endcapEta[abs_eta] / 2.;
}else{
eta += endcapEta[abs_eta];
}
for ( int i = 0; i != abs_eta; ++i )
{
eta += endcapEta[i];
}

if( lJet.JetSize() % 2 == 0 ){
eta += endcapEta[abs_eta] / 2.;
}else{
eta += endcapEta[abs_eta];
}

}
}

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

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

lJet.setP4( math::PtEtaPhiMLorentzVector( Et, eta, phi, 0. ) );
}
double phi = ( ( lJet.iPhi( ) + JetSize ) * 0.087 );
//Need this because 72*0.087 != 2pi: else get uneven phi dist
phi -= 0.087;
double pi=(72*0.087)/2;
if(phi>pi) phi-=2*pi;

double Et = double( lJet.E( ) ) / 2.;

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

}




Expand Down

0 comments on commit 426ff8f

Please sign in to comment.