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"))
26 sprintf(ecal_label,
"ECALBxminus%d",
i);
27 sprintf(hcal_label,
"HCALBxminus%d",
i);
28 produces<EcalTrigPrimDigiCollection>(ecal_label);
29 produces<HcalTrigPrimDigiCollection>(hcal_label);
32 produces<EcalTrigPrimDigiCollection>(
"ECALBx0");
33 produces<HcalTrigPrimDigiCollection>(
"HCALBx0");
37 sprintf(ecal_label,
"ECALBxplus%d",
i+1);
38 sprintf(hcal_label,
"HCALBxplus%d",
i+1);
39 produces<EcalTrigPrimDigiCollection>(ecal_label);
40 produces<HcalTrigPrimDigiCollection>(hcal_label);
78 short zside = ecal_it->id().zside();
79 unsigned short ietaAbs = ecal_it->id().ietaAbs();
80 short iphi = ecal_it->id().iphi();
81 unsigned short digiSize = ecal_it->size();
82 unsigned short nSOI = (
unsigned short) ( ecal_it->sampleOfInterest() );
83 if (digiSize < nSamples || nSOI <
preSamples || ((
int)(digiSize - nSOI) < (
int)(nSamples -
preSamples)))
85 unsigned short preLoopsZero = (
unsigned short) (
preSamples)- nSOI;
93 (
int) ietaAbs, (
int) iphi));
96 ecalColl[
sample].push_back(ecalDigi);
105 (
int) ietaAbs, (
int) iphi));
112 <<
"ECAL data needs at least one presample "
113 <<
"more than the number requested "
114 <<
"to use ecal cosmic timing mod! "
115 <<
"reverting to useEcalCosmicTiming = false "
116 <<
"for rest of job.";
122 (ecal_it->sample(nSOI +
sample -
131 (ecal_it->sample(nSOI +
sample -
134 ecalColl[
sample].push_back(ecalDigi);
138 for (
unsigned int sample = (preLoopsZero + digiSize);
144 (
int) ietaAbs, (
int) iphi));
147 ecalColl[
sample].push_back(ecalDigi);
155 short zside = ecal_it->id().zside();
156 unsigned short ietaAbs = ecal_it->id().ietaAbs();
157 short iphi = ecal_it->id().iphi();
160 (
int) ietaAbs, (
int) iphi));
168 <<
"ECAL data needs at least one presample "
169 <<
"more than the number requested "
170 <<
"to use ecal cosmic timing mod! "
171 <<
"reverting to useEcalCosmicTiming = false "
172 <<
"for rest of job.";
179 (ecal_it->sampleOfInterest() +
189 (ecal_it->sampleOfInterest() +
193 ecalColl[
sample].push_back(ecalDigi);
205 short ieta = hcal_it->id().ieta();
206 short iphi = hcal_it->id().iphi();
208 unsigned short digiSize = hcal_it->size();
210 unsigned short nSOI = (
unsigned short) (hcal_it->presamples());
212 || ((
int)(digiSize - nSOI) < (
int)(nSamples -
preSamples)))
214 unsigned short preLoopsZero = (
unsigned short) (
preSamples)
224 hcalColl[
sample].push_back(hcalDigi);
228 for (
int sample = preLoopsZero;
241 <<
"HCAL data needs at least one presample "
242 <<
"more than the number requested "
243 <<
"to use hcal cosmic timing mod! "
244 <<
"reverting to useHcalCosmicTiming = false "
245 <<
"for rest of job.";
251 (hcal_it->sample(hcal_it->
263 (hcal_it->sample(hcal_it->
269 hcalColl[
sample].push_back(hcalDigi);
273 for (
unsigned int sample = (preLoopsZero + digiSize);
282 hcalColl[
sample].push_back(hcalDigi);
299 <<
"HCAL data needs at least one presample "
300 <<
"more than the number requested "
301 <<
"to use hcal cosmic timing mod! "
302 <<
"reverting to useHcalCosmicTiming = false "
303 <<
"for rest of job.";
309 (hcal_it->sample(hcal_it->
319 if(ieta>-29 && ieta<29)
321 (hcal_it->sample(hcal_it->
325 if(ieta<=-29 || ieta>=29)
327 (hcal_it->sample(hcal_it->
332 hcalColl[
sample].push_back(hcalDigi);
343 char ecal_label[200];
344 char hcal_label[200];
352 for(
unsigned int j=0;
j<ecalColl[
i].size();++
j)
354 ecalIn->push_back((ecalColl[
i])[
j]);
356 for(
unsigned int j=0;
j<hcalColl[
i].size();++
j)
357 hcalIn->push_back((hcalColl[
i])[
j]);
359 iEvent.
put(ecalIn,ecal_label);
360 iEvent.
put(hcalIn,hcal_label);
369 for(
unsigned int j=0;j<hcalColl[
preSamples].size();++
j)
370 hcal0->push_back((hcalColl[preSamples])[j]);
372 iEvent.
put(ecal0,
"ECALBx0");
373 iEvent.
put(hcal0,
"HCALBx0");
378 char ecal_label[200];
379 char hcal_label[200];
381 sprintf(ecal_label,
"ECALBxplus%d",
i-preSamples);
382 sprintf(hcal_label,
"HCALBxplus%d",
i-preSamples);
387 for(
unsigned int j=0;j<ecalColl[
i].size();++
j)
388 ecalIn2->push_back((ecalColl[
i])[j]);
390 for(
unsigned int j=0;j<hcalColl[
i].size();++
j)
391 hcalIn2->push_back((hcalColl[i])[j]);
394 iEvent.
put(ecalIn2,ecal_label);
395 iEvent.
put(hcalIn2,hcal_label);
void setSample(int i, const HcalTriggerPrimitiveSample &sam)
std::vector< EcalTriggerPrimitiveDigi >::const_iterator const_iterator
L1RCTTPGProvider(const edm::ParameterSet &)
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void setPresamples(int ps)
virtual void produce(edm::Event &, const edm::EventSetup &)