86{
87
89
90 const EventContext& ctx = Gaudi::Hive::currentContext();
91 SG::ReadCondHandle<LArMCSym> mcsym (
m_mcSymKey, ctx);
92
93
94 const LArOnlineID* onlineHelper = nullptr;
96
97 const CaloCell_ID* idHelper = nullptr;
100
101 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{
m_cablingKey, ctx};
102 const LArOnOffIdMapping*
cabling{*cablingHdl};
103 if(!cabling) {
105 return StatusCode::FAILURE;
106 }
107
110 outfit->Add(
s.c_str());
111 }
112
113
117
118 Float_t covr[100];
120
121 outfit->SetBranchAddress("channelId", &channelId);
122 outfit->SetBranchAddress("FT", &FT);
123 outfit->SetBranchAddress("slot", &slot);
124 outfit->SetBranchAddress("channel", &channel);
125 outfit->SetBranchAddress("detector", &det);
126 outfit->SetBranchAddress("gain", &gain);
127 outfit->SetBranchAddress("covr", covr);
128
129
130 std::unique_ptr<LArAutoCorrComplete> larAutoCorrComplete;
131 std::unique_ptr<LArAutoCorrMC> larAutoCorrMC;
132
134 larAutoCorrComplete = std::make_unique<LArAutoCorrComplete>();
136 ATH_CHECK( larAutoCorrComplete->initialize() );
137 } else {
138 larAutoCorrMC = std::make_unique<LArAutoCorrMC>();
140 ATH_CHECK( larAutoCorrMC->initialize() );
141 }
142
143 typedef std::vector<float> AutoCorrVec;
144 std::map<std::pair<unsigned int,int>, AutoCorrVec>
AutoCorr;
145 unsigned int hwid;
149
150
151 Long64_t
nentries = outfit->GetEntries();
152 for ( Long64_t iev = 0; iev <
nentries; ++iev )
153 {
154 outfit->GetEvent(iev);
155 ATH_MSG_DEBUG (
" Chan " << std::hex << channelId <<
" det. "<< det << std::dec );
156
158 HWIdentifier
id(hwid);
159
160 if(FT != onlineHelper->
feedthrough(
id) || slot != onlineHelper->
slot(
id) || channel != onlineHelper->
channel(
id)) {
165 continue;
166 }
167
169 if (id != mcsym->ZPhiSymOnl(id) ) {
171 continue;
172 }
173 }
174
175 AutoCorrVec av(nsamples);
178 }
179
181
183
184 }
185
187
188
189 std::map<std::pair<unsigned int,int>, AutoCorrVec>::iterator ibeg =
AutoCorr.begin();
190 std::map<std::pair<unsigned int,int>, AutoCorrVec>::iterator iend =
AutoCorr.end();
191 unsigned int count=0;
192 for(;ibeg != iend; ++ibeg) {
193 ATH_MSG_DEBUG (
" Chan " << std::hex << (ibeg->first).first << std::dec );
195 HWIdentifier
id((ibeg->first).first);
196
197
200 continue;
201 }
202 }
203
206 larAutoCorrMC->set(HWIdentifier((ibeg->first).first),(ibeg->first).second, ibeg->second);
207 } else {
208 larAutoCorrComplete->set(HWIdentifier((ibeg->first).first),(ibeg->first).second, ibeg->second);
209 }
211 }
212
214
218 if(limit > 31)
limit = 31;
219 AutoCorrVec myvec(limit);
221 for (
const HWIdentifier chid: onlineHelper->
channel_range()) {
223 if (chid != mcsym->ZPhiSymOnl(chid) ) {
225 continue;
226 }
227 }
228
231 const int mod=fcal_id->module(
cabling->cnvToIdentifier(chid));
232 if(mod<0 || mod > 3) {
233 ATH_MSG_ERROR (
"Wrong FCAL module: " << mod <<
" ignored !!" );
234 continue;
235 }
236 for(int mygain=0; mygain<3; ++mygain) {
239 larAutoCorrComplete->set(chid,mygain,myvec);
240 } else {
241 larAutoCorrMC->set(chid,mygain,myvec);
242 }
243 }
246 }
247 }
249
250 }
251
254 } else {
255 ATH_MSG_INFO (
"Stored container " << larAutoCorrMC->nGains() <<
"gains, " << larAutoCorrMC->totalNumberOfConditions() <<
" conditions, key: " <<
m_store_key );
257 }
258
259 return StatusCode::SUCCESS;
260}
const float sFcalcovr[31][3]
const ServiceHandle< StoreGateSvc > & detStore() const
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
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...
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
id_range channel_range() const
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
retrieve(aClass, aKey=None)