CMS 3D CMS Logo

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

Class to print out information on current geometry. More...

Inheritance diagram for CTPPSAlignmentInfo:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 CTPPSAlignmentInfo (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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void printInfo (const CTPPSRPAlignmentCorrectionsData &alignments, const edm::Event &event) const
 

Private Attributes

edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecordalignmentToken_
 
std::string alignmentType_
 
edm::ESWatcher< RPMisalignedAlignmentRecordwatcherMisalignedAlignments_
 
edm::ESWatcher< RPRealAlignmentRecordwatcherRealAlignments_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Class to print out information on current geometry.

Definition at line 26 of file CTPPSAlignmentInfo.cc.

Constructor & Destructor Documentation

◆ CTPPSAlignmentInfo()

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

Definition at line 42 of file CTPPSAlignmentInfo.cc.

44  : alignmentType_(iConfig.getUntrackedParameter<std::string>("alignmentType", "real")),

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 48 of file CTPPSAlignmentInfo.cc.

49  {
50  if (alignmentType_ == "real") {
51  if (watcherRealAlignments_.check(iSetup)) {
52  auto const& alignments = iSetup.getData(alignmentToken_);
53  printInfo(alignments, iEvent);
54  }
55  return;
56  }
57 
58  else if (alignmentType_ == "misaligned") {
59  if (watcherMisalignedAlignments_.check(iSetup)) {
60  auto const& alignments = iSetup.getData(alignmentToken_);
61  printInfo(alignments, iEvent);
62  }
63  return;
64  }
65 
66  throw cms::Exception("CTPPSAlignmentInfo") << "Unknown geometry type: `" << alignmentType_ << "'.";

References alignmentToken_, alignmentType_, edm::ESWatcher< T >::check(), Exception, edm::EventSetup::getData(), iEvent, printInfo(), watcherMisalignedAlignments_, and watcherRealAlignments_.

◆ printInfo()

void CTPPSAlignmentInfo::printInfo ( const CTPPSRPAlignmentCorrectionsData alignments,
const edm::Event event 
) const
private

Definition at line 70 of file CTPPSAlignmentInfo.cc.

71  {
72  time_t unixTime = event.time().unixTime();
73  char timeStr[50];
74  strftime(timeStr, 50, "%F %T", localtime(&unixTime));
75 
76  edm::LogInfo("CTPPSAlignmentInfo") << "New " << alignmentType_ << " alignments found in run=" << event.id().run()
77  << ", event=" << event.id().event() << ", UNIX timestamp=" << unixTime << " ("
78  << timeStr << "):\n"
79  << alignments;

References alignmentType_.

Referenced by analyze().

Member Data Documentation

◆ alignmentToken_

edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord> CTPPSAlignmentInfo::alignmentToken_
private

Definition at line 39 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().

◆ alignmentType_

std::string CTPPSAlignmentInfo::alignmentType_
private

Definition at line 35 of file CTPPSAlignmentInfo.cc.

Referenced by analyze(), and printInfo().

◆ watcherMisalignedAlignments_

edm::ESWatcher<RPMisalignedAlignmentRecord> CTPPSAlignmentInfo::watcherMisalignedAlignments_
private

Definition at line 38 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().

◆ watcherRealAlignments_

edm::ESWatcher<RPRealAlignmentRecord> CTPPSAlignmentInfo::watcherRealAlignments_
private

Definition at line 37 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
CTPPSAlignmentInfo::alignmentType_
std::string alignmentType_
Definition: CTPPSAlignmentInfo.cc:35
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
iEvent
int iEvent
Definition: GenABIO.cc:224
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
Exception
Definition: hltDiff.cc:245
CTPPSAlignmentInfo::watcherMisalignedAlignments_
edm::ESWatcher< RPMisalignedAlignmentRecord > watcherMisalignedAlignments_
Definition: CTPPSAlignmentInfo.cc:38
CTPPSAlignmentInfo::printInfo
void printInfo(const CTPPSRPAlignmentCorrectionsData &alignments, const edm::Event &event) const
Definition: CTPPSAlignmentInfo.cc:70
CTPPSAlignmentInfo::watcherRealAlignments_
edm::ESWatcher< RPRealAlignmentRecord > watcherRealAlignments_
Definition: CTPPSAlignmentInfo.cc:37
CTPPSAlignmentInfo::alignmentToken_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > alignmentToken_
Definition: CTPPSAlignmentInfo.cc:39