103 vector<int> ecalTPieta;
104 vector<int> ecalTPCaliphi;
105 vector<int> ecalTPiphi;
106 vector<float> ecalTPet;
107 vector<int> ecalTPcompEt;
108 vector<int> ecalTPfineGrain;
111 for (
const auto& itr : *(ecalTPs.
product())) {
112 short ieta = (short)itr.id().ieta();
114 unsigned short cal_iphi = (
unsigned short)itr.id().iphi();
115 unsigned short iphi = (72 + 18 - cal_iphi) % 72;
116 unsigned short compEt = itr.compressedEt();
118 unsigned short fineGrain = (
unsigned short)itr.fineGrain();
121 ecalTPieta.push_back(
ieta);
122 ecalTPCaliphi.push_back(cal_iphi);
123 ecalTPiphi.push_back(
iphi);
124 ecalTPet.push_back(
et);
125 ecalTPcompEt.push_back(compEt);
126 ecalTPfineGrain.push_back(fineGrain);
131 auto ecalTPTable = std::make_unique<nanoaod::FlatTable>(nECALTP,
ecalTPsName_,
false);
132 ecalTPTable->addColumn<int16_t>(
"ieta", ecalTPieta,
"");
133 ecalTPTable->addColumn<int16_t>(
"Caliphi", ecalTPCaliphi,
"");
134 ecalTPTable->addColumn<int16_t>(
"iphi", ecalTPiphi,
"");
135 ecalTPTable->addColumn<
float>(
"et", ecalTPet,
"", 12);
136 ecalTPTable->addColumn<int16_t>(
"compEt", ecalTPcompEt,
"");
137 ecalTPTable->addColumn<int16_t>(
"fineGrain", ecalTPfineGrain,
"");
139 vector<int> hcalTPieta;
140 vector<int> hcalTPCaliphi;
141 vector<int> hcalTPiphi;
142 vector<float> hcalTPet;
143 vector<int> hcalTPcompEt;
144 vector<int> hcalTPfineGrain;
147 for (
auto itr : (*hcalTPs.
product())) {
148 int ver = itr.id().version();
149 short ieta = (short)itr.id().ieta();
150 unsigned short absIeta = (
unsigned short)
abs(
ieta);
151 unsigned short cal_iphi = (
unsigned short)itr.id().iphi();
152 unsigned short iphi = (72 + 18 - cal_iphi) % 72;
154 unsigned short compEt = itr.SOI_compressedEt();
155 double et = decoder->hcaletValue(itr.id(), itr.t0());
156 unsigned short fineGrain = (
unsigned short)itr.SOI_fineGrain();
158 if (compEt > 0 && (absIeta < 29 || ver == 1)) {
159 hcalTPieta.push_back(
ieta);
160 hcalTPCaliphi.push_back(cal_iphi);
161 hcalTPiphi.push_back(
iphi);
162 hcalTPet.push_back(
et);
163 hcalTPcompEt.push_back(compEt);
164 hcalTPfineGrain.push_back(fineGrain);
170 auto hcalTPTable = std::make_unique<nanoaod::FlatTable>(nHCALTP,
hcalTPsName_,
false);
171 hcalTPTable->addColumn<int16_t>(
"ieta", hcalTPieta,
"");
172 hcalTPTable->addColumn<int16_t>(
"Caliphi", hcalTPCaliphi,
"");
173 hcalTPTable->addColumn<int16_t>(
"iphi", hcalTPiphi,
"");
174 hcalTPTable->addColumn<
float>(
"et", hcalTPet,
"", 12);
175 hcalTPTable->addColumn<int16_t>(
"compEt", hcalTPcompEt,
"");
176 hcalTPTable->addColumn<int16_t>(
"fineGrain", hcalTPfineGrain,
"");
T const * product() const
const std::string hcalTPsName_
const edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPsToken_
Abs< T >::type abs(const T &t)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const std::string ecalTPsName_
const edm::ESGetToken< CaloTPGTranscoder, CaloTPGRecord > decoderToken_
const edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPsToken_