58 std::vector<EcalTrigPrimDigiCollection> ecalColl(
preSamples + 1 +
60 std::vector<HcalTrigPrimDigiCollection> hcalColl(
preSamples + 1 +
69 ecal_it != ecal->
end(); ecal_it++) {
70 short zside = ecal_it->id().zside();
71 unsigned short ietaAbs = ecal_it->id().ietaAbs();
72 short iphi = ecal_it->id().iphi();
73 unsigned short digiSize = ecal_it->size();
74 unsigned short nSOI = (
unsigned short)(ecal_it->sampleOfInterest());
75 if (digiSize < nSamples || nSOI <
preSamples ||
76 ((
int)(digiSize - nSOI) < (
int)(nSamples -
preSamples))) {
77 unsigned short preLoopsZero = (
unsigned short)(
preSamples)-nSOI;
86 ecalColl[
sample].push_back(ecalDigi);
90 for (
int sample = preLoopsZero;
sample < (preLoopsZero + digiSize);
99 <<
"ECAL data needs at least one presample " 100 <<
"more than the number requested " 101 <<
"to use ecal cosmic timing mod! " 102 <<
"reverting to useEcalCosmicTiming = false " 103 <<
"for rest of job.";
118 ecalColl[
sample].push_back(ecalDigi);
122 for (
unsigned int sample = (preLoopsZero + digiSize);
129 ecalColl[
sample].push_back(ecalDigi);
134 short zside = ecal_it->id().zside();
135 unsigned short ietaAbs = ecal_it->id().ietaAbs();
136 short iphi = ecal_it->id().iphi();
144 <<
"ECAL data needs at least one presample " 145 <<
"more than the number requested " 146 <<
"to use ecal cosmic timing mod! " 147 <<
"reverting to useEcalCosmicTiming = false " 148 <<
"for rest of job.";
161 ecalDigi.setSample(0,
164 ->
sample(ecal_it->sampleOfInterest() +
169 ecalColl[
sample].push_back(ecalDigi);
179 hcal_it != hcal->
end(); hcal_it++) {
180 short ieta = hcal_it->id().ieta();
181 short iphi = hcal_it->id().iphi();
183 unsigned short digiSize = hcal_it->size();
185 unsigned short nSOI = (
unsigned short)(hcal_it->presamples());
186 if (digiSize < nSamples || nSOI <
preSamples ||
187 ((
int)(digiSize - nSOI) < (
int)(nSamples -
preSamples))) {
188 unsigned short preLoopsZero = (
unsigned short)(
preSamples)-nSOI;
195 hcalDigi.setPresamples(0);
197 hcalColl[
sample].push_back(hcalDigi);
201 for (
int sample = preLoopsZero;
sample < (preLoopsZero + digiSize);
207 hcalDigi.setPresamples(0);
212 <<
"HCAL data needs at least one presample " 213 <<
"more than the number requested " 214 <<
"to use hcal cosmic timing mod! " 215 <<
"reverting to useHcalCosmicTiming = false " 216 <<
"for rest of job.";
221 ->
sample(hcal_it->presamples() +
231 ->
sample(hcal_it->presamples() +
235 hcalColl[
sample].push_back(hcalDigi);
239 for (
unsigned int sample = (preLoopsZero + digiSize);
245 hcalDigi.setPresamples(0);
247 hcalColl[
sample].push_back(hcalDigi);
255 hcalDigi.setPresamples(0);
260 <<
"HCAL data needs at least one presample " 261 <<
"more than the number requested " 262 <<
"to use hcal cosmic timing mod! " 263 <<
"reverting to useHcalCosmicTiming = false " 264 <<
"for rest of job.";
269 ->
sample(hcal_it->presamples() +
276 if (ieta > -29 && ieta < 29)
283 if (ieta <= -29 || ieta >= 29)
291 hcalColl[
sample].push_back(hcalDigi);
300 char ecal_label[200];
301 char hcal_label[200];
303 sprintf(ecal_label,
"ECALBxminus%d", preSamples -
i);
304 sprintf(hcal_label,
"HCALBxminus%d", preSamples -
i);
306 std::unique_ptr<EcalTrigPrimDigiCollection> ecalIn(
308 std::unique_ptr<HcalTrigPrimDigiCollection> hcalIn(
310 for (
unsigned int j = 0; j < ecalColl[
i].size(); ++j) {
311 ecalIn->push_back((ecalColl[
i])[j]);
313 for (
unsigned int j = 0; j < hcalColl[
i].size(); ++j)
314 hcalIn->push_back((hcalColl[
i])[j]);
320 std::unique_ptr<EcalTrigPrimDigiCollection> ecal0(
322 std::unique_ptr<HcalTrigPrimDigiCollection> hcal0(
324 for (
unsigned int j = 0; j < ecalColl[
preSamples].size(); ++j)
325 ecal0->push_back((ecalColl[preSamples])[j]);
326 for (
unsigned int j = 0; j < hcalColl[
preSamples].size(); ++j)
327 hcal0->push_back((hcalColl[preSamples])[j]);
332 for (
int i = preSamples + 1; i < preSamples + postSamples + 1; ++
i) {
333 char ecal_label[200];
334 char hcal_label[200];
336 sprintf(ecal_label,
"ECALBxplus%d", i - preSamples);
337 sprintf(hcal_label,
"HCALBxplus%d", i - preSamples);
339 std::unique_ptr<EcalTrigPrimDigiCollection> ecalIn2(
341 std::unique_ptr<HcalTrigPrimDigiCollection> hcalIn2(
344 for (
unsigned int j = 0; j < ecalColl[
i].size(); ++j)
345 ecalIn2->push_back((ecalColl[i])[j]);
347 for (
unsigned int j = 0; j < hcalColl[
i].size(); ++j)
348 hcalIn2->push_back((hcalColl[i])[j]);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< T >::const_iterator const_iterator
constexpr size_t nSamples
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const_iterator end() const
const_iterator begin() const