ATLAS Offline Software
SCT_CalibHvTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #ifndef SCT_CalibHvTool_h
12 #define SCT_CalibHvTool_h
13 
14 //Athena includes
16 
17 //Inner detector includes
18 #include "InDetIdentifier/SCT_ID.h"
19 
20 //local includes
22 #include "SCT_ConditionsTools/ISCT_DCSConditionsTool.h" //template parameter
23 
24 // Gaudi includes
25 #include "GaudiKernel/ToolHandle.h"
26 
27 //STL includes
28 #include <string>
29 #include <vector>
30 #include <queue>
31 #include <utility> //for 'pair'
32 
33 //fwd declarations
34 class StatusCode;
35 class ISvcLocator;
36 class IdentifierHash;
37 
38 class SCT_CalibHvTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
39 {
40 
41  public:
42  //@name Tool methods, reimplemented
44  SCT_CalibHvTool(const std::string&, const std::string&, const IInterface*);
45  virtual ~SCT_CalibHvTool() = default;
46  virtual StatusCode initialize();
47  virtual StatusCode finalize();
49  //@name ISCT_CalibHistoTool methods, reimplemented
51  virtual bool book();
52  virtual bool fill(const bool fromData=false);
53  virtual bool fillFromData();
55 
56  private:
61  };
62 
63  ToolHandle<ISCT_DCSConditionsTool> m_DCSConditionsTool{this, "SCT_DCSConditionsTool", "SCT_DCSConditionsTool", "Tool to retrieve SCT DCS information"};
64 
65  const SCT_ID* m_pSCTHelper{nullptr};
68  typedef std::vector<int> VecInt;
71 
72  //private use in this class
73  int m_maxq{100};
74  // For HV trips
75  std::vector<std::queue<int>> m_phvtripQueue;
76  std::queue<int> m_prevLBN;
81  //
86  int m_tq[100] {0};
87 
88  std::vector<std::vector<std::pair<int, int>>> m_summarytrips;
89  std::vector<std::vector<std::pair<int, int>>> m_summarytripslb;
90  bool m_outputLowHits{false};
91  int m_lowHitCut{100};
93  template<class T>
94  bool retrievedTool(T& tool, const std::string& toolName) const {
95  if (tool.retrieve().isFailure()) {
96  ATH_MSG_ERROR("Unable to retrieve " << toolName);
97  return false;
98  }
99  return true;
100  }
101 
102 };
103 #endif
SCT_CalibHvTool::m_outputLowHits
bool m_outputLowHits
Definition: SCT_CalibHvTool.h:90
SCT_CalibHvTool::m_phvtripQueue
std::vector< std::queue< int > > m_phvtripQueue
Definition: SCT_CalibHvTool.h:75
SCT_CalibHvTool::n_phiBinsECMiddle
@ n_phiBinsECMiddle
Definition: SCT_CalibHvTool.h:59
SCT_CalibHvTool::n_phiBinsB1
@ n_phiBinsB1
Definition: SCT_CalibHvTool.h:58
SCT_CalibHvTool::n_phiBinsB3
@ n_phiBinsB3
Definition: SCT_CalibHvTool.h:58
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
SCT_CalibHvTool::initialize
virtual StatusCode initialize()
Definition: SCT_CalibHvTool.cxx:30
SCT_CalibHvTool::m_waferItrEnd
SCT_ID::const_id_iterator m_waferItrEnd
Definition: SCT_CalibHvTool.h:67
SCT_CalibHvTool::n_BSErrorType
@ n_BSErrorType
Definition: SCT_CalibHvTool.h:60
SCT_CalibHvTool::m_sct_waferHash
VecInt * m_sct_waferHash
Definition: SCT_CalibHvTool.h:69
SCT_CalibHvTool::fillFromData
virtual bool fillFromData()
Definition: SCT_CalibHvTool.cxx:192
SCT_CalibHvTool::m_relativetriplimit
double m_relativetriplimit
Definition: SCT_CalibHvTool.h:85
SCT_CalibHvTool::SCT_CalibHvTool
SCT_CalibHvTool(const std::string &, const std::string &, const IInterface *)
Definition: SCT_CalibHvTool.cxx:24
SCT_ID::const_id_iterator
std::vector< Identifier >::const_iterator const_id_iterator
Definition: SCT_ID.h:73
SCT_CalibHvTool::m_phvtripHasItTripped_prev
VecInt m_phvtripHasItTripped_prev
Definition: SCT_CalibHvTool.h:80
SCT_CalibHvTool::m_pSCTHelper
const SCT_ID * m_pSCTHelper
Definition: SCT_CalibHvTool.h:65
SCT_CalibHvTool::n_phiBinsB2
@ n_phiBinsB2
Definition: SCT_CalibHvTool.h:58
SCT_CalibHvTool::~SCT_CalibHvTool
virtual ~SCT_CalibHvTool()=default
SCT_CalibHvTool::n_stripPerChip
@ n_stripPerChip
Definition: SCT_CalibHvTool.h:57
SCT_CalibHvTool::book
virtual bool book()
Definition: SCT_CalibHvTool.cxx:41
SCT_CalibHvTool::m_absolutetriplimit
double m_absolutetriplimit
Definition: SCT_CalibHvTool.h:84
SCT_CalibHvTool::lastBSErrorType
@ lastBSErrorType
Definition: SCT_CalibHvTool.h:60
SCT_CalibHvTool::n_chipPerModule
@ n_chipPerModule
Definition: SCT_CalibHvTool.h:57
SCT_CalibHvTool::retrievedTool
bool retrievedTool(T &tool, const std::string &toolName) const
retrieve a tool and report if it failed
Definition: SCT_CalibHvTool.h:94
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SCT_CalibHvTool::m_summarytripslb
std::vector< std::vector< std::pair< int, int > > > m_summarytripslb
Definition: SCT_CalibHvTool.h:89
SCT_CalibHvTool::m_DCSConditionsTool
ToolHandle< ISCT_DCSConditionsTool > m_DCSConditionsTool
Definition: SCT_CalibHvTool.h:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SCT_CalibHvTool::n_elements
@ n_elements
Definition: SCT_CalibHvTool.h:59
SCT_CalibHvTool::m_phvtripRunningTotalInt
VecInt m_phvtripRunningTotalInt
Definition: SCT_CalibHvTool.h:77
AthAlgTool.h
SCT_CalibHvTool::n_phiBinsECShort
@ n_phiBinsECShort
Definition: SCT_CalibHvTool.h:59
SCT_CalibHvTool::m_sct_numHitsInWafer
VecInt * m_sct_numHitsInWafer
Definition: SCT_CalibHvTool.h:70
SCT_CalibHvTool
Definition: SCT_CalibHvTool.h:39
SCT_CalibHvTool::firstBSErrorType
@ firstBSErrorType
Definition: SCT_CalibHvTool.h:60
SCT_CalibHvTool::fill
virtual bool fill(const bool fromData=false)
Definition: SCT_CalibHvTool.cxx:62
SCT_CalibHvTool::m_phvtripHasItTripped
VecInt m_phvtripHasItTripped
Definition: SCT_CalibHvTool.h:79
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
SCT_CalibHvTool::m_prevLBN
std::queue< int > m_prevLBN
Definition: SCT_CalibHvTool.h:76
SCT_CalibHvTool::n_chipPerSide
@ n_chipPerSide
Definition: SCT_CalibHvTool.h:57
SCT_CalibHvTool::n_etaInBarrel
@ n_etaInBarrel
Definition: SCT_CalibHvTool.h:57
SCT_CalibHvTool::n_phiBinsECOuter
@ n_phiBinsECOuter
Definition: SCT_CalibHvTool.h:59
SCT_ID
Definition: SCT_ID.h:68
SCT_CalibHvTool::m_tq
int m_tq[100]
Definition: SCT_CalibHvTool.h:86
SCT_CalibHvTool::finalize
virtual StatusCode finalize()
Definition: SCT_CalibHvTool.cxx:36
SCT_CalibHvTool::m_phvtripPrevTime
int m_phvtripPrevTime
Definition: SCT_CalibHvTool.h:82
SCT_CalibHvTool::VecInt
std::vector< int > VecInt
Definition: SCT_CalibHvTool.h:68
SCT_CalibHvTool::m_maxq
int m_maxq
Definition: SCT_CalibHvTool.h:73
SCT_CalibHvTool::m_phvtripProcessedEventsInt
VecInt m_phvtripProcessedEventsInt
Definition: SCT_CalibHvTool.h:78
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
ISCT_CalibHistoTool.h
SCT_CalibHvTool::m_waferItrBegin
SCT_ID::const_id_iterator m_waferItrBegin
Definition: SCT_CalibHvTool.h:66
SCT_CalibHvTool::m_lowHitCut
int m_lowHitCut
Definition: SCT_CalibHvTool.h:91
SCT_CalibHvTool::m_summarytrips
std::vector< std::vector< std::pair< int, int > > > m_summarytrips
Definition: SCT_CalibHvTool.h:88
ISCT_DCSConditionsTool.h
SCT_CalibHvTool::n_phiBinsB0
@ n_phiBinsB0
Definition: SCT_CalibHvTool.h:58
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
SCT_CalibHvTool::m_phvtripFirstTime
int m_phvtripFirstTime
Definition: SCT_CalibHvTool.h:83