Commit 0790e5ab authored by William Axel Leight's avatar William Axel Leight Committed by Adam Edward Barton
Browse files

Sweep NSW EDM changes to master

parent b98307fa
......@@ -114,8 +114,8 @@ namespace xAOD {
AUX_VARIABLE( etaLayer3TGCHoles );
AUX_VARIABLE( etaLayer4TGCHoles );
AUX_VARIABLE( cscEtaHits );
AUX_VARIABLE( cscUnspoiledEtaHits );
AUX_VARIABLE( cscEtaHits );
AUX_VARIABLE( cscUnspoiledEtaHits );
// Isolation
AUX_VARIABLE( etcone20 );
......
......@@ -103,37 +103,38 @@ namespace xAOD {
DEFINE_ACCESSOR( uint8_t, etaLayer3TGCHoles );
DEFINE_ACCESSOR( uint8_t, etaLayer4TGCHoles );
// New Small Wheel
// New Small Wheel
// STGC
DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHits );
DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHits );
DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHits );
DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHits );
DEFINE_ACCESSOR( uint8_t, etaLayer1STGCHits );
DEFINE_ACCESSOR( uint8_t, etaLayer2STGCHits );
DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHoles );
DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHoles );
DEFINE_ACCESSOR( uint8_t, etaLayer1STGCHoles );
DEFINE_ACCESSOR( uint8_t, etaLayer2STGCHoles );
// MM
DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHoles );
DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHoles );
DEFINE_ACCESSOR( uint8_t, etaLayer1STGCHoles );
DEFINE_ACCESSOR( uint8_t, etaLayer2STGCHoles );
// MM
DEFINE_ACCESSOR( uint8_t, MMHits );
DEFINE_ACCESSOR( uint8_t, MMHoles );
// Note: there is currently no MuonStationIndex for the two MM layers
// In the future it might be needed to add them in order to have
DEFINE_ACCESSOR( uint8_t, MMHoles );
// Note: there is currently no MuonStationIndex for the two MM layers
// In the future it might be needed to add them in order to have
// separate counters as follows
// DEFINE_ACCESSOR( uint8_t, Layer1MMHits );
// DEFINE_ACCESSOR( uint8_t, Layer2MMHits );
// DEFINE_ACCESSOR( uint8_t, Layer1MMHoles );
// DEFINE_ACCESSOR( uint8_t, Layer2MMHoles );
// DEFINE_ACCESSOR( uint8_t, Layer2MMHits );
// DEFINE_ACCESSOR( uint8_t, Layer1MMHoles );
// DEFINE_ACCESSOR( uint8_t, Layer2MMHoles );
DEFINE_ACCESSOR( uint8_t, innerClosePrecisionHits );
DEFINE_ACCESSOR( uint8_t, middleClosePrecisionHits );
DEFINE_ACCESSOR( uint8_t, outerClosePrecisionHits );
DEFINE_ACCESSOR( uint8_t, extendedClosePrecisionHits );
DEFINE_ACCESSOR( uint8_t, innerClosePrecisionHits );
DEFINE_ACCESSOR( uint8_t, middleClosePrecisionHits );
DEFINE_ACCESSOR( uint8_t, outerClosePrecisionHits );
DEFINE_ACCESSOR( uint8_t, extendedClosePrecisionHits );
DEFINE_ACCESSOR( uint8_t, innerOutBoundsPrecisionHits );
DEFINE_ACCESSOR( uint8_t, innerOutBoundsPrecisionHits );
DEFINE_ACCESSOR( uint8_t, middleOutBoundsPrecisionHits );
DEFINE_ACCESSOR( uint8_t, outerOutBoundsPrecisionHits );
DEFINE_ACCESSOR( uint8_t, extendedOutBoundsPrecisionHits );
......
......@@ -26,6 +26,9 @@ class RpcIdHelper;
class TgcIdHelper;
class CscIdHelper;
class MdtIdHelper;
// New Small Wheel
class MmIdHelper;
class sTgcIdHelper;
class Identifier;
......@@ -89,6 +92,9 @@ private:
const TgcIdHelper* m_tgcId;
const CscIdHelper* m_cscId;
const MdtIdHelper* m_mdtId;
//New Small Wheel
const sTgcIdHelper* m_stgcId;
const MmIdHelper* m_mmId;
/** tool used to do hole search */
ToolHandle<Trk::ITrackHoleSearchTool> m_muonTgTool;
......
......@@ -72,6 +72,7 @@ Muon::MuonTrackSummaryHelperTool::MuonTrackSummaryHelperTool(
declareProperty("CalculateCloseHits", m_calculateCloseHits = false );
declareProperty("RoadWidth", m_roadWidth = 135.,"width used to calculate hits within the road (mm)");
declareProperty("Extrapolator", m_extrapolator);
declareProperty("MdtPrepDataContainer", m_mdtKey="MDT_DriftCircles");
declareProperty("HoleOnTrackTool", m_muonTgTool);
declareProperty("TrackingGeometryName", m_trackingGeometryName);
}
......@@ -102,6 +103,20 @@ StatusCode Muon::MuonTrackSummaryHelperTool::initialize()
muonOkay=false;
}
sc = detStore()->retrieve(m_stgcId);
if (sc.isFailure())
{
msg (MSG::WARNING) << "Could not get STGC ID helper !" << endmsg;
muonOkay=false;
}
sc = detStore()->retrieve(m_mmId);
if (sc.isFailure())
{
msg (MSG::WARNING) << "Could not get MM ID helper !" << endmsg;
muonOkay=false;
}
sc = detStore()->retrieve(m_cscId);
if (sc.isFailure())
{
......@@ -214,13 +229,13 @@ void Muon::MuonTrackSummaryHelperTool::analyse(
else increment(information[numberOfTgcEtaHits]);
}else if(m_mdtId->is_mdt(id)){
increment(information[numberOfMdtHits]);
}else if(m_mdtId->is_mm(id) ){
increment(information[numberOfCscUnspoiltEtaHits]);
}else if(m_mdtId->is_stgc(id)){
int chType = m_idHelperTool->stgcIdHelper().channelType(id);
if( chType == 2 ) increment(information[numberOfCscPhiHits]);
else if( chType == 1 ) increment(information[numberOfCscEtaHits]);
else increment(information[numberOfCscPhiHoles]);
}else if(m_stgcId->is_stgc(id) ){
// strip = measuresPhi
if( m_stgcId->measuresPhi(id) ) increment(information[numberOfStgcPhiHits]);
// we do not discriminate between pads or wires
else increment(information[numberOfStgcEtaHits]);
}else if(m_mmId->is_mm(id)){
increment(information[numberOfMmHits]);
}else{
msg (MSG::ERROR) << "Unknown muon detector type " << endmsg;
msg (MSG::ERROR) << "Dumping TrackStateOnSurface "<<*tsos << endmsg;
......@@ -378,11 +393,11 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track
Identifier id = pars->associatedSurface().associatedDetectorElement()->identify();
bool issTgc = m_idHelperTool->issTgc(id);
if(issTgc) {
// get the identifier for phi or eta holes
// get the identifier for phi or eta holes
Identifier idh = pars->associatedSurface().associatedDetectorElementIdentifier();
if(idh.is_valid()) {
id = idh;
// ATH_MSG_VERBOSE(" For sTGC hole use associatedDetectorElementIdentifier ");
// ATH_MSG_VERBOSE(" For sTGC hole use associatedDetectorElementIdentifier ");
}
}
if( !id.is_valid() || !m_idHelperTool->isMuon(id) ) continue;
......@@ -494,6 +509,18 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track
goodLayIds.insert(layId);
}
}
else if(m_idHelperTool->isCsc(id)){
const Muon::CscClusterOnTrack* cscClus = dynamic_cast<const Muon::CscClusterOnTrack*>(rot);
if(cscClus->status()==0 || cscClus->status()==10) goodLayIds.insert(layId);
}
else if(m_idHelperTool->isMM(id)) {
// MM quality requirements to be inserted here if needed
goodLayIds.insert(layId);
}
else if(m_idHelperTool->issTgc(id)) {
// sTGC quality requirements to be inserted here if needed
goodLayIds.insert(layId);
}
}else{
const Muon::CompetingMuonClustersOnTrack* crot = dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(meas);
if( crot ){
......@@ -509,6 +536,10 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track
// get layer Identifier and insert it into set
Identifier layId = m_idHelperTool->layerId( (*clit)->identify() );
layIds.insert(layId);
if(m_idHelperTool->isCsc(id)){
const Muon::CscClusterOnTrack* cscClus = dynamic_cast<const Muon::CscClusterOnTrack*>(rot);
if(cscClus->status()==0 || cscClus->status()==10) goodLayIds.insert(layId);
}
}
}else{
continue;
......
......@@ -58,6 +58,10 @@ namespace Muon {
m_summaryTypeScore[Trk::numberOfCscEtaHits] = 5;
m_summaryTypeScore[Trk::numberOfRpcPhiHits] = 5;
m_summaryTypeScore[Trk::numberOfRpcEtaHits] = 5;
// New Small Wheel
m_summaryTypeScore[Trk::numberOfStgcPhiHits] = 5;
m_summaryTypeScore[Trk::numberOfStgcEtaHits] = 5;
m_summaryTypeScore[Trk::numberOfMmHits] = 5;
}
MuonTrackScoringTool::~MuonTrackScoringTool()
......
......@@ -100,6 +100,15 @@ enum SummaryType {
numberOfMdtHoles =25, //! number of MDT measurements missing from the track
numberOfTgcEtaHoles =26, //! number of TGC Eta measurements missing from the track
numberOfTgcPhiHoles =27, //! number of TGC Phi measurements missing from the track
// New Small Wheel
numberOfStgcEtaHits =67, //! number of TGC Eta measurements missing from the track
numberOfStgcPhiHits =68, //! number of TGC Phi measurements missing from the track
numberOfMmHits =69, //! number of TGC Eta measurements missing from the track
numberOfStgcEtaHoles =70, //! number of TGC Eta measurements missing from the track
numberOfStgcPhiHoles =71, //! number of TGC Phi measurements missing from the track
numberOfMmHoles =72, //! number of TGC Eta measurements missing from the track
numberOfCscUnspoiltEtaHits =45, //! number of unspoilt CSC eta measurements (all CSC phi measurements are by definition spoilt). See Muon::CscClusterStatus for definitions of 'spoiled' hits.
numberOfGoodMdtHits =66, //!number of non-deweighted MDT hits. Only here as a placeholder, will be filled only on xAOD::Muon
// --- all
......@@ -115,7 +124,7 @@ enum SummaryType {
pixeldEdx_res = 51, //!< the dE/dx estimate, calculated using the pixel clusters [?]
// -- numbers...
numberOfTrackSummaryTypes = 67
numberOfTrackSummaryTypes = 73
};
// Troels.Petersen@cern.ch:
......
......@@ -160,6 +160,15 @@ T_out& dumpTrackSummary( T_out& out, const TrackSummary& trackSum )
out << " * Number of dead TRT straws : "<<trackSum.get(numberOfTRTDeadStraws)<<"\n";
out << " * Number of MDT hits : "<<trackSum.get(numberOfMdtHits)<<"\n";
out << " * Number of MDT holes : "<<trackSum.get(numberOfMdtHoles)<<"\n";
// New Small Wheel
out << " * Number of STGC hits : phi "<<trackSum.get(numberOfStgcPhiHits)
<< " eta " <<trackSum.get(numberOfStgcEtaHits)<<"\n";
out << " * Number of STGC holes : phi "<<trackSum.get(numberOfStgcPhiHoles)
<< " eta "<<trackSum.get(numberOfStgcEtaHoles)<<"\n";
out << " * Number of MM hits : "<<trackSum.get(numberOfMmHits)<<"\n";
out << " * Number of MM holes : "<<trackSum.get(numberOfMmHoles)<<"\n";
out << " * Number of TGC hits : phi "<<trackSum.get(numberOfTgcPhiHits)
<< " eta " <<trackSum.get(numberOfTgcEtaHits)<<"\n";
out << " * Number of TGC holes : phi "<<trackSum.get(numberOfTgcPhiHoles)
......
......@@ -1026,6 +1026,7 @@ void TrackParticleCreatorTool::setTrackSummary( xAOD::TrackParticle& tp, const T
if ( i >= offset && i < offset+Trk::numberOfeProbabilityTypes+1){
continue;
}
if( i >= Trk::numberOfStgcEtaHits && i <= Trk::numberOfMmHoles) continue;
// coverity[mixed_enums]
if (i == Trk::numberOfTRTHitsUsedFordEdx ) continue;
......@@ -1065,21 +1066,21 @@ void TrackParticleCreatorTool::setTrackSummary( xAOD::TrackParticle& tp, const T
//muon hit info
if(m_useMuonSummaryTool){
ATH_MSG_DEBUG("now do muon hit info");
Muon::IMuonHitSummaryTool::CompactSummary msSummary = m_hitSummaryTool->summary(summary);
uint8_t numberOfPrecisionLayers = msSummary.nprecisionLayers;
ATH_MSG_DEBUG("# of prec layers: "<<numberOfPrecisionLayers);
uint8_t numberOfPrecisionHoleLayers = msSummary.nprecisionHoleLayers;
uint8_t numberOfPhiLayers = msSummary.nphiLayers;
uint8_t numberOfPhiHoleLayers = msSummary.nphiHoleLayers;
uint8_t numberOfTriggerEtaLayers = msSummary.ntrigEtaLayers;
uint8_t numberOfTriggerEtaHoleLayers = msSummary.ntrigEtaHoleLayers;
tp.setSummaryValue(numberOfPrecisionLayers,xAOD::numberOfPrecisionLayers);
tp.setSummaryValue(numberOfPrecisionHoleLayers,xAOD::numberOfPrecisionHoleLayers);
tp.setSummaryValue(numberOfPhiLayers,xAOD::numberOfPhiLayers);
tp.setSummaryValue(numberOfPhiHoleLayers,xAOD::numberOfPhiHoleLayers);
tp.setSummaryValue(numberOfTriggerEtaLayers,xAOD::numberOfTriggerEtaLayers);
tp.setSummaryValue(numberOfTriggerEtaHoleLayers,xAOD::numberOfTriggerEtaHoleLayers);
ATH_MSG_DEBUG("now do muon hit info");
Muon::IMuonHitSummaryTool::CompactSummary msSummary = m_hitSummaryTool->summary(summary);
uint8_t numberOfPrecisionLayers = msSummary.nprecisionLayers;
ATH_MSG_DEBUG("# of prec layers: "<<numberOfPrecisionLayers);
uint8_t numberOfPrecisionHoleLayers = msSummary.nprecisionHoleLayers;
uint8_t numberOfPhiLayers = msSummary.nphiLayers;
uint8_t numberOfPhiHoleLayers = msSummary.nphiHoleLayers;
uint8_t numberOfTriggerEtaLayers = msSummary.ntrigEtaLayers;
uint8_t numberOfTriggerEtaHoleLayers = msSummary.ntrigEtaHoleLayers;
tp.setSummaryValue(numberOfPrecisionLayers,xAOD::numberOfPrecisionLayers);
tp.setSummaryValue(numberOfPrecisionHoleLayers,xAOD::numberOfPrecisionHoleLayers);
tp.setSummaryValue(numberOfPhiLayers,xAOD::numberOfPhiLayers);
tp.setSummaryValue(numberOfPhiHoleLayers,xAOD::numberOfPhiHoleLayers);
tp.setSummaryValue(numberOfTriggerEtaLayers,xAOD::numberOfTriggerEtaLayers);
tp.setSummaryValue(numberOfTriggerEtaHoleLayers,xAOD::numberOfTriggerEtaHoleLayers);
}
}
......
......@@ -272,6 +272,13 @@ Trk::TrackSummaryTool::createSummary( const Track& track,
information[Trk::numberOfRpcPhiHoles] =0;
information[Trk::numberOfTgcEtaHoles] =0;
information[Trk::numberOfTgcPhiHoles] =0;
// New Small Wheel
information[Trk::numberOfStgcEtaHits] =0;
information[Trk::numberOfStgcPhiHits] =0;
information[Trk::numberOfMmHits] =0;
information[Trk::numberOfStgcEtaHoles] =0;
information[Trk::numberOfStgcPhiHoles] =0;
information[Trk::numberOfMmHoles] =0;
}
std::bitset<numberOfDetectorTypes> hitPattern;
......@@ -585,12 +592,17 @@ void Trk::TrackSummaryTool::searchHolesStepWise( const Trk::Track& track,
information [numberOfSCTDeadSensors] = -1;
information [numberOfTRTHoles] = -1;
information [numberOfTRTDeadStraws] = -1;
// NOTE: Eta holes was used twice instead of Phi holes
information [numberOfCscEtaHoles] = -1;
information [numberOfCscEtaHoles] = -1;
information [numberOfCscPhiHoles] = -1;
information [numberOfRpcEtaHoles] = -1;
information [numberOfRpcEtaHoles] = -1;
information [numberOfRpcPhiHoles] = -1;
information [numberOfTgcEtaHoles] = -1;
information [numberOfTgcEtaHoles] = -1;
information [numberOfTgcPhiHoles] = -1;
// New Small Wheel
information [numberOfStgcEtaHoles] = -1;
information [numberOfStgcPhiHoles] = -1;
information [numberOfMmHoles] = -1;
return;
}
else
......@@ -617,13 +629,17 @@ void Trk::TrackSummaryTool::searchHolesStepWise( const Trk::Track& track,
{
// now do Muon hole search. It works completely differently to the above, so we need to make this all a bit more general
// and probably more efficient. But this hopefully works for now! EJWM
information [numberOfMdtHoles] = 0;
information [numberOfMdtHoles] = 0;
information [numberOfCscEtaHoles] = 0;
information [numberOfCscPhiHoles] = 0;
information [numberOfRpcEtaHoles] = 0;
information [numberOfRpcPhiHoles] = 0;
information [numberOfTgcEtaHoles] = 0;
information [numberOfTgcPhiHoles] = 0;
information [numberOfTgcPhiHoles] = 0;
// New Small Wheel
information [numberOfStgcEtaHoles] = 0;
information [numberOfStgcPhiHoles] = 0;
information [numberOfMmHoles] = 0;
m_muonTool->searchForHoles(track,information,Trk::muon) ;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment