Skip to content
Snippets Groups Projects
Commit 29e3502f authored by Pavol Strizenec's avatar Pavol Strizenec Committed by Frank Winklmeier
Browse files

Add usage of current to LAr HV computation

parent 359a3dba
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ def LArHVScaleCfg(configFlags): ...@@ -23,6 +23,7 @@ def LArHVScaleCfg(configFlags):
result.merge(addFolders(configFlags,["/LAR/IdentifierOfl/HVLineToElectrodeMap"], "LAR_OFL", className="AthenaAttributeList")) result.merge(addFolders(configFlags,["/LAR/IdentifierOfl/HVLineToElectrodeMap"], "LAR_OFL", className="AthenaAttributeList"))
result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Pathologies"], "LAR_OFL", className="AthenaAttributeList")) result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Pathologies"], "LAR_OFL", className="AthenaAttributeList"))
result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Rvalues"], "LAR_OFL", className="AthenaAttributeList"))
from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
result.merge(LArBadChannelCfg(configFlags)) result.merge(LArBadChannelCfg(configFlags))
......
...@@ -8,6 +8,7 @@ if not conddb.isMC and not conddb.isOnline: ...@@ -8,6 +8,7 @@ if not conddb.isMC and not conddb.isOnline:
conddb.addFolder("DCS_OFL","/LAR/DCS/HV/BARREL/I8",className="CondAttrListCollection") conddb.addFolder("DCS_OFL","/LAR/DCS/HV/BARREL/I8",className="CondAttrListCollection")
conddb.addFolder("LAR_OFL","/LAR/IdentifierOfl/HVLineToElectrodeMap",className="AthenaAttributeList") conddb.addFolder("LAR_OFL","/LAR/IdentifierOfl/HVLineToElectrodeMap",className="AthenaAttributeList")
conddb.addFolder("LAR_OFL","/LAR/HVPathologiesOfl/Pathologies",className="AthenaAttributeList") conddb.addFolder("LAR_OFL","/LAR/HVPathologiesOfl/Pathologies",className="AthenaAttributeList")
conddb.addFolder("LAR_OFL","/LAR/HVPathologiesOfl/Rvalues",className="AthenaAttributeList")
from AthenaCommon.AlgSequence import AthSequencer from AthenaCommon.AlgSequence import AthSequencer
from Gaudi.Configuration import DEBUG from Gaudi.Configuration import DEBUG
......
...@@ -15,7 +15,7 @@ def LArHVDBCfg(configFlags): ...@@ -15,7 +15,7 @@ def LArHVDBCfg(configFlags):
if not isMC and not isOnline: if not isMC and not isOnline:
result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREl/I16","/LAR/DCS/HV/BARREL/I8"],detDb="DCS_OFL",className="CondAttrListCollection")) result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREl/I16","/LAR/DCS/HV/BARREL/I8"],detDb="DCS_OFL",className="CondAttrListCollection"))
result.merge(addFolders(configFlags,["/LAR/IdentifierOfl/HVLineToElectrodeMap","/LAR/HVPathologiesOfl/Pathologies"],detDb="LAR_OFL",className="AthenaAttributeList")) result.merge(addFolders(configFlags,["/LAR/IdentifierOfl/HVLineToElectrodeMap","/LAR/HVPathologiesOfl/Pathologies","/LAR/HVPathologiesOfl/Rvalues"],detDb="LAR_OFL",className="AthenaAttributeList"))
from LArRecUtils.LArRecUtilsConf import LArHVIdMappingAlg from LArRecUtils.LArRecUtilsConf import LArHVIdMappingAlg
result.addCondAlgo(LArHVIdMappingAlg(ReadKey="/LAR/IdentifierOfl/HVLineToElectrodeMap",WriteKey="LArHVIdMap")) result.addCondAlgo(LArHVIdMappingAlg(ReadKey="/LAR/IdentifierOfl/HVLineToElectrodeMap",WriteKey="LArHVIdMap"))
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "AthenaPoolUtilities/CondAttrListCollection.h" #include "AthenaPoolUtilities/CondAttrListCollection.h"
#include "CoralBase/Blob.h"
//#include <iostream> //#include <iostream>
#include <cmath> #include <cmath>
#include <cstdlib> #include <cstdlib>
...@@ -64,6 +66,7 @@ LArHVCondAlg::LArHVCondAlg( const std::string& name, ISvcLocator* pSvcLocator ) ...@@ -64,6 +66,7 @@ LArHVCondAlg::LArHVCondAlg( const std::string& name, ISvcLocator* pSvcLocator )
m_condSvc("CondSvc",name) m_condSvc("CondSvc",name)
{ {
declareProperty("doHV",m_doHV=true,"create HV data"); declareProperty("doHV",m_doHV=true,"create HV data");
declareProperty("doR",m_doR=true,"Use R values with current to improve HV");
declareProperty("doAffected",m_doAffected=true,"create affected region info"); declareProperty("doAffected",m_doAffected=true,"create affected region info");
declareProperty("doAffectedHV",m_doAffectedHV=true,"include HV non nominal regions info"); declareProperty("doAffectedHV",m_doAffectedHV=true,"include HV non nominal regions info");
...@@ -94,6 +97,7 @@ StatusCode LArHVCondAlg::initialize(){ ...@@ -94,6 +97,7 @@ StatusCode LArHVCondAlg::initialize(){
ATH_CHECK( m_cablingKey.initialize()); ATH_CHECK( m_cablingKey.initialize());
ATH_CHECK( m_BFKey.initialize() ); ATH_CHECK( m_BFKey.initialize() );
ATH_CHECK(m_hvMappingKey.initialize (m_doHV || m_doAffectedHV)); ATH_CHECK(m_hvMappingKey.initialize (m_doHV || m_doAffectedHV));
ATH_CHECK( m_hvRKey.initialize(m_doR && (m_doHV || m_doAffectedHV)));
// Write Handle // Write Handle
...@@ -149,6 +153,7 @@ StatusCode LArHVCondAlg::execute(const EventContext& ctx) const { ...@@ -149,6 +153,7 @@ StatusCode LArHVCondAlg::execute(const EventContext& ctx) const {
std::vector<const CondAttrListCollection*> attrvec; std::vector<const CondAttrListCollection*> attrvec;
const LArHVIdMapping* hvCabling{nullptr}; const LArHVIdMapping* hvCabling{nullptr};
const float* rValues{nullptr};
if(doHVData || (doAffected && m_doAffectedHV) ) { if(doHVData || (doAffected && m_doAffectedHV) ) {
SG::ReadCondHandle<LArHVIdMapping> mappingHdl{m_hvMappingKey, ctx}; SG::ReadCondHandle<LArHVIdMapping> mappingHdl{m_hvMappingKey, ctx};
...@@ -175,6 +180,21 @@ StatusCode LArHVCondAlg::execute(const EventContext& ctx) const { ...@@ -175,6 +180,21 @@ StatusCode LArHVCondAlg::execute(const EventContext& ctx) const {
ATH_MSG_WARNING("Why do not have DCS folder " << fldkey.fullKey()); ATH_MSG_WARNING("Why do not have DCS folder " << fldkey.fullKey());
} }
} // over DCS folders } // over DCS folders
if(m_doR) {
SG::ReadCondHandle<AthenaAttributeList> readAttrHandle{m_hvRKey, ctx};
const AthenaAttributeList* attr = *readAttrHandle;
if(!attr) {
ATH_MSG_ERROR("Unable to access R values Cond Object");
return StatusCode::FAILURE;
}
// store the conditions blob
const coral::Blob& rBlob = (*attr)["ElectrodeRvalues"].data<coral::Blob>();
if(rBlob.size()/sizeof(float) != m_electrodeID->electrodeHashMax()) {
ATH_MSG_ERROR("Expected " << m_electrodeID->electrodeHashMax() << " R values, but got " << rBlob.size()/sizeof(float) << " aborting");
return StatusCode::FAILURE;
}
rValues = static_cast<const float*>(rBlob.startingAddress());
}
} }
const LArHVManager *manager = NULL; const LArHVManager *manager = NULL;
...@@ -271,7 +291,7 @@ StatusCode LArHVCondAlg::execute(const EventContext& ctx) const { ...@@ -271,7 +291,7 @@ StatusCode LArHVCondAlg::execute(const EventContext& ctx) const {
std::unique_ptr<LArHVData> hvdata = std::make_unique<LArHVData>(); std::unique_ptr<LArHVData> hvdata = std::make_unique<LArHVData>();
ATH_CHECK(fillPayload(hvdata.get(), hvdataOld, hvCabling, voltage, current, hvlineidx, pathologyContainer, hasPathologyEM, hasPathologyHEC, hasPathologyFCAL)); ATH_CHECK(fillPayload(hvdata.get(), hvdataOld, hvCabling, voltage, current, hvlineidx, pathologyContainer, hasPathologyEM, hasPathologyHEC, hasPathologyFCAL, rValues));
ATH_CHECK(writeHandle.record(std::move(hvdata))); ATH_CHECK(writeHandle.record(std::move(hvdata)));
...@@ -337,7 +357,8 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata ...@@ -337,7 +357,8 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
, const LArHVPathology& pathologies , const LArHVPathology& pathologies
, pathVec& hasPathologyEM , pathVec& hasPathologyEM
, pathVec& hasPathologyHEC , pathVec& hasPathologyHEC
, pathVec& hasPathologyFCAL) const , pathVec& hasPathologyFCAL
, const float* rValues) const
{ {
LArHVData::hvMap &hvmap = hvdata->m_voltage; LArHVData::hvMap &hvmap = hvdata->m_voltage;
LArHVData::currMap &currmap = hvdata->m_current; LArHVData::currMap &currmap = hvdata->m_current;
...@@ -372,7 +393,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata ...@@ -372,7 +393,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
if (!embElement) std::abort(); if (!embElement) std::abort();
const EMBCellConstLink cell = embElement->getEMBCell(); const EMBCellConstLink cell = embElement->getEMBCell();
unsigned int nelec = cell->getNumElectrodes(); unsigned int nelec = cell->getNumElectrodes();
//std::cout << " nelec " << nelec << std::endl; //std::cout << " nelec: " << nelec << std::endl;
unsigned int ngap = 2*nelec; unsigned int ngap = 2*nelec;
double wt = 1./ngap; double wt = 1./ngap;
v.clear(); ihv.clear(); v.clear(); ihv.clear();
...@@ -396,6 +417,17 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata ...@@ -396,6 +417,17 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
unsigned idx = itrLine - hvlineidx.begin(); unsigned idx = itrLine - hvlineidx.begin();
double hv=voltage[idx]; double hv=voltage[idx];
double curr=current[idx]; double curr=current[idx];
if(rValues) { // modify the current record
const EMBHVModule &hvmod = electrode.getModule();
unsigned ridx = m_electrodeID->electrodeHash(m_electrodeID->ElectrodeId(0,
hvmod.getSideIndex(),
hvCabling->getCellModule(id),
hvmod.getPhiIndex(),
hvmod.getEtaIndex(),
igap,
electrode.getElectrodeIndex() ));
curr *= rValues[ridx];
}
if (hasPathology) { if (hasPathology) {
ATH_MSG_VERBOSE( "Has pathology for id: "<< m_larem_id->print_to_string(id)<<" "<<hasPathologyEM[index]); ATH_MSG_VERBOSE( "Has pathology for id: "<< m_larem_id->print_to_string(id)<<" "<<hasPathologyEM[index]);
msg(MSG::VERBOSE) << "Original hv: "<<hv<<" "; msg(MSG::VERBOSE) << "Original hv: "<<hv<<" ";
...@@ -439,6 +471,17 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata ...@@ -439,6 +471,17 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
unsigned idx = itrLine - hvlineidx.begin(); unsigned idx = itrLine - hvlineidx.begin();
double hv=voltage[idx]; double hv=voltage[idx];
double curr=current[idx]; double curr=current[idx];
if(rValues) { // modify the current record
unsigned ridx = m_electrodeID->electrodeHash(m_electrodeID->ElectrodeId(1,
hvmodule.getSideIndex(),
hvCabling->getCellModule(id),
0, // not used in EMBPS
hvmodule.getEtaIndex(),
igap,
0 // not used in EMBPS
));
curr *= rValues[ridx];
}
addHV(v,hv,wt); addHV(v,hv,wt);
addCurr(ihv,curr,wt); addCurr(ihv,curr,wt);
} }
...@@ -481,6 +524,17 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata ...@@ -481,6 +524,17 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
unsigned idx = itrLine - hvlineidx.begin(); unsigned idx = itrLine - hvlineidx.begin();
double hv=voltage[idx]; double hv=voltage[idx];
double curr=current[idx]; double curr=current[idx];
if(rValues) { // modify the current record
const EMECHVModule &hvmod = electrode.getModule();
unsigned ridx = m_electrodeID->electrodeHash(m_electrodeID->ElectrodeId(2,
hvmod.getSideIndex(),
hvCabling->getCellModule(id),
hvmod.getPhiIndex(),
hvmod.getEtaIndex(),
hvmod.getSectorIndex(),
electrode.getElectrodeIndex() ));
curr *= rValues[ridx];
}
if (hasPathology) { if (hasPathology) {
msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larem_id->print_to_string(id)<<" "<<hasPathologyEM[index]<<endmsg; msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larem_id->print_to_string(id)<<" "<<hasPathologyEM[index]<<endmsg;
for (unsigned int ii=0;ii<listElec.size();ii++) { for (unsigned int ii=0;ii<listElec.size();ii++) {
...@@ -521,6 +575,17 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata ...@@ -521,6 +575,17 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
unsigned idx = itrLine - hvlineidx.begin(); unsigned idx = itrLine - hvlineidx.begin();
double hv=voltage[idx]; double hv=voltage[idx];
double curr=current[idx]; double curr=current[idx];
if(rValues) { // modify the current record
unsigned ridx = m_electrodeID->electrodeHash(m_electrodeID->ElectrodeId(3,
hvmodule.getSideIndex(),
hvCabling->getCellModule(id),
0, // not used in EMECPS
0,
igap,
0 // not used in EMECPS
));
curr *= rValues[ridx];
}
addHV(v,hv,wt); addHV(v,hv,wt);
addCurr(ihv,curr,wt); addCurr(ihv,curr,wt);
} }
...@@ -589,6 +654,18 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata ...@@ -589,6 +654,18 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
unsigned idx = itrLine - hvlineidx.begin(); unsigned idx = itrLine - hvlineidx.begin();
double hv=voltage[idx]; double hv=voltage[idx];
double curr=current[idx]; double curr=current[idx];
if(rValues) { // modify the current record
const HECHVModule &hvmod = subgap.getModule();
unsigned ridx = m_electrodeID->electrodeHash(m_electrodeID->ElectrodeId(4,
hvmod.getSideIndex(),
hvCabling->getCellModule(id),
0, // not used in HEC
hvmod.getSamplingIndex(),
subgap.getSubgapIndex(),
0 // not used in HEC
));
curr *= rValues[ridx];
}
//std::cout << " hv value " << hv << std::endl; //std::cout << " hv value " << hv << std::endl;
if (hasPathology) { if (hasPathology) {
msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larhec_id->print_to_string(id)<<" "<<hasPathologyHEC[index]<<endmsg; msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larhec_id->print_to_string(id)<<" "<<hasPathologyHEC[index]<<endmsg;
...@@ -627,7 +704,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata ...@@ -627,7 +704,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
updatedCells.emplace(id); updatedCells.emplace(id);
} }
} }
} // loop over HEC } // loop over FCAL
for(auto id: m_larfcal_id->channel_ids()) { // LAr FCAL for(auto id: m_larfcal_id->channel_ids()) { // LAr FCAL
v.clear(); v.clear();
ihv.clear(); ihv.clear();
...@@ -671,6 +748,18 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata ...@@ -671,6 +748,18 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
unsigned idx = itrLine - hvlineidx.begin(); unsigned idx = itrLine - hvlineidx.begin();
double hv=voltage[idx]; double hv=voltage[idx];
double curr=current[idx]; double curr=current[idx];
if(rValues) { // modify the current record
const FCALHVModule& hvmod = line->getModule();
unsigned ridx = m_electrodeID->electrodeHash(m_electrodeID->ElectrodeId(5,
hvmod.getSideIndex(),
hvCabling->getCellModule(id),
0, // not used in FCAL
hvmod.getSamplingIndex(),
hvmod.getSectorIndex(),
line->getLineIndex()
));
curr *= rValues[ridx];
}
//std::cout << " line " << line; //std::cout << " line " << line;
if (hasPathology) { if (hasPathology) {
msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larfcal_id->print_to_string(id)<<" "<<hasPathologyFCAL[index]<<endmsg; msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larfcal_id->print_to_string(id)<<" "<<hasPathologyFCAL[index]<<endmsg;
......
/* /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
/** /**
...@@ -70,6 +70,8 @@ class LArHVCondAlg: public AthReentrantAlgorithm ...@@ -70,6 +70,8 @@ class LArHVCondAlg: public AthReentrantAlgorithm
SG::ReadCondHandleKey<LArHVIdMapping> m_hvMappingKey {this, "HVMappingKey", "LArHVIdMap", "Key for mapping object" }; SG::ReadCondHandleKey<LArHVIdMapping> m_hvMappingKey {this, "HVMappingKey", "LArHVIdMap", "Key for mapping object" };
SG::ReadCondHandleKey<AthenaAttributeList> m_hvRKey{this, "RvaluesKey", "/LAR/HVPathologiesOfl/Rvalues", "Cool folder with HV R values"};
// Conditions keys write: // Conditions keys write:
SG::WriteCondHandleKey<LArHVData> m_hvDataKey {this, "OutputHVData", "LArHVData", "Key for output HV data object"}; SG::WriteCondHandleKey<LArHVData> m_hvDataKey {this, "OutputHVData", "LArHVData", "Key for output HV data object"};
...@@ -86,6 +88,7 @@ class LArHVCondAlg: public AthReentrantAlgorithm ...@@ -86,6 +88,7 @@ class LArHVCondAlg: public AthReentrantAlgorithm
ServiceHandle<ICondSvc> m_condSvc; ServiceHandle<ICondSvc> m_condSvc;
bool m_doHV; bool m_doHV;
bool m_doR;
bool m_doAffected; bool m_doAffected;
bool m_doAffectedHV; bool m_doAffectedHV;
...@@ -104,7 +107,8 @@ class LArHVCondAlg: public AthReentrantAlgorithm ...@@ -104,7 +107,8 @@ class LArHVCondAlg: public AthReentrantAlgorithm
, const LArHVPathology& pathologies , const LArHVPathology& pathologies
, pathVec& hasPathologyEM , pathVec& hasPathologyEM
, pathVec& hasPathologyHEC , pathVec& hasPathologyHEC
, pathVec& hasPathologyFCAL) const; , pathVec& hasPathologyFCAL
, const float* rValues) const;
void addHV(std::vector< LArHVData::HV_t > & v, double hv, double wt) const; void addHV(std::vector< LArHVData::HV_t > & v, double hv, double wt) const;
void addCurr(std::vector< LArHVData::CURRENT_t > & ihv, double curr, double wt) const; void addCurr(std::vector< LArHVData::CURRENT_t > & ihv, double curr, double wt) const;
......
...@@ -35,7 +35,9 @@ LArHVScaleCorrCondAlg::LArHVScaleCorrCondAlg(const std::string& name, ISvcLocato ...@@ -35,7 +35,9 @@ LArHVScaleCorrCondAlg::LArHVScaleCorrCondAlg(const std::string& name, ISvcLocato
declareProperty("fixHVCorr", m_fixHVStrings); declareProperty("fixHVCorr", m_fixHVStrings);
declareProperty("UndoOnlineHVCorr",m_undoOnlineHVCorr=true,"Undo the HVCorr done online"); declareProperty("UndoOnlineHVCorr",m_undoOnlineHVCorr=true,"Undo the HVCorr done online");
declareProperty("UseCurrentsInHVEMB", m_useCurrentEMB=false, "Use currents in EMB as well");
declareProperty("UseCurrentsInHVFCAL1", m_useCurrentFCAL1=false, "Use currents in FCAL1 as well");
declareProperty("UseCurrentsInHVOthers", m_useCurrentOthers=false, "Use currents in other partitions as well");
} }
...@@ -331,30 +333,45 @@ StatusCode LArHVScaleCorrCondAlg::getScale(const HASHRANGEVEC& hashranges, ...@@ -331,30 +333,45 @@ StatusCode LArHVScaleCorrCondAlg::getScale(const HASHRANGEVEC& hashranges,
if (notfound) { if (notfound) {
ATH_MSG_WARNING( " At least one HV value not found in database for cell " << m_larem_id->show_to_string(offid) ); ATH_MSG_WARNING( " At least one HV value not found in database for cell " << m_larem_id->show_to_string(offid) );
} }
std::vector<LArHVData::CURRENT_t> currlist;
if(m_useCurrentEMB || m_useCurrentFCAL1 || m_useCurrentOthers) {
sc = hvdata->getCurrent(offid,currlist);
if (sc.isFailure() || currlist.size() != hvlist.size()) {
ATH_MSG_WARNING( " Current values not the same size as hv for cell " << m_larem_id->show_to_string(offid) << " resetting to 0" );
currlist.resize(hvlist.size(),LArHVData::CURRENT_t{0,0});
}
}
mycorr=0.; mycorr=0.;
mynorm=0.; mynorm=0.;
for (unsigned int i=0;i<hvlist.size();i++) { for (unsigned int i=0;i<hvlist.size();i++) {
double E = champ_e(hvlist[i].hv,d);
// dont correct if E is very close to E nominal to avoid small glitches
if (std::fabs(E_nominal)>1e-3) {
const double deviation = std::fabs((E-E_nominal)/E_nominal);
if (deviation<1e-3) E = E_nominal;
}
// barrel accordion // barrel accordion
if (isbarrelEM) { if (isbarrelEM) {
const double corr = this->Scale_barrel(hvlist[i].hv)*hvlist[i].weight; //const double corr = this->Scale_barrel(hvlist[i].hv)*hvlist[i].weight;
mycorr += corr; //mycorr += corr;
if(m_useCurrentEMB) mycorr += this->Scale_barrel(hvlist[i].hv-currlist[i].current)*hvlist[i].weight;
else mycorr += this->Scale_barrel(hvlist[i].hv)*hvlist[i].weight;
} }
//FCAL module 1 //FCAL module 1
else if (isFCAL1) { else if (isFCAL1) {
const double corr = this->Scale_FCAL1(hvlist[i].hv) * hvlist[i].weight; //const double corr = this->Scale_FCAL1(hvlist[i].hv) * hvlist[i].weight;
mycorr+=corr; //mycorr+=corr;
if(m_useCurrentFCAL1) mycorr += this->Scale_FCAL1(hvlist[i].hv-currlist[i].current) * hvlist[i].weight;
else mycorr += this->Scale_FCAL1(hvlist[i].hv) * hvlist[i].weight;
} }
// other subdetectors // other subdetectors
else { else {
double E;
if(m_useCurrentOthers) E = champ_e(hvlist[i].hv-currlist[i].current,d);
else E = champ_e(hvlist[i].hv,d);
// dont correct if E is very close to E nominal to avoid small glitches
if (std::fabs(E_nominal)>1e-3) {
const double deviation = std::fabs((E-E_nominal)/E_nominal);
if (deviation<1e-3) E = E_nominal;
}
const double corr = Respo(E,E_nominal,T)*hvlist[i].weight; const double corr = Respo(E,E_nominal,T)*hvlist[i].weight;
mycorr+= corr; mycorr+= corr;
} }
......
...@@ -92,6 +92,9 @@ class LArHVScaleCorrCondAlg: public AthAlgorithm ...@@ -92,6 +92,9 @@ class LArHVScaleCorrCondAlg: public AthAlgorithm
bool m_undoOnlineHVCorr; bool m_undoOnlineHVCorr;
bool m_useCurrentEMB;
bool m_useCurrentFCAL1;
bool m_useCurrentOthers;
struct HVfix_t { struct HVfix_t {
unsigned int subdet; // 0-1-2-3 for EMB-EMEC-HEC-FCAL unsigned int subdet; // 0-1-2-3 for EMB-EMEC-HEC-FCAL
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment