CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HtrXmlPattern Class Reference
Inheritance diagram for HtrXmlPattern:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 HtrXmlPattern (const edm::ParameterSet &)
 
 ~HtrXmlPattern () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void do_hand_fill (const HcalElectronicsMap *)
 
void endJob () override
 

Private Attributes

bool m_fill_by_hand
 
bool m_filled
 
int m_hand_pattern_number
 
const edm::ESGetToken< HcalDbService, HcalDbRecordm_hcalElectronicsMapToken
 
int m_sets_to_show
 
HtrXmlPatternToolm_tool
 
HtrXmlPatternToolParametersm_toolparameters
 
bool m_write_root_file
 

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)
 
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 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 25 of file HtrXmlPattern.cc.

Constructor & Destructor Documentation

◆ HtrXmlPattern()

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

Definition at line 45 of file HtrXmlPattern.cc.

References edm::ParameterSet::getUntrackedParameter(), HtrXmlPatternToolParameters::m_file_tag, m_fill_by_hand, m_filled, m_hand_pattern_number, HtrXmlPatternToolParameters::m_output_directory, HtrXmlPatternToolParameters::m_presamples_per_event, HtrXmlPatternToolParameters::m_samples_per_event, m_sets_to_show, HtrXmlPatternToolParameters::m_show_errors, m_tool, m_toolparameters, HtrXmlPatternToolParameters::m_user_output_directory, m_write_root_file, HtrXmlPatternToolParameters::m_XML_file_mode, runGCPTkAlMap::out_dir, and AlCaHLTBitMon_QueryRunRegistry::string.

45  {
46  m_filled = false;
47  m_fill_by_hand = iConfig.getUntrackedParameter<bool>("fill_by_hand");
48  m_hand_pattern_number = iConfig.getUntrackedParameter<int>("hand_pattern_number");
49  m_sets_to_show = iConfig.getUntrackedParameter<int>("sets_to_show");
50  m_write_root_file = iConfig.getUntrackedParameter<bool>("write_root_file");
51 
53  m_toolparameters->m_show_errors = iConfig.getUntrackedParameter<bool>("show_errors");
54  m_toolparameters->m_presamples_per_event = iConfig.getUntrackedParameter<int>("presamples_per_event");
55  m_toolparameters->m_samples_per_event = iConfig.getUntrackedParameter<int>("samples_per_event");
56 
57  m_toolparameters->m_XML_file_mode = iConfig.getUntrackedParameter<int>("XML_file_mode");
60 
62  while (out_dir.find_last_of('/') == out_dir.length() - 1)
63  out_dir.erase(out_dir.find_last_of('/'));
65 
67 }
HtrXmlPatternToolParameters * m_toolparameters
T getUntrackedParameter(std::string const &, T const &) const
int m_hand_pattern_number
bool m_write_root_file
HtrXmlPatternTool * m_tool

◆ ~HtrXmlPattern()

HtrXmlPattern::~HtrXmlPattern ( )
override

Definition at line 69 of file HtrXmlPattern.cc.

References m_tool, and m_toolparameters.

69  {
70  delete m_tool;
71  delete m_toolparameters;
72 }
HtrXmlPatternToolParameters * m_toolparameters
HtrXmlPatternTool * m_tool

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 75 of file HtrXmlPattern.cc.

References HltBtagPostValidation_cff::c, submitPVResolutionJobs::count, do_hand_fill(), Exception, HtrXmlPatternTool::Fill(), edm::EventSetup::getHandle(), photonIsolationHIProducer_cfi::hbhe, photonIsolationHIProducer_cfi::hf, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::hh, photonIsolationHIProducer_cfi::ho, mps_fire::i, dqmiolumiharvest::j, HcalElectronicsMap::lookup(), m_fill_by_hand, m_filled, m_hcalElectronicsMapToken, m_sets_to_show, m_tool, and hcalSimParameters_cfi::zdc.

75  {
76  using namespace std;
77 
78  if (m_filled)
79  return;
80 
81  // Get the HCAL Electronics Map from the Event setup
82  const auto pSetup = iSetup.getHandle(m_hcalElectronicsMapToken);
83  const HcalElectronicsMap* readoutMap = pSetup->getHcalMapping();
84 
85  if (m_fill_by_hand) {
86  do_hand_fill(readoutMap);
87  m_filled = true;
88  return;
89  }
90 
91  std::vector<edm::Handle<HBHEDigiCollection> > hbhe;
92  std::vector<edm::Handle<HODigiCollection> > ho;
93  std::vector<edm::Handle<HFDigiCollection> > hf;
94  std::vector<edm::Handle<ZDCDigiCollection> > zdc;
95  std::vector<edm::Handle<HcalCalibDigiCollection> > hc;
96  std::vector<edm::Handle<HcalTrigPrimDigiCollection> > htp;
97  std::vector<edm::Handle<HcalHistogramDigiCollection> > hh;
98 
99  //iEvent.getManyByType(hbhe);
100  throw cms::Exception("UnsupportedFunction") << "HtrXmlPattern::analyze: "
101  << "getManyByType has not been supported by the Framework since 2015. "
102  << "This module has been broken since then. Maybe it should be deleted. "
103  << "Another possibility is to upgrade to use GetterOfProducts instead.";
104 
105  if (hbhe.empty()) {
106  edm::LogPrint("HtrXmlPattern") << "No HB/HE Digis.";
107  } else {
108  std::vector<edm::Handle<HBHEDigiCollection> >::iterator i;
109  for (i = hbhe.begin(); i != hbhe.end(); i++) {
110  const HBHEDigiCollection& c = *(*i);
111 
112  int count = 0;
113  for (HBHEDigiCollection::const_iterator j = c.begin(); j != c.end(); j++) {
114  const HcalElectronicsId HEID = readoutMap->lookup(j->id());
115  m_tool->Fill(HEID, j);
116 
117  if (count++ < m_sets_to_show || m_sets_to_show < 0) {
118  edm::LogPrint("HtrXmlPattern") << *j;
119  edm::LogPrint("HtrXmlPattern") << HEID;
120  edm::LogPrint("HtrXmlPattern") << "count: " << count;
121  }
122  }
123  if (m_sets_to_show != 0)
124  edm::LogPrint("HtrXmlPattern") << "HB/HE count: " << count;
125  }
126  }
127 
128  //iEvent.getManyByType(hf);
129  throw cms::Exception("UnsupportedFunction") << "HtrXmlPattern::analyze: "
130  << "getManyByType has not been supported by the Framework since 2015. "
131  << "This module has been broken since then. Maybe it should be deleted. "
132  << "Another possibility is to upgrade to use GetterOfProducts instead.";
133 
134  if (hf.empty()) {
135  edm::LogPrint("HtrXmlPattern") << "No HF Digis.";
136  } else {
137  std::vector<edm::Handle<HFDigiCollection> >::iterator i;
138  for (i = hf.begin(); i != hf.end(); i++) {
139  const HFDigiCollection& c = *(*i);
140 
141  int count = 0;
142  for (HFDigiCollection::const_iterator j = c.begin(); j != c.end(); j++) {
143  const HcalElectronicsId HEID = readoutMap->lookup(j->id());
144  m_tool->Fill(HEID, j);
145 
146  if (count++ < m_sets_to_show || m_sets_to_show < 0) {
147  edm::LogPrint("HtrXmlPattern") << *j;
148  edm::LogPrint("HtrXmlPattern") << HEID;
149  edm::LogPrint("HtrXmlPattern") << "count: " << count;
150  }
151  }
152  if (m_sets_to_show != 0)
153  edm::LogPrint("HtrXmlPattern") << "HF count: " << count;
154  }
155  }
156 
157  //iEvent.getManyByType(ho);
158  throw cms::Exception("UnsupportedFunction") << "HtrXmlPattern::analyze: "
159  << "getManyByType has not been supported by the Framework since 2015. "
160  << "This module has been broken since then. Maybe it should be deleted. "
161  << "Another possibility is to upgrade to use GetterOfProducts instead.";
162 
163  if (ho.empty()) {
164  edm::LogPrint("HtrXmlPattern") << "No HO Digis.";
165  } else {
166  std::vector<edm::Handle<HODigiCollection> >::iterator i;
167  for (i = ho.begin(); i != ho.end(); i++) {
168  const HODigiCollection& c = *(*i);
169 
170  int count = 0;
171  for (HODigiCollection::const_iterator j = c.begin(); j != c.end(); j++) {
172  const HcalElectronicsId HEID = readoutMap->lookup(j->id());
173  m_tool->Fill(HEID, j);
174 
175  if (count++ < m_sets_to_show || m_sets_to_show < 0) {
176  edm::LogPrint("HtrXmlPattern") << *j;
177  edm::LogPrint("HtrXmlPattern") << HEID;
178  edm::LogPrint("HtrXmlPattern") << "count: " << count;
179  }
180  }
181  if (m_sets_to_show != 0)
182  edm::LogPrint("HtrXmlPattern") << "HO count: " << count;
183  }
184  }
185 
186  edm::LogPrint("HtrXmlPattern");
187 }
const edm::ESGetToken< HcalDbService, HcalDbRecord > m_hcalElectronicsMapToken
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
std::vector< T >::const_iterator const_iterator
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > CellTracksVector< TrackerTraits > HitsConstView< TrackerTraits > hh
Log< level::Warning, true > LogPrint
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
void Fill(const HcalElectronicsId HEID, HBHEDigiCollection::const_iterator data)
virtual void do_hand_fill(const HcalElectronicsMap *)
Readout chain identification for Hcal.
HtrXmlPatternTool * m_tool

◆ do_hand_fill()

void HtrXmlPattern::do_hand_fill ( const HcalElectronicsMap emap)
privatevirtual

Definition at line 189 of file HtrXmlPattern.cc.

References hippyaddtobaddatafiles::cd(), HtrXmlPatternSet::getCrate(), HalfHtrData::getPattern(), HtrXmlPatternTool::GetPatternSet(), m_hand_pattern_number, m_tool, ChannelPattern::NUM_CRATES, and ChannelPattern::NUM_SLOTS.

Referenced by analyze().

189  {
191 
192  for (int iCrate = 0; iCrate < ChannelPattern::NUM_CRATES; iCrate++) {
193  CrateData* cd = hxps->getCrate(iCrate);
194  if (!cd)
195  continue;
196  for (int iSlot = 0; iSlot < ChannelPattern::NUM_SLOTS; iSlot++) {
197  for (int iTb = 0; iTb < 2; iTb++) {
198  HalfHtrData* hhd = cd->getHalfHtrData(iSlot, iTb);
199  if (!hhd)
200  continue;
201  for (int iChannel = 1; iChannel < 25; iChannel++) {
202  ChannelPattern* cp = hhd->getPattern(iChannel);
203  if (!cp)
204  continue;
205  cp->Fill_by_hand(emap, m_hand_pattern_number);
206  }
207  }
208  }
209  }
210 }
static const int NUM_CRATES
ChannelPattern * getPattern(int chan)
int m_hand_pattern_number
static const int NUM_SLOTS
HtrXmlPatternSet * GetPatternSet()
CrateData * getCrate(int crate)
HtrXmlPatternTool * m_tool

◆ endJob()

void HtrXmlPattern::endJob ( void  )
overrideprivatevirtual

Member Data Documentation

◆ m_fill_by_hand

bool HtrXmlPattern::m_fill_by_hand
private

Definition at line 38 of file HtrXmlPattern.cc.

Referenced by analyze(), and HtrXmlPattern().

◆ m_filled

bool HtrXmlPattern::m_filled
private

Definition at line 39 of file HtrXmlPattern.cc.

Referenced by analyze(), and HtrXmlPattern().

◆ m_hand_pattern_number

int HtrXmlPattern::m_hand_pattern_number
private

Definition at line 37 of file HtrXmlPattern.cc.

Referenced by do_hand_fill(), and HtrXmlPattern().

◆ m_hcalElectronicsMapToken

const edm::ESGetToken<HcalDbService, HcalDbRecord> HtrXmlPattern::m_hcalElectronicsMapToken
private

Definition at line 42 of file HtrXmlPattern.cc.

Referenced by analyze().

◆ m_sets_to_show

int HtrXmlPattern::m_sets_to_show
private

Definition at line 36 of file HtrXmlPattern.cc.

Referenced by analyze(), and HtrXmlPattern().

◆ m_tool

HtrXmlPatternTool* HtrXmlPattern::m_tool
private

Definition at line 34 of file HtrXmlPattern.cc.

Referenced by analyze(), do_hand_fill(), endJob(), HtrXmlPattern(), and ~HtrXmlPattern().

◆ m_toolparameters

HtrXmlPatternToolParameters* HtrXmlPattern::m_toolparameters
private

Definition at line 35 of file HtrXmlPattern.cc.

Referenced by endJob(), HtrXmlPattern(), and ~HtrXmlPattern().

◆ m_write_root_file

bool HtrXmlPattern::m_write_root_file
private

Definition at line 40 of file HtrXmlPattern.cc.

Referenced by endJob(), and HtrXmlPattern().