39{
41
42
43
44 const LArOFCComplete* cellOFC = nullptr;
46
47
48 const LArOnlineID* onlID = nullptr;
50
51
52 const LArShapeComplete* cellShape = nullptr;
55 }
56
57 std::unique_ptr<LArOFCComplete> ofc_cont(new LArOFCComplete());
60
61
62 std::unique_ptr<LArShapeComplete> shape_cont;
64 shape_cont = std::unique_ptr<LArShapeComplete>(new LArShapeComplete());
67 }
68
75 const HWIdentifier
id =
it.channelId() ;
76 const int nPhases=
ofc.OFC_aSize();
77 const float timeOffset=
ofc.timeOffset();
78 const float timeBinWidth=
ofc.timeBinWidth();
79 if (nPhases==0) {
81 continue;
82 }
84
85 std::vector<std::vector<float> > OFC_a;
86 std::vector<std::vector<float> > OFC_b;
90
91 if ( vOFC_a.size() == 0 || vOFC_b.size() == 0 ) {
93 }else if ( vOFC_a.size() != vOFC_b.size() ) {
94 ATH_MSG_WARNING(
"OFC a (" << vOFC_a.size() <<
") and b (" << vOFC_b.size() <<
") are not the same size for channel " << onlID->
channel_name(
id) );
96 } else {
98 std::vector<float> newOFCa=vOFC_a.
asVector();
99 std::vector<float> newOFCb=vOFC_b.
asVector();
102 newOFCa.insert(newOFCa.begin(),0.);
103 newOFCb.insert(newOFCb.begin(),0.);
104 }
105 } else {
106 newOFCa.resize(newOFCa.size()+
m_numAdd, 0.);
107 newOFCb.resize(newOFCb.size()+
m_numAdd, 0.);
108 }
109
110 OFC_a.push_back(std::move(newOFCa));
111 OFC_b.push_back(std::move(newOFCb));
112 } else {
116
117 }
118 }
119 }
120 if(
m_numAdd > 0) ofc_cont->set(
id,(
int)gain,OFC_a,OFC_b,timeOffset,timeBinWidth);
121 else if(!OFC_a.empty()) ofc_cont->set(
id,
CaloGain::LARLOWGAIN,OFC_a,OFC_b,timeOffset,timeBinWidth);
122 }
123
127 for(; its!=its_e;++its){
129 const HWIdentifier
id = its.
channelId() ;
133 if (nPhases==0) {
135 continue;
136 }
137
138 std::vector<std::vector<float> > Shape;
139 std::vector<std::vector<float> > ShapeDer;
143
144 if ( vShape.size() == 0 || vShapeDer.size() == 0 ) {
146 }else if ( vShape.size() != vShapeDer.size() ) {
147 ATH_MSG_WARNING(
"Shape (" << vShape.size() <<
") and ShapeDer (" << vShapeDer.size() <<
") are not the same size for channel " << onlID->
channel_name(
id) );
149 } else {
151 std::vector<float> newShape=vShape.
asVector();
152 std::vector<float> newShapeDer=vShapeDer.
asVector();
155 newShape.insert(newShape.begin(),0.);
156 newShapeDer.insert(newShapeDer.begin(),0.);
157 }
158 } else {
159 newShape.resize(newShape.size()+
m_numAdd, 0.);
160 newShapeDer.resize(newShapeDer.size()+
m_numAdd, 0.);
161 }
162
163 Shape.push_back(std::move(newShape));
164 ShapeDer.push_back(std::move(newShapeDer));
165 } else {
168 ShapeDer.push_back(vShapeDer.
asVector());
169 }
170 }
171 }
173 shape_cont->set(id,(int)gain,Shape,ShapeDer,timeOffset,timeBinWidth);
174 } else {
175 if(!Shape.empty()) shape_cont->set(
id,
CaloGain::LARLOWGAIN,Shape,ShapeDer,timeOffset,timeBinWidth);
176 }
177 }
178 }
179
180 }
181
183 LArOFCComplete *ofcptr = ofc_cont.get();
185 CHECK(
detStore()->symLink(ofcptr,
dynamic_cast<ILArOFC*
>(ofcptr)));
187 LArShapeComplete *shapeptr = shape_cont.get();
189 CHECK(
detStore()->symLink(shapeptr,
dynamic_cast<ILArShape*
>(shapeptr)));
190 }
191
192 return StatusCode::SUCCESS;
193}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
LArVectorProxy OFCRef_t
This class defines the interface for accessing Optimal Filtering coefficients for each channel provid...
LArVectorProxy ShapeRef_t
This class defines the interface for accessing Shape (Nsample variable, Dt = 25 ns fixed) @stereotype...
float timeBinWidth() const
Return the time bin width for this channel.
ILArShape::ShapeRef_t shapeDer(size_t tbin) const
ILArShape::ShapeRef_t shape(size_t tbin) const
float timeOffset() const
Return the time offset for this channel.
HWIdentifier channelId() const
ConditionsMap::const_iterator ConstConditionsMapIterator
Subset::ConstReference ConstReference
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
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
bool isEMBPS(const HWIdentifier id) const
bool isHECchannel(const HWIdentifier id) const override final
std::vector< value_type > asVector() const
Convert back to a vector.
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
retrieve(aClass, aKey=None)