ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1TGCTrigger::LVL1TGCTrigger Class Reference

#include <LVL1TGCTrigger.h>

Inheritance diagram for LVL1TGCTrigger::LVL1TGCTrigger:

Public Member Functions

 LVL1TGCTrigger (const std::string &name, ISvcLocator *pSvcLocator)
 standard constructor and destructor for algorithms
virtual ~LVL1TGCTrigger ()
virtual StatusCode initialize () override
virtual StatusCode start () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method.
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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 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

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode processOneBunch (const Muon::TgcCablingMap &cabling, const TgcDigitContainer *, LVL1MUONIF::Lvl1MuCTPIInputPhase1 *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
void doMaskOperation (const TgcDigitContainer *, std::map< Identifier, int > &)
void fillTGCEvent (const Muon::TgcCablingMap &cabling, const std::map< Identifier, int > &, TGCEvent &)
void recordRdoSLB (const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
void recordRdoHPT (const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
void recordRdoInner (const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
void recordRdoSL (const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
StatusCode getMaskedChannel (const Muon::TgcCablingMap &cabling)
int getCharge (int dR, int Zdir)
void extractFromString (const std::string &, std::vector< int > &)
bool addRawData (std::unique_ptr< TgcRawData > rawdata, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &tgcrdo)
int getLPTTypeInRawData (int type)
void FillSectorLogicData (LVL1MUONIF::Lvl1MuSectorLogicDataPhase1 *sldata, const TGCTrackSelectorOut *trackSelectorOut)
TGCArgumentstgcArgs ()
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

StringProperty m_keyMuCTPIInput_TGC {this,"MuCTPIInput_TGC","L1MuctpiStoreTGC"}
StringProperty m_MaskFileName12 {this,"MaskFileName12",""}
 property, see LVL1TGCTrigger::LVL1TGCTrigger
ShortProperty m_CurrentBunchTag {this,"CurrentBunchTag",TgcDigit::BC_CURRENT}
 property, see LVL1TGCTrigger::LVL1TGCTrigger
BooleanProperty m_ProcessAllBunches {this,"ProcessAllBunhes",true}
BooleanProperty m_OutputTgcRDO {this,"OutputTgcRDO",true}
 property, see LVL1TGCTrigger::LVL1TGCTrigger
BooleanProperty m_USE_CONDDB {this, "USE_CONDDB", true}
BooleanProperty m_SHPTORED {this, "SHPTORED", true}
BooleanProperty m_USEINNER {this, "USEINNER", true}
BooleanProperty m_INNERVETO {this,"INNERVETO",true}
BooleanProperty m_FULLCW {this,"FULLCW",false}
BooleanProperty m_TILEMU {this,"TILEMU",true}
BooleanProperty m_USENSW {this,"USENSW",false}
BooleanProperty m_FORCENSWCOIN {this,"FORCENSWCOIN",true}
BooleanProperty m_USEBIS78 {this,"USEBIS78",false}
BooleanProperty m_useRun3Config {this,"useRun3Config",false}
StringProperty m_NSWSideInfo {this,"NSWSideInfo",""}
bool m_firstTime {true}
uint16_t m_bctagInProcess {TgcDigit::BC_UNDEFINED}
TGCDatabaseManagerm_db
std::unique_ptr< TGCTimingManagerm_TimingManager
std::unique_ptr< TGCElectronicsSystemm_system
int m_nEventInSector
TGCInnerTrackletSlotHolder m_innerTrackletSlotHolder
bool m_debuglevel
TGCArguments m_tgcArgs
SG::ReadCondHandleKey< Muon::TgcCablingMapm_cablingKey {this, "CablingKey", "MuonTgc_CablingMap"}
SG::WriteHandleKey< TgcRdoContainerm_keyTgcRdo {this,"TgcRdo","TGCRDO2","Location of TgcRdoContainer"}
SG::ReadHandleKey< TgcRdoContainerm_keyTgcRdoIn {this,"InputRDO","TGCRDO","Location of input TgcRdoContainer"}
SG::ReadHandleKey< TgcDigitContainerm_keyTgcDigit {this,"InputData_perEvent","TGC_DIGITS","Location of TgcDigitContainer"}
SG::ReadHandleKey< TileMuonReceiverContainerm_keyTileMu {this,"TileMuRcv_Input","TileMuRcvCnt","Location of TileMuonReceiverContainer"}
SG::ReadHandleKey< Muon::NSW_TrigRawDataContainerm_keyNSWTrigOut {this,"NSWTrigger_Input","L1_NSWTrigContainer","Location of NSW_TrigRawDataContainer"}
SG::ReadHandleKey< Muon::RpcBis78_TrigRawDataContainerm_keyBIS78TrigOut {this,"BIS78Trig_Input","BIS78TrigContainer","Location of RpcBis78_TrigRawDataContainer"}
SG::ReadCondHandleKey< TGCTriggerDatam_readCondKey {this,"ReadCondKey","TGCTriggerData"}
SG::ReadCondHandleKey< TGCTriggerLUTsm_readLUTs_CondKey {this,"ReadLUTCondKey","TGCTriggerLUTs"}
SG::WriteHandleKey< LVL1MUONIF::Lvl1MuCTPIInputPhase1m_muctpiPhase1Key {this, "MuctpiPhase1LocationTGC", "L1MuctpiStoreTGC", "Location of muctpiPhase1 for Tgc"}
SG::ReadHandleKey< ByteStreamMetadataContainerm_bsMetaDataContRHKey {this, "ByteStreamMetadataRHKey", "ByteStreamMetadata", "Location to retrieve the detector mask"}
std::map< Identifier, int > m_MaskedChannel
 mask channel map
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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 66 of file LVL1TGCTrigger.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LVL1TGCTrigger()

LVL1TGCTrigger::LVL1TGCTrigger::LVL1TGCTrigger ( const std::string & name,
ISvcLocator * pSvcLocator )

standard constructor and destructor for algorithms

Definition at line 50 of file LVL1TGCTrigger.cxx.

51: AthAlgorithm(name,pSvcLocator),
52 m_db(0),
55 m_debuglevel(false)
56{}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
TGCInnerTrackletSlotHolder m_innerTrackletSlotHolder

◆ ~LVL1TGCTrigger()

LVL1TGCTrigger::LVL1TGCTrigger::~LVL1TGCTrigger ( )
virtual

Definition at line 59 of file LVL1TGCTrigger.cxx.

60{
61 ATH_MSG_DEBUG("LVL1TGCTrigger destructor called");
62 if (m_db) {
63 delete m_db;
64 m_db =0;
65 }
66}
#define ATH_MSG_DEBUG(x)

Member Function Documentation

◆ addRawData()

bool LVL1TGCTrigger::LVL1TGCTrigger::addRawData ( std::unique_ptr< TgcRawData > rawdata,
std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > & tgcrdo )
private

Definition at line 1210 of file LVL1TGCTrigger.cxx.

1212{
1213 ATH_MSG_DEBUG("addRawData() is called.");
1214 std::pair<int, int> subDetectorRod(rawdata->subDetectorId(), rawdata->rodId());
1215 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>::iterator itRdo = tgcrdo.find(subDetectorRod);
1216
1217 if (itRdo==tgcrdo.end()) {
1218 // in case TgcRdo with the given subDetectorId and rodId is
1219 // not registered yet, create new TgcRdo and add rawdata to it
1220 auto thisRdo = std::make_unique<TgcRdo>(rawdata->subDetectorId(), rawdata->rodId(), rawdata->bcId(), rawdata->l1Id());
1221 thisRdo->push_back(std::move(rawdata));
1222 tgcrdo.insert(std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>::value_type(subDetectorRod, std::move(thisRdo)));
1223 } else {
1224 itRdo->second->push_back(std::move(rawdata));
1225 }
1226 return true;
1227}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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>

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ doMaskOperation()

void LVL1TGCTrigger::LVL1TGCTrigger::doMaskOperation ( const TgcDigitContainer * tgc_container,
std::map< Identifier, int > & TgcDigitIDs )
private

Definition at line 385 of file LVL1TGCTrigger.cxx.

387{
388 // (1) skip masked channels
389 for (const TgcDigitCollection* c : *tgc_container) {
390 for (const TgcDigit* h : *c) {
391
392 // check BCID
393 if (h->bcTag()!=m_bctagInProcess) continue;
394
395 Identifier channelId = h->identify();
396 const auto itCh = m_MaskedChannel.find(channelId);
397 if (itCh!=m_MaskedChannel.end() && itCh->second==0) {
398 ATH_MSG_DEBUG("This channel is masked! offlineID=" << channelId);
399 continue;
400 }
401 TgcDigitIDs.emplace(channelId, 1);
402 }
403 }
404
405 // (2) add fired channels by force
406 for(const auto& [Id, OnOff] : m_MaskedChannel) {
407 if (OnOff==1) {
408 ATH_MSG_VERBOSE("This channel is fired by force! offlineID=" << Id);
409 TgcDigitIDs.emplace(Id, 1);
410 }
411 }
412
413 ATH_MSG_DEBUG("# of total hits " << TgcDigitIDs.size());
414
415 return;
416}
#define ATH_MSG_VERBOSE(x)
std::map< Identifier, int > m_MaskedChannel
mask channel map

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode LVL1TGCTrigger::LVL1TGCTrigger::execute ( const EventContext & ctx)
overridevirtual

Execute method.

Implements AthAlgorithm.

Definition at line 139 of file LVL1TGCTrigger.cxx.

140{
141 ATH_MSG_DEBUG("execute() called");
142
143 const Muon::TgcCablingMap* cabling{nullptr};
144 ATH_CHECK(SG::get(cabling, m_cablingKey, ctx));
145
146 // doMaskOperation is performed at the first event
147 // It is better to implement callback against
148 // MuonTGC_CablingSvc::updateCableASDToPP (Susumu Oda, 2010/10/27)
149 if(m_firstTime) {
150 // do mask operation
151 ATH_CHECK(getMaskedChannel(*cabling));
152 m_firstTime = false;
153 }
154
155 // Tile-Muon data
156 bool doTileMu = m_tgcArgs.TILE_MU();
157
158 if (doTileMu && !m_tgcArgs.useRun3Config()) { // for Run-2
159 const TGCTriggerData* readCdo{};
160 ATH_CHECK(SG::get(readCdo, m_readCondKey, ctx));
161 doTileMu = readCdo->isActive(TGCTriggerData::CW_TILE);
162 }
163
164 // NSW data
165 bool doNSW = m_tgcArgs.USE_NSW();
166
167 // BIS78 data
168 bool doBIS78 = m_tgcArgs.USE_BIS78();
169
170 // TgcRdo
171 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>> tgcrdo;
172
173
174 const TgcDigitContainer* tgc_container{nullptr};
175 ATH_CHECK(SG::get(tgc_container, m_keyTgcDigit, ctx));
176
177 SG::WriteHandle<LVL1MUONIF::Lvl1MuCTPIInputPhase1> wh_muctpiTgc(m_muctpiPhase1Key, ctx);
178 ATH_CHECK(wh_muctpiTgc.record(std::make_unique<LVL1MUONIF::Lvl1MuCTPIInputPhase1>()));
179 LVL1MUONIF::Lvl1MuCTPIInputPhase1* muctpiinputPhase1 = wh_muctpiTgc.ptr();
180
181 // process one by one
182 StatusCode sc = StatusCode::SUCCESS;
183 for (int bc=TgcDigit::BC_PREVIOUS; bc<=TgcDigit::BC_NEXTNEXT; bc++){
184 sc = StatusCode::SUCCESS;
185
186 // Use TileMu only if BC_CURRENT
187 if (doTileMu && bc == m_CurrentBunchTag) {
188 ATH_CHECK(m_system->getTMDB()->retrieve(m_keyTileMu, ctx));
189 }
190
191 // Use NSW trigger output
192 if(doNSW && bc==m_CurrentBunchTag){ // To implement BC-calculation
193 ATH_CHECK(m_system->getNSW()->retrieve(m_keyNSWTrigOut, ctx));
194 }
195
196 // Use RPC BIS78 trigger output
197 if(doBIS78 && bc == m_CurrentBunchTag){ // Todo: implement BC-calculation
198 ATH_CHECK(m_system->getBIS78()->retrieve(m_keyBIS78TrigOut, ctx));
199 }
200
202 m_bctagInProcess = bc;
203 ATH_CHECK(processOneBunch(*cabling, tgc_container, muctpiinputPhase1, tgcrdo));
204 }
205
206 }
207
208
209 // before writing the output TgcRdo container,
210 // read input TgcRdo and copy the tracklet etc.
211 const TgcRdoContainer* rdoContIn{nullptr};
212 ATH_CHECK(SG::get(rdoContIn, m_keyTgcRdoIn, ctx));
213 if(rdoContIn->size()>0) {
214 TgcRdoContainer::const_iterator itR = rdoContIn->begin();
215 for(; itR!=rdoContIn->end(); ++itR){
216 const TgcRdo* rdoIn = (*itR);
217 std::pair<int, int> subDetectorRod(rdoIn->subDetectorId(), rdoIn->rodId());
218 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>::iterator itRdo = tgcrdo.find(subDetectorRod);
219 if (itRdo!=tgcrdo.end()) {
220 // if subDetectorId and rodId for input and output RDOs are the same,
221 // copy the tracklet info etc. from input to the output TgcRdo
222 for ( const TgcRawData* rd : *rdoIn ) {
223 itRdo->second->push_back(std::make_unique<TgcRawData>(*rd));
224 }
225 }
226 }
227 }
228
229 // write tgcL1rdo container
230 SG::WriteHandle<TgcRdoContainer> tgcL1rdoHandle (m_keyTgcRdo, ctx);
231 auto trgContainer=std::make_unique<TgcRdoContainer>();
232 for(const auto& tgcRdoMap : tgcrdo){
233 for(const auto rawData : *tgcRdoMap.second){
234 trgContainer->push_back(rawData);
235 }
236 }
237 ATH_CHECK(tgcL1rdoHandle.record(std::move(trgContainer)));
238
239 return sc;
240}
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t sc
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current TgcRdoContainer
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current TgcRawData
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old TgcRdo
const_iterator end() const
return const_iterator for end of container
size_t size() const
Duplicate of fullSize for backwards compatability.
const_iterator begin() const
return const_iterator for first entry
SG::ReadHandleKey< Muon::NSW_TrigRawDataContainer > m_keyNSWTrigOut
SG::ReadHandleKey< Muon::RpcBis78_TrigRawDataContainer > m_keyBIS78TrigOut
SG::ReadHandleKey< TgcDigitContainer > m_keyTgcDigit
SG::ReadCondHandleKey< Muon::TgcCablingMap > m_cablingKey
SG::ReadHandleKey< TgcRdoContainer > m_keyTgcRdoIn
SG::ReadHandleKey< TileMuonReceiverContainer > m_keyTileMu
ShortProperty m_CurrentBunchTag
property, see LVL1TGCTrigger::LVL1TGCTrigger
StatusCode processOneBunch(const Muon::TgcCablingMap &cabling, const TgcDigitContainer *, LVL1MUONIF::Lvl1MuCTPIInputPhase1 *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
SG::ReadCondHandleKey< TGCTriggerData > m_readCondKey
SG::WriteHandleKey< TgcRdoContainer > m_keyTgcRdo
SG::WriteHandleKey< LVL1MUONIF::Lvl1MuCTPIInputPhase1 > m_muctpiPhase1Key
std::unique_ptr< TGCElectronicsSystem > m_system
StatusCode getMaskedChannel(const Muon::TgcCablingMap &cabling)
bool isActive(int cwtype) const
@ BC_PREVIOUS
Definition TgcDigit.h:37
@ BC_NEXTNEXT
Definition TgcDigit.h:37
uint16_t rodId() const
Definition TgcRdo.h:138
uint16_t subDetectorId() const
Definition TgcRdo.h:134
::StatusCode StatusCode
StatusCode definition for legacy code.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.

◆ extractFromString()

void LVL1TGCTrigger::LVL1TGCTrigger::extractFromString ( const std::string & str,
std::vector< int > & v )
private

Definition at line 1161 of file LVL1TGCTrigger.cxx.

1161 {
1162 v.clear();
1163 if (str.empty()) return;
1164 std::string line=str;
1165 while(1) {
1166 if (line.empty()) break;
1167 int i = line.find(' ');
1168 if (i==(int)std::string::npos && !line.empty()) {
1169 v.push_back(atoi(line.c_str()));
1170 break;
1171 }
1172 std::string temp = line;
1173 temp.erase(i,line.size());
1174 v.push_back(atoi(temp.c_str()));
1175 line.erase(0,i+1);
1176 }
1177}
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ FillSectorLogicData()

void LVL1TGCTrigger::LVL1TGCTrigger::FillSectorLogicData ( LVL1MUONIF::Lvl1MuSectorLogicDataPhase1 * sldata,
const TGCTrackSelectorOut * trackSelectorOut )
private

Definition at line 500 of file LVL1TGCTrigger.cxx.

502{
503 // M.Aoki (26/10/2019)
504 // this function will be updated for Run3-specific configuration such as quality flags, 15 thresholds
505 if(trackSelectorOut ==0) return;
506
507 sldata->clear2candidatesInSector();// for temporary
508
509 const int muctpiBcId_offset = TgcDigit::BC_CURRENT;
510 sldata->bcid(m_bctagInProcess - muctpiBcId_offset);
511
512 for(int trackNumber=0;trackNumber!=trackSelectorOut->getNCandidate();trackNumber++){
513
514 sldata->roi(trackNumber,((trackSelectorOut->getR(trackNumber))<<2)+(trackSelectorOut->getPhi(trackNumber)));
515 sldata->pt(trackNumber,trackSelectorOut->getPtLevel(trackNumber));
516 if (trackSelectorOut->getInnerVeto(trackNumber)) sldata->ovl(trackNumber,1);
517 else sldata->ovl(trackNumber,0);
518 sldata->charge(trackNumber, trackSelectorOut->getCharge(trackNumber));
519 sldata->bw2or3(trackNumber, trackSelectorOut->getCoincidenceType(trackNumber));
520 sldata->goodmf(trackNumber, trackSelectorOut->getGoodMFFlag(trackNumber));
521 sldata->innercoin(trackNumber, trackSelectorOut->getInnerCoincidenceFlag(trackNumber));
522 }
524 sldata->set2candidates(trackNumber);// not used for TGC
525 sldata->clear2candidates(trackNumber);// not used for TGC
526 }
527}
@ BC_CURRENT
Definition TgcDigit.h:37

◆ fillTGCEvent()

void LVL1TGCTrigger::LVL1TGCTrigger::fillTGCEvent ( const Muon::TgcCablingMap & cabling,
const std::map< Identifier, int > & tgcDigitIDs,
TGCEvent & event )
private

Definition at line 419 of file LVL1TGCTrigger.cxx.

421{
422 // Loop on TGC detectors (collections)
423 for(const auto& itCh : tgcDigitIDs) {
424 const Identifier channelId = itCh.first;
425 int subsystemNumber{0}, octantNumber{0}, moduleNumber{0},
426 layerNumber{0}, rNumber{0}, wireOrStrip{0}, channelNumber{0};
427 bool status = cabling.getOnlineIDfromOfflineID(channelId,
428 subsystemNumber,
429 octantNumber,
430 moduleNumber,
431 layerNumber,
432 rNumber,
433 wireOrStrip,
434 channelNumber);
435
436 if(!status) {
437 ATH_MSG_INFO("Fail to getOnlineIDfromOfflineID for " << channelId);
438 } else {
439 bool fstatus;
440 int subDetectorID, srodID, sswID, sbLoc, channelID;
441 int phi=0;
442 int moduleType=0;
443 int slbID=0;
444 bool isAside=true;
445 bool isEndcap=true;
446
447 fstatus = cabling.getReadoutIDfromOfflineID(channelId,
448 subDetectorID,
449 srodID,sswID,
450 sbLoc,channelID);
451
452 if (fstatus) {
453 fstatus = cabling.getSLBIDfromReadoutID(phi, isAside, isEndcap,
454 moduleType, slbID,
455 subDetectorID,
456 srodID, sswID,sbLoc);
457 }
458 if (fstatus) {
459 ATH_MSG_VERBOSE("hit : subsys#=" << subsystemNumber
460 << " octant#=" << octantNumber
461 << " mod#=" << moduleNumber
462 << " layer#=" << layerNumber << " r#=" << rNumber
463 << " isStrip=" << wireOrStrip
464 << " ch#=" << channelNumber << endmsg
465 << " --> readoutID: sudetID=" << subDetectorID
466 << " srodID=" << srodID << " sswID=" << sswID
467 << " slbID=" << slbID << " chID=" << channelID);
468
469 TGCZDirection zdire = (subsystemNumber==1)? kZ_FORWARD : kZ_BACKWARD;
470 TGCReadoutIndex index(zdire,octantNumber,moduleNumber,rNumber,layerNumber);
471 TGCSignalType signal = (wireOrStrip==1)? STRIP : WIRE;
472 event.NewASDOut(index,
473 signal,
474 channelNumber,
475 0);
476 } else {
477 ATH_MSG_INFO("Fail to getSLBIDfromOfflineID for " << channelId);
478 }
479 }
480 } // End Loop on TGC detectors (collections)
481 if (m_debuglevel) {
482 ATH_MSG_DEBUG("Could make TGCEvent with TgcDigitContainer."
483 << " vector size : " << event.GetNASDOut() );
484 for(int iout=1; iout<= event.GetNASDOut(); iout++){
485 TGCASDOut* asdout = (event.GetASDOutVector()[iout-1]);
486 ATH_MSG_DEBUG( " Z:" << asdout->GetTGCReadoutIndex().GetZDirection() <<
487 " O:" << asdout->GetTGCReadoutIndex().GetOctantNumber() <<
488 " M:" << asdout->GetTGCReadoutIndex().GetModuleNumber() <<
489 " R:" << asdout->GetTGCReadoutIndex().GetRNumber() <<
490 " L:" << asdout->GetTGCReadoutIndex().GetLayerNumber() <<
491 " S:" << asdout->GetSignalType() <<
492 " I:" << asdout->GetHitID() <<
493 " T:" << asdout->GetHitToF() );
494 }
495 }
496}
Scalar phi() const
phi method
#define endmsg
#define ATH_MSG_INFO(x)
str index
Definition DeMoScan.py:362
status
Definition merge.py:16

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode LVL1TGCTrigger::LVL1TGCTrigger::finalize ( )
overridevirtual

Definition at line 128 of file LVL1TGCTrigger.cxx.

129{
130 ATH_MSG_DEBUG("LVL1TGCTrigger::finalize() called" << " m_nEventInSector = " << m_nEventInSector);
131
132 if (m_db) delete m_db;
133 m_db = 0 ;
134
135 return StatusCode::SUCCESS;
136}

◆ getCharge()

int LVL1TGCTrigger::LVL1TGCTrigger::getCharge ( int dR,
int Zdir )
private

Definition at line 1180 of file LVL1TGCTrigger.cxx.

1180 {
1181 // old scheme
1182 // if (dR==0) return (Zdir>0 ? -1 : 1);
1183 // return (dR*Zdir>0 ? 1 : -1);
1184 return (dR >=0 ? 1 : -1 );
1185}

◆ getLPTTypeInRawData()

int LVL1TGCTrigger::LVL1TGCTrigger::getLPTTypeInRawData ( int type)
private

Definition at line 1189 of file LVL1TGCTrigger.cxx.

1190{
1191 switch(type) {
1192 case WTSB :
1194 case WDSB :
1196 case STSB :
1198 case SDSB :
1200 case WISB :
1202 case SISB :
1204 default :
1205 return -1;
1206 }
1207}
@ SLB_TYPE_TRIPLET_WIRE
Definition TgcRawData.h:34
@ SLB_TYPE_INNER_WIRE
Definition TgcRawData.h:36
@ SLB_TYPE_TRIPLET_STRIP
Definition TgcRawData.h:35
@ SLB_TYPE_INNER_STRIP
Definition TgcRawData.h:37
@ SLB_TYPE_DOUBLET_STRIP
Definition TgcRawData.h:33
@ SLB_TYPE_DOUBLET_WIRE
Definition TgcRawData.h:32

◆ getMaskedChannel()

StatusCode LVL1TGCTrigger::LVL1TGCTrigger::getMaskedChannel ( const Muon::TgcCablingMap & cabling)
private

Definition at line 1033 of file LVL1TGCTrigger.cxx.

1033 {
1034 std::string fname=m_MaskFileName12.value();
1035 if (fname.empty()) return StatusCode::SUCCESS;
1036
1037 std::string fullName = PathResolver::find_file (fname, "PWD");
1038 if( fullName.empty())
1039 fullName = PathResolver::find_file (fname, "DATAPATH");
1040
1041 std::ifstream fin(fullName.c_str());
1042 if (!fin) {
1043 ATH_MSG_FATAL("Cannot open file " << (fullName.empty() ? fname : fullName));
1044 return StatusCode::FAILURE;
1045 } else {
1046 ATH_MSG_INFO("Use mask file : " << fullName);
1047 }
1048 // read database ------------------------------------------------------------------------------
1049 std::vector<std::string> mask;
1050 std::string aLine;
1051 while(getline(fin,aLine)) {
1052 if (aLine.compare(0,3,"///")!=0) break;
1053 }
1054 int id_type = atoi(aLine.c_str());
1055 while(getline(fin,aLine)) {
1056 if (!aLine.empty()) mask.push_back(aLine);
1057 }
1058 fin.close();
1059
1060 //
1061 std::vector<int> ids;
1062 Identifier ID;
1063 int nmasked=0, nfired=0;
1064 for(int ich=0; ich<(int)mask.size(); ich++) {
1065 std::string ch = mask[ich];
1066 extractFromString(ch, ids);
1067 int OnOff=ids[0]; // 0=off(masked) 1=on(fired)
1068 //
1069 if (id_type==1 && ids.size()==8) { // online
1070 int sysno1 = (ids[1]==-99 ? -1 : ids[1]); int sysno2=(ids[1]==-99 ? 1 : ids[1]);// -1(B) 1(F)
1071 int octno1 = (ids[2]==-99 ? 0 : ids[2]); int octno2=(ids[2]==-99 ? 7 : ids[2]);
1072 for(int sysno=sysno1; sysno<=sysno2; sysno+=2) {
1073 for(int octno=octno1; octno<=octno2; octno++) {
1074 bool status = cabling.getOfflineIDfromOnlineID(ID,sysno,octno,
1075 ids[3],ids[4],ids[5],ids[6],ids[7]);
1076 ATH_MSG_VERBOSE( (OnOff==0 ? "Mask" : "Fire") << " : offlineID=" << ID
1077 << " sys=" << sysno << " oct=" << octno << " modno=" << ids[3]
1078 << " layerno=" << ids[4] << " rNumber=" << ids[5]
1079 << " strip=" << ids[6] << " chno=" << ids[7] );
1080
1081 if (!status) {
1082 ATH_MSG_WARNING("This onlineID is not valid and cannot be converted to offline ID." );
1083 ATH_MSG_WARNING("sys=" << sysno << " oct=" << octno << " modno=" << ids[3]
1084 << " layerno=" << ids[4] << " rNumber=" << ids[5]
1085 << " strip=" << ids[6] << " chno=" << ids[7] );
1086 } else {
1087 m_MaskedChannel.insert(std::map<Identifier, int>::value_type(ID, OnOff));
1088 if (OnOff==0) nmasked+=1;
1089 else if (OnOff==1) nfired+=1;
1090 }
1091 }
1092 }
1093
1094 } else if (id_type==2 && ids.size()==6) { // readout id
1095 int sysno1 = (ids[1]==-99 ? 103 : ids[1]); int sysno2=(ids[1]==-99 ? 104 : ids[1]);// 103(F), 104(B)
1096 int octno1 = (ids[2]==-99 ? 0 : ids[2]); int octno2=(ids[2]==-99 ? 7 : ids[2]);
1097 for(int sysno=sysno1; sysno<=sysno2; sysno+=1) {
1098 for(int octno=octno1; octno<=octno2; octno++) {
1099 bool status = cabling.getOfflineIDfromReadoutID(ID, sysno,octno,ids[3],ids[4],ids[5]);
1100 ATH_MSG_VERBOSE( (OnOff==0 ? "Mask" : "Fire") << " : offlineID=" << ID
1101 << " subdetectorID=" << sysno << " rodId=" << octno << " sswID=" << ids[3]
1102 << " SBLoc=" << ids[4] << " channelId=" << ids[5] );
1103 if (!status) {
1104 ATH_MSG_WARNING("This readoutID is not valid and cannot be converted to offline ID " );
1105 ATH_MSG_WARNING("subdetectorID=" << sysno << " rodId=" << octno << " sswID=" << ids[3]
1106 << " SBLoc=" << ids[4] << " channelId=" << ids[5] );
1107 } else {
1108 m_MaskedChannel.insert(std::map<Identifier, int>::value_type(ID, OnOff));
1109 if (OnOff==0) nmasked+=1;
1110 else if (OnOff==1) nfired+=1;
1111 }
1112 }
1113 }
1114
1115 } else if (id_type==3 && ids.size()==2) { // offline id
1116 ID = Identifier((unsigned int)ids[1]);
1117 ATH_MSG_DEBUG((OnOff==0 ? "Mask" : "Fire") << " : offlineID=" << ID);
1118 m_MaskedChannel.insert(std::map<Identifier, int>::value_type(ID, OnOff));
1119 if (OnOff==0) nmasked+=1;
1120 else if (OnOff==1) nfired+=1;
1121
1122 } else {
1123 ATH_MSG_INFO("Invalid input. Idtype or number of parameters are invalid: idtype=" << id_type
1124 << " number of elements = " << ids.size() );
1125 return StatusCode::FAILURE;
1126 }
1127 }
1128 //
1129 ATH_MSG_INFO("Total number of masked channels ... " << nmasked);
1130 ATH_MSG_INFO("Total number of fired channels ... " << nfired);
1131 //
1132 return StatusCode::SUCCESS;
1133}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_WARNING(x)
void extractFromString(const std::string &, std::vector< int > &)
StringProperty m_MaskFileName12
property, see LVL1TGCTrigger::LVL1TGCTrigger
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...

◆ initialize()

StatusCode LVL1TGCTrigger::LVL1TGCTrigger::initialize ( )
overridevirtual

Definition at line 69 of file LVL1TGCTrigger.cxx.

70{
71 ATH_MSG_DEBUG("LVL1TGCTrigger::initialize()");
72
73 m_debuglevel = (msgLevel() <= MSG::DEBUG); // save if threshold for debug
74
75 m_tgcArgs.set_MSGLEVEL(msgLevel());
76 m_tgcArgs.set_SHPT_ORED( m_SHPTORED.value() );
77 m_tgcArgs.set_USE_INNER( m_USEINNER.value() );
78 m_tgcArgs.set_INNER_VETO( m_INNERVETO.value() );
79 m_tgcArgs.set_TILE_MU( m_TILEMU.value() );
80 m_tgcArgs.set_USE_NSW( m_USENSW.value() );
81 m_tgcArgs.set_USE_BIS78( m_USEBIS78.value() );
82 m_tgcArgs.set_FORCE_NSW_COIN( m_FORCENSWCOIN.value() );
83
84 m_tgcArgs.set_USE_CONDDB( m_USE_CONDDB.value() );
85 m_tgcArgs.set_useRun3Config( m_useRun3Config.value() );
86
87 m_tgcArgs.set_NSWSideInfo( m_NSWSideInfo.value() );
88
89 ATH_CHECK( m_readCondKey.initialize(!m_useRun3Config.value()) );
90 ATH_CHECK( m_readLUTs_CondKey.initialize(m_useRun3Config.value()) );
91 ATH_CHECK(m_cablingKey.initialize());
92
93 // CondDB is not available for Run3 config. set USE_CONDDB to false to avoid errors.
94 // will be removed the below part.
95 if(m_useRun3Config.value()){
96 m_tgcArgs.set_USE_CONDDB(false);
97 }
98
99 // initialize TGCDataBase
100 m_db = new TGCDatabaseManager(&m_tgcArgs, m_readCondKey, m_readLUTs_CondKey);
101
102
103 // create TGCElectronicsSystem
104 m_system = std::make_unique<TGCElectronicsSystem>(&m_tgcArgs,m_db);
105
106 m_TimingManager = std::make_unique<TGCTimingManager>(m_readCondKey);
107 m_TimingManager->setBunchCounter(0);
108
110
111 // read and write handle key
112 ATH_CHECK(m_keyTgcRdoIn.initialize());
113 ATH_CHECK(m_keyTgcDigit.initialize());
114 ATH_CHECK(m_keyTileMu.initialize());
115 ATH_CHECK(m_keyNSWTrigOut.initialize(tgcArgs()->USE_NSW())); // to be updated once the Run 3 CondDb becomes available (should be automatically configured by db info)
116 ATH_CHECK(m_keyBIS78TrigOut.initialize(tgcArgs()->USE_BIS78())); // to be updated as well
117 ATH_CHECK(m_muctpiPhase1Key.initialize(tgcArgs()->useRun3Config()));
118 ATH_CHECK(m_keyTgcRdo.initialize(tgcArgs()->useRun3Config()));
120
121 // clear mask channel map
122 m_MaskedChannel.clear();
123
124 return StatusCode::SUCCESS;
125}
SG::ReadCondHandleKey< TGCTriggerLUTs > m_readLUTs_CondKey
SG::ReadHandleKey< ByteStreamMetadataContainer > m_bsMetaDataContRHKey
std::unique_ptr< TGCTimingManager > m_TimingManager

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ processOneBunch()

StatusCode LVL1TGCTrigger::LVL1TGCTrigger::processOneBunch ( const Muon::TgcCablingMap & cabling,
const TgcDigitContainer * tgc_container,
LVL1MUONIF::Lvl1MuCTPIInputPhase1 * muctpiinputPhase1,
std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > & tgcrdo )
private

Definition at line 242 of file LVL1TGCTrigger.cxx.

246{
247 ATH_MSG_DEBUG("start processOneBunch: for BC=" << m_bctagInProcess);
248
249 std::map<Identifier, int> tgcDigitIDs;
250 std::map<Identifier, int>::iterator itCh;
251
252 // doMaskOperation (masked & fired)
253 doMaskOperation(tgc_container, tgcDigitIDs);
254
255 // fill ASDOut to this event
256 TGCEvent event;
257 fillTGCEvent(cabling, tgcDigitIDs, event);
258 tgcDigitIDs.clear();
259
260 // process trigger electronics emulation...
261 m_TimingManager->increaseBunchCounter();
262 m_system->distributeSignal(&event);
263
264 // EIFI trigger bits for SL are cleared.
265 m_innerTrackletSlotHolder.clearTriggerBits();
266
267 // PatchPanel, SlaveBoard
269 for( int j=0; j<m_system->getNumberOfOctant(); j+=1){
270 for( int k=0; k<m_system->getNumberOfModule(); k+=1){
271 TGCSector* sector = m_system->getSector(i,j,k);
272 if((sector!=0)&&(sector->hasHit())){
274 m_TimingManager->startPatchPanel(sector, m_db);
275 m_TimingManager->startSlaveBoard(sector);
276 if (m_OutputTgcRDO.value()) recordRdoSLB(cabling, sector, tgcrdo);
277 // EIFI trigger bits for SL are filled in this method.
278 }
279 }
280 }
281 }
282
283 // HighPtBoard, SectorLogic
284 const int muctpiBcId_offset = TgcDigit::BC_CURRENT;
285 int muctpiBcId = m_bctagInProcess - muctpiBcId_offset;
286 for(int i=0; i< LVL1TGC::kNSide; i++) {
287 int sectoraddr_endcap = 0;
288 int sectoraddr_forward = 0;
289 for(int j=0; j<m_system->getNumberOfOctant(); j+=1){
290 for(int k=0; k<m_system->getNumberOfModule(); k+=1){
291 if(k>=9) continue;// skip Inner TGC
292 TGCSector* sector = m_system->getSector(i,j,k);
293 if(sector==0) continue;
294
295 m_TimingManager->startHighPtBoard(sector);
296 if (m_OutputTgcRDO.value()) recordRdoHPT(cabling, sector, tgcrdo);
297
298 // EIFI trigger bits are checked if Endcap
299 if(sector->getRegionType() == TGCRegionType::ENDCAP && sector->getSL()) {
300 if((sector->hasHit())){
301 // Pointers to store EIFI trigger bits for Endcap SL
302 const TGCInnerTrackletSlot* innerTrackletSlots[TGCInnerTrackletSlotHolder::NUMBER_OF_SLOTS_PER_TRIGGER_SECTOR]
303 = {0, 0, 0, 0};
304 m_innerTrackletSlotHolder.getInnerTrackletSlots(i, j, k, innerTrackletSlots);
305 sector->getSL()->setInnerTrackletSlots(innerTrackletSlots);
306 }
307 }
308 m_TimingManager->startSectorLogic(sector);
309 if(sector->hasHit()) sector->clearNumberOfHit();
310
311 // Fill inner (EIFI/Tile) words
312 if (m_OutputTgcRDO.value() && m_tgcArgs.USE_INNER()) recordRdoInner(cabling, sector, tgcrdo);
313
314 // Fill Lvl1MuCTPInput
315 if (m_OutputTgcRDO.value()) recordRdoSL(cabling, sector, tgcrdo);
316
317 size_t tgcsystem=0,subsystem=0;
320
321 std::shared_ptr<TGCTrackSelectorOut> trackSelectorOut;
322 sector->getSL()->getTrackSelectorOutput(trackSelectorOut);
323
324 std::shared_ptr<LVL1TGC::TGCNSW> nsw = m_system->getNSW();
325 int module = sector->getModuleId();
326 int sectorId;
327 if(sector->getRegionType() == TGCRegionType::ENDCAP) {
328 LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1 sldata;
330 if(trackSelectorOut != 0) FillSectorLogicData(&sldata,trackSelectorOut.get());
331
332 if ( m_tgcArgs.USE_NSW() ){
333 sectorId = ((module/3)*2+module%3) + sector->getOctantId()*6;
334 std::shared_ptr<const LVL1TGC::NSWTrigOut> pNSWOut = nsw->getOutput(sector->getRegionType(),
335 sector->getSideId(),
336 sectorId);
337 if ( pNSWOut ){
338 // set monitoring flag
339 for(bool NSWmonitor : pNSWOut->getNSWmonitor() ){
340 if ( NSWmonitor ) {
341 sldata.nsw(true);
342 break;
343 }
344 }
345 }
346 }
347 muctpiinputPhase1->setSectorLogicData(sldata,tgcsystem,subsystem,sectoraddr_endcap++,muctpiBcId);
348 } else if(sector->getRegionType() == TGCRegionType::FORWARD) {
349 LVL1MUONIF::Lvl1MuForwardSectorLogicDataPhase1 sldata;
350 tgcsystem = LVL1MUONIF::Lvl1MuCTPIInputPhase1::idForwardSystem();
351 if(trackSelectorOut != 0) FillSectorLogicData(&sldata,trackSelectorOut.get());
352
353 if ( m_tgcArgs.USE_NSW() ) {
354 sectorId = (module/3) + sector->getOctantId()*3;
355 std::shared_ptr<const LVL1TGC::NSWTrigOut> pNSWOut = nsw->getOutput(sector->getRegionType(),
356 sector->getSideId(),
357 sectorId);
358 if ( pNSWOut ){
359 // set monitoring flag
360 for(bool NSWmonitor : pNSWOut->getNSWmonitor() ){
361 if ( NSWmonitor ) {
362 sldata.nsw(true);
363 break;
364 }
365 }
366 }
367 }
368 muctpiinputPhase1->setSectorLogicData(sldata,tgcsystem,subsystem,sectoraddr_forward++,muctpiBcId);
369 }
370
371 trackSelectorOut.get()->reset();
372
373
374 } // k Module
375 } // j Octant
376 } // i Side
377
378 event.Clear();
379
380 return StatusCode::SUCCESS;
381}
if(pathvar)
void setSectorLogicData(const Lvl1MuSectorLogicDataPhase1 &data, size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0)
void recordRdoSLB(const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
void recordRdoHPT(const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
void recordRdoSL(const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
void recordRdoInner(const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
void fillTGCEvent(const Muon::TgcCablingMap &cabling, const std::map< Identifier, int > &, TGCEvent &)
BooleanProperty m_OutputTgcRDO
property, see LVL1TGCTrigger::LVL1TGCTrigger
void FillSectorLogicData(LVL1MUONIF::Lvl1MuSectorLogicDataPhase1 *sldata, const TGCTrackSelectorOut *trackSelectorOut)
void doMaskOperation(const TgcDigitContainer *, std::map< Identifier, int > &)
TGCSide
The sides of TGC (A- or C-side).
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ recordRdoHPT()

void LVL1TGCTrigger::LVL1TGCTrigger::recordRdoHPT ( const Muon::TgcCablingMap & cabling,
TGCSector * sector,
std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > & tgcrdo )
private

Definition at line 655 of file LVL1TGCTrigger.cxx.

658{
659 if(sector->hasHit() == false) return;
660
661 // readoutID
662 int subDetectorId{0}, rodId{0}, sswId{0}, sbLoc{0}, secId{0};
663
664 // get numbering scheme info from cabling svc
665 int startEndcapSector{0}, coverageOfEndcapSector{0};
666 int startForwardSector{0}, coverageOfForwardSector{0};
667 rodId = 1;
668 cabling.getCoveragefromSRodID(rodId,
669 startEndcapSector,
670 coverageOfEndcapSector,
671 startForwardSector,
672 coverageOfForwardSector
673 ) ;
674
676
677 // HPTID
678 bool isAside{false}, isEndcap{false}, isStrip{false};
679 int phi{0};
680 isAside = (sector->getSideId()==0);
681 isEndcap = (sector->getRegionType() == TGCRegionType::ENDCAP);
682 int module = sector->getModuleId();
683 // sector Id = 0..47 (Endcap) 0..23 (forward)
684 int sectorId{0};
685 if (isEndcap){
686 sectorId = ((module/3)*2+module%3) + sector->getOctantId()*6;
687 } else {
688 sectorId = (module/3) + sector->getOctantId()*3;
689 }
690 // secId for TgcRawData
691 // 0-3(EC), 0-1(FWD) for new TGCcabling (1/12sector)
692 // 0-5(EC), 0-2(FWD) for new TGCcabling (octant)
693 if (isEndcap && (coverageOfEndcapSector!=0)){
694 secId = sectorId % coverageOfEndcapSector;
695 } else {
696 if (coverageOfForwardSector != 0){
697 secId = sectorId % coverageOfForwardSector;
698 }
699 }
700 // phi=1-48(EC), 1-24(FWD) in detector ID scheme
701 phi = (isEndcap ? (sectorId+46)%48+1 : (sectorId+23)%24+1);
702
703 for(int itype=0; itype<2; itype++) { // loop over HPB type(wire/strip)
704 isStrip = (itype==0 ? 0 : 1); // 0=wire 1=strip
705 for(unsigned int ihpb=0; ihpb<sector->getNumberOfHPB(itype); ihpb++) { // loop over # of HPB per sector
706 TGCHighPtBoard * hpb = sector->getHPB(itype, ihpb);
707 if (0==hpb) continue;
708 TGCHighPtChipOut * out = hpb->getOutput();
709 if (0==out) continue;
710
711 // get ReadoutID
712 bool status = cabling.getReadoutIDfromHPTID(phi, isAside, isEndcap, isStrip, hpb->getId(),
713 subDetectorId, rodId, sswId, sbLoc);
714 if (!status) {
715 ATH_MSG_WARNING("TGCcablignSvc::getReadoutIDfromHPTID fails");
716 continue;
717 }
718
719 // loop over chip and candidate
720 for(int ichip=0; ichip<NumberOfChip; ichip++) { // NumberOfChip=2
721 for(int icand=0; icand<TGCHighPtChipOut::s_NHitInTrackSelector; icand++) {
722 if (!out->getSel(ichip, icand)) continue; // should be 1 or 2
723 int chip = ichip;
724 int index = ihpb;
725 int hitId = out->getHitID(ichip, icand);
726 cabling.getRDOHighPtIDfromSimHighPtID(!isEndcap, isStrip,
727 index, chip, hitId);
728 bool isHPT = out->getPt(ichip,icand)==PtHigh ? 1 : 0;
729 auto rawdata = std::make_unique<TgcRawData>(bcTag,
730 static_cast<uint16_t>(subDetectorId),
731 static_cast<uint16_t>(rodId),
732 l1Id,
733 bcId,
734 isStrip, (!isEndcap), secId, chip, icand,
735 isHPT, hitId,
736 out->getPos(ichip, icand),
737 out->getDev(ichip, icand),
738 0);
739 addRawData(std::move(rawdata), tgcrdo);
740
741 // Print
742 ATH_MSG_DEBUG( "recordRdoHPT : bdTag =" << bcTag
743 << " side=" << ( (isAside)? "A" : "C")
744 << (isEndcap ? "EC" : "FWD")
745 << " w/s=" << ( (isStrip)? "s" : "w")
746 << " id=" << hpb->getId()
747 << " ecId=" << secId
748 << " chip=" << ichip
749 << " cand=" << icand
750 << " block=" << out->getHitID(ichip, icand)
751 << " subMatrix=" << out->getPos(ichip, icand)
752 << " dev=" << out->getDev(ichip, icand)
753 << " srod=" << rodId << " sswId=" << sswId << " SBLoc=" << sbLoc );
754
755 // Strip HPT hit may be duplicated
756 if ( m_tgcArgs.SHPT_ORED() &&
757 isEndcap && isStrip &&
758 (chip==1) ) {
759 int oredId = -1;
760 if (hitId == 1) oredId = 5;
761 else if (hitId == 2) oredId = 6;
762 else if (hitId == 5) oredId = 1;
763 else if (hitId == 6) oredId = 2;
764 if (oredId >=0) {
765 auto rawdata2 = std::make_unique<TgcRawData>(bcTag,
766 static_cast<uint16_t>(subDetectorId),
767 static_cast<uint16_t>(rodId),
768 l1Id,
769 bcId,
770 isStrip, (!isEndcap), secId, chip, icand,
771 isHPT, oredId,
772 out->getPos(ichip, icand),
773 out->getDev(ichip, icand),
774 0);
775 addRawData(std::move(rawdata2), tgcrdo);
776 }
778
779 }
780
781 }
782 }
783 // end loop of candidate and chip
784
785 } // end loop for # of HPB per sector
786 } // end loop for HPB type
787}
uint16_t bcId(uint32_t data)
unsigned bcTag(unsigned bcBitMap)
bool addRawData(std::unique_ptr< TgcRawData > rawdata, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &tgcrdo)
static constexpr int s_NHitInTrackSelector
const int NumberOfChip
setWord1 uint16_t

◆ recordRdoInner()

void LVL1TGCTrigger::LVL1TGCTrigger::recordRdoInner ( const Muon::TgcCablingMap & cabling,
TGCSector * sector,
std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > & tgcrdo )
private

Definition at line 791 of file LVL1TGCTrigger.cxx.

794{
795 const bool isAside = sector->getSideId()==0;
796 const bool isEndcap = (sector->getRegionType() == TGCRegionType::ENDCAP);
797 if (!isEndcap) return;
798
799 //*** isEndcap must be true for the rest of this function. ***
800
801 // sector Id = 0..47, phi = 1..48
802 int module = sector->getModuleId();
803 int octant = sector->getOctantId();
804 int sectorId = ((module/3)*2+module%3) + octant*6;
805 int phi = (sectorId+46)%48+1;
806
807 // get readout ID
808 int subDetectorId=0, rodId=0, sswId=0, sbLoc=0;
809
810 bool status = cabling.getSReadoutIDfromSLID(phi, isAside, isEndcap,
811 subDetectorId, rodId, sswId, sbLoc);
812 if (!status) {
813 ATH_MSG_WARNING("TGCcablingSvc::ReadoutIDfromSLID fails in recordRdoInner()" );
814 return;
815 }
816
817 // secID for TGCRawData
818 // 0-3(EC), 0-1(FWD) for 1/12 sector
819 // 0-15(EC), 0-7(FWD) for 1/3 sector covered by SROD in RUn3
820 int startEndcapSector{0}, coverageOfEndcapSector{0};
821 int startForwardSector{0}, coverageOfForwardSector{0};
822 if (!cabling.getCoveragefromSRodID(rodId,
823 startEndcapSector,
824 coverageOfEndcapSector,
825 startForwardSector,
826 coverageOfForwardSector
827 ) )
828 {
829 ATH_MSG_WARNING("LVL1TGCTrigger::recordRdoInner --- bad rodId " << rodId );
830 return;
831 }
832
833 int secId = 0;
834 secId = sectorId % coverageOfEndcapSector;
835
836 uint16_t bcTag = m_CurrentBunchTag, l1Id = 0, bcId = 0;
837
838 // EIFI
840
841 const TGCInnerTrackletSlot* innerTrackletSlots[n_slots] = {0, 0, 0, 0};
842 m_innerTrackletSlotHolder.getInnerTrackletSlots(sector->getSideId(),
843 octant, module, innerTrackletSlots);
844
845 std::array<int, n_slots>inner_eifi;
846 m_innerTrackletSlotHolder.getInnerTrackletBits(innerTrackletSlots, inner_eifi);
847
848 for (int i_slot = 0; i_slot < n_slots; i_slot++) {
849 if (inner_eifi[i_slot] > 0) {
850 auto rawdata_eifi = std::make_unique<TgcRawData>(bcTag,
851 static_cast<uint16_t>(subDetectorId),
852 static_cast<uint16_t>(rodId),
853 l1Id,
854 bcId,
855 (!isEndcap),
856 secId, /*to be checked*/
857 static_cast<uint16_t>(inner_eifi[i_slot]),
858 0, /*fi*/
859 static_cast<uint16_t>(i_slot) /*chamber Id*/);
860 addRawData(std::move(rawdata_eifi), tgcrdo);
861 }
862 }
863
864 // Tile
865 int inner_tile = m_system->getTMDB()->getInnerTileBits(sector->getSideId(), sectorId);
866
867 if (inner_tile > 0) {
868 //TgcRawData * rawdata_tile = new TgcRawData(bcTag,
869 //std::shared_ptr<TgcRawData> rawdata_tile (
870 auto rawdata_tile = std::make_unique<TgcRawData>(bcTag,
871 static_cast<uint16_t>(subDetectorId),
872 static_cast<uint16_t>(rodId),
873 l1Id,
874 bcId,
875 (!isEndcap),
876 secId,
877 inner_tile,
878 0 /*bcid*/ );
879 addRawData(std::move(rawdata_tile), tgcrdo);
880 }
881
882 // NSW
883 TGCRegionType region = sector->getRegionType();
884 if ( m_USENSW ) {
885 std::shared_ptr<const LVL1TGC::NSWTrigOut> nsw_trigout = m_system->getNSW()->getOutput(region, !isAside, sectorId);
886 for ( int icand=0; icand<(int)nsw_trigout->getNSWeta().size(); icand++ ){
887 auto rawdata_nsw = std::make_unique<TgcRawData>(bcTag,
888 static_cast<uint16_t>(subDetectorId),
889 static_cast<uint16_t>(rodId),
890 l1Id,
891 bcId,
892 (!isEndcap),
893 static_cast<uint16_t>(secId), /*?*/
894 static_cast<uint16_t>(nsw_trigout->getNSWeta().at(icand)),
895 static_cast<uint16_t>(nsw_trigout->getNSWphi().at(icand)),
896 static_cast<uint16_t>(icand), //nswcand
897 static_cast<uint16_t>(nsw_trigout->getNSWDtheta().at(icand)),
898 0, //nswphires
899 0, //nswlowres
900 static_cast<uint16_t>(nsw_trigout->getNSWTriggerProcessor().at(icand)));
901 addRawData(std::move(rawdata_nsw), tgcrdo);
902 }
903 }
904
905 // RPC BIS78
906 if ( m_USEBIS78 ) {
907 std::shared_ptr<const LVL1TGC::BIS78TrigOut> bis78_trigout = m_system->getBIS78()->getOutput(sectorId);
908 for ( int icand=0; icand<(int)bis78_trigout->getBIS78eta().size(); icand++ ){
909 auto rawdata_bis78 = std::make_unique<TgcRawData>(bcTag,
910 static_cast<uint16_t>(subDetectorId),
911 static_cast<uint16_t>(rodId),
912 l1Id,
913 bcId,
914 (!isEndcap),
915 static_cast<uint16_t>(secId), /*?*/
916 static_cast<uint16_t>(bis78_trigout->getBIS78eta().at(icand)),
917 static_cast<uint16_t>(bis78_trigout->getBIS78phi().at(icand)),
918 static_cast<uint16_t>(icand),
919 static_cast<uint16_t>(bis78_trigout->getBIS78Deta().at(icand)),
920 static_cast<uint16_t>(bis78_trigout->getBIS78Dphi().at(icand)));
921 addRawData(std::move(rawdata_bis78), tgcrdo);
922 }
923 }
924}
size_t size() const
Number of registered mappings.
for(size_t i=0;i< m_blockFillers.size();i++)
Fill one block.

◆ recordRdoSL()

void LVL1TGCTrigger::LVL1TGCTrigger::recordRdoSL ( const Muon::TgcCablingMap & cabling,
TGCSector * sector,
std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > & tgcrdo )
private

Definition at line 927 of file LVL1TGCTrigger.cxx.

930{
931 // check if whether trigger output exists or not
932 std::shared_ptr<TGCTrackSelectorOut> selectorOut;
933 sector->getSL()->getTrackSelectorOutput(selectorOut);
934
935 if (selectorOut == nullptr) return;
936 if (selectorOut->getNCandidate() == 0) return;
937
938 // trigger info
939 // bool cand3plus = 0;
940 bool isEndcap = (sector->getRegionType() == TGCRegionType::ENDCAP);
941 bool isAside = (sector->getSideId()==0);
942 bool veto=0;
943 int phi=0, index=0, threshold=0, roi=0;
944 int Zdir= (isAside) ? 1 : -1;
945
946 // sector Id = 0..47 (Endcap) 0..23 (forward)
947 int module = sector->getModuleId();
948 int sectorId;
949 if (isEndcap){
950 sectorId = ((module/3)*2+module%3) + sector->getOctantId()*6;
951 } else {
952 sectorId = (module/3) + sector->getOctantId()*3;
953 }
954
955 // secID for TGCRawData
956 // 0-3(EC), 0-1(FWD) for new TGCcabling (1/12sector)
957 // 0-5(EC), 0-2(FWD) for new TGCcabling (octant)
958 int startEndcapSector{0}, coverageOfEndcapSector{0};
959 int startForwardSector{0}, coverageOfForwardSector{0};
960 int rodId = 1;
961 cabling.getCoveragefromSRodID(rodId,
962 startEndcapSector,
963 coverageOfEndcapSector,
964 startForwardSector,
965 coverageOfForwardSector
966 ) ;
967 int secId = 0;
968 if (isEndcap && (coverageOfEndcapSector != 0)){
969 secId = sectorId % coverageOfEndcapSector;
970 } else {
971 if (coverageOfForwardSector !=0 ){
972 secId = sectorId % coverageOfForwardSector;
973 }
974 }
975
976 // phi=1-48(EC), 1-24(FWD) in detector ID scheme
977 phi = (isEndcap ? (sectorId+46)%48+1 : (sectorId+23)%24+1);
978
979 // get readout ID
980 int subDetectorId = 0, sswId = 0, sbLoc = 0;
981 bool status = cabling.getSReadoutIDfromSLID(phi, isAside, isEndcap,
982 subDetectorId, rodId, sswId, sbLoc);
983 if (!status) {
984 ATH_MSG_WARNING("TGCcablignSvc::ReadoutIDfromSLID fails"
985 << (isEndcap ? " Endcap-" : " Forward-")
986 << (isAside ? "A " : "C ")
987 << " phi=" << phi );
988 return;
989 }
990
991 // bool overlap = 0;
992 int inner=0, coinFlag=0;
994 for (unsigned int icand=0; icand < (unsigned int)selectorOut->getNCandidate(); ++icand) {
995 index=icand;
996 bool muplus = getCharge(selectorOut->getDR(icand), Zdir)==1 ? 1 : 0;
997 threshold = selectorOut->getPtLevel(icand);
998 roi = ((selectorOut->getR(icand))<<2)+(selectorOut->getPhi(icand));
999 if (selectorOut->getInnerVeto(icand)) veto = 1;
1000 else veto = 0;
1001
1002 inner = selectorOut->getInnerCoincidenceFlag(icand);
1003 coinFlag = selectorOut->getCoincidenceType(icand);
1004
1005 // create TgcRawData
1006 auto rawdata = std::make_unique<TgcRawData>(bcTag,
1007 static_cast<uint16_t>(subDetectorId),
1008 static_cast<uint16_t>(rodId),
1009 l1Id,
1010 bcId,
1011 (!isEndcap), secId,
1012 inner,
1013 coinFlag,
1014 muplus, threshold, roi);
1015 addRawData(std::move(rawdata), tgcrdo);
1016
1017 ATH_MSG_DEBUG("recordRdoSL : bcTag =" << bcTag
1018 << " side=" << (isAside ? "A " : "C ")
1019 << " reg=" << (isEndcap ? "EC" : "FWD")
1020 << " phi=" << phi
1021 << " cand=" << index
1022 << " charge=" << (muplus ? "mu+" : "mu-")
1023 << " thre=" << threshold
1024 << " veto=" << veto
1025 << " roi=" << roi
1026 << " srod=" << rodId << " sswId=" << sswId << " SBLoc=" << sbLoc
1027 << " inner=" << inner << " coinFlag=" << coinFlag );
1028 }
1029 }
std::vector< std::string > veto
these patterns are anded
Definition listroot.cxx:191

◆ recordRdoSLB()

void LVL1TGCTrigger::LVL1TGCTrigger::recordRdoSLB ( const Muon::TgcCablingMap & cabling,
TGCSector * sector,
std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > & tgcrdo )
private

Definition at line 530 of file LVL1TGCTrigger.cxx.

533{
535 // readoutID
536 int subDetectorId, rodId, sswId, sbLoc, secId, secIdEIFI;
537 // SLBID
538 bool isAside, isEndcap; int phi, moduleType, id, phiEIFI;
539 isAside = (sector->getSideId()==0 ? 1 : 0);
540 isEndcap = (sector->getRegionType() == TGCRegionType::ENDCAP ? 1 : 0);
541 int module = sector->getModuleId();
542 // OnlineID moduleNumber
543 // <---- phi ----
544 // EC: 7 6 4 3 1 0 11 10 9
545 // FWD: 8 5 2 14 13 12
546 // [M1, M2, M3] [EI/FI]
547 // secId=0-5(EC), 0-2(FWD) for TgcRawData
548 secId = (isEndcap ? (module/3)*2+module%3 : module/3);
549 // phi=1-48(EC), 1-24(FWD) in detector ID scheme
550 phi = (isEndcap ? (secId+46+sector->getOctantId()*6)%48+1 : (secId+23+sector->getOctantId()*3)%24+1);
551 // secIdEIFI=0-2
552 secIdEIFI = module%3;
553 // phiEIFI=1-24
554 phiEIFI = (secIdEIFI+23+sector->getOctantId()*3)%24+1;
555
556 // SLB
557 const int NumberOfSLBType = 6;
558 // 0: WT, 1: WD, 2: ST, 3: SD, 4: WI 5:SI
559 for(int itype=0; itype<NumberOfSLBType; itype++) {
560 moduleType = getLPTTypeInRawData(itype);
561
562 // loop over all SB of each type
563 for(unsigned int index=0; index<sector->getNumberOfSB(itype); index++) {
564 TGCSlaveBoard * slb = sector->getSB(itype, index);
565 if (0==slb) continue;
566 id = slb->getId();
567 const TGCSlaveBoardOut * out = slb->getOutput();
568 if (0==out) continue;
569
570 bool isEIFI = (moduleType==TgcRawData::SLB_TYPE_INNER_WIRE ||
571 moduleType==TgcRawData::SLB_TYPE_INNER_STRIP);
572
573 // get ReadoutID
574 bool status =
575 cabling.getReadoutIDfromSLBID((isEIFI ? phiEIFI : phi),
576 isAside, isEndcap,
577 moduleType, id,
578 subDetectorId, rodId,
579 sswId, sbLoc);
580 if (!status) {
581 ATH_MSG_DEBUG("TGCcablignSvc::getReadoutIDfromSLBID fails");
582 ATH_MSG_DEBUG( "phi=" << phi
583 << " side=" << ((isAside) ? "A": "C")
584 << " region=" << ((isEndcap) ? "Endcap" : "Forward")
585 << " type=" << moduleType
586 << " id=" << id
587 << " subDetectorId=" << subDetectorId
588 << " rodId=" << rodId
589 << " sswId=" << sswId
590 << " sbLoc=" << sbLoc);
591 continue;
592 }
593
594 // fill TgcRawData
595 for(int iData=0; iData<out->getNumberOfData(); iData++) { // max 8
596 if (!out->getHit(iData)) continue;
597
598 // see TGCcabling/TGCId.h (WD=0,SD,WT,ST,SI,WI). Same as TgcRawData
599 TgcRawData::SlbType type = (TgcRawData::SlbType)moduleType;
600 int subMat = iData % 4;
601 int seg = 0;
602 if (type==TgcRawData::SLB_TYPE_TRIPLET_STRIP ) {
603 if (iData<4) seg= 1;
604 // 13.Jan.2011 reversed by Hisaya
605 // because Layer swap in TGCStripTripletSB::doCoincidence()
606 } else if ( (type==TgcRawData::SLB_TYPE_INNER_WIRE ) ||
607 (type==TgcRawData::SLB_TYPE_INNER_STRIP) ) {
608 seg= iData/4;
609 }
610 std::unique_ptr<TgcRawData> rawdata(new TgcRawData(bcTag,
611 static_cast<uint16_t>(subDetectorId),
612 static_cast<uint16_t>(rodId),
613 static_cast<uint16_t>(sswId),
614 static_cast<uint16_t>(sbLoc),
615 l1Id, bcId,
616 type, out->getDev(iData), seg, subMat,
617 out->getPos(iData)));
618 addRawData(std::move(rawdata), tgcrdo);
619
620 // EIFI trigger bits for SL are filled.
621 if(isEIFI) {
622 bool setEIFITriggerBit =
623 m_innerTrackletSlotHolder.setTriggerBit(sector->getSideId(),
624 phiEIFI,
625 (isEndcap ?
626 TGCInnerTrackletSlot::EI : TGCInnerTrackletSlot::FI),
627 (type==TgcRawData::SLB_TYPE_INNER_WIRE ?
628 TGCInnerTrackletSlot::WIRE : TGCInnerTrackletSlot::STRIP),
629 static_cast<unsigned int>(subMat),
630 true);
631
632 if(!setEIFITriggerBit) {
633 ATH_MSG_INFO("Fail to set Inner trigger bit of"
634 << " sideId= " << sector->getSideId()
635 << " slotId= " << phiEIFI
636 << " region= " << (isEndcap ? "EI" : "FI")
637 << " readout= " << (type==TgcRawData::SLB_TYPE_INNER_WIRE ? "WIRE" : "STRIP")
638 << " subMat(iBit)= " << static_cast<unsigned int>(subMat) );
639 }
640 }
641
642 ATH_MSG_DEBUG(" recordRdoSLB : reg=" << (isEndcap ? "EC" : "FWD")
643 << " srod=" << rodId << " sswId=" << sswId
644 << " SBLoc=" << sbLoc << " type=" << itype
645 << " iData(subMat:seg)=" << iData << " pos="
646 << out->getPos(iData) << " dev=" << out->getDev(iData) );
647 }
648 // end of filling TgcRawData
649
650 } // end of loop over SB
651 } // end loop for SLB type
652}

◆ 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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ start()

StatusCode LVL1TGCTrigger::LVL1TGCTrigger::start ( )
overridevirtual

Definition at line 1136 of file LVL1TGCTrigger.cxx.

1136 {
1137 if (m_bsMetaDataContRHKey.key().empty()) return StatusCode::SUCCESS;
1138
1139 ATH_MSG_DEBUG("Retrieving Detector Mask from ByteStream metadata container");
1141 if (bsmdc.isValid() && !bsmdc->empty()) {
1142 const ByteStreamMetadata* metadata = bsmdc->front();
1143 uint64_t detMaskLeast = metadata->getDetectorMask();
1144 uint64_t detMaskMost = metadata->getDetectorMask2();
1145
1146 std::vector<eformat::SubDetector> subDetOff;
1147 eformat::helper::DetectorMask(~detMaskLeast, ~detMaskMost).sub_detectors(subDetOff);
1148 auto sideA = std::find_if(subDetOff.begin(), subDetOff.end(), [](const eformat::SubDetector &s) {
1149 return (s == eformat::MUON_MMEGA_ENDCAP_A_SIDE || s == eformat::MUON_STGC_ENDCAP_A_SIDE); });
1150 auto sideC = std::find_if(subDetOff.begin(), subDetOff.end(), [](const eformat::SubDetector &s) {
1151 return (s == eformat::MUON_MMEGA_ENDCAP_C_SIDE || s == eformat::MUON_STGC_ENDCAP_C_SIDE); });
1152
1153 if (sideA != std::end(subDetOff)) tgcArgs()->set_NSWSideInfo(m_NSWSideInfo.value().erase(0,1));
1154 else if (sideC != std::end(subDetOff)) tgcArgs()->set_NSWSideInfo(m_NSWSideInfo.value().erase(1,1));
1155 else if (sideA != std::end(subDetOff) && sideC != std::end(subDetOff)) tgcArgs()->set_NSWSideInfo("");
1156 }
1157 return StatusCode::SUCCESS;
1158}
void set_NSWSideInfo(const std::string &v)
unsigned int constexpr sideC
Definition RPDUtils.h:15
unsigned int constexpr sideA
Definition RPDUtils.h:16
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ tgcArgs()

TGCArguments * LVL1TGCTrigger::LVL1TGCTrigger::tgcArgs ( )
inlineprivate

Definition at line 176 of file LVL1TGCTrigger.h.

176 {
177 return &m_tgcArgs;
178}

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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 }

Member Data Documentation

◆ m_bctagInProcess

uint16_t LVL1TGCTrigger::LVL1TGCTrigger::m_bctagInProcess {TgcDigit::BC_UNDEFINED}
private

Definition at line 139 of file LVL1TGCTrigger.h.

◆ m_bsMetaDataContRHKey

SG::ReadHandleKey<ByteStreamMetadataContainer> LVL1TGCTrigger::LVL1TGCTrigger::m_bsMetaDataContRHKey {this, "ByteStreamMetadataRHKey", "ByteStreamMetadata", "Location to retrieve the detector mask"}
private

Definition at line 169 of file LVL1TGCTrigger.h.

169{this, "ByteStreamMetadataRHKey", "ByteStreamMetadata", "Location to retrieve the detector mask"};

◆ m_cablingKey

SG::ReadCondHandleKey<Muon::TgcCablingMap> LVL1TGCTrigger::LVL1TGCTrigger::m_cablingKey {this, "CablingKey", "MuonTgc_CablingMap"}
private

Definition at line 156 of file LVL1TGCTrigger.h.

156{this, "CablingKey", "MuonTgc_CablingMap"};

◆ m_CurrentBunchTag

ShortProperty LVL1TGCTrigger::LVL1TGCTrigger::m_CurrentBunchTag {this,"CurrentBunchTag",TgcDigit::BC_CURRENT}
private

property, see LVL1TGCTrigger::LVL1TGCTrigger

Definition at line 120 of file LVL1TGCTrigger.h.

120{this,"CurrentBunchTag",TgcDigit::BC_CURRENT};

◆ m_db

TGCDatabaseManager* LVL1TGCTrigger::LVL1TGCTrigger::m_db
private

Definition at line 141 of file LVL1TGCTrigger.h.

◆ m_debuglevel

bool LVL1TGCTrigger::LVL1TGCTrigger::m_debuglevel
private

Definition at line 151 of file LVL1TGCTrigger.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_firstTime

bool LVL1TGCTrigger::LVL1TGCTrigger::m_firstTime {true}
private

Definition at line 138 of file LVL1TGCTrigger.h.

138{true};

◆ m_FORCENSWCOIN

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_FORCENSWCOIN {this,"FORCENSWCOIN",true}
private

Definition at line 132 of file LVL1TGCTrigger.h.

132{this,"FORCENSWCOIN",true}; // flag to enable innerCoincidenceFlag at the TGC sectors expecting NSW hits even if there is no NSW hit

◆ m_FULLCW

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_FULLCW {this,"FULLCW",false}
private

Definition at line 129 of file LVL1TGCTrigger.h.

129{this,"FULLCW",false}; // flag for using differne CW for each octant

◆ m_innerTrackletSlotHolder

TGCInnerTrackletSlotHolder LVL1TGCTrigger::LVL1TGCTrigger::m_innerTrackletSlotHolder
private

Definition at line 148 of file LVL1TGCTrigger.h.

◆ m_INNERVETO

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_INNERVETO {this,"INNERVETO",true}
private

Definition at line 128 of file LVL1TGCTrigger.h.

128{this,"INNERVETO",true}; // flag for using VETO by Inner Station for SL

◆ m_keyBIS78TrigOut

SG::ReadHandleKey<Muon::RpcBis78_TrigRawDataContainer> LVL1TGCTrigger::LVL1TGCTrigger::m_keyBIS78TrigOut {this,"BIS78Trig_Input","BIS78TrigContainer","Location of RpcBis78_TrigRawDataContainer"}
private

Definition at line 163 of file LVL1TGCTrigger.h.

163{this,"BIS78Trig_Input","BIS78TrigContainer","Location of RpcBis78_TrigRawDataContainer"};

◆ m_keyMuCTPIInput_TGC

StringProperty LVL1TGCTrigger::LVL1TGCTrigger::m_keyMuCTPIInput_TGC {this,"MuCTPIInput_TGC","L1MuctpiStoreTGC"}
private

Definition at line 117 of file LVL1TGCTrigger.h.

117{this,"MuCTPIInput_TGC","L1MuctpiStoreTGC"};

◆ m_keyNSWTrigOut

SG::ReadHandleKey<Muon::NSW_TrigRawDataContainer> LVL1TGCTrigger::LVL1TGCTrigger::m_keyNSWTrigOut {this,"NSWTrigger_Input","L1_NSWTrigContainer","Location of NSW_TrigRawDataContainer"}
private

Definition at line 162 of file LVL1TGCTrigger.h.

162{this,"NSWTrigger_Input","L1_NSWTrigContainer","Location of NSW_TrigRawDataContainer"};

◆ m_keyTgcDigit

SG::ReadHandleKey<TgcDigitContainer> LVL1TGCTrigger::LVL1TGCTrigger::m_keyTgcDigit {this,"InputData_perEvent","TGC_DIGITS","Location of TgcDigitContainer"}
private

Definition at line 160 of file LVL1TGCTrigger.h.

160{this,"InputData_perEvent","TGC_DIGITS","Location of TgcDigitContainer"};

◆ m_keyTgcRdo

SG::WriteHandleKey<TgcRdoContainer> LVL1TGCTrigger::LVL1TGCTrigger::m_keyTgcRdo {this,"TgcRdo","TGCRDO2","Location of TgcRdoContainer"}
private

Definition at line 158 of file LVL1TGCTrigger.h.

158{this,"TgcRdo","TGCRDO2","Location of TgcRdoContainer"};

◆ m_keyTgcRdoIn

SG::ReadHandleKey<TgcRdoContainer> LVL1TGCTrigger::LVL1TGCTrigger::m_keyTgcRdoIn {this,"InputRDO","TGCRDO","Location of input TgcRdoContainer"}
private

Definition at line 159 of file LVL1TGCTrigger.h.

159{this,"InputRDO","TGCRDO","Location of input TgcRdoContainer"};

◆ m_keyTileMu

SG::ReadHandleKey<TileMuonReceiverContainer> LVL1TGCTrigger::LVL1TGCTrigger::m_keyTileMu {this,"TileMuRcv_Input","TileMuRcvCnt","Location of TileMuonReceiverContainer"}
private

Definition at line 161 of file LVL1TGCTrigger.h.

161{this,"TileMuRcv_Input","TileMuRcvCnt","Location of TileMuonReceiverContainer"};

◆ m_MaskedChannel

std::map<Identifier, int> LVL1TGCTrigger::LVL1TGCTrigger::m_MaskedChannel
private

mask channel map

Definition at line 172 of file LVL1TGCTrigger.h.

◆ m_MaskFileName12

StringProperty LVL1TGCTrigger::LVL1TGCTrigger::m_MaskFileName12 {this,"MaskFileName12",""}
private

property, see LVL1TGCTrigger::LVL1TGCTrigger

Definition at line 119 of file LVL1TGCTrigger.h.

119{this,"MaskFileName12",""};

◆ m_muctpiPhase1Key

SG::WriteHandleKey<LVL1MUONIF::Lvl1MuCTPIInputPhase1> LVL1TGCTrigger::LVL1TGCTrigger::m_muctpiPhase1Key {this, "MuctpiPhase1LocationTGC", "L1MuctpiStoreTGC", "Location of muctpiPhase1 for Tgc"}
private

Definition at line 166 of file LVL1TGCTrigger.h.

166{this, "MuctpiPhase1LocationTGC", "L1MuctpiStoreTGC", "Location of muctpiPhase1 for Tgc"};

◆ m_nEventInSector

int LVL1TGCTrigger::LVL1TGCTrigger::m_nEventInSector
private

Definition at line 145 of file LVL1TGCTrigger.h.

◆ m_NSWSideInfo

StringProperty LVL1TGCTrigger::LVL1TGCTrigger::m_NSWSideInfo {this,"NSWSideInfo",""}
private

Definition at line 136 of file LVL1TGCTrigger.h.

136{this,"NSWSideInfo",""};// Information about NSW geometry. It should be "" or "AC" or "A" or "C"

◆ m_OutputTgcRDO

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_OutputTgcRDO {this,"OutputTgcRDO",true}
private

property, see LVL1TGCTrigger::LVL1TGCTrigger

Definition at line 122 of file LVL1TGCTrigger.h.

122{this,"OutputTgcRDO",true};

◆ m_ProcessAllBunches

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_ProcessAllBunches {this,"ProcessAllBunhes",true}
private

Definition at line 121 of file LVL1TGCTrigger.h.

121{this,"ProcessAllBunhes",true};

◆ m_readCondKey

SG::ReadCondHandleKey<TGCTriggerData> LVL1TGCTrigger::LVL1TGCTrigger::m_readCondKey {this,"ReadCondKey","TGCTriggerData"}
private

Definition at line 164 of file LVL1TGCTrigger.h.

164{this,"ReadCondKey","TGCTriggerData"};

◆ m_readLUTs_CondKey

SG::ReadCondHandleKey<TGCTriggerLUTs> LVL1TGCTrigger::LVL1TGCTrigger::m_readLUTs_CondKey {this,"ReadLUTCondKey","TGCTriggerLUTs"}
private

Definition at line 165 of file LVL1TGCTrigger.h.

165{this,"ReadLUTCondKey","TGCTriggerLUTs"};

◆ m_SHPTORED

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_SHPTORED {this, "SHPTORED", true}
private

Definition at line 126 of file LVL1TGCTrigger.h.

126{this, "SHPTORED", true}; //< flag for E1/E2 chamber ORED in Strip HPT

◆ m_system

std::unique_ptr<TGCElectronicsSystem> LVL1TGCTrigger::LVL1TGCTrigger::m_system
private

Definition at line 143 of file LVL1TGCTrigger.h.

◆ m_tgcArgs

TGCArguments LVL1TGCTrigger::LVL1TGCTrigger::m_tgcArgs
private

Definition at line 153 of file LVL1TGCTrigger.h.

◆ m_TILEMU

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_TILEMU {this,"TILEMU",true}
private

Definition at line 130 of file LVL1TGCTrigger.h.

130{this,"TILEMU",true}; // flag for using TileMu

◆ m_TimingManager

std::unique_ptr<TGCTimingManager> LVL1TGCTrigger::LVL1TGCTrigger::m_TimingManager
private

Definition at line 142 of file LVL1TGCTrigger.h.

◆ m_USE_CONDDB

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_USE_CONDDB {this, "USE_CONDDB", true}
private

Definition at line 125 of file LVL1TGCTrigger.h.

125{this, "USE_CONDDB", true}; //< flag to use the Condition DB

◆ m_USEBIS78

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_USEBIS78 {this,"USEBIS78",false}
private

Definition at line 133 of file LVL1TGCTrigger.h.

133{this,"USEBIS78",false}; // flag for using RPC BIS78

◆ m_USEINNER

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_USEINNER {this, "USEINNER", true}
private

Definition at line 127 of file LVL1TGCTrigger.h.

127{this, "USEINNER", true}; //< flag for using Inner Station for SL

◆ m_USENSW

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_USENSW {this,"USENSW",false}
private

Definition at line 131 of file LVL1TGCTrigger.h.

131{this,"USENSW",false}; // flag for using NSW

◆ m_useRun3Config

BooleanProperty LVL1TGCTrigger::LVL1TGCTrigger::m_useRun3Config {this,"useRun3Config",false}
private

Definition at line 134 of file LVL1TGCTrigger.h.

134{this,"useRun3Config",false}; // flag for using switch between Run3 and Run2 algorithms

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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