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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 15 of file HcalCableMapper.cc.

Member Typedef Documentation

Definition at line 25 of file HcalCableMapper.cc.

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

Definition at line 24 of file HcalCableMapper.cc.

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

Definition at line 22 of file HcalCableMapper.cc.

Constructor & Destructor Documentation

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

Definition at line 58 of file HcalCableMapper.cc.

References edm::ParameterSet::getParameter().

58  {
59  tok_hbhe_ = consumes<HBHEDigiCollection>(conf.getParameter<edm::InputTag>("hbheLabel"));
60  tok_ho_ = consumes<HODigiCollection>(conf.getParameter<edm::InputTag>("hoLabel"));
61  tok_hf_ = consumes<HFDigiCollection>(conf.getParameter<edm::InputTag>("hfLabel"));
62 
63 }
edm::EDGetTokenT< HODigiCollection > tok_ho_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
edm::EDGetTokenT< HFDigiCollection > tok_hf_

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 161 of file HcalCableMapper.cc.

References edm::Event::getByToken(), photonIsolationHIProducer_cfi::hbhe, photonIsolationHIProducer_cfi::hf, photonIsolationHIProducer_cfi::ho, and record.

161  {
162 
164  e.getByToken(tok_hbhe_,hbhe);
165 
167  e.getByToken(tok_hf_,hf);
169  e.getByToken(tok_ho_,ho);
170 
171 
172  record(*hbhe);
173  record(*hf);
174  record(*ho);
175 }
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::EDAnalyzer.

Definition at line 180 of file HcalCableMapper.cc.

References EnergyCorrector::c, DEFINE_FWK_MODULE, mps_fire::i, cuy::ii, gen::k, GetRecoTauVFromDQM_MC_cff::kk, LaserDQM_cfg::process, and alignCSCRings::s.

Referenced by o2olib.O2ORunMgr::executeJob().

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

Definition at line 69 of file HcalCableMapper.cc.

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

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), ConfigBuilder.ConfigBuilder::scheduleSequence(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

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

Definition at line 39 of file HcalCableMapper.cc.

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

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

Member Data Documentation

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

Definition at line 32 of file HcalCableMapper.cc.

IdMap HcalCableMapper::IdSet
private

Definition at line 33 of file HcalCableMapper.cc.

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

Definition at line 34 of file HcalCableMapper.cc.

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

Definition at line 36 of file HcalCableMapper.cc.

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

Definition at line 35 of file HcalCableMapper.cc.