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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void printInfo (const RPAlignmentCorrectionsData &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 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 51 of file CTPPSAlignmentInfo.cc.

51  :
52  alignmentType_ ( iConfig.getUntrackedParameter<std::string>( "alignmentType", "real" ) )
53 {
54 }
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 58 of file CTPPSAlignmentInfo.cc.

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

59 {
61 
62  if ( alignmentType_ == "real" )
63  {
64  if ( watcherRealAlignments_.check( iSetup ) )
65  {
66  iSetup.get<RPRealAlignmentRecord>().get( alignments );
67  printInfo(*alignments, iEvent);
68  }
69  return;
70  }
71 
72  else if ( alignmentType_ == "misaligned" )
73  {
74  if ( watcherMisalignedAlignments_.check( iSetup ) )
75  {
76  iSetup.get<RPMisalignedAlignmentRecord>().get( alignments );
77  printInfo(*alignments, iEvent);
78  }
79  return;
80  }
81 
82  throw cms::Exception("CTPPSAlignmentInfo") << "Unknown geometry type: `" << alignmentType_ << "'.";
83 }
edm::ESWatcher< RPMisalignedAlignmentRecord > watcherMisalignedAlignments_
const T & get() const
Definition: EventSetup.h:59
edm::ESWatcher< RPRealAlignmentRecord > watcherRealAlignments_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
void printInfo(const RPAlignmentCorrectionsData &alignments, const edm::Event &event) const
void CTPPSAlignmentInfo::printInfo ( const RPAlignmentCorrectionsData alignments,
const edm::Event event 
) const
private

Definition at line 87 of file CTPPSAlignmentInfo.cc.

References alignmentType_, and DEFINE_FWK_MODULE.

Referenced by analyze().

88 {
89  time_t unixTime = event.time().unixTime();
90  char timeStr[50];
91  strftime( timeStr, 50, "%F %T", localtime( &unixTime ) );
92 
93  edm::LogInfo("CTPPSAlignmentInfo")
94  << "New " << alignmentType_ << " alignments found in run="
95  << event.id().run() << ", event=" << event.id().event() << ", UNIX timestamp=" << unixTime
96  << " (" << timeStr << "):\n"
97  << alignments;
98 }

Member Data Documentation

std::string CTPPSAlignmentInfo::alignmentType_
private

Definition at line 33 of file CTPPSAlignmentInfo.cc.

Referenced by analyze(), and printInfo().

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

Definition at line 36 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().

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

Definition at line 35 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().