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
 
- 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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<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)
 

Detailed Description

Class to print out information on current geometry.

Definition at line 27 of file CTPPSAlignmentInfo.cc.

Constructor & Destructor Documentation

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

Definition at line 50 of file CTPPSAlignmentInfo.cc.

51  : alignmentType_(iConfig.getUntrackedParameter<std::string>("alignmentType", "real")) {}
T getUntrackedParameter(std::string const &, T const &) const

Member Function Documentation

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

Definition at line 55 of file CTPPSAlignmentInfo.cc.

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

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_ << "'.";
75 }
edm::ESWatcher< RPMisalignedAlignmentRecord > watcherMisalignedAlignments_
void printInfo(const CTPPSRPAlignmentCorrectionsData &alignments, const edm::Event &event) const
edm::ESWatcher< RPRealAlignmentRecord > watcherRealAlignments_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
T get() const
Definition: EventSetup.h:73
void CTPPSAlignmentInfo::printInfo ( const CTPPSRPAlignmentCorrectionsData alignments,
const edm::Event event 
) const
private

Definition at line 79 of file CTPPSAlignmentInfo.cc.

References alignmentType_, and DEFINE_FWK_MODULE.

Referenced by analyze().

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;
88 }

Member Data Documentation

std::string CTPPSAlignmentInfo::alignmentType_
private

Definition at line 32 of file CTPPSAlignmentInfo.cc.

Referenced by analyze(), and printInfo().

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

Definition at line 35 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().

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

Definition at line 34 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().