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"
60 using namespace l1tcalo;
61 using namespace l1extra;
88 std::vector<std::vector<std::vector<uint32_t>>>
pumLUT;
120 : nPumBins(iConfig.getParameter<unsigned int>(
"nPumBins")),
122 caloScaleFactor(iConfig.getParameter<double>(
"caloScaleFactor")),
123 jetSeed(iConfig.getParameter<unsigned int>(
"jetSeed")),
124 tauSeed(iConfig.getParameter<unsigned int>(
"tauSeed")),
125 tauIsolationFactor(iConfig.getParameter<double>(
"tauIsolationFactor")),
126 eGammaSeed(iConfig.getParameter<unsigned int>(
"eGammaSeed")),
127 eGammaIsolationFactor(iConfig.getParameter<double>(
"eGammaIsolationFactor")),
128 boostedJetPtFactor(iConfig.getParameter<double>(
"boostedJetPtFactor")),
129 verbose(iConfig.getParameter<bool>(
"verbose")),
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());
185 uint32_t absCaloEta =
std::abs(t.first);
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);
193 UCTRegion*
test =
new UCTRegion(crate, card, negativeEta, region,
fwVersion);
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;
213 eta =
g.getUCTTowerEta(object->iEta());
214 phi =
g.getUCTTowerPhi(object->iPhi());
215 bitset<3> activeRegionEtaPattern = 0;
216 for (uint32_t iEta = 0; iEta < 3; iEta++) {
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;
229 for (uint32_t iEta = 0; iEta < 3; iEta++) {
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>();
239 if (
std::abs(
eta) < 2.5 && (regionEta ==
"010" || regionPhi ==
"010" || regionEta ==
"110" || regionPhi ==
"110" ||
240 regionEta ==
"011" || regionPhi ==
"011"))
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) 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)
static constexpr int verbose
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)
T getParameter(std::string const &) const
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