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
 
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)
 

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

Constructor & Destructor Documentation

◆ HtrXmlPattern()

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

Definition at line 44 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.

44  {
45  m_filled = false;
46  m_fill_by_hand = iConfig.getUntrackedParameter<bool>("fill_by_hand");
47  m_hand_pattern_number = iConfig.getUntrackedParameter<int>("hand_pattern_number");
48  m_sets_to_show = iConfig.getUntrackedParameter<int>("sets_to_show");
49  m_write_root_file = iConfig.getUntrackedParameter<bool>("write_root_file");
50 
52  m_toolparameters->m_show_errors = iConfig.getUntrackedParameter<bool>("show_errors");
53  m_toolparameters->m_presamples_per_event = iConfig.getUntrackedParameter<int>("presamples_per_event");
54  m_toolparameters->m_samples_per_event = iConfig.getUntrackedParameter<int>("samples_per_event");
55 
56  m_toolparameters->m_XML_file_mode = iConfig.getUntrackedParameter<int>("XML_file_mode");
59 
61  while (out_dir.find_last_of('/') == out_dir.length() - 1)
62  out_dir.erase(out_dir.find_last_of('/'));
64 
66 }
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 68 of file HtrXmlPattern.cc.

References m_tool, and m_toolparameters.

68  {
69  delete m_tool;
70  delete m_toolparameters;
71 }
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 74 of file HtrXmlPattern.cc.

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

74  {
75  using namespace std;
76 
77  if (m_filled)
78  return;
79 
80  // Get the HCAL Electronics Map from the Event setup
81  const auto pSetup = iSetup.getHandle(m_hcalElectronicsMapToken);
82  const HcalElectronicsMap* readoutMap = pSetup->getHcalMapping();
83 
84  if (m_fill_by_hand) {
85  do_hand_fill(readoutMap);
86  m_filled = true;
87  return;
88  }
89 
90  std::vector<edm::Handle<HBHEDigiCollection> > hbhe;
91  std::vector<edm::Handle<HODigiCollection> > ho;
92  std::vector<edm::Handle<HFDigiCollection> > hf;
93  std::vector<edm::Handle<ZDCDigiCollection> > zdc;
94  std::vector<edm::Handle<HcalCalibDigiCollection> > hc;
95  std::vector<edm::Handle<HcalTrigPrimDigiCollection> > htp;
96  std::vector<edm::Handle<HcalHistogramDigiCollection> > hh;
97 
98  iEvent.getManyByType(hbhe);
99  if (hbhe.empty()) {
100  edm::LogPrint("HtrXmlPattern") << "No HB/HE Digis.";
101  } else {
102  std::vector<edm::Handle<HBHEDigiCollection> >::iterator i;
103  for (i = hbhe.begin(); i != hbhe.end(); i++) {
104  const HBHEDigiCollection& c = *(*i);
105 
106  int count = 0;
107  for (HBHEDigiCollection::const_iterator j = c.begin(); j != c.end(); j++) {
108  const HcalElectronicsId HEID = readoutMap->lookup(j->id());
109  m_tool->Fill(HEID, j);
110 
111  if (count++ < m_sets_to_show || m_sets_to_show < 0) {
112  edm::LogPrint("HtrXmlPattern") << *j;
113  edm::LogPrint("HtrXmlPattern") << HEID;
114  edm::LogPrint("HtrXmlPattern") << "count: " << count;
115  }
116  }
117  if (m_sets_to_show != 0)
118  edm::LogPrint("HtrXmlPattern") << "HB/HE count: " << count;
119  }
120  }
121 
122  iEvent.getManyByType(hf);
123  if (hf.empty()) {
124  edm::LogPrint("HtrXmlPattern") << "No HF Digis.";
125  } else {
126  std::vector<edm::Handle<HFDigiCollection> >::iterator i;
127  for (i = hf.begin(); i != hf.end(); i++) {
128  const HFDigiCollection& c = *(*i);
129 
130  int count = 0;
131  for (HFDigiCollection::const_iterator j = c.begin(); j != c.end(); j++) {
132  const HcalElectronicsId HEID = readoutMap->lookup(j->id());
133  m_tool->Fill(HEID, j);
134 
135  if (count++ < m_sets_to_show || m_sets_to_show < 0) {
136  edm::LogPrint("HtrXmlPattern") << *j;
137  edm::LogPrint("HtrXmlPattern") << HEID;
138  edm::LogPrint("HtrXmlPattern") << "count: " << count;
139  }
140  }
141  if (m_sets_to_show != 0)
142  edm::LogPrint("HtrXmlPattern") << "HF count: " << count;
143  }
144  }
145 
146  iEvent.getManyByType(ho);
147  if (ho.empty()) {
148  edm::LogPrint("HtrXmlPattern") << "No HO Digis.";
149  } else {
150  std::vector<edm::Handle<HODigiCollection> >::iterator i;
151  for (i = ho.begin(); i != ho.end(); i++) {
152  const HODigiCollection& c = *(*i);
153 
154  int count = 0;
155  for (HODigiCollection::const_iterator j = c.begin(); j != c.end(); j++) {
156  const HcalElectronicsId HEID = readoutMap->lookup(j->id());
157  m_tool->Fill(HEID, j);
158 
159  if (count++ < m_sets_to_show || m_sets_to_show < 0) {
160  edm::LogPrint("HtrXmlPattern") << *j;
161  edm::LogPrint("HtrXmlPattern") << HEID;
162  edm::LogPrint("HtrXmlPattern") << "count: " << count;
163  }
164  }
165  if (m_sets_to_show != 0)
166  edm::LogPrint("HtrXmlPattern") << "HO count: " << count;
167  }
168  }
169 
170  edm::LogPrint("HtrXmlPattern");
171 }
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
int iEvent
Definition: GenABIO.cc:224
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 *)
TupleMultiplicity< TrackerTraits > const *__restrict__ TrackingRecHitSoAConstView< TrackerTraits > hh
Readout chain identification for Hcal.
HtrXmlPatternTool * m_tool

◆ do_hand_fill()

void HtrXmlPattern::do_hand_fill ( const HcalElectronicsMap emap)
privatevirtual

Definition at line 173 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().

173  {
175 
176  for (int iCrate = 0; iCrate < ChannelPattern::NUM_CRATES; iCrate++) {
177  CrateData* cd = hxps->getCrate(iCrate);
178  if (!cd)
179  continue;
180  for (int iSlot = 0; iSlot < ChannelPattern::NUM_SLOTS; iSlot++) {
181  for (int iTb = 0; iTb < 2; iTb++) {
182  HalfHtrData* hhd = cd->getHalfHtrData(iSlot, iTb);
183  if (!hhd)
184  continue;
185  for (int iChannel = 1; iChannel < 25; iChannel++) {
186  ChannelPattern* cp = hhd->getPattern(iChannel);
187  if (!cp)
188  continue;
189  cp->Fill_by_hand(emap, m_hand_pattern_number);
190  }
191  }
192  }
193  }
194 }
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 37 of file HtrXmlPattern.cc.

Referenced by analyze(), and HtrXmlPattern().

◆ m_filled

bool HtrXmlPattern::m_filled
private

Definition at line 38 of file HtrXmlPattern.cc.

Referenced by analyze(), and HtrXmlPattern().

◆ m_hand_pattern_number

int HtrXmlPattern::m_hand_pattern_number
private

Definition at line 36 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 41 of file HtrXmlPattern.cc.

Referenced by analyze().

◆ m_sets_to_show

int HtrXmlPattern::m_sets_to_show
private

Definition at line 35 of file HtrXmlPattern.cc.

Referenced by analyze(), and HtrXmlPattern().

◆ m_tool

HtrXmlPatternTool* HtrXmlPattern::m_tool
private

Definition at line 33 of file HtrXmlPattern.cc.

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

◆ m_toolparameters

HtrXmlPatternToolParameters* HtrXmlPattern::m_toolparameters
private

Definition at line 34 of file HtrXmlPattern.cc.

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

◆ m_write_root_file

bool HtrXmlPattern::m_write_root_file
private

Definition at line 39 of file HtrXmlPattern.cc.

Referenced by endJob(), and HtrXmlPattern().