34 #include "L1Trigger/L1TCaloLayer1/src/UCTLayer1.hh" 35 #include "L1Trigger/L1TCaloLayer1/src/UCTCrate.hh" 36 #include "L1Trigger/L1TCaloLayer1/src/UCTCard.hh" 37 #include "L1Trigger/L1TCaloLayer1/src/UCTRegion.hh" 38 #include "L1Trigger/L1TCaloLayer1/src/UCTTower.hh" 39 #include "L1Trigger/L1TCaloLayer1/src/UCTGeometry.hh" 41 #include "L1Trigger/L1TCaloLayer1/src/UCTObject.hh" 42 #include "L1Trigger/L1TCaloLayer1/src/UCTSummaryCard.hh" 43 #include "L1Trigger/L1TCaloLayer1/src/UCTGeometryExtended.hh" 57 #include "L1Trigger/L1TCaloLayer1/src/UCTLogging.hh" 88 std::vector<std::vector<std::vector<uint32_t>>>
pumLUT;
120 :
nPumBins(iConfig.getParameter<unsigned
int>(
"nPumBins")),
123 jetSeed(iConfig.getParameter<unsigned
int>(
"jetSeed")),
124 tauSeed(iConfig.getParameter<unsigned
int>(
"tauSeed")),
126 eGammaSeed(iConfig.getParameter<unsigned
int>(
"eGammaSeed")),
130 fwVersion(iConfig.getParameter<
int>(
"firmwareVersion")),
132 std::vector<double> pumLUTData;
133 char pumLUTString[10];
134 for (uint32_t pumBin = 0; pumBin <
nPumBins; pumBin++) {
135 for (uint32_t side = 0; side < 2; side++) {
137 sprintf(pumLUTString,
"pumLUT%2.2dp", pumBin);
139 sprintf(pumLUTString,
"pumLUT%2.2dn", pumBin);
140 pumLUTData = iConfig.
getParameter<std::vector<double>>(pumLUTString);
141 for (uint32_t
iEta = 0;
iEta <
std::max((uint32_t)pumLUTData.size(), MaxUCTRegionsEta);
iEta++) {
144 if (pumLUTData.size() != (MaxUCTRegionsEta))
145 edm::LogError(
"L1TCaloSummary") <<
"PUM LUT Data size integrity check failed; Expected size = " 146 << MaxUCTRegionsEta <<
"; Provided size = " << pumLUTData.size()
147 <<
"; Will use what is provided :(" << std::endl;
150 produces<L1JetParticleCollection>(
"Boosted");
176 std::vector<UCTRegion*> inputRegions;
177 inputRegions.clear();
180 edm::LogError(
"L1TCaloSummary") <<
"UCT: Failed to get regions from region collection!";
183 UCTRegionIndex
r =
g.getUCTRegionIndexFromL1CaloRegion(
i.gctEta(),
i.gctPhi());
184 UCTTowerIndex
t =
g.getUCTTowerIndexFromL1CaloRegion(
r,
i.raw());
186 uint32_t absCaloPhi =
std::abs(
t.second);
187 bool negativeEta =
false;
190 uint32_t crate =
g.getCrate(
t.first,
t.second);
191 uint32_t card =
g.getCard(
t.first,
t.second);
192 uint32_t
region =
g.getRegion(absCaloEta, absCaloPhi);
194 test->setRegionSummary(
i.raw());
195 inputRegions.push_back(
test);
200 edm::LogError(
"L1TCaloSummary") <<
"UCT: Failed to process summary card" << std::endl;
209 std::list<UCTObject*> boostedJetObjs =
summaryCard->getBoostedJetObjs();
210 for (std::list<UCTObject*>::const_iterator
i = boostedJetObjs.begin();
i != boostedJetObjs.end();
i++) {
211 const UCTObject*
object = *
i;
215 bitset<3> activeRegionEtaPattern = 0;
217 bool activeStrip =
false;
218 for (uint32_t iPhi = 0; iPhi < 3; iPhi++) {
219 if (
object->boostedJetRegionET()[3 *
iEta + iPhi] > 30 &&
220 object->boostedJetRegionET()[3 *
iEta + iPhi] >
object->et() * 0.0625)
224 activeRegionEtaPattern |= (0x1 <<
iEta);
226 bitset<3> activeRegionPhiPattern = 0;
227 for (uint32_t iPhi = 0; iPhi < 3; iPhi++) {
228 bool activeStrip =
false;
230 if (
object->boostedJetRegionET()[3 *
iEta + iPhi] > 30 &&
231 object->boostedJetRegionET()[3 *
iEta + iPhi] >
object->et() * 0.0625)
235 activeRegionPhiPattern |= (0x1 << iPhi);
237 string regionEta = activeRegionEtaPattern.to_string<char, std::string::traits_type, std::string::allocator_type>();
238 string regionPhi = activeRegionPhiPattern.to_string<char, std::string::traits_type, std::string::allocator_type>();
240 bool centralHighest =
object->boostedJetRegionET()[4] >=
object->boostedJetRegionET()[0] &&
241 object->boostedJetRegionET()[4] >=
object->boostedJetRegionET()[1] &&
242 object->boostedJetRegionET()[4] >=
object->boostedJetRegionET()[2] &&
243 object->boostedJetRegionET()[4] >=
object->boostedJetRegionET()[3] &&
244 object->boostedJetRegionET()[4] >=
object->boostedJetRegionET()[5] &&
245 object->boostedJetRegionET()[4] >=
object->boostedJetRegionET()[6] &&
246 object->boostedJetRegionET()[4] >=
object->boostedJetRegionET()[7] &&
247 object->boostedJetRegionET()[4] >=
object->boostedJetRegionET()[8];
249 if (
abs(
eta) < 2.5 && ((regionEta ==
"101" && (regionPhi ==
"110" || regionPhi ==
"101" || regionPhi ==
"010")) ||
250 ((regionEta ==
"110" || regionEta ==
"101" || regionEta ==
"010") && regionPhi ==
"101") ||
251 (regionEta ==
"111" && (regionPhi ==
"110" || regionPhi ==
"010")) ||
252 ((regionEta ==
"110" || regionEta ==
"010") && regionPhi ==
"111") ||
253 ((regionEta ==
"010" || regionPhi ==
"010" || regionEta ==
"110" || regionPhi ==
"110" ||
254 regionEta ==
"011" || regionPhi ==
"011") &&
T getParameter(std::string const &) const
void produce(edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
L1TCaloSummary(const edm::ParameterSet &)
Log< level::Error, false > LogError
UCTSummaryCard * summaryCard
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
double eGammaIsolationFactor
~L1TCaloSummary() override
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Abs< T >::type abs(const T &t)
std::vector< std::vector< std::vector< uint32_t > > > pumLUT
double boostedJetPtFactor
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void beginRun(edm::Run const &, edm::EventSetup const &) override
A calorimeter trigger region (sum of 4x4 trigger towers)
std::vector< L1CaloRegion > L1CaloRegionCollection
edm::EDGetTokenT< L1CaloRegionCollection > regionToken