Commit e6573918 authored by Adam Edward Barton's avatar Adam Edward Barton Committed by Frank Winklmeier
Browse files

Fix charge selection in BTrigMT

parent f4d350e5
......@@ -65,7 +65,7 @@ class TrigMultiTrkHypoConfig(object):
tool.AcceptAll = True
if 'noos' in topoAlgs:
tool.OppositeSign = True
tool.TotChargeCut = -100 #Negative number to indicate no charge cut
tool.ApplyUpperMassCut = True
tool.ApplyChi2Cut = True
......
......@@ -34,6 +34,7 @@ using TrigCompositeUtils::DecisionContainer;
using TrigCompositeUtils::DecisionIDContainer;
TrigMultiTrkHypo::TrigMultiTrkHypo(const std::string& name, ISvcLocator* pSvcLocator)
: ::HypoBase(name, pSvcLocator) {}
......
......@@ -61,6 +61,7 @@ class TrigMultiTrkHypo: public ::HypoBase {
SG::ReadHandleKey<xAOD::TrackParticleContainer>
m_trackParticleContainerKey {this, "TrackCollectionKey", "Tracks", "input TrackParticle container name"};
SG::ReadHandleKey<xAOD::MuonContainer>
m_muonContainerKey {this, "MuonCollectionKey", "CBCombinedMuon", "input EF Muon container name"};
......
......@@ -42,7 +42,8 @@ TrigMultiTrkHypoTool::~TrigMultiTrkHypoTool()
StatusCode TrigMultiTrkHypoTool::initialize()
{
ATH_MSG_DEBUG("AcceptAll = " << (m_acceptAll==true ? "True" : "False") );
ATH_MSG_DEBUG("OppositeCharge = " << (m_oppositeCharge==true ? "True" : "False") );
if(m_TotChargeCut >=0)ATH_MSG_DEBUG("Total Charge Cut = " << m_TotChargeCut);
else ATH_MSG_DEBUG("Total Charge Cut is disabled");
ATH_MSG_DEBUG("LowerMassCut = " << m_lowerMassCut );
ATH_MSG_DEBUG("UpperMassCut = " << m_upperMassCut );
ATH_MSG_DEBUG("ApplyUpperMassCut = " << m_applyUpperMassCut );
......@@ -79,7 +80,7 @@ bool TrigMultiTrkHypoTool::decideOnSingleObject( const xAOD::TrigBphys* trigBphy
bool thisPassedMassCut = false;
bool thisPassedChi2Cut = false;
bool thisPassedTrkPtCut = false;
bool thisPassedChargeCut = false;
bool result = false;
std::vector<float> ini_trkPts(0);
......@@ -124,6 +125,10 @@ bool TrigMultiTrkHypoTool::decideOnSingleObject( const xAOD::TrigBphys* trigBphy
trackPts.push_back(tp->pt());
}
mon_totCharge = totq;
thisPassedChargeCut = m_TotChargeCut <= -1 || (std::abs(totq) != m_TotChargeCut);
if(thisPassedChargeCut){
ATH_MSG_DEBUG("Passed charge cut with " << totq);
}
std::sort(trackPts.rbegin(), trackPts.rend()); //reverse sort the list
unsigned int nTrk_pass = 0;
for(unsigned int i=0; i < nTrk; i++ ){
......@@ -147,10 +152,13 @@ bool TrigMultiTrkHypoTool::decideOnSingleObject( const xAOD::TrigBphys* trigBphy
mon_cutCounter++;
if ( thisPassedTrkPtCut ){
mon_cutCounter++;
if(thisPassedChargeCut){
mon_cutCounter++;
}
}
}
}
if ( thisPassedMassCut && thisPassedChi2Cut && thisPassedTrkPtCut ) {
if ( thisPassedMassCut & thisPassedChi2Cut & thisPassedTrkPtCut & thisPassedChargeCut) {
result = true;
ATH_MSG_DEBUG("accepting event");
}
......
......@@ -76,7 +76,7 @@ class TrigMultiTrkHypoTool: public ::AthAlgTool {
// Mass window cuts
Gaudi::Property<int> m_nTrk { this, "nTrk",2,"Number of tracks in the vertex"};
Gaudi::Property< bool > m_oppositeCharge{this, "OppositeSign", false, "Require OS tracks" };
Gaudi::Property< int > m_TotChargeCut{this, "TotChargeCut", 0, "The Magnitude of the total charge to accept, negative is none" };
Gaudi::Property< float > m_lowerMassCut{this, "LowerMassCut", -99. , "Lower mass cut for vertex " };
Gaudi::Property< float > m_upperMassCut{this, "UpperMassCut", -99. , "Upper mass cut for vertex" };
Gaudi::Property< bool >m_applyUpperMassCut{this, "ApplyUpperMassCut", false, "Apply the upper mass cut" };
......
......@@ -20,8 +20,8 @@ TrigSignatureMoniMT INFO HLT_2mu14_L12MU10
TrigSignatureMoniMT INFO HLT_2mu14_L12MU10 decisions 12 4 4 4 0
TrigSignatureMoniMT INFO HLT_2mu15_L12MU10 3 3 3 1 1 1 0 1
TrigSignatureMoniMT INFO HLT_2mu15_L12MU10 decisions 12 4 4 4 0
TrigSignatureMoniMT INFO HLT_2mu4_bDimu_L12MU4 4 4 4 2 1 1 0 0
TrigSignatureMoniMT INFO HLT_2mu4_bDimu_L12MU4 decisions 16 22 4 4 0
TrigSignatureMoniMT INFO HLT_2mu4_bDimu_L12MU4 4 4 4 1 0 0 0 0
TrigSignatureMoniMT INFO HLT_2mu4_bDimu_L12MU4 decisions 16 9 0 0 0
TrigSignatureMoniMT INFO HLT_2mu4_bJpsimumu_L12MU4 4 4 4 0 0 0 0 0
TrigSignatureMoniMT INFO HLT_2mu4_bJpsimumu_L12MU4 decisions 16 0 0 0 0
TrigSignatureMoniMT INFO HLT_2mu4_bUpsimumu_L12MU4 4 4 4 0 0 0 0 0
......
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