CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
SiPixelBarycenter Class Reference

#include <SiPixelBarycenter.h>

Inheritance diagram for SiPixelBarycenter:
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

 SiPixelBarycenter (const edm::ParameterSet &conf)
 
 ~SiPixelBarycenter () 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 &)
 
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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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)
 

Protected Member Functions

void beginRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
void dqmEndJob (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
 
void dqmEndRun (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, edm::Run const &iRun, edm::EventSetup const &c) override
 
- 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)
 

Private Member Functions

void bookBarycenterHistograms (DQMStore::IBooker &iBooker)
 
void fillBarycenterHistograms (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::vector< AlignTransform > &input, const std::vector< AlignTransform > &GPR, const TrackerTopology &tTopo)
 

Private Attributes

const edm::ESGetToken< Alignments, TrackerAlignmentRcdalignmentToken_
 
std::map< std::string, MonitorElement * > barycenters_
 
const edm::ESGetToken< Alignments, GlobalPositionRcdgprToken_
 
const std::array< std::string, 9 > subdetectors_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtrackerTopologyToken_
 

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
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Description: Barycenter plot generation for the Phase 1 pixel

Usage: <usage>

Definition at line 37 of file SiPixelBarycenter.h.

Constructor & Destructor Documentation

◆ SiPixelBarycenter()

SiPixelBarycenter::SiPixelBarycenter ( const edm::ParameterSet conf)
explicit

Definition at line 28 of file SiPixelBarycenter.cc.

References edm::EndRun.

29  : DQMEDHarvester(iConfig),
30  alignmentToken_(esConsumes<edm::Transition::EndRun>()),
31  gprToken_(esConsumes<edm::Transition::EndRun>()),
32  trackerTopologyToken_(esConsumes<edm::Transition::EndRun>()) {
33  LogInfo("PixelDQM") << "SiPixelBarycenter::SiPixelBarycenter: Got DQM BackEnd interface" << endl;
34 }
const edm::ESGetToken< Alignments, GlobalPositionRcd > gprToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Log< level::Info, false > LogInfo
const edm::ESGetToken< Alignments, TrackerAlignmentRcd > alignmentToken_

◆ ~SiPixelBarycenter()

SiPixelBarycenter::~SiPixelBarycenter ( )
overridedefault

Member Function Documentation

◆ beginRun()

void SiPixelBarycenter::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 36 of file SiPixelBarycenter.cc.

36 {}

◆ bookBarycenterHistograms()

void SiPixelBarycenter::bookBarycenterHistograms ( DQMStore::IBooker iBooker)
private

Definition at line 55 of file SiPixelBarycenter.cc.

References barycenters_, dqm::implementation::IBooker::book1D(), dqm::implementation::NavigatorBase::cd(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, subdetector, and subdetectors_.

Referenced by dqmEndRun().

55  {
56  iBooker.cd();
57 
58  iBooker.setCurrentFolder("PixelPhase1/Barycenter");
59  //Book one histogram for each subdetector
60  for (const std::string& subdetector : subdetectors_) {
62  iBooker.book1D("barycenters_" + subdetector,
63  "Position of the barycenter for " + subdetector + ";Coordinate;Position [mm]",
64  3,
65  0.5,
66  3.5);
67  barycenters_[subdetector]->setBinLabel(1, "x");
68  barycenters_[subdetector]->setBinLabel(2, "y");
69  barycenters_[subdetector]->setBinLabel(3, "z");
70  }
71 
72  //Reset the iBooker
73  iBooker.setCurrentFolder("PixelPhase1/");
74 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
TString subdetector
const std::array< std::string, 9 > subdetectors_
std::map< std::string, MonitorElement * > barycenters_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ dqmEndJob()

void SiPixelBarycenter::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 38 of file SiPixelBarycenter.cc.

38 {}

◆ dqmEndRun()

void SiPixelBarycenter::dqmEndRun ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
edm::Run const &  iRun,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 40 of file SiPixelBarycenter.cc.

References alignmentToken_, bookBarycenterHistograms(), c, fillBarycenterHistograms(), gprToken_, Alignments::m_align, and trackerTopologyToken_.

43  {
44  bookBarycenterHistograms(iBooker);
45 
46  const Alignments* alignments = &c.getData(alignmentToken_);
47  const Alignments* gpr = &c.getData(gprToken_);
48  const TrackerTopology* tTopo = &c.getData(trackerTopologyToken_);
49 
50  fillBarycenterHistograms(iBooker, iGetter, alignments->m_align, gpr->m_align, *tTopo);
51 }
const edm::ESGetToken< Alignments, GlobalPositionRcd > gprToken_
void fillBarycenterHistograms(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::vector< AlignTransform > &input, const std::vector< AlignTransform > &GPR, const TrackerTopology &tTopo)
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
const edm::ESGetToken< Alignments, TrackerAlignmentRcd > alignmentToken_
void bookBarycenterHistograms(DQMStore::IBooker &iBooker)

◆ fillBarycenterHistograms()

void SiPixelBarycenter::fillBarycenterHistograms ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::vector< AlignTransform > &  input,
const std::vector< AlignTransform > &  GPR,
const TrackerTopology tTopo 
)
private

Definition at line 79 of file SiPixelBarycenter.cc.

References barycenters_, DQMBarycenter::TkAlBarycenters::computeBarycenters(), DQMBarycenter::TkAlBarycenters::getX(), DQMBarycenter::TkAlBarycenters::getY(), DQMBarycenter::TkAlBarycenters::getZ(), mps_fire::i, input, subdetectors_, DQMBarycenter::t_x, DQMBarycenter::t_y, and DQMBarycenter::t_z.

Referenced by dqmEndRun().

83  {
84  const auto GPR_translation_pixel = GPR[0].translation();
85  const std::map<DQMBarycenter::coordinate, float> GPR_pixel = {{DQMBarycenter::t_x, GPR_translation_pixel.x()},
86  {DQMBarycenter::t_y, GPR_translation_pixel.y()},
87  {DQMBarycenter::t_z, GPR_translation_pixel.z()}};
88 
90  barycenters.computeBarycenters(input, tTopo, GPR_pixel);
91 
92  auto Xbarycenters = barycenters.getX();
93  auto Ybarycenters = barycenters.getY();
94  auto Zbarycenters = barycenters.getZ();
95 
96  //Fill histogram for each subdetector
97  for (std::size_t i = 0; i < subdetectors_.size(); ++i) {
98  barycenters_[subdetectors_[i]]->setBinContent(1, Xbarycenters[i]);
99  barycenters_[subdetectors_[i]]->setBinContent(2, Ybarycenters[i]);
100  barycenters_[subdetectors_[i]]->setBinContent(3, Zbarycenters[i]);
101 
102  // zero the errors for better comparison display
103  barycenters_[subdetectors_[i]]->setBinError(1, 0.);
104  barycenters_[subdetectors_[i]]->setBinError(2, 0.);
105  barycenters_[subdetectors_[i]]->setBinError(3, 0.);
106  }
107 }
const std::array< double, 9 > getY()
static std::string const input
Definition: EdmProvDump.cc:50
const std::array< std::string, 9 > subdetectors_
void computeBarycenters(const std::vector< AlignTransform > &input, const TrackerTopology &tTopo, const std::map< DQMBarycenter::coordinate, float > &GPR)
std::map< std::string, MonitorElement * > barycenters_
const std::array< double, 9 > getZ()
const std::array< double, 9 > getX()

Member Data Documentation

◆ alignmentToken_

const edm::ESGetToken<Alignments, TrackerAlignmentRcd> SiPixelBarycenter::alignmentToken_
private

Definition at line 52 of file SiPixelBarycenter.h.

Referenced by dqmEndRun().

◆ barycenters_

std::map<std::string, MonitorElement*> SiPixelBarycenter::barycenters_
private

Definition at line 56 of file SiPixelBarycenter.h.

Referenced by bookBarycenterHistograms(), and fillBarycenterHistograms().

◆ gprToken_

const edm::ESGetToken<Alignments, GlobalPositionRcd> SiPixelBarycenter::gprToken_
private

Definition at line 53 of file SiPixelBarycenter.h.

Referenced by dqmEndRun().

◆ subdetectors_

const std::array<std::string, 9> SiPixelBarycenter::subdetectors_
private
Initial value:
= {
{"BPIX", "FPIX_zm", "FPIX_zp", "BPIX_xp", "BPIX_xm", "FPIX_zp_xp", "FPIX_zm_xp", "FPIX_zp_xm", "FPIX_zm_xm"}}

Definition at line 58 of file SiPixelBarycenter.h.

Referenced by bookBarycenterHistograms(), and fillBarycenterHistograms().

◆ trackerTopologyToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiPixelBarycenter::trackerTopologyToken_
private

Definition at line 54 of file SiPixelBarycenter.h.

Referenced by dqmEndRun().