CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
CTPPSLHCInfoPlotter Class Reference
Inheritance diagram for CTPPSLHCInfoPlotter:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 CTPPSLHCInfoPlotter (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void endJob () override
 

Private Attributes

TH2D * h2_betaStar_vs_xangle_
 
TH1D * h_beamEnergy_
 
TH1D * h_betaStar_
 
TH1D * h_fill_
 
TH1D * h_run_
 
TH1D * h_xangle_
 
edm::ESGetToken< LHCInfo, LHCInfoRcdlhcInfoESToken_
 
std::string outputFile_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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)
 

Detailed Description

Definition at line 23 of file CTPPSLHCInfoPlotter.cc.

Constructor & Destructor Documentation

◆ CTPPSLHCInfoPlotter()

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

Definition at line 53 of file CTPPSLHCInfoPlotter.cc.

54  : lhcInfoESToken_(esConsumes(ESInputTag("", iConfig.getParameter<std::string>("lhcInfoLabel")))),
55  outputFile_(iConfig.getParameter<string>("outputFile")),
56 
57  h_beamEnergy_(new TH1D("h_beamEnergy", ";beam energy (GeV)", 81, -50., 8050.)),
58  h_xangle_(new TH1D("h_xangle", ";(half) crossing angle (#murad)", 201, -0.5, 200.5)),
59  h_betaStar_(new TH1D("h_betaStar", ";#beta^{*} (m)", 101, -0.005, 1.005)),
60  h2_betaStar_vs_xangle_(new TH2D("h2_betaStar_vs_xangle",
61  ";(half) crossing angle (#murad);#beta^{*} (m)",
62  201,
63  -0.5,
64  200.5,
65  101,
66  -0.005,
67  1.005)),
68 
69  h_fill_(new TH1D("h_fill", ";fill", 4001, 3999.5, 8000.5)),
70  h_run_(new TH1D("h_run", ";run", 6000, 270E3, 330E3)) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoESToken_

Member Function Documentation

◆ analyze()

void CTPPSLHCInfoPlotter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 85 of file CTPPSLHCInfoPlotter.cc.

References edm::EventSetup::getData(), h2_betaStar_vs_xangle_, h_beamEnergy_, h_betaStar_, h_fill_, h_run_, h_xangle_, iEvent, and lhcInfoESToken_.

85  {
86  const auto &lhcInfo = iSetup.getData(lhcInfoESToken_);
87 
88  h_beamEnergy_->Fill(lhcInfo.energy());
89  h_xangle_->Fill(lhcInfo.crossingAngle());
90  h_betaStar_->Fill(lhcInfo.betaStar());
91  h2_betaStar_vs_xangle_->Fill(lhcInfo.crossingAngle(), lhcInfo.betaStar());
92 
93  h_fill_->Fill(lhcInfo.fillNumber());
94  h_run_->Fill(iEvent.id().run());
95 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
int iEvent
Definition: GenABIO.cc:224
edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoESToken_

◆ endJob()

void CTPPSLHCInfoPlotter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 99 of file CTPPSLHCInfoPlotter.cc.

References h2_betaStar_vs_xangle_, h_beamEnergy_, h_betaStar_, h_fill_, h_run_, h_xangle_, and outputFile_.

99  {
100  auto f_out = std::make_unique<TFile>(outputFile_.c_str(), "recreate");
101 
102  h_beamEnergy_->Write();
103  h_xangle_->Write();
104  h_betaStar_->Write();
105  h2_betaStar_vs_xangle_->Write();
106 
107  h_fill_->Write();
108  h_run_->Write();
109 }

◆ fillDescriptions()

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

Definition at line 74 of file CTPPSLHCInfoPlotter.cc.

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

74  {
76 
77  desc.add<std::string>("lhcInfoLabel", "")->setComment("label of the LHCInfo record");
78  desc.add<std::string>("outputFile", "")->setComment("output file");
79 
80  descriptions.add("ctppsLHCInfoPlotter", desc);
81 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ h2_betaStar_vs_xangle_

TH2D* CTPPSLHCInfoPlotter::h2_betaStar_vs_xangle_
private

Definition at line 40 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_beamEnergy_

TH1D* CTPPSLHCInfoPlotter::h_beamEnergy_
private

Definition at line 37 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_betaStar_

TH1D* CTPPSLHCInfoPlotter::h_betaStar_
private

Definition at line 39 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_fill_

TH1D* CTPPSLHCInfoPlotter::h_fill_
private

Definition at line 42 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_run_

TH1D* CTPPSLHCInfoPlotter::h_run_
private

Definition at line 43 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_xangle_

TH1D* CTPPSLHCInfoPlotter::h_xangle_
private

Definition at line 38 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ lhcInfoESToken_

edm::ESGetToken<LHCInfo, LHCInfoRcd> CTPPSLHCInfoPlotter::lhcInfoESToken_
private

Definition at line 33 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze().

◆ outputFile_

std::string CTPPSLHCInfoPlotter::outputFile_
private

Definition at line 35 of file CTPPSLHCInfoPlotter.cc.

Referenced by endJob().