CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
SiPixelTrackComparisonHarvester Class Reference
Inheritance diagram for SiPixelTrackComparisonHarvester:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void dqmEndJob (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
 
void project2DalongDiagonal (MonitorElement *input2D, DQMStore::IBooker &ibooker)
 
 SiPixelTrackComparisonHarvester (const edm::ParameterSet &)
 
 ~SiPixelTrackComparisonHarvester () override=default
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Attributes

const std::string topFolder_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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 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 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 DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 14 of file SiPixelTrackComparisonHarvester.cc.

Constructor & Destructor Documentation

◆ SiPixelTrackComparisonHarvester()

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

Definition at line 27 of file SiPixelTrackComparisonHarvester.cc.

28  : topFolder_(iConfig.getParameter<std::string>("topFolderName")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~SiPixelTrackComparisonHarvester()

SiPixelTrackComparisonHarvester::~SiPixelTrackComparisonHarvester ( )
overridedefault

Member Function Documentation

◆ dqmEndJob()

void SiPixelTrackComparisonHarvester::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 30 of file SiPixelTrackComparisonHarvester.cc.

References dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), dqm::impl::MonitorElement::divide(), dqm::implementation::IGetter::get(), M_PI, hlt_dqm_clientPB-live_cfg::me, project2DalongDiagonal(), dqm::implementation::NavigatorBase::setCurrentFolder(), and topFolder_.

30  {
31  MonitorElement* hpt_eta_tkAllReference = igetter.get(topFolder_ + "/ptetatrkAllReference");
32  if (hpt_eta_tkAllReference == nullptr) {
33  edm::LogError("SiPixelTrackComparisonHarvester")
34  << "MonitorElement not found: " << topFolder_ << "/ptetatrkAllReference. Skipping.";
35  return;
36  }
37 
38  MonitorElement* hpt_eta_tkAllReferencematched = igetter.get(topFolder_ + "/ptetatrkAllReferencematched");
39  if (hpt_eta_tkAllReferencematched == nullptr) {
40  edm::LogError("SiPixelTrackComparisonHarvester")
41  << "MonitorElement not found: " << topFolder_ << "/ptetatrkAllReferencematched. Skipping.";
42  return;
43  }
44 
45  MonitorElement* hphi_z_tkAllReference = igetter.get(topFolder_ + "/phiztrkAllReference");
46  if (hphi_z_tkAllReference == nullptr) {
47  edm::LogError("SiPixelTrackComparisonHarvester")
48  << "MonitorElement not found: " << topFolder_ << "/phiztrkAllReference. Skipping.";
49  return;
50  }
51 
52  MonitorElement* hphi_z_tkAllReferencematched = igetter.get(topFolder_ + "/phiztrkAllReferencematched");
53  if (hphi_z_tkAllReferencematched == nullptr) {
54  edm::LogError("SiPixelTrackComparisonHarvester")
55  << "MonitorElement not found: " << topFolder_ << "/phiztrkAllReferencematched. Skipping.";
56  return;
57  }
58 
59  ibooker.cd();
61  MonitorElement* hpt_eta_matchRatio = ibooker.book2D(
62  "matchingeff_pt_eta", "Efficiency of track matching; #eta; p_{T} [GeV];", 30, -M_PI, M_PI, 200, 0., 200.);
63  MonitorElement* hphi_z_matchRatio = ibooker.book2D(
64  "matchingeff_phi_z", "Efficiency of track matching; #phi; z [cm];", 30, -M_PI, M_PI, 30, -30., 30.);
65 
66  hpt_eta_matchRatio->divide(hpt_eta_tkAllReferencematched, hpt_eta_tkAllReference, 1., 1., "B");
67  hphi_z_matchRatio->divide(hphi_z_tkAllReferencematched, hphi_z_tkAllReference, 1., 1., "B");
68 
69  // now create the 1D projection from the 2D histograms
70  std::vector<std::string> listOfMEsToProject = {"nTracks",
71  "nLooseAndAboveTracks",
72  "nLooseAndAboveTracks_matched",
73  "nRecHits",
74  "nLayers",
75  "nChi2ndof",
76  "charge",
77  "pt",
78  "curvature",
79  "eta",
80  "phi",
81  "z",
82  "tip"};
83  for (const auto& me : listOfMEsToProject) {
84  MonitorElement* input2D = igetter.get(topFolder_ + "/" + me);
85  edm::LogPrint("SiPixelTrackComparisonHarvester") << "processing " << topFolder_ + "/" + me;
86  this->project2DalongDiagonal(input2D, ibooker);
87  }
88 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
Log< level::Error, false > LogError
void project2DalongDiagonal(MonitorElement *input2D, DQMStore::IBooker &ibooker)
Log< level::Warning, true > LogPrint
#define M_PI
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:221
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual void divide(const MonitorElement *, const MonitorElement *, double, double, const char *)
Replace entries with results of dividing num by denom.

◆ fillDescriptions()

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

◆ project2DalongDiagonal()

void SiPixelTrackComparisonHarvester::project2DalongDiagonal ( MonitorElement input2D,
DQMStore::IBooker ibooker 
)

Definition at line 90 of file SiPixelTrackComparisonHarvester.cc.

References newFWLiteAna::bin, dqm::implementation::IBooker::book1D(), dqm::implementation::NavigatorBase::cd(), f, dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::getAxisMax(), dqm::impl::MonitorElement::getAxisMin(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getName(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), dqm::impl::MonitorElement::getTitle(), mps_fire::i, dqmiolumiharvest::j, LaserClient_cfi::nbins, dqm::impl::MonitorElement::setBinError(), dqm::implementation::NavigatorBase::setCurrentFolder(), and topFolder_.

Referenced by dqmEndJob().

90  {
91  if (input2D == nullptr) {
92  edm::LogError("SiPixelTrackComparisonHarvester")
93  << "ME needed for diagonal projection is not found in the input file at" << topFolder_ << ". Skipping.";
94  return;
95  }
96 
97  ibooker.cd();
98  ibooker.setCurrentFolder(topFolder_ + "/projectedDifferences");
99  const auto& h_name = fmt::sprintf("%s_proj", input2D->getName());
100  const auto& h_title = fmt::sprintf(";%s CPU -GPU difference", input2D->getTitle());
101  const auto& span = (input2D->getAxisMax() - input2D->getAxisMin());
102  const auto& b_w = span / input2D->getNbinsX();
103  const auto& nbins = ((input2D->getNbinsX() % 2) == 0) ? input2D->getNbinsX() + 1 : input2D->getNbinsX();
104 
105  MonitorElement* diagonalized = ibooker.book1D(h_name, h_title, nbins, -span / 2., span / 2.);
106 
107  // collect all the entry on each diagonal of the 2D histogram
108  for (int i = 1; i <= input2D->getNbinsX(); i++) {
109  for (int j = 1; j <= input2D->getNbinsY(); j++) {
110  diagonalized->Fill((i - j) * b_w, input2D->getBinContent(i, j));
111  }
112  }
113 
114  // zero the error on the bin as it's sort of meaningless for the way we fill it
115  // by collecting the entry on each diagonal
116  for (int bin = 1; bin <= diagonalized->getNbinsX(); bin++) {
117  diagonalized->setBinError(bin, 0.f);
118  }
119 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
Log< level::Error, false > LogError
void Fill(long long x)
double f[11][100]
virtual int getNbinsY() const
get # of bins in Y-axis
virtual std::string getTitle() const
get MonitorElement title
virtual double getAxisMin(int axis=1) const
const std::string & getName() const
get name of ME
virtual double getAxisMax(int axis=1) const
virtual int getNbinsX() const
get # of bins in X-axis
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual double getBinContent(int binx) const
get content of bin (1-D)

Member Data Documentation

◆ topFolder_

const std::string SiPixelTrackComparisonHarvester::topFolder_
private

Definition at line 24 of file SiPixelTrackComparisonHarvester.cc.

Referenced by dqmEndJob(), and project2DalongDiagonal().