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
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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::vector< ModuleDescription const * > &modules, 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
 
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

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 49 of file CTPPSAlignmentInfo.cc.

51  : 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 54 of file CTPPSAlignmentInfo.cc.

55  {
57 
58  if (alignmentType_ == "real") {
59  if (watcherRealAlignments_.check(iSetup)) {
60  iSetup.get<RPRealAlignmentRecord>().get(alignments);
61  printInfo(*alignments, iEvent);
62  }
63  return;
64  }
65 
66  else if (alignmentType_ == "misaligned") {
67  if (watcherMisalignedAlignments_.check(iSetup)) {
68  iSetup.get<RPMisalignedAlignmentRecord>().get(alignments);
69  printInfo(*alignments, iEvent);
70  }
71  return;
72  }
73 
74  throw cms::Exception("CTPPSAlignmentInfo") << "Unknown geometry type: `" << alignmentType_ << "'.";

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

◆ printInfo()

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

Definition at line 78 of file CTPPSAlignmentInfo.cc.

79  {
80  time_t unixTime = event.time().unixTime();
81  char timeStr[50];
82  strftime(timeStr, 50, "%F %T", localtime(&unixTime));
83 
84  edm::LogInfo("CTPPSAlignmentInfo") << "New " << alignmentType_ << " alignments found in run=" << event.id().run()
85  << ", event=" << event.id().event() << ", UNIX timestamp=" << unixTime << " ("
86  << timeStr << "):\n"
87  << alignments;

References alignmentType_.

Referenced by analyze().

Member Data Documentation

◆ 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:52
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
RPMisalignedAlignmentRecord
Definition: RPMisalignedAlignmentRecord.h:6
RPRealAlignmentRecord
Definition: RPRealAlignmentRecord.h:6
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
edm::ESHandle
Definition: DTSurvey.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
Exception
Definition: hltDiff.cc:246
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:78
CTPPSAlignmentInfo::watcherRealAlignments_
edm::ESWatcher< RPRealAlignmentRecord > watcherRealAlignments_
Definition: CTPPSAlignmentInfo.cc:37