Skip to content
Commits on Source (487)
......@@ -526,7 +526,7 @@ namespace asg
ANA_MSG_ERROR ("trying to initialize ToolHandleArray property " << val_name << " with empty handle");
return StatusCode::FAILURE;
}
//strip the parent name
std::string tool_name = toolHandle.name();
tools.push_back (toolHandle.type() + "/" + tool_name);
......@@ -1130,6 +1130,9 @@ namespace asg
return detail::AnaToolHandleMode::USER;
#endif
if (m_config.empty() && !m_handleUser->typeAndName().empty() && (m_handleUser->type() != this->type() || m_handleUser->name() != this->name()))
return detail::AnaToolHandleMode::USER;
if (m_config.empty() && m_name.empty())
return detail::AnaToolHandleMode::EMPTY;
......
......@@ -23,6 +23,8 @@ atlas_depends_on_subdirs(
Control/StoreGate
Database/PersistentDataModel
Event/EventInfo
Event/xAOD/xAODEventInfo
Event/EventInfoUtils
GaudiKernel )
# External dependencies:
......@@ -59,8 +61,8 @@ atlas_add_component( AthenaServices ${sources}
${CLHEP_INCLUDE_DIRS} ${extra_inc}
LINK_LIBRARIES ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}
${CLHEP_LIBRARIES} z TestTools AthenaBaseComps AthenaKernel CxxUtils
DataModel DataModelRoot Navigation PerfMonKernel SGTools
StoreGateLib SGtests PersistentDataModel EventInfo GaudiKernel ${extra_libs} )
DataModel DataModelRoot Navigation PerfMonEvent PerfMonKernel SGTools
StoreGateLib SGtests PersistentDataModel EventInfo xAODEventInfo EventInfoUtils GaudiKernel ${extra_libs} )
# Test library checking the ability to build T/P converters:
atlas_add_tpcnv_library( AthenaServicesTest src/test/*.cxx
......
......@@ -37,6 +37,9 @@
#include "EventInfo/EventID.h"
#include "EventInfo/EventType.h"
#include "xAODEventInfo/EventInfo.h"
#include "EventInfoUtils/EventInfoFromxAOD.h"
#include "ClearStorePolicy.h"
#include "AthenaEventLoopMgr.h"
......@@ -691,7 +694,7 @@ StatusCode AthenaEventLoopMgr::executeEvent(void* /*par*/)
pEventPtr = CxxUtils::make_unique<EventInfo>
(new EventID(runNumber, eventNumber, eventTime, eventTimeNS, lumiBlock, bunchId), (EventType*)0);
pEvent = pEventPtr.get();
} catch (...) {
}
/* FIXME: PvG, not currently written
......@@ -708,11 +711,24 @@ StatusCode AthenaEventLoopMgr::executeEvent(void* /*par*/)
*/
}
if ( pEvent == 0 ) {
StatusCode sc = eventStore()->retrieve(pEvent);
if( !sc.isSuccess() ) {
m_msg << MSG::ERROR
<< "Unable to retrieve Event root object" << endreq;
return (StatusCode::FAILURE);
pEvent=eventStore()->tryConstRetrieve<EventInfo>();
if (pEvent == 0) {
//Try getting xAOD::EventInfo object
const xAOD::EventInfo* xAODEvent=eventStore()->tryConstRetrieve<xAOD::EventInfo>();
if (xAODEvent==nullptr) {
m_msg << MSG::ERROR
<< "Failed to get EventID from input. Tried both xAOD::EventInfo and legacy EventInfo"
<< endmsg;
return (StatusCode::FAILURE);
}
// Record the old-style object for those clients that still need it
pEventPtr = CxxUtils::make_unique<EventInfo>(new EventID(eventIDFromxAOD(xAODEvent)), new EventType(eventTypeFromxAOD(xAODEvent)));
pEvent = pEventPtr.get();
StatusCode sc = eventStore()->record(std::move(pEventPtr),"");
if( !sc.isSuccess() ) {
m_msg << MSG::ERROR << "Error declaring event data object" << endmsg;
return StatusCode::FAILURE;
}
}
}
}
......@@ -1123,7 +1139,6 @@ void AthenaEventLoopMgr::handle(const Incident& inc)
}
// Construct EventInfo
const EventInfo* pEvent(0);
IOpaqueAddress* addr = 0;
sc = m_evtSelector->next(*m_evtContext);
if(!sc.isSuccess()) {
......@@ -1150,10 +1165,23 @@ void AthenaEventLoopMgr::handle(const Incident& inc)
}
// Retrieve the Event object
sc = eventStore()->retrieve(pEvent);
if(!sc.isSuccess()) {
m_msg << MSG::ERROR << "Unable to retrieve Event root object" << endreq;
return;
std::unique_ptr<EventInfo> pEventPtr;
const EventInfo* pEvent = eventStore()->tryConstRetrieve<EventInfo>();
if(!pEvent) {
//Try getting xAOD::EventInfo object
const xAOD::EventInfo* xAODEvent=eventStore()->tryConstRetrieve<xAOD::EventInfo>();
if(!xAODEvent) {
m_msg << MSG::ERROR << "Failed to get EventID from input. Tried both xAOD::EventInfo and legacy EventInfo" << endmsg;
return;
}
// Record the old-style object for those clients that still need it
pEventPtr = CxxUtils::make_unique<EventInfo>(new EventID(eventIDFromxAOD(xAODEvent)), new EventType(eventTypeFromxAOD(xAODEvent)));
pEvent = pEventPtr.get();
sc = eventStore()->record(std::move(pEventPtr),"");
if( !sc.isSuccess() ) {
m_msg << MSG::ERROR << "Error declaring event data object" << endmsg;
return;
}
}
sc = beginRunAlgorithms(*pEvent);
......
......@@ -409,7 +409,7 @@ class Svc(object):
headerFile = outFiles[0]
_msg = self.msg
db_infos = lshosts_infos()
db_infos = ('err',) # lshosts_infos()
if db_infos[0] != 'ok':
host_infos = { 'si2k' : 0.,
'cpuf' : 0. }
......
......@@ -11,6 +11,7 @@ atlas_depends_on_subdirs(
Control/AthenaBaseComps
Control/AthenaMonitoring
Control/StoreGate
Database/ConnectionManagement/AtlasAuthentication
Event/xAOD/xAODCaloEvent
Event/xAOD/xAODEventInfo
Event/xAOD/xAODJet
......@@ -41,7 +42,7 @@ atlas_depends_on_subdirs(
Tools/LWHists
Tracking/TrkEvent/TrkParameters
Tracking/TrkExtrapolation/TrkExInterfaces
Trigger/TrigAnalysis/TrigEgammaMatchingTool
Trigger/TrigAnalysis/TrigEgammaMatchingTool
Trigger/TrigAnalysis/TrigDecisionTool
Trigger/TrigAnalysis/TrigMuonMatching
Trigger/TrigEvent/TrigCaloEvent
......@@ -62,7 +63,7 @@ atlas_add_component( DataQualityTools
src/*.cxx
src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} CaloGeoHelpers AthenaBaseComps AthenaMonitoringLib StoreGateLib SGtests xAODCaloEvent xAODEventInfo xAODJet xAODMissingET xAODMuon xAODTracking LUCID_RawEvent ZdcEvent ZdcIdentifier GaudiKernel InDetIdentifier InDetRawData InDetPrepRawData LArRawEvent LArRecEvent MagFieldInterfaces MuonCalibITools MuonIdHelpersLib MuonRDO MuonRecHelperToolsLib TagEvent RecBackgroundEvent RecoToolInterfaces TileEvent LWHists TrkParameters TrkExInterfaces TrkVertexAnalysisUtilsLib TrigDecisionToolLib TrigCaloEvent TrigMuonEvent TrigParticle TrigT1Result MuonSelectorToolsLib )
LINK_LIBRARIES ${ROOT_LIBRARIES} CaloGeoHelpers AthenaBaseComps AthenaMonitoringLib StoreGateLib SGtests xAODCaloEvent xAODEventInfo xAODJet xAODMissingET xAODMuon xAODTracking LUCID_RawEvent ZdcEvent ZdcIdentifier GaudiKernel InDetIdentifier InDetRawData InDetPrepRawData LArRawEvent LArRecEvent MagFieldInterfaces MuonCalibITools MuonIdHelpersLib MuonRDO MuonRecHelperToolsLib TagEvent RecBackgroundEvent RecoToolInterfaces TileEvent LWHists TrkParameters TrkExInterfaces TrkVertexAnalysisUtilsLib TrigDecisionToolLib TrigCaloEvent TrigMuonEvent TrigParticle TrigT1Result MuonSelectorToolsLib TrigAnalysisInterfaces TrigBunchCrossingTool )
# Install files from the package:
#atlas_install_headers( DataQualityTools )
......
......@@ -23,10 +23,6 @@
#include "TrigDecisionTool/TrigDecisionTool.h"
#include "TrigEgammaMatchingTool/ITrigEgammaMatchingTool.h"
#include "PATInterfaces/ISystematicsTool.h"
#include <PATInterfaces/SystematicRegistry.h>
#include <PATInterfaces/SystematicVariation.h>
#include "TMath.h"
#include <string>
#include <iostream>
......@@ -71,8 +67,9 @@ class DQTGlobalWZFinderTool: public DataQualityFatherMonTool
bool bookDQTGlobalWZFinderTool();
private:
void setDQTGlobalWZFinderBranches();
void doMuonTriggerTP(const xAOD::Muon* , const xAOD::Muon*);
void doMuonTruthEff(std::vector<const xAOD::Muon*>&);
void doMuonLooseTP(std::vector<const xAOD::Muon*>& goodmuonsZ, const xAOD::Vertex* pVtx);
void doMuonInDetTP(std::vector<const xAOD::Muon*>& goodmuonsZ, const xAOD::Vertex* pVtx);
......@@ -86,7 +83,9 @@ private:
const xAOD::Vertex* pVtx, bool isBad);
bool kinematicCuts(const xAOD::Electron*);
ToolHandle<Trig::ITrigEgammaMatchingTool> m_elTrigMatchTool;
bool m_isSimulation;
bool m_writeTTrees;
TH1F *m_ZBosonCounter_El_os;
TH1F *m_ZBosonCounter_El_ss;
......@@ -110,116 +109,220 @@ private:
TH1F_LW *m_fiducialSumWeights_el;
TH1F_LW *m_fiducialSumWeights_mu;
//----- Electron END ------//
TH1F_LW *m_W_mt_ele;
TH1F_LW *m_W_mt_mu;
TH2F_LW *m_W_pt_v_met_ele;
TH2F_LW *m_W_pt_v_met_mu;
TH1F_LW *m_metHist;
TH1F_LW *m_metPhiHist;
TH1F_LW *m_Z_mass_opsele;
TH1F_LW *m_Z_mass_opsmu;
TH1F_LW *m_JPsi_mass_opsmu;
TH1F_LW *m_Upsilon_mass_opsmu;
TH1F_LW *m_Z_mass_ssele;
TH1F_LW *m_Z_mass_ssmu;
TH1F_LW *m_Z_Q_ele;
TH1F_LW *m_Z_Q_mu;
TProfile *m_livetime_lb;
TProfile *m_lblength_lb;
TProfile *m_mu_lb;
TProfile *m_Z_ee_trig_ps;
TProfile *m_Z_mm_trig_ps;
//----- Electron END ------//
TH1F_LW *m_W_mt_ele;
TH1F_LW *m_W_mt_mu;
TH2F_LW *m_W_pt_v_met_ele;
TH2F_LW *m_W_pt_v_met_mu;
TH1F_LW *m_metHist;
TH1F_LW *m_metPhiHist;
TH1F_LW *m_Z_mass_opsele;
TH1F_LW *m_Z_mass_opsmu;
TH1F_LW *m_JPsi_mass_opsmu;
TH1F_LW *m_Upsilon_mass_opsmu;
TH1F_LW *m_Z_mass_ssele;
TH1F_LW *m_Z_mass_ssmu;
TH1F_LW *m_Z_Q_ele;
TH1F_LW *m_Z_Q_mu;
TProfile *m_livetime_lb;
TProfile *m_lblength_lb;
TProfile *m_mu_lb;
TProfile *m_Z_ee_trig_ps;
TProfile *m_Z_mm_trig_ps;
TH1F_LW *m_muon_Pt;
TH1F_LW *m_muon_Eta;
TH1F_LW *m_ele_Et;
TH1F_LW *m_ele_Eta;
//Resonance Counters
float m_minLumiBlock;
float m_maxLumiBlock;
float m_numBins;
TH1F_LW *m_JPsiCounter_Mu;
TH1F_LW *m_UpsilonCounter_Mu;
TH1F *m_ZBosonCounter_Mu;
//Trigger T&P
TH1F_LW *m_mutrigtp_matches;
//Reco T&P
TH1F_LW *m_muloosetp_match_os;
TH1F_LW *m_muloosetp_match_ss;
TH1F_LW *m_muloosetp_nomatch_os;
TH1F_LW *m_muloosetp_nomatch_ss;
// Inner detector T&P
TH1F_LW *m_mu_InDet_tp_match_os;
TH1F_LW *m_mu_InDet_tp_match_ss;
TH1F_LW *m_mu_InDet_tp_nomatch_os;
TH1F_LW *m_mu_InDet_tp_nomatch_ss;
// MC truth
TH1F_LW *m_mcmatch;
TH1F_LW *m_muon_Pt;
TH1F_LW *m_muon_Eta;
TH1F_LW *m_ele_Et;
TH1F_LW *m_ele_Eta;
//Resonance Counters
float m_minLumiBlock;
float m_maxLumiBlock;
float m_numBins;
TH1F_LW *m_JPsiCounter_Mu;
TH1F_LW *m_UpsilonCounter_Mu;
TH1F *m_ZBosonCounter_Mu;
//Trigger T&P
TH1F_LW *m_mutrigtp_matches;
//Reco T&P
TH1F_LW *m_muloosetp_match_os;
TH1F_LW *m_muloosetp_match_ss;
TH1F_LW *m_muloosetp_nomatch_os;
TH1F_LW *m_muloosetp_nomatch_ss;
// Inner detector T&P
TH1F_LW *m_mu_InDet_tp_match_os;
TH1F_LW *m_mu_InDet_tp_match_ss;
TH1F_LW *m_mu_InDet_tp_nomatch_os;
TH1F_LW *m_mu_InDet_tp_nomatch_ss;
// MC truth
TH1F_LW *m_mcmatch;
//Second component of counter array is for trigger aware counter
int m_JPsiCounterSBG[2];
int m_JPsiCounter2BG[2];
int m_JPsiCounterSignal[2];
//Second component of counter array is for trigger aware counter
int m_JPsiCounterSBG[2];
int m_JPsiCounter2BG[2];
int m_JPsiCounterSignal[2];
int m_UpsilonCounterSBG[2];
int m_UpsilonCounterBG[2];
int m_UpsilonCounterSignal[2];
int m_UpsilonCounterSBG[2];
int m_UpsilonCounterBG[2];
int m_UpsilonCounterSignal[2];
int m_ZBosonCounterSBG_El[2];
int m_ZBosonCounterSBG_Mu[2];
int m_ZBosonCounterSBG_El[2];
int m_ZBosonCounterSBG_Mu[2];
//uint32_t lumiBlock;
//uint32_t eventNumber;
//uint32_t lumiBlock;
//uint32_t eventNumber;
int m_this_lb; //remove _t
int m_eventNumber; //remove _t
Float_t m_evtWeight;
int m_this_lb; //remove _t
int m_eventNumber; //remove _t
float m_evtWeight;
std::string m_electronContainerName;
std::string m_egDetailContainerName;
std::string m_VxPrimContainerName;
std::string m_VxContainerName;
std::string m_METName;
std::string m_muonContainerName;
std::string m_jetCollectionName;
std::string m_tracksName;
Float_t m_electronEtCut;
Float_t m_muonPtCut;
Float_t m_metCut;
Float_t m_zCutLow;
Float_t m_zCutHigh;
Float_t m_muonMaxEta;
bool m_doTrigger;
ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool;
ToolHandle<CP::IIsolationSelectionTool> m_isolationSelectionTool;
ToolHandle<Trig::ITrigMuonMatching> m_muTrigMatchTool;
bool m_useOwnMuonSelection;
std::string m_electronContainerName;
std::string m_egDetailContainerName;
std::string m_VxPrimContainerName;
std::string m_VxContainerName;
std::string m_METName;
std::string m_muonContainerName;
std::string m_jetCollectionName;
std::string m_tracksName;
float m_electronEtCut;
float m_muonPtCut;
float m_metCut;
float m_zCutLow;
float m_zCutHigh;
float m_muonMaxEta;
bool m_doTrigger;
ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool;
ToolHandle<CP::IIsolationSelectionTool> m_isolationSelectionTool;
ToolHandle<Trig::ITrigMuonMatching> m_muTrigMatchTool;
bool m_useOwnMuonSelection;
// to guard against endless messages
bool m_printedErrorEleContainer;
bool m_printedErrorMuColl;
bool m_printedErrorMet;
bool m_printedErrorTrackContainer;
std::vector<std::string> m_Jpsi_mm_trigger;
std::vector<std::string> m_Z_mm_trigger;
std::vector<std::string> m_Z_ee_trigger;
// to guard against endless messages
bool m_printedErrorEleContainer;
bool m_printedErrorMuColl;
bool m_printedErrorMet;
bool m_printedErrorTrackContainer;
std::vector<std::string> m_Jpsi_mm_trigger;
std::vector<std::string> m_Z_mm_trigger;
std::vector<std::string> m_Z_ee_trigger;
ToolHandle<Trig::ITrigEgammaMatchingTool> m_elTrigMatchTool;
// Here we define all the TTree variables
// Muon TTrees
TTree *m_muontree;
bool m_muontree_isTruth;
float m_muontree_eta1;
float m_muontree_eta2;
float m_muontree_phi1;
float m_muontree_phi2;
float m_muontree_pT1;
float m_muontree_pT2;
float m_muontree_weight;
float m_muontree_mass;
int m_muontree_lb;
int m_muontree_runnumber;
unsigned long long m_muontree_eventnumber;
TTree *m_muon_reco_tptree;
bool m_muon_reco_tptree_isTruth;
float m_muon_reco_tptree_pT;
float m_muon_reco_tptree_eta;
float m_muon_reco_tptree_phi;
float m_muon_reco_tptree_mass;
float m_muon_reco_tptree_weight;
int m_muon_reco_tptree_mtype;
int m_muon_reco_tptree_lb;
int m_muon_reco_tptree_runnumber;
unsigned long long m_muon_reco_tptree_eventnumber;
TTree *m_muon_indet_tptree;
bool m_muon_indet_tptree_isTruth;
float m_muon_indet_tptree_pT;
float m_muon_indet_tptree_eta;
float m_muon_indet_tptree_phi;
float m_muon_indet_tptree_mass;
float m_muon_indet_tptree_weight;
int m_muon_indet_tptree_mtype;
int m_muon_indet_tptree_lb;
int m_muon_indet_tptree_runnumber;
unsigned long long m_muon_indet_tptree_eventnumber;
TTree *m_muon_trig_tptree;
bool m_muon_trig_tptree_isTruth;
float m_muon_trig_tptree_pT;
float m_muon_trig_tptree_eta;
float m_muon_trig_tptree_phi;
float m_muon_trig_tptree_mass;
float m_muon_trig_tptree_weight;
int m_muon_trig_tptree_mtype;
int m_muon_trig_tptree_lb;
int m_muon_trig_tptree_runnumber;
unsigned long long m_muon_trig_tptree_eventnumber;
// Electron TTrees
TTree *m_electrontree;
bool m_electrontree_isTruth;
float m_electrontree_eta1;
float m_electrontree_eta2;
float m_electrontree_phi1;
float m_electrontree_phi2;
float m_electrontree_pT1;
float m_electrontree_pT2;
float m_electrontree_weight;
float m_electrontree_mass;
int m_electrontree_lb;
int m_electrontree_runnumber;
unsigned long long m_electrontree_eventnumber;
TTree *m_electron_reco_tptree;
bool m_electron_reco_tptree_isTruth;
float m_electron_reco_tptree_pT;
float m_electron_reco_tptree_eta;
float m_electron_reco_tptree_phi;
float m_electron_reco_tptree_mass;
float m_electron_reco_tptree_weight;
int m_electron_reco_tptree_mtype;
int m_electron_reco_tptree_lb;
int m_electron_reco_tptree_runnumber;
unsigned long long m_electron_reco_tptree_eventnumber;
TTree *m_electron_container_tptree;
bool m_electron_container_tptree_isTruth;
float m_electron_container_tptree_pT;
float m_electron_container_tptree_eta;
float m_electron_container_tptree_phi;
float m_electron_container_tptree_mass;
float m_electron_container_tptree_weight;
int m_electron_container_tptree_mtype;
int m_electron_container_tptree_lb;
int m_electron_container_tptree_runnumber;
unsigned long long m_electron_container_tptree_eventnumber;
TTree *m_electron_trig_tptree;
bool m_electron_trig_tptree_isTruth;
float m_electron_trig_tptree_pT;
float m_electron_trig_tptree_eta;
float m_electron_trig_tptree_phi;
float m_electron_trig_tptree_mass;
float m_electron_trig_tptree_weight;
int m_electron_trig_tptree_mtype;
int m_electron_trig_tptree_lb;
int m_electron_trig_tptree_runnumber;
unsigned long long m_electron_trig_tptree_eventnumber;
};
......
......@@ -38,6 +38,8 @@
#include "LWHists/TProfile_LW.h"
#include "LWHists/TProfile2D_LW.h"
#include "TTree.h"
#include "TH1.h"
#include "TGraph.h"
......@@ -71,6 +73,9 @@ class DataQualityFatherMonTool: public ManagedMonitorToolBase
StatusCode registerHist(const std::string& path, TH2F_LW* h1, Interval_t interval=run, MgmtAttr_t histo_mgmt = ATTRIB_MANAGED);
StatusCode registerHist(const std::string& path, TProfile_LW* h1, Interval_t interval=run, MgmtAttr_t histo_mgmt = ATTRIB_MANAGED);
StatusCode registerHist(const std::string& path, TProfile2D_LW* h1, Interval_t interval=run, MgmtAttr_t histo_mgmt = ATTRIB_MANAGED);
StatusCode registerTree(const std::string& path, TTree* t1, Interval_t interval=run, MgmtAttr_t histo_mgmt = ATTRIB_MANAGED);
//StatusCode registerHist(const std::string& path, TH1F_LW* h1, Interval_t interval=run, std::string dqmAlgorithm="");
//StatusCode registerHist(const std::string& path, TH1I_LW* h1, Interval_t interval=run, std::string dqmAlgorithm="");
//StatusCode registerHist(const std::string& path, TH2F_LW* h1, Interval_t interval=run, std::string dqmAlgorithm="");
......@@ -78,7 +83,6 @@ class DataQualityFatherMonTool: public ManagedMonitorToolBase
//StatusCode registerHist(const std::string& path, TProfile_LW* h1, Interval_t interval=run, std::string dqmAlgorithm="");
//StatusCode registerHist(const std::string& path, TProfile2D_LW* h1, Interval_t interval=run, std::string dqmAlgorithm="");
protected:
StoreGateSvc* m_detStore ;
......
......@@ -271,6 +271,7 @@ if isBeam==True and (DQMonFlags.monManEnvironment != 'tier0Raw') and rec.doInDet
from TrigMuonMatching.TrigMuonMatchingConf import Trig__TrigMuonMatching
ToolSvc += Trig__TrigMuonMatching("MatchingTool");
from TrigBunchCrossingTool.BunchCrossingTool import BunchCrossingTool
from DataQualityTools.DataQualityToolsConf import DQTGlobalWZFinderTool
MyDQTGlobalWZFinderTool = DQTGlobalWZFinderTool(
name = 'DQTGlobalWZFinderTool',
......@@ -287,7 +288,6 @@ if isBeam==True and (DQMonFlags.monManEnvironment != 'tier0Raw') and rec.doInDet
#from TrigBunchCrossingTool.TrigBunchCrossingToolConf import Trig__TrigConfBunchCrossingTool
#ToolSvc += Trig__TrigConfBunchCrossingTool("DQTBunchCrossingTool")
from TrigBunchCrossingTool.BunchCrossingTool import BunchCrossingTool
#ToolSvc += BunchCrossingTool("DQTBunchCrossingTool")
DontUseBunchCrossingTool = False
if (rec.triggerStream() == 'CosmicCalo'
......
......@@ -85,20 +85,6 @@ StatusCode DQTDataFlowMonTool::bookHistograms( )
MonGroup run_hists( this, m_path, run, ATTRIB_MANAGED );
MonGroup rolling_hists( this, m_path, run, ATTRIB_X_VS_LB, "", "merge" );
//failure |= lb_hists.regHist(m_events_lb = TH1I_LW::create("events_lb", "Event Count", AthenaMonManager::altprod+1, -0.5, AthenaMonManager::altprod+0.5)).isFailure();
failure |= lb_hists.regHist(m_events_lb = new TH1I("events_lb", "Event Count", AthenaMonManager::altprod+1, -0.5, AthenaMonManager::altprod+0.5)).isFailure();
if (m_events_lb) {
for (int i = 1; i <= AthenaMonManager::altprod+1; i++) {
m_events_lb->GetXaxis()->SetBinLabel(i, envstrings[i-1]);
}
}
//failure |= lowStat_alpha_hists.regHist(m_release_stage_lowStat = TH1I_LW::create("m_release_stage_lowStat", "Release - Event Count", AthenaMonManager::altprod+1, -0.5, AthenaMonManager::altprod+0.5)).isFailure();
failure |= lowStat_alpha_hists.regHist(m_release_stage_lowStat = new TH1I("m_release_stage_lowStat", "Release - Event Count", AthenaMonManager::altprod+1, -0.5, AthenaMonManager::altprod+0.5)).isFailure();
if (m_release_stage_lowStat) {
m_release_stage_lowStat->GetXaxis()->SetBinLabel(m_environment+1, m_releaseStageString.c_str());
}
const EventInfo* evtinfo;
StatusCode sc(evtStore()->retrieve(evtinfo));
if (sc.isFailure()) {
......@@ -110,6 +96,18 @@ StatusCode DQTDataFlowMonTool::bookHistograms( )
}
}
failure |= lb_hists.regHist(m_events_lb = new TH1I("events_lb", "Event Count", AthenaMonManager::altprod+1, -0.5, AthenaMonManager::altprod+0.5)).isFailure();
if (m_events_lb) {
for (int i = 1; i <= AthenaMonManager::altprod+1; i++) {
m_events_lb->GetXaxis()->SetBinLabel(i, envstrings[i-1]);
}
}
failure |= lowStat_alpha_hists.regHist(m_release_stage_lowStat = new TH1I("m_release_stage_lowStat", "Release - Event Count", AthenaMonManager::altprod+1, -0.5, AthenaMonManager::altprod+0.5)).isFailure();
if (m_release_stage_lowStat) {
m_release_stage_lowStat->GetXaxis()->SetBinLabel(m_environment+1, m_releaseStageString.c_str());
}
if (failure) {return StatusCode::FAILURE;}
else {return StatusCode::SUCCESS;}
......@@ -118,25 +116,30 @@ StatusCode DQTDataFlowMonTool::bookHistograms( )
StatusCode
DQTDataFlowMonTool::bookHistogramsRecurrent() {
bool failure(false);
MonGroup lowStat_hists( this, m_path, lowStat, ATTRIB_UNMANAGED );
MonGroup run_hists( this, m_path, run, ATTRIB_UNMANAGED );
bool failure(false);
MonGroup lowStat_hists( this, m_path, lowStat, ATTRIB_UNMANAGED );
MonGroup run_hists( this, m_path, run, ATTRIB_UNMANAGED );
const EventInfo* evtinfo;
StatusCode sc(evtStore()->retrieve(evtinfo));
if (!evtinfo->eventType(xAOD::EventInfo::IS_SIMULATION)){
if( m_environment != AthenaMonManager::tier0Raw ) {
/*
if (newRunFlag()) {
if (newRunFlag()) {
for (int i=0; i < EventInfo::nDets; i++) {
m_eventflag_run[i] = new TGraph();
m_eventflag_run[i]->SetTitle((std::string("Nonzero Warning/Error Event Flags for ")
+ eventflagdets[i]).c_str());
m_eventflag_run[i]->SetName((std::string("eventflag_run_")
+ eventflagdets[i]).c_str());
failure |= run_hists.regGraph(m_eventflag_run[i]).isFailure();
delete m_eventflag_vec[i];
m_eventflag_vec[i] = new std::vector<EvFlagPt_t>;
m_eventflag_vec[i]->reserve(1000);
m_eventflag_run[i] = new TGraph();
m_eventflag_run[i]->SetTitle((std::string("Nonzero Warning/Error Event Flags for ")
+ eventflagdets[i]).c_str());
m_eventflag_run[i]->SetName((std::string("eventflag_run_")
+ eventflagdets[i]).c_str());
failure |= run_hists.regGraph(m_eventflag_run[i]).isFailure();
delete m_eventflag_vec[i];
m_eventflag_vec[i] = new std::vector<EvFlagPt_t>;
m_eventflag_vec[i]->reserve(1000);
}
}
}
*/
if (newLumiBlockFlag() && newLowStatIntervalFlag()) {
......@@ -154,6 +157,7 @@ DQTDataFlowMonTool::bookHistogramsRecurrent() {
}
}
}
}
//else if (isNewEventsBlock) {
// return StatusCode::SUCCESS;
//}
......@@ -166,7 +170,9 @@ DQTDataFlowMonTool::fillHistograms()
{
ATH_MSG_DEBUG("in fillHists()");
//StatusCode sc;
const EventInfo* evtinfo;
StatusCode sc(evtStore()->retrieve(evtinfo));
m_events_lb->Fill(m_environment);
m_release_stage_lowStat->Fill(m_environment);
......@@ -179,19 +185,21 @@ DQTDataFlowMonTool::fillHistograms()
if (m_sumweights) {
m_sumweights->Fill(evtinfo->lumiBlock(), evtinfo->mcEventWeight());
}
EventInfo::EventFlagErrorState worststate = EventInfo::NotSet;
for (int i = 0; i < EventInfo::nDets; i++) {
//unsigned int flag = evtinfo->eventFlags((EventInfo::EventFlagSubDet) i);
EventInfo::EventFlagErrorState detstate = evtinfo->errorState((EventInfo::EventFlagSubDet) i);
/*
if (flag != 0 && detstate > EventInfo::NotSet) {
m_eventflag_vec[i]->push_back(EvFlagPt_t(evtinfo->eventNumber(), flag));
if (!evtinfo->eventType(xAOD::EventInfo::IS_SIMULATION)){
EventInfo::EventFlagErrorState worststate = EventInfo::NotSet;
for (int i = 0; i < EventInfo::nDets; i++) {
//unsigned int flag = evtinfo->eventFlags((EventInfo::EventFlagSubDet) i);
EventInfo::EventFlagErrorState detstate = evtinfo->errorState((EventInfo::EventFlagSubDet) i);
/*
if (flag != 0 && detstate > EventInfo::NotSet) {
m_eventflag_vec[i]->push_back(EvFlagPt_t(evtinfo->eventNumber(), flag));
}
*/
if (detstate > worststate) worststate = detstate;
m_eventflag_summary_lowStat->Fill(i, detstate);
}
*/
if (detstate > worststate) worststate = detstate;
m_eventflag_summary_lowStat->Fill(i, detstate);
m_eventflag_summary_lowStat->Fill(EventInfo::nDets, worststate);
}
m_eventflag_summary_lowStat->Fill(EventInfo::nDets, worststate);
}
}
return StatusCode::SUCCESS;
......
......@@ -327,3 +327,15 @@ StatusCode DataQualityFatherMonTool::registerHist(const std::string& path, TGrap
return StatusCode::SUCCESS;
}
//----------------------------------------------------------------------------------
StatusCode DataQualityFatherMonTool::registerTree(const std::string& path, TTree* t1, Interval_t interval, MgmtAttr_t histo_mgmt)
//----------------------------------------------------------------------------------
{
if(ManagedMonitorToolBase::regTree(t1, path, interval, histo_mgmt) != StatusCode::SUCCESS) {
MsgStream log(msgSvc(), name());
log << MSG::WARNING << "Could not register ttree : "
<< "/"+path+"/"+t1->GetName() << endmsg;
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
......@@ -65,6 +65,12 @@ if have_atlas_geo:
import AtlasGeoModel.SetGeometryVersion
svcMgr.GeoModelSvc.IgnoreTagDifference = True
# todo: ToolStore
from MuonIdHelpers.MuonIdHelpersConf import Muon__MuonIdHelperTool
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
from AthenaCommon.AppMgr import ToolSvc
ToolSvc += Muon__MuonIdHelperTool("MuonIdHelperTool",HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=MuonGeometryFlags.hasSTGC(), HasMM=MuonGeometryFlags.hasMM())
if not globals().has_key ('get_dumper_fct'):
from PyDumper.Dumpers import get_dumper_fct
from AthenaPython import PyAthena
......
......@@ -17,9 +17,8 @@ def _setupDetStoreConfig():
from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc
# Create DetDescrCnvSvc and add to SvcMgr
# Specify primary Identifier dictionary to be used, and whether CSC/sTgc/MM muon chambers are part of the detector
from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
svcMgr += DetDescrCnvSvc(IdDictName = "IdDictParser/ATLAS_IDS.xml", HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=(CommonGeometryFlags.Run()=="RUN3"), HasMM=(CommonGeometryFlags.Run()=="RUN3"))
svcMgr += DetDescrCnvSvc(IdDictName = "IdDictParser/ATLAS_IDS.xml", HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=MuonGeometryFlags.hasSTGC(), HasMM=MuonGeometryFlags.hasMM())
#theApp.CreateSvc += [ svcMgr.DetDescrCnvSvc.getFullName() ]
svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ]
......
......@@ -24,8 +24,7 @@ EventPersistencySvc.CnvServices = [ "DetDescrCnvSvc" ]
DetDescrCnvSvc.IdDictName = "IdDictParser/ATLAS_IDS.xml";
# Specify whether CSC/sTgc/MM muon chambers are part of the detector
from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
DetDescrCnvSvc.HasCSC = MuonGeometryFlags.hasCSC()
DetDescrCnvSvc.HasSTgc = (CommonGeometryFlags.Run()=="RUN3")
DetDescrCnvSvc.HasMM = (CommonGeometryFlags.Run()=="RUN3")
DetDescrCnvSvc.HasSTgc = MuonGeometryFlags.hasSTGC()
DetDescrCnvSvc.HasMM = MuonGeometryFlags.hasMM()
......@@ -17,11 +17,10 @@ EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ]
DetDescrCnvSvc = Service( "DetDescrCnvSvc" )
DetDescrCnvSvc.IdDictName = "IdDictParser/ATLAS_IDS.xml"
# Specify whether CSC/sTgc/MM muon chambers are part of the detector
from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
DetDescrCnvSvc.HasCSC = MuonGeometryFlags.hasCSC()
DetDescrCnvSvc.HasSTgc = (CommonGeometryFlags.Run()=="RUN3")
DetDescrCnvSvc.HasMM = (CommonGeometryFlags.Run()=="RUN3")
DetDescrCnvSvc.HasSTgc = MuonGeometryFlags.hasSTGC()
DetDescrCnvSvc.HasMM = MuonGeometryFlags.hasMM()
# Specify the tag to be used
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from AthenaCommon.DetFlags import DetFlags
from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
if ( DetFlags.detdescr.Muon_on() ):
from AthenaCommon import CfgGetter
......@@ -14,7 +14,7 @@ if ( DetFlags.detdescr.Muon_on() ):
ToolSvc += CfgGetter.getPublicTool("MuonSpectrometer", checkType=True)
AGDD2Geo.Builders += ["MuonAGDDTool/MuonSpectrometer"]
if CommonGeometryFlags.Run() == "RUN3" :
if (MuonGeometryFlags.hasSTGC() and MuonGeometryFlags.hasMM()):
if not "NSWAGDDTool/NewSmallWheel" in AGDD2Geo.Builders:
ToolSvc += CfgGetter.getPublicTool("NewSmallWheel", checkType=True)
AGDD2Geo.Builders += ["NSWAGDDTool/NewSmallWheel"]
......
......@@ -2,7 +2,6 @@
from AthenaCommon.JobProperties import jobproperties
from AthenaCommon.DetFlags import DetFlags
from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
if ( jobproperties.Global.DetGeo() == "ctbh8" or jobproperties.Global.DetGeo() == "ctbh6" ):
......@@ -13,7 +12,7 @@ elif ( DetFlags.detdescr.Muon_on() ):
GeoModelSvc = GeoModelSvc()
from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool
GeoModelSvc.DetectorTools += [ MuonDetectorTool(HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=(CommonGeometryFlags.Run()=="RUN3"), HasMM=(CommonGeometryFlags.Run()=="RUN3")) ]
GeoModelSvc.DetectorTools += [ MuonDetectorTool(HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=MuonGeometryFlags.hasSTGC(), HasMM=MuonGeometryFlags.hasMM()) ]
GeoModelSvc.DetectorTools[ "MuonDetectorTool" ].BuildFromNova = 0
if ( not DetFlags.simulate.any_on() or DetFlags.overlay.any_on() ):
GeoModelSvc.DetectorTools[ "MuonDetectorTool" ].TheMuonAlignmentTool = "MuonAlignmentDbTool/MGM_AlignmentDbTool"
......
......@@ -15,19 +15,29 @@ class MuonGMFlags(CommonGMFlags, object):
dbId,dbSwitches,dbParam = self.dbGeomCursor.GetCurrentLeafContent("MuonSwitches")
_layoutName=None
_hasCsc=True
_hasStgc=True
_hasMM=True
if len(dbId)>0:
key=dbId[0]
if "LAYOUTNAME" in dbParam: _layoutName = dbSwitches[key][dbParam.index("LAYOUTNAME")]
if "HASCSC" in dbParam: _hasCsc = dbSwitches[key][dbParam.index("HASCSC")]
if "HASSTGC" in dbParam: _hasStgc = dbSwitches[key][dbParam.index("HASSTGC")]
if "HASMM" in dbParam: _hasMM = dbSwitches[key][dbParam.index("HASMM")]
self.__dict__["Layout"] = (_layoutName if _layoutName else "UNDEFINED")
if _hasCsc == 0: self.__dict__["HasCSC"] = False
else: self.__dict__["HasCSC"] = True
if _hasStgc == 0: self.__dict__["HasSTGC"] = False
else: self.__dict__["HasSTGC"] = True
if _hasMM == 0: self.__dict__["HasMM"] = False
else: self.__dict__["HasMM"] = True
def dump(self):
print "MuonGMFlags:"
print "Layout = ",self.__dict__["Layout"]
print "HasCSC = ",self.__dict__["HasCSC"]
print "HasSTGC = ",self.__dict__["HasSTGC"]
print "HasMM = ",self.__dict__["HasMM"]
class GeoLayout(JobProperty):
......@@ -42,6 +52,17 @@ class hasCSC(JobProperty):
allowedTypes = ['bool']
StoredValue = True
class hasSTGC(JobProperty):
""" does the layout contain STGC chambers? """
statusOn = True
allowedTypes = ['bool']
StoredValue = True
class hasMM(JobProperty):
""" does the layout contain MicroMegas chambers? """
statusOn = True
allowedTypes = ['bool']
StoredValue = True
class MuonGeometryFlags_JobProperties(JobPropertyContainer):
""" The geometry flag/job property container """
......@@ -53,19 +74,27 @@ class MuonGeometryFlags_JobProperties(JobPropertyContainer):
MuonGeoFlags = MuonGMFlags(geoTagName)
self.GeoLayout.set_Value_and_Lock(MuonGeoFlags.getValue("Layout"))
self.hasCSC.set_Value_and_Lock(MuonGeoFlags.getValue("HasCSC"))
self.hasSTGC.set_Value_and_Lock(MuonGeoFlags.getValue("HasSTGC"))
self.hasMM.set_Value_and_Lock(MuonGeoFlags.getValue("HasMM"))
def reset(self,geoTagName="none"):
self.GeoLayout.unlock()
self.hasCSC.unlock()
self.hasSTGC.unlock()
self.hasMM.unlock()
def dump(self):
print "Layout = ", self.GeoLayout()
print "HasCSC = ", self.hasCSC()
print "HasSTGC = ", self.hasSTGC()
print "HasMM = ", self.hasMM()
jobproperties.add_Container(MuonGeometryFlags_JobProperties)
jobproperties.MuonGeometryFlags_JobProperties.add_JobProperty(GeoLayout)
jobproperties.MuonGeometryFlags_JobProperties.add_JobProperty(hasCSC)
jobproperties.MuonGeometryFlags_JobProperties.add_JobProperty(hasSTGC)
jobproperties.MuonGeometryFlags_JobProperties.add_JobProperty(hasMM)
MuonGeometryFlags = jobproperties.MuonGeometryFlags_JobProperties
MuonGeometryFlags.setupValuesFromDB()
......
......@@ -8,7 +8,6 @@ from AthenaCommon.SystemOfUnits import * # loads MeV etc...
# import the base class
from RegionSelector.RegionSelectorConf import RegSelSvc
from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
class RegSelSvcDefault ( RegSelSvc ) :
......@@ -123,6 +122,7 @@ class RegSelSvcDefault ( RegSelSvc ) :
ToolSvc += tgcTable
mlog.debug(tgcTable)
# could avoid first check in case DetFlags.detdescr.CSC_on() would take into account MuonGeometryFlags already
if MuonGeometryFlags.hasCSC() and DetFlags.detdescr.CSC_on():
from MuonRegionSelector.MuonRegionSelectorConf import CSC_RegionSelectorTable
cscTable = CSC_RegionSelectorTable(name = "CSC_RegionSelectorTable")
......@@ -130,14 +130,16 @@ class RegSelSvcDefault ( RegSelSvc ) :
ToolSvc += cscTable
mlog.debug(cscTable)
if (CommonGeometryFlags.Run()=="RUN3") and DetFlags.detdescr.Micromegas_on():
# could avoid first check in case DetFlags.detdescr.Micromegas_on() would take into account MuonGeometryFlags already
if MuonGeometryFlags.hasMM() and DetFlags.detdescr.Micromegas_on():
from MuonRegionSelector.MuonRegionSelectorConf import MM_RegionSelectorTable
mmTable = MM_RegionSelectorTable(name = "MM_RegionSelectorTable")
ToolSvc += mmTable
mlog.debug(mmTable)
if (CommonGeometryFlags.Run()=="RUN3") and DetFlags.detdescr.sTGC_on():
# could avoid first check in case DetFlags.detdescr.sTGC_on() would take into account MuonGeometryFlags already
if MuonGeometryFlags.hasSTGC() and DetFlags.detdescr.sTGC_on():
from MuonRegionSelector.MuonRegionSelectorConf import sTGC_RegionSelectorTable
stgcTable = sTGC_RegionSelectorTable(name = "sTGC_RegionSelectorTable")
......@@ -217,15 +219,18 @@ class RegSelSvcDefault ( RegSelSvc ) :
self.enableTGC = True
else:
self.enableTGC = False
# could avoid first check in case DetFlags.detdescr.CSC_on() would take into account MuonGeometryFlags already
if MuonGeometryFlags.hasCSC() and DetFlags.detdescr.CSC_on():
self.enableCSC = True
else:
self.enableCSC = False
if (CommonGeometryFlags.Run()=="RUN3") and DetFlags.detdescr.sTGC_on():
# could avoid first check in case DetFlags.detdescr.sTGC_on() would take into account MuonGeometryFlags already
if MuonGeometryFlags.hasSTGC() and DetFlags.detdescr.sTGC_on():
self.enablesTGC = True
else:
self.enablesTGC = False
if (CommonGeometryFlags.Run()=="RUN3") and DetFlags.detdescr.Micromegas_on():
# could avoid first check in case DetFlags.detdescr.Micromegas_on() would take into account MuonGeometryFlags already
if MuonGeometryFlags.hasMM() and DetFlags.detdescr.Micromegas_on():
self.enableMM = True
else:
self.enableMM = False
......
################################################################################
# Package: EventInfoUtils
################################################################################
# Declare the package name:
atlas_subdir( EventInfoUtils )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
GaudiKernel
Control/StoreGate
PRIVATE
Control/SGTools
Event/EventInfo
Event/xAOD/xAODEventInfo
)
# Libraries(s) in the package:
atlas_add_library( EventInfoUtils
src/*.cxx
PUBLIC_HEADERS EventInfoUtils
LINK_LIBRARIES EventInfo xAODEventInfo
)