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 | Private Types | Private Member Functions | Private Attributes
HcalCableMapper Class Reference
Inheritance diagram for HcalCableMapper:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &c) override
 
void endJob () override
 
 HcalCableMapper (edm::ParameterSet const &conf)
 
 ~HcalCableMapper () override=default
 
- 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 Types

typedef std::map< HcalDetId,
HcalElectronicsId
IdMap
 
typedef std::map< HcalDetId,
SampleSet
PathSet
 
typedef std::vector
< HcalQIESample
SampleSet
 

Private Member Functions

void process (const PathSet &ps, const IdMap &im)
 
template<class DigiCollection >
void record (const DigiCollection &digis)
 

Private Attributes

std::map< HcalDetId,
std::vector< SampleSet > > 
fullHistory_
 
IdMap IdSet
 
edm::EDGetTokenT
< HBHEDigiCollection
tok_hbhe_
 
edm::EDGetTokenT
< HFDigiCollection
tok_hf_
 
edm::EDGetTokenT
< HODigiCollection
tok_ho_
 

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< B > consumes (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 () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
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 15 of file HcalCableMapper.cc.

Member Typedef Documentation

Definition at line 26 of file HcalCableMapper.cc.

typedef std::map<HcalDetId, SampleSet> HcalCableMapper::PathSet
private

Definition at line 25 of file HcalCableMapper.cc.

typedef std::vector<HcalQIESample> HcalCableMapper::SampleSet
private

Definition at line 23 of file HcalCableMapper.cc.

Constructor & Destructor Documentation

HcalCableMapper::HcalCableMapper ( edm::ParameterSet const &  conf)
explicit

Definition at line 53 of file HcalCableMapper.cc.

References edm::ParameterSet::getParameter().

53  {
54  tok_hbhe_ = consumes<HBHEDigiCollection>(conf.getParameter<edm::InputTag>("hbheLabel"));
55  tok_ho_ = consumes<HODigiCollection>(conf.getParameter<edm::InputTag>("hoLabel"));
56  tok_hf_ = consumes<HFDigiCollection>(conf.getParameter<edm::InputTag>("hfLabel"));
57 }
edm::EDGetTokenT< HODigiCollection > tok_ho_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
HcalCableMapper::~HcalCableMapper ( )
overridedefault

Member Function Documentation

void HcalCableMapper::analyze ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 161 of file HcalCableMapper.cc.

References edm::Event::getByToken(), hcalSimParameters_cfi::ho, and GlobalPosition_Frontier_DevDB_cff::record.

161  {
163  e.getByToken(tok_hbhe_, hbhe);
164 
166  e.getByToken(tok_hf_, hf);
168  e.getByToken(tok_ho_, ho);
169 
170  record(*hbhe);
171  record(*hf);
172  record(*ho);
173 }
edm::EDGetTokenT< HODigiCollection > tok_ho_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
void record(const DigiCollection &digis)
edm::EDGetTokenT< HFDigiCollection > tok_hf_
void HcalCableMapper::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 175 of file HcalCableMapper.cc.

References c, mps_fire::i, cuy::ii, dqmiolumiharvest::j, isotrackApplyRegressor::k, GetRecoTauVFromDQM_MC_cff::kk, LaserDQM_cfg::process, and alignCSCRings::s.

Referenced by o2olib.O2ORunMgr::executeJob().

175  {
176  std::vector<SampleSet>::iterator j;
177  int c[128];
178  int k, ii, kk;
179  int c_max = 0;
180 
181  std::map<HcalDetId, std::vector<SampleSet>>::iterator i;
182 
183  PathSet consensus;
184 
185  for (i = fullHistory_.begin(); i != fullHistory_.end(); i++) {
186  // i.first --> id
187  // i.second --> vector<SampleSet>
188  SampleSet s;
189  for (k = 0; k < 10; k++) {
190  for (ii = 0; ii < 128; ii++)
191  c[ii] = 0;
192 
193  for (j = i->second.begin(); j != i->second.end(); j++) { // word number
194  if (int(j->size()) > k)
195  c[(*j)[k].adc()]++;
196 
197  } // j loop
198  // sort c-array
199  for (kk = 0; kk < 128; kk++) {
200  if (c[kk] > c[c_max]) {
201  c_max = kk;
202  }
203  }
204 
205  s.push_back(((c_max & 0x7F)));
206 
207  c_max = 0;
208  } // k-loop
209  consensus[i->first] = s;
210 
211  } // i loop
212 
213  process(consensus, IdSet);
214 
215 } // end of endjob
const edm::EventSetup & c
int ii
Definition: cuy.py:589
std::vector< HcalQIESample > SampleSet
std::map< HcalDetId, std::vector< SampleSet > > fullHistory_
void process(const PathSet &ps, const IdMap &im)
std::map< HcalDetId, SampleSet > PathSet
void HcalCableMapper::process ( const PathSet ps,
const IdMap im 
)
private

Definition at line 61 of file HcalCableMapper.cc.

References c, gather_cfg::cout, HcalElectronicsId::dccid(), createTree::dd, HcalDetId::depth(), HLT_FULL_cff::depth, det_names, runTauDisplay::eid, HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), HcalElectronicsId::htrSlot(), HcalElectronicsId::htrTopBottom(), HcalDetId::ietaAbs(), HcalDetId::iphi(), HcalElectronicsId::readoutVMECrateId(), HcalElectronicsId::spigot(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and HcalDetId::subdet().

61  {
62  PathSet::const_iterator iii;
63  IdMap::const_iterator ij;
64 
65  for (iii = ps.begin(); iii != ps.end(); iii++) {
66  SampleSet ss = iii->second;
67  const HcalDetId dd = iii->first;
68 
69  ij = im.find(dd);
70  HcalElectronicsId eid = ij->second;
71 
72  int header = ((ss[0].adc()) & 0x7F);
73  int ieta = ((ss[1].adc()) & 0x3F);
74  int z_ieta = (((ss[1].adc()) >> 6) & 0x1);
75  int iphi = ((ss[2].adc()) & 0x7F);
76  int depth = ((ss[3].adc()) & 0x7);
77  int det = (((ss[3].adc()) >> 3) & 0xF);
78  int spigot = ((ss[4].adc()) & 0xF);
79  int fiber = (((ss[4].adc()) >> 4) & 0x7);
80  int crate = ((ss[5].adc()) & 0x1F);
81  int fiber_chan = (((ss[5].adc()) >> 5) & 0x3);
82  int G_Dcc = ((ss[6].adc()) & 0x3F);
83  int H_slot = ((ss[7].adc()) & 0x1F);
84  int TB = (((ss[7].adc()) >> 5) & 0x1);
85  int RBX_7 = (((ss[7].adc()) >> 6) & 0x1);
86  int RBX = ((ss[8].adc()) & 0x7F);
87  int RM = ((ss[9].adc()) & 0x3);
88  int RM_card = (((ss[9].adc()) >> 2) & 0x3);
89  int RM_chan = (((ss[9].adc()) >> 4) & 0x7);
90  string eta_sign;
91  std::string det_name;
92  if (det > 4 || det < 0) {
93  char c[20];
94  snprintf(c, 20, "Det=%d", det);
95  det_name = c;
96  } else
97  det_name = det_names[det];
98 
99  if (z_ieta == 1) {
100  eta_sign = "+";
101  } else {
102  eta_sign = "-";
103  }
104  string is_header;
105  if (header == 0x75) {
106  // NO SHIFT
107  if ((spigot == eid.spigot()) && (fiber + 1 == eid.fiberIndex()) && (fiber_chan == eid.fiberChanId()) &&
108  (H_slot == eid.htrSlot()) && (G_Dcc == eid.dccid()) && (crate == eid.readoutVMECrateId()) &&
109  (iphi == dd.iphi()) && (depth == dd.depth()) && (ieta == dd.ietaAbs()) && (TB == eid.htrTopBottom()) &&
110  (det == dd.subdet())) { //&&(z_ieta==dd.zside())
111  std::cout << "Pathway match" << std::endl;
112  } else {
113  is_header = " Header found";
114 
115  std::cout << " Digi ID: " << dd << is_header << " ieta: " << eta_sign << ieta << " iphi: " << iphi
116  << " Depth: " << depth << " Detector: " << det_name << " Spigot: " << spigot << "/" << eid.spigot()
117  << " Fiber: " << fiber + 1 << "/" << eid.fiberIndex() << " Fiber Channel: " << fiber_chan << "/"
118  << eid.fiberChanId() << " Crate: " << crate << "/" << eid.readoutVMECrateId()
119  << " Global Dcc: " << G_Dcc << "/" << eid.dccid() << " HTR Slot: " << H_slot << "/ " << eid.htrSlot()
120  << " Top/Bottom: " << TB << "/" << eid.htrTopBottom() << " RBX: " << (RBX_7 * 128 + RBX)
121  << " RM: " << RM + 1 << " RM Card: " << RM_card + 1 << " RM Channel: " << RM_chan << std::endl;
122  }
123  } else if (ieta + 64 == 0x75) {
124  ieta = ((ss[2].adc()) & 0x3F);
125  iphi = ((ss[3].adc()) & 0x7F);
126  depth = ((ss[4].adc()) & 0x7);
127  det = (((ss[4].adc()) >> 3) & 0xF);
128  spigot = ((ss[5].adc()) & 0xF);
129  fiber = (((ss[5].adc()) >> 4) & 0x7);
130  crate = ((ss[6].adc()) & 0x1F);
131  fiber_chan = (((ss[6].adc()) >> 5) & 0x3);
132  G_Dcc = ((ss[7].adc()) & 0x3F);
133  H_slot = ((ss[8].adc()) & 0x1F);
134  TB = (((ss[8].adc()) >> 5) & 0x1);
135  RBX_7 = (((ss[8].adc()) >> 6) & 0x1);
136  RBX = ((ss[9].adc()) & 0x7F);
137 
138  // SHIFT
139  if ((spigot == eid.spigot()) && (fiber + 1 == eid.fiberIndex()) && (fiber_chan == eid.fiberChanId()) &&
140  (H_slot == eid.htrSlot()) && (G_Dcc == eid.dccid()) && (TB == eid.htrTopBottom()) &&
141  (crate == eid.readoutVMECrateId()) && (iphi == dd.iphi()) && (depth == dd.depth()) && (det == dd.subdet()) &&
142  (ieta == dd.ietaAbs())) {
143  std::cout << "Pathway match (SHIFT)" << std::endl;
144  } else {
145  is_header = " DATA SHIFT";
146 
147  std::cout << " Digi ID: " << dd << is_header << " ieta: " << eta_sign << ieta << " iphi: " << iphi
148  << " Depth: " << depth << " Detector: " << det_name << " Spigot: " << spigot << "/" << eid.spigot()
149  << " Fiber: " << fiber + 1 << "/" << eid.fiberIndex() << " Fiber Channel: " << fiber_chan << "/"
150  << eid.fiberChanId() << " Crate: " << crate << "/" << eid.readoutVMECrateId()
151  << " Global Dcc: " << G_Dcc << "/" << eid.dccid() << " HTR Slot: " << H_slot << "/ " << eid.htrSlot()
152  << " Top/Bottom: " << TB << "/" << eid.htrTopBottom() << " RBX: " << (RBX_7 * 128 + RBX) << std::endl;
153  }
154  } else {
155  std::cout << " Digi ID: " << dd << " +NO HEADER+ "
156  << " RBX: " << (RBX_7 * 128 + RBX) << std::endl;
157  }
158  }
159 }
const edm::EventSetup & c
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
constexpr int dccid() const
get the (Hcal local) DCC id for VME, crate number for uTCA
constexpr char const * det_names[]
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
constexpr int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom), valid for VME
std::vector< HcalQIESample > SampleSet
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr int htrSlot() const
get the htr slot
constexpr int readoutVMECrateId() const
get the readout VME crate number
constexpr int spigot() const
get the spigot (input number on DCC, AMC card number for uTCA)
constexpr int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
tuple cout
Definition: gather_cfg.py:144
constexpr int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
Readout chain identification for Hcal.
template<class DigiCollection >
void HcalCableMapper::record ( const DigiCollection &  digis)
inlineprivate

Definition at line 37 of file HcalCableMapper.cc.

References mps_fire::i, and submitPVResolutionJobs::q.

37  {
38  for (typename DigiCollection::const_iterator digi = digis.begin(); digi != digis.end(); digi++) {
39  SampleSet q;
40  for (int i = 0; i < digi->size(); i++)
41  q.push_back(digi->sample(i));
42 
43  if (fullHistory_.find(digi->id()) == fullHistory_.end())
44  fullHistory_.insert(std::pair<HcalDetId, std::vector<SampleSet>>(digi->id(), std::vector<SampleSet>()));
45  if (IdSet.find(digi->id()) == IdSet.end())
46  IdSet.insert(std::pair<HcalDetId, HcalElectronicsId>(digi->id(), HcalElectronicsId()));
47  fullHistory_[digi->id()].push_back(q);
48  IdSet[digi->id()] = digi->elecId();
49  }
50  }
std::vector< HcalQIESample > SampleSet
std::map< HcalDetId, std::vector< SampleSet > > fullHistory_
Readout chain identification for Hcal.

Member Data Documentation

std::map<HcalDetId, std::vector<SampleSet> > HcalCableMapper::fullHistory_
private

Definition at line 30 of file HcalCableMapper.cc.

IdMap HcalCableMapper::IdSet
private

Definition at line 31 of file HcalCableMapper.cc.

edm::EDGetTokenT<HBHEDigiCollection> HcalCableMapper::tok_hbhe_
private

Definition at line 32 of file HcalCableMapper.cc.

edm::EDGetTokenT<HFDigiCollection> HcalCableMapper::tok_hf_
private

Definition at line 34 of file HcalCableMapper.cc.

edm::EDGetTokenT<HODigiCollection> HcalCableMapper::tok_ho_
private

Definition at line 33 of file HcalCableMapper.cc.