CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TICLTrackstersEdgesValidation Class Reference
Inheritance diagram for TICLTrackstersEdgesValidation:
DQMGlobalEDAnalyzer< Histograms_TICLTrackstersEdgesValidation > DQMGlobalEDAnalyzerBase< Histograms_TICLTrackstersEdgesValidation, Args... > edm::global::EDProducer< edm::RunCache< Histograms_TICLTrackstersEdgesValidation >, edm::EndRunProducer, edm::Accumulator, Args... > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TICLTrackstersEdgesValidation (const edm::ParameterSet &)
 
 ~TICLTrackstersEdgesValidation () override
 
- Public Member Functions inherited from DQMGlobalEDAnalyzer< Histograms_TICLTrackstersEdgesValidation >
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &, Histograms_TICLTrackstersEdgesValidation const &) const
 
void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup) const final
 
- Public Member Functions inherited from DQMGlobalEDAnalyzerBase< Histograms_TICLTrackstersEdgesValidation, Args... >
void accumulate (edm::StreamID id, edm::Event const &event, edm::EventSetup const &setup) const final
 
 DQMGlobalEDAnalyzerBase ()
 
std::shared_ptr< Histograms_TICLTrackstersEdgesValidationglobalBeginRun (edm::Run const &run, edm::EventSetup const &setup) const final
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const final
 
- Public Member Functions inherited from edm::global::EDProducer< edm::RunCache< Histograms_TICLTrackstersEdgesValidation >, edm::EndRunProducer, edm::Accumulator, Args... >
 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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms_TICLTrackstersEdgesValidation &) const override
 
void dqmAnalyze (edm::Event const &, edm::EventSetup const &, Histograms_TICLTrackstersEdgesValidation const &) const override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &, Histograms_TICLTrackstersEdgesValidation &) const override
 

Private Attributes

edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeomToken_
 
std::string folder_
 
edm::EDGetTokenT< std::vector< reco::CaloCluster > > layerClustersToken_
 
hgcal::RecHitTools rhtools_
 
edm::EDGetTokenT< std::vector< TICLSeedingRegion > > ticlSeedingGlobalToken_
 
edm::EDGetTokenT< std::vector< TICLSeedingRegion > > ticlSeedingTrkToken_
 
std::vector< std::string > trackstersCollectionsNames_
 
std::vector< edm::EDGetTokenT< std::vector< Trackster > > > tracksterTokens_
 

Additional Inherited Members

- Public Types inherited from DQMGlobalEDAnalyzerBase< Histograms_TICLTrackstersEdgesValidation, Args... >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from DQMGlobalEDAnalyzerBase< Histograms_TICLTrackstersEdgesValidation, Args... >
uint64_t meId (edm::Run const &run) const
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMGlobalEDAnalyzerBase< Histograms_TICLTrackstersEdgesValidation, Args... >
DQMStoredqmstore_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 49 of file TICLTrackstersEdgesValidation.cc.

Constructor & Destructor Documentation

◆ TICLTrackstersEdgesValidation()

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

Definition at line 77 of file TICLTrackstersEdgesValidation.cc.

References edm::ParameterSet::getParameter(), layerClustersToken_, makeGlobalPositionRcd_cfg::tag, ticlSeedingGlobalToken_, ticlSeedingTrkToken_, tracksterTokens_, and edm::vector_transform().

78  : caloGeomToken_(esConsumes<CaloGeometry, CaloGeometryRecord>()),
79  folder_(iConfig.getParameter<std::string>("folder")) {
80  tracksterTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag>>("tracksterCollections"),
81  [this](edm::InputTag const& tag) {
82  trackstersCollectionsNames_.emplace_back(tag.label());
83  return consumes<std::vector<Trackster>>(tag);
84  });
85  layerClustersToken_ = consumes<std::vector<reco::CaloCluster>>(iConfig.getParameter<edm::InputTag>("layerClusters"));
87  consumes<std::vector<TICLSeedingRegion>>(iConfig.getParameter<edm::InputTag>("ticlSeedingGlobal"));
89  consumes<std::vector<TICLSeedingRegion>>(iConfig.getParameter<edm::InputTag>("ticlSeedingTrk"));
90 }
edm::EDGetTokenT< std::vector< reco::CaloCluster > > layerClustersToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
edm::EDGetTokenT< std::vector< TICLSeedingRegion > > ticlSeedingGlobalToken_
std::vector< edm::EDGetTokenT< std::vector< Trackster > > > tracksterTokens_
edm::EDGetTokenT< std::vector< TICLSeedingRegion > > ticlSeedingTrkToken_

◆ ~TICLTrackstersEdgesValidation()

TICLTrackstersEdgesValidation::~TICLTrackstersEdgesValidation ( )
override

Definition at line 92 of file TICLTrackstersEdgesValidation.cc.

92 {}

Member Function Documentation

◆ bookHistograms()

void TICLTrackstersEdgesValidation::bookHistograms ( DQMStore::IBooker ibook,
edm::Run const &  run,
edm::EventSetup const &  iSetup,
Histograms_TICLTrackstersEdgesValidation histos 
) const
overrideprivatevirtual

Implements DQMGlobalEDAnalyzerBase< Histograms_TICLTrackstersEdgesValidation, Args... >.

Definition at line 206 of file TICLTrackstersEdgesValidation.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), cosmicPhotonAnalyzer_cfi::eMax, photonAnalyzer_cfi::eMin, folder_, timingPdfMaker::histo, combine::histos, phase1PixelTopology::layer, dqm::implementation::NavigatorBase::setCurrentFolder(), cond::impl::to_string(), trackstersCollectionsNames_, and tracksterTokens_.

209  {
210  float eMin = 0., eThresh = 70., eMax = 500;
211  float eWidth[] = {0.5, 2.};
212  std::vector<float> eBins;
213  float eVal = eMin;
214  while (eVal <= eThresh) {
215  eBins.push_back(eVal);
216  eVal += eWidth[0];
217  }
218  while (eVal < eMax) {
219  eVal += eWidth[1];
220  eBins.push_back(eVal);
221  }
222  int eNBins = eBins.size() - 1;
223 
224  TString onePlusLC[] = {"1plus LC", "for tracksters with at least one LC"};
225  TString trkers = "Tracksters";
226  static const char* particle_kind[] = {
227  "photon", "electron", "muon", "neutral_pion", "charged_hadron", "neutral_hadron", "ambiguous", "unknown"};
228  auto nCategory = sizeof(particle_kind) / sizeof(*particle_kind);
229  int labelIndex = 0;
230  for (const auto& trackster_token : tracksterTokens_) {
231  auto& histo = histos[trackster_token.index()];
232  ibook.setCurrentFolder(folder_ + "HGCalValidator/" + trackstersCollectionsNames_[labelIndex]);
233  histo.number_ = ibook.book1D(
234  "Number of Tracksters per Event", "Number of Tracksters per Event;# Tracksters;Events", 250, 0., 250.);
235  // The following plots should be moved to HGVHistoProducerAlgo
236  // when we get rid of the MultiClusters and use only Tracksters
237  histo.raw_energy_ = ibook.book1D("Raw Energy", "Raw Energy;Raw Energy [GeV];" + trkers, eNBins, &eBins[0]);
238  histo.regr_energy_ =
239  ibook.book1D("Regressed Energy", "Regressed Energy;Regressed Energy [GeV];" + trkers, eNBins, &eBins[0]);
240  histo.raw_energy_vs_regr_energy_ = ibook.book2D("Raw Energy vs Regressed Energy",
241  "Raw vs Regressed Energy;Regressed Energy [GeV];Raw Energy [GeV]",
242  eNBins,
243  &eBins[0],
244  eNBins,
245  &eBins[0]);
246  histo.id_prob_ =
247  ibook.book1D("ID probability", "ID probability;category;Max ID probability", nCategory, 0, nCategory);
248  histo.raw_energy_1plusLC_ = ibook.book1D(
249  "Raw Energy " + onePlusLC[0], "Raw Energy " + onePlusLC[1] + ";Raw Energy [GeV];" + trkers, eNBins, &eBins[0]);
250  histo.regr_energy_1plusLC_ = ibook.book1D("Regressed Energy " + onePlusLC[0],
251  "Regressed Energy " + onePlusLC[1] + ";Regressed Energy [GeV];" + trkers,
252  eNBins,
253  &eBins[0]);
254  histo.raw_energy_vs_regr_energy_1plusLC_ =
255  ibook.book2D("Raw Energy vs Regressed Energy " + onePlusLC[0],
256  "Raw vs Regressed Energy " + onePlusLC[1] + ";Regressed Energy [GeV];Raw Energy [GeV]",
257  eNBins,
258  &eBins[0],
259  eNBins,
260  &eBins[0]);
261  histo.id_prob_1plusLC_ = ibook.book1D("ID probability " + onePlusLC[0],
262  "ID probability " + onePlusLC[1] + ";category;Max ID probability",
263  nCategory,
264  0,
265  nCategory);
266  for (int iBin = 0; iBin < histo.id_prob_->getNbinsX(); iBin++) {
267  histo.id_prob_->setBinLabel(iBin + 1, particle_kind[iBin]);
268  histo.id_prob_1plusLC_->setBinLabel(iBin + 1, particle_kind[iBin]);
269  }
270  // Plots on edges
271  histo.delta_energy_ = ibook.book1D("Delta energy", "Delta Energy (O-I)", 800, -20., 20.);
272  histo.delta_energy_relative_ =
273  ibook.book1D("Relative Delta energy", "Relative Delta Energy (O-I)/I", 200, -10., 10.);
274  histo.delta_energy_vs_energy_ =
275  ibook.book2D("Energy vs Delta Energy", "Energy (I) vs Delta Energy (O-I)", 800, -20., 20., 200, 0., 20.);
276  histo.delta_energy_vs_layer_ = ibook.book2D(
277  "Delta Energy (O-I) vs Layer Number (I)", "Delta Energy (O-I) vs Layer Number (I)", 50, 0., 50., 800, -20., 20.);
278  histo.delta_energy_relative_vs_layer_ = ibook.book2D("Relative Delta Energy (O-I)_I vs Layer Number (I)",
279  "Relative Delta Energy (O-I)_I vs Layer Number (I)",
280  50,
281  0.,
282  50.,
283  200,
284  -10.,
285  10.);
286  histo.ingoing_links_vs_layer_ =
287  ibook.book2D("Ingoing links Layer Number", "Ingoing links vs Layer Number", 50, 0., 50., 40, 0., 40.);
288  histo.outgoing_links_vs_layer_ =
289  ibook.book2D("Outgoing links vs Layer Number", "Outgoing links vs Layer Number", 50, 0., 50., 40, 0., 40.);
290  histo.delta_layer_ = ibook.book1D("Delta Layer", "Delta Layer", 10, 0., 10.);
291  histo.angle_alpha_ = ibook.book1D("cosAngle Alpha", "cosAngle Alpha", 200, -1., 1.);
292  histo.angle_beta_ = ibook.book1D("cosAngle Beta", "cosAngle Beta", 200, -1., 1.);
293  histo.angle_alpha_alternative_ = ibook.book1D("cosAngle Alpha Alternative", "Angle Alpha Alternative", 200, 0., 1.);
294  for (int layer = 0; layer < 50; layer++) {
295  auto layerstr = std::to_string(layer + 1);
296  if (layerstr.length() < 2)
297  layerstr.insert(0, 2 - layerstr.length(), '0');
298  histo.angle_beta_byLayer_.push_back(
299  ibook.book1D("cosAngle Beta on Layer " + layerstr, "cosAngle Beta on Layer " + layerstr, 200, -1., 1.));
300  histo.angle_beta_w_byLayer_.push_back(ibook.book1D(
301  "cosAngle Beta Weighted on Layer " + layerstr, "cosAngle Beta Weighted on Layer " + layerstr, 200, -1., 1.));
302  }
303  labelIndex++;
304  }
305 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::string to_string(const V &value)
Definition: OMSAccess.h:71
constexpr std::array< uint8_t, layerIndexSize > layer
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
histos
Definition: combine.py:4
std::vector< edm::EDGetTokenT< std::vector< Trackster > > > tracksterTokens_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::vector< std::string > trackstersCollectionsNames_

◆ dqmAnalyze()

void TICLTrackstersEdgesValidation::dqmAnalyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup,
Histograms_TICLTrackstersEdgesValidation const &  histos 
) const
overrideprivatevirtual

Implements DQMGlobalEDAnalyzerBase< Histograms_TICLTrackstersEdgesValidation, Args... >.

Definition at line 94 of file TICLTrackstersEdgesValidation.cc.

References alpha, HLT_2022v12_cff::beta, mps_fire::end, hgcal::RecHitTools::getLayerWithOffset(), timingPdfMaker::histo, combine::histos, mps_fire::i, iEvent, SurfaceOrientation::inner, dqmiolumiharvest::j, hltEgammaHGCALIDVarsL1Seeded_cfi::layerClusters, layerClustersToken_, edm::Handle< T >::product(), rhtools_, alignCSCRings::s, fileCollector::seed, jetUpdater_cfi::sort, mathSSE::sqrt(), ticlSeedingGlobal_cfi::ticlSeedingGlobal, ticlSeedingGlobalToken_, ticlSeedingTrk_cfi::ticlSeedingTrk, ticlSeedingTrkToken_, and tracksterTokens_.

96  {
98  iEvent.getByToken(layerClustersToken_, layerClustersH);
99  auto const& layerClusters = *layerClustersH.product();
100 
101  edm::Handle<std::vector<TICLSeedingRegion>> ticlSeedingGlobalH;
102  iEvent.getByToken(ticlSeedingGlobalToken_, ticlSeedingGlobalH);
103  auto const& ticlSeedingGlobal = *ticlSeedingGlobalH.product();
104 
106  iEvent.getByToken(ticlSeedingTrkToken_, ticlSeedingTrkH);
107  auto const& ticlSeedingTrk = *ticlSeedingTrkH.product();
108 
109  for (const auto& trackster_token : tracksterTokens_) {
111  iEvent.getByToken(trackster_token, trackster_h);
112  auto numberOfTracksters = trackster_h->size();
113  //using .at() as [] is not const
114  const auto& histo = histos.at(trackster_token.index());
115  histo.number_->Fill(numberOfTracksters);
116  for (unsigned int i = 0; i < numberOfTracksters; ++i) {
117  const auto& thisTrackster = trackster_h->at(i);
118 
119  // The following plots should be moved to HGVHistoProducerAlgo
120  // when we get rid of the MultiClusters and use only Tracksters
121  histo.raw_energy_->Fill(thisTrackster.raw_energy());
122  histo.regr_energy_->Fill(thisTrackster.regressed_energy());
123  histo.raw_energy_vs_regr_energy_->Fill(thisTrackster.regressed_energy(), thisTrackster.raw_energy());
124  const auto& probs = thisTrackster.id_probabilities();
125  std::vector<int> sorted_probs_idx(probs.size());
126  std::iota(begin(sorted_probs_idx), end(sorted_probs_idx), 0);
127  std::sort(begin(sorted_probs_idx), end(sorted_probs_idx), [&probs](int i, int j) { return probs[i] > probs[j]; });
128  histo.id_prob_->Fill(sorted_probs_idx[0]);
129  if (!thisTrackster.vertices().empty()) {
130  histo.raw_energy_1plusLC_->Fill(thisTrackster.raw_energy());
131  histo.regr_energy_1plusLC_->Fill(thisTrackster.regressed_energy());
132  histo.raw_energy_vs_regr_energy_1plusLC_->Fill(thisTrackster.regressed_energy(), thisTrackster.raw_energy());
133  histo.id_prob_1plusLC_->Fill(sorted_probs_idx[0]);
134  }
135 
136  // Plots on edges
137  for (const auto& edge : thisTrackster.edges()) {
138  auto& ic = layerClusters[edge[0]];
139  auto& oc = layerClusters[edge[1]];
140  auto const& cl_in = ic.hitsAndFractions()[0].first;
141  auto const& cl_out = oc.hitsAndFractions()[0].first;
142  auto const layer_in = rhtools_.getLayerWithOffset(cl_in);
143  auto const layer_out = rhtools_.getLayerWithOffset(cl_out);
144  histo.delta_energy_->Fill(oc.energy() - ic.energy());
145  histo.delta_energy_relative_->Fill((oc.energy() - ic.energy()) / ic.energy());
146  histo.delta_energy_vs_energy_->Fill(oc.energy() - ic.energy(), ic.energy());
147  histo.delta_energy_vs_layer_->Fill(layer_in, oc.energy() - ic.energy());
148  histo.delta_energy_relative_vs_layer_->Fill(layer_in, (oc.energy() - ic.energy()) / ic.energy());
149  histo.delta_layer_->Fill(layer_out - layer_in);
150 
151  // Alpha angles
152  const auto& outer_outer_pos = oc.position();
153  const auto& outer_inner_pos = ic.position();
154  const auto& seed = thisTrackster.seedIndex();
155  auto seedGlobalPos = math::XYZPoint(
156  ticlSeedingGlobal[0].origin.x(), ticlSeedingGlobal[0].origin.y(), ticlSeedingGlobal[0].origin.z());
157  auto seedDirectionPos = outer_inner_pos;
158  if (thisTrackster.seedID().id() != 0) {
159  // Seed to trackster association is, at present, rather convoluted.
160  for (auto const& s : ticlSeedingTrk) {
161  if (s.index == seed) {
162  seedGlobalPos = math::XYZPoint(s.origin.x(), s.origin.y(), s.origin.z());
163  seedDirectionPos =
164  math::XYZPoint(s.directionAtOrigin.x(), s.directionAtOrigin.y(), s.directionAtOrigin.z());
165  break;
166  }
167  }
168  }
169 
170  auto alpha = (outer_inner_pos - seedGlobalPos).Dot(outer_outer_pos - outer_inner_pos) /
171  sqrt((outer_inner_pos - seedGlobalPos).Mag2() * (outer_outer_pos - outer_inner_pos).Mag2());
172  auto alpha_alternative = (outer_outer_pos - seedGlobalPos).Dot(seedDirectionPos) /
173  sqrt((outer_outer_pos - seedGlobalPos).Mag2() * seedDirectionPos.Mag2());
174  histo.angle_alpha_->Fill(alpha);
175  histo.angle_alpha_alternative_->Fill(alpha_alternative);
176 
177  // Beta angle is usually computed using 2 edges. Another inner loop
178  // is therefore needed.
179  std::vector<std::array<unsigned int, 2>> innerDoublets;
180  std::vector<std::array<unsigned int, 2>> outerDoublets;
181  for (const auto& otherEdge : thisTrackster.edges()) {
182  if (otherEdge[1] == edge[0]) {
183  innerDoublets.push_back(otherEdge);
184  }
185  if (edge[1] == otherEdge[0]) {
186  outerDoublets.push_back(otherEdge);
187  }
188  }
189 
190  histo.ingoing_links_vs_layer_->Fill(layer_in, innerDoublets.size());
191  histo.outgoing_links_vs_layer_->Fill(layer_out, outerDoublets.size());
192  for (const auto& inner : innerDoublets) {
193  const auto& inner_ic = layerClusters[inner[0]];
194  const auto& inner_inner_pos = inner_ic.position();
195  auto beta = (outer_inner_pos - inner_inner_pos).Dot(outer_outer_pos - inner_inner_pos) /
196  sqrt((outer_inner_pos - inner_inner_pos).Mag2() * (outer_outer_pos - inner_inner_pos).Mag2());
197  histo.angle_beta_->Fill(beta);
198  histo.angle_beta_byLayer_[layer_in]->Fill(beta);
199  histo.angle_beta_w_byLayer_[layer_in]->Fill(beta, ic.energy());
200  }
201  }
202  }
203  }
204 }
edm::EDGetTokenT< std::vector< reco::CaloCluster > > layerClustersToken_
float alpha
Definition: AMPTWrapper.h:105
T const * product() const
Definition: Handle.h:70
int iEvent
Definition: GenABIO.cc:224
T sqrt(T t)
Definition: SSEVec.h:19
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::EDGetTokenT< std::vector< TICLSeedingRegion > > ticlSeedingGlobalToken_
histos
Definition: combine.py:4
std::vector< edm::EDGetTokenT< std::vector< Trackster > > > tracksterTokens_
edm::EDGetTokenT< std::vector< TICLSeedingRegion > > ticlSeedingTrkToken_
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:365

◆ dqmBeginRun()

void TICLTrackstersEdgesValidation::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup,
Histograms_TICLTrackstersEdgesValidation histograms 
) const
overrideprivatevirtual

◆ fillDescriptions()

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

Definition at line 314 of file TICLTrackstersEdgesValidation.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_2022v12_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

314  {
316  std::vector<edm::InputTag> source_vector{edm::InputTag("ticlTrackstersTrk"),
317  edm::InputTag("ticlTrackstersTrkEM"),
318  edm::InputTag("ticlTrackstersEM"),
319  edm::InputTag("ticlTrackstersHAD"),
320  edm::InputTag("ticlTrackstersMerge")};
321  desc.add<std::vector<edm::InputTag>>("tracksterCollections", source_vector);
322  desc.add<edm::InputTag>("layerClusters", edm::InputTag("hgcalLayerClusters"));
323  desc.add<edm::InputTag>("ticlSeedingGlobal", edm::InputTag("ticlSeedingGlobal"));
324  desc.add<edm::InputTag>("ticlSeedingTrk", edm::InputTag("ticlSeedingTrk"));
325  desc.add<std::string>("folder", "HGCAL/");
326  descriptions.add("ticlTrackstersEdgesValidationDefault", desc);
327 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ caloGeomToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> TICLTrackstersEdgesValidation::caloGeomToken_
private

Definition at line 67 of file TICLTrackstersEdgesValidation.cc.

Referenced by dqmBeginRun().

◆ folder_

std::string TICLTrackstersEdgesValidation::folder_
private

Definition at line 68 of file TICLTrackstersEdgesValidation.cc.

Referenced by bookHistograms().

◆ layerClustersToken_

edm::EDGetTokenT<std::vector<reco::CaloCluster> > TICLTrackstersEdgesValidation::layerClustersToken_
private

Definition at line 71 of file TICLTrackstersEdgesValidation.cc.

Referenced by dqmAnalyze(), and TICLTrackstersEdgesValidation().

◆ rhtools_

hgcal::RecHitTools TICLTrackstersEdgesValidation::rhtools_
mutableprivate

Definition at line 74 of file TICLTrackstersEdgesValidation.cc.

Referenced by dqmAnalyze(), and dqmBeginRun().

◆ ticlSeedingGlobalToken_

edm::EDGetTokenT<std::vector<TICLSeedingRegion> > TICLTrackstersEdgesValidation::ticlSeedingGlobalToken_
private

Definition at line 72 of file TICLTrackstersEdgesValidation.cc.

Referenced by dqmAnalyze(), and TICLTrackstersEdgesValidation().

◆ ticlSeedingTrkToken_

edm::EDGetTokenT<std::vector<TICLSeedingRegion> > TICLTrackstersEdgesValidation::ticlSeedingTrkToken_
private

Definition at line 73 of file TICLTrackstersEdgesValidation.cc.

Referenced by dqmAnalyze(), and TICLTrackstersEdgesValidation().

◆ trackstersCollectionsNames_

std::vector<std::string> TICLTrackstersEdgesValidation::trackstersCollectionsNames_
private

Definition at line 69 of file TICLTrackstersEdgesValidation.cc.

Referenced by bookHistograms().

◆ tracksterTokens_

std::vector<edm::EDGetTokenT<std::vector<Trackster> > > TICLTrackstersEdgesValidation::tracksterTokens_
private