CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
HcalCableMapper Class Reference
Inheritance diagram for HcalCableMapper:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (edm::Event const &e, edm::EventSetup const &c)
 
virtual void endJob ()
 
 HcalCableMapper (edm::ParameterSet const &conf)
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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_
 
edm::InputTag hbheLabel_
 
edm::InputTag hfLabel_
 
edm::InputTag hoLabel_
 
IdMap IdSet
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 16 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 57 of file HcalCableMapper.cc.

57  :
58  hbheLabel_(conf.getParameter<edm::InputTag>("hbheLabel")),
59  hoLabel_(conf.getParameter<edm::InputTag>("hoLabel")),
60  hfLabel_(conf.getParameter<edm::InputTag>("hfLabel")){
61 
62 }
edm::InputTag hbheLabel_
tuple conf
Definition: dbtoconf.py:185
edm::InputTag hfLabel_
edm::InputTag hoLabel_

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 160 of file HcalCableMapper.cc.

References edm::Event::getByLabel(), hbheLabel_, hfLabel_, hoLabel_, and record().

160  {
161 
163  e.getByLabel(hbheLabel_,hbhe);
164 
166  e.getByLabel(hfLabel_,hf);
168  e.getByLabel(hoLabel_,ho);
169 
170 
171  record(*hbhe);
172  record(*hf);
173  record(*ho);
174 }
void record(const DigiCollection &digis)
edm::InputTag hbheLabel_
edm::InputTag hfLabel_
edm::InputTag hoLabel_
void HcalCableMapper::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 179 of file HcalCableMapper.cc.

References trackerHits::c, fullHistory_, i, IdSet, j, gen::k, GetRecoTauVFromDQM_MC_cff::kk, process(), and alignCSCRings::s.

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

Definition at line 68 of file HcalCableMapper.cc.

References trackerHits::c, gather_cfg::cout, HcalElectronicsId::dccid(), createTree::dd, HcalDetId::depth(), det_names, HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), errorMatrix2Lands::header, HcalElectronicsId::htrSlot(), HcalElectronicsId::htrTopBottom(), HcalDetId::ietaAbs(), HcalDetId::iphi(), HcalElectronicsId::readoutVMECrateId(), HcalElectronicsId::spigot(), and HcalDetId::subdet().

Referenced by Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), endJob(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

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

Definition at line 38 of file HcalCableMapper.cc.

References i, and lumiQueryAPI::q.

Referenced by analyze().

38  {
39 
40  for (typename DigiCollection::const_iterator digi=digis.begin(); digi!=digis.end(); digi++) {
41 
42  SampleSet q;
43  for (int i=0; i<digi->size(); i++)
44  q.push_back(digi->sample(i));
45 
46  if (fullHistory_.find(digi->id())==fullHistory_.end()) fullHistory_.insert(std::pair<HcalDetId,std::vector<SampleSet> >(digi->id(),std::vector<SampleSet>()));
47  if (IdSet.find(digi->id())==IdSet.end()) IdSet.insert(std::pair<HcalDetId,HcalElectronicsId>(digi->id(),HcalElectronicsId()));
48  fullHistory_[digi->id()].push_back(q);
49  IdSet[digi->id()]=digi->elecId();
50  }
51  }
int i
Definition: DBlmapReader.cc:9
std::map< HcalDetId, std::vector< SampleSet > > fullHistory_
std::vector< HcalQIESample > SampleSet
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...

Member Data Documentation

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

Definition at line 33 of file HcalCableMapper.cc.

Referenced by endJob().

edm::InputTag HcalCableMapper::hbheLabel_
private

Definition at line 35 of file HcalCableMapper.cc.

Referenced by analyze().

edm::InputTag HcalCableMapper::hfLabel_
private

Definition at line 35 of file HcalCableMapper.cc.

Referenced by analyze().

edm::InputTag HcalCableMapper::hoLabel_
private

Definition at line 35 of file HcalCableMapper.cc.

Referenced by analyze().

IdMap HcalCableMapper::IdSet
private

Definition at line 34 of file HcalCableMapper.cc.

Referenced by endJob().