1401{
1403
1404 const int currentRoIId = roids->
roiId();
1405
1406 const EventIDBase& eventID = ctx.eventID();
1408 if (!eventInfo.isValid()) {
1410 return false;
1411 }
1412
1413 int inner = 0;
1414 int middle = 1;
1415 int outer = 2;
1416 int ee = 6;
1417 int csc = 7;
1418 int barrelinner = 0;
1419 int endcapinner = 3;
1420 int bee = 8;
1421 int bme = 9;
1422
1423
1424
1432 } else {
1438 }
1439
1440 ATH_MSG_DEBUG(
"### Hit patterns at the Muon Spectrometer ###");
1446 ATH_MSG_DEBUG(
"pattern#0: # of hits at endcap barrel inner =" <<
pattern.mdtSegments[barrelinner].size());
1448 } else {
1450 ATH_MSG_DEBUG(
"pattern#0: # of hits at barrel endcap inner =" <<
pattern.mdtSegments[endcapinner].size());
1451 }
1452 ATH_MSG_DEBUG(
"### ************************************* ###");
1454
1455
1456
1457
1460
1461
1467
1473
1474
1476
1477
1484
1485
1486
1490
1493
1494
1499
1500
1503
1504
1508 pattern.superPoints[middle].Alin,
pattern.superPoints[middle].Blin,
pattern.superPoints[middle].Chi2);
1515 pattern.superPoints[barrelinner].Alin,
pattern.superPoints[barrelinner].Blin,
pattern.superPoints[barrelinner].Chi2);
1518 } else {
1520 pattern.superPoints[endcapinner].Alin,
pattern.superPoints[endcapinner].Blin,
pattern.superPoints[endcapinner].Chi2);
1521 }
1522
1524
1525
1527
1531
1533 muonSA->
setLvl1Id( eventInfo->extendedLevel1ID() );
1556
1564
1565
1566 std::vector<std::string> mdtId;
1567 for (const TrigL2MuonSA::MdtHitData& mdtHit : mdtHits) {
1568 if ( mdtHit.isOutlier==0 || mdtHit.isOutlier==1 ) {
1569 muonSA->
setMdtHit(mdtHit.OnlineId, mdtHit.isOutlier, mdtHit.Chamber,
1570 mdtHit.R, mdtHit.Z, mdtHit.cPhi0, mdtHit.Residual,
1571 mdtHit.DriftTime, mdtHit.DriftSpace, mdtHit.DriftSigma);
1572 mdtId.push_back(mdtHit.Id.getString());
1573 }
1574 }
1575 static const SG::Accessor< std::vector<std::string> > accessor_mdthitid( "mdtHitId" );
1576 accessor_mdthitid( *muonSA ) = mdtId;
1577
1578
1579 std::vector<float> cscResol;
1580 for (const TrigL2MuonSA::CscHitData& cscHit : cscHits) {
1581 if ( 1 ){
1582 if ( cscHit.isOutlier==0 || cscHit.isOutlier==1 ) {
1583 muonSA->
setCscHit(cscHit.isOutlier, cscHit.Chamber, cscHit.StationName,
1584 cscHit.StationEta, cscHit.StationPhi,
1585 cscHit.ChamberLayer, cscHit.WireLayer, cscHit.MeasuresPhi, cscHit.Strip,
1586 cscHit.eta, cscHit.phi, cscHit.r, cscHit.z,
1587 cscHit.charge, cscHit.time, cscHit.Residual);
1588 cscResol.push_back(cscHit.resolution);
1590 << "OL=" << cscHit.isOutlier << ","
1591 << "Ch=" << cscHit.Chamber << ","
1592 << "StationName=" << cscHit.StationName << ","
1593 << "StationEta=" << cscHit.StationEta << ","
1594 << "StationPhi=" << cscHit.StationPhi << ","
1595 << "ChamberLayer=" << cscHit.ChamberLayer << ","
1596 << "WireLayer=" << cscHit.WireLayer << ","
1597 << "MeasuresPhi=" << cscHit.MeasuresPhi << ","
1598 << "Strip=" << cscHit.Strip << ","
1599 << "eta=" << cscHit.eta << ","
1600 << "phi=" << cscHit.phi << ","
1601 << "r=" << cscHit.r << ","
1602 << "z=" << cscHit.z << ","
1603 << "charge=" << cscHit.charge << ","
1604 << "Rs=" << cscHit.Residual << ","
1605 << "t=" << cscHit.time);
1606 }
1607 }
1608 }
1609 static const SG::Accessor< std::vector<float> > accessor_cschitresol( "cscHitResolution" );
1610 accessor_cschitresol( *muonSA ) = cscResol;
1611
1612
1613 float sumbeta[8]={0};
1614 float nhit_layer[8]={0};
1615 for (const TrigL2MuonSA::RpcHitData& rpcHit : rpcHits) {
1616 muonSA->
setRpcHit(rpcHit.layer, rpcHit.measuresPhi,
1617 rpcHit.x, rpcHit.y, rpcHit.z,
1618 rpcHit.time, rpcHit.distToEtaReadout, rpcHit.distToPhiReadout,
1619 rpcHit.stationName);
1621 << "stationName=" << rpcHit.stationName << ","
1622 << "layer=" << rpcHit.layer << ","
1623 << "measuresPhi=" << rpcHit.measuresPhi << ","
1624 << "x=" << rpcHit.x << ","
1625 << "y=" << rpcHit.y << ","
1626 << "y=" << rpcHit.z);
1627
1628 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)) );
1629 if(dRMS>0.05) continue;
1630 float muToF = rpcHit.l/1000/(CLHEP::c_light/1000);
1631 float Tprop = rpcHit.distToPhiReadout/1000*4.8;
1632 float beta = rpcHit.l/1000/(muToF+rpcHit.time-Tprop+3.125/2)/(CLHEP::c_light/1000);
1633 sumbeta[rpcHit.layer]=sumbeta[rpcHit.layer]+
beta;
1634 nhit_layer[rpcHit.layer]=nhit_layer[rpcHit.layer]+1;
1635 }
1636
1637 std::vector<float> Avebeta_layer;
1638 for(int i_layer=0;i_layer<8;i_layer++){
1639 if(nhit_layer[i_layer]!=0)Avebeta_layer.push_back( sumbeta[i_layer]/nhit_layer[i_layer] );
1640 }
1641 if(Avebeta_layer.size()>0) muonSA->
setBeta( std::accumulate(Avebeta_layer.begin(),Avebeta_layer.end(),0.0)/Avebeta_layer.size() );
1643 Avebeta_layer.clear();
1644
1645
1646 for (const TrigL2MuonSA::TgcHitData& tgcHit : tgcHits) {
1647 muonSA->
setTgcHit(tgcHit.eta, tgcHit.phi, tgcHit.r, tgcHit.z,
1648 tgcHit.width, tgcHit.sta, tgcHit.isStrip,
1649 tgcHit.bcTag, tgcHit.inRoad);
1651 << "eta=" << tgcHit.eta << ","
1652 << "phi=" << tgcHit.phi << ","
1653 << "r=" << tgcHit.r << ","
1654 << "z=" << tgcHit.z << ","
1655 << "width=" << tgcHit.width << ","
1656 << "stationNum=" << tgcHit.sta << ","
1657 << "isStrip=" << tgcHit.isStrip << ","
1658 << "bcTag=" << tgcHit.bcTag << ","
1659 << "inRoad=" << tgcHit.inRoad);
1660 }
1661
1662
1663
1664 for(unsigned int i_hit=0; i_hit<stgcHits.size(); i_hit++) {
1665 if ( stgcHits[i_hit].isOutlier==0 || stgcHits[i_hit].isOutlier==1 ) {
1666
1667
1668 muonSA->
setStgcCluster(stgcHits[i_hit].layerNumber, stgcHits[i_hit].isOutlier, stgcHits[i_hit].channelType,
1669 stgcHits[i_hit].
eta, stgcHits[i_hit].
phi, stgcHits[i_hit].
r, stgcHits[i_hit].
z,
1670 stgcHits[i_hit].ResidualR, stgcHits[i_hit].ResidualPhi,
1671 stgcHits[i_hit].stationEta, stgcHits[i_hit].stationPhi, stgcHits[i_hit].stationName);
1672
1674 <<
"eta=" << stgcHits[i_hit].
eta <<
","
1675 <<
"phi=" << stgcHits[i_hit].
phi <<
","
1676 <<
"r=" << stgcHits[i_hit].
r <<
","
1677 <<
"z=" << stgcHits[i_hit].
z <<
","
1678 << "z=" << stgcHits[i_hit].ResidualR << ","
1679 << "z=" << stgcHits[i_hit].ResidualPhi);
1680 }
1681 }
1682
1683
1684 for(unsigned int i_hit=0; i_hit<mmHits.size(); i_hit++) {
1685 if ( mmHits[i_hit].isOutlier==0 || mmHits[i_hit].isOutlier==1 ) {
1686
1687
1688 muonSA->
setMmCluster(mmHits[i_hit].layerNumber, mmHits[i_hit].isOutlier,
1689 mmHits[i_hit].
eta, mmHits[i_hit].
phi, mmHits[i_hit].
r, mmHits[i_hit].
z,
1690 mmHits[i_hit].ResidualR, mmHits[i_hit].ResidualPhi,
1691 mmHits[i_hit].stationEta, mmHits[i_hit].stationPhi, mmHits[i_hit].stationName);
1692
1694 <<
"eta=" << tgcHits[i_hit].
eta <<
","
1695 <<
"phi=" << tgcHits[i_hit].
phi <<
","
1696 <<
"r=" << tgcHits[i_hit].
r <<
","
1697 <<
"z=" << tgcHits[i_hit].
z <<
","
1698 <<
"width=" << tgcHits[i_hit].
width <<
","
1699 << "stationNum=" << tgcHits[i_hit].sta << ","
1700 << "isStrip=" << tgcHits[i_hit].isStrip << ","
1701 <<
"bcTag=" << tgcHits[i_hit].
bcTag <<
","
1702 << "inRoad=" << tgcHits[i_hit].inRoad);
1703 }
1704 }
1705
1706
1707 for (int i_station=0; i_station<8; i_station++) {
1708 for (int i_sector=0; i_sector<2; i_sector++) {
1709 muonSA->
setRoad(i_station, i_sector, muonRoad.
aw[i_station][i_sector], muonRoad.
bw[i_station][i_sector]);
1710 muonSA->
setRegionZ(i_station, i_sector, mdtRegion.
zMin[i_station][i_sector], mdtRegion.
zMax[i_station][i_sector]);
1711 muonSA->
setRegionR(i_station, i_sector, mdtRegion.
rMin[i_station][i_sector], mdtRegion.
rMax[i_station][i_sector]);
1712 muonSA->
setRegionEta(i_station, i_sector, mdtRegion.
etaMin[i_station][i_sector], mdtRegion.
etaMax[i_station][i_sector]);
1715 }
1716 }
1717
1719
1722
1727
1734 }
1735 } else {
1736
1738
1739
1743 }
1744 }
1745
1746
1748
1749
1752 float theta = std::atan(
pattern.superPoints[inner].R/std::abs(
pattern.superPoints[inner].Z));
1753 float eta = (std::tan(
theta/2.)!=0.)? -std::log(std::tan(
theta/2.))*
pattern.superPoints[inner].Z/std::abs(
pattern.superPoints[inner].Z): 0.;
1755 }
1756 }
1757
1758
1762 double phi1 = tgcFitResult.
tgcMid1[1];
1763 double phi2 = tgcFitResult.
tgcMid2[1];
1764 if ( tgcFitResult.
tgcMid1[3]==0. || tgcFitResult.
tgcMid2[3]==0. ) {
1767 }
else if( phi1*phi2 < 0 && std::abs(phi1)>(
M_PI/2.) ) {
1768 double tmp1 = (phi1>0)? phi1 -
M_PI : phi1 +
M_PI;
1772 } else {
1773 phi = (phi2+phi1)/2.;
1774 }
1775 } else {
1777 }
1778 float theta = std::atan(
pattern.superPoints[middle].R/std::abs(
pattern.superPoints[middle].Z));
1779 float eta = (std::tan(
theta/2.)!=0.)? -std::log(std::tan(
theta/2.))*
pattern.superPoints[middle].Z/std::abs(
pattern.superPoints[middle].Z): 0.;
1781 }
1782
1783 } else {
1784
1785
1790 } else {
1792 }
1793 float theta = std::atan(
pattern.superPoints[middle].R/std::abs(
pattern.superPoints[middle].Z));
1794 float eta = (std::tan(
theta/2.)!=0.)? -std::log(std::tan(
theta/2.))*
pattern.superPoints[middle].Z/std::abs(
pattern.superPoints[middle].Z): 0.;
1796 }
1797
1798
1799
1800 }
1802
1803 return true;
1804}
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.