Skip to content
Snippets Groups Projects
Commit da3c945e authored by Nikita Belyaev's avatar Nikita Belyaev
Browse files

First histogram booking block transfered

parent a2949f61
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ public:
virtual StatusCode initialize() override;
virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
private:
const AtlasDetectorID * m_idHelper;
const AtlasDetectorID* m_idHelper;
Gaudi::Property<bool> m_doRandom {this,"RandomHist",false}; //< Trigger chain string pulled from the job option and parsed into a vector?
// Services
......@@ -84,13 +84,13 @@ private:
//const InDetDD::TRT_DetectorManager* m_mgr;
// Data handles
//SG::ReadHandleKey<TRT_RDO_Container> m_rdoContainerKey {this, "TRTRawDataObjectName", "TRT_RDOs", "Name of TRT RDOs container"};
//SG::ReadHandleKey<TrackCollection> m_trackCollectionKey {this, "TRTTracksObjectName", "Tracks", "Name of tracks container"};
SG::ReadHandleKey<TRT_RDO_Container> m_rdoContainerKey {this, "TRTRawDataObjectName", "TRT_RDOs", "Name of TRT RDOs container"};
SG::ReadHandleKey<TrackCollection> m_trackCollectionKey {this, "TRTTracksObjectName", "Tracks", "Name of tracks container"};
//SG::ReadHandleKey<TrackCollection> m_trackCollectionKey {this, "TrackCollection", "Tracks", "Name of tracks container"};
//SG::ReadHandleKey<TrackCollection> m_tracksName{this, "tracksName", "CombinedInDetTracks"}; //From SCTLorentzMonAlg.h
//SG::ReadHandleKey<TrackCollection> m_combTrackCollectionKey{this, "track_collection_hole_finder", "CombinedInDetTracks", "Name of tracks container used for hole finder"};
SG::ReadHandleKey<TrackCollection> m_combTrackCollectionKey{this, "TrackCollection", "Tracks", "Name of tracks container used for hole finder"};
SG::ReadHandleKey<xAOD::EventInfo> m_xAODEventInfoKey {this, "xAODEventInfo", "EventInfo", "Name of EventInfo object"};
SG::ReadHandleKey<xAOD::EventInfo> m_xAODEventInfoKey {this, "xAODEventInfo", "EventInfo", "Name of EventInfo object"};
//SG::ReadHandleKey<InDetTimeCollection> m_TRT_BCIDCollectionKey {this, "TRTBCIDCollectionName", "TRT_BCID", "Name of TRT BCID collection"};
//SG::ReadHandleKey<ComTime> m_comTimeObjectKey {this, "ComTimeObjectName", "TRT_Phase", "Name of ComTime object"};
//SG::ReadHandleKey<xAOD::TrigDecision> m_trigDecisionKey {this, "TrigDecisionObjectName", "xTrigDecision", "Name of trigger decision object"};
......@@ -110,7 +110,7 @@ private:
bool m_doExpert;
bool m_doEfficiency;
const int s_numberOfStacks[2] = {32, 32};
//const int s_numberOfStacks[2] = {32, 32};
};
#endif
......@@ -32,7 +32,7 @@
TRTMonitoringRun3_Tool::TRTMonitoringRun3_Tool( const std::string& name, ISvcLocator* pSvcLocator )
:AthMonitorAlgorithm(name,pSvcLocator)
,m_idHelper(0)
,m_idHelper(nullptr)
,m_doRandom(false)
//,m_sumTool("TRT_StrawStatusSummaryTool", this)
//,m_pTRTHelper(0)
......@@ -78,9 +78,9 @@ StatusCode TRTMonitoringRun3_Tool::initialize() {
// }
// Initialization of VarHandleKeys
//ATH_CHECK( m_rdoContainerKey.initialize() );
//ATH_CHECK( m_trackCollectionKey.initialize() );
//ATH_CHECK( m_combTrackCollectionKey.initialize() );
ATH_CHECK( m_rdoContainerKey.initialize() );
ATH_CHECK( m_trackCollectionKey.initialize() );
ATH_CHECK( m_combTrackCollectionKey.initialize() );
ATH_CHECK( m_xAODEventInfoKey.initialize() );
//ATH_CHECK( m_TRT_BCIDCollectionKey.initialize() );
//ATH_CHECK( m_comTimeObjectKey.initialize() );
......@@ -92,7 +92,7 @@ StatusCode TRTMonitoringRun3_Tool::initialize() {
// TRT ID helper
//ATH_CHECK(detStore()->retrieve(m_pTRTHelper,"TRT_ID"));
ATH_CHECK( detStore()->retrieve(m_idHelper, "AtlasID") );
ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID"));
return AthMonitorAlgorithm::initialize();
}
......@@ -103,10 +103,12 @@ StatusCode TRTMonitoringRun3_Tool::fillHistograms( const EventContext& ctx ) con
// Declare the quantities which should be monitored
auto lumiPerBCID = Monitored::Scalar<float>("lumiPerBCID",0.0);
auto b = Monitored::Scalar<bool>("a",true);
auto a = Monitored::Scalar<float>("b",1.0);
auto c = Monitored::Scalar<bool>("c",true);
auto d = Monitored::Scalar<float>("d",1.0);
auto a = Monitored::Scalar<float>("a",1.0);
auto a_passed = Monitored::Scalar<float>("a_passed",0);
auto b = Monitored::Scalar<float>("b",1.0);
auto b_passed = Monitored::Scalar<float>("b_passed",0);
auto c = Monitored::Scalar<float>("c",1.0);
auto c_passed = Monitored::Scalar<float>("c_passed",0);
auto lb = Monitored::Scalar<int>("lb",0);
auto run = Monitored::Scalar<int>("run",0);
auto random = Monitored::Scalar<float>("random",0.0);
......@@ -124,8 +126,31 @@ StatusCode TRTMonitoringRun3_Tool::fillHistograms( const EventContext& ctx ) con
auto hTimeResidual_B = Monitored::Scalar<float>("hTimeResidual_B",0.0);
auto hTimeResidual_B_passed = Monitored::Scalar<float>("hTimeResidual_B_passed",false);
//auto thisStrawNumber = Monitored::Scalar<float>("thisStrawNumber",0.0);
//auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold",false);\
auto hHitWMapS = Monitored::Scalar<float>("hHitWMapS",0.0);
auto hHitTrWMapS = Monitored::Scalar<float>("hHitTrWMapS",0.0);
auto hHitTrMapS = Monitored::Scalar<float>("hHitTrMapS",0.0);
auto hHitAWMapS = Monitored::Scalar<float>("hHitAWMapS",0.0);
auto hHitAMapS = Monitored::Scalar<float>("hHitAMapS",0.0);
auto hOccupancyS = Monitored::Scalar<float>("hOccupancyS",0.0);
auto hHitToTMapS = Monitored::Scalar<float>("hHitToTMapS",0.0);
auto hHitToTLongMapS = Monitored::Scalar<float>("hHitToTLongMapS",0.0);
auto hHitToTLongTrMapS = Monitored::Scalar<float>("hHitToTLongTrMapS",0.0);
auto hHitHMapS = Monitored::Scalar<float>("hHitHMapS",0.0);
auto hHitHWMapS = Monitored::Scalar<float>("hHitHWMapS",0.0);
auto hHtoLMapS = Monitored::Scalar<float>("hHtoLMapS",0.0);
auto hHitWMapS_passed = Monitored::Scalar<float>("hHitWMapS",false);
auto hHitTrWMapS_passed = Monitored::Scalar<float>("hHitTrWMapS",false);
auto hHitTrMapS_passed = Monitored::Scalar<float>("hHitTrMapS",false);
auto hHitAWMapS_passed = Monitored::Scalar<float>("hHitAWMapS",false);
auto hHitAMapS_passed = Monitored::Scalar<float>("hHitAMapS",false);
auto hOccupancyS_passed = Monitored::Scalar<float>("hOccupancyS",false);
auto hHitToTMapS_passed = Monitored::Scalar<float>("hHitToTMapS",false);
auto hHitToTLongMapS_passed = Monitored::Scalar<float>("hHitToTLongMapS",false);
auto hHitToTLongTrMapS_passed = Monitored::Scalar<float>("hHitToTLongTrMapS",false);
auto hHitHMapS_passed = Monitored::Scalar<float>("hHitHMapS",false);
auto hHitHWMapS_passed = Monitored::Scalar<float>("hHitHWMapS",false);
auto hHtoLMapS_passed = Monitored::Scalar<float>("hHtoLMapS",false);
// Set the values of the monitored variables for the event
lumiPerBCID = lbAverageInteractionsPerCrossing();
......@@ -142,31 +167,35 @@ StatusCode TRTMonitoringRun3_Tool::fillHistograms( const EventContext& ctx ) con
// Retrieve containers/objects only once per event
// Dereference handles to pass them to methods
//SG::ReadHandle<TRT_RDO_Container> rdoContainer{m_rdoContainerKey, ctx};
//SG::ReadHandle<TrackCollection> trackCollection{m_trackCollectionKey, ctx};
//SG::ReadHandle<TrackCollection> combTrackCollection{m_combTrackCollectionKey, ctx};
SG::ReadHandle<TRT_RDO_Container> rdoContainer{m_rdoContainerKey, ctx};
SG::ReadHandle<TrackCollection> trackCollection{m_trackCollectionKey, ctx};
SG::ReadHandle<TrackCollection> combTrackCollection{m_combTrackCollectionKey, ctx};
SG::ReadHandle<xAOD::EventInfo> xAODEventInfo{m_xAODEventInfoKey, ctx};
//SG::ReadHandle<InDetTimeCollection> trtBCIDCollection(m_TRT_BCIDCollectionKey);
//SG::ReadHandle<ComTime> comTimeObject(m_comTimeObjectKey);
//SG::ReadHandle<xAOD::TrigDecision> trigDecision(m_trigDecisionKey);
//if (!rdoContainer.isValid()) {
// ATH_MSG_WARNING("No TRT_RDO_Container by the name of " << m_rdoContainerKey.key() << " in StoreGate. Skipping TRT RDO Monitoring.");
// //m_doRDOsMon = false;
//}
// if (!trackCollection.isValid()) {
// ATH_MSG_WARNING("No TrackCollection by the name of " << m_trackCollectionKey.key() << " in StoreGate. Skipping TRT Track Monitoring.");
// // m_doTracksMon = false;
// ATH_CHECK( checkEventBurst(*rdoContainer) );
// if (!rdoContainer.isValid()) {
// ATH_MSG_WARNING("No TRT_RDO_Container by the name of " << m_rdoContainerKey.key() << " in StoreGate. Skipping TRT RDO Monitoring.");
// return StatusCode::FAILURE;
// //m_doRDOsMon = false;
// }
//
if (!trackCollection.isValid()) {
ATH_MSG_WARNING("No TrackCollection by the name of " << m_trackCollectionKey.key() << " in StoreGate. Skipping TRT Track Monitoring.");
return StatusCode::FAILURE;
// m_doTracksMon = false;
}
// if (m_doEfficiency) {
// if (!combTrackCollection.isValid()) {
// ATH_MSG_ERROR("Could not find track collection " << m_combTrackCollectionKey.key() << " in store");
// return StatusCode::FAILURE;
// }
// }
//
if (!xAODEventInfo.isValid()) {
ATH_MSG_ERROR("Could not find event info object " << m_xAODEventInfoKey.key() << " in store");
return StatusCode::FAILURE;
......@@ -177,7 +206,7 @@ StatusCode TRTMonitoringRun3_Tool::fillHistograms( const EventContext& ctx ) con
// return StatusCode::FAILURE;
// }
std::cout << "xAODEventInfo.timeStamp() = " << xAODEventInfo->timeStamp() << std::endl;
//std::cout << "xAODEventInfo.timeStamp() = " << xAODEventInfo->timeStamp() << std::endl;
// NOTE: failing to retrieve ComTime from store for some reason
// if (!comTimeObject.isValid()) {
// ATH_MSG_INFO("Could not find com time object " << m_comTimeObjectKey.key() <<
......@@ -242,23 +271,27 @@ StatusCode TRTMonitoringRun3_Tool::fillHistograms( const EventContext& ctx ) con
pT = r.Landau(15);
pT_passed = pT>r.Poisson(15);
hIntLum = lbDuration()*lbAverageLuminosity();
std::cout << "lbDuration() = " << lbDuration() << "; lbAverageLuminosity() = " << lbAverageLuminosity() << std::endl;
//std::cout << "lbDuration() = " << lbDuration() << "; lbAverageLuminosity() = " << lbAverageLuminosity() << std::endl;
hIntLum_passed = hIntLum>0.7;
hNumTrksDetPhi_B = 1.;
hNumTrksDetPhi_B_passed = hNumTrksDetPhi_B>0.7;
// for (int ibe = 0; ibe < 2; ibe++) {
// for (int i = 0; i < s_numberOfStacks[ibe] * 2; i++) {
// thisStrawNumber = ibe*100 + i;
// //timeOverThreshold = i*ibe + 1;
// timeOverThreshold = thisStrawNumber>0.7;
// fill("TOTGroup"+std::to_string(ibe)+std::to_string(i), thisStrawNumber, timeOverThreshold);
// }
// }
for (int ibe = 0; ibe < 10; ibe++) {
a = 100.*r.Rndm();
std::cout << a << std::endl;
a_passed = a>70;
b = 100.*r.Rndm();
b_passed = b>70;
c = 100.*r.Rndm();
c_passed = c>70;
fill("AlgTRTMonitoringRun3"+std::to_string(ibe),a,a_passed);
fill("AltAlgTRTMonitoringRun3"+std::to_string(ibe),b,b_passed);
fill("AltAlgTRTMonitoringRun3C",c,c_passed);
}
// Fill. First argument is the tool name, all others are the variables to be saved.
//fill("TRTMonitoringRun3Monitor",lumiPerBCID,lb,random,pT,pT_passed,hIntLum,hIntLum_passed,hNumTrksDetPhi_B,hNumTrksDetPhi_B_passed);
fill("AlgTRTMonitoringRun3",lumiPerBCID,lb,random,pT,pT_passed,hIntLum,hIntLum_passed,hNumTrksDetPhi_B,hNumTrksDetPhi_B_passed);
//fill("ExampleMonitor00",lumiPerBCID,a,b);
//fill("ExampleMonitor01",lumiPerBCID,a,b);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment