CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edmtest::AlignPCLThresholdsReader Class Reference
Inheritance diagram for edmtest::AlignPCLThresholdsReader:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 AlignPCLThresholdsReader (edm::ParameterSet const &p)
 
 ~AlignPCLThresholdsReader () override
 
- 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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)
 

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 &e, const edm::EventSetup &c) override
 

Private Attributes

const std::string formatedOutput_
 
const bool printdebug_
 
const edm::ESGetToken
< AlignPCLThresholds,
AlignPCLThresholdsRcd
thresholdToken_
 

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 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<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 12 of file AlignPCLThresholdsReader.cc.

Constructor & Destructor Documentation

edmtest::AlignPCLThresholdsReader::AlignPCLThresholdsReader ( edm::ParameterSet const &  p)
explicit

Definition at line 28 of file AlignPCLThresholdsReader.cc.

30  printdebug_(p.getUntrackedParameter<bool>("printDebug", true)),
31  formatedOutput_(p.getUntrackedParameter<std::string>("outputFile", "")) {
32  edm::LogInfo("AlignPCLThresholdsReader") << "AlignPCLThresholdsReader" << std::endl;
33  }
const edm::ESGetToken< AlignPCLThresholds, AlignPCLThresholdsRcd > thresholdToken_
Log< level::Info, false > LogInfo
edmtest::AlignPCLThresholdsReader::~AlignPCLThresholdsReader ( )
override

Definition at line 35 of file AlignPCLThresholdsReader.cc.

35  {
36  edm::LogInfo("AlignPCLThresholdsReader") << "~AlignPCLThresholdsReader " << std::endl;
37  }
Log< level::Info, false > LogInfo

Member Function Documentation

void edmtest::AlignPCLThresholdsReader::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 39 of file AlignPCLThresholdsReader.cc.

References edm::EventID::event(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), formatedOutput_, AlignPCLThresholds::getExtraDOFCutsForAlignable(), AlignPCLThresholds::getExtraDOFLabelForAlignable(), edm::EventSetup::getHandle(), AlignPCLThresholds::getNrecords(), AlignPCLThresholds::getThreshold_Map(), edm::EventBase::id(), edm::ESHandleBase::isValid(), dqmiolumiharvest::j, AlignPCLThresholds::printAll(), printdebug_, edm::ESHandle< class >::product(), edm::EventID::run(), AlignPCLThresholds::size(), lowPtGsfElectronSeeds_cfi::thresholds(), thresholdToken_, and edm::eventsetup::EventSetupRecordKey::type().

39  {
40  edm::LogInfo("AlignPCLThresholdsReader") << "### AlignPCLThresholdsReader::analyze ###" << std::endl;
41  edm::LogInfo("AlignPCLThresholdsReader") << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
42  edm::LogInfo("AlignPCLThresholdsReader") << " ---EVENT NUMBER " << e.id().event() << std::endl;
43 
46 
47  if (recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
48  //record not found
49  edm::LogInfo("AlignPCLThresholdsReader") << "Record \"AlignPCLThresholdsRcd"
50  << "\" does not exist " << std::endl;
51  }
52 
53  //this part gets the handle of the event source and the record (i.e. the Database)
54  edm::ESHandle<AlignPCLThresholds> thresholdHandle = context.getHandle(thresholdToken_);
55  edm::LogInfo("AlignPCLThresholdsReader") << "got eshandle" << std::endl;
56 
57  if (!thresholdHandle.isValid()) {
58  edm::LogError("AlignPCLThresholdsReader") << " Could not get Handle" << std::endl;
59  return;
60  }
61 
62  const AlignPCLThresholds* thresholds = thresholdHandle.product();
63  edm::LogInfo("AlignPCLThresholdsReader") << "got AlignPCLThresholds* " << std::endl;
64  edm::LogInfo("AlignPCLThresholdsReader") << "print pointer address : ";
65  edm::LogInfo("AlignPCLThresholdsReader") << thresholds << std::endl;
66 
67  edm::LogInfo("AlignPCLThresholdsReader") << "Size " << thresholds->size() << std::endl;
68  edm::LogInfo("AlignPCLThresholdsReader") << "Content of myThresholds " << std::endl;
69  // use built-in method in the CondFormat to print the content
70  if (printdebug_) {
71  thresholds->printAll();
72  }
73 
74  FILE* pFile = nullptr;
75  if (!formatedOutput_.empty())
76  pFile = fopen(formatedOutput_.c_str(), "w");
77  if (pFile) {
78  fprintf(pFile, "AlignPCLThresholds::printAll() \n");
79  fprintf(pFile,
80  " ======================================================================================================="
81  "============ \n");
82  fprintf(pFile, "N records cut: %i \n", thresholds->getNrecords());
83 
84  AlignPCLThresholds::threshold_map m_thresholds = thresholds->getThreshold_Map();
85 
86  for (auto it = m_thresholds.begin(); it != m_thresholds.end(); ++it) {
87  fprintf(pFile,
88  " ====================================================================================================="
89  "============== \n");
90  fprintf(pFile, "key : %s \n ", (it->first).c_str());
91  fprintf(pFile, "- Xcut : %8.3f um ", (it->second).getXcut());
92  fprintf(pFile, "| sigXcut : %8.3f ", (it->second).getSigXcut());
93  fprintf(pFile, "| maxMoveXcut : %8.3f um ", (it->second).getMaxMoveXcut());
94  fprintf(pFile, "| ErrorXcut : %8.3f um\n ", (it->second).getErrorXcut());
95 
96  fprintf(pFile, "- thetaXcut : %8.3f urad ", (it->second).getThetaXcut());
97  fprintf(pFile, "| sigThetaXcut : %8.3f ", (it->second).getSigThetaXcut());
98  fprintf(pFile, "| maxMoveThetaXcut : %8.3f urad ", (it->second).getMaxMoveThetaXcut());
99  fprintf(pFile, "| ErrorThetaXcut : %8.3f urad\n ", (it->second).getErrorThetaXcut());
100 
101  fprintf(pFile, "- Ycut : %8.3f um ", (it->second).getYcut());
102  fprintf(pFile, "| sigYcut : %8.3f ", (it->second).getSigXcut());
103  fprintf(pFile, "| maxMoveYcut : %8.3f um ", (it->second).getMaxMoveYcut());
104  fprintf(pFile, "| ErrorYcut : %8.3f um\n ", (it->second).getErrorYcut());
105 
106  fprintf(pFile, "- thetaYcut : %8.3f urad ", (it->second).getThetaYcut());
107  fprintf(pFile, "| sigThetaYcut : %8.3f ", (it->second).getSigThetaYcut());
108  fprintf(pFile, "| maxMoveThetaYcut : %8.3f urad ", (it->second).getMaxMoveThetaYcut());
109  fprintf(pFile, "| ErrorThetaYcut : %8.3f urad\n ", (it->second).getErrorThetaYcut());
110 
111  fprintf(pFile, "- Zcut : %8.3f um ", (it->second).getZcut());
112  fprintf(pFile, "| sigZcut : %8.3f ", (it->second).getSigZcut());
113  fprintf(pFile, "| maxMoveZcut : %8.3f um ", (it->second).getMaxMoveZcut());
114  fprintf(pFile, "| ErrorZcut : %8.3f um\n ", (it->second).getErrorZcut());
115 
116  fprintf(pFile, "- thetaZcut : %8.3f urad ", (it->second).getThetaZcut());
117  fprintf(pFile, "| sigThetaZcut : %8.3f ", (it->second).getSigThetaZcut());
118  fprintf(pFile, "| maxMoveThetaZcut : %8.3f urad ", (it->second).getMaxMoveThetaZcut());
119  fprintf(pFile, "| ErrorThetaZcut : %8.3f urad\n ", (it->second).getErrorThetaZcut());
120 
121  if ((it->second).hasExtraDOF()) {
122  for (unsigned int j = 0; j < (it->second).extraDOFSize(); j++) {
123  std::array<float, 4> extraDOFCuts = thresholds->getExtraDOFCutsForAlignable(it->first, j);
124  fprintf(pFile,
125  "Extra DOF: %i with label %s \n ",
126  j,
127  thresholds->getExtraDOFLabelForAlignable(it->first, j).c_str());
128  fprintf(pFile, "- cut : %8.3f ", extraDOFCuts.at(0));
129  fprintf(pFile, "| sigCut : %8.3f ", extraDOFCuts.at(1));
130  fprintf(pFile, "| maxMoveCut : %8.3f ", extraDOFCuts.at(2));
131  fprintf(pFile, "| maxErrorCut : %8.3f \n ", extraDOFCuts.at(3));
132  }
133  }
134  }
135  }
136  }
RunNumber_t run() const
Definition: EventID.h:38
const threshold_map & getThreshold_Map() const
EventNumber_t event() const
Definition: EventID.h:40
double size() const
std::map< std::string, AlignPCLThreshold > threshold_map
Log< level::Error, false > LogError
const edm::ESGetToken< AlignPCLThresholds, AlignPCLThresholdsRcd > thresholdToken_
std::string getExtraDOFLabelForAlignable(const std::string &AlignableId, const unsigned int i) const
std::array< float, 4 > getExtraDOFCutsForAlignable(const std::string &AlignableId, const unsigned int i) const
Log< level::Info, false > LogInfo
T const * product() const
Definition: ESHandle.h:86
const int & getNrecords() const
heterocontainer::HCTypeTag TypeTag
edm::EventID id() const
Definition: EventBase.h:59
bool isValid() const
Definition: ESHandle.h:44
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:121
void edmtest::AlignPCLThresholdsReader::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 138 of file AlignPCLThresholdsReader.cc.

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

138  {
140  desc.setComment("Reads payloads of type AlignPCLThresholds");
141  desc.addUntracked<bool>("printDebug", true);
142  desc.addUntracked<std::string>("outputFile", "");
143  descriptions.add("AlignPCLThresholdsReader", desc);
144  }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

const std::string edmtest::AlignPCLThresholdsReader::formatedOutput_
private

Definition at line 25 of file AlignPCLThresholdsReader.cc.

Referenced by analyze().

const bool edmtest::AlignPCLThresholdsReader::printdebug_
private

Definition at line 24 of file AlignPCLThresholdsReader.cc.

Referenced by analyze().

const edm::ESGetToken<AlignPCLThresholds, AlignPCLThresholdsRcd> edmtest::AlignPCLThresholdsReader::thresholdToken_
private

Definition at line 23 of file AlignPCLThresholdsReader.cc.

Referenced by analyze().