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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
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::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_
 
const edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcdlhcInfoPerFillToken_
 
const edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcdlhcInfoPerLSToken_
 
const edm::ESGetToken< LHCInfo, LHCInfoRcdlhcInfoToken_
 
std::string outputFile_
 
const bool useNewLHCInfo_
 

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 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 22 of file CTPPSLHCInfoPlotter.cc.

Constructor & Destructor Documentation

◆ CTPPSLHCInfoPlotter()

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

Definition at line 55 of file CTPPSLHCInfoPlotter.cc.

56  : lhcInfoToken_(esConsumes(ESInputTag("", iConfig.getParameter<std::string>("lhcInfoLabel")))),
57  lhcInfoPerLSToken_(esConsumes(ESInputTag("", iConfig.getParameter<std::string>("lhcInfoPerLSLabel")))),
58  lhcInfoPerFillToken_(esConsumes(ESInputTag("", iConfig.getParameter<std::string>("lhcInfoPerFillLabel")))),
59  useNewLHCInfo_(iConfig.getParameter<bool>("useNewLHCInfo")),
60  outputFile_(iConfig.getParameter<string>("outputFile")),
61 
62  h_beamEnergy_(new TH1D("h_beamEnergy", ";beam energy (GeV)", 81, -50., 8050.)),
63  h_xangle_(new TH1D("h_xangle", ";(half) crossing angle (#murad)", 201, -0.5, 200.5)),
64  h_betaStar_(new TH1D("h_betaStar", ";#beta^{*} (m)", 101, -0.005, 1.005)),
65  h2_betaStar_vs_xangle_(new TH2D("h2_betaStar_vs_xangle",
66  ";(half) crossing angle (#murad);#beta^{*} (m)",
67  201,
68  -0.5,
69  200.5,
70  101,
71  -0.005,
72  1.005)),
73 
74  h_fill_(new TH1D("h_fill", ";fill", 6001, 3999.5, 10000.5)),
75  h_run_(new TH1D("h_run", ";run", 6000, 270E3, 430E3)) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcd > lhcInfoPerLSToken_
const edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoToken_
const edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > lhcInfoPerFillToken_

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 94 of file CTPPSLHCInfoPlotter.cc.

References LHCInfoCombined::betaStarX, LHCInfoCombined::crossingAngle(), LHCInfoCombined::energy, LHCInfoCombined::fillNumber, h2_betaStar_vs_xangle_, h_beamEnergy_, h_betaStar_, h_fill_, h_run_, h_xangle_, iEvent, lhcInfoPerFillToken_, lhcInfoPerLSToken_, lhcInfoToken_, and useNewLHCInfo_.

94  {
96 
97  h_beamEnergy_->Fill(lhcInfoCombined.energy);
98  h_xangle_->Fill(lhcInfoCombined.crossingAngle());
99  h_betaStar_->Fill(lhcInfoCombined.betaStarX); //adjust accordingly to run period
100  // h_betaStar_->Fill(lhcInfoCombined.betaStarY);
101  h2_betaStar_vs_xangle_->Fill(lhcInfoCombined.crossingAngle(),
102  lhcInfoCombined.betaStarX); //adjust accordingly to run period
103  // h2_betaStar_vs_xangle_->Fill(lhcInfoCombined.crossingAngle(), lhcInfoCombined.betaStarY);
104 
105  h_fill_->Fill(lhcInfoCombined.fillNumber);
106  h_run_->Fill(iEvent.id().run());
107 }
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcd > lhcInfoPerLSToken_
const edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoToken_
const edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > lhcInfoPerFillToken_

◆ endJob()

void CTPPSLHCInfoPlotter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 111 of file CTPPSLHCInfoPlotter.cc.

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

111  {
112  auto f_out = std::make_unique<TFile>(outputFile_.c_str(), "recreate");
113 
114  h_beamEnergy_->Write();
115  h_xangle_->Write();
116  h_betaStar_->Write();
117  h2_betaStar_vs_xangle_->Write();
118 
119  h_fill_->Write();
120  h_run_->Write();
121 }

◆ fillDescriptions()

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

Definition at line 79 of file CTPPSLHCInfoPlotter.cc.

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

79  {
81 
82  desc.add<std::string>("lhcInfoLabel", "")->setComment("label of the LHCInfo record");
83  desc.add<std::string>("lhcInfoPerLSLabel", "")->setComment("label of the LHCInfoPerLS record");
84  desc.add<std::string>("lhcInfoPerFillLabel", "")->setComment("label of the LHCInfoPerFill record");
85  desc.add<bool>("useNewLHCInfo", false)->setComment("flag whether to use new LHCInfoPer* records or old LHCInfo");
86 
87  desc.add<std::string>("outputFile", "")->setComment("output file");
88 
89  descriptions.add("ctppsLHCInfoPlotterDefault", desc);
90 }
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 42 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_beamEnergy_

TH1D* CTPPSLHCInfoPlotter::h_beamEnergy_
private

Definition at line 39 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_betaStar_

TH1D* CTPPSLHCInfoPlotter::h_betaStar_
private

Definition at line 41 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_fill_

TH1D* CTPPSLHCInfoPlotter::h_fill_
private

Definition at line 44 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_run_

TH1D* CTPPSLHCInfoPlotter::h_run_
private

Definition at line 45 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_xangle_

TH1D* CTPPSLHCInfoPlotter::h_xangle_
private

Definition at line 40 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze(), and endJob().

◆ lhcInfoPerFillToken_

const edm::ESGetToken<LHCInfoPerFill, LHCInfoPerFillRcd> CTPPSLHCInfoPlotter::lhcInfoPerFillToken_
private

Definition at line 34 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze().

◆ lhcInfoPerLSToken_

const edm::ESGetToken<LHCInfoPerLS, LHCInfoPerLSRcd> CTPPSLHCInfoPlotter::lhcInfoPerLSToken_
private

Definition at line 33 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze().

◆ lhcInfoToken_

const edm::ESGetToken<LHCInfo, LHCInfoRcd> CTPPSLHCInfoPlotter::lhcInfoToken_
private

Definition at line 32 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze().

◆ outputFile_

std::string CTPPSLHCInfoPlotter::outputFile_
private

Definition at line 37 of file CTPPSLHCInfoPlotter.cc.

Referenced by endJob().

◆ useNewLHCInfo_

const bool CTPPSLHCInfoPlotter::useNewLHCInfo_
private

Definition at line 35 of file CTPPSLHCInfoPlotter.cc.

Referenced by analyze().