1400{
1402
1403 const int currentRoIId = roids->
roiId();
1404
1405 const EventIDBase& eventID = ctx.eventID();
1407 if (!eventInfo.isValid()) {
1409 return false;
1410 }
1411
1412 int inner = 0;
1413 int middle = 1;
1414 int outer = 2;
1415 int ee = 6;
1416 int csc = 7;
1417 int barrelinner = 0;
1418 int endcapinner = 3;
1419 int bee = 8;
1420 int bme = 9;
1421
1422
1423
1431 } else {
1437 }
1438
1439 ATH_MSG_DEBUG(
"### Hit patterns at the Muon Spectrometer ###");
1445 ATH_MSG_DEBUG(
"pattern#0: # of hits at endcap barrel inner =" <<
pattern.mdtSegments[barrelinner].size());
1447 } else {
1449 ATH_MSG_DEBUG(
"pattern#0: # of hits at barrel endcap inner =" <<
pattern.mdtSegments[endcapinner].size());
1450 }
1451 ATH_MSG_DEBUG(
"### ************************************* ###");
1453
1454
1455
1456
1459
1460
1466
1472
1473
1475
1476
1483
1484
1485
1489
1492
1493
1498
1499
1502
1503
1507 pattern.superPoints[middle].Alin,
pattern.superPoints[middle].Blin,
pattern.superPoints[middle].Chi2);
1514 pattern.superPoints[barrelinner].Alin,
pattern.superPoints[barrelinner].Blin,
pattern.superPoints[barrelinner].Chi2);
1517 } else {
1519 pattern.superPoints[endcapinner].Alin,
pattern.superPoints[endcapinner].Blin,
pattern.superPoints[endcapinner].Chi2);
1520 }
1521
1523
1524
1526
1530
1532 muonSA->
setLvl1Id( eventInfo->extendedLevel1ID() );
1555
1563
1564
1565 std::vector<std::string> mdtId;
1566 for (const TrigL2MuonSA::MdtHitData& mdtHit : mdtHits) {
1567 if ( mdtHit.isOutlier==0 || mdtHit.isOutlier==1 ) {
1568 muonSA->
setMdtHit(mdtHit.OnlineId, mdtHit.isOutlier, mdtHit.Chamber,
1569 mdtHit.R, mdtHit.Z, mdtHit.cPhi0, mdtHit.Residual,
1570 mdtHit.DriftTime, mdtHit.DriftSpace, mdtHit.DriftSigma);
1571 mdtId.push_back(mdtHit.Id.getString());
1572 }
1573 }
1574 static const SG::Accessor< std::vector<std::string> > accessor_mdthitid( "mdtHitId" );
1575 accessor_mdthitid( *muonSA ) = mdtId;
1576
1577
1578 std::vector<float> cscResol;
1579 for (const TrigL2MuonSA::CscHitData& cscHit : cscHits) {
1580 if ( 1 ){
1581 if ( cscHit.isOutlier==0 || cscHit.isOutlier==1 ) {
1582 muonSA->
setCscHit(cscHit.isOutlier, cscHit.Chamber, cscHit.StationName,
1583 cscHit.StationEta, cscHit.StationPhi,
1584 cscHit.ChamberLayer, cscHit.WireLayer, cscHit.MeasuresPhi, cscHit.Strip,
1585 cscHit.eta, cscHit.phi, cscHit.r, cscHit.z,
1586 cscHit.charge, cscHit.time, cscHit.Residual);
1587 cscResol.push_back(cscHit.resolution);
1589 << "OL=" << cscHit.isOutlier << ","
1590 << "Ch=" << cscHit.Chamber << ","
1591 << "StationName=" << cscHit.StationName << ","
1592 << "StationEta=" << cscHit.StationEta << ","
1593 << "StationPhi=" << cscHit.StationPhi << ","
1594 << "ChamberLayer=" << cscHit.ChamberLayer << ","
1595 << "WireLayer=" << cscHit.WireLayer << ","
1596 << "MeasuresPhi=" << cscHit.MeasuresPhi << ","
1597 << "Strip=" << cscHit.Strip << ","
1598 << "eta=" << cscHit.eta << ","
1599 << "phi=" << cscHit.phi << ","
1600 << "r=" << cscHit.r << ","
1601 << "z=" << cscHit.z << ","
1602 << "charge=" << cscHit.charge << ","
1603 << "Rs=" << cscHit.Residual << ","
1604 << "t=" << cscHit.time);
1605 }
1606 }
1607 }
1608 static const SG::Accessor< std::vector<float> > accessor_cschitresol( "cscHitResolution" );
1609 accessor_cschitresol( *muonSA ) = cscResol;
1610
1611
1612 float sumbeta[8]={0};
1613 float nhit_layer[8]={0};
1614 for (const TrigL2MuonSA::RpcHitData& rpcHit : rpcHits) {
1615 muonSA->
setRpcHit(rpcHit.layer, rpcHit.measuresPhi,
1616 rpcHit.x, rpcHit.y, rpcHit.z,
1617 rpcHit.time, rpcHit.distToEtaReadout, rpcHit.distToPhiReadout,
1618 rpcHit.stationName);
1620 << "stationName=" << rpcHit.stationName << ","
1621 << "layer=" << rpcHit.layer << ","
1622 << "measuresPhi=" << rpcHit.measuresPhi << ","
1623 << "x=" << rpcHit.x << ","
1624 << "y=" << rpcHit.y << ","
1625 << "y=" << rpcHit.z);
1626
1627 float dRMS = std::sqrt( std::abs(
pattern.etaMap-rpcHit.eta)*std::abs(
pattern.etaMap-rpcHit.eta) + std::acos(std::cos(
pattern.phiMS-rpcHit.phi))*std::acos(std::cos(
pattern.phiMS-rpcHit.phi)) );
1628 if(dRMS>0.05) continue;
1629 float muToF = rpcHit.l/1000/(CLHEP::c_light/1000);
1630 float Tprop = rpcHit.distToPhiReadout/1000*4.8;
1631 float beta = rpcHit.l/1000/(muToF+rpcHit.time-Tprop+3.125/2)/(CLHEP::c_light/1000);
1632 sumbeta[rpcHit.layer]=sumbeta[rpcHit.layer]+
beta;
1633 nhit_layer[rpcHit.layer]=nhit_layer[rpcHit.layer]+1;
1634 }
1635
1636 std::vector<float> Avebeta_layer;
1637 for(int i_layer=0;i_layer<8;i_layer++){
1638 if(nhit_layer[i_layer]!=0)Avebeta_layer.push_back( sumbeta[i_layer]/nhit_layer[i_layer] );
1639 }
1640 if(Avebeta_layer.size()>0) muonSA->
setBeta( std::accumulate(Avebeta_layer.begin(),Avebeta_layer.end(),0.0)/Avebeta_layer.size() );
1642 Avebeta_layer.clear();
1643
1644
1645 for (const TrigL2MuonSA::TgcHitData& tgcHit : tgcHits) {
1646 muonSA->
setTgcHit(tgcHit.eta, tgcHit.phi, tgcHit.r, tgcHit.z,
1647 tgcHit.width, tgcHit.sta, tgcHit.isStrip,
1648 tgcHit.bcTag, tgcHit.inRoad);
1650 << "eta=" << tgcHit.eta << ","
1651 << "phi=" << tgcHit.phi << ","
1652 << "r=" << tgcHit.r << ","
1653 << "z=" << tgcHit.z << ","
1654 << "width=" << tgcHit.width << ","
1655 << "stationNum=" << tgcHit.sta << ","
1656 << "isStrip=" << tgcHit.isStrip << ","
1657 << "bcTag=" << tgcHit.bcTag << ","
1658 << "inRoad=" << tgcHit.inRoad);
1659 }
1660
1661
1662
1663 for(unsigned int i_hit=0; i_hit<stgcHits.size(); i_hit++) {
1664 if ( stgcHits[i_hit].isOutlier==0 || stgcHits[i_hit].isOutlier==1 ) {
1665
1666
1667 muonSA->
setStgcCluster(stgcHits[i_hit].layerNumber, stgcHits[i_hit].isOutlier, stgcHits[i_hit].channelType,
1668 stgcHits[i_hit].
eta, stgcHits[i_hit].
phi, stgcHits[i_hit].
r, stgcHits[i_hit].
z,
1669 stgcHits[i_hit].ResidualR, stgcHits[i_hit].ResidualPhi,
1670 stgcHits[i_hit].stationEta, stgcHits[i_hit].stationPhi, stgcHits[i_hit].stationName);
1671
1673 <<
"eta=" << stgcHits[i_hit].
eta <<
","
1674 <<
"phi=" << stgcHits[i_hit].
phi <<
","
1675 <<
"r=" << stgcHits[i_hit].
r <<
","
1676 <<
"z=" << stgcHits[i_hit].
z <<
","
1677 << "z=" << stgcHits[i_hit].ResidualR << ","
1678 << "z=" << stgcHits[i_hit].ResidualPhi);
1679 }
1680 }
1681
1682
1683 for(unsigned int i_hit=0; i_hit<mmHits.size(); i_hit++) {
1684 if ( mmHits[i_hit].isOutlier==0 || mmHits[i_hit].isOutlier==1 ) {
1685
1686
1687 muonSA->
setMmCluster(mmHits[i_hit].layerNumber, mmHits[i_hit].isOutlier,
1688 mmHits[i_hit].
eta, mmHits[i_hit].
phi, mmHits[i_hit].
r, mmHits[i_hit].
z,
1689 mmHits[i_hit].ResidualR, mmHits[i_hit].ResidualPhi,
1690 mmHits[i_hit].stationEta, mmHits[i_hit].stationPhi, mmHits[i_hit].stationName);
1691
1693 <<
"eta=" << tgcHits[i_hit].
eta <<
","
1694 <<
"phi=" << tgcHits[i_hit].
phi <<
","
1695 <<
"r=" << tgcHits[i_hit].
r <<
","
1696 <<
"z=" << tgcHits[i_hit].
z <<
","
1697 <<
"width=" << tgcHits[i_hit].
width <<
","
1698 << "stationNum=" << tgcHits[i_hit].sta << ","
1699 << "isStrip=" << tgcHits[i_hit].isStrip << ","
1700 <<
"bcTag=" << tgcHits[i_hit].
bcTag <<
","
1701 << "inRoad=" << tgcHits[i_hit].inRoad);
1702 }
1703 }
1704
1705
1706 for (int i_station=0; i_station<8; i_station++) {
1707 for (int i_sector=0; i_sector<2; i_sector++) {
1708 muonSA->
setRoad(i_station, i_sector, muonRoad.
aw[i_station][i_sector], muonRoad.
bw[i_station][i_sector]);
1709 muonSA->
setRegionZ(i_station, i_sector, mdtRegion.
zMin[i_station][i_sector], mdtRegion.
zMax[i_station][i_sector]);
1710 muonSA->
setRegionR(i_station, i_sector, mdtRegion.
rMin[i_station][i_sector], mdtRegion.
rMax[i_station][i_sector]);
1711 muonSA->
setRegionEta(i_station, i_sector, mdtRegion.
etaMin[i_station][i_sector], mdtRegion.
etaMax[i_station][i_sector]);
1714 }
1715 }
1716
1718
1721
1726
1733 }
1734 } else {
1735
1737
1738
1742 }
1743 }
1744
1745
1747
1748
1751 float theta = std::atan(
pattern.superPoints[inner].R/std::abs(
pattern.superPoints[inner].Z));
1752 float eta = (std::tan(
theta/2.)!=0.)? -std::log(std::tan(
theta/2.))*
pattern.superPoints[inner].Z/std::abs(
pattern.superPoints[inner].Z): 0.;
1754 }
1755 }
1756
1757
1761 double phi1 = tgcFitResult.
tgcMid1[1];
1762 double phi2 = tgcFitResult.
tgcMid2[1];
1763 if ( tgcFitResult.
tgcMid1[3]==0. || tgcFitResult.
tgcMid2[3]==0. ) {
1766 }
else if( phi1*phi2 < 0 && std::abs(phi1)>(
M_PI/2.) ) {
1767 double tmp1 = (phi1>0)? phi1 -
M_PI : phi1 +
M_PI;
1771 } else {
1772 phi = (phi2+phi1)/2.;
1773 }
1774 } else {
1776 }
1777 float theta = std::atan(
pattern.superPoints[middle].R/std::abs(
pattern.superPoints[middle].Z));
1778 float eta = (std::tan(
theta/2.)!=0.)? -std::log(std::tan(
theta/2.))*
pattern.superPoints[middle].Z/std::abs(
pattern.superPoints[middle].Z): 0.;
1780 }
1781
1782 } else {
1783
1784
1789 } else {
1791 }
1792 float theta = std::atan(
pattern.superPoints[middle].R/std::abs(
pattern.superPoints[middle].Z));
1793 float eta = (std::tan(
theta/2.)!=0.)? -std::log(std::tan(
theta/2.))*
pattern.superPoints[middle].Z/std::abs(
pattern.superPoints[middle].Z): 0.;
1795 }
1796
1797
1798
1799 }
1801
1802 return true;
1803}
Scalar theta() const
theta method
unsigned bcTag(unsigned bcBitMap)
int L2MuonAlgoMap(const std::string &name) const
Gaudi::Property< int > m_esd_mm_size
Gaudi::Property< int > m_esd_rpc_size
Gaudi::Property< int > m_esd_csc_size
Gaudi::Property< int > m_esd_tgc_size
Gaudi::Property< int > m_esd_mdt_size
Gaudi::Property< int > m_esd_stgc_size
double zMin[N_STATION][N_SECTOR]
double rMin[N_STATION][N_SECTOR]
double zMax[N_STATION][N_SECTOR]
double etaMax[N_STATION][N_SECTOR]
double etaMin[N_STATION][N_SECTOR]
int chamberType[N_STATION][N_SECTOR][2]
double rMax[N_STATION][N_SECTOR]
double aw[N_STATION][N_SECTOR]
double bw[N_STATION][N_SECTOR]
void setRegionR(int station, int sector, float min, float max)
R range.
void setEta(float eta)
Set the pseudorapidity ( ) of the muon.
void setStgcCluster(const unsigned int layer, const int isOutlier, const int type, const float eta, const float phi, const float r, const float z, const float residualR, const float residualPhi, const int stationEta, const int stationPhi, const int stationName)
Set sTGC hits.
void setBeta(float value)
Set beta.
void setRpcFitInn(float phi, float slope, float offset)
Set the results of RPC fit.
void setPhi(float phi)
Set the azimuthal angle ( ) of the muon.
void setRpcHit(uint32_t layer, uint32_t measuresPhi, float x, float y, float z, float time, float distEta, float distPhi, const std::string &stationName)
Set RPC hits.
void setCscHit(int isOutlier, int chamber, uint32_t stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip, float eta, float phi, float r, float z, int charge, float time, float residual)
Set the properties of each CSC tube.
void setBarrelSagitta(float value)
Set the fitted sagitta of the muon in the barrel.
void setDeltaPt(float value)
Set error of pT.
void setEtaMS(float value)
Set the eta at muon spectrometer.
void setMdtHit(uint32_t onlineId, int isOutier, int chamber, float r, float z, float phi, float residual, float time, float space, float sigma)
Set the properties of each MDT tube.
void setTgcInn(float eta, float phi, float r, float z)
Set the results of TGC fit.
void setMmClustersCapacity(const int value)
Set size of storage for MM clusters.
void setDeltaEta(float value)
Set error of eta.
void setRoiSystem(uint32_t value)
void setRoad(int station, int sector, float aw, float bw)
Road.
void setTgcHit(float eta, float phi, float r, float z, float width, int stationNum, bool isStrip, int bcTag, bool inRoad)
Set TGC hits.
void setRoiNumber(uint32_t value)
void setDeltaPhi(float value)
Set error of phi.
void setPtEndcapRadius(float value)
void setTgcMid2(float eta, float phi, float r, float z)
void setStgcClustersCapacity(const int value)
Set size of storage for sTGC clusters.
void setTrackPosition(float r, float z, float eta, float phi)
Set position of muon track.
void setRMS(float value)
Set the R at muon spectrometer.
void setPtCSC(float value)
void setLumiBlock(uint32_t value)
void setRoiThreshold(uint32_t value)
void setTgcMidF(float rhoChi2, long rhoN, float phiChi2, long phiN)
void setPhiMap(float value)
Set phi used to refer pT LUT.
void setIsTgcFailure(int value)
Set flag to record if TGC is properly read.
void setRoiSubsystem(uint32_t value)
void setRpcHitsCapacity(int value)
Size of storage to be reserved.
void setRoiSector(uint32_t value)
void setRpcFitOut(float phi, float slope, float offset)
void setLvl1Id(uint32_t value)
void setChamberType2(int station, int sector, int chamberType)
void setMmCluster(const unsigned int layer, const int isOutlier, const float eta, const float phi, const float r, const float z, const float residualR, const float residualPhi, const int stationEta, const int stationPhi, const int stationName)
Set MM hits.
void setEtaBin(int value)
Set eta bin of pT LUT.
void setEtaMap(float value)
Set eta used to refer pT LUT.
void setMuonDetMask(uint32_t value)
void setDirPhiMS(float value)
Set tan phi at muon spectrometer.
void setPtEndcapBeta(float value)
void setCscHitsCapacity(int value)
Set size of storage for CSC hits.
void setRegionZ(int station, int sector, float min, float max)
Z range.
void setEndcapRadius(float value)
Set the fitted radius of the muon in the endcap.
void setEndcapBeta(float value)
Set the fitted value in the endcap.
void setChamberType1(int station, int sector, int chamberType)
Set the muon road information.
void setSAddress(int value)
Set the station address of the muon.
void setRpcFitMid(float phi, float slope, float offset)
void setPhiMS(float value)
Set the phi at muon spectrometer.
void setEndcapAlpha(float value)
Set the fitted value in the endcap.
void setRoIWord(uint32_t value)
Set the RoI ID of the seeding LVL1 muon.
void setRoiId(uint32_t value)
void setTgcHitsCapacity(int value)
Set size of storage for TGC hits.
void setRoiEta(float value)
void setTgcMid1(float eta, float phi, float r, float z)
void setRegionEta(int station, int sector, float min, float max)
Eta range.
void setIsRpcFailure(int value)
Set flag to record if RPC is properly read.
void setPt(float pt)
Set the transverse momentum ( ) of the muon.
void setRoiPhi(float value)
void setSuperPoint(int chamber, float r, float z, float slope, float intercept=0., float chi2=0.)
Set the properties of one particular super point measurement.
void setMdtHitsCapacity(int value)
Set size of storage for MDT hits.
void setDirZMS(float value)
Set dRdZ at muon spectrometer.
void setAlgoId(int value)
void setPhiBin(int value)
Set phi bin of pT LUT.
void setZMS(float value)
Set the Z at muon spectrometer.
void setBarrelRadius(float value)
Set the fitted radius of the muon in the barrel.
void setPtEndcapAlpha(float value)
void setTgcPt(float value)
void setTgcInnF(float rhoStd, long rhoN, float phiStd, long phiN)
Hemisphere getHemisphere() const
Returns the hemisphere that detected the muon candidate.
RoISource getSource() const
Returns the system that detected the muon candidate.
uint32_t roiWord() const
The "raw" RoI word describing the muon candidate.
int getThrNumber() const
Get the logic number of the highest threshold this RoI passed.
int getSectorID() const
Get the sector ID number.
int getRoI() const
Get the "RoI number" (position inside the sector)
@ BarrelInner
Inner station in the barrel spectrometer.
@ EndcapOuter
Outer station in the endcap spectrometer.
@ BarrelMiddle
Middle station in the barrel spectrometer.
@ EndcapMiddle
Middle station in the endcap spectrometer.
@ BEE
BEE measurement point.
@ EndcapExtra
Extra station in the endcap spectrometer.
@ BarrelOuter
Outer station in the barrel spectrometer.
@ BME
BME measurement point.
@ EndcapInner
Inner station in the endcap spectrometer.