#include <L1Trigger/L1ExtraFromDigis/interface/L1ExtraParticlesProd.h>
Public Member Functions | |
L1ExtraParticlesProd (const edm::ParameterSet &) | |
~L1ExtraParticlesProd () | |
Private Member Functions | |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
math::PtEtaPhiMLorentzVector | gctLorentzVector (const double &et, const L1GctCand &cand, const L1CaloGeometry *geom, bool central) |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
edm::InputTag | cenJetSource_ |
bool | centralBxOnly_ |
edm::InputTag | etHadSource_ |
edm::InputTag | etMissSource_ |
edm::InputTag | etTotSource_ |
edm::InputTag | forJetSource_ |
edm::InputTag | isoEmSource_ |
edm::InputTag | muonSource_ |
edm::InputTag | nonIsoEmSource_ |
bool | produceCaloParticles_ |
bool | produceMuonParticles_ |
edm::InputTag | tauJetSource_ |
Static Private Attributes | |
static double | muonMassGeV_ = 0.105658369 |
src/L1ExtraParticlesProd/src/L1ExtraParticlesProd.cc
Description: producer of L1Extra particle objects from Level-1 hardware objects.
Definition at line 40 of file L1ExtraParticlesProd.h.
L1ExtraParticlesProd::L1ExtraParticlesProd | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 66 of file L1ExtraParticlesProd.cc.
00067 : produceMuonParticles_( iConfig.getParameter< bool >( 00068 "produceMuonParticles" ) ), 00069 muonSource_( iConfig.getParameter< edm::InputTag >( 00070 "muonSource" ) ), 00071 produceCaloParticles_( iConfig.getParameter< bool >( 00072 "produceCaloParticles" ) ), 00073 isoEmSource_( iConfig.getParameter< edm::InputTag >( 00074 "isolatedEmSource" ) ), 00075 nonIsoEmSource_( iConfig.getParameter< edm::InputTag >( 00076 "nonIsolatedEmSource" ) ), 00077 cenJetSource_( iConfig.getParameter< edm::InputTag >( 00078 "centralJetSource" ) ), 00079 forJetSource_( iConfig.getParameter< edm::InputTag >( 00080 "forwardJetSource" ) ), 00081 tauJetSource_( iConfig.getParameter< edm::InputTag >( 00082 "tauJetSource" ) ), 00083 etTotSource_( iConfig.getParameter< edm::InputTag >( 00084 "etTotalSource" ) ), 00085 etHadSource_( iConfig.getParameter< edm::InputTag >( 00086 "etHadSource" ) ), 00087 etMissSource_( iConfig.getParameter< edm::InputTag >( 00088 "etMissSource" ) ), 00089 centralBxOnly_( iConfig.getParameter< bool >( 00090 "centralBxOnly" ) ) 00091 { 00092 using namespace l1extra ; 00093 00094 //register your products 00095 produces< L1EmParticleCollection >( "Isolated" ) ; 00096 produces< L1EmParticleCollection >( "NonIsolated" ) ; 00097 produces< L1JetParticleCollection >( "Central" ) ; 00098 produces< L1JetParticleCollection >( "Forward" ) ; 00099 produces< L1JetParticleCollection >( "Tau" ) ; 00100 produces< L1MuonParticleCollection >() ; 00101 // produces< L1EtMissParticle >() ; 00102 produces< L1EtMissParticleCollection >() ; 00103 00104 //now do what ever other initialization is needed 00105 }
L1ExtraParticlesProd::~L1ExtraParticlesProd | ( | ) |
Definition at line 108 of file L1ExtraParticlesProd.cc.
00109 { 00110 00111 // do anything here that needs to be done at desctruction time 00112 // (e.g. close files, deallocate resources etc.) 00113 00114 }
void L1ExtraParticlesProd::beginJob | ( | const edm::EventSetup & | ) | [private, virtual] |
math::PtEtaPhiMLorentzVector L1ExtraParticlesProd::gctLorentzVector | ( | const double & | et, | |
const L1GctCand & | cand, | |||
const L1CaloGeometry * | geom, | |||
bool | central | |||
) | [private] |
Definition at line 653 of file L1ExtraParticlesProd.cc.
References L1CaloGeometry::emJetPhiBinCenter(), eta, L1CaloGeometry::etaBinCenter(), L1GctCand::etaIndex(), phi, and L1GctCand::phiIndex().
Referenced by produce().
00657 { 00658 // To keep x and y components non-zero. 00659 double etCorr = et + 1.e-6 ; // protect against roundoff, not only for et=0 00660 00661 double eta = geom->etaBinCenter( cand.etaIndex(), central ) ; 00662 00663 // double tanThOver2 = exp( -eta ) ; 00664 // double ez = etCorr * ( 1. - tanThOver2 * tanThOver2 ) / ( 2. * tanThOver2 ); 00665 // double e = etCorr * ( 1. + tanThOver2 * tanThOver2 ) / ( 2. * tanThOver2 ); 00666 00667 double phi = geom->emJetPhiBinCenter( cand.phiIndex() ) ; 00668 00669 // return math::XYZTLorentzVector( etCorr * cos( phi ), 00670 // etCorr * sin( phi ), 00671 // ez, 00672 // e ) ; 00673 return math::PtEtaPhiMLorentzVector( etCorr, 00674 eta, 00675 phi, 00676 0. ) ; 00677 }
void L1ExtraParticlesProd::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 123 of file L1ExtraParticlesProd.cc.
References cenJetSource_, centralBxOnly_, e, eta, etHad, etHadSource_, etMiss, etMissColl, etMissSource_, L1CaloGeometry::etSumPhiBinCenter(), etTot, etTotSource_, forJetSource_, gctLorentzVector(), edm::EventSetup::get(), edm::Event::getByLabel(), i, isoEmSource_, L1GctEtHad::kEtHadMaxValue, L1GctEtMiss::kEtMissMaxValue, L1GctEtTotal::kEtTotalMaxValue, muonMassGeV_, muonSource_, nonIsoEmSource_, p4, phi, produceCaloParticles_, produceMuonParticles_, edm::Event::put(), std, and tauJetSource_.
00125 { 00126 using namespace edm ; 00127 using namespace l1extra ; 00128 using namespace std ; 00129 00130 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00131 // ~~~~~~~~~~~~~~~~~~~~ Muons ~~~~~~~~~~~~~~~~~~~~ 00132 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00133 00134 if( produceMuonParticles_ ) 00135 { 00136 ESHandle< L1MuTriggerScales > muScales ; 00137 iSetup.get< L1MuTriggerScalesRcd >().get( muScales ) ; 00138 00139 ESHandle< L1MuTriggerPtScale > muPtScale ; 00140 iSetup.get< L1MuTriggerPtScaleRcd >().get( muPtScale ) ; 00141 00142 Handle< L1MuGMTReadoutCollection > hwMuCollection ; 00143 iEvent.getByLabel( muonSource_, hwMuCollection ) ; 00144 00145 vector< L1MuGMTExtendedCand > hwMuCands ; 00146 00147 if( centralBxOnly_ ) 00148 { 00149 // Get GMT candidates from central bunch crossing only 00150 hwMuCands = hwMuCollection->getRecord().getGMTCands() ; 00151 } 00152 else 00153 { 00154 // Get GMT candidates from all bunch crossings 00155 vector< L1MuGMTReadoutRecord > records = hwMuCollection->getRecords(); 00156 vector< L1MuGMTReadoutRecord >::const_iterator rItr = records.begin(); 00157 vector< L1MuGMTReadoutRecord >::const_iterator rEnd = records.end(); 00158 00159 for( ; rItr != rEnd ; ++rItr ) 00160 { 00161 vector< L1MuGMTExtendedCand > tmpCands = rItr->getGMTCands() ; 00162 00163 hwMuCands.insert( hwMuCands.end(), 00164 tmpCands.begin(), 00165 tmpCands.end() ) ; 00166 } 00167 } 00168 00169 auto_ptr< L1MuonParticleCollection > muColl( 00170 new L1MuonParticleCollection ); 00171 00172 // cout << "HW muons" << endl ; 00173 vector< L1MuGMTExtendedCand >::const_iterator muItr = hwMuCands.begin() ; 00174 vector< L1MuGMTExtendedCand >::const_iterator muEnd = hwMuCands.end() ; 00175 for( int i = 0 ; muItr != muEnd ; ++muItr, ++i ) 00176 { 00177 // cout << "#" << i 00178 // << " name " << muItr->name() 00179 // << " empty " << muItr->empty() 00180 // << " pt " << muItr->ptIndex() 00181 // << " eta " << muItr->etaIndex() 00182 // << " phi " << muItr->phiIndex() 00183 // << " iso " << muItr->isol() 00184 // << " mip " << muItr->mip() 00185 // << " bx " << muItr->bx() 00186 // << endl ; 00187 00188 if( !muItr->empty() ) 00189 { 00190 // keep x and y components non-zero and protect against roundoff. 00191 double pt = 00192 muPtScale->getPtScale()->getLowEdge( muItr->ptIndex() ) + 1.e-6 ; 00193 // muScales->getPtScale()->getLowEdge( muItr->ptIndex() ) + 1.e-6 ; 00194 00195 // cout << "L1Extra pt " << pt << endl ; 00196 00197 double eta = 00198 muScales->getGMTEtaScale()->getCenter( muItr->etaIndex() ) ; 00199 00200 double phi = 00201 muScales->getPhiScale()->getLowEdge( muItr->phiIndex() ) ; 00202 00203 math::PtEtaPhiMLorentzVector p4( pt, 00204 eta, 00205 phi, 00206 muonMassGeV_ ) ; 00207 00208 muColl->push_back( 00209 L1MuonParticle( muItr->charge(), 00210 p4, 00211 *muItr, 00212 muItr->bx() ) 00213 ) ; 00214 } 00215 } 00216 00217 OrphanHandle< L1MuonParticleCollection > muHandle = 00218 iEvent.put( muColl ); 00219 } 00220 00221 00222 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00223 // ~~~~~~~~~~~~~~~~~~~~ Calorimeter ~~~~~~~~~~~~~~~~~~~~ 00224 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00225 00226 if( produceCaloParticles_ ) 00227 { 00228 // ~~~~~~~~~~~~~~~~~~~~ Geometry ~~~~~~~~~~~~~~~~~~~~ 00229 00230 ESHandle< L1CaloGeometry > caloGeomESH ; 00231 iSetup.get< L1CaloGeometryRecord >().get( caloGeomESH ) ; 00232 const L1CaloGeometry* caloGeom = &( *caloGeomESH ) ; 00233 00234 // ~~~~~~~~~~~~~~~~~~~~ EM ~~~~~~~~~~~~~~~~~~~~ 00235 00236 ESHandle< L1CaloEtScale > emScale ; 00237 iSetup.get< L1EmEtScaleRcd >().get( emScale ) ; 00238 00239 // Isolated EM 00240 Handle< L1GctEmCandCollection > hwIsoEmCands ; 00241 iEvent.getByLabel( isoEmSource_, hwIsoEmCands ) ; 00242 00243 auto_ptr< L1EmParticleCollection > isoEmColl( 00244 new L1EmParticleCollection ); 00245 00246 // cout << "HW iso EM" << endl ; 00247 00248 L1GctEmCandCollection::const_iterator emItr = hwIsoEmCands->begin() ; 00249 L1GctEmCandCollection::const_iterator emEnd = hwIsoEmCands->end() ; 00250 for( int i = 0 ; emItr != emEnd ; ++emItr, ++i ) 00251 { 00252 // cout << "#" << i 00253 // << " name " << emItr->name() 00254 // << " empty " << emItr->empty() 00255 // << " rank " << emItr->rank() 00256 // << " eta " << emItr->etaIndex() 00257 // << " sign " << emItr->etaSign() 00258 // << " phi " << emItr->phiIndex() 00259 // << " iso " << emItr->isolated() 00260 // << " bx " << emItr->bx() 00261 // << endl ; 00262 00263 if( !emItr->empty() && 00264 ( !centralBxOnly_ || emItr->bx() == 0 ) ) 00265 { 00266 double et = emScale->et( emItr->rank() ) ; 00267 00268 // cout << "L1Extra et " << et << endl ; 00269 00270 isoEmColl->push_back( 00271 L1EmParticle( gctLorentzVector( et, *emItr, caloGeom, true ), 00272 Ref< L1GctEmCandCollection >( hwIsoEmCands, 00273 i ), 00274 emItr->bx() ) ) ; 00275 } 00276 } 00277 00278 OrphanHandle< L1EmParticleCollection > isoEmHandle = 00279 iEvent.put( isoEmColl, "Isolated" ) ; 00280 00281 00282 // Non-isolated EM 00283 Handle< L1GctEmCandCollection > hwNonIsoEmCands ; 00284 iEvent.getByLabel( nonIsoEmSource_, hwNonIsoEmCands ) ; 00285 00286 auto_ptr< L1EmParticleCollection > nonIsoEmColl( 00287 new L1EmParticleCollection ); 00288 00289 // cout << "HW non-iso EM" << endl ; 00290 emItr = hwNonIsoEmCands->begin() ; 00291 emEnd = hwNonIsoEmCands->end() ; 00292 for( int i = 0 ; emItr != emEnd ; ++emItr, ++i ) 00293 { 00294 // cout << "#" << i 00295 // << " name " << emItr->name() 00296 // << " empty " << emItr->empty() 00297 // << " rank " << emItr->rank() 00298 // << " eta " << emItr->etaIndex() 00299 // << " sign " << emItr->etaSign() 00300 // << " phi " << emItr->phiIndex() 00301 // << " iso " << emItr->isolated() 00302 // << " bx " << emItr->bx() 00303 // << endl ; 00304 00305 if( !emItr->empty() && 00306 ( !centralBxOnly_ || emItr->bx() == 0 ) ) 00307 { 00308 double et = emScale->et( emItr->rank() ) ; 00309 00310 // cout << "L1Extra et " << et << endl ; 00311 00312 nonIsoEmColl->push_back( 00313 L1EmParticle( gctLorentzVector( et, *emItr, caloGeom, true ), 00314 Ref< L1GctEmCandCollection >( hwNonIsoEmCands, 00315 i ), 00316 emItr->bx() ) ); 00317 } 00318 } 00319 00320 OrphanHandle< L1EmParticleCollection > nonIsoEmHandle = 00321 iEvent.put( nonIsoEmColl, "NonIsolated" ) ; 00322 00323 00324 // ~~~~~~~~~~~~~~~~~~~~ Jets ~~~~~~~~~~~~~~~~~~~~ 00325 00326 ESHandle< L1CaloEtScale > jetScale ; 00327 iSetup.get< L1JetEtScaleRcd >().get( jetScale ) ; 00328 00329 // Central jets. 00330 Handle< L1GctJetCandCollection > hwCenJetCands ; 00331 iEvent.getByLabel( cenJetSource_, hwCenJetCands ) ; 00332 00333 auto_ptr< L1JetParticleCollection > cenJetColl( 00334 new L1JetParticleCollection ); 00335 00336 // cout << "HW central jets" << endl ; 00337 L1GctJetCandCollection::const_iterator jetItr = hwCenJetCands->begin() ; 00338 L1GctJetCandCollection::const_iterator jetEnd = hwCenJetCands->end() ; 00339 for( int i = 0 ; jetItr != jetEnd ; ++jetItr, ++i ) 00340 { 00341 // cout << "#" << i 00342 // << " name " << jetItr->name() 00343 // << " empty " << jetItr->empty() 00344 // << " rank " << jetItr->rank() 00345 // << " eta " << jetItr->etaIndex() 00346 // << " sign " << jetItr->etaSign() 00347 // << " phi " << jetItr->phiIndex() 00348 // << " cen " << jetItr->isCentral() 00349 // << " for " << jetItr->isForward() 00350 // << " tau " << jetItr->isTau() 00351 // << " bx " << jetItr->bx() 00352 // << endl ; 00353 00354 if( !jetItr->empty() && 00355 ( !centralBxOnly_ || jetItr->bx() == 0 ) ) 00356 { 00357 double et = jetScale->et( jetItr->rank() ) ; 00358 00359 // cout << "L1Extra et " << et << endl ; 00360 00361 cenJetColl->push_back( 00362 L1JetParticle( gctLorentzVector( et, *jetItr, caloGeom, true ), 00363 Ref< L1GctJetCandCollection >( hwCenJetCands, 00364 i ), 00365 jetItr->bx() ) ) ; 00366 } 00367 } 00368 00369 OrphanHandle< L1JetParticleCollection > cenJetHandle = 00370 iEvent.put( cenJetColl, "Central" ) ; 00371 00372 00373 // Forward jets. 00374 Handle< L1GctJetCandCollection > hwForJetCands ; 00375 iEvent.getByLabel( forJetSource_, hwForJetCands ) ; 00376 00377 auto_ptr< L1JetParticleCollection > forJetColl( 00378 new L1JetParticleCollection ); 00379 00380 // cout << "HW forward jets" << endl ; 00381 jetItr = hwForJetCands->begin() ; 00382 jetEnd = hwForJetCands->end() ; 00383 for( int i = 0 ; jetItr != jetEnd ; ++jetItr, ++i ) 00384 { 00385 // cout << "#" << i 00386 // << " name " << jetItr->name() 00387 // << " empty " << jetItr->empty() 00388 // << " rank " << jetItr->rank() 00389 // << " eta " << jetItr->etaIndex() 00390 // << " sign " << jetItr->etaSign() 00391 // << " phi " << jetItr->phiIndex() 00392 // << " cen " << jetItr->isCentral() 00393 // << " for " << jetItr->isForward() 00394 // << " tau " << jetItr->isTau() 00395 // << " bx " << jetItr->bx() 00396 // << endl ; 00397 00398 if( !jetItr->empty() && 00399 ( !centralBxOnly_ || jetItr->bx() == 0 ) ) 00400 { 00401 double et = jetScale->et( jetItr->rank() ) ; 00402 00403 // cout << "L1Extra et " << et << endl ; 00404 00405 forJetColl->push_back( 00406 L1JetParticle( gctLorentzVector( et, *jetItr, caloGeom, false ), 00407 Ref< L1GctJetCandCollection >( hwForJetCands, 00408 i ), 00409 jetItr->bx() ) ) ; 00410 } 00411 } 00412 00413 OrphanHandle< L1JetParticleCollection > forJetHandle = 00414 iEvent.put( forJetColl, "Forward" ) ; 00415 00416 00417 // Tau jets. 00418 // cout << "HW tau jets" << endl ; 00419 Handle< L1GctJetCandCollection > hwTauJetCands ; 00420 iEvent.getByLabel( tauJetSource_, hwTauJetCands ) ; 00421 00422 auto_ptr< L1JetParticleCollection > tauJetColl( 00423 new L1JetParticleCollection ); 00424 00425 jetItr = hwTauJetCands->begin() ; 00426 jetEnd = hwTauJetCands->end() ; 00427 for( int i = 0 ; jetItr != jetEnd ; ++jetItr, ++i ) 00428 { 00429 // cout << "#" << i 00430 // << " name " << jetItr->name() 00431 // << " empty " << jetItr->empty() 00432 // << " rank " << jetItr->rank() 00433 // << " eta " << jetItr->etaIndex() 00434 // << " sign " << jetItr->etaSign() 00435 // << " phi " << jetItr->phiIndex() 00436 // << " cen " << jetItr->isCentral() 00437 // << " for " << jetItr->isForward() 00438 // << " tau " << jetItr->isTau() 00439 // << " bx " << jetItr->bx() 00440 // << endl ; 00441 00442 if( !jetItr->empty() && 00443 ( !centralBxOnly_ || jetItr->bx() == 0 ) ) 00444 { 00445 double et = jetScale->et( jetItr->rank() ) ; 00446 00447 // cout << "L1Extra et " << et << endl ; 00448 00449 tauJetColl->push_back( 00450 L1JetParticle( gctLorentzVector( et, *jetItr, caloGeom, true ), 00451 Ref< L1GctJetCandCollection >( hwTauJetCands, 00452 i ), 00453 jetItr->bx() ) ) ; 00454 } 00455 } 00456 00457 OrphanHandle< L1JetParticleCollection > tauJetHandle = 00458 iEvent.put( tauJetColl, "Tau" ) ; 00459 00460 // ~~~~~~~~~~~~~~~~~~~~ Energy Sums ~~~~~~~~~~~~~~~~~~~~ 00461 00462 ESHandle< L1GctJetEtCalibrationFunction > jetCalibFn ; 00463 iSetup.get< L1GctJetCalibFunRcd >().get( jetCalibFn ) ; 00464 00465 double etSumLSB = jetScale->linearLsb() ; 00466 double htSumLSB = jetCalibFn->getHtScaleLSB(); 00467 00468 Handle< L1GctEtTotalCollection > hwEtTotColl ; 00469 iEvent.getByLabel( etTotSource_, hwEtTotColl ) ; 00470 00471 Handle< L1GctEtHadCollection > hwEtHadColl ; 00472 iEvent.getByLabel( etHadSource_, hwEtHadColl ) ; 00473 00474 Handle< L1GctEtMissCollection > hwEtMissColl ; 00475 iEvent.getByLabel( etMissSource_, hwEtMissColl ) ; 00476 00477 // try 00478 // { 00479 // iEvent.getByLabel( etTotSource_, hwEtTotColl ) ; 00480 // iEvent.getByLabel( etHadSource_, hwEtHadColl ) ; 00481 // iEvent.getByLabel( etMissSource_, hwEtMissColl ) ; 00482 // } 00483 // catch( const edm::Exception& ex ) 00484 00485 if( !( hwEtTotColl.isValid() && hwEtHadColl.isValid() && 00486 hwEtMissColl.isValid() ) ) 00487 { 00488 // // Check for only one particular exception. 00489 // if( ex.categoryCode() != edm::errors::ProductNotFound ) 00490 // { 00491 // throw ex ; 00492 // } 00493 00494 // For backwards compatibility with 20X and earlier. 00495 // If energy sum collections are not present, get the objects 00496 // themselves. 00497 00498 Handle< L1GctEtTotal > hwEtTot ; 00499 iEvent.getByLabel( etTotSource_, hwEtTot ) ; 00500 00501 Handle< L1GctEtHad > hwEtHad ; 00502 iEvent.getByLabel( etHadSource_, hwEtHad ) ; 00503 00504 Handle< L1GctEtMiss > hwEtMiss ; 00505 iEvent.getByLabel( etMissSource_, hwEtMiss ) ; 00506 00507 // cout << "AAAA HW ET Sums " << endl 00508 // << "MET: phi " << hwEtMiss->phi() 00509 // << " et " << hwEtMiss->et() 00510 // << " EtTot " << hwEtTot->et() 00511 // << " EtHad " << hwEtHad->et() 00512 // << " bx 0" 00513 // << endl ; 00514 00515 // ET bin low edge 00516 double etTot = ( hwEtTot->overFlow() ? 00517 ( double ) L1GctEtTotal::kEtTotalMaxValue : 00518 ( double ) hwEtTot->et() ) * etSumLSB + 1.e-6 ; 00519 double etHad = ( hwEtHad->overFlow() ? 00520 ( double ) L1GctEtHad::kEtHadMaxValue : 00521 ( double ) hwEtHad->et() ) * htSumLSB + 1.e-6 ; 00522 double etMiss = ( hwEtMiss->overFlow() ? 00523 ( double ) L1GctEtMiss::kEtMissMaxValue : 00524 ( double ) hwEtMiss->et() ) * etSumLSB + 1.e-6 ; 00525 // keep x and y components non-zero and protect against roundoff. 00526 00527 double phi = caloGeom->etSumPhiBinCenter( hwEtMiss->phi() ) ; 00528 00529 math::PtEtaPhiMLorentzVector p4( etMiss, 00530 0., 00531 phi, 00532 0. ) ; 00533 00534 auto_ptr< L1EtMissParticleCollection > etMissColl( 00535 new L1EtMissParticleCollection ); 00536 00537 etMissColl->push_back( 00538 L1EtMissParticle( p4, 00539 etTot, 00540 etHad ) ) ; 00541 00542 iEvent.put( etMissColl ) ; 00543 return ; // don't put any other processing after energy sums block!!! 00544 } 00545 00546 auto_ptr< L1EtMissParticleCollection > etMissColl( 00547 new L1EtMissParticleCollection ); 00548 00549 // Collate energy sums by bx 00550 L1GctEtTotalCollection::const_iterator hwEtTotItr = 00551 hwEtTotColl->begin() ; 00552 L1GctEtTotalCollection::const_iterator hwEtTotEnd = 00553 hwEtTotColl->end() ; 00554 00555 int iTot = 0 ; 00556 for( ; hwEtTotItr != hwEtTotEnd ; ++hwEtTotItr, ++iTot ) 00557 { 00558 int bx = hwEtTotItr->bx() ; 00559 00560 if( !centralBxOnly_ || bx == 0 ) 00561 { 00562 L1GctEtHadCollection::const_iterator hwEtHadItr = 00563 hwEtHadColl->begin() ; 00564 L1GctEtHadCollection::const_iterator hwEtHadEnd = 00565 hwEtHadColl->end() ; 00566 00567 int iHad = 0 ; 00568 for( ; hwEtHadItr != hwEtHadEnd ; ++hwEtHadItr, ++iHad ) 00569 { 00570 if( hwEtHadItr->bx() == bx ) 00571 { 00572 break ; 00573 } 00574 } 00575 00576 // If a L1GctEtHad with the right bx is not found, itr == end. 00577 if( hwEtHadItr != hwEtHadEnd ) 00578 { 00579 L1GctEtMissCollection::const_iterator hwEtMissItr = 00580 hwEtMissColl->begin() ; 00581 L1GctEtMissCollection::const_iterator hwEtMissEnd = 00582 hwEtMissColl->end() ; 00583 00584 int iMiss = 0 ; 00585 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr, ++iMiss ) 00586 { 00587 if( hwEtMissItr->bx() == bx ) 00588 { 00589 break ; 00590 } 00591 } 00592 00593 // If a L1GctEtMiss with the right bx is not found, itr == end. 00594 if( hwEtMissItr != hwEtMissEnd ) 00595 { 00596 // Construct L1EtMissParticle only if all three energy 00597 // sums are present. 00598 00599 // cout << "HW ET Sums " << endl 00600 // << "MET: phi " << hwEtMissItr->phi() 00601 // << " et " << hwEtMissItr->et() 00602 // << " EtTot " << hwEtTotItr->et() 00603 // << " EtHad " << hwEtHadItr->et() 00604 // << " bx " << bx 00605 // << endl ; 00606 00607 // ET bin low edge 00608 double etTot = 00609 ( hwEtTotItr->overFlow() ? 00610 ( double ) L1GctEtTotal::kEtTotalMaxValue : 00611 ( double ) hwEtTotItr->et() ) * etSumLSB + 1.e-6 ; 00612 double etHad = 00613 ( hwEtHadItr->overFlow() ? 00614 ( double ) L1GctEtHad::kEtHadMaxValue : 00615 ( double ) hwEtHadItr->et() ) * htSumLSB + 1.e-6 ; 00616 double etMiss = 00617 ( hwEtMissItr->overFlow() ? 00618 ( double ) L1GctEtMiss::kEtMissMaxValue : 00619 ( double ) hwEtMissItr->et() ) * etSumLSB + 1.e-6 ; 00620 // keep x and y components non-zero and 00621 // protect against roundoff. 00622 00623 double phi = 00624 caloGeom->etSumPhiBinCenter( hwEtMissItr->phi() ) ; 00625 00626 math::PtEtaPhiMLorentzVector p4( etMiss, 00627 0., 00628 phi, 00629 0. ) ; 00630 00631 etMissColl->push_back( 00632 L1EtMissParticle( 00633 p4, 00634 etTot, 00635 etHad, 00636 Ref< L1GctEtMissCollection >( hwEtMissColl, iMiss ), 00637 Ref< L1GctEtTotalCollection >( hwEtTotColl, iTot ), 00638 Ref< L1GctEtHadCollection >( hwEtHadColl, iHad ), 00639 bx 00640 ) ) ; 00641 } 00642 } 00643 } 00644 } 00645 00646 OrphanHandle< L1EtMissParticleCollection > etMissCollHandle = 00647 iEvent.put( etMissColl ) ; 00648 } 00649 }
bool L1ExtraParticlesProd::centralBxOnly_ [private] |
double L1ExtraParticlesProd::muonMassGeV_ = 0.105658369 [static, private] |