ATLAS Offline Software
LVL1TGCTrigger.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGT1TGC_LVL1TGCTRIGGER_H
6 #define TRIGT1TGC_LVL1TGCTRIGGER_H
7 
9 
10 // STL
11 #include <string>
12 #include <vector>
13 #include <map>
14 
15 // Gaudi includes
16 #include "Gaudi/Property.h"
17 
18 // Other stuff
22 #include "Identifier/Identifier.h"
24 
25 // EIFI-SL connection
27 
31 
32 // BS metadata container
34 
37 
39 
40 #include "TrigT1TGC/TGCArguments.h"
43 
44 // Tile-Muon
47 
48 //NSW Trigger Output
50 
51 // RPC BIS78 Trigger Output
53 
54 class TgcRdo;
55 class TgcRawData;
56 
57 namespace LVL1TGCTrigger {
58 
59 class TGCSector;
60 class TGCTrackSelectorOut;
61 class TGCElectronicsSystem;
62 class TGCTimingManager;
63 class TGCDatabaseManager;
64 class TGCEvent;
65 
67 {
68  public:
69 
72  LVL1TGCTrigger( const std::string& name, ISvcLocator* pSvcLocator ) ;
73  virtual ~LVL1TGCTrigger();
74 
75  // standard algorithm methods:
76  virtual StatusCode initialize() override;
77  virtual StatusCode start() override;
78  virtual StatusCode execute() override;
79  virtual StatusCode finalize() override;
80 
81  private:
82  StatusCode processOneBunch(const TgcDigitContainer*,
84  std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>&);
85  void doMaskOperation(const TgcDigitContainer* ,std::map<Identifier, int>& );
86  void fillTGCEvent(const std::map<Identifier, int>& , TGCEvent&);
87 
88  // record bare-RDO for LowPT coincidences (on m_OutputTgcRDO=True):
89  void recordRdoSLB(TGCSector *, std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>&);
90 
91  // record bare-RDO for HighPT coincidences (on OutputTgcRDO=True):
92  void recordRdoHPT(TGCSector *, std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>&);
93 
94  // record bare-RDO for Inner coincidences (on OutputTgcRDO=True):
95  void recordRdoInner(TGCSector *, std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>&);
96 
97  // record bare-RDO for R-phi coincidences (on m_OutputTgcRDO=True):
98  void recordRdoSL(TGCSector *, std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>&);
99 
100  // Retrieve Masked channel list
101  StatusCode getMaskedChannel();
102 
103  // useful functions
104  int getCharge(int dR, int Zdir);
105  void extractFromString(const std::string&, std::vector<int>&);
106  //bool addRawData(TgcRawData * rawdata,
107  bool addRawData(std::unique_ptr<TgcRawData> rawdata,
108  std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo );
109  int getLPTTypeInRawData(int type);
110  void FillSectorLogicData(LVL1MUONIF::Lvl1MuSectorLogicDataPhase1* sldata,
111  const TGCTrackSelectorOut *trackSelectorOut);
112 
113 
114  // Properties
115 
116  // Location of LVL1MUONIF::Lvl1MuSectorLogicData (output from SL)
117  StringProperty m_keyMuCTPIInput_TGC{this,"MuCTPIInput_TGC","L1MuctpiStoreTGC"};
118 
119  StringProperty m_MaskFileName12{this,"MaskFileName12",""};
120  ShortProperty m_CurrentBunchTag{this,"CurrentBunchTag",TgcDigit::BC_CURRENT};
121  BooleanProperty m_ProcessAllBunches{this,"ProcessAllBunhes",true};
122  BooleanProperty m_OutputTgcRDO{this,"OutputTgcRDO",true};
123 
124  // expert usage
125  BooleanProperty m_USE_CONDDB{this, "USE_CONDDB", true}; //< flag to use the Condition DB
126  BooleanProperty m_SHPTORED {this, "SHPTORED", true}; //< flag for E1/E2 chamber ORED in Strip HPT
127  BooleanProperty m_USEINNER {this, "USEINNER", true}; //< flag for using Inner Station for SL
128  BooleanProperty m_INNERVETO{this,"INNERVETO",true}; // flag for using VETO by Inner Station for SL
129  BooleanProperty m_FULLCW{this,"FULLCW",false}; // flag for using differne CW for each octant
130  BooleanProperty m_TILEMU{this,"TILEMU",true}; // flag for using TileMu
131  BooleanProperty m_USENSW{this,"USENSW",false}; // flag for using NSW
132  BooleanProperty m_FORCENSWCOIN{this,"FORCENSWCOIN",true}; // flag to enable innerCoincidenceFlag at the TGC sectors expecting NSW hits even if there is no NSW hit
133  BooleanProperty m_USEBIS78{this,"USEBIS78",false}; // flag for using RPC BIS78
134  BooleanProperty m_useRun3Config{this,"useRun3Config",false}; // flag for using switch between Run3 and Run2 algorithms
135 
136  StringProperty m_NSWSideInfo{this,"NSWSideInfo",""};// Information about NSW geometry. It should be "" or "AC" or "A" or "C"
137 
138  bool m_firstTime{true};
139  uint16_t m_bctagInProcess{TgcDigit::BC_UNDEFINED};
140 
142  std::unique_ptr<TGCTimingManager> m_TimingManager;
143  std::unique_ptr<TGCElectronicsSystem> m_system;
144 
146 
147  // EIFI-SL connection
149 
150  // getCabling method
151  StatusCode getCabling();
152 
153  // log
155 
157  TGCArguments* tgcArgs();
158 
159 
160  ServiceHandle<MuonTGC_CablingSvc> m_cabling{this, "TGCCablingSvc", "MuonTGC_CablingSvc", ""};
161 
162  SG::WriteHandleKey<TgcRdoContainer> m_keyTgcRdo{this,"TgcRdo","TGCRDO2","Location of TgcRdoContainer"};
163  SG::ReadHandleKey<TgcRdoContainer> m_keyTgcRdoIn{this,"InputRDO","TGCRDO","Location of input TgcRdoContainer"};
164  SG::ReadHandleKey<TgcDigitContainer> m_keyTgcDigit{this,"InputData_perEvent","TGC_DIGITS","Location of TgcDigitContainer"};
165  SG::ReadHandleKey<TileMuonReceiverContainer> m_keyTileMu{this,"TileMuRcv_Input","TileMuRcvCnt","Location of TileMuonReceiverContainer"};
166  SG::ReadHandleKey<Muon::NSW_TrigRawDataContainer> m_keyNSWTrigOut{this,"NSWTrigger_Input","L1_NSWTrigContainer","Location of NSW_TrigRawDataContainer"};
167  SG::ReadHandleKey<Muon::RpcBis78_TrigRawDataContainer> m_keyBIS78TrigOut{this,"BIS78Trig_Input","BIS78TrigContainer","Location of RpcBis78_TrigRawDataContainer"};
168  SG::ReadCondHandleKey<TGCTriggerData> m_readCondKey{this,"ReadCondKey","TGCTriggerData"};
169  SG::ReadCondHandleKey<TGCTriggerLUTs> m_readLUTs_CondKey{this,"ReadLUTCondKey","TGCTriggerLUTs"};
170  SG::WriteHandleKey<LVL1MUONIF::Lvl1MuCTPIInputPhase1> m_muctpiPhase1Key{this, "MuctpiPhase1LocationTGC", "L1MuctpiStoreTGC", "Location of muctpiPhase1 for Tgc"};
171 
172  //StoreGate key for the ByteStreamMetadata container to retrieve detector mask
173  SG::ReadHandleKey<ByteStreamMetadataContainer> m_bsMetaDataContRHKey {this, "ByteStreamMetadataRHKey", "ByteStreamMetadata", "Location to retrieve the detector mask"};
174 
176  std::map<Identifier, int> m_MaskedChannel;
177 
178 }; // class LVL1TGCTrigger
179 
180 inline TGCArguments* LVL1TGCTrigger::tgcArgs() {
181  return &m_tgcArgs;
182 }
183 
184 } // namespace LVL1TGCTrigger
185 
186 #endif // TRIGT1TGC_LVL1TGCTRIGGER_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
LVL1TGCTrigger::TGCSector
Definition: TGCSector.h:32
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
RpcBis78_TrigRawDataContainer.h
TgcDigit::BC_UNDEFINED
@ BC_UNDEFINED
Definition: TgcDigit.h:37
MuonTGC_CablingSvc.h
TGCInnerTrackletSlotHolder.h
TgcDigit::BC_CURRENT
@ BC_CURRENT
Definition: TgcDigit.h:37
initialize
void initialize()
Definition: run_EoverP.cxx:894
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
LVL1MUONIF::Lvl1MuCTPIInputPhase1
Class representing (part of) the input data to the MuCTPI for Phase 1.
Definition: Lvl1MuCTPIInputPhase1.h:33
ByteStreamMetadataContainer.h
This file contains the class definition for the ByteStreamMetadataContainer class.
TGCTriggerLUTs.h
LVL1TGCTrigger::LVL1TGCTrigger::m_tgcArgs
TGCArguments m_tgcArgs
Definition: LVL1TGCTrigger.h:156
SG::ReadHandleKey< TgcRdoContainer >
LVL1TGCTrigger::LVL1TGCTrigger::m_nEventInSector
int m_nEventInSector
Definition: LVL1TGCTrigger.h:145
LVL1TGCTrigger::LVL1TGCTrigger::m_db
TGCDatabaseManager * m_db
Definition: LVL1TGCTrigger.h:141
ReadCondHandle.h
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
AthAlgorithm.h
Lvl1MuCTPIInputPhase1.h
LVL1TGCTrigger::TGCInnerTrackletSlotHolder
Definition: TGCInnerTrackletSlotHolder.h:14
SG::WriteHandleKey< TgcRdoContainer >
LVL1TGCTrigger::LVL1TGCTrigger::m_MaskedChannel
std::map< Identifier, int > m_MaskedChannel
mask channel map
Definition: LVL1TGCTrigger.h:176
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1MUONIF::Lvl1MuSectorLogicDataPhase1
Base class for the data coming from one SL board.
Definition: Lvl1MuSectorLogicDataPhase1.h:35
TgcDigit.h
SlinkWord.h
LVL1TGCTrigger::TGCEvent
Definition: TGCEvent.h:15
TgcRdoContainer.h
AthAlgorithm
Definition: AthAlgorithm.h:47
LVL1TGCTrigger
Definition: LVL1TGCTrigger.cxx:47
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
LVL1TGCTrigger::TGCDatabaseManager
Definition: TGCDatabaseManager.h:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TileMuContainer.h
LVL1TGCTrigger::TGCArguments
Definition: TGCArguments.h:12
SG::ReadCondHandleKey< TGCTriggerData >
LVL1TGCTrigger::TGCTrackSelectorOut
Definition: TGCTrackSelectorOut.h:11
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
NSW_TrigRawDataContainer.h
TgcRawData
An unit object of TGC ROD output.
Definition: TgcRawData.h:23
LVL1TGCTrigger::LVL1TGCTrigger::m_TimingManager
std::unique_ptr< TGCTimingManager > m_TimingManager
Definition: LVL1TGCTrigger.h:142
LVL1TGCTrigger::LVL1TGCTrigger::m_debuglevel
bool m_debuglevel
Definition: LVL1TGCTrigger.h:154
TileMuonReceiverObj.h
TgcRdo
Definition: TgcRdo.h:22
TGCArguments.h
TgcDigitContainer
Use IdentifiableContainer with TgcDigitCollection.
Definition: TgcDigitContainer.h:53
TgcDigitContainer.h
LVL1TGCTrigger::LVL1TGCTrigger::m_innerTrackletSlotHolder
TGCInnerTrackletSlotHolder m_innerTrackletSlotHolder
Definition: LVL1TGCTrigger.h:148
LVL1TGCTrigger::LVL1TGCTrigger::m_system
std::unique_ptr< TGCElectronicsSystem > m_system
Definition: LVL1TGCTrigger.h:143
Lvl1MuCTPIInput.h
ServiceHandle< MuonTGC_CablingSvc >
TGCTriggerData.h