![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/ISvcLocator.h"
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;
34 ISvcLocator* svcLoc = Gaudi::svcLocator( );
35 IToolSvc* toolSvc =
nullptr;
36 sc = svcLoc->service(
"ToolSvc",toolSvc);
38 std::cout <<
"LArCellCont:initialize ERROR: Can not retrieve ToolSvc" << std::endl;
39 return StatusCode::FAILURE;
45 std::cout <<
"LArCellCont:initialize ERROR: Can not retrieve DetectorStore" << std::endl;
46 return StatusCode::FAILURE;
52 std::cout <<
"LArCellCont:initialize ERROR: Can not retrieve LArOnlineID" << std::endl;
53 return StatusCode::FAILURE;
58 std::cout <<
"Problems to initialize Hid2RESrcID" << std::endl;
59 return StatusCode::FAILURE;
65 #ifdef TRIGLARCELLDEBUG
66 std::cout <<
"LArCellCont\t\t DEBUG \t"
73 this->push_back(mycoll);
80 std::vector<const CaloCellCorrection*> LArCellCorrTools;
84 makeCell.
initialize( roiMap, onOffMap, man, &LArCellCorrTools, 0 );
95 bool toolAvailable =
sc.isSuccess();
98 std::cout <<
"LArCellCont\t\t INFO \t Failed to retrieve LArBadFebMasker - no masking will be done." << std::endl;
99 std::cout <<
"toolAvailable "<<toolAvailable<<std::endl;
101 std::vector<uint32_t> RobsFromMissingFeb;
106 std::vector<HWIdentifier>::const_iterator
end = onlineId->
channel_end ();
120 for (
unsigned iFeb=0;iFeb<onlineId->
febHashMax();++iFeb) {
131 #ifdef TRIGLARCELLDEBUG
132 std::cout <<
"LArCellCont\t\t DEBUG \t"
137 std::map<LArRoIMap::TT_ID,std::vector<LArCell* > > collMap;
138 if ( (*
this)[
idx]->
size() != 0 ) {
142 hashTab.reserve(256);
144 for(
int ch=0;
ch<128;
ch++){
150 (*this)[
idx]->push_back(larcell);
161 if (
good ) collMap[ttId].push_back(larcell);
165 hashTab.push_back(
index );
166 }
else hashTab.push_back(indexsetmax);
167 #ifdef TRIGLARCELLDEBUG
168 std::cout <<
"Cell registered at Collection "
170 " Channel " <<
ch <<
" TTId " << (
unsigned int)ttId
175 #ifdef TRIGLARCELLDEBUG
176 std::cout <<
"Cell not existing" << std::endl;
179 (*this)[
idx]->push_back(larcell);
180 hashTab.push_back( indexsetmax);
183 for (
const auto& [ttid,
cells] : collMap) {
192 (*this)[
idx]->setTT(ttid,
vec->begin(),
vec->end());
199 for(
size_t i = 0 ;
i < RobsFromMissingFeb.size() ;
i++)
200 for(
size_t j =
i+1 ; j < RobsFromMissingFeb.size() ; j++)
201 if ( RobsFromMissingFeb[
i] == RobsFromMissingFeb[j] )
203 RobsFromMissingFeb.clear();
205 return StatusCode::SUCCESS;
210 for(
int i=0;
i<number_of_col;
i++){
211 int number_of_cell = ((*this)[
i])->
size();
212 for(
int j=0;j<number_of_cell;j++)
213 delete ((*((*
this)[
i]))[j]);
214 if ((*
this)[
i] != NULL)
223 return StatusCode::SUCCESS;
227 const std::vector<LArCellCollection*>::const_iterator
230 return (std::vector<LArCellCollection*>::const_iterator)((*this).begin()+
idx);
234 const std::vector<LArCellCollection*>::const_iterator
239 return (std::vector<LArCellCollection*>::const_iterator)((*this).begin()+
idx);
242 return (std::vector<LArCellCollection*>::const_iterator)((*this).end());
248 std::vector<LArCellCollection*>::const_iterator
it = (std::vector<LArCellCollection*>::const_iterator)((*this).begin()+
idx);
250 unsigned int itsize =
col->size();
252 for(
unsigned int i=0;
i< itsize; ++
i){
255 #ifdef TRIGLARCELLDEBUG
256 std::cout <<
"LArCellId= " <<
cell->ID() <<
" Ecorr= " << cor <<
" MeV " << std::endl;
258 float cellenergy =
cell->energy();
259 cell->setEnergyFast( cellenergy - cor );
272 #ifdef TRIGLARCELLDEBUG
273 std::cout <<
"Update : CURRENT lumi_block, BCID = " << lumi_block <<
", " <<
BCID <<
" <--> PREVIOUS lumi_block = " <<
m_lumi_block <<
", " <<
m_bcid << std::endl;
282 std::map<HWIdentifier,int>::const_iterator
end =
m_indexset.end ();
284 std::map<HWIdentifier,int>::const_iterator
beg =
m_indexset.begin();
287 int idx = (*beg).second;
290 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
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
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
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
The Athena Transient Store API.
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.
value_type get_compact(void) const
Get the compact id.
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.
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
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
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
id_iterator channel_begin() const
Returns an iterator pointing to a channel identifier collection.
StatusCode finalize(void)
finalize method.