32 m_ntpath=std::string(
"/NTUPLES/FILE1/OFCBINDIFF");
39 NTuple::Item<long> ntold, ntnew, ntcorr;
40 NTuple::Item<long> ntgain;
43 CHECK(
m_nt->addItem(
"OFCBinOld",ntold,-200,200));
44 CHECK(
m_nt->addItem(
"OFCBinNew",ntnew,-200,200));
45 CHECK(
m_nt->addItem(
"correction",ntcorr,0,200));
51 std::vector<std::map<HWIdentifier,float> > offsetMap;
52 if(
m_perFebMG) offsetMap.resize(2);
else offsetMap.resize(3);
55 rein.open(
m_fileName.c_str(),std::ifstream::in);
58 return StatusCode::FAILURE;
67 rein >> std::hex>>chidint >>std::dec>> offset;
69 offsetMap[1][fid]=offset;
76 rein >> std::hex>>chidint >>std::dec>> offset[0] >>offset[1] >>offset[2];
80 for(
unsigned i=0; i<3; ++i) offsetMap[i][fid]=offset[i];
96 if(
sc!=StatusCode::SUCCESS) {
104 return StatusCode::FAILURE;
112 for (
int gain=0;gain<3;++gain) {
116 for (;it!=it_e;++it) {
124 int bindiff=td.
m_bin;
127 newCont->
set(chid,gain,bindiff);
136 int barrel_ec = onlineID->
barrel_ec(chid);
138 if (cabling->isOnlineConnected(chid)) {
148 if(
m_perFebMG && (layer<0 || (barrel_ec ==0 && layer==3 )) ) {
150 newCont->
set(chid,gain,bindiff);
154 const float correction=offsetMap[gain][fid];
156 if(correction>0) mfac=1;
else mfac=-1;
157 const int imult = correction / 1.042;
158 if(fabs(correction - imult*1.042) < 0.5) ntcorr = imult;
else ntcorr=(imult + mfac);
160 std::cout<<std::hex<<fid.
get_identifier32()<<
" "<<std::dec<<ntcorr<<std::endl;
164 newCont->
set(chid,gain,bindiff);
172 if (
sc!=StatusCode::SUCCESS) {
174 return StatusCode::FAILURE;
181 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
bool is_lar_em(Identifier id) const
bool is_lar_fcal(Identifier id) const
bool is_lar_hec(Identifier id) const
Helper class for offline cell identifiers.
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
const LArEM_ID * em_idHelper() const
access to EM idHelper
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
const SG::ReadCondHandleKey< LArOnOffIdMapping > & cablingKey() const
const LArHEC_Base_ID * m_hecId
const LArFCAL_Base_ID * m_fcalId
bool fillFromIdentifier(const HWIdentifier &id)
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
void setGroupingType(GroupingType type)
allow group type to be set externally - need to (re)initialize after setting grouping type
ConditionsMap::const_iterator ConstConditionsMapIterator
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
This class factors out code common between LArEM_ID and LArEM_SuperCell_ID.
int sampling(const Identifier id) const
return sampling according to :
This class factors out code common between LArEM_ID and LArEM_SuperCell_ID.
std::string m_outputContainer
LArOFCBinAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::string m_inputContainer
void set(const HWIdentifier &chid, const int &gain, const int &bin)
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.