CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1TCaloSummary Class Reference

#include <L1Trigger/L1TCaloSummary/plugins/L1TCaloSummary.cc>

Inheritance diagram for L1TCaloSummary:
edm::stream::EDProducer<>

Public Member Functions

 L1TCaloSummary (const edm::ParameterSet &)
 
 ~L1TCaloSummary () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void print ()
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

double boostedJetPtFactor
 
double caloScaleFactor
 
double eGammaIsolationFactor
 
uint32_t eGammaSeed
 
int fwVersion
 
uint32_t jetSeed
 
UCTLayer1 * layer1
 
uint32_t nPumBins
 
std::vector< std::vector< std::vector< uint32_t > > > pumLUT
 
edm::EDGetTokenT< L1CaloRegionCollectionregionToken
 
UCTSummaryCard * summaryCard
 
float tauIsolationFactor
 
uint32_t tauSeed
 
bool verbose
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Description: The package L1Trigger/L1TCaloSummary is prepared for monitoring the CMS Layer-1 Calorimeter Trigger.

Implementation: It prepares region objects and puts them in the event

Definition at line 70 of file L1TCaloSummary.cc.

Constructor & Destructor Documentation

◆ L1TCaloSummary()

L1TCaloSummary::L1TCaloSummary ( const edm::ParameterSet iConfig)
explicit

Definition at line 121 of file L1TCaloSummary.cc.

122  : nPumBins(iConfig.getParameter<unsigned int>("nPumBins")),
123  pumLUT(nPumBins, std::vector<std::vector<uint32_t>>(2, std::vector<uint32_t>(13))),
124  caloScaleFactor(iConfig.getParameter<double>("caloScaleFactor")),
125  jetSeed(iConfig.getParameter<unsigned int>("jetSeed")),
126  tauSeed(iConfig.getParameter<unsigned int>("tauSeed")),
127  tauIsolationFactor(iConfig.getParameter<double>("tauIsolationFactor")),
128  eGammaSeed(iConfig.getParameter<unsigned int>("eGammaSeed")),
129  eGammaIsolationFactor(iConfig.getParameter<double>("eGammaIsolationFactor")),
130  boostedJetPtFactor(iConfig.getParameter<double>("boostedJetPtFactor")),
131  verbose(iConfig.getParameter<bool>("verbose")),
132  fwVersion(iConfig.getParameter<int>("firmwareVersion")),
133  regionToken(consumes<L1CaloRegionCollection>(edm::InputTag("simCaloStage2Layer1Digis"))) {
134  std::vector<double> pumLUTData;
135  char pumLUTString[10];
136  for (uint32_t pumBin = 0; pumBin < nPumBins; pumBin++) {
137  for (uint32_t side = 0; side < 2; side++) {
138  if (side == 0)
139  sprintf(pumLUTString, "pumLUT%2.2dp", pumBin);
140  else
141  sprintf(pumLUTString, "pumLUT%2.2dn", pumBin);
142  pumLUTData = iConfig.getParameter<std::vector<double>>(pumLUTString);
143  for (uint32_t iEta = 0; iEta < std::max((uint32_t)pumLUTData.size(), MaxUCTRegionsEta); iEta++) {
144  pumLUT[pumBin][side][iEta] = (uint32_t)round(pumLUTData[iEta] / caloScaleFactor);
145  }
146  if (pumLUTData.size() != (MaxUCTRegionsEta))
147  edm::LogError("L1TCaloSummary") << "PUM LUT Data size integrity check failed; Expected size = "
148  << MaxUCTRegionsEta << "; Provided size = " << pumLUTData.size()
149  << "; Will use what is provided :(" << std::endl;
150  }
151  }
152  produces<L1JetParticleCollection>("Boosted");
154 }

References caloScaleFactor, eGammaIsolationFactor, eGammaSeed, edm::ParameterSet::getParameter(), L1TowerCalibrationProducer_cfi::iEta, jetSeed, SiStripPI::max, nPumBins, pumLUT, summaryCard, tauIsolationFactor, and tauSeed.

◆ ~L1TCaloSummary()

L1TCaloSummary::~L1TCaloSummary ( )
override

Definition at line 156 of file L1TCaloSummary.cc.

156  {
157  if (summaryCard != nullptr)
158  delete summaryCard;
159 }

References summaryCard.

Member Function Documentation

◆ beginRun()

void L1TCaloSummary::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 259 of file L1TCaloSummary.cc.

259 {}

◆ fillDescriptions()

void L1TCaloSummary::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 286 of file L1TCaloSummary.cc.

286  {
287  //The following says we do not know what parameters are allowed so do no validation
288  // Please change this to state exactly what you do use, even if it is no parameters
290  desc.setUnknown();
291  descriptions.addDefault(desc);
292 }

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

◆ print()

void L1TCaloSummary::print ( void  )
private

Definition at line 249 of file L1TCaloSummary.cc.

249 {}

◆ produce()

void L1TCaloSummary::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 166 of file L1TCaloSummary.cc.

166  {
167  using namespace edm;
168 
169  std::unique_ptr<L1JetParticleCollection> bJetCands(new L1JetParticleCollection);
170 
171  UCTGeometry g;
172 
173  // Here we read region data from the region collection created by L1TCaloLayer1 instead of
174  // independently creating regions from TPGs for processing by the summary card. This results
175  // in a single region vector of size 252 whereas from independent creation we had 3*6 vectors
176  // of size 7*2. Indices are mapped in UCTSummaryCard accordingly.
177  summaryCard->clearRegions();
178  std::vector<UCTRegion*> inputRegions;
179  inputRegions.clear();
180  edm::Handle<std::vector<L1CaloRegion>> regionCollection;
181  if (!iEvent.getByToken(regionToken, regionCollection))
182  edm::LogError("L1TCaloSummary") << "UCT: Failed to get regions from region collection!";
183  iEvent.getByToken(regionToken, regionCollection);
184  for (const L1CaloRegion& i : *regionCollection) {
185  UCTRegionIndex r = g.getUCTRegionIndexFromL1CaloRegion(i.gctEta(), i.gctPhi());
186  UCTTowerIndex t = g.getUCTTowerIndexFromL1CaloRegion(r, i.raw());
187  uint32_t absCaloEta = std::abs(t.first);
188  uint32_t absCaloPhi = std::abs(t.second);
189  bool negativeEta = false;
190  if (t.first < 0)
191  negativeEta = true;
192  uint32_t crate = g.getCrate(t.first, t.second);
193  uint32_t card = g.getCard(t.first, t.second);
194  uint32_t region = g.getRegion(absCaloEta, absCaloPhi);
195  UCTRegion* test = new UCTRegion(crate, card, negativeEta, region, fwVersion);
196  test->setRegionSummary(i.raw());
197  inputRegions.push_back(test);
198  }
199  summaryCard->setRegionData(inputRegions);
200 
201  if (!summaryCard->process()) {
202  edm::LogError("L1TCaloSummary") << "UCT: Failed to process summary card" << std::endl;
203  exit(1);
204  }
205 
206  double pt = 0;
207  double eta = -999.;
208  double phi = -999.;
209  double mass = 0;
210 
211  std::list<UCTObject*> boostedJetObjs = summaryCard->getBoostedJetObjs();
212  for (std::list<UCTObject*>::const_iterator i = boostedJetObjs.begin(); i != boostedJetObjs.end(); i++) {
213  const UCTObject* object = *i;
214  pt = ((double)object->et()) * caloScaleFactor * boostedJetPtFactor;
215  eta = g.getUCTTowerEta(object->iEta());
216  phi = g.getUCTTowerPhi(object->iPhi());
217  bitset<3> activeRegionEtaPattern = 0;
218  for (uint32_t iEta = 0; iEta < 3; iEta++) {
219  bool activeStrip = false;
220  for (uint32_t iPhi = 0; iPhi < 3; iPhi++) {
221  if (object->boostedJetRegionET()[3 * iEta + iPhi] > 30 &&
222  object->boostedJetRegionET()[3 * iEta + iPhi] > object->et() * 0.0625)
223  activeStrip = true;
224  }
225  if (activeStrip)
226  activeRegionEtaPattern |= (0x1 << iEta);
227  }
228  bitset<3> activeRegionPhiPattern = 0;
229  for (uint32_t iPhi = 0; iPhi < 3; iPhi++) {
230  bool activeStrip = false;
231  for (uint32_t iEta = 0; iEta < 3; iEta++) {
232  if (object->boostedJetRegionET()[3 * iEta + iPhi] > 30 &&
233  object->boostedJetRegionET()[3 * iEta + iPhi] > object->et() * 0.0625)
234  activeStrip = true;
235  }
236  if (activeStrip)
237  activeRegionPhiPattern |= (0x1 << iPhi);
238  }
239  string regionEta = activeRegionEtaPattern.to_string<char, std::string::traits_type, std::string::allocator_type>();
240  string regionPhi = activeRegionPhiPattern.to_string<char, std::string::traits_type, std::string::allocator_type>();
241  if (std::abs(eta) < 2.5 && (regionEta == "010" || regionPhi == "010" || regionEta == "110" || regionPhi == "110" ||
242  regionEta == "011" || regionPhi == "011"))
243  bJetCands->push_back(L1JetParticle(math::PtEtaPhiMLorentzVector(pt, eta, phi, mass), L1JetParticle::kCentral));
244  }
245 
246  iEvent.put(std::move(bJetCands), "Boosted");
247 }

References funct::abs(), boostedJetPtFactor, caloScaleFactor, PVValHelper::eta, beamvalidation::exit(), fwVersion, g, mps_fire::i, L1TowerCalibrationProducer_cfi::iEta, iEvent, EgHLTOffHistBins_cfi::mass, eostools::move(), resolutioncreator_cfi::object, phi, DiDispStaMuonMonitor_cfi::pt, alignCSCRings::r, HLT_FULL_cff::region, regionToken, summaryCard, and submitPVValidationJobs::t.

Member Data Documentation

◆ boostedJetPtFactor

double L1TCaloSummary::boostedJetPtFactor
private

Definition at line 99 of file L1TCaloSummary.cc.

Referenced by produce().

◆ caloScaleFactor

double L1TCaloSummary::caloScaleFactor
private

Definition at line 92 of file L1TCaloSummary.cc.

Referenced by L1TCaloSummary(), and produce().

◆ eGammaIsolationFactor

double L1TCaloSummary::eGammaIsolationFactor
private

Definition at line 98 of file L1TCaloSummary.cc.

Referenced by L1TCaloSummary().

◆ eGammaSeed

uint32_t L1TCaloSummary::eGammaSeed
private

Definition at line 97 of file L1TCaloSummary.cc.

Referenced by L1TCaloSummary().

◆ fwVersion

int L1TCaloSummary::fwVersion
private

Definition at line 102 of file L1TCaloSummary.cc.

Referenced by produce().

◆ jetSeed

uint32_t L1TCaloSummary::jetSeed
private

Definition at line 94 of file L1TCaloSummary.cc.

Referenced by L1TCaloSummary().

◆ layer1

UCTLayer1* L1TCaloSummary::layer1
private

Definition at line 106 of file L1TCaloSummary.cc.

◆ nPumBins

uint32_t L1TCaloSummary::nPumBins
private

Definition at line 88 of file L1TCaloSummary.cc.

Referenced by L1TCaloSummary().

◆ pumLUT

std::vector<std::vector<std::vector<uint32_t> > > L1TCaloSummary::pumLUT
private

Definition at line 90 of file L1TCaloSummary.cc.

Referenced by L1TCaloSummary().

◆ regionToken

edm::EDGetTokenT<L1CaloRegionCollection> L1TCaloSummary::regionToken
private

Definition at line 104 of file L1TCaloSummary.cc.

Referenced by produce().

◆ summaryCard

UCTSummaryCard* L1TCaloSummary::summaryCard
private

Definition at line 107 of file L1TCaloSummary.cc.

Referenced by L1TCaloSummary(), produce(), and ~L1TCaloSummary().

◆ tauIsolationFactor

float L1TCaloSummary::tauIsolationFactor
private

Definition at line 96 of file L1TCaloSummary.cc.

Referenced by L1TCaloSummary().

◆ tauSeed

uint32_t L1TCaloSummary::tauSeed
private

Definition at line 95 of file L1TCaloSummary.cc.

Referenced by L1TCaloSummary().

◆ verbose

bool L1TCaloSummary::verbose
private
L1JetParticleCollection
resolutioncreator_cfi.object
object
Definition: resolutioncreator_cfi.py:4
mps_fire.i
i
Definition: mps_fire.py:428
L1CaloRegion
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:21
L1TCaloSummary::regionToken
edm::EDGetTokenT< L1CaloRegionCollection > regionToken
Definition: L1TCaloSummary.cc:104
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle
Definition: AssociativeIterator.h:50
L1TCaloSummary::nPumBins
uint32_t nPumBins
Definition: L1TCaloSummary.cc:88
test
Definition: SmallWORMDict.h:13
L1TCaloSummary::caloScaleFactor
double caloScaleFactor
Definition: L1TCaloSummary.cc:92
L1TCaloSummary::verbose
bool verbose
Definition: L1TCaloSummary.cc:101
PVValHelper::eta
Definition: PVValidationHelpers.h:70
L1TCaloSummary::fwVersion
int fwVersion
Definition: L1TCaloSummary.cc:102
L1TCaloSummary::eGammaIsolationFactor
double eGammaIsolationFactor
Definition: L1TCaloSummary.cc:98
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
l1extra::L1JetParticle
Definition: L1JetParticle.h:28
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
L1TCaloSummary::eGammaSeed
uint32_t eGammaSeed
Definition: L1TCaloSummary.cc:97
iEvent
int iEvent
Definition: GenABIO.cc:224
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
L1TCaloSummary::tauIsolationFactor
float tauIsolationFactor
Definition: L1TCaloSummary.cc:96
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDAxes::phi
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
L1TCaloSummary::tauSeed
uint32_t tauSeed
Definition: L1TCaloSummary.cc:95
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:52
L1TCaloSummary::pumLUT
std::vector< std::vector< std::vector< uint32_t > > > pumLUT
Definition: L1TCaloSummary.cc:90
L1TCaloSummary::boostedJetPtFactor
double boostedJetPtFactor
Definition: L1TCaloSummary.cc:99
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
L1TCaloSummary::summaryCard
UCTSummaryCard * summaryCard
Definition: L1TCaloSummary.cc:107
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::Log
Definition: MessageLogger.h:70
edm::InputTag
Definition: InputTag.h:15
g
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
Definition: Activities.doc:4
L1TCaloSummary::jetSeed
uint32_t jetSeed
Definition: L1TCaloSummary.cc:94