6 : ecalTPG_(iConfig.getParameter<edm::
InputTag>(
"ecalTPGs")),
7 hcalTPG_(iConfig.getParameter<edm::
InputTag>(
"hcalTPGs")),
8 useHcalCosmicTiming(iConfig.getParameter<bool>(
"useHCALCosmicTiming")),
9 useEcalCosmicTiming(iConfig.getParameter<bool>(
"useECALCosmicTiming")),
10 preSamples(iConfig.getParameter<int>(
"preSamples")),
11 postSamples(iConfig.getParameter<int>(
"postSamples")),
12 hfShift(iConfig.getParameter<int>(
"HFShift")),
13 hbShift(iConfig.getParameter<int>(
"HBShift")) {
21 sprintf(ecal_label,
"ECALBxminus%d",
i);
22 sprintf(hcal_label,
"HCALBxminus%d",
i);
23 produces<EcalTrigPrimDigiCollection>(ecal_label);
24 produces<HcalTrigPrimDigiCollection>(hcal_label);
27 produces<EcalTrigPrimDigiCollection>(
"ECALBx0");
28 produces<HcalTrigPrimDigiCollection>(
"HCALBx0");
31 sprintf(ecal_label,
"ECALBxplus%d",
i + 1);
32 sprintf(hcal_label,
"HCALBxplus%d",
i + 1);
33 produces<EcalTrigPrimDigiCollection>(ecal_label);
34 produces<HcalTrigPrimDigiCollection>(hcal_label);
65 short zside = ecal_it->id().zside();
66 unsigned short ietaAbs = ecal_it->id().ietaAbs();
67 short iphi = ecal_it->id().iphi();
68 unsigned short digiSize = ecal_it->size();
69 unsigned short nSOI = (
unsigned short)(ecal_it->sampleOfInterest());
71 unsigned short preLoopsZero = (
unsigned short)(
preSamples)-nSOI;
80 ecalColl[
sample].push_back(ecalDigi);
91 edm::LogWarning(
"TooLittleData") <<
"ECAL data needs at least one presample "
92 <<
"more than the number requested "
93 <<
"to use ecal cosmic timing mod! "
94 <<
"reverting to useEcalCosmicTiming = false "
95 <<
"for rest of job.";
106 ecalColl[
sample].push_back(ecalDigi);
116 ecalColl[
sample].push_back(ecalDigi);
121 short zside = ecal_it->id().zside();
122 unsigned short ietaAbs = ecal_it->id().ietaAbs();
123 short iphi = ecal_it->id().iphi();
130 edm::LogWarning(
"TooLittleData") <<
"ECAL data needs at least one presample "
131 <<
"more than the number requested "
132 <<
"to use ecal cosmic timing mod! "
133 <<
"reverting to useEcalCosmicTiming = false "
134 <<
"for rest of job.";
139 ecal_it->sample(ecal_it->sampleOfInterest() +
sample -
preSamples - 1).raw()));
149 ecalColl[
sample].push_back(ecalDigi);
156 if (
hcal.isValid()) {
159 short ieta = hcal_it->id().ieta();
160 short iphi = hcal_it->id().iphi();
162 unsigned short digiSize = hcal_it->size();
164 unsigned short nSOI = (
unsigned short)(hcal_it->presamples());
166 unsigned short preLoopsZero = (
unsigned short)(
preSamples)-nSOI;
174 hcalColl[
sample].push_back(hcalDigi);
186 edm::LogWarning(
"TooLittleData") <<
"HCAL data needs at least one presample "
187 <<
"more than the number requested "
188 <<
"to use hcal cosmic timing mod! "
189 <<
"reverting to useHcalCosmicTiming = false "
190 <<
"for rest of job.";
203 hcalColl[
sample].push_back(hcalDigi);
213 hcalColl[
sample].push_back(hcalDigi);
224 edm::LogWarning(
"TooLittleData") <<
"HCAL data needs at least one presample "
225 <<
"more than the number requested "
226 <<
"to use hcal cosmic timing mod! "
227 <<
"reverting to useHcalCosmicTiming = false "
228 <<
"for rest of job.";
238 if (ieta > -29 && ieta < 29)
242 if (ieta <= -29 || ieta >= 29)
247 hcalColl[
sample].push_back(hcalDigi);
256 char ecal_label[200];
257 char hcal_label[200];
259 sprintf(ecal_label,
"ECALBxminus%d",
preSamples -
i);
260 sprintf(hcal_label,
"HCALBxminus%d",
preSamples -
i);
264 for (
unsigned int j = 0;
j < ecalColl[
i].size(); ++
j) {
265 ecalIn->push_back((ecalColl[
i])[
j]);
267 for (
unsigned int j = 0;
j < hcalColl[
i].size(); ++
j)
268 hcalIn->push_back((hcalColl[
i])[
j]);
276 for (
unsigned int j = 0;
j < ecalColl[
preSamples].size(); ++
j)
278 for (
unsigned int j = 0; j < hcalColl[
preSamples].size(); ++
j)
279 hcal0->push_back((hcalColl[preSamples])[j]);
284 for (
int i = preSamples + 1;
i < preSamples +
postSamples + 1; ++
i) {
285 char ecal_label[200];
286 char hcal_label[200];
288 sprintf(ecal_label,
"ECALBxplus%d",
i - preSamples);
289 sprintf(hcal_label,
"HCALBxplus%d",
i - preSamples);
294 for (
unsigned int j = 0; j < ecalColl[
i].size(); ++
j)
295 ecalIn2->push_back((ecalColl[
i])[j]);
297 for (
unsigned int j = 0; j < hcalColl[
i].size(); ++
j)
298 hcalIn2->push_back((hcalColl[i])[j]);
void setSample(int i, const HcalTriggerPrimitiveSample &sam)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< T >::const_iterator const_iterator
L1RCTTPGProvider(const edm::ParameterSet &)
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
~L1RCTTPGProvider() override
constexpr size_t nSamples
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void produce(edm::Event &, const edm::EventSetup &) override
void setPresamples(int ps)
Log< level::Warning, false > LogWarning