ATLAS Offline Software
Loading...
Searching...
No Matches
MdtVsTgcRawDataValAlg Class Reference

#include <MdtVsTgcRawDataValAlg.h>

Inheritance diagram for MdtVsTgcRawDataValAlg:
Collaboration diagram for MdtVsTgcRawDataValAlg:

Public Types

enum  Interval_t {
  file = 0 , eventsBlock , lumiBlock , lowStat ,
  medStat , higStat , run , fill ,
  all
}
 An enumeration describing how detailed a particular monitoring object is. More...
enum  MgmtAttr_t { ATTRIB_MANAGED = 0 , ATTRIB_UNMANAGED = 1 , ATTRIB_X_VS_LB = 2 }
 An enumeration describing how the class handles the histogram. More...

Public Member Functions

 MdtVsTgcRawDataValAlg (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~MdtVsTgcRawDataValAlg ()
StatusCode initialize ()
virtual StatusCode bookHistogramsRecurrent ()
 An inheriting class should either override this function, bookHists() or bookHistograms().
virtual StatusCode fillHistograms ()
 An inheriting class should either override this function or fillHists().
virtual StatusCode procHistograms ()
 An inheriting class should either override this function or finalHists().
virtual StreamNameFcnstreamNameFunction ()
 Returns the function object that converts logical paramters into a physical stream name.
virtual StatusCode bookHists ()
 Calls bookHists( true, true, true ) and initializes lumiBlock and run numbers.
virtual StatusCode fillHists ()
 Calls fillHists( bool, bool, bool ); if an eventBlock,lumiBlock, or run has turned over, calls procHists( bool, bool, bool ) and bookHists( bool, bool, bool ).
virtual StatusCode finalHists ()
 Calls procHists( true, true, true ).
virtual StatusCode bookHistograms ()
 An inheriting class should either override this function or bookHists().
virtual void setMonManager (AthenaMonManager *manager)
 Takes a pointer to a managing object to get information from it when needed.
virtual StatusCode regHist (TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
 Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical parameters that describe the histogram.
virtual StatusCode regHist (TH1 *h, const MonGroup &group)
 Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical parameters that describe the histogram.
virtual StatusCode getHist (TH1 *&h, const std::string &hName, const std::string &system, Interval_t interval)
 Returns a TH1 via the pointer passed as the first argument.
virtual StatusCode getHist (TH1 *&h, const std::string &hName, const MonGroup &group)
 Returns a TH1 via the pointer passed as the first argument.
virtual StatusCode getHist (TH2 *&h, const std::string &hName, const std::string &system, Interval_t interval)
 Returns a TH2 via the pointer passed as the first argument.
virtual StatusCode getHist (TH2 *&h, const std::string &hName, const MonGroup &group)
 Returns a TH2 via the pointer passed as the first argument.
virtual StatusCode regEfficiency (TEfficiency *e, const MonGroup &group)
 Registers a TEfficiency to be included in the output stream using logical parameters that describe the plot.
virtual StatusCode regGraph (TGraph *g, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
 Registers a TGraph to be included in the output stream using logical parameters that describe the graph.
virtual StatusCode regGraph (TGraph *g, const MonGroup &group)
 Registers a TGraph to be included in the output stream using logical parameters that describe the graph.
virtual StatusCode regTree (TTree *t, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
 Registers a TTree to be included in the output stream using logical parameters that describe it.
virtual StatusCode regTree (TTree *t, const MonGroup &group)
 Registers a TTree to be included in the output stream using logical parameters that describe it.
virtual StatusCode writeAndDelete (TH1 *h, const MonGroup &group)
 Write out histogram and delete it.
virtual StatusCode deregHist (TH1 *h)
 De-registers a TH1 from the THistSvc, but does NOT delete the object.
virtual StatusCode deregGraph (TGraph *g)
 De-registers a TGraph from the THistSvc, but does NOT delete the object.
virtual StatusCode deregObject (const std::string &objName, const std::string &system, Interval_t interval)
 De-registers a TObject from the THistSvc, but does NOT delete the object.
virtual StatusCode deregObject (const std::string &objName, const MonGroup &group)
 De-registers a TObject from the THistSvc, but does NOT delete the object.
virtual StatusCode setupOutputStreams (std::vector< std::string > Mapping=std::vector< std::string >())
 This implementation does nothing—streams in this class should be managed by the AthenaMonManager.
virtual StatusCode runStat ()
 This implementation does nothing; equivalent functionality may be provided by procHists( true, true, true ).
virtual StatusCode checkHists (bool calledFromFinalize)
 This implementation does nothing; equivalent functionality may be provided by procHists(...) with appropriate arguments.
virtual bool preSelector ()
virtual float lbAverageInteractionsPerCrossing (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Average mu, i.e.
virtual float lbInteractionsPerCrossing (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Instantaneous number of interactions, i.e.
virtual float lbAverageLuminosity (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1)
virtual float lbLuminosityPerBCID (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Instantaneous luminosity.
virtual double lbDuration (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Luminosity block time (in seconds)
virtual float lbAverageLivefraction (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Average luminosity livefraction.
virtual float livefractionPerBCID (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Livefraction per bunch crossing ID.
virtual double lbLumiWeight (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Average Integrated Luminosity Live Fraction.
 MMTB_DEPRECATED (newLowStatInterval)
 MMTB_DEPRECATED (newMedStatInterval)
 MMTB_DEPRECATED (newHigStatInterval)
 MMTB_DEPRECATED (newLowStat)
 MMTB_DEPRECATED (newLumiBlock)
 MMTB_DEPRECATED (newRun)
 MMTB_DEPRECATED (newEventsBlock)
 MMTB_DEPRECATED (endOfEventsBlock)
 MMTB_DEPRECATED (endOfLowStat)
 MMTB_DEPRECATED (endOfLumiBlock)
 MMTB_DEPRECATED (endOfRun)
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static std::string intervalEnumToString (Interval_t interval)
 Converts a LevelOfDetail_t to a string of the same name.
static Interval_t intervalStringToEnum (const std::string &str)
 Converts a string to the corresponding Interval_t.
static const InterfaceID & interfaceID ()

Protected Types

typedef std::map< std::string, OutputMetadata * > MDMap_t

Protected Member Functions

StatusCode regManagedHistograms (std::vector< MgmtParams< TH1 > > &templateHistograms)
StatusCode regManagedGraphs (std::vector< MgmtParams< TGraph > > &templateGraphs)
StatusCode regManagedTrees (std::vector< MgmtParams< TTree > > &templateTrees)
StatusCode regManagedEfficiencies (std::vector< MgmtParams< TEfficiency > > &templateEfficiencies)
StatusCode parseList (const std::string &, std::vector< std::string > &)
void updateTriggersForGroups (std::vector< std::string > &)
StatusCode registerMetadata (const std::string &streamName, const std::string &hName, const MonGroup &group)
StatusCode THistSvc_deReg_fixTGraph (TFile *file, TGraph *theGraph, std::string &directoryName)
 Fixes THistSvc->deReg(obj) when obj is TGraph instance.
unsigned int get_nEvents () const
long get_procNEventsProp () const
virtual bool trigChainsArePassed (std::vector< std::string > &)
virtual StreamNameFcngetNewStreamNameFcn () const
bool newLowStatIntervalFlag () const
 Flag functions allowing clients to determine when to book new and process old histograms; values are updated by fillHists() based on counting lumiBlocks, and are correctly set when fillHistograms(), bookHistograms() and procHistograms() are called.
bool newMedStatIntervalFlag () const
bool newHigStatIntervalFlag () const
bool newLowStatFlag () const
bool newLumiBlockFlag () const
bool newRunFlag () const
bool newEventsBlockFlag () const
bool endOfEventsBlockFlag () const
bool endOfLowStatFlag () const
bool endOfLumiBlockFlag () const
bool endOfRunFlag () const
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

std::map< Interval_t, std::vector< MgmtParams< TH1 > > > m_templateHistograms
std::map< Interval_t, std::vector< MgmtParams< TGraph > > > m_templateGraphs
std::map< Interval_t, std::vector< MgmtParams< TTree > > > m_templateTrees
std::map< Interval_t, std::vector< MgmtParams< TEfficiency > > > m_templateEfficiencies
std::vector< std::string > m_vTrigChainNames
std::vector< std::string > m_vTrigGroupNames
MDMap_t m_metadataMap
AthenaMonManagerm_manager
std::string m_managerNameProp
std::string m_fileKey
std::string m_dataTypeStr
std::string m_environmentStr
unsigned int m_detailLevel
AthenaMonManager::DataType_t m_dataType
AthenaMonManager::Environment_t m_environment
StreamNameFcnm_streamNameFcn
ServiceHandle< ITHistSvc > m_THistSvc
PublicToolHandle< Trig::ITrigDecisionToolm_trigDecTool {this, "TrigDecisionTool",""}
PublicToolHandle< ITriggerTranslatorToolm_trigTranslator {this,"TriggerTranslatorTool",""}
ToolHandleArray< IDQFilterToolm_DQFilterTools {this,"FilterTools",{}}
long m_procNEventsProp
std::string m_path
long m_preScaleProp
std::string m_triggerChainProp
std::string m_triggerGroupProp
bool m_useTrigger
unsigned int m_lastLumiBlock
unsigned int m_lastRun
int m_lastLowStatInterval
int m_lastMedStatInterval
int m_lastHigStatInterval
unsigned int m_nEvents
unsigned int m_nEventsIgnoreTrigger
unsigned int m_nLumiBlocks
bool m_haveClearedLastEventBlock

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void correlation (const Muon::MdtPrepDataContainer *mdt_hit_container, const Muon::TgcCoinDataContainer *tgc_trigger_container)
int numberOfSL (const Muon::TgcCoinDataContainer *tgctrgcontainer)
void roi2etaphi (const Muon::TgcCoinData &cd, int &eta, int &phi)
int phi2sector (int phi, int ef)
int roiphi2mdtSector (int roiphi, int ef)
int roitotalphi2sectorphi (int phi)
int stationGasGap2layer (int station, int GasGap)
void prepareTREarray (const MuonGM::MuonDetectorManager *MuonDetMgrDS)
int TGCgetlayer (int stationName, int g)
int TGClayer2stationindex (int l)
int TGCstationname2stationindex (int stationName)
StatusCode bookmaphists (MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
void maphists (const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void maphistsfinalize ()
StatusCode bookeffhists (MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
void tgceffcalc (const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void SortMDTSegments (const xAOD::MuonSegmentContainer *m_newsegment, std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4])
void DQCheckMDTSegments (std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4])
void MatchMDTSegments (std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], std::vector< SegmTrack >(&matchedSegments)[2])
void CheckTGConTrack (std::vector< SegmTrack >(&matchedSegments)[2], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void MidstationOnlyCheck (std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void tgceffcalcfinalize ()
int getStationMapIndex (int x, int l, int stationFE, int stationEta, int stationPhi)
void labelStationMap (TH2 *h2, int i=-1, int k=-1)
void putBox (TH2 *h2, float x1, float y1, float x2, float y2)
void BlankPhi24 (TH2 *h2, int binx)
void BlankStationMap (TH2 *h2, int ws)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

MuonDQAHistMap m_stationHists
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_DetectorManagerKey
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
bool m_checkCabling
bool m_tgclv1file
std::string m_chamberName
std::string m_StationSize
int m_sector
int m_side
int m_lastEvent
int m_cosmicStation
SG::ReadHandleKey< Muon::TgcPrepDataContainerm_tgc_PrepDataContainerName {this,"TgcPrepDataContainer","TGC_Measurements","TGC PRDs"}
SG::ReadHandleKey< Muon::TgcCoinDataContainerm_tgc_CoinContainerName {this,"OutputCoinCollection","TrigT1CoinDataCollection","TGC coincidences"}
SG::ReadHandleKey< Muon::MdtPrepDataContainerm_mdt_PrepDataContainerName {this,"MdtPrepDataContainer","MDT_DriftCircles","MDT PRDs"}
SG::ReadHandleKey< xAOD::MuonSegmentContainerm_mdt_SegmentCollectionName {this,"MdtSegmentCollection","MuonSegments","muon segments"}
int m_MdtAdcCut
int m_MdtTdcCut
const MuonGM::TgcReadoutElementm_TREarray [8][2][9][49] {}
TH1 * m_mvt_cutspassed [2] {}
TH2 * m_mdt_segmmap [2][4] {}
TH2 * m_eff_stationmapbase [2][2][4] {}
TH2 * m_eff_stationmapmid [2][2][4] {}
TH2 * m_eff_stationmap [2][2][4] {}
TH1 * m_mvt_extrprdsag [2][4][2][2][4] {}
TH1 * m_mvt_extrprdsag2 [2][4][2][2][4] {}
TH1 * m_tgc_prdcompsag [2][2][4] {}
TH1 * m_mdt_segmmatchsag [2][4][4][4] {}
TH1 * m_mdt_segmposdirsag [2][4][4] {}
TH1 * m_mdt_trackdirdirsag [2][4][4][4] {}
TH1 * m_mdt_trackchecksag [2][4][4][4][2] {}
bool m_newLowStatInterval
bool m_newMedStatInterval
bool m_newHigStatInterval
bool m_newLowStat
bool m_newLumiBlock
bool m_newRun
bool m_newEventsBlock
bool m_endOfEventsBlock
bool m_endOfLowStat
bool m_endOfLumiBlock
bool m_endOfRun
SG::ReadCondHandleKey< LuminosityCondDatam_lumiDataKey {this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"}
SG::ReadCondHandleKey< LBDurationCondDatam_lbDurationDataKey {this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"}
SG::ReadCondHandleKey< TrigLiveFractionCondDatam_trigLiveFractionDataKey {this,"TrigLiveFractionCondDataKey","TrigLiveFractionCondData","SG Key of TrigLiveFractionCondData object"}
bool m_bookHistogramsInitial
bool m_useLumi
float m_defaultLBDuration
std::set< Interval_tm_supportedIntervalsForRebooking
Impm_d
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 38 of file MdtVsTgcRawDataValAlg.h.

Member Typedef Documentation

◆ MDMap_t

typedef std::map<std::string,OutputMetadata*> ManagedMonitorToolBase::MDMap_t
protectedinherited

Definition at line 826 of file ManagedMonitorToolBase.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ Interval_t

An enumeration describing how detailed a particular monitoring object is.

summary: used to summarize the state of the system

runstat: same as summary

shift: used to flag potential problems

expert: essential for diagnosing problems identified by shift-level objects

debug: useful for standalone debugging, but not for routine monitoring; not essential for diagnosing problems during normal running

transient: too detailed to ever be written; always summarized by the user by means of another object An enumeration describing the interval over which a particular monitoring object is filled (i.e., interval over which the method Fill(...) is called). This information may be stored with the monitoring object if an application is only able to partially fill the object (i.e., a job sees only part of a run or fill). This information may be ignored in some running Environments. The 'fill' interval corresponds to a fill of the LHC. The 'all' interval corresponds to all available data. The 'lumiBlock' and 'fill' intervals are only valid for the 'collisions' DataType_t.

Enumerator
file 
eventsBlock 
lumiBlock 
lowStat 
medStat 
higStat 
run 
fill 
all 

Definition at line 113 of file ManagedMonitorToolBase.h.

◆ MgmtAttr_t

An enumeration describing how the class handles the histogram.

attrib_unmanaged: histograms with this attribute will not be rebooked automatically and must be managed by the user code.

attrib_x_is_lb: indicates that the x-axis of the histogram is the luminosity block number and that the histogram should be rebooked as necessary if the current LB exceeds the range.

Enumerator
ATTRIB_MANAGED 
ATTRIB_UNMANAGED 
ATTRIB_X_VS_LB 

Definition at line 130 of file ManagedMonitorToolBase.h.

Constructor & Destructor Documentation

◆ MdtVsTgcRawDataValAlg()

MdtVsTgcRawDataValAlg::MdtVsTgcRawDataValAlg ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 34 of file MdtVsTgcRawDataValAlg.cxx.

35 :ManagedMonitorToolBase( type, name, parent )
36{
37 // Declare the properties
38 declareProperty("CheckCabling", m_checkCabling=false);
39 declareProperty("TgcLv1File", m_tgclv1file=true);
40 declareProperty("ChamberName", m_chamberName="XXX");
41 declareProperty("StationSize", m_StationSize="XXX");
42 declareProperty("Sector", m_sector=0);
43 declareProperty("Side", m_side=0);
44 declareProperty("LastEvent", m_lastEvent=0);
45 declareProperty("CosmicStation", m_cosmicStation=0);
46 declareProperty("MdtAdcCut", m_MdtAdcCut=50);
47 declareProperty("MdtTdcCut", m_MdtTdcCut=1600);
48
49 // initialize class members
50
51 for(int ac=0; ac<2; ac++){
52 m_mvt_cutspassed[ac] = nullptr;
53 for(int jMDT=0; jMDT<4; jMDT++){
54 m_mdt_segmmap[ac][jMDT] = nullptr;
55 for(int sMDT=0; sMDT<4; sMDT++){
56 m_mdt_segmposdirsag[ac][jMDT][sMDT] = nullptr;
57 for(int iREPT=0; iREPT<4; iREPT++){
58 m_mdt_segmmatchsag[ac][jMDT][sMDT][iREPT] = nullptr;
59 m_mdt_trackdirdirsag[ac][jMDT][sMDT][iREPT] = nullptr;
60 m_mdt_trackchecksag[ac][jMDT][sMDT][iREPT][0] = nullptr;
61 m_mdt_trackchecksag[ac][jMDT][sMDT][iREPT][1] = nullptr;
62 }
63 }
64 }
65 for(int WS=0; WS<2; WS++){
66 for(int EffNDE=0; EffNDE<4; EffNDE++){
67 m_eff_stationmapbase[ac][WS][EffNDE] = nullptr;
68 m_eff_stationmapmid[ac][WS][EffNDE] = nullptr;
69 m_eff_stationmap[ac][WS][EffNDE] = nullptr;
70 }
71 }
72 }
73
74 // Initialize to zero
75 for(int i=0;i<2;i++)// AC
76 for(int jTGC=0;jTGC<4;jTGC++)// TGC Station
77 for(int f=0;f<2;f++)// FE
78 for(int k=0;k<2;k++)// WireStrip
79 for(int x=0;x<4;x++){
80 m_mvt_extrprdsag[i][jTGC][f][k][x]=nullptr;
81 m_mvt_extrprdsag2[i][jTGC][f][k][x]=nullptr;
82 }
83 for(int k=0;k<2;k++)
84 for(int i=0;i<2;i++)
85 for(int x=0;x<4;x++){
86 m_tgc_prdcompsag[i][k][x]=nullptr;
87 }
88
89}
#define x
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
TH1 * m_mvt_extrprdsag[2][4][2][2][4]
TH1 * m_mvt_extrprdsag2[2][4][2][2][4]
TH1 * m_mdt_trackdirdirsag[2][4][4][4]
TH1 * m_mdt_segmmatchsag[2][4][4][4]
TH1 * m_mdt_trackchecksag[2][4][4][4][2]

◆ ~MdtVsTgcRawDataValAlg()

MdtVsTgcRawDataValAlg::~MdtVsTgcRawDataValAlg ( )
virtual

Definition at line 91 of file MdtVsTgcRawDataValAlg.cxx.

91 {
92 ATH_MSG_INFO( " deleting MdtVsTgcRawDataValAlg " );
93}
#define ATH_MSG_INFO(x)

Member Function Documentation

◆ BlankPhi24()

void MdtVsTgcRawDataValAlg::BlankPhi24 ( TH2 * h2,
int binx )
private

Definition at line 144 of file MdtVsTgcRawData_functions.cxx.

144 {
145 float x1=h->GetXaxis()->GetBinLowEdge(binx);
146 float x2=h->GetXaxis()->GetBinUpEdge(binx);
147 for(int i=0;i<24;i++){
148 int biny = (i+1)*2;
149 float y1=h->GetYaxis()->GetBinLowEdge(biny);
150 float y2=h->GetYaxis()->GetBinUpEdge(biny);
151 putBox(h, x1, y1, x2, y2);
152 }
153}
void putBox(TH2 *h2, float x1, float y1, float x2, float y2)

◆ BlankStationMap()

void MdtVsTgcRawDataValAlg::BlankStationMap ( TH2 * h2,
int ws )
private

Definition at line 155 of file MdtVsTgcRawData_functions.cxx.

155 {
156 bool rebin=true;
157 if(rebin){//use new bin
158 for(int i=33; i<44;i++)BlankPhi24(h,i);
159 int x1=h->GetXaxis()->GetBinLowEdge(40);
160 int x2=h->GetXaxis()->GetBinUpEdge(40);
161 int x3=h->GetXaxis()->GetBinLowEdge(41);
162 int x4=h->GetXaxis()->GetBinUpEdge(41);
163 int y1=h->GetYaxis()->GetBinLowEdge(19);
164 int y2=h->GetYaxis()->GetBinUpEdge(19);
165 putBox(h, x1, y1, x2, y2);
166 putBox(h, x3, y1, x4, y2);
167 y1=h->GetYaxis()->GetBinLowEdge(35);
168 y2=h->GetYaxis()->GetBinUpEdge(35);
169 putBox(h, x1, y1, x2, y2);
170 putBox(h, x3, y1, x4, y2);
171 y1=h->GetYaxis()->GetBinLowEdge(43);
172 y2=h->GetYaxis()->GetBinUpEdge(43);
173 putBox(h, x1, y1, x2, y2);
174 putBox(h, x3, y1, x4, y2);
175
176 if(ws==1){//Strip
177 x1=h->GetXaxis()->GetBinLowEdge(2);
178 y1=h->GetYaxis()->GetBinLowEdge(1);
179 x2=h->GetXaxis()->GetBinUpEdge(2);
180 y2=h->GetYaxis()->GetBinUpEdge(48);
181 putBox(h, x1, y1, x2, y2);
182 x1=h->GetXaxis()->GetBinLowEdge(9);
183 x2=h->GetXaxis()->GetBinUpEdge(9);
184 putBox(h, x1, y1, x2, y2);
185 x1=h->GetXaxis()->GetBinLowEdge(16);
186 x2=h->GetXaxis()->GetBinUpEdge(16);
187 putBox(h, x1, y1, x2, y2);
188 x1=h->GetXaxis()->GetBinLowEdge(23);
189 x2=h->GetXaxis()->GetBinUpEdge(23);
190 putBox(h, x1, y1, x2, y2);
191 x1=h->GetXaxis()->GetBinLowEdge(34);
192 x2=h->GetXaxis()->GetBinUpEdge(34);
193 putBox(h, x1, y1, x2, y2);
194 }
195 }else{//use old bin, logically dead code, comment out
196// BlankPhi24(h, 5);
197// BlankPhi24(h, 10);
198// BlankPhi24(h, 15);
199// BlankPhi24(h, 21);
200// BlankPhi24(h, 27);
201// BlankPhi24(h, 33);
202// BlankPhi24(h, 39);
203// BlankPhi24(h, 40);
204// BlankPhi24(h, 41);
205// BlankPhi24(h, 42);
206// BlankPhi24(h, 43);
207// int x1=h->GetXaxis()->GetBinLowEdge(40);
208// int x2=h->GetXaxis()->GetBinUpEdge(40);
209// int x3=h->GetXaxis()->GetBinLowEdge(42);
210// int x4=h->GetXaxis()->GetBinUpEdge(42);
211// int y1=h->GetYaxis()->GetBinLowEdge(19);
212// int y2=h->GetYaxis()->GetBinUpEdge(19);
213// putBox(h, x1, y1, x2, y2);
214// putBox(h, x3, y1, x4, y2);
215// y1=h->GetYaxis()->GetBinLowEdge(35);
216// y2=h->GetYaxis()->GetBinUpEdge(35);
217// putBox(h, x1, y1, x2, y2);
218// putBox(h, x3, y1, x4, y2);
219// y1=h->GetYaxis()->GetBinLowEdge(43);
220// y2=h->GetYaxis()->GetBinUpEdge(43);
221// putBox(h, x1, y1, x2, y2);
222// putBox(h, x3, y1, x4, y2);
223 }
224}
void BlankPhi24(TH2 *h2, int binx)
rebin(binning, data)

◆ bookeffhists()

StatusCode MdtVsTgcRawDataValAlg::bookeffhists ( MonGroup & mdtvstgclv1_expert_a,
MonGroup & mdtvstgclv1_expert_c )
private

Definition at line 100 of file MdtVsTgcRawData_bookhistograms.cxx.

101 {
102
103 std::stringstream sst;
104 std::string AC[2]= {"A","C"};
105 std::string RhoEtaPhiThe[4]={"Rho","Eta","Phi","Theta"};
106 std::string RhoEtaPhiZ[4]= {"Rho","Eta","Phi","Z"};
107 std::string FE[2]= {"F","E"};// Forward, Endcap
108 std::string EffNumDenom[4]= {"","num","denom","error"};
109 std::string WireStrip[2]= {"Wire","Strip"};
110 int nbins3D_1[4]= { 0, 0, 0, 0};
111 float fGlobalCoords3Dlo[4]= { 0, 0, 0, 0};
112 float fGlobalCoords3Dup[4]= { 0, 0, 0, 0};
113 // **************************************************************
114 // ** EffCheck
115 // **************************************************************
117 // Efficiencies
118 nbins3D_1[0]= 100; nbins3D_1[1]= 8; nbins3D_1[2]= 48; nbins3D_1[3]= 100;
119 fGlobalCoords3Dlo[0]= -1000; fGlobalCoords3Dlo[1]= -1; fGlobalCoords3Dlo[2]= -M_PI; fGlobalCoords3Dlo[3]= 0;
120 fGlobalCoords3Dup[0]= 1000; fGlobalCoords3Dup[1]= 1; fGlobalCoords3Dup[2]= M_PI; fGlobalCoords3Dup[3]= 0.5*M_PI;
121 for(int i=0;i<2;i++){// AC
122 for(int k=0;k<2;k++){// WireStrip
123 for(int e=0;e<4;e++){// EffNumDenom
124 // Station Efficiency Map Segm Track
125 sst<<WireStrip[k];
126 sst<<"_EfficiencyAgainstMDT";
127 sst<<"_MapSegmTrack"<<EffNumDenom[e];
128 sst<<"_"<<AC[i];
129 ATH_MSG_DEBUG("Eff_StationMapBase "<<i<<" "<<k<<" "<<e<<sst.str().c_str() );
130 m_eff_stationmapbase[i][k][e]=new TH2F( sst.str().c_str(), sst.str().c_str(),43, 0, 43, 48, 0, 48 );
131 if(i==0){
132 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_eff_stationmapbase[i][k][e]) );
133 }else{
134 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_eff_stationmapbase[i][k][e]) );
135 }
136
138 sst.str("");
139
140 // Station Efficiency Map Midstation Segments
141 sst<<WireStrip[k];
142 sst<<"_EfficiencyAgainstMDT";
143 sst<<"_MapMidOnly"<<EffNumDenom[e];
144 sst<<"_"<<AC[i];
145 ATH_MSG_DEBUG("Eff_StationMapMid "<<i<<" "<<k<<" "<<e<<sst.str().c_str() );
146 m_eff_stationmapmid[i][k][e]=new TH2F( sst.str().c_str(), sst.str().c_str(),43, 0, 43, 48, 0, 48 );
147 if(i==0){
148 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_eff_stationmapmid[i][k][e]) );
149 }else{
150 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_eff_stationmapmid[i][k][e]) );
151 }
152
154 sst.str("");
155
156 // Station Efficiency Map Total
157 sst<<WireStrip[k];
158 sst<<"_EfficiencyAgainstMDT";
159 sst<<"_Map"<<EffNumDenom[e];
160 sst<<"_"<<AC[i];
161 ATH_MSG_DEBUG("Eff_StationMap "<<i<<" "<<k<<" "<<e<<sst.str().c_str() );
162 m_eff_stationmap[i][k][e]=new TH2F( sst.str().c_str(), sst.str().c_str(),43, 0, 43, 48, 0, 48 );
163 if(i==0){
164 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_eff_stationmap[i][k][e]) );
165 }else{
166 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_eff_stationmap[i][k][e]) );
167 }
168
169 labelStationMap(m_eff_stationmap[i][k][e], i,k);
170 sst.str("");
171 }// EffNumDenom
172 }// WireStrip
173 }// AC
174
176 // Sagittas
177
178
179 nbins3D_1[0]= 8000; nbins3D_1[1]= 200; nbins3D_1[2]= 4096; nbins3D_1[3]= 40000;
180 fGlobalCoords3Dlo[0]= -8000; fGlobalCoords3Dlo[1]= -1; fGlobalCoords3Dlo[2]= -M_PI; fGlobalCoords3Dlo[3]= -200000;
181 fGlobalCoords3Dup[0]= 8000; fGlobalCoords3Dup[1]= 1; fGlobalCoords3Dup[2]= M_PI; fGlobalCoords3Dup[3]= 200000;
182 for(int i=0;i<2;i++){// AC
183 for(int jTGC=0;jTGC<4;jTGC++){// TGC Station
184 for(int f=0;f<2;f++){// FE
185 for(int k=0;k<2;k++){// WireStrip
186 for(int x=0;x<4;x++){// RhoEtaPhi
187 if(x==0||x==2){ // Only interested in Rho and Phi
188 // TGC EIFI vs MDT extrapolated position, Sagitta
189 sst<<"TGC_SegmTrack_"<<RhoEtaPhiZ[x];
190 sst<<"Sagitta_T"<<jTGC+1;
191 sst<<FE[f];
192 sst<<WireStrip[k];
193 sst<<"_"<<AC[i];
194 ATH_MSG_DEBUG("TGC_Sagitta "<<i<<" "<<jTGC<<" "<<f<<" "<<k<<" "<<x<<" "<<sst.str().c_str() );
195 m_mvt_extrprdsag[i][jTGC][f][k][x] =new TH1F(sst.str().c_str(), sst.str().c_str(), nbins3D_1[x],fGlobalCoords3Dlo[x],fGlobalCoords3Dup[x]);
196 if(i==0){
197 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mvt_extrprdsag[i][jTGC][f][k][x]) );
198 }else{
199 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mvt_extrprdsag[i][jTGC][f][k][x]) );
200 }
201
202 m_mvt_extrprdsag[i][jTGC][f][k][x]->GetXaxis()->SetTitle(RhoEtaPhiZ[x].c_str());
203 sst.str("");
204
205 // TGC EIFI vs MDT extrapolated position, Sagitta
206 sst<<"TGC_MidSegm_"<<RhoEtaPhiZ[x];
207 sst<<"Sagitta_T"<<jTGC+1;
208 sst<<FE[f];
209 sst<<WireStrip[k];
210 sst<<"_"<<AC[i];
211 ATH_MSG_DEBUG("TGC_Sagitta "<<i<<" "<<jTGC<<" "<<f<<" "<<k<<" "<<x<<" "<<sst.str().c_str() );
212 m_mvt_extrprdsag2[i][jTGC][f][k][x] =new TH1F(sst.str().c_str(), sst.str().c_str(), nbins3D_1[x],fGlobalCoords3Dlo[x],fGlobalCoords3Dup[x]);
213 if(i==0){
214 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mvt_extrprdsag2[i][jTGC][f][k][x]) );
215 }else{
216 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mvt_extrprdsag2[i][jTGC][f][k][x]) );
217 }
218
219 m_mvt_extrprdsag2[i][jTGC][f][k][x]->GetXaxis()->SetTitle(RhoEtaPhiZ[x].c_str());
220 sst.str("");
221 }
222 }// RhoEtaPhi
223 }// WireStrip
224 }// FE
225 }// TGC Station
226 }// AC
227
228
229 for(int k=0;k<2;k++){// WireStrip
230 if(k==0){
231 nbins3D_1[0]= 10000; nbins3D_1[1]= 1200; nbins3D_1[2]= 8192; nbins3D_1[3]= 40000;
232 fGlobalCoords3Dlo[0]= -1000; fGlobalCoords3Dlo[1]= -3; fGlobalCoords3Dlo[2]=-1*M_PI/8; fGlobalCoords3Dlo[3]= -200000;
233 fGlobalCoords3Dup[0]= 1000; fGlobalCoords3Dup[1]= 3; fGlobalCoords3Dup[2]= M_PI/8; fGlobalCoords3Dup[3]= 200000;
234 }
235 else{
236 nbins3D_1[0]= 10000; nbins3D_1[1]= 1200; nbins3D_1[2]= 8192; nbins3D_1[3]= 40000;
237 fGlobalCoords3Dlo[0]= -5000; fGlobalCoords3Dlo[1]= -3; fGlobalCoords3Dlo[2]=-1*M_PI/8; fGlobalCoords3Dlo[3]= -200000;
238 fGlobalCoords3Dup[0]= 5000; fGlobalCoords3Dup[1]= 3; fGlobalCoords3Dup[2]= M_PI/8; fGlobalCoords3Dup[3]= 200000;
239 }
240 for(int i=0;i<2;i++){// AC
241 for(int x=0;x<4;x++){// RhoEtaPhiZ
242 if(x==0||x==2){ // Only interested in Rho and Phi
243 // TGC PRD comparison for Mid Only Check
244 sst<<"TGC_MidStationPRD_"<<RhoEtaPhiZ[x];
245 sst<<"Sagitta_"<<WireStrip[k];
246 sst<<"_"<<AC[i];
247 ATH_MSG_DEBUG("TGC_PRDonly_Sagitta "<<i<<" "<<" "<<k<<" "<<x<<" "<<sst.str().c_str() );
248 m_tgc_prdcompsag[i][k][x] =new TH1F(sst.str().c_str(), sst.str().c_str(), nbins3D_1[x],fGlobalCoords3Dlo[x],fGlobalCoords3Dup[x]);
249 if(i==0){
250 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_tgc_prdcompsag[i][k][x]) );
251 }else{
252 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_tgc_prdcompsag[i][k][x]) );
253 }
254
255 m_tgc_prdcompsag[i][k][x]->GetXaxis()->SetTitle(RhoEtaPhiZ[x].c_str());
256 sst.str("");
257 }
258 }// WireStrip
259 }// RhoEtaPhiThe
260 }// AC
261
262
264 // Segment Positions
265
266 // Initialize to zero
267 for(int i=0;i<2;i++)// AC
268 for(int jMDT1=0;jMDT1<4;jMDT1++)// MDT Station1
269 for(int jMDT2=0;jMDT2<4;jMDT2++)// MDT Station2
270 for(int x=0;x<4;x++){
271 m_mdt_segmmatchsag[i][jMDT1][jMDT2][x]=nullptr;
272 }
273
274 nbins3D_1[0]= 2000; nbins3D_1[1]= 200; nbins3D_1[2]= 4096; nbins3D_1[3]= 1024;
275 fGlobalCoords3Dlo[0]= -1000; fGlobalCoords3Dlo[1]= -1; fGlobalCoords3Dlo[2]= -M_PI/8; fGlobalCoords3Dlo[3]= 0;
276 fGlobalCoords3Dup[0]= 1000; fGlobalCoords3Dup[1]= 1; fGlobalCoords3Dup[2]= M_PI/8; fGlobalCoords3Dup[3]= 0.5*M_PI;
277 for(int i=0;i<2;i++){// AC
278 for(int jMDT1=0;jMDT1<4;jMDT1++){// MDT Station1
279 for(int jMDT2=0;jMDT2<4;jMDT2++){// MDT Station2
280 //if(jMDT1==jMDT2)continue;
281 for(int x=0;x<4;x++){// RhoEtaPhiThe
282 if(x==0||x==2||x==3){// Not interested in Eta
283 // Segm Matching Sag
284 sst<<"MDT_Matching_"<<RhoEtaPhiThe[x];
285 sst<<"Sagitta_MDT"<<jMDT1+1;
286 sst<<"vsMDT"<<jMDT2+1;
287 sst<<"_"<<AC[i];
288 ATH_MSG_DEBUG("MDT_MatchingSagitta "<<i<<" "<<jMDT1<<" "<<jMDT2<<" "<<x<<" "<<sst.str().c_str() );
289 m_mdt_segmmatchsag[i][jMDT1][jMDT2][x] =new TH1F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[x], fGlobalCoords3Dlo[x], fGlobalCoords3Dup[x]);
290 if(i==0){
291 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_segmmatchsag[i][jMDT1][jMDT2][x]) );
292 }else{
293 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_segmmatchsag[i][jMDT1][jMDT2][x]) );
294 }
295
296 m_mdt_segmmatchsag[i][jMDT1][jMDT2][x]->GetXaxis()->SetTitle(RhoEtaPhiThe[x].c_str());
297 sst.str("");
298 }
299 }
300 }
301 }
302 }
303
304
306 // Segment Directions
307
308 for(int i=0;i<2;i++)// AC
309 for(int jMDT1=0;jMDT1<4;jMDT1++){// MDT Station2
310 for(int x=0;x<4;x++){// RhoEtaPhiThe
311 m_mdt_segmposdirsag[i][jMDT1][x]=nullptr;
312 }
313 for(int jMDT2=0;jMDT2<4;jMDT2++){
314 for(int x=0;x<4;x++){
315 m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x]=nullptr;
316 for(int v=0;v<2;v++){
317 m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v]=nullptr;
318 }
319 }
320 }
321 }
322
323 nbins3D_1[0]= 2000; nbins3D_1[1]= 200; nbins3D_1[2]= 8192; nbins3D_1[3]= 2048;
324 fGlobalCoords3Dlo[0]= -1000; fGlobalCoords3Dlo[1]= -1; fGlobalCoords3Dlo[2]= -2*M_PI; fGlobalCoords3Dlo[3]=-0.5*M_PI;
325 fGlobalCoords3Dup[0]= 1000; fGlobalCoords3Dup[1]= 1; fGlobalCoords3Dup[2]= 2*M_PI; fGlobalCoords3Dup[3]= 0.5*M_PI;
326 for(int i=0;i<2;i++){// AC
327 for(int jMDT1=0;jMDT1<4;jMDT1++){// MDT Station2
328 for(int x=0;x<4;x++){// RhoEtaPhiThe
329 if(x==2||x==3){ // Only interested in Phi & Theta
330 // Segm Pos-Dir Sag
331 sst<<"MDT_PosDir_"<<RhoEtaPhiThe[x];
332 sst<<"Sagitta_MDT"<<jMDT1+1;
333 sst<<"_"<<AC[i];
334 ATH_MSG_DEBUG("MDT_PosDirSagitta "<<i<<" "<<jMDT1<<" "<<x<<" "<<sst.str().c_str() );
335 m_mdt_segmposdirsag[i][jMDT1][x] =new TH1F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[x], fGlobalCoords3Dlo[x], fGlobalCoords3Dup[x]);
336 if(i==0){
337 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_segmposdirsag[i][jMDT1][x]) );
338 }else{
339 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_segmposdirsag[i][jMDT1][x]) );
340 }
341 m_mdt_segmposdirsag[i][jMDT1][x]->GetXaxis()->SetTitle(RhoEtaPhiThe[x].c_str());
342 sst.str("");
343 }
344 }// RhoEtaPhiThe
345
346 for(int jMDT2=0;jMDT2<4;jMDT2++){// MDT Station2
347 //if(jMDT1==jMDT2)continue;// Cut same station comparison
348 for(int x=0;x<4;x++){// RhoEtaPhiThe
349 if(x==2||x==3){ // Only interested in Phi & Theta
350 // Track Dir-Dir Sag
351 sst<<"MDT_DirDir_"<<RhoEtaPhiThe[x];
352 sst<<"Sagitta_MDT"<<jMDT1+1;
353 sst<<"vsMDT"<<jMDT2+1;
354 sst<<"_"<<AC[i];
355 ATH_MSG_DEBUG("MDT_DirDirSagitta "<<i<<" "<<jMDT1<<" "<<jMDT2<<" "<<x<<" "<<sst.str().c_str() );
356 m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x] =new TH1F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[x], fGlobalCoords3Dlo[x], fGlobalCoords3Dup[x]);
357 if(i==0){
358 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x]) );
359 }else{
360 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x]) );
361 }
362
363 m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x]->GetXaxis()->SetTitle(RhoEtaPhiThe[x].c_str());
364 sst.str("");
365
366 for(int v=0;v<2;v++){
367 if(jMDT1>=jMDT2)continue;// Regard vector comparison between two stations as
368 // Track Direction Check
369 sst<<"MDT_TrackCheck_"<<RhoEtaPhiThe[x];
370 sst<<"Sagitta_MDT"<<jMDT1+1;
371 sst<<"vs"<<jMDT2+1;
372 sst<<"_MDT";
373 if(v==0)sst<<jMDT1+1;
374 else sst<<jMDT2+1;
375 sst<<"_"<<AC[i];
376 ATH_MSG_DEBUG("MDT_TrackCheckSagitta "<<i<<" "<<jMDT1<<" "<<jMDT2<<" "<<x<<" "<<sst.str().c_str() );
377 m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v] =new TH1F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[x], fGlobalCoords3Dlo[x], fGlobalCoords3Dup[x]);
378 if(i==0){
379 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v]) );
380 }else{
381 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v]) );
382 }
383 m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v]->GetXaxis()->SetTitle(RhoEtaPhiThe[x].c_str());
384 sst.str("");
385 }
386 }
387 }// RhoEtaPhiThe
388 }// MDT Station2
389 }// MDT Station1
390 }// AC
391
392 return StatusCode::SUCCESS;
393}
#define M_PI
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
void labelStationMap(TH2 *h2, int i=-1, int k=-1)
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)

◆ bookHistograms()

◆ bookHistogramsRecurrent()

StatusCode MdtVsTgcRawDataValAlg::bookHistogramsRecurrent ( )
virtual

An inheriting class should either override this function, bookHists() or bookHistograms().

Reimplemented from ManagedMonitorToolBase.

Definition at line 134 of file MdtVsTgcRawDataValAlg.cxx.

134 {
135/*----------------------------------------------------------------------------------*/
136 ATH_MSG_DEBUG( "TGC RawData Monitoring Histograms being booked" );
137
138 //declare a group of histograms
139 std::string generic_path_mdtvstgclv1 = "Muon/MuonRawDataMonitoring/MDTvsTGC";
140 //MonGroup mdtvstgclv1_expert( this, generic_path_mdtvstgclv1+"/Global", expert, run );
141 MonGroup mdtvstgclv1_expert_a( this, generic_path_mdtvstgclv1+"/TGCEA", run, ATTRIB_UNMANAGED );
142 MonGroup mdtvstgclv1_expert_c( this, generic_path_mdtvstgclv1+"/TGCEC", run, ATTRIB_UNMANAGED );
143
144 if(newRunFlag()){
145 ATH_MSG_INFO( "MdtVsTgc RawData Monitoring : begin of run" );
146
147 ATH_CHECK( bookmaphists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
148 ATH_CHECK( bookeffhists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
149 }//isNewRun
150 return StatusCode::SUCCESS;
151}
A container of information describing a monitoring object.
StatusCode bookmaphists(MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
StatusCode bookeffhists(MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)

◆ bookHists()

StatusCode ManagedMonitorToolBase::bookHists ( )
virtualinherited

Calls bookHists( true, true, true ) and initializes lumiBlock and run numbers.

Implements IMonitorToolBase.

Reimplemented in TileDigitsMonTool, and TileRawChannelMonTool.

Definition at line 729 of file ManagedMonitorToolBase.cxx.

731{
732 // The Run/LumiBlock numbers are not set when beginRun() is called. Therefore,
733 // book histograms on the first call to fillHists(), which is called from execute().
734 return StatusCode::SUCCESS;
735}

◆ bookmaphists()

StatusCode MdtVsTgcRawDataValAlg::bookmaphists ( MonGroup & mdtvstgclv1_expert_a,
MonGroup & mdtvstgclv1_expert_c )
private

Definition at line 27 of file MdtVsTgcRawData_bookhistograms.cxx.

28 {
29
30 std::stringstream sst;
31 std::string AC[2]= {"A","C"};
32 int nbins3D_1[4]= { 0, 0, 0, 0};
33 float fGlobalCoords3Dlo[4]= { 0, 0, 0, 0};
34 float fGlobalCoords3Dup[4]= { 0, 0, 0, 0};
35 // **************************************************************
36 // ** maphists
37 // **************************************************************
39 // Number of~ hists
40 nbins3D_1[0]= 480; nbins3D_1[1]= 120; nbins3D_1[2]= 128; nbins3D_1[3]= 100;
41 fGlobalCoords3Dlo[0]= 0; fGlobalCoords3Dlo[1]= 0; fGlobalCoords3Dlo[2]= 0; fGlobalCoords3Dlo[3]= 0;
42 fGlobalCoords3Dup[0]= 12000; fGlobalCoords3Dup[1]= 3; fGlobalCoords3Dup[2]= 2*M_PI; fGlobalCoords3Dup[3]= 0.5*M_PI;
43 for(int i=0;i<2;i++){// AC
44 // nEvents passing cut criteria
45 sst<<"EffCheck_CutsPassed_"<<AC[i];
46 ATH_MSG_DEBUG("EffCheck_CutsPassed "<<i<<" "<<sst.str().c_str() );
47 m_mvt_cutspassed[i] =new TH1I(sst.str().c_str(), sst.str().c_str(), 14, 1, 15);
48 if(i==0){
49 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mvt_cutspassed[i]) );
50 }else{
51 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mvt_cutspassed[i]) );
52 }
53
54 m_mvt_cutspassed[i]->GetYaxis()->SetTitle("nEvents");
55 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(1, "Events");
56 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(2, "matchedSegm=0");
57 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(3, "matchedSegm>1");
58 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(4, "matchedSegm=1");
59 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(5, "+HasEIFI");
60 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(6, "EIFIMatch");
61 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(7, "+HasT1");
62 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(8, "T1Match");
63 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(9,"+HasT2");
64 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(10,"T2Match");
65 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(11,"+HasT3");
66 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(12,"T3Match");
67 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(13,"AllStationsMatch");
68 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(14,"AllLayersMatch");
69 sst.str("");
70 }// AC
71
72
74 // Distributions
75 nbins3D_1[0]= 600; nbins3D_1[1]= 120; nbins3D_1[2]= 128; nbins3D_1[3]= 128;
76 fGlobalCoords3Dlo[0]= 0; fGlobalCoords3Dlo[1]= 0; fGlobalCoords3Dlo[2]= 0; fGlobalCoords3Dlo[3]= 0;
77 fGlobalCoords3Dup[0]= 12000; fGlobalCoords3Dup[1]= 3; fGlobalCoords3Dup[2]= 2*M_PI; fGlobalCoords3Dup[3]= 0.5*M_PI;
78 for(int i=0;i<2;i++){// AC
79 for(int jMDT=0;jMDT<4;jMDT++){// MDT Station
80 // MDT Segm Eta vs Phi
81 sst<<"MDT_SegmMap_MDT"<<jMDT+1;
82 sst<<"_"<<AC[i];
83 ATH_MSG_DEBUG("MDT_SegmMap "<<i<<" "<<jMDT<<" "<<sst.str().c_str() );
84 m_mdt_segmmap[i][jMDT] =new TH2F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[2], fGlobalCoords3Dlo[2], fGlobalCoords3Dup[2], nbins3D_1[1], fGlobalCoords3Dlo[1], fGlobalCoords3Dup[1]);
85 if(i==0){
86 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_segmmap[i][jMDT]) );
87 }else{
88 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_segmmap[i][jMDT]) );
89 }
90
91 m_mdt_segmmap[i][jMDT]->GetXaxis()->SetTitle("MDT Phi");
92 m_mdt_segmmap[i][jMDT]->GetYaxis()->SetTitle("MDT Eta");
93 sst.str("");
94 }// MDT Station
95 }// AC
96 return StatusCode::SUCCESS;
97}

◆ checkHists()

StatusCode ManagedMonitorToolBase::checkHists ( bool calledFromFinalize)
virtualinherited

This implementation does nothing; equivalent functionality may be provided by procHists(...) with appropriate arguments.

Implements IMonitorToolBase.

Reimplemented in CscCalibMonToolBase, TileCellNoiseMonTool, TileDigitsMonTool, and TileRawChannelMonTool.

Definition at line 1669 of file ManagedMonitorToolBase.cxx.

1671{
1672 // Histograms will be checked using the data-quality monitoring framework (DQMF)
1673
1674 return StatusCode::SUCCESS;
1675}

◆ CheckTGConTrack()

void MdtVsTgcRawDataValAlg::CheckTGConTrack ( std::vector< SegmTrack >(&) matchedSegments[2],
const Muon::TgcPrepDataContainer * tgc_prepcontainer )
private

Definition at line 36 of file MdtVsTgcRawData_PRDonTrack.cxx.

37 {
38 // Define Cuts:
39 // Loose cut for PRD and Extrapolated
40 const float dPhiCut_Loose = M_PI/8;
41 // Cut for Global Position Efficiencies
42 const float dPhiCutGlobal[2] = {static_cast<float>(M_PI/24),static_cast<float>(M_PI/12)}; //[WireStrip]
43 const float dRhoCutGlobal[2] = { 0.08, 0.5}; //[WireStrip]
44 // Cut for Sector Efficiencies
45 const float dPhiCutSector[2] = { 0.2, 0.1}; //[WireStrip]
46 const float dRhoCutSector[2] = { 200, 2000}; //[WireStrip]
47
48 // Loop over sides
49 for(int i=0;i<2;i++){// AC
50 // Get number of tracks
51 unsigned int nTrack=matchedSegments[i].size();
52
53 // Fill nEvents histograms
54 m_mvt_cutspassed[i]->Fill(1);
55 if(nTrack==0)m_mvt_cutspassed[i]->Fill(2);
56 if(nTrack>1)m_mvt_cutspassed[i]->Fill(3);
57 if(nTrack==1)m_mvt_cutspassed[i]->Fill(4);
58
59 // Cut events without exactly one set of matched Segments
60 if(nTrack!=1)continue;
61
62 // Declare Position variables for inner
63 //Trk::GlobalPosition innerSegmPos;
64 Amg::Vector3D innerSegmPos = {0, 0, 0};
65
66 // float innerSegmEta=0;
67 float innerSegmRho=0; float innerSegmPhi=0; float innerSegmZ=0;
68 //Trk::GlobalDirection innerSegmDirzunit;
69 Amg::Vector3D innerSegmDirzunit = {0, 0, 0};
70
71 // Declare Position variables for midstation
72 //Trk::GlobalPosition midSegmPos;
73 Amg::Vector3D midSegmPos = {0, 0, 0};
74
75 // float midSegmRho =0; float midSegmEta =0;
76 float midSegmPhi =0; float midSegmZ =0;
77 //Trk::GlobalDirection midSegmDirzunit;
78 Amg::Vector3D midSegmDirzunit = {0, 0, 0};
79
80 // Check which layers have sufficienct segments to operate on for global coordinates
81 bool canCheckGlobal[4] = {0, 0, 0, 0};// [TGCStation]
82 if(matchedSegments[i].at(0).at(2)!=nullptr){
83 // Check Midstation
84 canCheckGlobal[0]=true; canCheckGlobal[1]=true; canCheckGlobal[2]=true;
85 // Read Midstation Segment Values into variables
86 midSegmPos = Amg::Vector3D(matchedSegments[i].at(0).at(2)->globalPosition());
87 midSegmPhi = midSegmPos.phi();
88 midSegmZ = midSegmPos.z();
89 if(midSegmPhi<0)midSegmPhi+=2*M_PI;
90 midSegmDirzunit = Amg::Vector3D(midSegmPos/std::abs(midSegmZ));
91 }
92 if((matchedSegments[i].at(0).at(0)!=nullptr)&&(matchedSegments[i].at(0).at(2)!=nullptr)){
93 // Check EIFI
94 canCheckGlobal[3]=true;
95 // Read Inner Segment Values
96 innerSegmPos = Amg::Vector3D(matchedSegments[i].at(0).at(0)->globalPosition());
97 innerSegmRho = std::abs(innerSegmPos.perp());
98 innerSegmZ = std::abs(innerSegmPos.z());
99 // Modify position
100 innerSegmPhi = midSegmPhi;
101
102 innerSegmPos = Amg::Vector3D(innerSegmRho*std::cos(innerSegmPhi), innerSegmRho*std::sin(innerSegmPhi), innerSegmZ);
103 innerSegmDirzunit = Amg::Vector3D(innerSegmPos/std::abs(innerSegmZ));
104 }
105
106 // If no layers can be checked (i.e. no midstation segment matched) skip side
107 bool skipSide = true;
108 for(int jTGC=0;jTGC<4;jTGC++)if(canCheckGlobal[jTGC]==true)skipSide=false;
109 if(skipSide==true)continue;
110
111 // Initialize variables for TRE array search
112 int TGCStationNames[8] ={41, 42, 43, 44, 45, 46, 47, 48};
113 int TGCstation_StationFE[4] ={-1,-1,-1,-1};// [TGCStation]
114 int TGCstation_StationEta[4]={ 0, 0, 0, 0};// [TGCStation]
115 int TGCstation_StationPhi[4]={ 0, 0, 0, 0};// [TGCStation]
116 int nStationMatch[4] ={ 0, 0, 0, 0};// [TGCStation]
117 bool canCheckSector[4] ={ true, true, true, true};// [TGCStation]
118
119 // Loop through TRE array, finding sectors which match the track in each layer
120 for(int stationnameindex=0; stationnameindex<8; stationnameindex++){// Station {T1F,T1E,T2F,T2E,T3F,T3E,T4F,T4E}
121 // Skip stations which don't have sufficient Segments to run efficiency check
122 int stationName = TGCStationNames[stationnameindex];
123 int stationIndex= TGCstationname2stationindex(stationName);
124 if(stationIndex<0) continue;
125 if(!canCheckGlobal[stationIndex])continue;
126
127 // Loop over StationEta&StationPhi
128 for(int stationeta=1; stationeta<=8; stationeta++){// AbsStationEta
129 for(int stationphi=1; stationphi<=48; stationphi++){// StationPhi
130 // Cut Station EtaPhi combinations with no TGC element
131 if(m_TREarray[stationnameindex][i][stationeta][stationphi]==nullptr)continue;
132 const MuonGM::TgcReadoutElement *tre=m_TREarray[stationnameindex][i][stationeta][stationphi];
133
134 // Extrapolate position from nearest Station's Segment to Sector's Z
135 float sectorZ=tre->globalPosition().z();
136 //Trk::GlobalPosition sectorExtrapolatedPos;
137 Amg::Vector3D sectorExtrapolatedPos;
138
139 if(stationIndex==3){// Inner
140 float dZ_sector=std::abs(sectorZ)-std::abs(innerSegmZ);
141 //sectorExtrapolatedPos = Trk::GlobalPosition(innerSegmPos+(innerSegmDirzunit*dZ_sector));
142 sectorExtrapolatedPos = Amg::Vector3D(innerSegmPos+(innerSegmDirzunit*dZ_sector));
143 }
144 else{// Midstation
145 float dZ_sector=std::abs(sectorZ)-std::abs(midSegmZ);
146 sectorExtrapolatedPos = Amg::Vector3D(midSegmPos+(midSegmDirzunit*dZ_sector));
147 }
148
149 // Convert extrapolated position to local position on the Sector
150 Identifier sector_id=tre->identify();
151 const Amg::Vector3D sectorLocalPos3D=tre->globalToLocalTransf(sector_id)*sectorExtrapolatedPos;
152 Amg::Vector2D sectorLocalPos2D(sectorLocalPos3D.y(),sectorLocalPos3D.z());
153
154 double avWidth = (tre->getLongSsize()+tre->getSsize())/2;
155 //double dWidth = (tre->longWidth()-tre->shortWidth());
156 double length = tre->length();
157
158 // Cut sectors which the track does not go through the central 80% of (avoids double counts)
159 double tol1=-0.1*(avWidth/2);
160 double tol2=-0.1*(length/2);
161
162 bool insideSectorBounds=tre->bounds().inside(sectorLocalPos2D,tol1,tol2);
163 if(!insideSectorBounds)continue;
164
165 // Assign values to matching station variables
166 TGCstation_StationFE[stationIndex]= (tre->isForward()==false);
167 TGCstation_StationEta[stationIndex]=stationeta;
168 TGCstation_StationPhi[stationIndex]=stationphi;
169 nStationMatch[stationIndex]++;
170 }// StationPhi
171 }// StationEta
172 }// StationName
173
174 // Don't check stations that don't have exactly 1 match for this track
175 for(int jTGC=0;jTGC<4;jTGC++){// TGC Station
176 if(nStationMatch[jTGC]==0){
177 canCheckSector[jTGC]=false;
178 }
179 else if(nStationMatch[jTGC]>1){
180 canCheckSector[jTGC]=false;
181 // Should be impossible, but happens due a problem with the bounds().inside function
182 // commenting out until this bug is resolved
183 //m_log << MSG::WARNING << "SegmTrack: Number of matches for TGC" << jTGC+1 << " is " << nStationMatch[jTGC] << endl;
184 }
185 }// TGC Station
186
187 // Loop through segments to check number of TGC Strips in each
188 int nTGCStrips[4] = {0, 0, 0, 0};//[TGCStation]
189 for(int jMDT=0;jMDT<4;jMDT++){// MDT Station
190 if(matchedSegments[i].at(0).at(jMDT)==nullptr)continue;
191 const Muon::MuonSegment *segm=matchedSegments[i].at(0).at(jMDT);
192 // Loop through contained ROTs and identify used stations
193 const std::vector<const Trk::MeasurementBase*> mMeasTrk = segm->containedMeasurements();
194 ATH_MSG_DEBUG( "number of MeasurementBase: "<<mMeasTrk.size() );
195 for (unsigned int i=0; i<mMeasTrk.size(); i++) {
196 const Trk::MeasurementBase* m = mMeasTrk[i];
197 //const Trk::RIO_OnTrack* rio = dynamic_cast<const Trk::RIO_OnTrack*>(m);
198 const Muon::CompetingMuonClustersOnTrack* crot = dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(m);
199 if(crot) {
200 const std::vector<const Muon::MuonClusterOnTrack*> mc_list = crot->containedROTs();
201 for(unsigned int iROT=0; iROT< mc_list.size(); iROT++){
202 const Muon::MuonClusterOnTrack * rio = mc_list[iROT];
203 //const Trk::RIO_OnTrack* rio = crot->rioOnTrack(iROT);
204 Identifier id = rio->identify();
205 int stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
206 // 41=T1F 42=T1E 43=T2F 44=T2E 45=T3F 46=T3E 47=T4F 48=T4E
207 if(m_idHelperSvc->tgcIdHelper().isStrip(id)){
208 if((jMDT==2)&&((stationName==41)||(stationName==42)))nTGCStrips[0]++;// TGC
209 if((jMDT==2)&&((stationName==43)||(stationName==44)))nTGCStrips[1]++;// TGC
210 if((jMDT==2)&&((stationName==45)||(stationName==46)))nTGCStrips[2]++;// TGC
211 if((jMDT==0)&&((stationName==47)||(stationName==48)))nTGCStrips[3]++;// TGC
212 }
213
214 ATH_MSG_DEBUG( " check if TGC strip: "<<m_idHelperSvc->tgcIdHelper().isStrip(id)<<" StationName: "<<stationName );
215 }
216 }
217 }
218 }// MDT Station
219
220
221 // Don't check mid-stations when there are no strips in other mid-stations
222 if((nTGCStrips[1]==0)&&(nTGCStrips[2]==0)){canCheckSector[0]=false;canCheckGlobal[0]=false;}
223 if((nTGCStrips[0]==0)&&(nTGCStrips[2]==0)){canCheckSector[1]=false;canCheckGlobal[1]=false;}
224 if((nTGCStrips[0]==0)&&(nTGCStrips[1]==0)){canCheckSector[2]=false;canCheckGlobal[2]=false;}
225
226 // Initialise hit registered arrays
227 // bool hitregistered[9][2];
228 bool sectorhitregistered[9][2];
229 for(int l=0;l<9;l++){// Layer
230 for(int k=0;k<2;k++){// WireStrip
231 // hitregistered[l][k]=false;
232 sectorhitregistered[l][k]=false;
233 }// WireStrip
234 }// Layer
235
236 // Initialise flags for whether a layer in this event has PRD and PRD which matched the current track
237 bool HasPRD[9] ={false,false,false,false,false,false,false,false,false};
238 bool PRDMatch[9]={false,false,false,false,false,false,false,false,false};
239
240 // Loop over TGC Prep Data container
241 Muon::TgcPrepDataContainer::const_iterator prepit_end=tgc_prepcontainer->end();
242 for( Muon::TgcPrepDataContainer::const_iterator prepit=tgc_prepcontainer->begin();
243 prepit!=prepit_end;
244 ++prepit){
245
246 //loop over TGC Prep Data collection
247 Muon::TgcPrepDataCollection::const_iterator prepitc_end=(*prepit)->end();
248 for( Muon::TgcPrepDataCollection::const_iterator prepitc=(*prepit)->begin();
249 prepitc!= prepitc_end;
250 ++prepitc){
251 // Get PRD and variables
252 const Muon::TgcPrepData* tpd=*prepitc;
253 const MuonGM::TgcReadoutElement *tre = tpd->detectorElement();
254 const std::string stationType = tre->getStationType();
255
256 // Get id values
257 Identifier tgcid=(*prepitc)->identify();
258 int tgcAC=(tre->sideA()==false);//isNotAside a:0, c:1
259 int tgcFE=(tre->isForward()==false);//isNotForward f:0, e:1
260 int tgcWS=(m_idHelperSvc->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1
261 int stationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid);
262 int stationEta = std::abs(tre->getStationEta());
263 int stationPhi = tre->getStationPhi();
264 int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid);
265
266 // Cut hits except those from same side EIFI & Midstation
267 if(tgcAC!=i) continue;
268 if(stationName>48 || stationName<41) continue;
269
270 // Get layer number and stationIndex
271 int layer = TGCgetlayer(stationName,gasGap);
272 int stationIndex = TGCstationname2stationindex(stationName);
273
274 // Skip PRD in stations which can't be checked
275 if(stationIndex<0) continue;
276 if(!(canCheckGlobal[stationIndex]||canCheckSector[stationIndex]))continue;
277 if(layer<0) continue;
278 HasPRD[layer]=true;
279
280 // Get position variables
281 // const Trk::GlobalPosition prdPos = tpd->globalPosition();
282 const Amg::Vector3D prdPos = tpd->globalPosition();
283 float tgcRho = std::abs(prdPos.perp());
284 float tgcPhi = prdPos.phi();
285 float tgcZ = prdPos.z();
286 if(tgcPhi<0)tgcPhi+=2*M_PI;
287
288 // Run Extrapolation
289 // Trk::GlobalPosition tgcExtrapolatedPos;
290 Amg::Vector3D tgcExtrapolatedPos;
291 if(stationIndex==3){// Extrapolate position from Inner Position to PRD Z position
292 //if(innerSegmPos=0)m_log << MSG::WARNING << "MidstationOnly: innerSegmPos=0 but passed canCheckGlobal" );
293 float dZ = std::abs(tgcZ) - std::abs(innerSegmZ);
294 //tgcExtrapolatedPos = Trk::GlobalPosition(innerSegmPos+(innerSegmDirzunit*dZ));
295 tgcExtrapolatedPos = Amg::Vector3D(innerSegmPos+(innerSegmDirzunit*dZ));
296 }
297 else{// Extrapolate position from Midstation Position to PRD Z position
298 float dZ = std::abs(tgcZ) - std::abs(midSegmZ);
299 //tgcExtrapolatedPos = Trk::GlobalPosition(midSegmPos+(midSegmDirzunit*dZ));
300 tgcExtrapolatedPos = Amg::Vector3D(midSegmPos+(midSegmDirzunit*dZ));
301 }
302 float tgcExtrRho = std::abs(tgcExtrapolatedPos.perp());
303 float tgcExtrPhi = tgcExtrapolatedPos.phi();
304 if(tgcExtrPhi<0)tgcExtrPhi+=2*M_PI;
305
306 // Get differences between extrapolated and segm2 positions
307 float dRho = tgcRho-tgcExtrRho;
308 float dPhi = tgcPhi-tgcExtrPhi;
309 if(dPhi<-M_PI)dPhi+=2*M_PI;
310 if(dPhi> M_PI)dPhi-=2*M_PI;
311
312 // Pass through loose phi cut to eliminate some noise
313 if(std::abs(dPhi)<dPhiCut_Loose){
314 // Fill PRD sagitta histograms
315 if(m_mvt_extrprdsag[i][stationIndex][tgcFE][tgcWS][0]) m_mvt_extrprdsag[i][stationIndex][tgcFE][tgcWS][0]->Fill(dRho);
316 if(m_mvt_extrprdsag[i][stationIndex][tgcFE][tgcWS][2]) m_mvt_extrprdsag[i][stationIndex][tgcFE][tgcWS][2]->Fill(dPhi);
317
318 // Global efficiency check
319 if(canCheckGlobal[stationIndex]){
320 // Do check
321 float dRhoCut = dRhoCutGlobal[tgcWS]*tgcExtrRho;
322 if(std::abs(dPhi)<dPhiCutGlobal[tgcWS] && std::abs(dRho)<dRhoCut){
323 }
324 }
325
326 // Sector Efficiency Check
327 if(canCheckSector[stationIndex]){// If this station can be checked
328 if((stationEta==TGCstation_StationEta[stationIndex])&&
329 (stationPhi==TGCstation_StationPhi[stationIndex])&&
330 (tgcFE==TGCstation_StationFE[stationIndex])){// If Station FE&Eta&Phi match
331 if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){
332 sectorhitregistered[layer][tgcWS]=true;
333 }
334 }// Station EtaPhi
335 }
336
337 }// dPhi Loose Cut
338 }// TGC PRD Collection
339 }// TGC PRD Container
340
341 // Fill Efficiency Histograms
342 for(int l=0;l<9;l++){// Layer
343 // Get Station Number
344 int stationIndex=TGClayer2stationindex(l);
345 if(stationIndex<0) continue;
346 for(int k=0;k<2;k++){// WireStrip
347 // If Segment Track matches a Sector
348 if(canCheckSector[stationIndex]){
349 if((TGCstation_StationFE[stationIndex]<0)||(TGCstation_StationEta[stationIndex]==0)||(TGCstation_StationPhi[stationIndex]==0)){
350 ATH_MSG_WARNING( "SegmTrack: canCheckSector passed for jTGC=" << stationIndex
351 << " but, FE=" << TGCstation_StationFE[stationIndex]
352 << " Eta=" << TGCstation_StationEta[stationIndex]
353 << " Phi=" << TGCstation_StationPhi[stationIndex] );
354 continue;
355 }
356 // Get Sector histogram indexes
357 int stationMap_EtaIndex=getStationMapIndex(1, l, TGCstation_StationFE[stationIndex], TGCstation_StationEta[stationIndex], TGCstation_StationPhi[stationIndex]);
358 int stationMap_PhiIndex=getStationMapIndex(2, l, TGCstation_StationFE[stationIndex], TGCstation_StationEta[stationIndex], TGCstation_StationPhi[stationIndex]);
359 // Fill Sector efficiency histograms
360 if(sectorhitregistered[l][k]){// Hit in Sector matches extrapolated track
361 m_eff_stationmapbase[i][k][1]->Fill(stationMap_EtaIndex, stationMap_PhiIndex);
362 }
363 m_eff_stationmapbase[i][k][2]->Fill(stationMap_EtaIndex, stationMap_PhiIndex);
364 }
365 }// WireStrip
366 }// Layer
367
368 // Fill +Has Station bins of histogram
369 if(HasPRD[0]||HasPRD[1]||HasPRD[2])m_mvt_cutspassed[i]->Fill(7);
370 if(HasPRD[3]||HasPRD[4])m_mvt_cutspassed[i]->Fill(9);
371 if(HasPRD[5]||HasPRD[6])m_mvt_cutspassed[i]->Fill(11);
372 if(HasPRD[7]||HasPRD[8])m_mvt_cutspassed[i]->Fill(5);
373
374 // Fill Match Station bins of histogram
375 if(PRDMatch[0]||PRDMatch[1]||PRDMatch[2])m_mvt_cutspassed[i]->Fill(8);
376 if(PRDMatch[3]||PRDMatch[4])m_mvt_cutspassed[i]->Fill(10);
377 if(PRDMatch[5]||PRDMatch[6])m_mvt_cutspassed[i]->Fill(12);
378 if(PRDMatch[7]||PRDMatch[8])m_mvt_cutspassed[i]->Fill(6);
379 if((PRDMatch[0]||PRDMatch[1]||PRDMatch[2])&&
380 (PRDMatch[3]||PRDMatch[4])&&
381 (PRDMatch[5]||PRDMatch[6])&&
382 (PRDMatch[7]||PRDMatch[8]))m_mvt_cutspassed[i]->Fill(13);
383 if((PRDMatch[0]&&PRDMatch[1]&&PRDMatch[2])&&
384 (PRDMatch[3]&&PRDMatch[4])&&
385 (PRDMatch[5]&&PRDMatch[6])&&
386 (PRDMatch[7]&&PRDMatch[8]))m_mvt_cutspassed[i]->Fill(14);
387
388
389 }// AC
390}// End of function
#define ATH_MSG_WARNING(x)
double length(const pvec &v)
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
int TGCgetlayer(int stationName, int g)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
int getStationMapIndex(int x, int l, int stationFE, int stationEta, int stationPhi)
const MuonGM::TgcReadoutElement * m_TREarray[8][2][9][49]
int TGCstationname2stationindex(int stationName)
virtual const Trk::SurfaceBounds & bounds() const override
Return the boundaries of the element.
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
Amg::Transform3D globalToLocalTransf(const Identifier &id) const
Returns the global -> local transformation.
bool isForward() const
Returns true if the chamber is mounted on the most inner ring, i.e. a TxF chamber.
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
virtual const Amg::Vector3D & globalPosition() const override final
Returns the global position.
virtual const MuonGM::TgcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD The pointer will be zero if the det el is not ...
Identifier identify() const
return the identifier -extends MeasurementBase
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const =0
Each Bounds has a method inside, which checks if a LocalPosition is inside the bounds.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr uint8_t stationPhi
station Phi 1 to 8
l
Printing final latex table to .tex output file.
@ layer
Definition HitInfo.h:79
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)

◆ correlation()

void MdtVsTgcRawDataValAlg::correlation ( const Muon::MdtPrepDataContainer * mdt_hit_container,
const Muon::TgcCoinDataContainer * tgc_trigger_container )
private

<<"mmdtStationName "<<mdtStationName

Definition at line 27 of file MdtVsTgcRawData_correlation.cxx.

28 {
29
30 ATH_MSG_DEBUG("inside correlation" );
31 //StatusCode sc=StatusCode::SUCCESS;
32
33 // MuonDetectorManager from the conditions store
34 SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{m_DetectorManagerKey};
35 const MuonGM::MuonDetectorManager* MuonDetMgr = DetectorManagerHandle.cptr();
36 if(MuonDetMgr==nullptr){
37 ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object");
38 return;
39 }
40
41 //loop over TGC RoI container
42 Muon::TgcCoinDataContainer::const_iterator it_end=tgccontainer->end();
43 for( Muon::TgcCoinDataContainer::const_iterator it=tgccontainer->begin();
44 it!=it_end;
45 ++it){
46
47
48 ATH_MSG_DEBUG( "size of tgc collection is " << (*it) -> size() );
49
50 //loop over TGC RoI collection
52 for( Muon::TgcCoinDataCollection::const_iterator itc=(*it)->begin();
53 itc!= itc_end;
54 ++itc){
55
56 const Muon::TgcCoinData* tcd=*itc;
57 Identifier tgcid=(*itc)->identify();
58
59 if( tcd->type() != Muon::TgcCoinData::TYPE_SL )continue;
60
61 int ac=(tcd->isAside()==false);//isNotAside a:0, c:1
62 int ef=(tcd->isForward()==false);//isNotForward f:0, e:1
63 int phi48=tcd->phi();//48(24)
64 int roi=tcd->roi();
65 int roieta;//1-53
66 int roiphi;//1-192
67
68 roi2etaphi(*tcd, roieta, roiphi);
69
70 //int tgcMdtSector=roiphi2mdtSector(roiphi,ef);
71
72 const MuonGM::TgcReadoutElement* pReadoutElementTGC = MuonDetMgr->getTgcReadoutElement(tgcid);
73 const Amg::Vector3D pos = pReadoutElementTGC->channelPos(tgcid);
74
75 float tgcEta = std::abs(pos.eta());
76 float tgcPhi = pos.phi();
77 if(tgcPhi<0)tgcPhi+=2*M_PI;
78
79
80 ATH_MSG_DEBUG("ac "<<ac
81 <<" ef "<<ef
82 <<" phi48 "<<phi48
83 <<" roi "<<roi
84 <<" roieta "<<roieta
85 <<" roiphi "<<roiphi
86 <<" tgcEta "<<tgcEta
87 <<" tgcPhi "<<tgcPhi );
88
89
90 //loop over MDT container
91 Muon::MdtPrepDataContainer::const_iterator containerIt;
92 Muon::MdtPrepDataContainer::const_iterator container_end=mdt_hit_container->end();
93 for (containerIt = mdt_hit_container->begin() ;
94 containerIt != container_end ;
95 ++containerIt){
96
97 Identifier mdt_id = (*containerIt)->identify();
98 // Field Range Notes
99 // ==============================================================================
100 // StationName unsigned integer maps to "BIL", "EMS" ,etc.
101 // StationEta [-6,-1] backward endcap (-1 at lowest R)
102 // [-8,8] barrel (increases with Z)
103 // [-6,-1]+[1,6] forward endcap (1 at lowest R)
104 // StationPhi [1,8] increases with phi
105 // Technology [0] maps to "MDT"
106 // Multilayer [1,2] barrel: increases with R
107 // endcap: increases with |Z|
108 // TubeLayer [1,4] barrel: increases with R
109 // endcap: increases with |Z|
110 // Tube [1,n] barrel: increases with |Z|
111 // endcap: increases with R
112 // ==============================================================================
113
114 int mdtStationName = int(m_idHelperSvc->mdtIdHelper().stationName(mdt_id)) ;
115
116 //SN Layer Tube Radial
117 //13:EIL 2x4 x54 x4
118 //49:EIS 2x4 x36 x2
119 //17:EML 2x3 x64 x5
120 //18:EMS 2x3 x64 x5
121 //20:EOL 2x3 x48 x6
122 //21:EOS 2x3 x48 x6
123
124 //only Endcap MDT
125 //if(mdtStationName!=13 && mdtStationName!=49 && mdtStationName!=17 && mdtStationName!=18 && mdtStationName!=20 && mdtStationName!=21 )continue;
126
127 //if (m_debuglevel){
128 //m_log<<MSG::DEBUG
130 // <<endmsg;
131 //}
132
133 //only Endcap middle MDT
134 if(mdtStationName!=17 && mdtStationName!=18 )continue;
135
136 int mdtStationEta = int(m_idHelperSvc->mdtIdHelper().stationEta(mdt_id)) ;//backward:[-6,-1], forward:[1,6], (1 or -1 at lowest R)
137 int mdtStationPhi = int(m_idHelperSvc->mdtIdHelper().stationPhi(mdt_id)) ;//[1:8]
138 int mdtAC = (mdtStationEta<0);//a:0, c:1
139
140 float mdtSector=mdtStationPhi*2.-1.;
141 if(mdtStationName==18)mdtSector+=1;
142 double mdtSectorPhi = (mdtSector-1.)*M_PI/8.;
143
144 //same Side
145 if(ac!=mdtAC)continue;
146 ATH_MSG_DEBUG( "size of mdt collection is " << (*containerIt) -> size() );
147
148 ATH_MSG_DEBUG("mdtStationName "<<mdtStationName
149 <<" mdtStationEta "<<mdtStationEta
150 <<" mdtStationPhi "<<mdtStationPhi
151 <<" mdtSectorPhi "<<mdtSectorPhi );
152
153 //loop over MDT PRD Collection
154 Muon::MdtPrepDataCollection::const_iterator collection_it_end=(*containerIt)->end();
155
156
157 int tmp[2][4][64];
158 for(int i=0;i<2;i++)
159 for(int j=0;j<4;j++)
160 for(int k=0;k<64;k++)
161 tmp[i][j][k]=0;
162
163 for(Muon::MdtPrepDataCollection::const_iterator mdtCollection=(*containerIt)->begin();
164 mdtCollection!= collection_it_end;
165 ++mdtCollection){
166
167 Identifier mdt_id2 = (*mdtCollection)->identify();
168
169 int mdtMultiLayer = int(m_idHelperSvc->mdtIdHelper().multilayer(mdt_id2));
170 int mdtTubeLayer = int(m_idHelperSvc->mdtIdHelper().tubeLayer(mdt_id2));
171 int mdtTube = int(m_idHelperSvc->mdtIdHelper().tube(mdt_id2));
172 int mdtTubeIdForEM = (std::abs(mdtStationEta)-1)*64 + mdtTube -1;
173
174 ATH_MSG_DEBUG("mdtMultiLayer "<<mdtMultiLayer
175 <<" mdtTubeLayer "<<mdtTubeLayer
176 <<" mdtTube "<<mdtTube
177 <<" mdtTubeIdForEM "<<mdtTubeIdForEM );
178
179 if(tmp[mdtMultiLayer-1][mdtTubeLayer-1][mdtTube-1]==1)continue;
180 tmp[mdtMultiLayer-1][mdtTubeLayer-1][mdtTube-1]=1;
181
182 int adc = (*mdtCollection)->adc();
183 int tdc = (*mdtCollection)->tdc();
184
185 if(adc < m_MdtAdcCut )continue;
186
187 const MuonGM::MdtReadoutElement* pReadoutElementMDT = MuonDetMgr->getMdtReadoutElement(mdt_id2);
188 const Amg::Vector3D mdtgPos = pReadoutElementMDT->tubePos(mdt_id2); //global position of the wire
189 float mdtEta = std::abs(mdtgPos.eta());
190 float mdtPhi = mdtgPos.phi();
191 float mdtr = mdtgPos.perp();
192 float mdtz = mdtgPos.z();
193 if(mdtPhi<0)mdtPhi+=2*M_PI;
194
195 ATH_MSG_DEBUG(" Name "<<mdtStationName
196 <<" Eta "<<mdtStationEta
197 <<" Phi "<<mdtStationPhi
198 <<" MultiLayer "<<mdtMultiLayer
199 <<" TubeLayer "<<mdtTubeLayer
200 <<" Tube "<<mdtTube
201 <<" TubeIdForEM "<<mdtTubeIdForEM
202 <<" Eta "<<mdtEta
203 <<" Phi "<<mdtPhi
204 <<" r "<<mdtr
205 <<" z "<<mdtz
206 <<" Sec "<<mdtSector
207 <<" SecPhi "<<mdtSectorPhi
208 <<" ADC "<<adc
209 <<" TDC "<<tdc );
210
211 }//MDT collection
212 }//MDT container
213 }//TGC collection
214 }//TGC container
215}
#define ATH_MSG_ERROR(x)
void roi2etaphi(const Muon::TgcCoinData &cd, int &eta, int &phi)
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Amg::Vector3D channelPos(const Identifier &id) const
Returns the position of the active channel (wireGang or strip)
int roi() const
return ROI number
CoinDataType type() const
return the coincidence type (HIPT, LPT, SL)
bool isAside() const
Aside or Cside.
int phi() const
return phi number of trigger sector
bool isForward() const
Forward region or Endcap region.
const_pointer_type cptr()

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ deregGraph()

StatusCode ManagedMonitorToolBase::deregGraph ( TGraph * g)
virtualinherited

De-registers a TGraph from the THistSvc, but does NOT delete the object.

Definition at line 1623 of file ManagedMonitorToolBase.cxx.

1625{
1626 return m_THistSvc->deReg( g );
1627}
ServiceHandle< ITHistSvc > m_THistSvc

◆ deregHist()

StatusCode ManagedMonitorToolBase::deregHist ( TH1 * h)
virtualinherited

De-registers a TH1 from the THistSvc, but does NOT delete the object.

Definition at line 1615 of file ManagedMonitorToolBase.cxx.

1617{
1618 return m_THistSvc->deReg( h );
1619}

◆ deregObject() [1/2]

StatusCode ManagedMonitorToolBase::deregObject ( const std::string & objName,
const MonGroup & group )
virtualinherited

De-registers a TObject from the THistSvc, but does NOT delete the object.

(NB: LightWeight histograms are not even registered until readout).

Definition at line 1641 of file ManagedMonitorToolBase.cxx.

1643{
1644 std::string streamName = streamNameFunction()->getStreamName( this, group, objName );
1645 return m_THistSvc->deReg( streamName );
1646}
virtual std::string getStreamName(const ManagedMonitorToolBase *tool, const MonGroup &group, const std::string &objName, bool usePreviousInterval=false)=0
A function that converts a MonGroup of logical parameters into a physical output stream name.
virtual StreamNameFcn * streamNameFunction()
Returns the function object that converts logical paramters into a physical stream name.

◆ deregObject() [2/2]

StatusCode ManagedMonitorToolBase::deregObject ( const std::string & objName,
const std::string & system,
Interval_t interval )
virtualinherited

De-registers a TObject from the THistSvc, but does NOT delete the object.

(NB: LightWeight histograms are not even registered until readout).

Definition at line 1631 of file ManagedMonitorToolBase.cxx.

1634{
1635 MonGroup group( this, system, interval );
1636 return deregObject( objName, group );
1637}
virtual StatusCode deregObject(const std::string &objName, const std::string &system, Interval_t interval)
De-registers a TObject from the THistSvc, but does NOT delete the object.

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ DQCheckMDTSegments()

void MdtVsTgcRawDataValAlg::DQCheckMDTSegments ( std::vector< const Muon::MuonSegment * >(&) sortedSegments[2][4],
std::vector< const Muon::MuonSegment * >(&) disqualifiedSegments[2][4] )
private

Definition at line 34 of file MdtVsTgcRawData_SegmDQ.cxx.

35 {
36 // Define Cuts:
37 // Cut for miniumum number of measurements necessary to use Segments
38 const int nMeasCutMdt[4] = { 4, 2, 4, 5}; //[MDTStation]
39 const int nMeasCutTgcStrip[4] = { 0, 0, 1, 0}; //[MDTStation]
40 // Cut for differences between direction and position vectors
41 const float dPhiCutPosDir[4] = {0.05,0.05,0.08,0.1 };
42 const float dTheCutPosDir[4] = { 0.2, 0.4, 0.6,0.5 };
43
44 // Loop over sides
45 for(int i=0;i<2;i++){// AC
46 bool skipSegm;int nDisqualifiedSegm; // used when checking the disqualified list for a segment
47 bool segmDisqual; // used to flag a segment which has been found DQ insufficient
48 //bool HasStationDQSegm[4] = {false, false, false, false};// flags for whether the there are segments in each MDT station with sufficienct DQ
49
50 for(int jMDT=0;jMDT<4;jMDT++){// MDT Stations
51 // Get number of segments
52 int nSegm=sortedSegments[i][jMDT].size();
53
54 // Loop over segments in this MDT Station
55 for(int n=0; n<nSegm;n++){
56 segmDisqual = false;// set disqualified flag to false
57 // Get segment
58 const Muon::MuonSegment *segm=sortedSegments[i][jMDT].at(n);
59 if(segm==nullptr)continue;// Cut empty entries
60
61 // Check disqualifiedSegments for current segment
62 skipSegm=false;
63 nDisqualifiedSegm=disqualifiedSegments[i][jMDT].size();
64 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm==disqualifiedSegments[i][jMDT].at(ndis))skipSegm=true;
65 if(skipSegm)continue;
66
68 // Apply nHits cuts to segments
70 int stationName=0;
71 int nMdtMeas = 0; // nMDTHits in this Segment
72 int nTgcMeas[2] = {0,0};// [WireStrip] nTGCHits in this Segment
73
74 // Loop through contained ROTs and identify used stations
75 for(unsigned int iROT=0; iROT<segm->numberOfContainedROTs(); ++iROT) {
76 const Trk::RIO_OnTrack* rio = segm->rioOnTrack(iROT);
77 if(!rio){
78 ATH_MSG_DEBUG("no RIO");
79 continue;
80 }
81 Identifier id = rio->identify();
82 stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
83 int isStrip = m_idHelperSvc->tgcIdHelper().isStrip(id);
84
85 if((stationName==41)||(stationName==42))nTgcMeas[isStrip]++;// TGC
86 if((stationName==43)||(stationName==44))nTgcMeas[isStrip]++;// TGC
87 if((stationName==45)||(stationName==46))nTgcMeas[isStrip]++;// TGC
88 if((stationName==47)||(stationName==48))nTgcMeas[isStrip]++;// TGC
89
90 if((stationName==13)||(stationName==49))nMdtMeas++;// MDT
91 if((stationName==14)||(stationName==15))nMdtMeas++;// MDT
92 if((stationName==17)||(stationName==18))nMdtMeas++;// MDT
93 if((stationName==20)||(stationName==21))nMdtMeas++;// MDT
94 }
95
96 // Cut Segments with insufficient numbers of hits in the stations
97 if(nMdtMeas<nMeasCutMdt[jMDT]||nTgcMeas[1]<nMeasCutTgcStrip[jMDT]){
98 segmDisqual = true;
99 }
100
102 // Apply Direction-Position cuts to segments
104 // Get Position and Direction Variables
105 // const Trk::GlobalPosition segmGlobalPos = segm->globalPosition();
106 const Amg::Vector3D segmGlobalPos = segm->globalPosition();
107
108 float segmPosPhi = segmGlobalPos.phi();
109 float segmPosThe = segmGlobalPos.theta();
110 if(segmPosPhi<0) segmPosPhi+=2*M_PI;
111 if(segmPosThe>M_PI/2) segmPosThe=M_PI-segmPosThe;
112 //const Trk::GlobalDirection segmGlobalDir = segm->globalDirection();
113 const Amg::Vector3D segmGlobalDir = segm->globalDirection();
114
115 float segmDirPhi = segmGlobalDir.phi();
116 float segmDirThe = segmGlobalDir.theta();
117 if(segmDirPhi<0) segmDirPhi+=2*M_PI;
118 if(segmDirThe>M_PI/2) segmDirThe=M_PI-segmDirThe;
119
120 // Get Differences between Position and Direction vectors
121 float dPhi_Pos_Dir = segmPosPhi-segmDirPhi;
122 float dThe_Pos_Dir = segmPosThe-segmDirThe;
123 if(dPhi_Pos_Dir<-M_PI)dPhi_Pos_Dir+=2*M_PI;
124 if(dPhi_Pos_Dir> M_PI)dPhi_Pos_Dir-=2*M_PI;
125
126 if(!segmDisqual){
127 if(m_mdt_segmposdirsag[i][jMDT][2]) m_mdt_segmposdirsag[i][jMDT][2]->Fill(dPhi_Pos_Dir);
128 if(m_mdt_segmposdirsag[i][jMDT][3]) m_mdt_segmposdirsag[i][jMDT][3]->Fill(dThe_Pos_Dir);
129 }
130
131 // Cut Segments with too great a difference between position and direction vectors
132 if(std::abs(dPhi_Pos_Dir)>dPhiCutPosDir[jMDT]||std::abs(dThe_Pos_Dir)>dTheCutPosDir[jMDT]){
133 segmDisqual = true;
134 }
135
137 // Add disqualified segments to the disqualified list
139 if(segmDisqual){
140 disqualifiedSegments[i][jMDT].push_back(segm);
141 }
142 else{
143 //HasStationDQSegm[jMDT]=true;// Flag event as having a DQ sufficient segment in the current station
144 }
145 }// Segments in station
146 }// MDT Stations
147 }// AC
148
149 return;
150}// End of function
const Trk::RIO_OnTrack * rioOnTrack(unsigned int) const
returns the RIO_OnTrack (also known as ROT) objects depending on the integer
virtual const Amg::Vector3D & globalPosition() const override final
global position

◆ endOfEventsBlockFlag()

bool ManagedMonitorToolBase::endOfEventsBlockFlag ( ) const
inlineprotectedinherited

Definition at line 794 of file ManagedMonitorToolBase.h.

◆ endOfLowStatFlag()

bool ManagedMonitorToolBase::endOfLowStatFlag ( ) const
inlineprotectedinherited

Definition at line 795 of file ManagedMonitorToolBase.h.

◆ endOfLumiBlockFlag()

bool ManagedMonitorToolBase::endOfLumiBlockFlag ( ) const
inlineprotectedinherited

Definition at line 796 of file ManagedMonitorToolBase.h.

◆ endOfRunFlag()

bool ManagedMonitorToolBase::endOfRunFlag ( ) const
inlineprotectedinherited

Definition at line 797 of file ManagedMonitorToolBase.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillHistograms()

StatusCode MdtVsTgcRawDataValAlg::fillHistograms ( )
virtual

An inheriting class should either override this function or fillHists().

Reimplemented from ManagedMonitorToolBase.

Definition at line 155 of file MdtVsTgcRawDataValAlg.cxx.

155 {
156/*----------------------------------------------------------------------------------*/
157 ATH_MSG_DEBUG( "MdtVsTgcRawDataValAlg::TGC RawData Monitoring Histograms being filled" );
158
159 //TGC PRD
160 SG::ReadHandle<Muon::TgcPrepDataContainer> tgc_prd_container(m_tgc_PrepDataContainerName);
161
162 //TGC Coincidence
163 SG::ReadHandle<Muon::TgcCoinDataContainer> tgc_coin_container(m_tgc_CoinContainerName);
164
165 ATH_MSG_DEBUG( "size of tgc container is " << tgc_coin_container -> size() );
166
167 //MDT PRD
168 SG::ReadHandle<Muon::MdtPrepDataContainer> mdt_prd_container(m_mdt_PrepDataContainerName);
169
170 SG::ReadHandle<xAOD::MuonSegmentContainer> mdt_segment_collection(m_mdt_SegmentCollectionName) ;
171 tgceffcalc(mdt_segment_collection.cptr(), tgc_prd_container.cptr());
172 maphists(mdt_segment_collection.cptr(), tgc_prd_container.cptr());
173
174 //only analyze nSL==1
175 int nSL = numberOfSL(tgc_coin_container.cptr());
176
177 if(nSL==1){
178 //fill MDT hit vs TGC RoI
179 correlation(mdt_prd_container.cptr(), tgc_coin_container.cptr());
180 }
181
182
183 return StatusCode::SUCCESS; // statuscode check
184}
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_tgc_PrepDataContainerName
void correlation(const Muon::MdtPrepDataContainer *mdt_hit_container, const Muon::TgcCoinDataContainer *tgc_trigger_container)
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_mdt_SegmentCollectionName
SG::ReadHandleKey< Muon::TgcCoinDataContainer > m_tgc_CoinContainerName
void tgceffcalc(const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void maphists(const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
int numberOfSL(const Muon::TgcCoinDataContainer *tgctrgcontainer)
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdt_PrepDataContainerName

◆ fillHists()

StatusCode ManagedMonitorToolBase::fillHists ( )
virtualinherited

Calls fillHists( bool, bool, bool ); if an eventBlock,lumiBlock, or run has turned over, calls procHists( bool, bool, bool ) and bookHists( bool, bool, bool ).

Implements IMonitorToolBase.

Reimplemented in TileDigitsMonTool, and TileRawChannelMonTool.

Definition at line 739 of file ManagedMonitorToolBase.cxx.

741{
742
743 if (m_d->m_warnAboutMissingInitialize) {
744 m_d->m_warnAboutMissingInitialize = false;
745 msg(MSG::WARNING) << "ManagedMonitorToolBase::initialize() never called from reimplementation!" << endmsg;
746 }
747
748
749 bool isNewEventsBlock = ( m_procNEventsProp > 0 && ((m_nEvents % m_procNEventsProp) == 1) && m_haveClearedLastEventBlock );
750 if (isNewEventsBlock) m_haveClearedLastEventBlock = false;
751
752 m_newLowStat = false;
753 m_newLumiBlock = false;
754 m_newRun = false;
755 newLowStat = false;
756 newLumiBlock = false;
757 newRun = false;
758
759 m_newLowStatInterval = false;
760 m_newMedStatInterval = false;
761 m_newHigStatInterval = false;
762 newLowStatInterval = false;
763 newMedStatInterval = false;
764 newHigStatInterval = false;
765
766 m_useTrigger = ( (m_triggerChainProp != "" || m_triggerGroupProp != "") && (!m_trigDecTool.empty()) );
767
768 if( m_manager != 0 ) {
769 m_newLumiBlock = ( (m_lastLumiBlock != m_manager->lumiBlockNumber()) || m_manager->forkedProcess());
770 m_newRun = ( m_lastRun != m_manager->runNumber() );
771 newLumiBlock = m_newLumiBlock;
772 newRun = m_newRun;
773
774 if(m_newRun) {
775 m_newLumiBlock = true;
776 newLumiBlock = m_newLumiBlock;
777 isNewEventsBlock = true;
778 }
779
780 m_newEventsBlock = isNewEventsBlock;
781 newEventsBlock = m_newEventsBlock;
782
783 if( m_newLumiBlock ) {
784 // check if a new LB interval has started
785 // lowest lumiBlockNumber() is 1
786 // m_lastLowStatInterval is -1 initially
787 int currentLB = m_manager->lumiBlockNumber();
788 int LBsLowStat = m_manager->getLBsLowStat();
789 int LBsMedStat = m_manager->getLBsMedStat();
790 int LBsHigStat = m_manager->getLBsHigStat();
791
792 if( LBsLowStat*LBsMedStat*LBsHigStat == 0) {
793 msg(MSG::WARNING) << "zero LBs requested for interval" << endmsg;
794 }
795 else {
796 if( ((currentLB-1)/LBsLowStat) != m_lastLowStatInterval ) m_newLowStatInterval = true;
797 if( ((currentLB-1)/LBsMedStat) != m_lastMedStatInterval ) m_newMedStatInterval = true;
798 if( ((currentLB-1)/LBsHigStat) != m_lastHigStatInterval ) m_newHigStatInterval = true;
799 newLowStatInterval = m_newLowStatInterval;
800 newMedStatInterval = m_newHigStatInterval;
801 newHigStatInterval = m_newHigStatInterval;
802 }
803 }
804
805 // Allow inheriting classes the option of using the lastLumiBloc/lastRun values
806 // before updating them
807 }
808
809
810 StatusCode sc0( StatusCode::SUCCESS );
811 StatusCode sc1( StatusCode::SUCCESS );
812 StatusCode sc2( StatusCode::SUCCESS );
813 StatusCode sc3( StatusCode::SUCCESS );
814
815 // Set end of LowStat, LumiBlock and Run variables
816 // These are needed to be used in procHistograms().
821 endOfEventsBlock = m_newEventsBlock;
822 endOfLowStat = m_newLowStatInterval;
823 endOfLumiBlock = m_newLumiBlock;
825
826 // just duplicates m_newLowStatInterval
828 newLowStat = m_newLowStatInterval;
829
831 ATH_MSG_DEBUG("Interval transition processing");
832 // Process histograms from the previous lumiBlock/run
833 if( m_nEvents != 1 ) {
834 m_d->benchPreProcHistograms();
835 sc0 = procHistograms();
836 m_d->benchPostProcHistograms();
837 }
838 // Re-book new histograms
839 m_d->benchPreBookHistograms();
840
842 sc1 = bookHistograms();
844 } else {
845 std::vector<Interval_t> intervals_to_process;
846 if (m_newEventsBlock) intervals_to_process.push_back(eventsBlock);
847 if (m_newLumiBlock) intervals_to_process.push_back(lumiBlock);
848 if (m_newLowStatInterval) intervals_to_process.push_back(lowStat);
849 if (m_newRun) intervals_to_process.push_back(run);
850 for (const auto interval: intervals_to_process) {
852 sc1 = regManagedGraphs(m_templateGraphs[interval]);
853 sc1 = regManagedTrees(m_templateTrees[interval]);
854 }
855 }
856 for (const auto& interval: std::vector<Interval_t>{ eventsBlock, lumiBlock, lowStat, run }) {
857 for (const auto& it: m_templateHistograms[interval]) {
858 // is histogram too small in x axis for LB range?
859 if (it.m_group.histo_mgmt() == ATTRIB_X_VS_LB) {
860 //ATH_MSG_WARNING("We are rebinning for " << it.m_templateHist->GetName());
861 while ( it.m_templateHist->GetXaxis()->GetXmax() <= AthenaMonManager::lumiBlockNumber() ) {
862 it.m_templateHist->LabelsInflate("X");
863 }
864 }
865 }
866 for (auto& it: m_templateEfficiencies[interval]) {
867 if (it.m_group.histo_mgmt() == ATTRIB_X_VS_LB) {
868 // get the underlying passed and total TH1's from the TEfficiency
869 TH1* passedHist = it.m_templateHist->GetCopyPassedHisto();
870 TH1* totalHist = it.m_templateHist->GetCopyTotalHisto();
871 // inflate them until they exceed the lumi-block number
872 while (passedHist->GetXaxis()->GetXmax() <= AthenaMonManager::lumiBlockNumber() ) {
873 passedHist->LabelsInflate("X");
874 totalHist->LabelsInflate("X");
875 }
876 // Replace them in the TEfficiency. First one has force ("f") option, since the
877 // histograms will not be consistent. This is corrected in the next line, so we
878 // do check for consistency then.
879 it.m_templateHist->SetPassedHistogram(*passedHist, "f");
880 it.m_templateHist->SetTotalHistogram(*totalHist, " ");
881 delete passedHist; // not owned by THistSvc, so need to be deleted.
882 delete totalHist;
883 }
884 }
885 }
886
887 if (auto streamname = dynamic_cast<OfflineStream*>(streamNameFunction())) {
888 streamname->updateRunLB();
889 }
890
892
893 m_d->benchPostBookHistograms();
894
895 }//end if new RUN/LB/Block
896
897 // check filters
898 bool filterresult(true);
899 if (! m_DQFilterTools.empty()) {
900 ToolHandleArray<IDQFilterTool>::const_iterator ifilter(m_DQFilterTools.begin()), filterend(m_DQFilterTools.end());
901 for (; filterresult && (ifilter != filterend);
902 ++ifilter) {
903 filterresult = (filterresult && (*ifilter)->accept());
904 }
905 }
906
907
908 // ...and fill as normal
909 if(filterresult &&
913 ATH_MSG_DEBUG("Passed trigger, presumably");
914 m_d->benchPreFillHistograms();
915 fillHistograms().ignore();
917 m_d->benchPostFillHistograms();
918 ++m_nEvents;
919 } else { ATH_MSG_DEBUG("Failed trigger, presumably"); }
920
922 if( m_newLumiBlock && (m_nEventsIgnoreTrigger != 1) ) {
924 }
925 if( m_manager != 0 ) {
926 m_lastRun = m_manager->runNumber();
927 if( m_newLumiBlock ) {
928 m_lastLumiBlock = m_manager->lumiBlockNumber();
929
930 int LBsLowStat = m_manager->getLBsLowStat();
931 int LBsMedStat = m_manager->getLBsMedStat();
932 int LBsHigStat = m_manager->getLBsHigStat();
933 if( LBsLowStat*LBsMedStat*LBsHigStat > 0) {
937 }
938 }
939 }
940
941 return StatusCode::SUCCESS;
942}
#define endmsg
MsgStream & msg() const
static unsigned int lumiBlockNumber()
StatusCode regManagedTrees(std::vector< MgmtParams< TTree > > &templateTrees)
ToolHandleArray< IDQFilterTool > m_DQFilterTools
virtual StatusCode bookHistogramsRecurrent()
An inheriting class should either override this function, bookHists() or bookHistograms().
std::vector< std::string > m_vTrigGroupNames
std::map< Interval_t, std::vector< MgmtParams< TH1 > > > m_templateHistograms
virtual StatusCode fillHistograms()
An inheriting class should either override this function or fillHists().
PublicToolHandle< Trig::ITrigDecisionTool > m_trigDecTool
StatusCode regManagedGraphs(std::vector< MgmtParams< TGraph > > &templateGraphs)
std::map< Interval_t, std::vector< MgmtParams< TGraph > > > m_templateGraphs
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
std::vector< std::string > m_vTrigChainNames
std::map< Interval_t, std::vector< MgmtParams< TTree > > > m_templateTrees
std::map< Interval_t, std::vector< MgmtParams< TEfficiency > > > m_templateEfficiencies
virtual StatusCode procHistograms()
An inheriting class should either override this function or finalHists().
StatusCode regManagedHistograms(std::vector< MgmtParams< TH1 > > &templateHistograms)
virtual bool trigChainsArePassed(std::vector< std::string > &)
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ finalHists()

StatusCode ManagedMonitorToolBase::finalHists ( )
virtualinherited

Calls procHists( true, true, true ).

Implements IMonitorToolBase.

Reimplemented in TileCellNoiseMonTool, TileDigitsMonTool, and TileRawChannelMonTool.

Definition at line 1254 of file ManagedMonitorToolBase.cxx.

1256{
1257
1258 // This assumes that the end of a file will naturally end a run, which is not always true.
1259 // A merging application run afterwards should be able to put parts of a run together.
1260 if( m_nEvents != 1 ) {
1261 m_d->benchPreProcHistograms();
1262
1263 // Set end flags for the LowStat, LumiBlock and Run variables.
1264 // This is needed to be used in the procHistograms method below.
1265 m_endOfEventsBlock = true;
1266 m_endOfLowStat = true;
1267 m_endOfLumiBlock = true;
1268 m_endOfRun = true;
1269 endOfEventsBlock = true;
1270 endOfLowStat = true;
1271 endOfLumiBlock = true;
1272 endOfRun = true;
1273
1275
1276 m_d->benchPostProcHistograms();
1277 return sc;
1278 }
1279 return StatusCode::SUCCESS;
1280}
static Double_t sc

◆ get_nEvents()

unsigned int ManagedMonitorToolBase::get_nEvents ( ) const
inlineprotectedinherited

Definition at line 692 of file ManagedMonitorToolBase.h.

692 {
693 return m_nEvents;
694 }

◆ get_procNEventsProp()

long ManagedMonitorToolBase::get_procNEventsProp ( ) const
inlineprotectedinherited

Definition at line 696 of file ManagedMonitorToolBase.h.

696 {
697 return m_procNEventsProp;
698 }

◆ getHist() [1/4]

StatusCode ManagedMonitorToolBase::getHist ( TH1 *& h,
const std::string & hName,
const MonGroup & group )
virtualinherited

Returns a TH1 via the pointer passed as the first argument.

The histogram name, without the leading path or stream name, must be given as the second argument.

Definition at line 1417 of file ManagedMonitorToolBase.cxx.

1419{
1420 std::string streamName = streamNameFunction()->getStreamName( this, group, hName );
1421 return m_THistSvc->getHist( streamName, h );
1422}

◆ getHist() [2/4]

StatusCode ManagedMonitorToolBase::getHist ( TH1 *& h,
const std::string & hName,
const std::string & system,
Interval_t interval )
virtualinherited

Returns a TH1 via the pointer passed as the first argument.

The histogram name, without the leading path or stream name, must be given as the second argument.

Definition at line 1407 of file ManagedMonitorToolBase.cxx.

1410{
1411 MonGroup group( this, system, interval );
1412 return getHist( h, hName, group );
1413}
virtual StatusCode getHist(TH1 *&h, const std::string &hName, const std::string &system, Interval_t interval)
Returns a TH1 via the pointer passed as the first argument.

◆ getHist() [3/4]

StatusCode ManagedMonitorToolBase::getHist ( TH2 *& h,
const std::string & hName,
const MonGroup & group )
virtualinherited

Returns a TH2 via the pointer passed as the first argument.

The histogram name, without the leading path or stream name, must be given as the second argument.

Definition at line 1436 of file ManagedMonitorToolBase.cxx.

1438{
1439 std::string streamName = streamNameFunction()->getStreamName( this, group, hName );
1440 return m_THistSvc->getHist( streamName, h );
1441}

◆ getHist() [4/4]

StatusCode ManagedMonitorToolBase::getHist ( TH2 *& h,
const std::string & hName,
const std::string & system,
Interval_t interval )
virtualinherited

Returns a TH2 via the pointer passed as the first argument.

The histogram name, without the leading path or stream name, must be given as the second argument.

Definition at line 1426 of file ManagedMonitorToolBase.cxx.

1429{
1430 MonGroup group( this, system, interval );
1431 return getHist( h, hName, group );
1432}

◆ getNewStreamNameFcn()

ManagedMonitorToolBase::StreamNameFcn * ManagedMonitorToolBase::getNewStreamNameFcn ( ) const
protectedvirtualinherited

Definition at line 2155 of file ManagedMonitorToolBase.cxx.

2157{
2158 StreamNameFcn* fcn(0);
2159
2160 switch( m_environment ) {
2162 fcn = new NoOutputStream();
2163 break;
2165 fcn = new OnlineStream();
2166 break;
2168 fcn = new DefaultStream( m_fileKey );
2169 break;
2175 default:
2177 }
2178
2179 return fcn;
2180}
A function-object base class allowing the specific implementation of getStreamName to be decided at r...
AthenaMonManager::Environment_t m_environment
AthenaMonManager::DataType_t m_dataType

◆ getStationMapIndex()

int MdtVsTgcRawDataValAlg::getStationMapIndex ( int x,
int l,
int stationFE,
int stationEta,
int stationPhi )
private

Definition at line 259 of file MdtVsTgcRawData_TGCEffCheck.cxx.

259 {
260 // Display error messages if invalid TRE variables are passed in
261 if((stationFE!=0)&&(stationFE!=1)) ATH_MSG_WARNING( "getStationMapIndex passed invalid stationFE=" << stationFE );
262 if((l<0)||(l>8)) ATH_MSG_WARNING( "getStationMapIndex passed invalid layer index l=" << l );
263 if(stationEta<1) ATH_MSG_WARNING( "getStationMapIndex passed invalid stationEta=" << stationEta );
264 if(stationPhi<1) ATH_MSG_WARNING( "getStationMapIndex passed invalid stationPhi=" << stationPhi );
265 int index=0;
266 switch(x){
267 case 1:// Getting Eta Index //use old eta bin
268 if(l==0||l==1||l==2){// T1
269 if(stationEta>4) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " stationEta=" << stationEta );
270 if(stationFE==0)index=32+l;
271 else{
273 index=index*7+l;
274 }
275 }
276 else if(l==3||l==4){// T2
277 if(stationEta>5) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " stationEta=" << stationEta );
278 if(stationFE==0)index=32+l;
279 else {
281 index=index*7+l;
282 if(stationEta==1)index=25+l;
283 }
284 }
285 else if(l==5||l==6){// T3
286 if(stationEta>5) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " stationEta=" << stationEta );
287 if(stationFE==0)index=32+l;
288 else{
290 index=index*7+l;
291 if(stationEta==1)index=25+l;
292 }
293 }
294 else if(l==7||l==8){// T4
295 if(stationEta>1) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " stationEta=" << stationEta );
296 if(stationFE==0){
297 if(l==7){index=41;}
298 else if(l==8){index=42;}
299 }else{
300 if(l==7){index=39;}
301 else if(l==8){index=40;}
302 }
303 }
304 break;
305 case 2:// Getting Phi Index
306 if(stationFE==0){// Forward
307 if((l==7)||(l==8)){// FI
308 if(stationPhi>24) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " FE=" << stationFE << " stationPhi=" << stationPhi );
309 index=(stationPhi-1)*2;
310 }
311 else{// Forward Midstation
312 if(stationPhi>24) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " FE=" << stationFE << " stationPhi=" << stationPhi );
313 index=(stationPhi-1)*2;
314 }
315 }
316 else{// Endcap
317 if((l==7)||(l==8)){// EI
318 if(stationPhi>21) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " FE=" << stationFE << " stationPhi=" << stationPhi );
319 index=(stationPhi-1);
320 if(index>7)index++;
321 if(index>15)index++;
322 if(index>19)index++;
323 index*=2;
324 }
325 else{// Endcap Midstation
326 if(stationPhi>48) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " FE=" << stationFE << " stationPhi=" << stationPhi );
328 }
329 }
330 // Adjust to set A01phi0(stationPhi=47 for Midstation)at 0
331 index+=2;
332 if(index>47)index-=48;
333 break;
334 default:
335 ATH_MSG_WARNING( "getStationMapIndex(" << x << ") is invalid" );
336 break;
337 }
338 return index;
339}// End of function
str index
Definition DeMoScan.py:362

◆ initialize()

StatusCode MdtVsTgcRawDataValAlg::initialize ( )
virtual

Reimplemented from ManagedMonitorToolBase.

Definition at line 98 of file MdtVsTgcRawDataValAlg.cxx.

98 {
100 ATH_MSG_INFO( "in initializing MdtVsTgcRawDataValAlg" );
101 // MuonDetectorManager from the conditions store
102 ATH_CHECK(m_DetectorManagerKey.initialize());
103 ATH_CHECK(m_idHelperSvc.retrieve());
104
105 //MDT z position
106 //Name MultiLayer TubeLayer z
107 //17 1 1 14142.5
108 //17 1 2 14168.5
109 //17 1 3 14194.5
110 //17 2 1 14394.6
111 //17 2 2 14420.6
112 //17 2 3 14446.6
113 //18 1 1 13726.5
114 //18 1 2 13752.5
115 //18 1 3 13778.5
116 //18 2 1 13978.6
117 //18 2 2 14004.6
118 //18 2 3 14030.6
119
120 // Retrieve the MuonDetectorManager
121 const MuonGM::MuonDetectorManager* MuonDetMgrDS=nullptr;
122 ATH_CHECK( detStore()->retrieve(MuonDetMgrDS) );
123 ATH_MSG_DEBUG( " Found the MuonDetectorManager from detector store. " );
124 prepareTREarray(MuonDetMgrDS);
129 return StatusCode::SUCCESS;
130}
const ServiceHandle< StoreGateSvc > & detStore() const
void prepareTREarray(const MuonGM::MuonDetectorManager *MuonDetMgrDS)
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & IMonitorToolBase::interfaceID ( )
inlinestaticinherited

Definition at line 29 of file IMonitorToolBase.h.

29{ return IID_IMonitorToolBase; }
static const InterfaceID IID_IMonitorToolBase("IMonitorToolBase", 1, 0)

◆ intervalEnumToString()

std::string ManagedMonitorToolBase::intervalEnumToString ( Interval_t interval)
staticinherited

Converts a LevelOfDetail_t to a string of the same name.

Converts a string to the corresponding LevelOfDetail_t. Converts a Interval_t to a string of the same name.

Definition at line 535 of file ManagedMonitorToolBase.cxx.

537{
538 std::string str("file");
539
540 switch( interval ) {
541 case all:
542 str = "all";
543 break;
544 case fill:
545 str = "fill";
546 break;
547 case run:
548 str = "run";
549 break;
550 case lowStat:
551 str = "lowStat";
552 break;
553 case medStat:
554 str = "medStat";
555 break;
556 case higStat:
557 str = "higStat";
558 break;
559 case lumiBlock:
560 str = "lumiBlock";
561 break;
562 case eventsBlock:
563 str = "eventsBlock";
564 break;
565 case file:
566 str = "file";
567 break;
568 default:
569 str = "unknown";
570 }
571
572 return str;
573}

◆ intervalStringToEnum()

ManagedMonitorToolBase::Interval_t ManagedMonitorToolBase::intervalStringToEnum ( const std::string & str)
staticinherited

Converts a string to the corresponding Interval_t.

Definition at line 577 of file ManagedMonitorToolBase.cxx.

579{
580 std::string lcstr( strToLower(str) );
581
582 if( lcstr == "all" )
583 return all;
584 else if( lcstr == "fill" )
585 return fill;
586 else if( lcstr == "run" )
587 return run;
588 else if( lcstr == "lowStat" )
589 return lowStat;
590 else if( lcstr == "medStat" )
591 return medStat;
592 else if( lcstr == "higStat" )
593 return higStat;
594 else if( lcstr == "lumiBlock" )
595 return lumiBlock;
596 else if( lcstr == "eventsBlock" )
597 return eventsBlock;
598 else if( lcstr == "file" )
599 return file;
600
601 if( Imp::s_svcLocator ) {
602 SmartIF<IMessageSvc> ms{Imp::s_svcLocator.load()->service( "MessageSvc" )};
603 if( ms.isValid() ) {
604 MsgStream log( ms, "ManagedMonitorToolBase::intervalStringToEnum()" );
605 log << MSG::WARNING << "Unknown ManagedMonitorToolBase::Interval_t \""
606 << str << "\", returning \"file\"" << endmsg;
607 }
608 }
609
610 return file;
611}
static std::atomic< ISvcLocator * > s_svcLocator

◆ labelStationMap()

void MdtVsTgcRawDataValAlg::labelStationMap ( TH2 * h2,
int i = -1,
int k = -1 )
private

Definition at line 397 of file MdtVsTgcRawData_bookhistograms.cxx.

397 {
398 // Blank non-existent chambers
399 BlankStationMap(h2,ws);
400
401 std::stringstream sst;
402 std::string AC[2]={"A","C"};
403 int nChambers[9]={5,5,5,6,6,6,6,2,2};
404 std::string chamber1[6]={"E1", "E2", "E3", "E4", "F"};
405 std::string chamber3[6]={"E1", "E2", "E3", "E4", "E5", "F"};
406 std::string chamberE[2]={"EI", "FI"};
407
408 bool rebin=true;
409 // Name StationEtas/Layers
410 int ibin=1;
411 if(rebin){//use new bin
412 for(int l=0 ; l<9 ; l++ ){// Layer
413 //cppcheck-suppress negativeIndex
414 for( int c=0 ; c<nChambers[l] ; c++ ){// Chamber
415 sst << "L" << l+1 << "_";
416 if(nChambers[l]==5)sst<<chamber1[c];
417 else if(nChambers[l]==6)sst<<chamber3[c];
418 else if(nChambers[l]==2)sst<<chamberE[c];
419 if(l+1>0 && l+1<=3 && c+1<5)ibin=7*c+(l+1);
420 else if(l+1>3 && l+1<=7 && c+1<5)ibin=7*c+(l+1);
421 else if(l+1>3 && l+1<=7 && c+1==5)ibin=25+(l+1);
422 else if(l+1==1 && c+1==5)ibin=33;
423 else if(l+1==2 && c+1==5)ibin=34;
424 else if(l+1==3 && c+1==5)ibin=35;
425 else if(l+1==4 && c+1==6)ibin=36;
426 else if(l+1==5 && c+1==6)ibin=37;
427 else if(l+1==6 && c+1==6)ibin=38;
428 else if(l+1==7 && c+1==6)ibin=39;
429 else if(l+1==8 && c+1==1)ibin=40;
430 else if(l+1==8 && c+1==2)ibin=42;
431 else if(l+1==9 && c+1==1)ibin=41;
432 else if(l+1==9 && c+1==2)ibin=43;
433 h2->GetXaxis()->SetBinLabel(ibin, sst.str().c_str());
434 h2->GetXaxis()->SetBit(TAxis::kLabelsVert);
435 sst.str("");
436 }// Chamber
437 }// Layer
438 }else{//use old bin logically dead code, comment out
439// for(int l=0 ; l<9 ; l++ ){// Layer
440// for( int c=0 ; c<nChambers[l] ; c++ ){// Chamber
441// sst << "L" << l+1 << "_";
442// if(nChambers[l]==5)sst<<chamber1[c];
443// else if(nChambers[l]==6)sst<<chamber3[c];
444// else if(nChambers[l]==2)sst<<chamberE[c];
445// h2->GetXaxis()->SetBinLabel(ibin, sst.str().c_str());
446// sst.str(""); ibin++;
447// }// Chamber
448// }// Layer
449// h2->GetXaxis()->LabelsOption("v");
450 }
451 // Name Phi Sectors
452 for(int isec=1;isec<=12;isec++){// Sector
453 for(int iphi=0;iphi<=3;iphi+=4){// Phi number
454 if(ac==0||ac==1)sst << AC[ac];
455 if(isec<10)sst << "0";
456 sst << isec << "phi" << iphi;
457 ibin=(isec-1)*4+iphi+1;
458 h2->GetYaxis()->SetBinLabel(ibin, sst.str().c_str());
459 sst.str("");
460 }// Phi number
461 }// Sector
462}// End of function
void BlankStationMap(TH2 *h2, int ws)

◆ lbAverageInteractionsPerCrossing()

float ManagedMonitorToolBase::lbAverageInteractionsPerCrossing ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
virtualinherited

Average mu, i.e.

<mu>

Definition at line 1691 of file ManagedMonitorToolBase.cxx.

1693{
1694 if (!m_lumiDataKey.empty()) {
1695 SG::ReadCondHandle<LuminosityCondData> lumi (m_lumiDataKey, ctx);
1696 return lumi->lbAverageInteractionsPerCrossing();
1697 } else {
1698 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbAverageInteractionsPerCrossing() can't work properly! ");
1699 ATH_MSG_DEBUG("Warning: lbAverageInteractionsPerCrossing() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1700 return -1.0;
1701 }
1702 // not reached
1703}
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey

◆ lbAverageLivefraction()

float ManagedMonitorToolBase::lbAverageLivefraction ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
virtualinherited

Average luminosity livefraction.

Definition at line 1760 of file ManagedMonitorToolBase.cxx.

1762{
1764 return 1.0;
1765
1766 if (!m_trigLiveFractionDataKey.empty()) {
1767 SG::ReadCondHandle<TrigLiveFractionCondData> live (m_trigLiveFractionDataKey, ctx);
1768 return live->lbAverageLiveFraction();
1769 } else {
1770 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbAverageLivefraction() can't work properly! ");
1771 ATH_MSG_DEBUG("Warning: lbAverageLivefraction() - luminosity not availble (i.e. EnableLumi = False)");
1772 return -1.0;
1773 }
1774 // not reached
1775}
SG::ReadCondHandleKey< TrigLiveFractionCondData > m_trigLiveFractionDataKey

◆ lbAverageLuminosity()

float ManagedMonitorToolBase::lbAverageLuminosity ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
virtualinherited

Average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1)

Definition at line 1727 of file ManagedMonitorToolBase.cxx.

1729{
1730 if (!m_lumiDataKey.empty()) {
1731 SG::ReadCondHandle<LuminosityCondData> lumi (m_lumiDataKey, ctx);
1732 return lumi->lbAverageLuminosity();
1733 } else {
1734 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbAverageLuminosity() can't work properly! ");
1735 ATH_MSG_DEBUG("Warning: lbAverageLuminosity() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1736 return -1.0;
1737 }
1738 // not reached
1739}

◆ lbDuration()

double ManagedMonitorToolBase::lbDuration ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
virtualinherited

Luminosity block time (in seconds)

Definition at line 1814 of file ManagedMonitorToolBase.cxx.

1816{
1818 return m_defaultLBDuration;
1819 }
1820 if (!m_lbDurationDataKey.empty()) {
1821 SG::ReadCondHandle<LBDurationCondData> dur (m_lbDurationDataKey, ctx);
1822 return dur->lbDuration();
1823 } else {
1824 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbDuration() can't work properly! ");
1825 ATH_MSG_DEBUG("Warning: lbDuration() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1826 return m_defaultLBDuration;
1827 }
1828 // not reached
1829}
SG::ReadCondHandleKey< LBDurationCondData > m_lbDurationDataKey

◆ lbInteractionsPerCrossing()

float ManagedMonitorToolBase::lbInteractionsPerCrossing ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
virtualinherited

Instantaneous number of interactions, i.e.

mu

Definition at line 1707 of file ManagedMonitorToolBase.cxx.

1709{
1710 if (!m_lumiDataKey.empty()) {
1711 SG::ReadCondHandle<LuminosityCondData> lumi (m_lumiDataKey, ctx);
1712 float muToLumi = lumi->muToLumi();
1713 if (muToLumi > 0) {
1714 return lumi->lbLuminosityPerBCIDVector().at (ctx.eventID().bunch_crossing_id()) / muToLumi;
1715 }
1716 return 0;
1717 } else {
1718 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbInteractionsPerCrossing() can't work properly! ");
1719 ATH_MSG_DEBUG("Warning: lbInteractionsPerCrossing() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1720 return -1.0;
1721 }
1722 // not reached
1723}

◆ lbLuminosityPerBCID()

float ManagedMonitorToolBase::lbLuminosityPerBCID ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
virtualinherited

Instantaneous luminosity.

Definition at line 1743 of file ManagedMonitorToolBase.cxx.

1745{
1746 if (!m_lumiDataKey.empty()) {
1747 SG::ReadCondHandle<LuminosityCondData> lumi (m_lumiDataKey, ctx);
1748 return lumi->lbLuminosityPerBCIDVector().at (ctx.eventID().bunch_crossing_id());
1749 } else {
1750 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbLuminosityPerBCID() can't work properly! ");
1751 ATH_MSG_DEBUG("Warning: lbLuminosityPerBCID() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1752 return -1.0;
1753 }
1754 // not reached
1755}

◆ lbLumiWeight()

double ManagedMonitorToolBase::lbLumiWeight ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
virtualinherited

Average Integrated Luminosity Live Fraction.

Definition at line 1798 of file ManagedMonitorToolBase.cxx.

1800{
1801 if (!m_lumiDataKey.empty()) {
1803 } else{
1804 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbLumiWeight() can't work properly! ");
1805 ATH_MSG_DEBUG("Warning: lbLumiWeight() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1806 return -1.0;
1807 }
1808 // not reached
1809}
virtual float lbAverageLivefraction(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Average luminosity livefraction.
virtual float lbAverageLuminosity(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1)
virtual double lbDuration(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Luminosity block time (in seconds)

◆ livefractionPerBCID()

float ManagedMonitorToolBase::livefractionPerBCID ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
virtualinherited

Livefraction per bunch crossing ID.

Definition at line 1779 of file ManagedMonitorToolBase.cxx.

1781{
1783 return 1.0;
1784
1785 if (!m_trigLiveFractionDataKey.empty()) {
1786 SG::ReadCondHandle<TrigLiveFractionCondData> live (m_trigLiveFractionDataKey, ctx);
1787 return live->l1LiveFractionVector().at (ctx.eventID().bunch_crossing_id());
1788 } else {
1789 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! livefractionPerBCID() can't work properly! ");
1790 ATH_MSG_DEBUG("Warning: livefractionPerBCID() - luminosity retrieved available (i.e. EnableLumi = False)");
1791 return -1.0;
1792 }
1793 // not reached
1794}

◆ maphists()

void MdtVsTgcRawDataValAlg::maphists ( const xAOD::MuonSegmentContainer * m_newsegment,
const Muon::TgcPrepDataContainer * tgc_prepcontainer )
private

Definition at line 38 of file MdtVsTgcRawData_maptgchits.cxx.

39 {//use new mdt segment
40 ATH_MSG_DEBUG("inside maptgchits" );
41
43 // loop over MDT Segment Collection
44 xAOD::MuonSegmentContainer::const_iterator mdtseg_itr = newsegment->begin();
45 xAOD::MuonSegmentContainer::const_iterator mdtseg_end = newsegment->end();
46 for(; mdtseg_itr!=mdtseg_end; ++mdtseg_itr){
47 if(!(*mdtseg_itr)->muonSegment().isValid())continue;
48 // Get segm
49 const Muon::MuonSegment* segm = dynamic_cast<const Muon::MuonSegment*>(*(*mdtseg_itr)->muonSegment());
50 if (segm == nullptr) {
51 ATH_MSG_ERROR( "no pointer to segm!!!" );
52 break;
53 }
54 // Initialize variables
55 int stationName=0;
56 int nMdtMeas[4] = {0,0,0,0};
57 bool isMdt=false, isEndcap=false;
58
59 // Loop through contained ROTs and count used MDT and TGC stations
60 for(unsigned int i=0;i<segm->numberOfContainedROTs();++i){
61 // Get station information
62 const Trk::RIO_OnTrack* rio = segm->rioOnTrack(i);
63 if(!rio) continue;
64 Identifier id = rio->identify();
65 stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
66 // Flag Segments with ROTs in the MDT & Endcap
67 if(m_idHelperSvc->isMdt(id))isMdt=true;
68 if(m_idHelperSvc->isEndcap(id))isEndcap=true;
69 // If ROT is MDT
70 if((stationName==13)||(stationName==49)){nMdtMeas[0]++;}
71 if((stationName==14)||(stationName==15)){nMdtMeas[1]++;}
72 if((stationName==17)||(stationName==18)){nMdtMeas[2]++;}
73 if((stationName==20)||(stationName==21)){nMdtMeas[3]++;}
74 }
75 if(!isMdt)continue;
76 if(!isEndcap)continue;
77
78 // Establish which MDT stations the Segment is in
79 int nStations = 0;
80 for(int jMDT=0;jMDT<4;jMDT++){
81 if(nMdtMeas[jMDT]){
82 nStations++;
83 }
84 }
85 // Check that the Segment only occupies one Station
86 if(nStations!=1)continue;
87
88 // Get Position pointer and segmAC index
89 const Amg::Vector3D segmGlobalPos = segm->globalPosition();
90 int segmAC = (segmGlobalPos.z()<0);// a:0, c:1
91
92 // Fill MDT data
93 for(int jMDT=0;jMDT<4;jMDT++){// jMDT
94 if(nMdtMeas[jMDT]){// If hits in this Station
95 // Get position variables
96 float segmGlobalEta = std::abs(segmGlobalPos.eta());
97 float segmGlobalPhi = segmGlobalPos.phi();
98 if(segmGlobalPhi<0) segmGlobalPhi+=2*M_PI;
99 // Fill position histogram
100 m_mdt_segmmap[segmAC][jMDT]->Fill(segmGlobalPhi, segmGlobalEta);
101 }// If hits in Station
102 }// jMDT
103 }// MDT Segment Collection
104
106 //loop over TGC Prep Data container
107 Muon::TgcPrepDataContainer::const_iterator tgc_it_end=tgc_prepcontainer->end();
108 for( Muon::TgcPrepDataContainer::const_iterator tgc_it=tgc_prepcontainer->begin();
109 tgc_it!=tgc_it_end;
110 ++tgc_it){
111
112 //loop over TGC Prep Data collection
113 Muon::TgcPrepDataCollection::const_iterator tgc_itc_end=(*tgc_it)->end();
114 for( Muon::TgcPrepDataCollection::const_iterator tgc_itc=(*tgc_it)->begin();
115 tgc_itc!= tgc_itc_end;
116 ++tgc_itc){
117 const Muon::TgcPrepData* tpd=*tgc_itc;
118
119 // Get detector information
120 const MuonGM::TgcReadoutElement *tre = tpd->detectorElement();
121 const std::string tgcStationType = tre->getStationType();
122
123 // Get detector variables
124 Identifier tgcid=(*tgc_itc)->identify();
125 int tgcStationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid);
126
127 // Get position variables
128 const Amg::Vector3D tgcGlobalPos = tpd->globalPosition();
129 float tgcGlobalPhi = tgcGlobalPos.phi();
130 if(tgcGlobalPhi<0)tgcGlobalPhi+=2*M_PI;
131
132 // Cut non-TGC-Endcap
133 if(tgcStationName<41 || tgcStationName>48)continue;
134 }// TGC PRD Collection
135 }// TGC PRD Container
136
137 return;
138}// End of function

◆ maphistsfinalize()

void MdtVsTgcRawDataValAlg::maphistsfinalize ( )
private

Definition at line 141 of file MdtVsTgcRawData_maptgchits.cxx.

141 {
142
143}// End of function

◆ MatchMDTSegments()

void MdtVsTgcRawDataValAlg::MatchMDTSegments ( std::vector< const Muon::MuonSegment * >(&) sortedSegments[2][4],
std::vector< const Muon::MuonSegment * >(&) disqualifiedSegments[2][4],
std::vector< SegmTrack >(&) matchedSegments[2] )
private

Definition at line 33 of file MdtVsTgcRawData_SegmMatching.cxx.

35 {// Define Cuts:
36 // Cut for matching Segments
37 const float dRhoCutSegmentMatching = 1000;
38 const float dPhiCutSegmentMatching = M_PI/8;
39 const float dPhiCutSegmentDirectionChecking[4][4]={{ 0,M_PI/8, 0.1, 0.01},
40 {M_PI/8, 0,M_PI/8,M_PI/8},
41 { 0.06,M_PI/8, 0, 0.01},
42 { 0.05,M_PI/8, 0.05, 0}};
43 const float dTheCutSegmentDirectionChecking[4][4]={{ 0,M_PI/8, 0.05, 0.06},
44 {M_PI/8, 0,M_PI/8,M_PI/8},
45 { 0.04,M_PI/8, 0, 0.005},
46 { 0.02,M_PI/8, 0.005, 0}};
47 // Loop over sides
48 for(int i=0;i<2;i++){// AC
49 bool skipSegm;int nDisqualifiedSegm; // used when checking the disqualified list for a segment
50 //bool HasStationMatchSegm[4] = {false, false, false, false};// flags for whether the there are segments in each MDT station which were included in tracks
51 //bool HasMatchedTrack = false;// flag for whether a track was found on current side
52
53 for(int jMDT1=3;jMDT1>=0;jMDT1--){// MDT Stations in reverse]
54 // Get number of segments
55 int nSegm1=sortedSegments[i][jMDT1].size();
56
57 // Loop over Segments in Station
58 for(int n1=0; n1<nSegm1;n1++){
59 // Get segment
60 const Muon::MuonSegment *segm1 = sortedSegments[i][jMDT1].at(n1);
61
62 // Check disqualifiedSegments for current segment
63 skipSegm=false;
64 nDisqualifiedSegm=disqualifiedSegments[i][jMDT1].size();
65 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm1==disqualifiedSegments[i][jMDT1].at(ndis))skipSegm=true;
66 if(skipSegm)continue;
67
68 // Get position variables
69 const Amg::Vector3D segm1Pos = segm1->globalPosition();
70
71 float segm1PosPhi = segm1Pos.phi();
72 float segm1PosZ = segm1Pos.z();
73 if(segm1PosPhi<0)segm1PosPhi+=2*M_PI;
74 Amg::Vector3D segm1PosZunit(segm1Pos/std::abs(segm1PosZ));
75 Amg::Vector3D segm1Dir = segm1->globalDirection();
76
77 float segm1DirThe = segm1Dir.theta();
78 float segm1DirPhi = segm1Dir.phi();
79 if(segm1DirThe>M_PI/2) segm1DirThe=M_PI-segm1DirThe;
80 if(segm1DirPhi<0) segm1DirPhi+=2*M_PI;
81
82 // Initialise segment matching variables
83 bool stationMatchFound[4] = {false,false,false,false};
84 std::vector<const Muon::MuonSegment*> matchingSegments[4];
85 for(int jMDT2=0;jMDT2<4;jMDT2++)matchingSegments[jMDT2] = std::vector<const Muon::MuonSegment*>();
86 matchingSegments[jMDT1].push_back(segm1);
87 int nStationMatch=0;
88
89 for(int jMDT2=3;jMDT2>=0;jMDT2--){// MDT Station in reverse
90 // Get number of segments
91 int nSegm2=sortedSegments[i][jMDT2].size();
92
93 // Loop over Segments in Station
94 for(int n2=0; n2<nSegm2;n2++){
95 // Get segment
96 const Muon::MuonSegment *segm2 = sortedSegments[i][jMDT2].at(n2);
97 if(segm1==segm2)continue; //do not compare same segments
98
99 // Check disqualifiedSegments for current segment
100 skipSegm = false;
101 nDisqualifiedSegm=disqualifiedSegments[i][jMDT2].size();
102 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm1==disqualifiedSegments[i][jMDT2].at(ndis))skipSegm=true;
103 if(skipSegm)continue;
104
106 // Position Cut
107 // Fill position variables
108 const Amg::Vector3D segm2Pos = segm2->globalPosition();
109
110 float segm2PosRho = std::abs(segm2Pos.perp());
111 float segm2PosPhi = segm2Pos.phi();
112 float segm2PosThe = segm2Pos.theta();
113 float segm2PosZ = segm2Pos.z();
114 if(segm2PosThe>M_PI/2) segm2PosThe=M_PI-segm2PosThe;
115 if(segm2PosPhi<0)segm2PosPhi+=2*M_PI;
116 Amg::Vector3D segm2PosZunit(segm2Pos/std::abs(segm2PosZ));
117
118 // Apply preliminary phi cut between segm1 and segm2 positions
119 float dPhi_Segm1_Segm2 = segm1PosPhi-segm2PosPhi;
120 if(dPhi_Segm1_Segm2<-M_PI)dPhi_Segm1_Segm2+=2*M_PI;
121 if(dPhi_Segm1_Segm2> M_PI)dPhi_Segm1_Segm2-=2*M_PI;
122 if(std::abs(dPhi_Segm1_Segm2)>dPhiCutSegmentMatching)continue;
123
124 // Extrapolate segm1 position to segm2's Z position
125 float dZ = std::abs(segm2PosZ)-std::abs(segm1PosZ);
126 Amg::Vector3D extrPos(segm1Pos+(segm1PosZunit*dZ));
127
128 float extrPosRho = std::abs(extrPos.perp());
129 float extrPosThe = extrPos.theta();
130 float extrPosPhi = extrPos.phi();
131 if(extrPosThe>M_PI/2) extrPosThe=M_PI-extrPosThe;
132 if(extrPosPhi<0)extrPosPhi+=2*M_PI;
133
134 // Get differences between extrapolated and segm2 positions
135 float dRho_Extr_Segm2 = extrPosRho-segm2PosRho;
136 float dPhi_Extr_Segm2 = extrPosPhi-segm2PosPhi;
137 float dThe_Extr_Segm2 = extrPosThe-segm2PosThe;
138 if(dPhi_Extr_Segm2<-M_PI)dPhi_Extr_Segm2+=2*M_PI;
139 if(dPhi_Extr_Segm2> M_PI)dPhi_Extr_Segm2-=2*M_PI;
140
141 // Fill difference histograms
142 if(m_mdt_segmmatchsag[i][jMDT1][jMDT2][0]) m_mdt_segmmatchsag[i][jMDT1][jMDT2][0]->Fill(dRho_Extr_Segm2);
143 if(m_mdt_segmmatchsag[i][jMDT1][jMDT2][2]) m_mdt_segmmatchsag[i][jMDT1][jMDT2][2]->Fill(dPhi_Extr_Segm2);
144 if(m_mdt_segmmatchsag[i][jMDT1][jMDT2][3]) m_mdt_segmmatchsag[i][jMDT1][jMDT2][3]->Fill(dThe_Extr_Segm2);
145
146 // Cut segments (segm2) which are outside difference cuts
147 if(std::abs(dPhi_Extr_Segm2)>dPhiCutSegmentMatching)continue;
148 if(std::abs(dRho_Extr_Segm2)>dRhoCutSegmentMatching)continue;
149
151 // Direction Cut
152 // Fill direction variables
153 //const Trk::GlobalDirection segm2Dir = segm2->globalDirection();
154 const Amg::Vector3D segm2Dir = segm2->globalDirection();
155
156 float segm2DirThe = segm2Dir.theta();
157 float segm2DirPhi = segm2Dir.phi();
158 if(segm2DirThe>M_PI/2) segm2DirThe=M_PI-segm2DirThe;
159 if(segm2DirPhi<0) segm2DirPhi+=2*M_PI;
160
161 // Vector Method
162 // Make vector between segment positions
163 //Trk::GlobalDirection segmVector;
164 Amg::Vector3D segmVector;
165
166 if(jMDT2>jMDT1)segmVector = segm2Pos-segm1Pos;
167 else segmVector = segm1Pos-segm2Pos;
168 float segmVecThe = segmVector.theta();
169 float segmVecPhi = segmVector.phi();
170 if(segmVecThe>M_PI/2) segmVecThe=M_PI-segmVecThe;
171 if(segmVecPhi<0) segmVecPhi+=2*M_PI;
172
173 // Get difference between vector direction and segment directions
174 float dThe_Vec_Segm1 = segmVecThe-segm1DirThe;
175 float dPhi_Vec_Segm1 = segmVecPhi-segm1DirPhi;
176 if(dPhi_Vec_Segm1<-M_PI)dPhi_Vec_Segm1+=2*M_PI;
177 if(dPhi_Vec_Segm1> M_PI)dPhi_Vec_Segm1-=2*M_PI;
178 float dThe_Vec_Segm2 = segmVecThe-segm2DirThe;
179 float dPhi_Vec_Segm2 = segmVecPhi-segm2DirPhi;
180 if(dPhi_Vec_Segm2<-M_PI)dPhi_Vec_Segm2+=2*M_PI;
181 if(dPhi_Vec_Segm2> M_PI)dPhi_Vec_Segm2-=2*M_PI;
182
183 // Fill histograms
184 if(jMDT1>jMDT2){
185 if(m_mdt_trackchecksag[i][jMDT2][jMDT1][2][0]) m_mdt_trackchecksag[i][jMDT2][jMDT1][2][0]->Fill(dPhi_Vec_Segm2);
186 if(m_mdt_trackchecksag[i][jMDT2][jMDT1][3][0]) m_mdt_trackchecksag[i][jMDT2][jMDT1][3][0]->Fill(dThe_Vec_Segm2);
187 if(m_mdt_trackchecksag[i][jMDT2][jMDT1][2][1]) m_mdt_trackchecksag[i][jMDT2][jMDT1][2][1]->Fill(dPhi_Vec_Segm1);
188 if(m_mdt_trackchecksag[i][jMDT2][jMDT1][3][1]) m_mdt_trackchecksag[i][jMDT2][jMDT1][3][1]->Fill(dThe_Vec_Segm1);
189 }
190 else if(jMDT1<jMDT2){
191 if(m_mdt_trackchecksag[i][jMDT1][jMDT2][2][0]) m_mdt_trackchecksag[i][jMDT1][jMDT2][2][0]->Fill(dPhi_Vec_Segm1);
192 if(m_mdt_trackchecksag[i][jMDT1][jMDT2][3][0]) m_mdt_trackchecksag[i][jMDT1][jMDT2][3][0]->Fill(dThe_Vec_Segm1);
193 if(m_mdt_trackchecksag[i][jMDT1][jMDT2][2][1]) m_mdt_trackchecksag[i][jMDT1][jMDT2][2][1]->Fill(dPhi_Vec_Segm2);
194 if(m_mdt_trackchecksag[i][jMDT1][jMDT2][3][1]) m_mdt_trackchecksag[i][jMDT1][jMDT2][3][1]->Fill(dThe_Vec_Segm2);
195 }
196
197 // Direction Comparison Method
198 float dTheDir_Segm1_Segm2 = segm1DirThe-segm2DirThe;
199 float dPhiDir_Segm1_Segm2 = segm1PosPhi-segm2PosPhi;
200 if(dPhiDir_Segm1_Segm2<-M_PI)dPhiDir_Segm1_Segm2+=2*M_PI;
201 if(dPhiDir_Segm1_Segm2> M_PI)dPhiDir_Segm1_Segm2-=2*M_PI;
202 if(m_mdt_trackdirdirsag[i][jMDT1][jMDT2][2]) m_mdt_trackdirdirsag[i][jMDT1][jMDT2][2]->Fill(dTheDir_Segm1_Segm2);
203 if(m_mdt_trackdirdirsag[i][jMDT1][jMDT2][3]) m_mdt_trackdirdirsag[i][jMDT1][jMDT2][3]->Fill(dPhiDir_Segm1_Segm2);
204 // Cut using Vector Method
205 if(dPhi_Vec_Segm1>dPhiCutSegmentDirectionChecking[jMDT1][jMDT2] ||
206 dThe_Vec_Segm1>dTheCutSegmentDirectionChecking[jMDT1][jMDT2] ||
207 dPhi_Vec_Segm2>dPhiCutSegmentDirectionChecking[jMDT2][jMDT1] ||
208 dThe_Vec_Segm2>dTheCutSegmentDirectionChecking[jMDT2][jMDT1]) continue;
209
210 // Match is found, increment counter and assign segm2 to match found array
211 matchingSegments[jMDT2].push_back(segm2);
212 }// nSegms2
213
214 if(matchingSegments[jMDT2].size()==1){
215 stationMatchFound[jMDT2]=true;
216 nStationMatch++;
217 }
218 }// Reverse MDT Stations2
219
220 // If matches found add to matchedSegments and disqualify all segments in array
221 if(nStationMatch>1){
222 //HasMatchedTrack=true;
223 const Muon::MuonSegment *segmArray[4] = {nullptr,nullptr,nullptr,nullptr};
224 for(int jMDT2=0;jMDT2<4;jMDT2++){
225 if(stationMatchFound[jMDT2]){
226 segmArray[jMDT2]=matchingSegments[jMDT2].at(0);
227 //HasStationMatchSegm[jMDT2]=true;
228 disqualifiedSegments[i][jMDT2].push_back(matchingSegments[jMDT2].at(0));
229 }
230 }
231 SegmTrack newTrack(segmArray);
232 matchedSegments[i].push_back(newTrack);
233 }// If Matched Track Found
234
235 }// nSegms1
236 }// Reverse MDT Stations1
237
238 }// AC
239
240 return;
241}// End of function

◆ MidstationOnlyCheck()

void MdtVsTgcRawDataValAlg::MidstationOnlyCheck ( std::vector< const Muon::MuonSegment * >(&) sortedSegments[2][4],
std::vector< const Muon::MuonSegment * >(&) disqualifiedSegments[2][4],
const Muon::TgcPrepDataContainer * tgc_prepcontainer )
private

Definition at line 34 of file MdtVsTgcRawData_MidstationMatching.cxx.

36 {
37 // Define Cuts:
38 // Cut for matching Segments
39 const float dRhoCutSegmentMatching = 1000;
40 const float dPhiCutSegmentMatching = M_PI/8;
41
42 // Cuts for number of Mdt Measurements required for Midstation only track
43 const int nMeasCutMdtMidstation = 5;
44 const int nMeasCutTGCMidPRD[2] = {2,2};
45
46 // Loose cut for PRD and Extrapolated
47 const float dPhiCut_Loose = M_PI/8;
48 // Cut for Global Position Efficiencies
49 const float dPhiCutGlobal[2] = {static_cast<float>(M_PI/24),static_cast<float>(M_PI/12)};//[WireStrip]
50 const float dRhoCutGlobal[2] = { 0.08, 0.5};//[WireStrip]
51 // Cut for Sector Efficiencies
52 const float dPhiCutSector[2] = { 0.2, 0.1};//[WireStrip]
53 const float dRhoCutSector[2] = { 300, 3000};//[WireStrip]
54 // Cut for TgcPrepData comparison
55 const float dPhiCutTPD[2] = { 0.15, 0.02};//[WireStrip]
56 const float dRhoCutTPD[2] = { 150, 3000};//[WireStrip]
57
58 // Loop over sides
59 for(int i=0;i<2;i++){// AC
60 // Number of Segments found which passed all cuts
61 int nValidatedSegm = 0;
62
63 // Following "Fill" variables are only used if one segment passed all cuts
64 // Flags for whether different stations can be checked by the segment
65 //bool canCheckGlobalFill[4] = {0, 0, 0, 0};
66 bool canCheckSectorFill[4] = {0, 0, 0, 0};
67 // Segment Global Position variables
68 // float posThetaFill = 0;
69 // float posPhiFill = 0;
70 // Segment Sector Position
71 int TGCstation_StationFEFill[4] = {-1,-1,-1,-1};// [TGCStation]
72 int TGCstation_StationEtaFill[4] = { 0, 0, 0, 0};// [TGCStation]
73 int TGCstation_StationPhiFill[4] = { 0, 0, 0, 0};// [TGCStation]
74 // Hit registered arrays
75 // bool hitregisteredFill[9][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}};
76 bool sectorhitregisteredFill[9][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}};
77
78 bool skipSegm;int nDisqualifiedSegm; // used when checking the disqualified list for a segment
79
80 // Make copy of disqualifiedSegment vector array
81 std::vector<const Muon::MuonSegment*> copyDisqualifiedSegments;
82 nDisqualifiedSegm=disqualifiedSegments[i][2].size();
83 copyDisqualifiedSegments.reserve(nDisqualifiedSegm);
84for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)copyDisqualifiedSegments.push_back(disqualifiedSegments[i][2].at(ndis));
85
87 // Apply preliminary nMdtMeas Cut
88 int nSegm = sortedSegments[i][2].size();
89 for(int n0=0; n0<nSegm;n0++){
90 // Get segment
91 const Muon::MuonSegment *segm0 = sortedSegments[i][2].at(n0);
92
93 // Check copyDisqualifiedSegments for current segment
94 skipSegm=false;
95 nDisqualifiedSegm=copyDisqualifiedSegments.size();
96 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm0==copyDisqualifiedSegments.at(ndis))skipSegm=true;
97 if(skipSegm)continue;
98
99 // Apply nMDTMeasurements Cut to Segment Collection
100 int stationName = 0;
101 int nMdtMeas = 0;
102 // Loop through contained ROTs and identify used stations
103 for(unsigned int iROT=0; iROT<segm0->numberOfContainedROTs(); ++iROT) {
104 const Trk::RIO_OnTrack* rio = segm0->rioOnTrack(iROT);
105 if(!rio) continue;
106 Identifier id = rio->identify();
107 stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
108
109 if((stationName==17)||(stationName==18))nMdtMeas++;// MDT
110 }
111 // Cut Segments with insufficient numbers of hits in the stations
112 if(nMdtMeas<nMeasCutMdtMidstation){
113 copyDisqualifiedSegments.push_back(segm0);
114 }
115 }
116
117 // Loop over Segments in MidStation
118 for(int n1=0; n1<nSegm;n1++){
120 // Start operation on Segment
121 // Get segment
122 const Muon::MuonSegment *segm1 = sortedSegments[i][2].at(n1);
123
124 // Check copyDisqualifiedSegments for current segment
125 skipSegm=false;
126 nDisqualifiedSegm=copyDisqualifiedSegments.size();
127 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm1==copyDisqualifiedSegments.at(ndis))skipSegm=true;
128 if(skipSegm)continue;
129
130 // Flag for Grouping cut
131 bool failedGroupingCut = false;
132 // Flags for whether different stations can be checked by the segment
133 bool canCheckGlobal[4] = {true, true, true, false};
134 bool canCheckSector[4] = {true, true, true, false};
135
136 // Get position variables
137 //const Trk::GlobalPosition segm1Pos = segm1->globalPosition();
138 const Amg::Vector3D segm1Pos = segm1->globalPosition();
139
140 float segm1PosPhi = segm1Pos.phi();
141 float segm1PosThe = segm1Pos.theta();
142 float segm1PosZ = segm1Pos.z();
143 if(segm1PosPhi<0)segm1PosPhi+=2*M_PI;
144 if(segm1PosThe>M_PI/2) segm1PosThe=M_PI-segm1PosThe;
145 Amg::Vector3D segm1PosZunit(segm1Pos/std::abs(segm1PosZ));
146
147
149 // Apply nTGCStripMeasurements Cut to canCheck arrays
150 int stationName = 0;
151 int nTGCStrips[4] = { 0, 0, 0, 0};
152 // Loop through contained ROTs and identify used stations
153 for(unsigned int iROT=0; iROT<segm1->numberOfContainedROTs(); ++iROT){
154 const Trk::RIO_OnTrack* rio = segm1->rioOnTrack(iROT);
155 if(!rio) continue;
156 Identifier id = rio->identify();
157 stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
158 bool isStrip = m_idHelperSvc->tgcIdHelper().isStrip(id);
159
160 if(((stationName==41)||(stationName==42))&&isStrip)nTGCStrips[0]++;// TGC
161 if(((stationName==43)||(stationName==44))&&isStrip)nTGCStrips[1]++;// TGC
162 if(((stationName==45)||(stationName==46))&&isStrip)nTGCStrips[2]++;// TGC
163 if(((stationName==47)||(stationName==48))&&isStrip)nTGCStrips[3]++;// TGC
164 }
165
166 // Don't check mid-stations when there are no strips in other mid-stations
167 if((nTGCStrips[1]==0)&&(nTGCStrips[2]==0)){canCheckSector[0]=false;canCheckGlobal[0]=false;}
168 if((nTGCStrips[0]==0)&&(nTGCStrips[2]==0)){canCheckSector[1]=false;canCheckGlobal[1]=false;}
169 if((nTGCStrips[0]==0)&&(nTGCStrips[1]==0)){canCheckSector[2]=false;canCheckGlobal[2]=false;}
170
171
173 // Do Grouping Cut
174 // Ignore any segments which are too close to any other segments not in the original disqualified list
175 for(int n2=0; n2<nSegm;n2++){
176 if(n1==n2)continue; // don't compare segment to itself
177 // Get segment
178 const Muon::MuonSegment *segm2 = sortedSegments[i][2].at(n2);
179
180 // Check disqualifiedSegments for current segment
181 skipSegm=false;
182 nDisqualifiedSegm=disqualifiedSegments[i][2].size();
183 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm1==disqualifiedSegments[i][2].at(ndis))skipSegm=true;
184 if(skipSegm)continue;
185
186 // Get position variables
187 const Amg::Vector3D segm2Pos = segm2->globalPosition();
188 float segm2PosRho = std::abs(segm2Pos.perp());
189 float segm2PosPhi = segm2Pos.phi();
190 float segm2PosZ = segm2Pos.z();
191 if(segm2PosPhi<0)segm2PosPhi+=2*M_PI;
192 Amg::Vector3D segm2PosZunit(segm2Pos/std::abs(segm2PosZ));
193
194 // Apply preliminary phi cut between segm1 and segm2 positions
195 float dPhi_Segm1_Segm2 = segm1PosPhi-segm2PosPhi;
196 if(dPhi_Segm1_Segm2<-M_PI)dPhi_Segm1_Segm2+=2*M_PI;
197 if(dPhi_Segm1_Segm2> M_PI)dPhi_Segm1_Segm2-=2*M_PI;
198 if(std::abs(dPhi_Segm1_Segm2)<dPhiCutSegmentMatching){
199 failedGroupingCut=true;
200 break;
201 }
202
203 // Extrapolate segm1 position to segm2's Z position
204 float dZ = std::abs(segm2PosZ)-std::abs(segm1PosZ);
205 Amg::Vector3D extrPos(segm1Pos+(segm1PosZunit*dZ));
206 float extrPosRho = std::abs(extrPos.perp());
207 float extrPosThe = extrPos.theta();
208 float extrPosPhi = extrPos.phi();
209 if(extrPosThe>M_PI/2) extrPosThe=M_PI-extrPosThe;
210 if(extrPosPhi<0)extrPosPhi+=2*M_PI;
211
212 // Get differences between extrapolated and segm2 positions
213 float dRho_Extr_Segm2 = extrPosRho-segm2PosRho;
214 float dPhi_Extr_Segm2 = extrPosPhi-segm2PosPhi;
215 if(dPhi_Extr_Segm2<-M_PI)dPhi_Extr_Segm2+=2*M_PI;
216 if(dPhi_Extr_Segm2> M_PI)dPhi_Extr_Segm2-=2*M_PI;
217
218 // Cut segments (segm1) which are inside difference cuts
219 if((std::abs(dPhi_Extr_Segm2)<dPhiCutSegmentMatching)||
220 (std::abs(dRho_Extr_Segm2)<dRhoCutSegmentMatching)){
221 failedGroupingCut=true;
222 break;
223 }
224 }// nSegm2
225 if(failedGroupingCut)continue;
226
228 // Check track against TGC Sectors to find which it passes
229 // Initialize variables for TRE array search
230 int TGCStationNames[8] ={41, 42, 43, 44, 45, 46, 47, 48};
231 int TGCstation_StationFE[4] ={-1,-1,-1,-1};// [TGCStation]
232 int TGCstation_StationEta[4]={ 0, 0, 0, 0};// [TGCStation]
233 int TGCstation_StationPhi[4]={ 0, 0, 0, 0};// [TGCStation]
234 int nStationMatch[4] ={ 0, 0, 0, 0};// [TGCStation]
235
236 // Loop through TRE array, finding sectors which match the track in each layer
237 for(int stationnameindex=0; stationnameindex<6; stationnameindex++){// Station {T1F,T1E,T2F,T2E,T3F,T3E}
238 // Skip stations which don't have sufficient Segments to run efficiency check
239 int stationName = TGCStationNames[stationnameindex];
240 int stationIndex= TGCstationname2stationindex(stationName);
241
242 // Loop over StationEta&StationPhi
243 for(int stationeta=1; stationeta<=8; stationeta++){// AbsStationEta
244 for(int stationphi=1; stationphi<=48; stationphi++){// StationPhi
245 // Cut Station EtaPhi combinations with no TGC element
246 if(m_TREarray[stationnameindex][i][stationeta][stationphi]==nullptr)continue;
247 const MuonGM::TgcReadoutElement *tre=m_TREarray[stationnameindex][i][stationeta][stationphi];
248
249 // Extrapolate position from nearest Station's Segment to Sector's Z
250 float sectorZ=tre->globalPosition().z();
251 float dZ_sector=std::abs(sectorZ)-std::abs(segm1PosZ);
252 //Trk::GlobalPosition sectorExtrapolatedPos = segm1Pos+(segm1PosZunit*dZ_sector);
253 Amg::Vector3D sectorExtrapolatedPos = segm1Pos+(segm1PosZunit*dZ_sector);
254
255 // Convert extrapolated position to local position on the Sector
256 Identifier sector_id=tre->identify();
257 //const HepGeom::Point3D<double> sectorLocalPos3D=tre->globalToLocalCoords(sectorExtrapolatedPos, sector_id);
258 const Amg::Vector3D sectorLocalPos3D=tre->globalToLocalTransf(sector_id) * sectorExtrapolatedPos;
259 //Trk::LocalPosition sectorLocalPos2D(sectorLocalPos3D.y(),sectorLocalPos3D.z());
260 Amg::Vector2D sectorLocalPos2D(sectorLocalPos3D.y(),sectorLocalPos3D.z());
261
262 double avWidth = (tre->getLongSsize()+tre->getSsize())/2;
263 //double dWidth = (tre->longWidth()-tre->shortWidth());
264 double length = tre->length();
265
266 // Cut sectors which the track does not go through the central 80% of (avoids double counts)
267 double tol1=-0.1*(avWidth/2);
268 double tol2=-0.1*(length/2);
269
270 bool insideSectorBounds=tre->bounds().inside(sectorLocalPos2D,tol1,tol2);
271 if(!insideSectorBounds)continue;
272 // Assign values to matching station variables
273 if(stationIndex<0) continue;
274 TGCstation_StationFE[stationIndex]= (tre->isForward()==false);
275 TGCstation_StationEta[stationIndex]=stationeta;
276 TGCstation_StationPhi[stationIndex]=stationphi;
277 nStationMatch[stationIndex]++;
278 }// StationPhi
279 }// StationEta
280 }// StationName
281
282 // Don't check stations that don't have exactly 1 match for this track
283 for(int jTGC=0;jTGC<4;jTGC++){// TGC Station
284 if(nStationMatch[jTGC]==0){
285 canCheckSector[jTGC]=false;
286 }
287 else if(nStationMatch[jTGC]>1){
288 canCheckSector[jTGC]=false;
289 // Should be impossible, but happens due a problem with the bounds().inside function
290 // commenting out until this bug is resolved
291 //m_log << MSG::WARNING << "MidstationOnly: Number of matches for TGC" << jTGC+1 << " is " << nStationMatch[jTGC] << endl;
292 }
293 }// TGC Station
294
295 // Cut Segment if no stations can be checked
296 if((!canCheckGlobal[0])&&(!canCheckGlobal[1])&&(!canCheckGlobal[2])&&(!canCheckGlobal[3]))continue;
298 // Check which PRD matches Segm1
299 // Initialise hit registered arrays
300 bool sectorhitregistered[9][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}};
301 std::vector<const Muon::TgcPrepData*> tpdVector[2];
302
303 // Loop over TGC Prep Data container
304 Muon::TgcPrepDataContainer::const_iterator prepit_end=tgc_prepcontainer->end();
305 for( Muon::TgcPrepDataContainer::const_iterator prepit=tgc_prepcontainer->begin();
306 prepit!=prepit_end;
307 ++prepit){
308
309 //loop over TGC Prep Data collection
310 Muon::TgcPrepDataCollection::const_iterator prepitc_end=(*prepit)->end();
311 for( Muon::TgcPrepDataCollection::const_iterator prepitc=(*prepit)->begin();
312 prepitc!= prepitc_end;
313 ++prepitc){
314 // Get PRD and variables
315 const Muon::TgcPrepData* tpd=*prepitc;
316 const MuonGM::TgcReadoutElement *tre = tpd->detectorElement();
317 const std::string stationType = tre->getStationType();
318
319 // Get id values
320 Identifier tgcid=(*prepitc)->identify();
321 int tgcAC=(tre->sideA()==false);//isNotAside a:0, c:1
322 int tgcFE=(tre->isForward()==false);//isNotForward f:0, e:1
323 int tgcWS=(m_idHelperSvc->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1
324 int stationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid);
325 int stationEta = std::abs(tre->getStationEta());
326 int stationPhi = tre->getStationPhi();
327 int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid);
328
329 // Cut hits except those from same side Midstation
330 if(tgcAC!=i) continue;
331 if(stationName>46 || stationName<41) continue;
332
333 // Get layer number and stationIndex
334 int layer = TGCgetlayer(stationName,gasGap);
335 int stationIndex = TGCstationname2stationindex(stationName);
336 if(stationIndex==3)continue;
337
338 // Get position variables
339 const Amg::Vector3D prdPos = tpd->globalPosition();
340 float tgcRho = std::abs(prdPos.perp());
341 float tgcPhi = prdPos.phi();
342 float tgcZ = prdPos.z();
343 if(tgcPhi<0)tgcPhi+=2*M_PI;
344
345 // Extrapolate Segm1 to PRD Z position
346 float dZ = std::abs(tgcZ) - std::abs(segm1PosZ);
347 Amg::Vector3D tgcExtrapolatedPos = ((segm1Pos)+((segm1PosZunit)*dZ));
348
349 // Get extrapolated variables
350 float tgcExtrRho = std::abs(tgcExtrapolatedPos.perp());
351 float tgcExtrPhi = tgcExtrapolatedPos.phi();
352 if(tgcExtrPhi<0)tgcExtrPhi+=2*M_PI;
353
354 // Get differences between extrapolated and segm2 positions
355 float dRho = tgcRho-tgcExtrRho;
356 float dPhi = tgcPhi-tgcExtrPhi;
357 if(dPhi<-M_PI)dPhi+=2*M_PI;
358 if(dPhi> M_PI)dPhi-=2*M_PI;
359
360 // Pass through loose phi cut to eliminate some noise
361 if(std::abs(dPhi)<dPhiCut_Loose){
362 // Fill PRD sagitta histograms
363 if(m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][0]) m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][0]->Fill(dRho);
364 if(m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][2]) m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][2]->Fill(dPhi);
365
366 // Do Global check
367 if(canCheckGlobal[stationIndex]){
368 float dRhoCut = dRhoCutGlobal[tgcWS]*tgcExtrRho;
369 if(std::abs(dPhi)<dPhiCutGlobal[tgcWS] && std::abs(dRho)<dRhoCut){
370 }
371 }// global
372
373 // Add PRD which matches Segm1 position to vector for further analysis
374 if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){
375 tpdVector[tgcWS].push_back(tpd);
376 }
377 // Do Sector Efficiency Check
378 if(canCheckSector[stationIndex]){
379 // Do check against PRD from matching Sectors
380 if((stationEta==TGCstation_StationEta[stationIndex])&&
381 (stationPhi==TGCstation_StationPhi[stationIndex])&&
382 (tgcFE==TGCstation_StationFE[stationIndex])){
383 // Do check
384 if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){
385 if(layer>=0)sectorhitregistered[layer][tgcWS]=true;// Sector hit
386 }
387 }
388 }// sector
389
390 }// dPhi Loose Cut
391 }// TGC PRD Collection
392 }// TGC PRD Container
393
394 // Cut Segment if no stations can be checked
395 if((!canCheckGlobal[0])&&(!canCheckGlobal[1])&&(!canCheckGlobal[2])&&(!canCheckGlobal[3]))continue;
397 // Do PRD checks
398 // Find vector of PRD which forms a coherent line in the vicinity of Segm1
399
400 // Variables to hold best PRD matching results
401 std::vector<const Muon::TgcPrepData*> *bestTPDmatches[2];
402 bestTPDmatches[0] = nullptr;
403 bestTPDmatches[1] = nullptr;
404 if(bestTPDmatches[0]->size()>0) bestTPDmatches[0]->clear();
405 if(bestTPDmatches[1]->size()>0) bestTPDmatches[1]->clear();
406 int bestTPDlayerMatches[2][9] = {{0,0,0,0,0,0,0,0,0},
407 {0,0,0,0,0,0,0,0,0}};
408
409 for(int k=0;k<2;k++){// WireStrip
410 // Variables to record quality of best match found
411 int nPRDMax = 0;
412 int nlayerMax = 0;
413
414 // Loop over PRD vector
415 int nTPD = tpdVector[k].size();
416 for(int iTPD1=0;iTPD1<nTPD;iTPD1++){
417 // Variables to hold matches found for this PRD
418 std::vector<const Muon::TgcPrepData*> thisTPDmatches;
419 int thisTPDlayerMatches[9] = {0,0,0,0,0,0,0,0,0};
420
421 // Get position variables
422 const Amg::Vector3D prdPos1 = tpdVector[k].at(iTPD1)->globalPosition();
423
424 float prd1Phi = prdPos1.phi();
425 float prd1Z = prdPos1.z();
426 if(prd1Phi<0)prd1Phi+=2*M_PI;
427 Amg::Vector3D prd1PosZunit(prdPos1/std::abs(prd1Z));
428
429 // Get id values
430 Identifier tgcid1=(tpdVector[k].at(iTPD1))->identify();
431 int stationName1 = m_idHelperSvc->tgcIdHelper().stationName(tgcid1);
432 int gasGap1 = m_idHelperSvc->tgcIdHelper().gasGap(tgcid1);
433 int layer1 = TGCgetlayer(stationName1,gasGap1);
434 if(layer1>=0)thisTPDlayerMatches[layer1]++;
435
436 // Loop over PRD
437 for(int iTPD2=0;iTPD2<nTPD;iTPD2++){
438 if(iTPD2==iTPD1)continue;// do not check PRD against itself
439
440 // Get position variables
441 const Amg::Vector3D prdPos2 = tpdVector[k].at(iTPD2)->globalPosition();
442 float prd2Rho = std::abs(prdPos2.perp());
443 float prd2Phi = prdPos2.phi();
444 float prd2Z = prdPos2.z();
445 if(prd2Phi<0)prd2Phi+=2*M_PI;
446
447 // Extrapolate PRD1 to PRD2 Z position
448 float dZ = std::abs(prd2Z)- std::abs(prd1Z);
449 Amg::Vector3D prdExtrPos = ((prdPos1)+((prd1PosZunit)*dZ));
450
451 // Get extrapolated variables
452 float prdExtrRho = std::abs(prdExtrPos.perp());
453 float prdExtrPhi = prdExtrPos.phi();
454 if(prdExtrPhi<0)prdExtrPhi+=2*M_PI;
455
456 // Get differences between extrapolated and PRD2 positions
457 float dRho = prd2Rho-prdExtrRho;
458 float dPhi = prd2Phi-prdExtrPhi;
459 if(dPhi<-M_PI)dPhi+=2*M_PI;
460 if(dPhi> M_PI)dPhi-=2*M_PI;
461
462 // Fill PRD comparison sagitta histograms
463 if(m_tgc_prdcompsag[i][k][0]) m_tgc_prdcompsag[i][k][0]->Fill(dRho);
464 if(m_tgc_prdcompsag[i][k][2]) m_tgc_prdcompsag[i][k][2]->Fill(dPhi);
465
466 // Do check
467 if(std::abs(dPhi)<dPhiCutTPD[k] && std::abs(dRho)<dRhoCutTPD[k]){
468 // Get id values
469 Identifier tgcid2=(tpdVector[k].at(iTPD2))->identify();
470 int stationName2 = m_idHelperSvc->tgcIdHelper().stationName(tgcid2);
471 int gasGap2 = m_idHelperSvc->tgcIdHelper().gasGap(tgcid2);
472 int layer2 = TGCgetlayer(stationName2,gasGap2);
473
474 // Add PRD2 to matches for PRD1
475 if(layer2>=0)thisTPDlayerMatches[layer2]++;
476 thisTPDmatches.push_back(tpdVector[k].at(iTPD2));
477 }
478 }// nTPD2
479
480 // Get quality of matching array produced
481 int nPRDCurrent = 0;
482 int nlayerCurrent = 0;
483 for(int l=0;l<9;l++){
484 if(thisTPDlayerMatches[l]>0)nlayerCurrent++;
485 nPRDCurrent+=thisTPDlayerMatches[l];
486 }
487
488 // Check quality variables against maximum found
489 if(nlayerMax <= nlayerCurrent){
490 if(nPRDMax < nPRDCurrent){
491 // Set maximum values to current segment's values
492 nlayerMax = nlayerCurrent;
493 nPRDMax = nPRDCurrent;
494 bestTPDmatches[k] = &thisTPDmatches;
495 for(int l=0;l<9;l++){
496 bestTPDlayerMatches[k][l] = thisTPDlayerMatches[l];
497 }
498 }
499 }
500 }// nTPD1
501
502 // If matching array was somehow empty (should be impossible)
503 if(nlayerMax==0)continue;
504 if(bestTPDmatches[k]->size()==0){
505 ATH_MSG_WARNING( "MidstationOnly: empty bestTPDmatches["<<k<<"] passed" );
506 continue;
507 }
508
509 // Set canCheck variables based on contents of matched PRD array
510 for(int jTGC1=0;jTGC1<3;jTGC1++){// TGC Stations
511 // Number of matched PRD found in other Stations
512 int nMatchOther = 0;
513 for(int l=0;l<9;l++){
514 int jTGC2 = TGClayer2stationindex(l);
515 if(jTGC1==jTGC2)continue;
516 nMatchOther+=bestTPDlayerMatches[k][l];
517 }
518
519 // Check against cut
520 if(nMatchOther<nMeasCutTGCMidPRD[k]){
521 canCheckGlobal[jTGC1]=false;
522 canCheckSector[jTGC1]=false;
523 }
524 }// TGC Stations
525 }// WireStrip
526
527 // Cut Segment if no stations can be checked
528 if((!canCheckGlobal[0])&&(!canCheckGlobal[1])&&(!canCheckGlobal[2])&&(!canCheckGlobal[3]))continue;
530 // Segment has passed all global cuts, fill histogram variables
531 // If no segments have already passed all cuts
532 if(nValidatedSegm==0){
533 for(int jTGC=0;jTGC<4;jTGC++){// TGC Stations
534 // Assign values of variables to fill histograms
535 // posThetaFill = segm1PosThe;
536 // posPhiFill = segm1PosPhi;
537
538 //canCheckGlobalFill[jTGC] = canCheckGlobal[jTGC];
539 canCheckSectorFill[jTGC] = canCheckSector[jTGC];
540
541 TGCstation_StationFEFill[jTGC] = TGCstation_StationFE[jTGC];
542 TGCstation_StationEtaFill[jTGC] = TGCstation_StationEta[jTGC];
543 TGCstation_StationPhiFill[jTGC] = TGCstation_StationPhi[jTGC];
544 }
545 for(int l=0;l<9;l++){
546 for(int k=0;k<2;k++){
547 sectorhitregisteredFill[l][k] = sectorhitregistered[l][k];
548 // hitregisteredFill[l][k] = hitregistered[l][k];
549 }
550 }
551 }// TGC Stations
552 nValidatedSegm++;
553 }// nSegm1
554
555 // If only one Segment was validated on this side
556 if(nValidatedSegm==1){
557 for(int l=0;l<9;l++){//Layer
558 int stationIndex = TGClayer2stationindex(l);
559 for(int k=0;k<2;k++){// WireStrip
560 // If this station can be checked
561 if(canCheckSectorFill[stationIndex]){
562 if((TGCstation_StationFEFill[stationIndex]<0)||(TGCstation_StationEtaFill[stationIndex]==0)||(TGCstation_StationPhiFill[stationIndex]==0)){
563 ATH_MSG_WARNING( "MidstationOnly: canCheckSector passed for jTGC=" << stationIndex
564 << " but, FE="<<TGCstation_StationFEFill[stationIndex]
565 << " Eta="<<TGCstation_StationEtaFill[stationIndex]
566 << " Phi=" << TGCstation_StationPhiFill[stationIndex] );
567 continue;
568 }
569 // Get Sector histogram indexes
570 int stationMap_EtaIndex=getStationMapIndex(1, l, TGCstation_StationFEFill[stationIndex], TGCstation_StationEtaFill[stationIndex], TGCstation_StationPhiFill[stationIndex]);
571 int stationMap_PhiIndex=getStationMapIndex(2, l, TGCstation_StationFEFill[stationIndex], TGCstation_StationEtaFill[stationIndex], TGCstation_StationPhiFill[stationIndex]);
572
573 // Fill Sector efficiency histograms
574 if(sectorhitregisteredFill[l][k]){// Hit in Sector matches extrapolated track
575 m_eff_stationmapmid[i][k][1]->Fill(stationMap_EtaIndex, stationMap_PhiIndex);
576 }
577 m_eff_stationmapmid[i][k][2]->Fill(stationMap_EtaIndex, stationMap_PhiIndex);
578 }
579 }// WireStrip
580 }// layer
581 }
582
583 }// AC
584
585}// End of Function

◆ MMTB_DEPRECATED() [1/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( endOfEventsBlock )
inherited

◆ MMTB_DEPRECATED() [2/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( endOfLowStat )
inherited

◆ MMTB_DEPRECATED() [3/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( endOfLumiBlock )
inherited

◆ MMTB_DEPRECATED() [4/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( endOfRun )
inherited

◆ MMTB_DEPRECATED() [5/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newEventsBlock )
inherited

◆ MMTB_DEPRECATED() [6/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newHigStatInterval )
inherited

◆ MMTB_DEPRECATED() [7/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newLowStat )
inherited

◆ MMTB_DEPRECATED() [8/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newLowStatInterval )
inherited

◆ MMTB_DEPRECATED() [9/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newLumiBlock )
inherited

◆ MMTB_DEPRECATED() [10/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newMedStatInterval )
inherited

◆ MMTB_DEPRECATED() [11/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newRun )
inherited

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ newEventsBlockFlag()

bool ManagedMonitorToolBase::newEventsBlockFlag ( ) const
inlineprotectedinherited

Definition at line 793 of file ManagedMonitorToolBase.h.

793{ return m_newEventsBlock; }

◆ newHigStatIntervalFlag()

bool ManagedMonitorToolBase::newHigStatIntervalFlag ( ) const
inlineprotectedinherited

Definition at line 789 of file ManagedMonitorToolBase.h.

789{ return m_newHigStatInterval; }

◆ newLowStatFlag()

bool ManagedMonitorToolBase::newLowStatFlag ( ) const
inlineprotectedinherited

Definition at line 790 of file ManagedMonitorToolBase.h.

790{ return m_newLowStat; }

◆ newLowStatIntervalFlag()

bool ManagedMonitorToolBase::newLowStatIntervalFlag ( ) const
inlineprotectedinherited

Flag functions allowing clients to determine when to book new and process old histograms; values are updated by fillHists() based on counting lumiBlocks, and are correctly set when fillHistograms(), bookHistograms() and procHistograms() are called.

Definition at line 787 of file ManagedMonitorToolBase.h.

787{ return m_newLowStatInterval; }

◆ newLumiBlockFlag()

bool ManagedMonitorToolBase::newLumiBlockFlag ( ) const
inlineprotectedinherited

Definition at line 791 of file ManagedMonitorToolBase.h.

791{ return m_newLumiBlock; }

◆ newMedStatIntervalFlag()

bool ManagedMonitorToolBase::newMedStatIntervalFlag ( ) const
inlineprotectedinherited

Definition at line 788 of file ManagedMonitorToolBase.h.

788{ return m_newMedStatInterval; }

◆ newRunFlag()

bool ManagedMonitorToolBase::newRunFlag ( ) const
inlineprotectedinherited

Definition at line 792 of file ManagedMonitorToolBase.h.

792{ return m_newRun; }

◆ numberOfSL()

int MdtVsTgcRawDataValAlg::numberOfSL ( const Muon::TgcCoinDataContainer * tgctrgcontainer)
private

Definition at line 83 of file MdtVsTgcRawData_functions.cxx.

83 {
84
85 int nSL=0;
86
87 //loop over TGC RoI container
88 Muon::TgcCoinDataContainer::const_iterator it_end=tgctrgcontainer->end();
89 for( Muon::TgcCoinDataContainer::const_iterator it=tgctrgcontainer->begin();
90 it!=it_end;
91 ++it){
92
93
94 ATH_MSG_DEBUG( "size of tgc collection is " << (*it) -> size() );
95
96 //loop over TGC RoI collection
98 for( Muon::TgcCoinDataCollection::const_iterator itc=(*it)->begin();
99 itc!= itc_end;
100 ++itc){
101
102 const Muon::TgcCoinData* tcd=*itc;
103
104 if( tcd->type() != Muon::TgcCoinData::TYPE_SL )continue;
105 ATH_MSG_DEBUG("pt"<<tcd->pt() );
106 nSL++;
107 }
108 }
109
110 return nSL;
111}
int pt() const
return pt threshold value

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ parseList()

StatusCode ManagedMonitorToolBase::parseList ( const std::string & line,
std::vector< std::string > & result )
protectedinherited

Definition at line 2111 of file ManagedMonitorToolBase.cxx.

2112 {
2113 std::string item;
2114 std::stringstream ss(line);
2115
2116 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "ManagedMonitorToolBase::parseList:";
2117
2118 while ( std::getline(ss, item, ',') ) {
2119 std::stringstream iss(item); // remove
2120 iss >> item; // whitespace
2121 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " " << item;
2122 result.push_back(item);
2123 }
2124
2125 msg(MSG::DEBUG) << endmsg;
2126 return StatusCode::SUCCESS;
2127}
static Double_t ss
bool msgLvl(const MSG::Level lvl) const

◆ phi2sector()

int MdtVsTgcRawDataValAlg::phi2sector ( int phi,
int ef )
private

Definition at line 57 of file MdtVsTgcRawData_functions.cxx.

57 {
58 int sector=-1;
59 if(ef==0){//forward
60 sector=phi/2+1;//(phi,sector)= (1,1), (2,2), (3,2), (4,3)
61 }else{//endcap
62 sector=(phi+1)/4+1;//(phi,sector)= (1,1), (2,1), (3,2), (4,2)
63 }
64 if(sector>12)sector=1;
65
66 return sector;
67}
Scalar phi() const
phi method

◆ prepareTREarray()

void MdtVsTgcRawDataValAlg::prepareTREarray ( const MuonGM::MuonDetectorManager * MuonDetMgrDS)
private

Definition at line 86 of file MdtVsTgcRawData_TGCEffCheck.cxx.

86 {
87 int TGCStationNames[8]={41, 42, 43, 44, 45, 46, 47, 48};
88
89 // Make array of TGC Readout Element pointers
90 for(int stationNameIndex=0; stationNameIndex<8; stationNameIndex++){// Station Name
91 int stationName = TGCStationNames[stationNameIndex];
92 for(int stationEta=-8; stationEta<=8; stationEta++){// Station Eta
93 int tgcAC(stationEta<0);
94 int absStationEta = std::abs(stationEta);
95 for(int stationPhi=0; stationPhi<=48; stationPhi++){// Station Phi
96 // Exclude non-existent "zero" sectors included in the array for ease of use
97 if(stationEta==0){
98 m_TREarray[stationNameIndex][0][absStationEta][stationPhi]=nullptr;
99 m_TREarray[stationNameIndex][1][absStationEta][stationPhi]=nullptr;
100 continue;
101 }
102 m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi]=nullptr;
103 if(stationPhi==0)continue;
104
105 // Exclude sectors known not to exist
106 if(stationNameIndex==6){ // Inner Forward
107 if(std::abs(stationEta)>1)continue;
108 if(stationPhi>24)continue;
109 }
110 else if(stationNameIndex==7){ // Inner Endcap
111 if(std::abs(stationEta)>1)continue;
112 if(stationPhi>21)continue;
113 }
114 else if((stationNameIndex==0)|| // Midstation Forward
115 (stationNameIndex==2)||
116 (stationNameIndex==4)){
117 if(std::abs(stationEta)>1)continue;
118 if(stationPhi>24)continue;
119 }
120 else{ // Midstation Endcap
121 if(std::abs(stationEta)>5)continue;
122 if((stationNameIndex==1)&&
123 (std::abs(stationEta)>4))continue;
124 }
125
126 // Get identifier of TRE at this set of indexes
127 bool isValid{false};
128 Identifier tgc_testId = m_idHelperSvc->tgcIdHelper().elementID(stationName, stationEta, stationPhi, isValid);
129 if(!isValid){continue;}
130
131 // Get TRE and put into to array
132 m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi] = MuonDetMgrDS->getTgcReadoutElement(tgc_testId);
133 if(m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi]==nullptr){
134 ATH_MSG_WARNING( "prepareTREarray: TgcReadoutElement==0 passed checks" );
135 continue;
136 }
137 }// Station Phi
138 }// Station Eta
139 }// Station Name
140 return;
141}// End of function
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878

◆ preSelector()

bool ManagedMonitorToolBase::preSelector ( )
virtualinherited

Implements IMonitorToolBase.

Definition at line 1679 of file ManagedMonitorToolBase.cxx.

1681{
1682 if( m_preScaleProp > 1 ) {
1683 return ( (m_nEvents % m_preScaleProp) == 1 );
1684 }
1685 return true;
1686}

◆ procHistograms()

StatusCode MdtVsTgcRawDataValAlg::procHistograms ( )
virtual

An inheriting class should either override this function or finalHists().

Reimplemented from ManagedMonitorToolBase.

Definition at line 186 of file MdtVsTgcRawDataValAlg.cxx.

186 {
187/*----------------------------------------------------------------------------------*/
188
189 ATH_MSG_DEBUG( "MdtVsTgcRawDataValAlg finalize()" );
190 if(endOfRunFlag()){
193 }
194 return StatusCode::SUCCESS;
195}

◆ putBox()

void MdtVsTgcRawDataValAlg::putBox ( TH2 * h2,
float x1,
float y1,
float x2,
float y2 )
private

Definition at line 129 of file MdtVsTgcRawData_functions.cxx.

129 {
130 TBox* box = new TBox(x1, y1, x2, y2);
131// box->SetFillColor(kGray+1);
132// box->SetLineColor(kGray+1);
133// box->SetFillStyle(3013);
134// box->SetFillStyle(3004);
135
136 box->SetFillColor(kGray);
137 box->SetLineColor(kGray);
138
139// box->SetLineStyle(3);
140
141 (h->GetListOfFunctions())->Add(box);
142}

◆ regEfficiency()

StatusCode ManagedMonitorToolBase::regEfficiency ( TEfficiency * e,
const MonGroup & group )
virtualinherited

Registers a TEfficiency to be included in the output stream using logical parameters that describe the plot.

Definition at line 1444 of file ManagedMonitorToolBase.cxx.

1444 {
1445 if (!e)
1446 return StatusCode::FAILURE;
1447
1448 TGraph* g = reinterpret_cast<TGraph*>(e);
1449 std::string name = e->GetName();
1450
1451 // MANAGED
1452 if ( group.histo_mgmt() != ATTRIB_UNMANAGED ) {
1453 // warn about not using merge algorithms
1454 if (group.histo_mgmt() == ATTRIB_X_VS_LB && group.merge().empty()) {
1455 ATH_MSG_WARNING("HEY! Attempting to register "<<name<<" as a per-LB histogram, but not setting the merge algorithm! Use \"merge\", at least.");
1456 }
1457 // add the efficiency to rebooking vector
1458 if (m_supportedIntervalsForRebooking.count(group.interval())) {
1459 m_templateEfficiencies[group.interval()].push_back( MgmtParams<TEfficiency>(e, group) );
1460 } else {
1461 ATH_MSG_ERROR("Attempt to book managed graph " << name << " with invalid interval type " << intervalEnumToString(group.interval()));
1462 return StatusCode::FAILURE;
1463 }
1464
1465 MonGroup group_unmanaged( this, group.system(), group.interval(), ATTRIB_UNMANAGED, group.chain(), group.merge());
1466 std::string streamName = streamNameFunction()->getStreamName( this, group_unmanaged, name, false );
1467 registerMetadata(streamName, name, group).ignore();
1468 return m_THistSvc->regGraph( streamName, g );
1469 } else {
1470 // UNMANAGED
1471 if( m_manager != 0 ) {
1472 std::string genericName = NoOutputStream().getStreamName( this, group, name );
1473 m_manager->writeAndDelete( genericName );
1474 m_manager->passOwnership( e, genericName );
1475 }
1476
1477 std::string streamName = streamNameFunction()->getStreamName( this, group, name, false );
1478 StatusCode smd = registerMetadata(streamName, name, group);
1479 if (smd != StatusCode::SUCCESS)
1480 return StatusCode::FAILURE;
1481
1482 return m_THistSvc->regGraph( streamName, g );
1483 }
1484}
virtual std::string getStreamName(const ManagedMonitorToolBase *tool, const MonGroup &group, const std::string &objName, bool usePreviousInterval=false)
A function that converts a MonGroup of logical parameters into a physical output stream name.
std::set< Interval_t > m_supportedIntervalsForRebooking
StatusCode registerMetadata(const std::string &streamName, const std::string &hName, const MonGroup &group)
static std::string intervalEnumToString(Interval_t interval)
Converts a LevelOfDetail_t to a string of the same name.

◆ regGraph() [1/2]

StatusCode ManagedMonitorToolBase::regGraph ( TGraph * g,
const MonGroup & group )
virtualinherited

Registers a TGraph to be included in the output stream using logical parameters that describe the graph.

Reimplemented in TilePaterMonTool.

Definition at line 1498 of file ManagedMonitorToolBase.cxx.

1500{
1501 if (!g)
1502 return StatusCode::FAILURE;
1503
1504 // This part of the code deals with MANAGED type
1505 if ( group.histo_mgmt() != ATTRIB_UNMANAGED ) {
1506 // Create an unmanaged group based on the original MonGroup instance passed
1507 // This is needed because managed graph is presented as a number of unmanaged
1508 // graphs (one per each interval)
1509 MonGroup group_unmanaged( this, group.system(), group.interval(), ATTRIB_UNMANAGED, group.chain(), group.merge());
1510
1511 if (m_supportedIntervalsForRebooking.count(group.interval())) {
1512 m_templateGraphs[group.interval()].push_back( MgmtParams<TGraph>(g, group_unmanaged) );
1513 } else {
1514 ATH_MSG_ERROR("Attempt to book managed graph " << g->GetName() << " with invalid interval type " << intervalEnumToString(group.interval()));
1515 return StatusCode::FAILURE;
1516 }
1517
1518 std::string name = g->GetName();
1519 std::string streamName = streamNameFunction()->getStreamName( this, group_unmanaged, name, false );
1520 registerMetadata(streamName, name, group).ignore();
1521 return m_THistSvc->regGraph( streamName, g );
1522 //return m_THistSvc->regGraph( streamName );
1523 }
1524
1525 // This part of the code deals with UNMANAGED type
1526 std::string gName = g->GetName();
1527
1528 if( m_manager != 0 ) {
1529 std::string genericName = NoOutputStream().getStreamName( this, group, gName );
1530 m_manager->writeAndDelete( genericName );
1531 m_manager->passOwnership( g, genericName );
1532 }
1533
1534 std::string streamName = streamNameFunction()->getStreamName( this, group, gName, false );
1535
1536 StatusCode smd = registerMetadata(streamName, gName, group);
1537 if (smd != StatusCode::SUCCESS) return StatusCode::FAILURE;
1538
1539 return m_THistSvc->regGraph( streamName, g );
1540}

◆ regGraph() [2/2]

StatusCode ManagedMonitorToolBase::regGraph ( TGraph * g,
const std::string & system,
Interval_t interval,
MgmtAttr_t histo_mgmt = ATTRIB_MANAGED,
const std::string & chain = "",
const std::string & merge = "" )
virtualinherited

Registers a TGraph to be included in the output stream using logical parameters that describe the graph.

Reimplemented in TilePaterMonTool.

Definition at line 1488 of file ManagedMonitorToolBase.cxx.

1491{
1492 MonGroup group( this, system, interval, histo_mgmt, chain, merge );
1493 return regGraph( g, group );
1494}
virtual StatusCode regGraph(TGraph *g, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TGraph to be included in the output stream using logical parameters that describe the gra...

◆ regHist() [1/2]

StatusCode ManagedMonitorToolBase::regHist ( TH1 * h,
const MonGroup & group )
virtualinherited

Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical parameters that describe the histogram.

A histogram is passed via reference to a pointer.

Reimplemented in TilePaterMonTool.

Definition at line 1352 of file ManagedMonitorToolBase.cxx.

1354{
1355// ManagedMonitorToolBase_addHistStatistics(this,h);
1356
1357 if (!h)
1358 return StatusCode::FAILURE;
1359
1360 // This part of the code deals with MANAGED type
1361 if ( group.histo_mgmt() != ATTRIB_UNMANAGED ) {
1362 /*
1363 Create an unmanaged group based on the original MonGroup instance passed
1364 It is needed because managed histogram is presented as a number of unmanaged
1365 histograms (one per each interval)
1366 Update (PUEO) - I don't think it actually matters, and need to keep
1367 track of "proper" attribute for X_VS_LB
1368 */
1369
1370 if (group.histo_mgmt() == ATTRIB_X_VS_LB && group.merge().empty()) {
1371 ATH_MSG_WARNING("HEY! You're attempting to register " << h->GetName() << " as a per-LB histogram, but you're not setting the merge algorithm! This is a SUPER-BAD idea! Use \"merge\", at least.");
1372 }
1373
1374 if (m_supportedIntervalsForRebooking.count(group.interval())) {
1375 m_templateHistograms[group.interval()].push_back( MgmtParams<TH1>(h, group) );
1376 } else {
1377 ATH_MSG_ERROR("Attempt to book managed histogram " << h->GetName() << " with invalid interval type " << intervalEnumToString(group.interval()));
1378 return StatusCode::FAILURE;
1379 }
1380
1381 std::string hName = h->GetName();
1382 MonGroup group_unmanaged( this, group.system(), group.interval(), ATTRIB_UNMANAGED, group.chain(), group.merge());
1383 std::string streamName = streamNameFunction()->getStreamName( this, group_unmanaged, hName, false );
1384 registerMetadata(streamName, hName, group).ignore();
1385 return m_THistSvc->regHist( streamName, h );
1386 }
1387
1388 // This part of the code deals with UNMANAGED type
1389 std::string hName = h->GetName();
1390
1391 if( m_manager != 0 ) {
1392 std::string genericName = NoOutputStream().getStreamName( this, group, hName );
1393 m_manager->writeAndDelete( genericName );
1394 m_manager->passOwnership( h, genericName );
1395 }
1396
1397 std::string streamName = streamNameFunction()->getStreamName( this, group, hName, false );
1398
1399 StatusCode smd = registerMetadata(streamName, hName, group);
1400 if (smd != StatusCode::SUCCESS) return StatusCode::FAILURE;
1401
1402 return m_THistSvc->regHist( streamName, h );
1403}

◆ regHist() [2/2]

StatusCode ManagedMonitorToolBase::regHist ( TH1 * h,
const std::string & system,
Interval_t interval,
MgmtAttr_t histo_mgmt = ATTRIB_MANAGED,
const std::string & chain = "",
const std::string & merge = "" )
virtualinherited

Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical parameters that describe the histogram.

Reimplemented in TilePaterMonTool.

Definition at line 1343 of file ManagedMonitorToolBase.cxx.

1346{
1347 MonGroup group( this, system, interval, histo_mgmt, chain, merge );
1348 return regHist( h, group );
1349}
virtual StatusCode regHist(TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...

◆ registerMetadata()

StatusCode ManagedMonitorToolBase::registerMetadata ( const std::string & streamName,
const std::string & hName,
const MonGroup & group )
protectedinherited

Definition at line 945 of file ManagedMonitorToolBase.cxx.

947 {
949 TTree* metadata(0);
950 std::string mdStreamName( streamName );
951 size_t found=mdStreamName.rfind('/');
952
953 if ( found != std::string::npos )
954 mdStreamName.replace( found, mdStreamName.length(), "/metadata" );
955
956 MDMap_t::iterator i = m_metadataMap.find( mdStreamName );
957 if( i == m_metadataMap.end() ) {
958 metadata = new TTree( "metadata", "Monitoring Metadata" );
959 if (! metadata) return StatusCode::FAILURE;
960 StatusCode scmd = m_THistSvc->regTree( mdStreamName, metadata );
961 if (scmd == StatusCode::FAILURE) return StatusCode::FAILURE;
962 i = m_metadataMap.emplace( mdStreamName, new OutputMetadata(metadata) ).first;
963 }
964
965 i->second->fill( hName, group.interval(), group.chain(), group.merge() );
966 }
967 return StatusCode::SUCCESS;
968}

◆ regManagedEfficiencies()

StatusCode ManagedMonitorToolBase::regManagedEfficiencies ( std::vector< MgmtParams< TEfficiency > > & templateEfficiencies)
protectedinherited

Definition at line 1139 of file ManagedMonitorToolBase.cxx.

1139 {
1140 bool allIsOk = true;
1141 for( auto& it : templateEfficiencies ) {
1142 // get components of MgmtParams and copy efficiency
1143 MonGroup group = it.m_group;
1144 TEfficiency* theEfficiency = it.m_templateHist;
1145 TEfficiency* e = static_cast<TEfficiency*>(theEfficiency->Clone());
1146 int nbins = theEfficiency->GetTotalHistogram()->GetNbinsX();
1147 int xlow = theEfficiency->GetTotalHistogram()->GetXaxis()->GetXmin();
1148 int xhigh = theEfficiency->GetTotalHistogram()->GetXaxis()->GetXmax();
1149 e->SetBins(nbins,xlow,xhigh); // reset histogram
1150 std::string name = e->GetName();
1151
1152 // make TGraph casts of TEfficiencies
1153 TGraph* theGraph = reinterpret_cast<TGraph*>(theEfficiency);
1154 TGraph* g = reinterpret_cast<TGraph*>(e);
1155
1156 // Get the streamName for the previous interval
1157 std::string streamName = streamNameFunction()->getStreamName( this, group, name, true );
1158
1159 // RE-REGISTER
1160 // 1) De-register the original graph with the THistSvc
1161 StatusCode sc1 = m_THistSvc->deReg( theGraph );
1162 if (sc1 == StatusCode::FAILURE) allIsOk = false;
1163 // 2) Fix THistSvc->deReg for TGraphs
1164 bool doneCleaning = false;
1165 std::string directoryName = streamNameFunction()->getDirectoryName( this, group, name, true );
1166 TSeqCollection *filelist=gROOT->GetListOfFiles();
1167 for (int i=0; i<filelist->GetEntries(); i++) {
1168 ATH_MSG_DEBUG( "List of files: " << filelist->At(i)->GetName());
1169 TFile* file = static_cast<TFile*>(filelist->At(i));
1170 StatusCode sc2 = THistSvc_deReg_fixTGraph(file, theGraph, directoryName);
1171 if (sc2 == StatusCode::SUCCESS) doneCleaning = true;
1172 }
1173 // 3) Check if TGraph fix has been applied successfully
1174 if (!doneCleaning) {
1175 ATH_MSG_ERROR("THistSvc_deReg_fixTGraph: failed to apply TGraph fix for the THist Svc!");
1176 allIsOk = false;
1177 }
1178 // 4) Register cloned histogram under previous interval streamName
1179 StatusCode sc3 = m_THistSvc->regGraph( streamName, g );
1180 if (sc3 == StatusCode::FAILURE)
1181 allIsOk = false;
1182
1183 // get streamname for interval
1184 streamName = streamNameFunction()->getStreamName( this, group, name, false );
1185 // store metadata
1186 StatusCode smd = registerMetadata(streamName, name, group);
1187 if (smd != StatusCode::SUCCESS) allIsOk = false;
1188 // Re-register the original graph
1189 StatusCode sc4 = m_THistSvc->regGraph( streamName, theGraph );
1190 if (sc4 == StatusCode::FAILURE) allIsOk = false;
1191 }
1192
1193 if (!allIsOk) return StatusCode::FAILURE;
1194 return StatusCode::SUCCESS;
1195}
virtual std::string getDirectoryName(const ManagedMonitorToolBase *tool, const MonGroup &group, const std::string &objName, const bool usePreviousInterval)=0
A function that returns TDirectory path in a file that corresponds to a given MonGroup and object nam...
StatusCode THistSvc_deReg_fixTGraph(TFile *file, TGraph *theGraph, std::string &directoryName)
Fixes THistSvc->deReg(obj) when obj is TGraph instance.
filelist
print ("Checking files %s..." % fullfile)
Definition envutil.py:133

◆ regManagedGraphs()

StatusCode ManagedMonitorToolBase::regManagedGraphs ( std::vector< MgmtParams< TGraph > > & templateGraphs)
protectedinherited

Definition at line 1068 of file ManagedMonitorToolBase.cxx.

1070{
1071 // See the description for the regManagedHistograms method
1072 bool allIsOk = true;
1073
1074 for( std::vector< MgmtParams<TGraph> >::iterator it = templateGraphs.begin(); it != templateGraphs.end(); ++it ) {
1075 MonGroup group = (*it).m_group;
1076
1077 // Get a handle to the graph
1078 TGraph* theGraph = (*it).m_templateHist;
1079
1080 // Clone the graph
1081 TGraph* g = static_cast<TGraph*>(theGraph->Clone());
1082 theGraph->Set(0); // equivalent to Reset() for TH1
1083
1084 // Get name
1085 std::string gName = g->GetName();
1086
1087 // Get the streamName for the previous interval
1088 std::string streamName = streamNameFunction()->getStreamName( this, group, gName, true );
1089
1090 // De-register the original graph with the THistSvc
1091 StatusCode sc1 = m_THistSvc->deReg( theGraph );
1092 if (sc1 == StatusCode::FAILURE)
1093 allIsOk = false;
1094
1095 // *** begin ***
1096 // Fix THistSvc->deReg for TGraphs
1097 bool doneCleaning = false;
1098 std::string directoryName = streamNameFunction()->getDirectoryName( this, group, gName, true );
1099 TSeqCollection *filelist=gROOT->GetListOfFiles();
1100 for (int i=0; i<filelist->GetEntries(); i++) {
1101 ATH_MSG_DEBUG( "List of files: " << filelist->At(i)->GetName());
1102 TFile* file = static_cast<TFile*>(filelist->At(i));
1103 StatusCode sc2 = THistSvc_deReg_fixTGraph(file, theGraph, directoryName);
1104 if (sc2 == StatusCode::SUCCESS)
1105 doneCleaning = true;
1106 }
1107
1108 // Check if TGraph fix has been applied successfully
1109 if (!doneCleaning) {
1110 ATH_MSG_ERROR("THistSvc_deReg_fixTGraph: failed to apply TGraph fix for the THist Svc!");
1111 allIsOk = false;
1112 }
1113 // *** end ***
1114
1115 // Register clonned histogram under previous interval streamName
1116 StatusCode sc3 = m_THistSvc->regGraph( streamName, g );
1117 if (sc3 == StatusCode::FAILURE)
1118 allIsOk = false;
1119
1120 // Get streamName for the current interval
1121 streamName = streamNameFunction()->getStreamName( this, group, gName, false );
1122 // Register metadata information with the current interval streamname
1123 StatusCode smd = registerMetadata(streamName, gName, group);
1124 if (smd != StatusCode::SUCCESS)
1125 allIsOk = false;
1126
1127 // Re-register the original graph with the current interval streamName
1128 StatusCode sc4 = m_THistSvc->regGraph( streamName, theGraph );
1129 if (sc4 == StatusCode::FAILURE)
1130 allIsOk = false;
1131
1132 }
1133
1134 if (!allIsOk) return StatusCode::FAILURE;
1135
1136 return StatusCode::SUCCESS;
1137}

◆ regManagedHistograms()

StatusCode ManagedMonitorToolBase::regManagedHistograms ( std::vector< MgmtParams< TH1 > > & templateHistograms)
protectedinherited

Definition at line 971 of file ManagedMonitorToolBase.cxx.

973{
974 // The method registers histograms with the THistSvc and saves them to file.
975
976 // The funky business with registering and deregistering the histogram is needed
977 // to get the correct directory when saving histograms. THistSvc deals with ROOT
978 // to set up proper TDirectory, so we rely on it.
979 // E.g.
980 // m_THistSvc->regHist( streamName, h ): sets the correct TDirectory with streamName
981 // m_THistSvc->deReg( h ) - deregister from THistSvc otherwise THistSvc will try to save it
982 // at the end of execution
983 // use passownership of the histogram and save it to file
984 // m_manager->passOwnership( h, genericName );
985 // m_manager->writeAndDelete( genericName );
986 bool allIsOk = true;
987
988 for( std::vector< MgmtParams<TH1> >::iterator it = templateHistograms.begin(); it != templateHistograms.end(); ++it ) {
989 MonGroup& group = (*it).m_group;
990
991 // Get a handle to the histogram
992 TH1* theHist = (*it).m_templateHist;
993
994 // Clone the histogram
995 TH1* h = static_cast<TH1*>(theHist->Clone());
996 theHist->Reset();
997
998 // Get name
999 std::string hName = h->GetName();
1000
1001 // Get the streamName for the previous interval
1002 std::string streamName = streamNameFunction()->getStreamName( this, group, hName, true );
1003
1004 // Register the histogram with the THistSvc
1005 StatusCode sc1 = m_THistSvc->deReg( theHist );
1006 if (sc1 == StatusCode::FAILURE) allIsOk = false;
1007
1008 // Register clonned histogram under previous interval streamName
1009 StatusCode sc2 = m_THistSvc->regHist( streamName, h );
1010 if (sc2 == StatusCode::FAILURE) allIsOk = false;
1011
1012 if( m_manager != 0 ) {
1013 std::string genericName = NoOutputStream().getStreamName( this, group, hName );
1014 m_manager->passOwnership( h, genericName );
1015 m_manager->writeAndDelete( genericName );
1016 }
1017
1018 // Get streamName for the current interval
1019 streamName = streamNameFunction()->getStreamName( this, group, hName, false );
1020 // Register metadata information with the current interval streamname
1021 StatusCode smd = registerMetadata(streamName, hName, group);
1022 if (smd != StatusCode::SUCCESS) allIsOk = false;
1023
1024 // Re-register the original histogram with the current interval streamName
1025 StatusCode sc3 = m_THistSvc->regHist( streamName, theHist );
1026 if (sc3 == StatusCode::FAILURE) allIsOk = false;
1027
1028 }
1029
1030 if (!allIsOk) return StatusCode::FAILURE;
1031
1032 return StatusCode::SUCCESS;
1033}

◆ regManagedTrees()

StatusCode ManagedMonitorToolBase::regManagedTrees ( std::vector< MgmtParams< TTree > > & templateTrees)
protectedinherited

Definition at line 1199 of file ManagedMonitorToolBase.cxx.

1201{
1202 // See the description for the regManagedHistograms method
1203 bool allIsOk = true;
1204
1205 for( std::vector< MgmtParams<TTree> >::iterator it = templateTrees.begin(); it != templateTrees.end(); ++it ) {
1206 MonGroup group = (*it).m_group;
1207
1208 // Get a handle to the original tree
1209 TTree* theTree = (*it).m_templateHist;
1210
1211 // Clone the tree
1212 TTree* t = static_cast<TTree*>(theTree->Clone());
1213 theTree->Reset();
1214
1215 // Dumping the tree
1216 std::string name = t->GetName();
1217
1218 // Get the streamName for the previous interval
1219 std::string streamName = streamNameFunction()->getStreamName( this, group, name, true );
1220
1221 // De-register original tree with the THistSvc
1222 StatusCode sc1 = m_THistSvc->deReg( theTree );
1223 if (sc1 == StatusCode::FAILURE) allIsOk = false;
1224
1225 // Register clonned tree under previous interval streamName
1226 StatusCode sc2 = m_THistSvc->regTree( streamName, t );
1227 if (sc2 == StatusCode::FAILURE) allIsOk = false;
1228
1229 if( m_manager != 0 ) {
1230 std::string genericName = NoOutputStream().getStreamName( this, group, name );
1231 m_manager->passOwnership( t, genericName );
1232 m_manager->writeAndDelete( genericName );
1233 }
1234
1235 // Get streamName for the current interval
1236 streamName = streamNameFunction()->getStreamName( this, group, name, false );
1237 // Register metadata information with the current interval streamname
1238 StatusCode smd = registerMetadata(streamName, name, group);
1239 if (smd != StatusCode::SUCCESS) allIsOk = false;
1240
1241 // Re-register the original graph with the current interval streamName
1242 StatusCode sc3 = m_THistSvc->regTree( streamName, theTree );
1243 if (sc3 == StatusCode::FAILURE) allIsOk = false;
1244
1245 }
1246
1247 if (!allIsOk) return StatusCode::FAILURE;
1248
1249 return StatusCode::SUCCESS;
1250}

◆ regTree() [1/2]

StatusCode ManagedMonitorToolBase::regTree ( TTree * t,
const MonGroup & group )
virtualinherited

Registers a TTree to be included in the output stream using logical parameters that describe it.

Definition at line 1554 of file ManagedMonitorToolBase.cxx.

1556{
1557
1558 // This part of the code deals with MANAGED type
1559 if ( group.histo_mgmt() != ATTRIB_UNMANAGED ) {
1560 // Create an unmanaged group based on the original MonGroup instance passed
1561 // This is needed because managed tree is presented as a number of unmanaged
1562 // trees (one per each interval)
1563 MonGroup group_unmanaged( this, group.system(), group.interval(), ATTRIB_UNMANAGED, group.chain(), group.merge());
1564
1565 if (m_supportedIntervalsForRebooking.count(group.interval())) {
1566 m_templateTrees[group.interval()].push_back( MgmtParams<TTree>(t, group_unmanaged) );
1567 } else {
1568 ATH_MSG_ERROR("Attempt to book managed tree " << t->GetName() << " with invalid interval type " << intervalEnumToString(group.interval()));
1569 return StatusCode::FAILURE;
1570 }
1571
1572 std::string name = t->GetName();
1573 std::string genericName = NoOutputStream().getStreamName( this, group_unmanaged, name );
1574 std::string streamName = streamNameFunction()->getStreamName( this, group_unmanaged, name, false );
1575 registerMetadata(streamName, name, group).ignore();
1576 return m_THistSvc->regTree( streamName, t );
1577 }
1578
1579
1580 // This part of the code deals with UNMANAGED type
1581 std::string tName = t->GetName();
1582
1583 if( m_manager != 0 ) {
1584 std::string genericName = NoOutputStream().getStreamName( this, group, tName );
1585 m_manager->writeAndDelete( genericName );
1586 m_manager->passOwnership( t, genericName );
1587 }
1588
1589 std::string streamName = streamNameFunction()->getStreamName( this, group, tName, false );
1590
1591 StatusCode smd = registerMetadata(streamName, tName, group);
1592 if (smd != StatusCode::SUCCESS) return StatusCode::FAILURE;
1593
1594 return m_THistSvc->regTree( streamName, t );
1595}

◆ regTree() [2/2]

StatusCode ManagedMonitorToolBase::regTree ( TTree * t,
const std::string & system,
Interval_t interval,
MgmtAttr_t histo_mgmt = ATTRIB_MANAGED,
const std::string & chain = "",
const std::string & merge = "" )
virtualinherited

Registers a TTree to be included in the output stream using logical parameters that describe it.

Definition at line 1544 of file ManagedMonitorToolBase.cxx.

1547{
1548 MonGroup group( this, system, interval, histo_mgmt, chain, merge );
1549 return regTree( t, group );
1550}
virtual StatusCode regTree(TTree *t, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TTree to be included in the output stream using logical parameters that describe it.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ roi2etaphi()

void MdtVsTgcRawDataValAlg::roi2etaphi ( const Muon::TgcCoinData & cd,
int & eta,
int & phi )
private

Definition at line 28 of file MdtVsTgcRawData_functions.cxx.

28 {
29
30 int roiphi=cd.phi();//phi in 1/48(24) sector for endcap(forward)
31 int roi=cd.roi();//0-147(0-63)
32
33 //int localeta=roi/4;
34
35 if(cd.isForward()){//forward
36
37 int localphi=roi%4;
38
39 //eta=roi/4;
40 eta=roi/4+36;
41 phi=(localphi+roiphi*4)*2;
42
43 }else{//endcap
44
45 int sector=phi2sector(roiphi,1);
46
47 phi=roiphi*4 + ( sector%2==0 ? roi%4 : 3-(roi%4) );
48 eta=roi/4;
49 }
50
51 //eta=52-eta;
52 return;
53
54}
Scalar eta() const
pseudorapidity method

◆ roiphi2mdtSector()

int MdtVsTgcRawDataValAlg::roiphi2mdtSector ( int roiphi,
int ef )
private

Definition at line 70 of file MdtVsTgcRawData_functions.cxx.

70 {
71 int mdtSector=-1;
72 if(ef==0){//forward phi1-24
73 mdtSector=roiphi/2+1;//(phi,sector)= (1,1), (2,2), (3,2), (4,3)
74 }else{//endcap
75 mdtSector=(roiphi+1)/4+1;//(phi,sector)= (1,1), (2,1), (3,2), (4,2)
76 }
77 if(mdtSector>8)mdtSector=1;
78
79 return mdtSector;
80}

◆ roitotalphi2sectorphi()

int MdtVsTgcRawDataValAlg::roitotalphi2sectorphi ( int phi)
private

◆ runStat()

StatusCode ManagedMonitorToolBase::runStat ( )
virtualinherited

This implementation does nothing; equivalent functionality may be provided by procHists( true, true, true ).

Implements IMonitorToolBase.

Definition at line 1661 of file ManagedMonitorToolBase.cxx.

1663{
1664 return StatusCode::SUCCESS;
1665}

◆ setMonManager()

void ManagedMonitorToolBase::setMonManager ( AthenaMonManager * manager)
virtualinherited

Takes a pointer to a managing object to get information from it when needed.

Definition at line 1325 of file ManagedMonitorToolBase.cxx.

1327{
1328 ATH_MSG_DEBUG( "ManagedMonitorToolBase::setMonManager():");
1330 if( m_manager != 0 ) {
1331 ATH_MSG_DEBUG( " --> Setting manager");
1332 m_managerNameProp = m_manager->name();
1333 m_fileKey = m_manager->fileKey();
1334 m_dataType = m_manager->dataType();
1335 m_environment = m_manager->environment();
1336 delete m_streamNameFcn;
1338 }
1339 ATH_MSG_DEBUG( " --> Exiting successfully");
1340}
virtual StreamNameFcn * getNewStreamNameFcn() const

◆ setupOutputStreams()

StatusCode ManagedMonitorToolBase::setupOutputStreams ( std::vector< std::string > Mapping = std::vector<std::string>())
virtualinherited

This implementation does nothing—streams in this class should be managed by the AthenaMonManager.

Consider using MonitorToolBase for user-managed streams.

Implements IMonitorToolBase.

Definition at line 1650 of file ManagedMonitorToolBase.cxx.

1652{
1653 // All instances should write to the stream(s) defined by the
1654 // AthenaMonManager.
1655
1656 return StatusCode::SUCCESS;
1657}

◆ SortMDTSegments()

void MdtVsTgcRawDataValAlg::SortMDTSegments ( const xAOD::MuonSegmentContainer * m_newsegment,
std::vector< const Muon::MuonSegment * >(&) sortedSegments[2][4] )
private

Definition at line 29 of file MdtVsTgcRawData_SegmSorting.cxx.

30 {
31
32 // Loop over all segments in event
33 xAOD::MuonSegmentContainer::const_iterator mdtseg_itr = newsegment->begin();
34 xAOD::MuonSegmentContainer::const_iterator mdtseg_end = newsegment->end();
35 for(; mdtseg_itr!=mdtseg_end; ++mdtseg_itr){
36 if(!(*mdtseg_itr)->muonSegment().isValid())continue;
37 // Get segm
38 const Muon::MuonSegment* segm = dynamic_cast<const Muon::MuonSegment*>(*(*mdtseg_itr)->muonSegment());
39 if (segm == nullptr) {
40 ATH_MSG_ERROR( "no pointer to segm!!!" );
41 break;
42 }
43
44 bool isMdt=false, isEndcap=false; // Flags for whether the Segment has hits from the MDT/Endcap
45 int nMdtMeas[4]={0,0,0,0}; // int array to count number of MDT hits in different stations
46
47 // Loop through contained ROTs and identify used stations
48 for(unsigned int iROT=0; iROT<segm->numberOfContainedROTs(); ++iROT){
49 const Trk::RIO_OnTrack* rio = segm->rioOnTrack(iROT);
50 if(!rio){
51 ATH_MSG_DEBUG("No RIO");
52 continue;
53 }
54 Identifier id = rio->identify();
55
56 // Identify MDT Endcap Segments
57 if(m_idHelperSvc->isMdt(id))isMdt=true;
58 if(m_idHelperSvc->isEndcap(id))isEndcap=true;
59
60 int stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
61 // Large (L) = odd, greater r, Small (S) = even, lower r
62 // 13=EIL 49=EIS 14=EEL 15=EES 17=EML 18=EMS 20=EOL 21=EOS
63 if((stationName==13)||(stationName==49))nMdtMeas[0]++;// MDT
64 if((stationName==14)||(stationName==15))nMdtMeas[1]++;// MDT
65 if((stationName==17)||(stationName==18))nMdtMeas[2]++;// MDT
66 if((stationName==20)||(stationName==21))nMdtMeas[3]++;// MDT
67 }
68
69 // If not Endcap and does not contain MDT hits
70 if(!isMdt||!isEndcap)continue;
71
72 // Get Side
73 int segmAC = (segm->globalPosition().eta()<0);// a:0, c:1
74
75 // Check MDT Stations included in this Segment
76 int nMDTStations=0; int MDTStationj=-1;
77 for(int jMDT=0;jMDT<4;jMDT++){
78 if(nMdtMeas[jMDT]!=0){
79 nMDTStations++;
80 MDTStationj=jMDT;
81 }
82 }
83
84 // MC data has an odd channel set always triggering segments, this cuts them
85 if((segmAC==0)&&(MDTStationj==0)&&
86 (segm->globalPosition().eta()>1.815)&&(segm->globalPosition().eta()<1.82)&&
87 (segm->globalPosition().phi()>2.857)&&(segm->globalPosition().phi()<2.862))continue;
88
89 // If there is only one station pass the segment data on to the variables
90 if(nMDTStations==1){
91 //HasStationSegm[segmAC][MDTStationj]=true;
92 sortedSegments[segmAC][MDTStationj].push_back(segm);
93 }
94 }// Loop over segments
95}// End of function

◆ stationGasGap2layer()

int MdtVsTgcRawDataValAlg::stationGasGap2layer ( int station,
int GasGap )
private

Definition at line 114 of file MdtVsTgcRawData_functions.cxx.

114 {
115 int layer=0;
116 if(station==41||station==42){
117 layer += GasGap;
118 }else if(station==43||station==44){
119 layer = 3+GasGap;
120 }else if(station==45||station==46){
121 layer = 5+GasGap;
122 }
123 return layer;
124}

◆ streamNameFunction()

ManagedMonitorToolBase::StreamNameFcn * ManagedMonitorToolBase::streamNameFunction ( )
virtualinherited

Returns the function object that converts logical paramters into a physical stream name.

Definition at line 450 of file ManagedMonitorToolBase.cxx.

452{
453 if( m_streamNameFcn == 0 ) {
454 msg(MSG::ERROR) << "!! streamNameFunction() has not been initialized !!" << endmsg;
455 msg(MSG::ERROR) << " --> neither ManagedMonitorToolBase::initialize() nor" << endmsg;
456 msg(MSG::ERROR) << " --> ManagedMonitorToolBase::setMonManager() has been called." << endmsg;
457 msg(MSG::ERROR) << " --> Correct configuration cannot be guaranteed from this point." << endmsg;
459 }
460 return m_streamNameFcn;
461}

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ tgceffcalc()

void MdtVsTgcRawDataValAlg::tgceffcalc ( const xAOD::MuonSegmentContainer * m_newsegment,
const Muon::TgcPrepDataContainer * tgc_prepcontainer )
private

Definition at line 36 of file MdtVsTgcRawData_TGCEffCheck.cxx.

37 {
38 ATH_MSG_DEBUG("inside tgcEIFIeffcalc" );
40 // Declare vector arrays to hold segment pointers
41
42 // Holds Segments sorted into MDT Stations on each side
43 std::vector<const Muon::MuonSegment*> sortedSegments[2][4]; //[AC][MDTStation]
44
45 // Holds Segments which have been disqualified, any segments in this array are ignored when looping through sortedSegments
46 std::vector<const Muon::MuonSegment*> DQdisqualifiedSegments[2][4]; //[AC][MDTStation] // Segments which have been disqualified by DQ
47 std::vector<const Muon::MuonSegment*> MATCHdisqualifiedSegments[2][4];//[AC][MDTStation] // Segments which have been disqualified by DQ or already been included in a track
48
49 // Holds Segments which have been matched into a track
50 std::vector<SegmTrack> matchedSegments[2]; //[AC]
51
52
54 // Sort and filter Segments
55
56 // Sort Segments from segmcollection into correct bin in sortedSegments array
57 SortMDTSegments(newmdtsegment, sortedSegments);
58 // Disqualify Segments with bad DQ
59 DQCheckMDTSegments(sortedSegments, DQdisqualifiedSegments);
60 for(int i=0;i<2;i++){
61 for(int jMDT=0;jMDT<4;jMDT++){
62 MATCHdisqualifiedSegments[i][jMDT] = DQdisqualifiedSegments[i][jMDT];
63 }
64 }
65
66
68 // Segment Track Method
69 // Match up Segments into tracks
70 MatchMDTSegments(sortedSegments, MATCHdisqualifiedSegments, matchedSegments);
71 // Use tracks to look for TGC hits
72 CheckTGConTrack(matchedSegments, tgc_prepcontainer);
73
74
76 // Midstation-only Method
77
78 // Use segments to check Midstation again
79 MidstationOnlyCheck(sortedSegments, DQdisqualifiedSegments, tgc_prepcontainer);
80
81 return;
82}// End of function
void SortMDTSegments(const xAOD::MuonSegmentContainer *m_newsegment, std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4])
void MatchMDTSegments(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], std::vector< SegmTrack >(&matchedSegments)[2])
void CheckTGConTrack(std::vector< SegmTrack >(&matchedSegments)[2], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void MidstationOnlyCheck(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void DQCheckMDTSegments(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4])

◆ tgceffcalcfinalize()

void MdtVsTgcRawDataValAlg::tgceffcalcfinalize ( )
private

Definition at line 145 of file MdtVsTgcRawData_TGCEffCheck.cxx.

145 {
146 int beff, bdenom, berror;
147 float feff, fdenom;
148 for(int i=0;i<2;i++){// AC
149 // Station Coordinate Efficiency Histograms
150 for(int k=0;k<2;k++){// WireStrip
151 // Loop Numerator and Denominator, total up histograms
152 for(int e=1;e<3;e++){
153 TList histlist;
154 histlist.Add(m_eff_stationmapbase[i][k][e]);
155 histlist.Add(m_eff_stationmapmid[i][k][e]);
156 m_eff_stationmap[i][k][e]->Merge(&histlist);
157 }
158
159 const int nhtypes = 3;
160 // Make array of pointers to different efficiency histogram types
161 TH2 *histarray[nhtypes][4] = {{ m_eff_stationmapbase[i][k][0], m_eff_stationmapbase[i][k][1], m_eff_stationmapbase[i][k][2], m_eff_stationmapbase[i][k][3]},
164 for(int h=0;h<nhtypes;h++){
165 // Calculate Efficiency
166 histarray[h][0]->Divide(histarray[h][1], histarray[h][2]);
167
168 // Calculate Error
169 int nX=histarray[h][3]->GetNbinsX();
170 int nY=histarray[h][3]->GetNbinsY();
171 for(int x=1;x<=nX;x++){
172 for(int y=1;y<=nY;y++){
173 beff =histarray[h][0]->GetBin(x,y);
174 bdenom=histarray[h][2]->GetBin(x,y);
175 berror=histarray[h][3]->GetBin(x,y);
176
177 feff =histarray[h][0]->GetBinContent(beff);
178 fdenom=histarray[h][2]->GetBinContent(bdenom);
179
180 float result = 0;
181 if(fdenom>0){
182 result=sqrt(feff*(1-feff)/fdenom);
183 }
184 histarray[h][3]->SetBinContent(berror,result);
185 }// nY Bins
186 }// nX Bins
187 }
188 }// WireStrip
189 }// AC
190
191 return;
192}// End of function
#define y

◆ TGCgetlayer()

int MdtVsTgcRawDataValAlg::TGCgetlayer ( int stationName,
int g )
private

Definition at line 196 of file MdtVsTgcRawData_TGCEffCheck.cxx.

196 {
197 if(g<1){
198 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap g=" << g );
199 return -1;
200 }
201 int l = g-1;
202 if(stationName==41||stationName==42){
203 if(g>3){
204 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName << " g=" << g );
205 return -1;
206 }
207 }else if(stationName==43||stationName==44){
208 if(g>2){
209 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName << " g=" << g );
210 return -1;
211 }
212 l+=3;
213 }else if(stationName==45||stationName==46){
214 if(g>2){
215 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName << " g=" << g );
216 return -1;
217 }
218 l+=5;
219 }else if(stationName==47||stationName==48){
220 if(g>2){
221 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName << " g=" << g );
222 return -1;
223 }
224 l+=7;
225 }else{
226 ATH_MSG_WARNING( "TGCgetlayer passed invalid stationName n=" << stationName );
227 return -1;
228 }
229 return l;
230}// End of function

◆ TGClayer2stationindex()

int MdtVsTgcRawDataValAlg::TGClayer2stationindex ( int l)
private

Definition at line 234 of file MdtVsTgcRawData_TGCEffCheck.cxx.

234 {
235 if(l==0||l==1||l==2)return 0;
236 else if(l==3||l==4)return 1;
237 else if(l==5||l==6)return 2;
238 else if(l==7||l==8)return 3;
239 else{
240 ATH_MSG_WARNING( "TGClayer2Station passed invalid layer number:" << l );
241 return -1;
242 }
243}// End of function

◆ TGCstationname2stationindex()

int MdtVsTgcRawDataValAlg::TGCstationname2stationindex ( int stationName)
private

Definition at line 246 of file MdtVsTgcRawData_TGCEffCheck.cxx.

246 {
247 if(stationName==41||stationName==42)return 0;
248 else if(stationName==43||stationName==44)return 1;
249 else if(stationName==45||stationName==46)return 2;
250 else if(stationName==47||stationName==48)return 3;
251 else{
252 ATH_MSG_WARNING( "TGCstationname2stationindex passed invalid stationName n=" << stationName );
253 return -1;
254 }
255}// End of function

◆ THistSvc_deReg_fixTGraph()

StatusCode ManagedMonitorToolBase::THistSvc_deReg_fixTGraph ( TFile * file,
TGraph * theGraph,
std::string & directoryName )
protectedinherited

Fixes THistSvc->deReg(obj) when obj is TGraph instance.

Read more in source file about this bug.

Definition at line 1036 of file ManagedMonitorToolBase.cxx.

1038{
1039 // THistSvc employs TDirectory Append method when registering TGraph.
1040 // When deReg is used to de-register TGraph object, THistSvc only removes the object
1041 // from its internal management but forgets to delete from TDirectory.
1042 // The current method fixes this problem by removing the TGraph object manually
1043 // after THistSvc->deReg(TGraph* obj) is called.
1044
1045 // Saves and restores gFile and gDirectory
1046 GlobalDirectoryRestore restore;
1047
1048 // This check is true when TGraph object is removed successfully
1049 bool graphRemoved = false;
1050
1051 file->cd("/");
1052 TDirectory* dir = file->GetDirectory(directoryName.c_str());
1053 if (dir != 0) {
1054 dir->cd();
1055 TObject* obj = dir->Remove(theGraph);
1056 if (obj != 0)
1057 graphRemoved = true;
1058 }
1059
1060 if (!graphRemoved) {
1061 return StatusCode::FAILURE;
1062 }
1063
1064 return StatusCode::SUCCESS;
1065}

◆ trigChainsArePassed()

bool ManagedMonitorToolBase::trigChainsArePassed ( std::vector< std::string > & vTrigNames)
protectedvirtualinherited

Definition at line 2092 of file ManagedMonitorToolBase.cxx.

2094{
2095 ATH_MSG_DEBUG( "ManagedMonitorToolBase::trigChainsArePassed:");
2096
2097 for(unsigned int i=0; i<vTrigNames.size(); i++) {
2098 if( m_trigDecTool->isPassed(vTrigNames[i]) ) {
2099 ATH_MSG_DEBUG( " + \"" << vTrigNames[i] << "\" passed, returning \'true\'");
2100 return true;
2101 }
2102 else {
2103 ATH_MSG_DEBUG( " - \"" << vTrigNames[i] << "\" did not pass");
2104 }
2105 }
2106
2107 return false;
2108}

◆ updateTriggersForGroups()

void ManagedMonitorToolBase::updateTriggersForGroups ( std::vector< std::string > & vTrigChainNames)
protectedinherited

Definition at line 2130 of file ManagedMonitorToolBase.cxx.

2131 {
2132 for (size_t i = 0; i < vTrigChainNames.size(); ++i) {
2133 std::string& thisName = vTrigChainNames[i];
2134 if (thisName.compare(0, 9, "CATEGORY_") ==0) {
2135 ATH_MSG_DEBUG("Found a trigger category: " << thisName << ". We will unpack it.");
2136 std::vector<std::string> triggers = m_trigTranslator->translate(thisName.substr(9,std::string::npos));
2137 std::ostringstream oss;
2138 oss << "(";
2139 for (size_t itrig = 0; itrig < triggers.size(); ++itrig) {
2140 if (itrig != 0) {
2141 oss << "|";
2142 }
2143 oss << triggers[itrig];
2144 }
2145 oss << ")";
2146 // replace with new value
2147 std::string newval = oss.str();
2148 ATH_MSG_DEBUG("Replaced with " << newval);
2149 vTrigChainNames[i] = std::move(newval);
2150 }
2151 }
2152}
PublicToolHandle< ITriggerTranslatorTool > m_trigTranslator

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ writeAndDelete()

StatusCode ManagedMonitorToolBase::writeAndDelete ( TH1 * h,
const MonGroup & group )
virtualinherited

Write out histogram and delete it.

Definition at line 1599 of file ManagedMonitorToolBase.cxx.

1600 {
1601 if (!h)
1602 return StatusCode::FAILURE;
1603
1604 std::string hName = h->GetName();
1605
1606 if( m_manager != 0 ) {
1607 std::string genericName = NoOutputStream().getStreamName( this, group, hName );
1608 m_manager->writeAndDelete( genericName );
1609 }
1610 return StatusCode::SUCCESS;
1611}

Member Data Documentation

◆ m_bookHistogramsInitial

bool ManagedMonitorToolBase::m_bookHistogramsInitial
privateinherited

Definition at line 893 of file ManagedMonitorToolBase.h.

◆ m_chamberName

std::string MdtVsTgcRawDataValAlg::m_chamberName
private

Definition at line 75 of file MdtVsTgcRawDataValAlg.h.

◆ m_checkCabling

bool MdtVsTgcRawDataValAlg::m_checkCabling
private

Definition at line 72 of file MdtVsTgcRawDataValAlg.h.

◆ m_cosmicStation

int MdtVsTgcRawDataValAlg::m_cosmicStation
private

Definition at line 80 of file MdtVsTgcRawDataValAlg.h.

◆ m_d

Imp* ManagedMonitorToolBase::m_d
privateinherited

Definition at line 900 of file ManagedMonitorToolBase.h.

◆ m_dataType

AthenaMonManager::DataType_t ManagedMonitorToolBase::m_dataType
protectedinherited

Definition at line 838 of file ManagedMonitorToolBase.h.

◆ m_dataTypeStr

std::string ManagedMonitorToolBase::m_dataTypeStr
protectedinherited

Definition at line 834 of file ManagedMonitorToolBase.h.

◆ m_defaultLBDuration

float ManagedMonitorToolBase::m_defaultLBDuration
privateinherited

Definition at line 895 of file ManagedMonitorToolBase.h.

◆ m_detailLevel

unsigned int ManagedMonitorToolBase::m_detailLevel
protectedinherited

Definition at line 836 of file ManagedMonitorToolBase.h.

◆ m_DetectorManagerKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> MdtVsTgcRawDataValAlg::m_DetectorManagerKey
private
Initial value:
{this, "DetectorManagerKey",
"MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}

Definition at line 66 of file MdtVsTgcRawDataValAlg.h.

66 {this, "DetectorManagerKey",
67 "MuonDetectorManager",
68 "Key of input MuonDetectorManager condition data"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_DQFilterTools

ToolHandleArray<IDQFilterTool> ManagedMonitorToolBase::m_DQFilterTools {this,"FilterTools",{}}
protectedinherited

Definition at line 849 of file ManagedMonitorToolBase.h.

849{this,"FilterTools",{}};

◆ m_eff_stationmap

TH2* MdtVsTgcRawDataValAlg::m_eff_stationmap[2][2][4] {}
private

Definition at line 145 of file MdtVsTgcRawDataValAlg.h.

145{}; // [AC][WireStrip][EffNumDenomError] //Filled in postprocessor

◆ m_eff_stationmapbase

TH2* MdtVsTgcRawDataValAlg::m_eff_stationmapbase[2][2][4] {}
private

Definition at line 143 of file MdtVsTgcRawDataValAlg.h.

143{}; // [AC][WireStrip][EffNumDenomError]

◆ m_eff_stationmapmid

TH2* MdtVsTgcRawDataValAlg::m_eff_stationmapmid[2][2][4] {}
private

Definition at line 144 of file MdtVsTgcRawDataValAlg.h.

144{}; // [AC][WireStrip][EffNumDenomError]

◆ m_endOfEventsBlock

bool ManagedMonitorToolBase::m_endOfEventsBlock
privateinherited

Definition at line 823 of file ManagedMonitorToolBase.h.

◆ m_endOfLowStat

bool ManagedMonitorToolBase::m_endOfLowStat
privateinherited

Definition at line 823 of file ManagedMonitorToolBase.h.

◆ m_endOfLumiBlock

bool ManagedMonitorToolBase::m_endOfLumiBlock
privateinherited

Definition at line 823 of file ManagedMonitorToolBase.h.

◆ m_endOfRun

bool ManagedMonitorToolBase::m_endOfRun
privateinherited

Definition at line 823 of file ManagedMonitorToolBase.h.

◆ m_environment

AthenaMonManager::Environment_t ManagedMonitorToolBase::m_environment
protectedinherited

Definition at line 839 of file ManagedMonitorToolBase.h.

◆ m_environmentStr

std::string ManagedMonitorToolBase::m_environmentStr
protectedinherited

Definition at line 835 of file ManagedMonitorToolBase.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fileKey

std::string ManagedMonitorToolBase::m_fileKey
protectedinherited

Definition at line 833 of file ManagedMonitorToolBase.h.

◆ m_haveClearedLastEventBlock

bool ManagedMonitorToolBase::m_haveClearedLastEventBlock
protectedinherited

Definition at line 866 of file ManagedMonitorToolBase.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MdtVsTgcRawDataValAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 69 of file MdtVsTgcRawDataValAlg.h.

69{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_lastEvent

int MdtVsTgcRawDataValAlg::m_lastEvent
private

Definition at line 79 of file MdtVsTgcRawDataValAlg.h.

◆ m_lastHigStatInterval

int ManagedMonitorToolBase::m_lastHigStatInterval
protectedinherited

Definition at line 861 of file ManagedMonitorToolBase.h.

◆ m_lastLowStatInterval

int ManagedMonitorToolBase::m_lastLowStatInterval
protectedinherited

Definition at line 861 of file ManagedMonitorToolBase.h.

◆ m_lastLumiBlock

unsigned int ManagedMonitorToolBase::m_lastLumiBlock
protectedinherited

Definition at line 859 of file ManagedMonitorToolBase.h.

◆ m_lastMedStatInterval

int ManagedMonitorToolBase::m_lastMedStatInterval
protectedinherited

Definition at line 861 of file ManagedMonitorToolBase.h.

◆ m_lastRun

unsigned int ManagedMonitorToolBase::m_lastRun
protectedinherited

Definition at line 860 of file ManagedMonitorToolBase.h.

◆ m_lbDurationDataKey

SG::ReadCondHandleKey<LBDurationCondData> ManagedMonitorToolBase::m_lbDurationDataKey {this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"}
privateinherited

Definition at line 888 of file ManagedMonitorToolBase.h.

889{this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"};

◆ m_lumiDataKey

SG::ReadCondHandleKey<LuminosityCondData> ManagedMonitorToolBase::m_lumiDataKey {this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"}
privateinherited

Definition at line 886 of file ManagedMonitorToolBase.h.

887{this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"};

◆ m_manager

AthenaMonManager* ManagedMonitorToolBase::m_manager
protectedinherited

Definition at line 829 of file ManagedMonitorToolBase.h.

◆ m_managerNameProp

std::string ManagedMonitorToolBase::m_managerNameProp
protectedinherited

Definition at line 831 of file ManagedMonitorToolBase.h.

◆ m_mdt_PrepDataContainerName

SG::ReadHandleKey<Muon::MdtPrepDataContainer> MdtVsTgcRawDataValAlg::m_mdt_PrepDataContainerName {this,"MdtPrepDataContainer","MDT_DriftCircles","MDT PRDs"}
private

Definition at line 83 of file MdtVsTgcRawDataValAlg.h.

83{this,"MdtPrepDataContainer","MDT_DriftCircles","MDT PRDs"};

◆ m_mdt_SegmentCollectionName

SG::ReadHandleKey<xAOD::MuonSegmentContainer> MdtVsTgcRawDataValAlg::m_mdt_SegmentCollectionName {this,"MdtSegmentCollection","MuonSegments","muon segments"}
private

Definition at line 84 of file MdtVsTgcRawDataValAlg.h.

84{this,"MdtSegmentCollection","MuonSegments","muon segments"};

◆ m_mdt_segmmap

TH2* MdtVsTgcRawDataValAlg::m_mdt_segmmap[2][4] {}
private

Definition at line 111 of file MdtVsTgcRawDataValAlg.h.

111{}; // [AC][StationIndex]

◆ m_mdt_segmmatchsag

TH1* MdtVsTgcRawDataValAlg::m_mdt_segmmatchsag[2][4][4][4] {}
private

Definition at line 150 of file MdtVsTgcRawDataValAlg.h.

150{}; // [AC][MDTStation][MDTStation][RhoEtaPhiThe]

◆ m_mdt_segmposdirsag

TH1* MdtVsTgcRawDataValAlg::m_mdt_segmposdirsag[2][4][4] {}
private

Definition at line 151 of file MdtVsTgcRawDataValAlg.h.

151{}; // [AC][MDTStation][RhoEtaPhiThe]

◆ m_mdt_trackchecksag

TH1* MdtVsTgcRawDataValAlg::m_mdt_trackchecksag[2][4][4][4][2] {}
private

Definition at line 153 of file MdtVsTgcRawDataValAlg.h.

153{};// [AC][MDTStation][MDTStation][RhoEtaPhiThe]

◆ m_mdt_trackdirdirsag

TH1* MdtVsTgcRawDataValAlg::m_mdt_trackdirdirsag[2][4][4][4] {}
private

Definition at line 152 of file MdtVsTgcRawDataValAlg.h.

152{}; // [AC][MDTStation][MDTStation][RhoEtaPhiThe]

◆ m_MdtAdcCut

int MdtVsTgcRawDataValAlg::m_MdtAdcCut
private

Definition at line 86 of file MdtVsTgcRawDataValAlg.h.

◆ m_MdtTdcCut

int MdtVsTgcRawDataValAlg::m_MdtTdcCut
private

Definition at line 87 of file MdtVsTgcRawDataValAlg.h.

◆ m_metadataMap

MDMap_t ManagedMonitorToolBase::m_metadataMap
protectedinherited

Definition at line 827 of file ManagedMonitorToolBase.h.

◆ m_mvt_cutspassed

TH1* MdtVsTgcRawDataValAlg::m_mvt_cutspassed[2] {}
private

Definition at line 109 of file MdtVsTgcRawDataValAlg.h.

109{}; // [AC]

◆ m_mvt_extrprdsag

TH1* MdtVsTgcRawDataValAlg::m_mvt_extrprdsag[2][4][2][2][4] {}
private

Definition at line 147 of file MdtVsTgcRawDataValAlg.h.

147{}; // [AC][TGCStation][FE][WireStrip][RhoEtaPhi]

◆ m_mvt_extrprdsag2

TH1* MdtVsTgcRawDataValAlg::m_mvt_extrprdsag2[2][4][2][2][4] {}
private

Definition at line 148 of file MdtVsTgcRawDataValAlg.h.

148{}; // [AC][TGCStation][FE][WireStrip][RhoEtaPhi]

◆ m_nEvents

unsigned int ManagedMonitorToolBase::m_nEvents
protectedinherited

Definition at line 863 of file ManagedMonitorToolBase.h.

◆ m_nEventsIgnoreTrigger

unsigned int ManagedMonitorToolBase::m_nEventsIgnoreTrigger
protectedinherited

Definition at line 864 of file ManagedMonitorToolBase.h.

◆ m_newEventsBlock

bool ManagedMonitorToolBase::m_newEventsBlock
privateinherited

Definition at line 822 of file ManagedMonitorToolBase.h.

◆ m_newHigStatInterval

bool ManagedMonitorToolBase::m_newHigStatInterval
privateinherited

Definition at line 820 of file ManagedMonitorToolBase.h.

◆ m_newLowStat

bool ManagedMonitorToolBase::m_newLowStat
privateinherited

Definition at line 821 of file ManagedMonitorToolBase.h.

◆ m_newLowStatInterval

bool ManagedMonitorToolBase::m_newLowStatInterval
privateinherited

Definition at line 820 of file ManagedMonitorToolBase.h.

◆ m_newLumiBlock

bool ManagedMonitorToolBase::m_newLumiBlock
privateinherited

Definition at line 821 of file ManagedMonitorToolBase.h.

◆ m_newMedStatInterval

bool ManagedMonitorToolBase::m_newMedStatInterval
privateinherited

Definition at line 820 of file ManagedMonitorToolBase.h.

◆ m_newRun

bool ManagedMonitorToolBase::m_newRun
privateinherited

Definition at line 821 of file ManagedMonitorToolBase.h.

◆ m_nLumiBlocks

unsigned int ManagedMonitorToolBase::m_nLumiBlocks
protectedinherited

Definition at line 865 of file ManagedMonitorToolBase.h.

◆ m_path

std::string ManagedMonitorToolBase::m_path
protectedinherited

Definition at line 852 of file ManagedMonitorToolBase.h.

◆ m_preScaleProp

long ManagedMonitorToolBase::m_preScaleProp
protectedinherited

Definition at line 853 of file ManagedMonitorToolBase.h.

◆ m_procNEventsProp

long ManagedMonitorToolBase::m_procNEventsProp
protectedinherited

Definition at line 851 of file ManagedMonitorToolBase.h.

◆ m_sector

int MdtVsTgcRawDataValAlg::m_sector
private

Definition at line 77 of file MdtVsTgcRawDataValAlg.h.

◆ m_side

int MdtVsTgcRawDataValAlg::m_side
private

Definition at line 78 of file MdtVsTgcRawDataValAlg.h.

◆ m_stationHists

MuonDQAHistMap MdtVsTgcRawDataValAlg::m_stationHists
private

Definition at line 63 of file MdtVsTgcRawDataValAlg.h.

◆ m_StationSize

std::string MdtVsTgcRawDataValAlg::m_StationSize
private

Definition at line 76 of file MdtVsTgcRawDataValAlg.h.

◆ m_streamNameFcn

StreamNameFcn* ManagedMonitorToolBase::m_streamNameFcn
protectedinherited

Definition at line 841 of file ManagedMonitorToolBase.h.

◆ m_supportedIntervalsForRebooking

std::set<Interval_t> ManagedMonitorToolBase::m_supportedIntervalsForRebooking
privateinherited

Definition at line 896 of file ManagedMonitorToolBase.h.

◆ m_templateEfficiencies

std::map< Interval_t, std::vector< MgmtParams<TEfficiency> > > ManagedMonitorToolBase::m_templateEfficiencies
protectedinherited

Definition at line 676 of file ManagedMonitorToolBase.h.

◆ m_templateGraphs

std::map< Interval_t, std::vector< MgmtParams<TGraph> > > ManagedMonitorToolBase::m_templateGraphs
protectedinherited

Definition at line 668 of file ManagedMonitorToolBase.h.

◆ m_templateHistograms

std::map< Interval_t, std::vector< MgmtParams<TH1> > > ManagedMonitorToolBase::m_templateHistograms
protectedinherited

Definition at line 664 of file ManagedMonitorToolBase.h.

◆ m_templateTrees

std::map< Interval_t, std::vector< MgmtParams<TTree> > > ManagedMonitorToolBase::m_templateTrees
protectedinherited

Definition at line 672 of file ManagedMonitorToolBase.h.

◆ m_tgc_CoinContainerName

SG::ReadHandleKey<Muon::TgcCoinDataContainer> MdtVsTgcRawDataValAlg::m_tgc_CoinContainerName {this,"OutputCoinCollection","TrigT1CoinDataCollection","TGC coincidences"}
private

Definition at line 82 of file MdtVsTgcRawDataValAlg.h.

82{this,"OutputCoinCollection","TrigT1CoinDataCollection","TGC coincidences"};

◆ m_tgc_prdcompsag

TH1* MdtVsTgcRawDataValAlg::m_tgc_prdcompsag[2][2][4] {}
private

Definition at line 149 of file MdtVsTgcRawDataValAlg.h.

149{}; // [AC][TGCStation][RhoEtaPhiZ]

◆ m_tgc_PrepDataContainerName

SG::ReadHandleKey<Muon::TgcPrepDataContainer> MdtVsTgcRawDataValAlg::m_tgc_PrepDataContainerName {this,"TgcPrepDataContainer","TGC_Measurements","TGC PRDs"}
private

Definition at line 81 of file MdtVsTgcRawDataValAlg.h.

81{this,"TgcPrepDataContainer","TGC_Measurements","TGC PRDs"};

◆ m_tgclv1file

bool MdtVsTgcRawDataValAlg::m_tgclv1file
private

Definition at line 73 of file MdtVsTgcRawDataValAlg.h.

◆ m_THistSvc

ServiceHandle<ITHistSvc> ManagedMonitorToolBase::m_THistSvc
protectedinherited

Definition at line 843 of file ManagedMonitorToolBase.h.

◆ m_TREarray

const MuonGM::TgcReadoutElement* MdtVsTgcRawDataValAlg::m_TREarray[8][2][9][49] {}
private

Definition at line 94 of file MdtVsTgcRawDataValAlg.h.

94{}; // [StationName][AC][StationEta][StationPhi]

◆ m_trigDecTool

PublicToolHandle<Trig::ITrigDecisionTool> ManagedMonitorToolBase::m_trigDecTool {this, "TrigDecisionTool",""}
protectedinherited

Definition at line 845 of file ManagedMonitorToolBase.h.

845{this, "TrigDecisionTool",""};

◆ m_triggerChainProp

std::string ManagedMonitorToolBase::m_triggerChainProp
protectedinherited

Definition at line 854 of file ManagedMonitorToolBase.h.

◆ m_triggerGroupProp

std::string ManagedMonitorToolBase::m_triggerGroupProp
protectedinherited

Definition at line 855 of file ManagedMonitorToolBase.h.

◆ m_trigLiveFractionDataKey

SG::ReadCondHandleKey<TrigLiveFractionCondData> ManagedMonitorToolBase::m_trigLiveFractionDataKey {this,"TrigLiveFractionCondDataKey","TrigLiveFractionCondData","SG Key of TrigLiveFractionCondData object"}
privateinherited

Definition at line 890 of file ManagedMonitorToolBase.h.

891{this,"TrigLiveFractionCondDataKey","TrigLiveFractionCondData","SG Key of TrigLiveFractionCondData object"};

◆ m_trigTranslator

PublicToolHandle<ITriggerTranslatorTool> ManagedMonitorToolBase::m_trigTranslator {this,"TriggerTranslatorTool",""}
protectedinherited

Definition at line 847 of file ManagedMonitorToolBase.h.

847{this,"TriggerTranslatorTool",""};

◆ m_useLumi

bool ManagedMonitorToolBase::m_useLumi
privateinherited

Definition at line 894 of file ManagedMonitorToolBase.h.

◆ m_useTrigger

bool ManagedMonitorToolBase::m_useTrigger
protectedinherited

Definition at line 857 of file ManagedMonitorToolBase.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vTrigChainNames

std::vector<std::string> ManagedMonitorToolBase::m_vTrigChainNames
protectedinherited

Definition at line 680 of file ManagedMonitorToolBase.h.

◆ m_vTrigGroupNames

std::vector<std::string> ManagedMonitorToolBase::m_vTrigGroupNames
protectedinherited

Definition at line 680 of file ManagedMonitorToolBase.h.


The documentation for this class was generated from the following files: