1318{
1320
1321 const int currentRoIId = roids->
roiId();
1322
1323 const EventIDBase& eventID = ctx.eventID();
1325 if (!eventInfo.isValid()) {
1327 return false;
1328 }
1329
1330 int inner = 0;
1331 int middle = 1;
1332 int outer = 2;
1333 int ee = 6;
1334 int csc = 7;
1335 int barrelinner = 0;
1336 int endcapinner = 3;
1337 int bee = 8;
1338 int bme = 9;
1339
1340
1341
1349 } else {
1355 }
1356
1357 ATH_MSG_DEBUG(
"### Hit patterns at the Muon Spectrometer ###");
1363 ATH_MSG_DEBUG(
"pattern#0: # of hits at endcap barrel inner =" <<
pattern.mdtSegments[barrelinner].size());
1365 } else {
1367 ATH_MSG_DEBUG(
"pattern#0: # of hits at barrel endcap inner =" <<
pattern.mdtSegments[endcapinner].size());
1368 }
1369 ATH_MSG_DEBUG(
"### ************************************* ###");
1371
1372
1373
1374
1376 muonSA->makePrivateStore();
1377
1378
1384
1390
1391
1393
1394
1401
1402
1403
1407
1410
1411
1416
1417
1420
1421
1425 pattern.superPoints[middle].Alin,
pattern.superPoints[middle].Blin,
pattern.superPoints[middle].Chi2);
1432 pattern.superPoints[barrelinner].Alin,
pattern.superPoints[barrelinner].Blin,
pattern.superPoints[barrelinner].Chi2);
1435 } else {
1437 pattern.superPoints[endcapinner].Alin,
pattern.superPoints[endcapinner].Blin,
pattern.superPoints[endcapinner].Chi2);
1438 }
1439
1441
1442
1444
1448
1450 muonSA->
setLvl1Id( eventInfo->extendedLevel1ID() );
1473
1481
1482
1483 std::vector<std::string> mdtId;
1484 for (const TrigL2MuonSA::MdtHitData& mdtHit : mdtHits) {
1485 if ( mdtHit.isOutlier==0 || mdtHit.isOutlier==1 ) {
1486 muonSA->
setMdtHit(mdtHit.OnlineId, mdtHit.isOutlier, mdtHit.Chamber,
1487 mdtHit.R, mdtHit.Z, mdtHit.cPhi0, mdtHit.Residual,
1488 mdtHit.DriftTime, mdtHit.DriftSpace, mdtHit.DriftSigma);
1489 mdtId.push_back(mdtHit.Id.getString());
1490 }
1491 }
1493 accessor_mdthitid( *muonSA ) = std::move(mdtId);
1494
1495
1496 std::vector<float> cscResol;
1497 for (const TrigL2MuonSA::CscHitData& cscHit : cscHits) {
1498 if ( 1 ){
1499 if ( cscHit.isOutlier==0 || cscHit.isOutlier==1 ) {
1500 muonSA->
setCscHit(cscHit.isOutlier, cscHit.Chamber, cscHit.StationName,
1501 cscHit.StationEta, cscHit.StationPhi,
1502 cscHit.ChamberLayer, cscHit.WireLayer, cscHit.MeasuresPhi, cscHit.Strip,
1503 cscHit.eta, cscHit.phi, cscHit.r, cscHit.z,
1504 cscHit.charge, cscHit.time, cscHit.Residual);
1505 cscResol.push_back(cscHit.resolution);
1507 << "OL=" << cscHit.isOutlier << ","
1508 << "Ch=" << cscHit.Chamber << ","
1509 << "StationName=" << cscHit.StationName << ","
1510 << "StationEta=" << cscHit.StationEta << ","
1511 << "StationPhi=" << cscHit.StationPhi << ","
1512 << "ChamberLayer=" << cscHit.ChamberLayer << ","
1513 << "WireLayer=" << cscHit.WireLayer << ","
1514 << "MeasuresPhi=" << cscHit.MeasuresPhi << ","
1515 << "Strip=" << cscHit.Strip << ","
1516 << "eta=" << cscHit.eta << ","
1517 << "phi=" << cscHit.phi << ","
1518 << "r=" << cscHit.r << ","
1519 << "z=" << cscHit.z << ","
1520 << "charge=" << cscHit.charge << ","
1521 << "Rs=" << cscHit.Residual << ","
1522 << "t=" << cscHit.time);
1523 }
1524 }
1525 }
1527 accessor_cschitresol( *muonSA ) = std::move(cscResol);
1528
1529
1530 float sumbeta[8]={0};
1531 float nhit_layer[8]={0};
1532 for (const TrigL2MuonSA::RpcHitData& rpcHit : rpcHits) {
1533 muonSA->
setRpcHit(rpcHit.layer, rpcHit.measuresPhi,
1534 rpcHit.x, rpcHit.y, rpcHit.z,
1535 rpcHit.time, rpcHit.distToEtaReadout, rpcHit.distToPhiReadout,
1536 rpcHit.stationName);
1538 << "stationName=" << rpcHit.stationName << ","
1539 << "layer=" << rpcHit.layer << ","
1540 << "measuresPhi=" << rpcHit.measuresPhi << ","
1541 << "x=" << rpcHit.x << ","
1542 << "y=" << rpcHit.y << ","
1543 << "y=" << rpcHit.z);
1544
1545 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)) );
1546 if(dRMS>0.05) continue;
1547 float muToF = rpcHit.l/1000/(CLHEP::c_light/1000);
1548 float Tprop = rpcHit.distToPhiReadout/1000*4.8;
1549 float beta = rpcHit.l/1000/(muToF+rpcHit.time-Tprop+3.125/2)/(CLHEP::c_light/1000);
1550 sumbeta[rpcHit.layer]=sumbeta[rpcHit.layer]+beta;
1551 nhit_layer[rpcHit.layer]=nhit_layer[rpcHit.layer]+1;
1552 }
1553
1554 std::vector<float> Avebeta_layer;
1555 for(int i_layer=0;i_layer<8;i_layer++){
1556 if(nhit_layer[i_layer]!=0)Avebeta_layer.push_back( sumbeta[i_layer]/nhit_layer[i_layer] );
1557 }
1558 if(Avebeta_layer.size()>0) muonSA->
setBeta( std::accumulate(Avebeta_layer.begin(),Avebeta_layer.end(),0.0)/Avebeta_layer.size() );
1560 Avebeta_layer.clear();
1561
1562
1563 for (const TrigL2MuonSA::TgcHitData& tgcHit : tgcHits) {
1564 muonSA->
setTgcHit(tgcHit.eta, tgcHit.phi, tgcHit.r, tgcHit.z,
1565 tgcHit.width, tgcHit.sta, tgcHit.isStrip,
1566 tgcHit.bcTag, tgcHit.inRoad);
1568 << "eta=" << tgcHit.eta << ","
1569 << "phi=" << tgcHit.phi << ","
1570 << "r=" << tgcHit.r << ","
1571 << "z=" << tgcHit.z << ","
1572 << "width=" << tgcHit.width << ","
1573 << "stationNum=" << tgcHit.sta << ","
1574 << "isStrip=" << tgcHit.isStrip << ","
1575 << "bcTag=" << tgcHit.bcTag << ","
1576 << "inRoad=" << tgcHit.inRoad);
1577 }
1578
1579
1580
1581 for(unsigned int i_hit=0; i_hit<stgcHits.size(); i_hit++) {
1582 if ( stgcHits[i_hit].isOutlier==0 || stgcHits[i_hit].isOutlier==1 ) {
1583
1584
1585 muonSA->
setStgcCluster(stgcHits[i_hit].layerNumber, stgcHits[i_hit].isOutlier, stgcHits[i_hit].channelType,
1586 stgcHits[i_hit].
eta, stgcHits[i_hit].
phi, stgcHits[i_hit].
r, stgcHits[i_hit].
z,
1587 stgcHits[i_hit].ResidualR, stgcHits[i_hit].ResidualPhi,
1588 stgcHits[i_hit].stationEta, stgcHits[i_hit].stationPhi, stgcHits[i_hit].stationName);
1589
1591 <<
"eta=" << stgcHits[i_hit].
eta <<
","
1592 <<
"phi=" << stgcHits[i_hit].
phi <<
","
1593 <<
"r=" << stgcHits[i_hit].
r <<
","
1594 <<
"z=" << stgcHits[i_hit].
z <<
","
1595 << "z=" << stgcHits[i_hit].ResidualR << ","
1596 << "z=" << stgcHits[i_hit].ResidualPhi);
1597 }
1598 }
1599
1600
1601 for(unsigned int i_hit=0; i_hit<mmHits.size(); i_hit++) {
1602 if ( mmHits[i_hit].isOutlier==0 || mmHits[i_hit].isOutlier==1 ) {
1603
1604
1605 muonSA->
setMmCluster(mmHits[i_hit].layerNumber, mmHits[i_hit].isOutlier,
1606 mmHits[i_hit].
eta, mmHits[i_hit].
phi, mmHits[i_hit].
r, mmHits[i_hit].
z,
1607 mmHits[i_hit].ResidualR, mmHits[i_hit].ResidualPhi,
1608 mmHits[i_hit].stationEta, mmHits[i_hit].stationPhi, mmHits[i_hit].stationName);
1609
1611 <<
"eta=" << tgcHits[i_hit].
eta <<
","
1612 <<
"phi=" << tgcHits[i_hit].
phi <<
","
1613 <<
"r=" << tgcHits[i_hit].
r <<
","
1614 <<
"z=" << tgcHits[i_hit].
z <<
","
1615 <<
"width=" << tgcHits[i_hit].
width <<
","
1616 << "stationNum=" << tgcHits[i_hit].sta << ","
1617 << "isStrip=" << tgcHits[i_hit].isStrip << ","
1618 <<
"bcTag=" << tgcHits[i_hit].
bcTag <<
","
1619 << "inRoad=" << tgcHits[i_hit].inRoad);
1620 }
1621 }
1622
1623
1624 for (int i_station=0; i_station<8; i_station++) {
1625 for (int i_sector=0; i_sector<2; i_sector++) {
1626 muonSA->
setRoad(i_station, i_sector, muonRoad.
aw[i_station][i_sector], muonRoad.
bw[i_station][i_sector]);
1627 muonSA->
setRegionZ(i_station, i_sector, mdtRegion.
zMin[i_station][i_sector], mdtRegion.
zMax[i_station][i_sector]);
1628 muonSA->
setRegionR(i_station, i_sector, mdtRegion.
rMin[i_station][i_sector], mdtRegion.
rMax[i_station][i_sector]);
1629 muonSA->
setRegionEta(i_station, i_sector, mdtRegion.
etaMin[i_station][i_sector], mdtRegion.
etaMax[i_station][i_sector]);
1632 }
1633 }
1634
1636
1639
1644
1651 }
1652 } else {
1653
1655
1656
1660 }
1661 }
1662
1663
1665
1666
1669 float theta = std::atan(
pattern.superPoints[inner].R/std::abs(
pattern.superPoints[inner].Z));
1670 float eta = (std::tan(
theta/2.)!=0.)? -std::log(std::tan(
theta/2.))*
pattern.superPoints[inner].Z/std::abs(
pattern.superPoints[inner].Z): 0.;
1672 }
1673 }
1674
1675
1679 double phi1 = tgcFitResult.
tgcMid1[1];
1680 double phi2 = tgcFitResult.
tgcMid2[1];
1681 if ( tgcFitResult.
tgcMid1[3]==0. || tgcFitResult.
tgcMid2[3]==0. ) {
1684 }
else if( phi1*phi2 < 0 && std::abs(phi1)>(
M_PI/2.) ) {
1685 double tmp1 = (phi1>0)? phi1 -
M_PI : phi1 +
M_PI;
1689 } else {
1690 phi = (phi2+phi1)/2.;
1691 }
1692 } else {
1694 }
1695 float theta = std::atan(
pattern.superPoints[middle].R/std::abs(
pattern.superPoints[middle].Z));
1696 float eta = (std::tan(
theta/2.)!=0.)? -std::log(std::tan(
theta/2.))*
pattern.superPoints[middle].Z/std::abs(
pattern.superPoints[middle].Z): 0.;
1698 }
1699
1700 } else {
1701
1702
1707 } else {
1709 }
1710 float theta = std::atan(
pattern.superPoints[middle].R/std::abs(
pattern.superPoints[middle].Z));
1711 float eta = (std::tan(
theta/2.)!=0.)? -std::log(std::tan(
theta/2.))*
pattern.superPoints[middle].Z/std::abs(
pattern.superPoints[middle].Z): 0.;
1713 }
1714
1715
1716
1717 }
1719
1720 return true;
1721}
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).
SG::Accessor< T, ALLOC > Accessor
@ 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.