|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "TLorentzVector.h"
22 #include "GaudiKernel/IInterface.h"
48 ISvcLocator* pSvcLocator):
54 m_trackToVertexTool(
"Reco::TrackToVertex"),
55 m_triggerDecision(
"Trig::TrigDecisionTool/TrigDecisionTool"),
56 m_triggerMatching(
"Trig::MatchingTool/MatchingTool"),
57 m_selTool(
"InDet::InDetTrackSelectionTool/TrackSelectionTool"),
58 m_trackToVertexIPEstimator(
"Trk::TrackToVertexIPEstimator"),
59 m_extrapolator(
"Trk::Extrapolator/AtlasExtrapolator"),
60 m_muonSelector(
"CP::MuonSelectionTool/MuonSelectionTool"),
61 m_validationMode(true),
63 m_commonTreeName (
"commonTree"),
64 m_defaultTreeName(
"Default_Particle"),
65 m_IDTreeName (
"ID_InDetTrackParticle"),
66 m_refit1TreeName (
"Refit1_SiAndTRT"),
67 m_refit2TreeName (
"Refit2_SiOnly"),
68 m_truthTreeName (
"TruthParams"),
69 m_combTreeName (
"CombinedTrackParticle"),
70 m_MSTreeName (
"MS_TrackParticle"),
71 m_FourMuTreeName (
"FourMu"),
73 m_ValidationTreeDescription(
"Small Tree for Zmumu fits"),
75 m_commonTreeFolder (
"/ZmumuValidation/common"),
76 m_defaultTreeFolder(
"/ZmumuValidation/default"),
77 m_IDTreeFolder (
"/ZmumuValidation/ID"),
78 m_refit1TreeFolder (
"/ZmumuValidation/refit1"),
79 m_refit2TreeFolder (
"/ZmumuValidation/refit2"),
80 m_truthTreeFolder (
"/ZmumuValidation/truth"),
81 m_combTreeFolder (
"/ZmumuValidation/comb"),
82 m_MSTreeFolder (
"/ZmumuValidation/ms"),
83 m_FourMuTreeFolder (
"/ZmumuValidation/fourmu"),
85 m_commonTree (nullptr),
86 m_defaultTree(nullptr),
88 m_refit1Tree(nullptr),
89 m_refit2Tree(nullptr),
93 m_FourMuTree(nullptr),
96 m_Trk2VtxAssociationTool(
"CP::TrackVertexAssociationTool", this)
182 return StatusCode::FAILURE;
191 return StatusCode::FAILURE;
199 return StatusCode::FAILURE;
210 return StatusCode::FAILURE;
233 ATH_MSG_INFO(
" -- IDPerfMonZmumu::initialize() -- init m_beamSpotKey ");
271 return StatusCode::FAILURE;
279 return StatusCode::FAILURE;
287 return StatusCode::FAILURE;
294 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::Initialize ** Completed **");
295 return StatusCode::SUCCESS;
303 m_h_cutflow =
new TH1F(
"h_cutflow",
"cut flow histogram",11, -0.5, 9.5);
423 bool isTreeNone =
false;
424 if (
m_IDTreeName.find(
"none") != std::string::npos) isTreeNone =
true;
598 if (
m_combTreeName.find(
"none") != std::string::npos) isTreeNone =
true;
654 if (
m_MSTreeName.find(
"none") != std::string::npos) isTreeNone =
true;
656 ATH_MSG_INFO(
"initialize() ** defining IDPerfMon MSTree ");
819 ATH_MSG_INFO(
"initialize() Going to register the mu+mu- trees");
821 if (tHistSvc.retrieve().isFailure()){
822 ATH_MSG_ERROR(
"initialize() Could not find Hist Service -> Switching ValidationMode Off !");
828 ATH_MSG_INFO(
"initialize() commonTree succesfully registered!");
831 ATH_MSG_ERROR(
"initialize() Could not register the validation commonTree -> Switching ValidationMode Off !");
839 ATH_MSG_INFO(
"initialize() IDTree succesfully registered!");
842 ATH_MSG_ERROR(
"initialize() Could not register the validation IDTree -> Switching ValidationMode Off !");
855 ATH_MSG_INFO(
"initialize() CBTree succesfully registered!");
858 ATH_MSG_ERROR(
"initialize() Could not register the validation CBTree -> Switching ValidationMode Off !");
872 ATH_MSG_INFO(
"initialize() MSTree succesfully registered!");
875 ATH_MSG_ERROR(
"initialize() Could not register the validation MSTree -> Switching ValidationMode Off !");
885 ATH_MSG_INFO(
"initialize() Refit1 Tree succesfully registered!");
888 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !");
896 ATH_MSG_INFO(
"initialize() Refit2 Tree succesfully registered!");
899 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !");
908 ATH_MSG_INFO(
"initialize() truthTree Tree succesfully registered!");
911 ATH_MSG_ERROR(
"initialize() Could not register the validation truth Tree -> Switching ValidationMode Off !");
919 ATH_MSG_INFO(
"initialize() FourMu Tree succesfully registered!");
922 ATH_MSG_ERROR(
"initialize() Could not register the validation FourMu Tree -> Switching ValidationMode Off !");
928 return StatusCode::SUCCESS;
959 ATH_MSG_DEBUG(
" IDPerfMonZmumu::execute evtStore->retrieve (eventInfo) failed .. trying another strategy.. ");
975 ATH_MSG_ERROR(
"** IDPerfMonZmumu::execute ** Could not retrieve event info.");
981 ATH_MSG_DEBUG(
" ** IDPerfMonZmumu::execute ** calling FourLeptonAnalysis()...");
983 if (fourLeptAnaStatus.isSuccess())
ATH_MSG_INFO (
" ** IDPerfMonZmumu::execute ** RunFourLeptonAnalysis() SUCCESS -> found a new event");
989 ATH_MSG_DEBUG(
" ** IDPerfMonZmumu::execute ** calling dimuon analysis m_xZmm.Reco()...");
996 <<
" ** SUCCESS **");
1002 <<
" Failed dimuon reconstruction. m_xZmm.Reco() returned FALSE ");
1003 return StatusCode::SUCCESS;
1012 if (isTriggerPassed == StatusCode::SUCCESS) {
1016 ATH_MSG_DEBUG(
"Trigger Failed -> reject event --> leave event");
1017 return StatusCode::SUCCESS;
1029 StatusCode success_pos = StatusCode::FAILURE;
1030 StatusCode success_neg = StatusCode::FAILURE;
1032 if (muon_pos && muon_neg) {
1036 ATH_MSG_INFO(
"** IDPerfMonZmumu::execute ** Retrieving InnerDetectorTrackParticles of the accepted muons");
1037 ppos_comb = muon_pos->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
1038 pneg_comb = muon_neg->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
1040 if (!ppos_comb || !pneg_comb) {
1041 ATH_MSG_WARNING(
"** IDPerfMonZmumu::execute ** InnerDetectorTrackParticles are requested but they are not present. Exiting event.");
1042 return StatusCode::SUCCESS;
1047 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Retrieving CombinedTrackParticles of the accepted muons");
1048 ppos_comb = muon_pos->
trackParticle(xAOD::Muon::CombinedTrackParticle);
1049 pneg_comb = muon_neg->
trackParticle(xAOD::Muon::CombinedTrackParticle);
1051 if (!ppos_comb || !pneg_comb){
1052 ATH_MSG_WARNING(
"** IDPerfMonZmumu::execute ** CombinedTrackParticles are requested but they are not present. Exiting event.");
1053 return StatusCode::SUCCESS;
1059 if (ppos_comb && pneg_comb) {
1068 const EventContext& ctx = Gaudi::Hive::currentContext();
1070 for (
const auto V : *vertices) {
1080 if (!ppos_comb_v || !pneg_comb_v){
1081 ATH_MSG_WARNING(
"Some or all of the requested particles have no vertex. Exiting event");
1082 return StatusCode::SUCCESS;
1086 ATH_MSG_WARNING(
"** IDPerfMonZmumu::execute ** Could not find CombinedMuon pos/neg in event"
1090 return StatusCode::SUCCESS;
1101 <<
" Invariant mass = " <<
m_xZmm.
GetInvMass() <<
" GeV ** some preliminaries are due though...");
1106 ATH_MSG_DEBUG(
"Exiting because the ID segment of muon_pos do not pass the TrackSelection");
1107 return StatusCode::SUCCESS;
1110 ATH_MSG_DEBUG(
"Exiting because the ID segment of muon_neg do not pass the TrackSelection");
1111 return StatusCode::SUCCESS;
1113 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Good news ** pos and neg muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle) pass the trackSelection :)");
1116 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Track selection is not in use ");
1128 muon_pos->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1132 muon_neg->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1136 if (success_pos && success_neg) {
1151 <<
" pt: " << muon_pos->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->
pt()
1159 <<
" pt: " << muon_neg->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->
pt()
1191 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** not filling IDTracks in combTree due to problems with muon_xxx->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)");
1199 muon_pos->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1204 muon_neg->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1209 if (success_pos && success_neg) {
1264 muon_pos->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1269 muon_neg->
trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1272 if (success_pos && success_neg) {
1305 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Going to build TrackCollections: muonTrks, muonTrksRefit1 and muonTrksRefit2");
1310 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Going to refit and store the track parameters ");
1320 const EventContext& ctx = Gaudi::Hive::currentContext();
1321 if( ppos_comb->
track() ) {
1326 if (fitStatus.isFailure()) {
1327 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Track Refit1 Failed for ppos_comb->track(). Skipping Event");
1328 return StatusCode::SUCCESS;
1330 refit1MuonTrk1 = fitResult.refittedTrack.release();
1331 muonTrksRefit1->
push_back(refit1MuonTrk1);
1332 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Track Refit1 Success of ppos_comb->track()."
1334 <<
" track refit pt: " << refit1MuonTrk1->perigeeParameters()->pT() );
1339 if (fitStatus.isFailure()) {
1340 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Track Refit2 Failed for ppos_comb->track(). Skipping Event");
1341 return StatusCode::SUCCESS;
1343 refit2MuonTrk1 = fitResult.refittedTrack.release();
1344 muonTrksRefit2->
push_back(refit2MuonTrk1);
1345 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Track Refit2 Success of ppos_comb->track()."
1347 <<
" track refit pt: " << refit1MuonTrk1->perigeeParameters()->pT() );
1351 if( pneg_comb->
track() ) {
1356 if (fitStatus.isFailure()) {
1357 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Track Refit1 Failed. Skipping Event");
1358 return StatusCode::SUCCESS;
1360 refit1MuonTrk2 = fitResult.refittedTrack.release();
1361 muonTrksRefit1->
push_back(refit1MuonTrk2);
1362 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Track Refit1 Success of pneg_comb->track()."
1364 <<
" track refit pt: " << refit1MuonTrk2->perigeeParameters()->pT() );
1369 if (fitStatus.isFailure()) {
1371 return StatusCode::SUCCESS;
1373 refit2MuonTrk2 = fitResult.refittedTrack.release();
1374 muonTrksRefit2->
push_back(refit2MuonTrk2);
1375 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** Track Refit2 Success of pneg_comb->track()."
1377 <<
" track refit pt: " << refit2MuonTrk2->perigeeParameters()->pT() );
1380 if (muonTrksRefit1->
size() != 2)
ATH_MSG_WARNING(
"** IDPerfMonZmumu::execute ** WARNING ** size of muonTrksRefit1: " << muonTrksRefit1->
size());
1381 if (muonTrksRefit2->
size() != 2)
ATH_MSG_WARNING(
"** IDPerfMonZmumu::execute ** WARNING ** size of muonTrksRefit2: " << muonTrksRefit2->
size());
1389 if (
sc.isSuccess()) {
1396 if (muonTrksRefit1->
size() > 1) {
1398 if (
sc.isSuccess()) {
1405 if (muonTrksRefit2->
size() > 1) {
1407 if (
sc.isSuccess()) {
1416 if (muonTrksRefit1->
size()<2) {
1417 ATH_MSG_WARNING(
"** IDPerfMonZmumu::execute ** Refit1 muon tracks are missing!");
1420 ATH_MSG_DEBUG(
"** IDPerfMonZmumu::execute ** going to fill refit1tree ");
1425 if (success_pos && success_neg) {
1471 if (muonTrksRefit2->
size()<2) {
1472 ATH_MSG_WARNING(
"** IDPerfMonZmumu::execute ** Refit2 muon tracks are missing!");
1480 if (success_pos && success_neg) {
1533 return StatusCode::SUCCESS;
1540 bool truthStatusIsGood =
true;
1542 truthStatusIsGood =
false;
1546 truthStatusIsGood =
false;
1549 if (truthStatusIsGood) {
1596 bool dofill =
false;
1632 for (
auto muon : *muons) {
1657 if (scid.isSuccess()) {
1668 return StatusCode::SUCCESS;
1679 return StatusCode::FAILURE;
1683 return StatusCode::FAILURE;
1700 double sigma_pt = 0;
1702 double sigma_qOverP = 1.;
1705 px = trackp->
p4().Px();
1706 py = trackp->
p4().Py();
1707 pt = trackp->
p4().Pt();
1708 pz = trackp->
p4().Pz();
1709 phi= trackp->
p4().Phi();
1710 eta= trackp->
p4().Eta();
1713 qoverp = trackp->
qOverP();
1722 double sigma_pt_term1 = (
sin(trackp->
theta()) /
pow(qoverp,2)) * sigma_qOverP;
1723 double sigma_pt_term2 = (1./qoverp) *
cos(trackp->
theta()) * sigma_theta;
1724 double sigma_pt_term3 = (
cos(trackp->
theta()) /
pow(qoverp,2)) * sigma_theta * sigma_qOverP;
1730 return StatusCode::FAILURE;
1733 ATH_MSG_WARNING(
"in FillRecParametersTP. WARNING: m_trackToVertexIPEstimator is NULL");
1734 return StatusCode::FAILURE;
1738 std::unique_ptr<Trk::ImpactParametersAndSigma> iPandSigma(
nullptr);
1745 ATH_MSG_DEBUG(
"return from the trackToVertexIPEstimator->estimate()");
1748 ATH_MSG_WARNING (
"FillRecParametersTP::trackToVertexIPEstimator failed !");
1749 return StatusCode::FAILURE;
1752 ATH_MSG_DEBUG(
"FillRecParametersTP::trackToVertexIPEstimator success !");
1753 PVd0 = iPandSigma->
IPd0;
1756 PVz0 = iPandSigma->
IPz0;
1783 <<
" d0: "<<
m_positive_d0 <<
" d0res : "<< d0res <<
" PVd0res : "<< PVd0res <<
" z0: "<<
m_positive_z0 <<
" z0res : " << z0res <<
" PVz0res : "<< PVz0res );
1785 }
else if (
charge == -1) {
1805 ATH_MSG_DEBUG(
"(Filled charge == -1 ) (reco)-> px : "<<
px <<
" py: "<<
py <<
" pt: " <<
pt <<
" pz: "<<
pz
1806 <<
" d0: "<<
m_negative_d0 <<
" d0res : "<< d0res <<
" PVd0res : "<< PVd0res <<
" z0: "<<
m_negative_z0 <<
" z0res : " << z0res <<
" PVz0res : "<< PVz0res );
1809 return StatusCode::SUCCESS;
1817 ATH_MSG_DEBUG(
"* FillRecParameters * Empty Track: track. Skipping.");
1818 return StatusCode::FAILURE;
1822 ATH_MSG_DEBUG(
"* FillRecParameters * Empty Track: trackp_for_unbias. Skipping.");
1823 return StatusCode::FAILURE;
1839 double d0_err = 999.;
1840 double z0_err = 999.;
1848 if (trkPerigee !=
nullptr){
1851 px = trkPerigee->momentum().x();
1852 py = trkPerigee->momentum().y();
1853 pt = std::abs(trkPerigee->pT());
1854 pz = trkPerigee->momentum().z();
1856 eta= trkPerigee->eta();
1874 px = atBL->momentum().x();
1875 py = atBL->momentum().y();
1876 pt = std::abs(atBL->pT());
1877 pz = atBL->momentum().z();
1878 eta= trkPerigee->eta();
1888 ATH_MSG_WARNING(
"FillRecParameters::Failed extrapolation to the BeamLine");
1892 TLorentzVector vtrack = TLorentzVector (trkPerigee->momentum().x(),
1893 trkPerigee->momentum().y(),
1894 trkPerigee->momentum().z(),
1895 trkPerigee->momentum().mag());
1896 float trkd0 = trkPerigee->parameters()[
Trk::d0];
1897 float trkz0 = trkPerigee->parameters()[
Trk::z0];
1898 float bsX = position.x();
1899 float bsY = position.y();
1900 float bsZ = position.z();
1901 float btiltX = beamSpotHandleRec->beamTilt(0);
1902 float btiltY = beamSpotHandleRec->beamTilt(1);
1904 float beamX = bsX +
std::tan(btiltX) * (trkz0-bsZ);
1905 float beamY = bsY +
std::tan(btiltY) * (trkz0-bsZ);
1906 float beamD0 = ( -
std::sin(vtrack.Phi())*beamX +
std::cos(vtrack.Phi())*beamY );
1907 float d0bscorr = trkd0 - beamD0;
1908 float z0bscorr = trkz0 - bsZ;
1911 std::unique_ptr<Trk::ImpactParametersAndSigma> iPandSigma(
nullptr);
1914 if( iPandSigma==0 ){
1915 ATH_MSG_WARNING (
"FillRecParameters::trackToVertexIPEstimator failed !");
1916 return StatusCode::FAILURE;
1919 ATH_MSG_DEBUG(
"FillRecParameters::trackToVertexIPEstimator success !");
1920 PVd0 = iPandSigma->
IPd0;
1923 PVz0 = iPandSigma->
IPz0;
1928 ATH_MSG_INFO(
" FillRecParameters::trackToVertexIPEstimator vertex does exist ");
1957 ATH_MSG_DEBUG(
"(Filled charge == 1 ) (reco)-> px : "<<
px <<
" py: "<<
py <<
" pz: "<<
pz <<
" d0: "<<
d0<<
" z0: "<<
z0);
1978 ATH_MSG_DEBUG(
"(Filled charge == -1 ) (reco)-> px : "<<
px <<
" py: "<<
py <<
" pz: "<<
pz <<
" d0: "<<
d0<<
" z0: "<<
z0 );
1981 return StatusCode::SUCCESS;
1987 ATH_MSG_DEBUG(
"* FillRecParametersSimple * Empty Track: track. Skipping.");
1988 return StatusCode::FAILURE;
1992 if (not trkPerigee) {
1993 ATH_MSG_ERROR(
"trkPerigee pointer is null in IDPerfMonZmumu::FillRecParametersSimple");
1994 return StatusCode::FAILURE;
2005 double d0_err = 999.;
2006 double z0_err = 999.;
2011 px = trkPerigee->momentum().x();
2012 py = trkPerigee->momentum().y();
2013 pt = std::abs(trkPerigee->pT());
2014 pz = trkPerigee->momentum().z();
2016 eta= trkPerigee->eta();
2025 TLorentzVector vtrack = TLorentzVector (trkPerigee->momentum().x(),
2026 trkPerigee->momentum().y(),
2027 trkPerigee->momentum().z(),
2028 trkPerigee->momentum().mag());
2029 float trkd0 = trkPerigee->parameters()[
Trk::d0];
2030 float trkz0 = trkPerigee->parameters()[
Trk::z0];
2031 float bsX = position.x();
2032 float bsY = position.y();
2033 float bsZ = position.z();
2037 float beamX = bsX +
std::tan(btiltX) * (trkz0-bsZ);
2038 float beamY = bsY +
std::tan(btiltY) * (trkz0-bsZ);
2039 float beamD0 = ( -
std::sin(vtrack.Phi())*beamX +
std::cos(vtrack.Phi())*beamY );
2040 float d0bscorr = trkd0 - beamD0;
2041 float z0bscorr = trkz0 - bsZ -
vertex->z();
2074 return StatusCode::SUCCESS;
2081 if (!trackParticle ){
2082 ATH_MSG_WARNING(
"-- FillTruthParameters -- Empty Trackparticle. Skipping.");
2083 return StatusCode::FAILURE;
2089 ATH_MSG_DEBUG(
" -- FillTruthParameters -- Failure while retrieving the truth particle. Returning FAILURE.");
2090 return StatusCode::FAILURE;
2096 ATH_MSG_DEBUG(
" -- FillTruthParameters -- reco muon associated to a truth neutral!! Returning FAILURE.");
2097 return StatusCode::FAILURE;
2100 ATH_MSG_DEBUG(
" -- FillTruthParameters -- reco muon associated to a non true muon!! Returning FAILURE.");
2101 return StatusCode::FAILURE;
2108 ATH_MSG_DEBUG(
"A production vertex pointer was retrieved, but it is NULL");
2109 return StatusCode::FAILURE;
2113 if (
particle->parent(0) !=
nullptr) {
2119 <<
" nparents " <<
particle->nParents()
2120 <<
" parent->pdg: " <<
particle->parent(0)->pdgId()
2121 <<
" truthType: " << truthTypeAcc(*
particle)
2122 <<
" truthOrigin: " << truthOriginAcc(*
particle)
2129 <<
" nparents " <<
particle->nParents()
2130 <<
" parent->pdg: " <<
particle->parent(0)->pdgId()
2131 <<
" truthType & truthOrigin: " <<
" NOT AVAILABLE "
2136 const auto xPos=ptruthVertex->
x();
2137 const auto yPos=ptruthVertex->
y();
2138 const auto z_truth=ptruthVertex->
z();
2146 const EventContext& ctx = Gaudi::Hive::currentContext();
2167 ATH_MSG_DEBUG(
"reco IPs (pos): > d0 : "<<d0recoPos <<
" z0: " << z0recoPos <<
" trackp z0 : " << trackParticle->
z0() <<
" trackp d0 : " << trackParticle->
d0());
2168 ATH_MSG_DEBUG(
"reco IPs (neg): > d0 : "<<d0recoNeg <<
" z0: " << z0recoNeg <<
" trackp z0 : " << trackParticle->
z0() <<
" trackp d0 : " << trackParticle->
d0() );
2170 double qOverP_truth = 0.;
2209 bool parentfound =
false;
2211 if (
particle->parent(0) !=
nullptr) {
2226 }
else if (
charge == -1) {
2241 bool parentfound =
false;
2243 if (
particle->parent(0) !=
nullptr) {
2258 return StatusCode::SUCCESS;
2269 if( !
acc.isAvailable(
p ) ) {
2273 const Link_t& link =
acc(
p );
2275 if( ! link.isValid() ) {
2286 return StatusCode::SUCCESS;
2297 return StatusCode::FAILURE;
2303 float thisEventTriggerPrescale = 999999.9;
2304 float thisHLTTriggerPrescale = 999999.9;
2305 bool thisHLTIsPassed =
false;
2306 std::string thisHLTTriggerName;
2307 std::string thisEventTriggerName;
2310 const std::vector<std::string> myHLTtriglist =
m_triggerDecision->getChainGroup(
"HLT_mu.*, HLT_2mu.*")->getListOfTriggers();
2311 for (
int i=0;
i < (
int) myHLTtriglist.size();
i++) {
2313 ATH_MSG_DEBUG(
"HLT trigger = " <<
i <<
" out of " << myHLTtriglist.size() <<
" --> " << myHLTtriglist.at(
i) <<
" isPassed? " <<
m_triggerDecision->isPassed(myHLTtriglist.at(
i)) <<
" prescale: " <<
m_triggerDecision->getChainGroup(myHLTtriglist.at(
i))->getPrescale() );
2316 thisHLTIsPassed =
true;
2317 float thisprescale =
m_triggerDecision->getChainGroup(myHLTtriglist.at(
i))->getPrescale();
2318 if (thisprescale < thisHLTTriggerPrescale) {
2319 thisHLTTriggerPrescale = thisprescale;
2320 thisHLTTriggerName = myHLTtriglist.at(
i);
2324 if (thisHLTTriggerPrescale < 1) thisHLTTriggerPrescale = 1;
2325 ATH_MSG_DEBUG(
"Event HLT trigger prescale = " << thisHLTTriggerPrescale);
2328 if (thisHLTIsPassed) {
2333 return StatusCode::FAILURE;
2337 thisEventTriggerPrescale = thisHLTTriggerPrescale;
2338 thisEventTriggerName = thisHLTTriggerName;
2339 ATH_MSG_DEBUG(
"CheckTriggerStatusAndPrescale -- Event trigger prescale = " << thisEventTriggerPrescale);
2340 ATH_MSG_DEBUG(
"CheckTriggerStatusAndPrescale -- Event trigger name = " << thisEventTriggerName);
2346 return StatusCode::SUCCESS;
2360 for (
int ivtx=0; ivtx< (
int) vxContainer->
size();ivtx++) {
2361 myVtx = (*vxContainer)[ivtx];
2554 if( electronTruth) {
2555 ATH_MSG_DEBUG (
"retrieving electron Truth container with key: \"egammaTruthParticles\" SUCCESS ");
2557 if( electronTruth->hasStore() ) {
2559 auto tr_itr = electronTruth->
begin();
2560 auto tr_end = electronTruth->
end();
2561 int electronCount = 0;
2562 for(
int i = 0; tr_itr != tr_end; ++tr_itr, ++
i ) {
2563 ATH_MSG_DEBUG(
"Truth : Investigating truth electron #" <<
i <<
" pdgID= " << ( *tr_itr )->pdgId());
2564 if (fabs(( *tr_itr )->pdgId()) == 11) {
2565 if (( *tr_itr )->pt() > 10000 && fabs(( *tr_itr )->eta()) < 2.47) {
2566 ATH_MSG_INFO(
" central electron found --> pt: " << ( *tr_itr )->charge()*( *tr_itr )->pt() <<
" eta " <<( *tr_itr )->eta() );
2571 ATH_MSG_INFO(
"#central electrons: " << electronCount );
2574 ATH_MSG_WARNING (
"electronTruth container has no Store !!! FAILURE");
2578 ATH_MSG_WARNING (
"retrieve electron Truth container with key: \"egammaTruthParticles\" FAILURE");
2582 if (
m_doDebug) std::cout <<
" ** RunFourLeptonAnalysis ** calling m_4mu.Reco() .... " << std::endl;
2586 if(statusOf4LeptReco) {
2587 thisStatus = StatusCode::SUCCESS;
2592 thisStatus = StatusCode::FAILURE;
2593 ATH_MSG_DEBUG (
"4-lepton reconstruction FAILURE. m_4mu.Reco() returned FALSE --> event failed selection");
2594 if (
m_doDebug) std::cout <<
" ** RunFourLeptonAnalysis ** 4-lepton reconstruction FAILURE. m_4mu.Reco() returned FALSE --> event failed selection" << std::endl;
2597 if(statusOf4LeptReco) {
2705 std::string metName =
"MET_Reference_AntiKt4LCTopo";
2706 std::string metRefFinalName =
"FinalClus";
2713 ATH_MSG_WARNING (
"No Collection with name " << metName <<
" found in StoreGate");
2718 if (
sc.isFailure()) {
2719 ATH_MSG_DEBUG (
"Could not retrieve Collection " << metName <<
" from StoreGate");
2724 if (final_met)
met = (*final_met)[metRefFinalName];
2736 <<
" Invariant mass = " <<
m_4mu_minv <<
" GeV ");
2737 if (muon1_pos !=
nullptr)
ATH_MSG_DEBUG(
"mu1+ --> pxyz " << muon1_pos->
p4().Px()
2738 <<
", " << muon1_pos->
p4().Py()
2739 <<
", " << muon1_pos->
p4().Pz()
2740 <<
" pt: " << muon1_pos->
pt()
2741 <<
" d0: " << muon1_pos->
d0()
2742 <<
" z0: " << muon1_pos->
z0()
2745 if (muon1_neg !=
nullptr)
ATH_MSG_DEBUG(
"mu1- --> pxyz " << muon1_neg->
p4().Px()
2746 <<
", " << muon1_neg->
p4().Py()
2747 <<
", " << muon1_neg->
p4().Pz()
2748 <<
" pt: " << muon1_neg->
pt()
2749 <<
" d0: " << muon1_neg->
d0()
2750 <<
" z0: " << muon1_neg->
z0()
2753 if (elec1_pos !=
nullptr)
ATH_MSG_DEBUG(
"el1+ --> pxyz " << elec1_pos->
p4().Px()
2754 <<
", " << elec1_pos->
p4().Py()
2755 <<
", " << elec1_pos->
p4().Pz()
2756 <<
" pt: " << elec1_pos->
pt()
2757 <<
" d0: " << elec1_pos->
d0()
2758 <<
" z0: " << elec1_pos->
z0()
2779 int nBLhits, nhitsPIX, nhitsSCT, nhitsTRT, nContribPixLayers;
2780 int nPIXholes, nSCTholes;
2781 if (IDTrkMuPos && IDTrkMuNeg) {
2799 <<
" nBLhits: " << nBLhits
2800 <<
" nhitsPIX: " << nhitsPIX
2801 <<
" nPIXLayers: " << nContribPixLayers
2802 <<
" nhitsSCT: " << nhitsSCT
2803 <<
" Silicon holes: " << nPIXholes + nSCTholes
2804 <<
" nhitsTRT: " << nhitsTRT);
2820 <<
" nBLhits: " << nBLhits
2821 <<
" nhitsPIX: " << nhitsPIX
2822 <<
" nPIXLayers: " << nContribPixLayers
2823 <<
" nhitsSCT: " << nhitsSCT
2824 <<
" Silicon holes: " << nPIXholes + nSCTholes
2825 <<
" nhitsTRT: " << nhitsTRT);
double m_positive_sigma_qoverp
double m_negative_d0_manualBS
std::vector< float > m_IDTrack_sigma_z0
ToolHandle< InDet::IInDetTrackSelectionTool > m_selTool
The track selection Tool.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
double m_el_positive1_z0_err
std::string m_IDTreeFolder
std::string m_defaultTreeName
std::string m_combTreeName
std::vector< int > m_nSCThits
std::vector< float > m_Refit1_qoverp
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
tool to extrapolate tracks to BL
std::vector< int > m_nBLhits
ToolHandle< Trig::IMatchingTool > m_triggerMatching
std::string m_truthTreeFolder
std::vector< float > m_Refit1_phi
std::string m_truthLinkVecName
TrackParticle input name.
ToolHandle< CP::ITrackVertexAssociationTool > m_Trk2VtxAssociationTool
const xAOD::TrackParticle * getELTrack(unsigned int uPart)
std::vector< int > m_nPIXhits
Scalar phi() const
phi method
uint64_t eventNumber() const
The current event's event number.
float beamTiltXZ() const
The beam's tilt in radians in XZ.
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be NULL) to the TrackParticle used in identification of this muon.
std::vector< float > m_Refit1_sigma_pt
void SetZ0GapCut(double newvalue)
std::vector< float > m_Truth_d0
const std::vector< float > & mcEventWeights() const
The weights of all the MC events used in the simulation.
std::vector< float > m_CBTrack_d0
float charge() const
Returns the charge.
void SetMuonSelectionTool(ToolHandle< CP::IMuonSelectionTool > mst)
std::vector< float > m_Refit2_z0
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
ToolHandle< IegammaTrkRefitterTool > m_TrackRefitter2
The track refitter.
std::vector< float > m_CBTrack_phi
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
std::vector< float > m_Truth_qoverp
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
std::string m_FourMuTreeName
std::vector< float > m_IDTrack_sigma_qoverp
std::vector< float > m_CBTrack_eta
const xAOD::TrackParticle * getMSTrack(unsigned int uPart)
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackContainerName
IDTtacks.
float beamTiltYZ() const
The beam's tilt in radians in YZ.
float z0() const
Returns the parameter.
std::vector< float > definingParametersCovMatrixVec() const
Returns the length 6 vector containing the elements of defining parameters covariance matrix.
void SetMassWindowHigh(double newvalue)
StatusCode CheckTriggerStatusAndPrescale()
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
double m_el_positive1_d0_err
std::vector< float > m_CBTrack_sigma_qoverp
std::vector< float > m_CBTrack_pt
Class providing the definition of the 4-vector interface.
unsigned int getNegMuon(ZTYPE eType)
std::vector< float > m_Truth_pt
VxType::VertexType vertexType() const
The type of the vertex.
float beamPosX() const
X coordinate of the beam spot position.
std::string m_refit1TreeFolder
std::vector< float > m_Refit2_eta
double m_LeadingMuonPtCut
@ numberOfBLayerHits
these are the hits in the first pixel layer, i.e.
float y() const
Vertex y displacement.
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
used for truth parameters
double m_positive_d0_manualBS
float d0() const
Returns the parameter.
uint32_t runNumber() const
The current event's run number.
virtual StatusCode finalize()
double m_positive_z0_manualBS
ToolHandle< IegammaTrkRefitterTool > m_TrackRefitter1
The track refitter.
void SetMaxLumiBlock(int newlumiblock)
std::vector< float > m_Refit1_z0
void doIPSelection(bool doIPsel)
std::vector< float > m_IDTrack_d0
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
bool m_validationMode
< boolean to switch to validation mode
std::string m_trackParticleName
Track(Particle)TruthCollection input name.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
float beamPosY() const
Y coordinate of the beam spot position.
unsigned int getNegMuon(int eType)
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
std::string m_ValidationTreeDescription
< validation tree description - second argument in TTree
std::string m_refit2TreeFolder
StatusCode FillTruthParameters(const xAOD::TrackParticle *track)
double m_el_negative1_z0_err
std::vector< float > m_Refit1_sigma_z0
std::vector< float > m_Refit2_qoverp
std::vector< float > m_CBTrack_sigma_pt
unsigned int getPosMuon(int eType)
void RegisterHistograms()
std::vector< float > m_IDTrack_phi
@ OWN_ELEMENTS
this data object owns its elements
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
double m_positive_2_z0_err
double m_el_positive2_d0_err
std::vector< float > m_CBTrack_sigma_z0
std::string m_combTreeFolder
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
std::vector< float > m_Refit1_sigma_qoverp
std::vector< float > m_IDTrack_eta
Principal data object for Missing ET.
void SetLeadingMuonPtCut(double newvalue)
std::vector< float > m_IDTrack_z0
std::string m_MuonQualityName
std::vector< float > m_Refit1_eta
std::vector< float > m_IDTrack_sigma_d0
double m_negative_d0_PVerr
std::vector< float > m_IDTrack_sigma_pt
std::vector< float > m_CBTrack_sigma_d0
std::vector< int > m_nTRThits
unsigned int m_lumi_block
std::vector< float > m_Refit1_pt
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
@ numberOfSCTHoles
number of SCT holes [unit8_t].
std::string m_outputTracksName
std::vector< float > m_Refit2_phi
void doMCPSelection(bool doMCP)
const xAOD::Muon * getCombMuon(unsigned int uPart)
double m_el_negative2_z0_err
uint32_t lumiBlock() const
The current event's luminosity block number.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::vector< float > m_Refit2_d0
double m_positive_2_d0_err
StatusCode FillRecParametersSimple(const Trk::Track *track, float charge, const xAOD::Vertex *vertex)
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
StatusCode FillRecParameters(const Trk::Track *track, const xAOD::TrackParticle *trackp_for_unbias, double charge, const xAOD::Vertex *vertex, const EventContext &ctx)
ElementLink implementation for ROOT usage.
void ResetCommonNtupleVectors()
double m_negative_2_d0_err
const Perigee * perigeeParameters() const
return Perigee.
Class describing a truth vertex in the MC record.
Container for xAOD::MissingET_v1 objects.
void doIPSelection(bool doIPsel)
double pT() const
Access method for transverse momentum.
std::vector< float > m_Truth_z0
float beamPosZ() const
Z coordinate of the beam spot position.
float qOverP() const
Returns the parameter.
double m_negative_z0_PVerr
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
void setDebugMode(bool debug)
bool m_useCustomMuonSelector
void SetMuonSelectionTool(ToolHandle< CP::IMuonSelectionTool > mst)
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
void setDebugMode(bool debug)
void doIsoSelection(bool doIso)
std::vector< float > m_Truth_phi
double charge(const T &p)
std::string m_MSTreeFolder
std::vector< float > m_Refit2_sigma_pt
void setContainer(PerfMonServices::CONTAINERS container)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
std::vector< float > m_Refit1_sigma_d0
Eigen::Matrix< double, 3, 1 > Vector3D
ToolHandle< CP::IMuonSelectionTool > m_muonSelector
used to pass a custom muon selector
std::string m_sTriggerChainName
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimator
Needed for IP resolution studies.
std::string m_refit1TreeName
void SetSecondMuonPtCut(double newvalue)
void SetMuonQuality(const std::string &newname)
float x() const
Vertex x displacement.
virtual StatusCode initialize()
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
std::string m_commonTreeFolder
void SetLeadingMuonPtCut(double newvalue)
const Amg::Vector3D & momentum() const
Access method for the momentum.
double m_positive_d0_PVerr
void SetMinLumiBlock(int newlumiblock)
double m_el_positive2_z0_err
StatusCode FillRecParametersTP(const xAOD::TrackParticle *trackp, const xAOD::TrackParticle *trackp_for_unbias, double charge, const xAOD::Vertex *vertex=nullptr)
void Clear4MuNtupleVariables()
virtual StatusCode execute()
bool m_useTrackSelectionTool
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
double m_el_negative1_d0_err
std::vector< float > m_CBTrack_z0
StatusCode RunFourLeptonAnalysis()
std::string m_triggerName
float z() const
Vertex longitudinal distance along the beam line form the origin.
void SetOpeningAngleCut(double newvalue)
void doMCPSelection(bool doMCP)
double m_negative_sigma_qoverp
int GetVertexElec(unsigned int uPart)
std::vector< float > m_Refit1_d0
@ numberOfContribPixelLayers
number of contributing layers of the pixel detector [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
std::vector< float > m_Truth_eta
std::vector< float > m_Refit2_sigma_qoverp
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
double eta() const
Access method for pseudorapidity - from momentum.
ToolHandle< Trk::IExtrapolator > m_extrapolator
void SetMassWindowLow(double newvalue)
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Class describing a TrackParticle.
void ExtractIDHitsInformation(const xAOD::Muon *muon_pos, const xAOD::Muon *muon_neg)
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
Helper class to provide constant type-safe access to aux data.
ToolHandle< Trig::TrigDecisionTool > m_triggerDecision
TH1F * m_h_cutflow
link vector to map HepMC onto xAOD truth
void SetSkipMSCheck(bool value)
double m_negative_2_z0_err
double m_positive_z0_PVerr
const xAOD::Vertex * GetDiMuonVertex(const xAOD::TrackParticle *, const xAOD::TrackParticle *)
void SetOpeningAngleCut(double newvalue)
void SetMassWindowHigh(double newvalue)
std::vector< float > m_Refit2_pt
constexpr int pow(int base, int exp) noexcept
std::vector< int > m_Truth_parent
std::vector< float > m_Refit2_sigma_d0
void SetZ0GapCut(double newvalue)
std::string m_commonTreeName
float theta() const
Returns the parameter, which has range 0 to .
size_type size() const noexcept
Returns the number of elements in the collection.
std::string m_truthTreeName
unsigned int getPosMuon(ZTYPE eType)
std::vector< float > m_Refit2_sigma_z0
double m_negative_z0_manualBS
std::vector< float > m_IDTrack_qoverp
std::string m_refit2TreeName
void SetSecondMuonPtCut(double newvalue)
void setContainer(PerfMonServices::CONTAINERS container)
void SetMassWindowLow(double newvalue)
std::vector< float > m_CBTrack_qoverp
IDPerfMonZmumu(const std::string &name, ISvcLocator *pSvcLocator)
needed for IP resolution studies
void doIsoSelection(bool doIso)
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
std::string m_defaultTreeFolder
const xAOD::TrackParticle * getIDTrack(unsigned int uPart)
std::vector< float > m_IDTrack_pt
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
virtual bool Reco(int theLumiBlock=0)
double m_el_negative2_d0_err
double m_negative_sigma_pt
std::string m_FourMuTreeFolder
Root Validation Tree.
double m_positive_sigma_pt