CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
HcalCableMapper Class Reference
Inheritance diagram for HcalCableMapper:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &c) override
 
void endJob () override
 
 HcalCableMapper (edm::ParameterSet const &conf)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
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, HcalElectronicsIdIdMap
 
typedef std::map< HcalDetId, SampleSetPathSet
 
typedef std::vector< HcalQIESampleSampleSet
 

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< HBHEDigiCollectiontok_hbhe_
 
edm::EDGetTokenT< HFDigiCollectiontok_hf_
 
edm::EDGetTokenT< HODigiCollectiontok_ho_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 15 of file HcalCableMapper.cc.

Member Typedef Documentation

◆ IdMap

Definition at line 25 of file HcalCableMapper.cc.

◆ PathSet

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

Definition at line 24 of file HcalCableMapper.cc.

◆ SampleSet

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

Definition at line 22 of file HcalCableMapper.cc.

Constructor & Destructor Documentation

◆ HcalCableMapper()

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

Definition at line 52 of file HcalCableMapper.cc.

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

References edm::ParameterSet::getParameter().

Member Function Documentation

◆ analyze()

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

◆ endJob()

void HcalCableMapper::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 176 of file HcalCableMapper.cc.

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

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

Referenced by o2olib.O2ORunMgr::executeJob().

◆ process()

void HcalCableMapper::process ( const PathSet ps,
const IdMap im 
)
private

Definition at line 60 of file HcalCableMapper.cc.

60  {
61  PathSet::const_iterator iii;
62  IdMap::const_iterator ij;
63 
64  for (iii = ps.begin(); iii != ps.end(); iii++) {
65  SampleSet ss = iii->second;
66  const HcalDetId dd = iii->first;
67 
68  ij = im.find(dd);
69  HcalElectronicsId eid = ij->second;
70 
71  int header = ((ss[0].adc()) & 0x7F);
72  int ieta = ((ss[1].adc()) & 0x3F);
73  int z_ieta = (((ss[1].adc()) >> 6) & 0x1);
74  int iphi = ((ss[2].adc()) & 0x7F);
75  int depth = ((ss[3].adc()) & 0x7);
76  int det = (((ss[3].adc()) >> 3) & 0xF);
77  int spigot = ((ss[4].adc()) & 0xF);
78  int fiber = (((ss[4].adc()) >> 4) & 0x7);
79  int crate = ((ss[5].adc()) & 0x1F);
80  int fiber_chan = (((ss[5].adc()) >> 5) & 0x3);
81  int G_Dcc = ((ss[6].adc()) & 0x3F);
82  int H_slot = ((ss[7].adc()) & 0x1F);
83  int TB = (((ss[7].adc()) >> 5) & 0x1);
84  int RBX_7 = (((ss[7].adc()) >> 6) & 0x1);
85  int RBX = ((ss[8].adc()) & 0x7F);
86  int RM = ((ss[9].adc()) & 0x3);
87  int RM_card = (((ss[9].adc()) >> 2) & 0x3);
88  int RM_chan = (((ss[9].adc()) >> 4) & 0x7);
89  string eta_sign;
90  std::string det_name;
91  if (det > 4 || det < 0) {
92  char c[20];
93  snprintf(c, 20, "Det=%d", det);
94  det_name = c;
95  } else
96  det_name = det_names[det];
97 
98  if (z_ieta == 1) {
99  eta_sign = "+";
100  } else {
101  eta_sign = "-";
102  }
103  string is_header;
104  if (header == 0x75) {
105  // NO SHIFT
106  if ((spigot == eid.spigot()) && (fiber + 1 == eid.fiberIndex()) && (fiber_chan == eid.fiberChanId()) &&
107  (H_slot == eid.htrSlot()) && (G_Dcc == eid.dccid()) && (crate == eid.readoutVMECrateId()) &&
108  (iphi == dd.iphi()) && (depth == dd.depth()) && (ieta == dd.ietaAbs()) && (TB == eid.htrTopBottom()) &&
109  (det == dd.subdet())) { //&&(z_ieta==dd.zside())
110  std::cout << "Pathway match" << std::endl;
111  } else {
112  is_header = " Header found";
113 
114  std::cout << " Digi ID: " << dd << is_header << " ieta: " << eta_sign << ieta << " iphi: " << iphi
115  << " Depth: " << depth << " Detector: " << det_name << " Spigot: " << spigot << "/" << eid.spigot()
116  << " Fiber: " << fiber + 1 << "/" << eid.fiberIndex() << " Fiber Channel: " << fiber_chan << "/"
117  << eid.fiberChanId() << " Crate: " << crate << "/" << eid.readoutVMECrateId()
118  << " Global Dcc: " << G_Dcc << "/" << eid.dccid() << " HTR Slot: " << H_slot << "/ " << eid.htrSlot()
119  << " Top/Bottom: " << TB << "/" << eid.htrTopBottom() << " RBX: " << (RBX_7 * 128 + RBX)
120  << " RM: " << RM + 1 << " RM Card: " << RM_card + 1 << " RM Channel: " << RM_chan << std::endl;
121  }
122  } else if (ieta + 64 == 0x75) {
123  ieta = ((ss[2].adc()) & 0x3F);
124  z_ieta = (((ss[2].adc()) >> 6) & 0x1);
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())) { //&&(z_ieta==dd.zside())
143 
144  std::cout << "Pathway match (SHIFT)" << std::endl;
145  } else {
146  is_header = " DATA SHIFT";
147 
148  std::cout << " Digi ID: " << dd << is_header << " ieta: " << eta_sign << ieta << " iphi: " << iphi
149  << " Depth: " << depth << " Detector: " << det_name << " Spigot: " << spigot << "/" << eid.spigot()
150  << " Fiber: " << fiber + 1 << "/" << eid.fiberIndex() << " Fiber Channel: " << fiber_chan << "/"
151  << eid.fiberChanId() << " Crate: " << crate << "/" << eid.readoutVMECrateId()
152  << " Global Dcc: " << G_Dcc << "/" << eid.dccid() << " HTR Slot: " << H_slot << "/ " << eid.htrSlot()
153  << " Top/Bottom: " << TB << "/" << eid.htrTopBottom() << " RBX: " << (RBX_7 * 128 + RBX) << std::endl;
154  }
155  } else {
156  std::cout << " Digi ID: " << dd << " +NO HEADER+ "
157  << " RBX: " << (RBX_7 * 128 + RBX) << std::endl;
158  }
159  }
160 }

References HltBtagPostValidation_cff::c, gather_cfg::cout, createTree::dd, LEDCalibrationChannels::depth, det_names, runTauDisplay::eid, RecoTauValidation_cfi::header, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ record()

template<class DigiCollection >
void HcalCableMapper::record ( const DigiCollection &  digis)
inlineprivate

Definition at line 36 of file HcalCableMapper.cc.

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

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

Member Data Documentation

◆ fullHistory_

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

Definition at line 29 of file HcalCableMapper.cc.

◆ IdSet

IdMap HcalCableMapper::IdSet
private

Definition at line 30 of file HcalCableMapper.cc.

◆ tok_hbhe_

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

Definition at line 31 of file HcalCableMapper.cc.

◆ tok_hf_

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

Definition at line 33 of file HcalCableMapper.cc.

◆ tok_ho_

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

Definition at line 32 of file HcalCableMapper.cc.

mps_fire.i
i
Definition: mps_fire.py:428
HcalCableMapper::IdSet
IdMap IdSet
Definition: HcalCableMapper.cc:30
HcalCableMapper::PathSet
std::map< HcalDetId, SampleSet > PathSet
Definition: HcalCableMapper.cc:24
HcalCableMapper::tok_hf_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
Definition: HcalCableMapper.cc:33
HcalCableMapper::tok_hbhe_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
Definition: HcalCableMapper.cc:31
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::Handle
Definition: AssociativeIterator.h:50
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
photonIsolationHIProducer_cfi.hf
hf
Definition: photonIsolationHIProducer_cfi.py:9
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
HcalCableMapper::record
void record(const DigiCollection &digis)
Definition: HcalCableMapper.cc:36
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
dqmdumpme.k
k
Definition: dqmdumpme.py:60
createTree.dd
string dd
Definition: createTree.py:154
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalCableMapper::tok_ho_
edm::EDGetTokenT< HODigiCollection > tok_ho_
Definition: HcalCableMapper.cc:32
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HcalDetId
Definition: HcalDetId.h:12
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
photonIsolationHIProducer_cfi.ho
ho
Definition: photonIsolationHIProducer_cfi.py:10
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
det_names
constexpr const char * det_names[]
Definition: HcalCableMapper.cc:58
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HcalCableMapper::SampleSet
std::vector< HcalQIESample > SampleSet
Definition: HcalCableMapper.cc:22
cuy.ii
ii
Definition: cuy.py:590
edm::InputTag
Definition: InputTag.h:15
HcalCableMapper::process
void process(const PathSet &ps, const IdMap &im)
Definition: HcalCableMapper.cc:60
HcalCableMapper::fullHistory_
std::map< HcalDetId, std::vector< SampleSet > > fullHistory_
Definition: HcalCableMapper.cc:29
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37