|
ATLAS Offline Software
|
Go to the documentation of this file.
28 #include "GaudiKernel/ThreadLocalContext.h"
35 , m_writeCondObjs(false)
36 , m_inpFile(
"LArHVPathology.inp")
39 , m_outpTag(
"HVPathologies-TEST")
40 , m_regSvc(
"IOVRegistrationSvc",
name)
41 , m_pathologyTool(
"LArHVPathologyDbTool")
49 declareProperty(
"Mode",
m_mode,
"Mode to read file (0=offlineID/elecID, 1=online ID fields + HV module/line, 2=type is HV value to overwrite)");
61 return StatusCode::FAILURE;
83 return StatusCode::SUCCESS;
90 const EventContext& ctx = Gaudi::Hive::currentContext();
92 int nevt = ctx.eventID().event_number();
105 return StatusCode::FAILURE;
111 if(!
sc.isSuccess()) {
126 if(!
sc.isSuccess()) {
143 ATH_MSG_INFO(
"EMB Pathologies already in SG, skipping ");
152 return StatusCode::FAILURE;
160 return StatusCode::FAILURE;
164 char commentSign(
'#');
167 unsigned short electInd, pathologyType;
178 <<
" in the input file");
179 return StatusCode::FAILURE;
190 checkChar =
static_cast<char> (
infile.get());
194 if((checkChar >=
'0') && (checkChar <=
'9')) {
197 std::vector<unsigned int> elecList;
200 infile >> cellID >> electInd >> pathologyType;
201 elecList.push_back(electInd);
203 unsigned int bec,pos_neg,
FT,slot,
channel,hvModule,hvLine;
204 infile >>
bec >> pos_neg >>
FT >> slot >>
channel >> hvModule >> hvLine >> pathologyType;
205 ATH_MSG_INFO(
" read " <<
bec <<
" " << pos_neg <<
" " <<
FT <<
" " << slot <<
" " <<
channel <<
" " << hvModule <<
" " << hvLine <<
" " << pathologyType);
208 cellID = (
unsigned int)(
id.get_identifier32().get_compact());
209 elecList=
getElectInd(**hvIdMapping,
id,hvModule,hvLine,calodetdescrmgr);
210 ATH_MSG_INFO(
" cellId , elecList size " << cellID <<
" " << elecList.size());
212 for (
unsigned int i=0;
i<elecList.size();
i++) {
214 electPath.
cellID = cellID;
215 electPath.electInd = elecList[
i];
216 if(
m_mode==2) electPath.pathologyType = ((pathologyType&0x0FFF)<<4);
217 else electPath.pathologyType = pathologyType;
218 pathologies.
m_v.push_back(electPath);
220 <<
"," << elecList[
i]
221 <<
"," << pathologyType <<
")");
224 else if(checkChar==commentSign) {
226 std::getline(
infile,commentLine);
241 if(!
sc.isSuccess()) {
249 return StatusCode::SUCCESS;
261 return StatusCode::FAILURE;
264 std::ofstream *
fout=
nullptr;
281 for(
unsigned i=0;
i<pathologyContainer->
m_v.size(); ++
i) {
295 int hvmodule=HVLine/1000;
308 delete pathologyContainer;
318 std::string objname(
"AthenaAttributeList");
329 std::vector<unsigned int>
337 std::vector<unsigned int>
list;
346 unsigned int nelec =
cell->getNumElectrodes();
347 for (
unsigned int i=0;
i<nelec;
i++) {
349 for (
unsigned int igap=0;igap<2;igap++) {
350 if (electrode.
hvLineNo(igap, &hvIdMapping)==HVline) {
351 list.push_back(2*
i+igap);
361 unsigned int nelec =
cell->getNumElectrodes();
362 for (
unsigned int i=0;
i<nelec;
i++) {
364 for (
unsigned int igap=0;igap<2;igap++) {
365 if (electrode.
hvLineNo(igap, &hvIdMapping)==HVline) {
366 list.push_back(2*
i+igap);
377 for (
unsigned int igap=0;igap<2;igap++) {
378 if (hvmodule.
hvLineNo(igap, &hvIdMapping)==HVline) {
379 list.push_back(igap);
389 for (
unsigned int igap=0;igap<2;igap++) {
390 if (hvmodule.
hvLineNo(igap, &hvIdMapping)==HVline) {
391 list.push_back(igap);
401 unsigned int nsubgaps =
cell->getNumSubgaps();
402 for (
unsigned int i=0;
i<nsubgaps;
i++) {
404 if (subgap.
hvLineNo(&hvIdMapping)==HVline) {
415 for (
unsigned int i=0;
i<nlines;
i++) {
418 if (
line2->hvLineNo(&hvIdMapping)==HVline) {
432 short unsigned int ElectInd,
436 unsigned int igap, ielec;
443 unsigned int nelec =
cell->getNumElectrodes();
445 ielec = std::div(ElectInd - igap, 2).quot;
447 ATH_MSG_ERROR(
"Wrong electrode number " << ielec <<
" for cell "<<
id.get_identifier32().get_compact());
450 return cell->getElectrode(ielec).hvLineNo(igap, &hvIdMapping);
458 unsigned int nelec =
cell->getNumElectrodes();
460 ielec = std::div(ElectInd - igap, 2).quot;
462 ATH_MSG_ERROR(
"Wrong electrode number " << ielec <<
" for cell "<<
id.get_identifier32().get_compact());
465 return cell->getElectrode(ielec).hvLineNo(igap, &hvIdMapping);
475 ATH_MSG_ERROR(
"Wrong igap "<<ElectInd<<
" for EMBPS cell "<<
id.get_identifier32().get_compact());
478 return hvmodule.
hvLineNo(ElectInd, &hvIdMapping);
488 ATH_MSG_ERROR(
"Wrong igap "<<ElectInd<<
" for EMECPS cell "<<
id.get_identifier32().get_compact());
491 return hvmodule.
hvLineNo(ElectInd, &hvIdMapping);
500 unsigned int nsubgaps =
cell->getNumSubgaps();
501 if( ElectInd >= nsubgaps) {
502 ATH_MSG_ERROR(
"Wrong igap "<<ElectInd<<
" for HEC cell "<<
id.get_identifier32().get_compact());
505 return cell->getSubgap(ElectInd).hvLineNo(&hvIdMapping);
514 if( ElectInd >= nlines) {
515 ATH_MSG_ERROR(
"Wrong line "<<ElectInd<<
" for FCAL cell "<<
id.get_identifier32().get_compact());
520 return line2->hvLineNo(&hvIdMapping);
522 ATH_MSG_ERROR(
"Do not have HVLine for "<<ElectInd<<
" for FCAL cell "<<
id.get_identifier32().get_compact());
def retrieve(aClass, aKey=None)
const LArFCAL_ID * m_larfcal_id
StatusCode registerCondObjects()
const LArEM_ID * m_larem_id
GeoIntrusivePtr< const HECCell > HECCellConstLink
@Class: HECCellConstLink
LAr EMEC Detector Element.
Smart Pointer to EMEC Cells. This reference counted link allocates on demand. It audits the total poi...
bool is_lar_fcal(Identifier id) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
const LArEM_ID * getEM_ID(void) const
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
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...
This is an interface to a tool used to register conditions objects in the Interval of Validity (IOV) ...
int sampling(const Identifier id) const
return sampling according to :
SG::ReadCondHandleKey< LArHVIdMapping > m_hvCablingKey
const LArOnlineID * m_laronline_id
const std::string & key() const
Return the StoreGate ID for the referenced object.
LAr EMB Detector Element.
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
GeoIntrusivePtr< const EMBCell > EMBCellConstLink
ToolHandle< ILArHVPathologyDbTool > m_pathologyTool
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
LAr HEC Detector Element.
BooleanProperty m_writeCondObjs
A tile of the forward calorimeter readout geometry.
ServiceHandle< IIOVRegistrationSvc > m_regSvc
StatusCode printCondObjects(const EventContext &ctx, const CaloDetDescrManager *calodetdescrmgr)
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
const LArHEC_ID * getHEC_ID(void) const
::StatusCode StatusCode
StatusCode definition for legacy code.
LAr FCAL Detector Element.
const LArFCAL_ID * getFCAL_ID(void) const
int hvLineNo(const LArHVIdMapping *hvIdMapping) const
StatusCode createCondObjects(const EventContext &ctx, const CaloDetDescrManager *calodetdescrmgr)
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
bool is_lar_hec(Identifier id) const
static unsigned int getNumHVLines()
Get num hvlines.
unsigned short pathologyType
std::vector< unsigned int > getElectInd(const LArHVIdMapping &hvIdMapping, const Identifier &id, unsigned int module, unsigned int line, const CaloDetDescrManager *calodetdescrmgr)
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
std::vector< LArHVElectPathologyDb > m_v
int barrel_ec(const Identifier id) const
return barrel_ec according to :
StatusCode initialize(bool used=true)
virtual StatusCode stop() override
virtual StatusCode initialize() override
const LArHEC_ID * m_larhec_id
LArHVPathologyDbAlg(const std::string &name, ISvcLocator *pSvcLocator)
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
This class provides the client interface for accessing the detector description information common to...
int getHVline(const LArHVIdMapping &hvIdMapping, const Identifier &id, short unsigned int ElectInd, const CaloDetDescrManager *calodetdescrmgr)
virtual StatusCode execute() override
#define ATH_MSG_WARNING(x)
Describes one HV Module within the EMEc Presampler.
const CaloIdManager * m_caloIdMgr
bool is_lar_em(Identifier id) const
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
Describes one HV Module within the EMB Presampler.
Calo Subsystem specific Detector Elements + Dummy element for testing.