|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/IToolSvc.h"
13 #include "GaudiKernel/EventContext.h"
29 #ifdef TRIGLARCELLDEBUG
30 std::cout <<
"LArCellCont \t\t DEBUG \t in initialize" << std::endl;
47 #ifdef TRIGLARCELLDEBUG
48 std::cout <<
"LArCellCont\t\t DEBUG \t"
55 this->push_back(mycoll);
62 std::vector<const CaloCellCorrection*> LArCellCorrTools;
66 makeCell.
initialize( roiMap, onOffMap, man, &LArCellCorrTools, 0 );
69 bool toolAvailable =
sc.isSuccess();
73 "Failed to retrieve LArBadFebMasker - no masking will be done." <<
endmsg;
75 std::vector<uint32_t> RobsFromMissingFeb;
79 std::vector<HWIdentifier>::const_iterator
end = onlineId->
channel_end ();
93 for (
unsigned iFeb=0;iFeb<onlineId->
febHashMax();++iFeb) {
104 #ifdef TRIGLARCELLDEBUG
105 std::cout <<
"LArCellCont\t\t DEBUG \t"
110 std::map<LArRoIMap::TT_ID,std::vector<LArCell* > > collMap;
111 if ( (*
this)[
idx]->
size() != 0 ) {
115 hashTab.reserve(256);
117 for(
int ch=0;
ch<128;
ch++){
123 (*this)[
idx]->push_back(larcell);
134 if (
good ) collMap[ttId].push_back(larcell);
138 hashTab.push_back(
index );
139 }
else hashTab.push_back(indexsetmax);
140 #ifdef TRIGLARCELLDEBUG
141 std::cout <<
"Cell registered at Collection "
143 " Channel " <<
ch <<
" TTId " << (
unsigned int)ttId
148 #ifdef TRIGLARCELLDEBUG
149 std::cout <<
"Cell not existing" << std::endl;
152 (*this)[
idx]->push_back(larcell);
153 hashTab.push_back( indexsetmax);
156 for (
const auto& [ttid,
cells] : collMap) {
165 (*this)[
idx]->setTT(ttid,
vec->begin(),
vec->end());
172 for(
size_t i = 0 ;
i < RobsFromMissingFeb.size() ;
i++)
173 for(
size_t j =
i+1 ; j < RobsFromMissingFeb.size() ; j++)
174 if ( RobsFromMissingFeb[
i] == RobsFromMissingFeb[j] )
176 RobsFromMissingFeb.clear();
178 return StatusCode::SUCCESS;
183 for(
int i=0;
i<number_of_col;
i++){
184 int number_of_cell = ((*this)[
i])->
size();
185 for(
int j=0;j<number_of_cell;j++)
186 delete ((*((*
this)[
i]))[j]);
187 if ((*
this)[
i] != NULL)
196 return StatusCode::SUCCESS;
200 const std::vector<LArCellCollection*>::const_iterator
203 return (std::vector<LArCellCollection*>::const_iterator)((*this).begin()+
idx);
207 const std::vector<LArCellCollection*>::const_iterator
212 return (std::vector<LArCellCollection*>::const_iterator)((*this).begin()+
idx);
215 return (std::vector<LArCellCollection*>::const_iterator)((*this).end());
221 std::vector<LArCellCollection*>::const_iterator
it = (std::vector<LArCellCollection*>::const_iterator)((*this).begin()+
idx);
223 unsigned int itsize =
col->size();
225 for(
unsigned int i=0;
i< itsize; ++
i){
228 #ifdef TRIGLARCELLDEBUG
229 std::cout <<
"LArCellId= " <<
cell->ID() <<
" Ecorr= " << cor <<
" MeV " << std::endl;
231 float cellenergy =
cell->energy();
232 cell->setEnergyFast( cellenergy - cor );
245 #ifdef TRIGLARCELLDEBUG
246 std::cout <<
"Update : CURRENT lumi_block, BCID = " << lumi_block <<
", " <<
BCID <<
" <--> PREVIOUS lumi_block = " <<
m_lumi_block <<
", " <<
m_bcid << std::endl;
255 std::map<HWIdentifier,int>::const_iterator
end =
m_indexset.end ();
257 std::map<HWIdentifier,int>::const_iterator
beg =
m_indexset.begin();
260 int idx = (*beg).second;
263 float corr =
avg.average(
id);
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
uint32_t getRobID(uint32_t rod_id) const
Make a ROB Source ID from a ROD source ID.
bool good() const
Returns true if no problems at all (all bits at zero)
LArCell * getLArCell(unsigned int feb, unsigned int chan, int e, int t, int q, CaloGain::CaloGain caloGain, unsigned int &ttId) const
access by Identifier
#define CHECK_WITH_CONTEXT(...)
Evaluate an expression and check for errors, with an explicitly specified context name.
LArRodIdHash m_hash
Hash ID Identifier mapping to collection index.
size_type febHashMax(void) const
define feb hash tables max size
HWIdentifier getReadoutModuleID(const HWIdentifier &id) const
void initialize(int offset, const std::vector< HWIdentifier > &roms)
Initialize.
bool m_BCIDcache
flag to only update cache when trying to apply corrections
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
ID identifier(int i) const
reverse conversion
std::vector< HWIdentifier > m_second
FEB Hardware Identifier for second FEBs in a Collection.
bool lumiBCIDCheck(const EventContext &context)
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
uint32_t getRodID(const LArFebRodMapping &rodMapping, const HWIdentifier &hid) const
make a ROD SrcID for a HWIdentifier
const std::vector< LArCellCollection * >::const_iterator find(const HWIdentifier &id) const
Finds a collection by its LArReadoutModuleID.
Building LArCell objects from LArRawChannel.
virtual bool febMissing(const HWIdentifier &febId) const =0
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
std::vector< unsigned int > m_eventNumber
eventNumber of a given Collection
std::vector< size_t > vec
HWIdentifier findsec(const unsigned int &id) const
Each Collection contains data from 2 FEBs.
LArBC_t offlineStatus(const Identifier id) const
Query the status of a particular channel by offline ID This is the main client access method.
Mapping between calorimeter trigger id to offline/online Identifier.
id_iterator channel_end() const
value_type get_compact() const
Get the compact id.
Definition of CaloDetDescrManager.
void initialize(const LArRoIMap &roiMap, const LArOnOffIdMapping &onOffMap, const CaloDetDescrManager &man, const std::vector< const CaloCellCorrection * > *pCorr, unsigned int poolMaxSize=190000)
initialize the internal map
EventIDBase::event_number_t event_number_t
void applyBCIDCorrection(const unsigned int &rodid)
method to apply correction based on the luminosity to the energy
Helper class to handle z-phi symmetry of calibration constants in MC.
float m_lumi_block
current lumi_block
unsigned int m_event
this event number
bool problematicForUnknownReason() const
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize(const LArFebRodMapping &rodMapping)
EventIDBase::event_number_t m_bcidEvt
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
HWIdentifier ZPhiSymOnl(const HWIdentifier notSymOnlId) const
Find the symmetric HWID for an online channel identifier.
void setGain(CaloGain::CaloGain gain=CaloGain::INVALIDGAIN)
set gain
const ILArBadFebMasker * m_badFebMasker
A tool to help mask cells.
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
const std::vector< HWIdentifier > & getLArRoModIDvec() const
"iterator" on LArReadoutModuleIDs
Container Class for LArCell in a ROB used by EF.
std::vector< float > m_corrBCID
corrections for a given BCID
uint32_t getRodIDFromROM(const COLLECTION_ID &hid) const
make a ROD SrcID for a COLLECTION_ID
Helpers for checking error return status codes and reporting errors.
StatusCode initialize(const LArRoIMap &roiMap, const LArOnOffIdMapping &onOffMap, const LArMCSym &mcsym, const LArFebRodMapping &febrod, const LArBadChannelCont &badchannel, const CaloDetDescrManager &ddm)
initialize method.
Data object for LAr calorimeter readout cell.
setEventNumber setTimeStamp bcid
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Hid2RESrcID m_conv
Hardware to Source ID conversion.
void updateBCID(const CaloBCIDAverage &, const LArOnOffIdMapping &)
update BCID dependent correction table for MT case
int max() const
return maximum number of IDs
LArCellCont()
Constructor.
void setThreshold(float t)
void lumiBlock_BCID(const unsigned int lumi_block, const unsigned int BCID)
sets LumiBlock and BCID
std::vector< DataVector< LArCell > * > m_vecs
One needs to destroy the TT vectors.
This class provides the client interface for accessing the detector description information common to...
Identifier cnvToIdentifier(const HWIdentifier &sid) const
create an Identifier from a HWIdentifier (inline)
std::map< HWIdentifier, int > m_indexset
index table
Mapping between calorimeter trigger id to offline/online Identifier.
std::vector< uint32_t > m_MissingROBs
List of Missing ROBs to be disabled at the RS.
std::vector< std::vector< int > > m_hashSym
hash references to BCID
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
id_iterator channel_begin() const
Returns an iterator pointing to a channel identifier collection.
StatusCode finalize(void)
finalize method.