 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/INTupleSvc.h"
18 #include "CaloDetDescr/CaloDetDescrElement.h"
45 m_nWrongBunchGroup(0),
50 m_onlineHelper(nullptr),
51 m_onlineHelperSC(nullptr),
143 return StatusCode::SUCCESS;
149 m_runData = std::make_unique<RunData>(0);
152 std::vector<std::regex> regexs;
159 std::vector<std::string> myChains;
171 if (calibStreamGroup) {
178 unsigned int idx = 0;
182 for (
const std::string& l1Item :
group->getListOfTriggers()) {
185 ATH_MSG_WARNING (
"LVL1 item " << l1Item <<
", obtained from TrigConfig, cannot be retrieved!" );
189 if (pos < 0 || pos >= 256) {
194 ATH_MSG_INFO (
"Adding LVL1 trigger bit for " << l1Item <<
" at position " <<
pos );
199 for (
const std::string&
name : myChains) {
214 return StatusCode::SUCCESS;
221 const EventContext& ctx = Gaudi::Hive::currentContext();
225 return StatusCode::SUCCESS;
236 int bunchId = eventInfo->
bcid();
242 return StatusCode::SUCCESS;
248 if (!bunchCrossing) {
250 return StatusCode::FAILURE;
261 return StatusCode::SUCCESS;
270 if (
eventIndex < 0)
return StatusCode::FAILURE;
276 return StatusCode::SUCCESS;
281 if (larDigitContainer->
empty()) {
284 return StatusCode::SUCCESS;
290 return StatusCode::SUCCESS;
298 return StatusCode::SUCCESS;
304 const LArOnOffIdMapping*
cabling=*cablingHdl;
306 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping" );
307 return StatusCode::FAILURE;
314 return StatusCode::FAILURE;
321 return StatusCode::FAILURE;
330 return StatusCode::FAILURE;
338 return StatusCode::FAILURE;
343 if (
evtStore()->contains<LArOFIterResultsContainer> (
"LArOFIterResult")) {
352 const std::map<unsigned int,uint16_t>& febErrorMap = larFebErrorSummary->
get_all_febs();
353 std::map<unsigned int, const LArRawChannel*> channelsToKeep;
363 if (!
hash.is_valid()) {
365 <<
") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
366 return StatusCode::FAILURE;
373 HWIdentifier channelID =
channel->hardwareID();
383 std::map<HWIdentifier, LArOFIterResultsContainer::const_iterator> ofcResultPosition;
385 for (LArOFIterResultsContainer::const_iterator ofResult = ofIterResult->begin();
386 ofResult != ofIterResult->end(); ++ofResult)
387 ofcResultPosition[ofResult->getChannelID()] = ofResult;
390 <<
" " << (ofIterResult ? ofIterResult->size() : 0) <<
" "
402 std::map<unsigned int, const LArRawChannel*>::const_iterator findChannel = channelsToKeep.find(
hash);
403 if (findChannel == channelsToKeep.end())
continue;
407 HWIdentifier channelID = (*digit)->hardwareID();
417 const bool connected =
cabling->isOnlineConnected(channelID);
424 const std::vector<short>& samples = (*digit)->samples();
426 for (
short sample : samples)
438 if (!caloDetElement) caloDetElement = caloMgr->
get_element(
id);
447 unsigned int status = 0xFFFFFFFF;
449 if (!caloDetElement) caloDetElement = caloMgr->
get_element(
id);
451 status = bcCont->status(channelID).packedData();
453 std::map<unsigned int,uint16_t>::const_iterator findError = febErrorMap.find(febId.get_identifier32().get_compact());
454 if (findError != febErrorMap.end()) {
455 unsigned int febErrWord = findError->second;
465 ATH_MSG_WARNING (
"AutoCorr object is not of type LArAutoCorrComplete!" );
470 if (!
info->shape((*digit)->gain()))
475 if (
eventIndex < 0)
return StatusCode::FAILURE;
481 rawChannel->
time()/
double(1000),
499 data->setADCMax(rawChannel->
energy()/ramp[1]);
506 std::map<unsigned int, const LArRawSC*> scToKeep;
511 return StatusCode::SUCCESS;
515 if (hdlSC->
empty()) {
517 return StatusCode::SUCCESS;
523 return StatusCode::SUCCESS;
527 if (hdlrecoSC->
empty()) {
529 return StatusCode::SUCCESS;
533 const LArOnOffIdMapping* cablingSC=*cablingHdl;
535 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping" );
536 return StatusCode::FAILURE;
546 ATH_MSG_ERROR(
"Failed to retrieve pedestal cond obj for SC");
547 return StatusCode::FAILURE;
550 std::map<unsigned int, std::pair<float, std::pair<float,float> > > channelsToKeepSC;
552 for (
const LArRawSC* rawSC : *hdlSC) {
557 const std::vector<unsigned short>& bcids = rawSC->bcids();
558 const std::vector<int>& energies = rawSC->energies();
559 const std::vector<bool>& satur = rawSC->satur();
563 float defValue = -99999999.;
565 const size_t nBCIDs = bcids.size();
567 for (
i = 0;
i < nBCIDs && bcids[
i] != bunchId;
i++)
569 if(
i==nBCIDs)
continue;
570 if (satur[
i])
continue;
578 if (!
hash.is_valid()) {
579 ATH_MSG_FATAL (
"Found a LArRawSC whose HWIdentifier (" << rawSC->hardwareID()
580 <<
") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
581 return StatusCode::FAILURE;
584 channelsToKeepSC[
hash] = std::make_pair(scEne, std::make_pair(defValue,defValue));
590 HWIdentifier channelID = rawSC->hardwareID();
591 const Identifier id = cablingSC->cnvToIdentifier(channelID);
599 ATH_MSG_INFO(
"SC to keep in this event: "<<channelsToKeepSC.size());
601 for (
const LArRawSC* rawSC : *hdlrecoSC) {
605 if (!
hash.is_valid()) {
606 ATH_MSG_FATAL (
"Found a LArRawSC whose HWIdentifier (" << rawSC->hardwareID()
607 <<
") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
608 return StatusCode::FAILURE;
612 if (channelsToKeepSC.find(
hash) == channelsToKeepSC.end())
continue;
614 const std::vector<unsigned short>& bcids = rawSC->bcids();
615 const std::vector<int>& energies = rawSC->energies();
616 const std::vector<int>& tauenergies = rawSC->tauEnergies();
620 float scTim = -99999999.;
622 const size_t nBCIDs = bcids.size();
624 for (
i = 0;
i < nBCIDs && bcids[
i] != bunchId;
i++)
626 if(
i==nBCIDs)
continue;
630 if(tauenergies.size() && scEne != 0) scTim = tauenergies[
i] / scEne;
632 channelsToKeepSC[
hash].second = std::make_pair(scEne, scTim);
638 HWIdentifier channelID = rawSC->hardwareID();
639 const Identifier id = cablingSC->cnvToIdentifier(channelID);
651 return StatusCode::SUCCESS;
656 if (larSCDigitContainer->
empty()) {
659 return StatusCode::SUCCESS;
668 std::map<unsigned int, std::pair<float, std::pair<float,float> > >::const_iterator findChannel = channelsToKeepSC.find(
hash);
669 if (findChannel == channelsToKeepSC.end())
continue;
672 float pedestal = pedestalsSC->
pedestal((*digit)->channelID(), 0);
674 const std::vector<short>& samples = (*digit)->samples();
676 for (
short sample : samples)
681 const Identifier id = cablingSC->cnvToIdentifier((*digit)->channelID());
687 if (!caloDetElement) caloDetElement = caloMgrSC->
get_element(
id);
697 if (
eventIndex < 0)
return StatusCode::FAILURE;
702 findChannel->second.first,
703 findChannel->second.second.second,
704 findChannel->second.second.first,
715 return StatusCode::SUCCESS;
722 return StatusCode::SUCCESS;
739 ATH_MSG_INFO (
"Cell with no cellInfo at index " <<
i <<
" !!" );
766 return StatusCode::SUCCESS;
774 std::vector<unsigned int> triggerWords;
781 const std::vector<ROIB::CTPRoI> tav = l1Result->
cTPResult().
TAV();
783 triggerWords.push_back(word.roIWord());
785 for (
const std::pair<const TString, unsigned int>&
p :
m_runData->triggerConfig()) {
786 while (triggerWords.size() <=
p.second/32) triggerWords.push_back(0);
788 triggerWords[
p.second/32] |= (0x1 << (
p.second % 32));
810 eventData->
addRoI(roI.cptr()->eta(), roI.cptr()->phi(),
group->getListOfTriggers()[0].c_str(), roI.label().c_str());
def retrieve(aClass, aKey=None)
ToolHandle< ILArShapeDumperTool > m_dumperTool
ROIB::CTPRoI contains a RoI delivered by the CTP.
Liquid Argon SuperCell raw data.
virtual float pedestal(const HWIdentifier &id, int gain) const =0
bool m_gains[CaloGain::LARNGAIN]
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
char data[hepevt_bytes_allocation_ATLAS]
SG::ReadHandleKey< LArRawSCContainer > m_rawRecomputedscKey
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
Const iterator class for DataVector/DataList.
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
const std::map< unsigned int, uint16_t > & get_all_febs() const
get all febs with error
#define maxValue(current, test)
void setRunData(const RunData *runData)
uint64_t eventNumber() const
The current event's event number.
Class holding the LVL1 RoIB result build by the RoIBuilder.
LArBadChannelMask m_bcMaskSC
const HistoryContainer * historyContainer(unsigned int i) const
virtual StatusCode execute() override
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
LArBadChannelMask m_bcMask
LArShapeDumper(const std::string &name, ISvcLocator *pSvcLocator)
std::uint64_t m_count
the number of times the timer has been started
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
unsigned int addEvent(EventData *eventData)
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
StatusCode buildBitMask(const std::vector< std::string > &problemsToMask, MsgStream &msg)
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
virtual StatusCode initialize() override
void addRoI(float eta, float phi, const char *name="", const char *label="")
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKeySC
std::vector< std::string > m_triggerNames
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
bool cellShouldBeMasked(const LArBadChannelCont *bcCont, const HWIdentifier &hardwareId) const
unsigned m_nPrescaledAway
@ LAr
The LAr calorimeter.
SG::ReadHandleKey< LArRawChannelContainer > m_channelsKey
uint32_t runNumber() const
The current event's run number.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
@ Error
The sub-detector issued an error.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
This class defines the interface for accessing AutoCorrelation parameters for each channel @stereotyp...
Gaudi::Property< std::vector< std::string > > m_problemsToMaskSC
Definition of CaloDetDescriptor.
bool isFCALchannel(const HWIdentifier id) const
This class implements the ILArAutoCorr interface.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
HistoryContainer *& hist_cont(unsigned int i)
bool isEMECchannel(const HWIdentifier id) const override final
Gaudi::Property< std::vector< std::string > > m_problemsToMask
POOL::TEvent event(POOL::TEvent::kClassAccess)
Liquid Argon ROD output object base class.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
unsigned int nChannels() const
SG::ReadHandleKey< LArRawSCContainer > m_rawscKey
#define CHECK(...)
Evaluate an expression and check for errors.
void setTriggerData(const std::vector< unsigned int > &words)
const LArOnline_SuperCellID * m_onlineHelperSC
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
CellInfo * cell_info() const
uint32_t lumiBlock() const
The current event's luminosity block number.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
SG::ReadHandleKey< LArDigitContainer > m_digitsKey
HistoryContainer * makeNewHistorySC(const IdentifierHash &hash, CellInfo *info)
const CTPResult & cTPResult() const
Gets the CTP part of the L1 RDO.
ToolHandle< ILArShapeDumperTool > m_dumperToolSC
StatusCode initialize(bool used=true)
storage of the time histories of all the cells
bool isEMBchannel(const HWIdentifier id) const
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKey
Class describing the basic event information.
SG::ReadHandleKey< LArDigitContainer > m_digitsKeySC
const std::vector< CTPRoI > TAV() const
get trigger result after veto
const CellInfo * cellInfo() const
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKeySC
virtual StatusCode start() override
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
unsigned int addRun(RunData *eventData)
This class provides the client interface for accessing the detector description information common to...
std::unique_ptr< LArSamples::RunData > m_runData
LArSamples::DataStore * m_samples
virtual StatusCode finalize() override
#define ATH_MSG_WARNING(x)
Holds information from the FEB Error Summary.
void add(const DataContainer *data)
append data (takes ownership)
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
virtual StatusCode stop() override
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKey
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
Container class for LArDigit.
std::vector< const Trig::ChainGroup * > m_triggerGroups
unsigned m_nWrongBunchGroup
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
bool isHECchannel(const HWIdentifier id) const override final
HistoryContainer *& hist_cont_sc(unsigned int i)
const LArOnlineID * m_onlineHelper
std::vector< std::string > getListOfTriggers() const
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
uint32_t bcid() const
The bunch crossing ID of the event.
virtual float pedestalRMS(const HWIdentifier &id, int gain) const =0
access to RMS of Pedestal index by Identifier, and gain setting
SG::ReadCondHandleKey< ILArAutoCorr > m_acorrKey
size_type size() const noexcept
Returns the number of elements in the collection.
int makeEvent(LArSamples::EventData *&eventData, int run, int event, int lumiBlock, int bunchXing) const
bool empty() const noexcept
Returns true if the collection is empty.
bool writeTrees(const char *fileName)
virtual AutoCorrRef_t autoCorr(const HWIdentifier &CellID, int gain) const
bool match(std::string s1, std::string s2)
match the individual directories of two strings
HWIdentifier feedthrough_Id(int barrel_ec, int pos_neg, int feedthrough) const
Create a feedthrough identifier from fields.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
bool isFilled(const bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
Proxy for accessing a range of float values like a vector.
Container for LArRawChannel (IDC using LArRawChannelCollection)
HistoryContainer * makeNewHistory(const IdentifierHash &hash, CellInfo *info)
append data (takes ownership of everything)
thread_local event_number_t eventIndex