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 Attributes
L1TOverlapReader Class Reference
Inheritance diagram for L1TOverlapReader:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
string hash (void *buf, size_t len) const
 
 L1TOverlapReader (const edm::ParameterSet &pset)
 
virtual ~L1TOverlapReader (void)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool printLayerMap
 

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 &)
 
- 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 21 of file L1TOverlapReader.cc.

Constructor & Destructor Documentation

L1TOverlapReader::L1TOverlapReader ( const edm::ParameterSet pset)
inlineexplicit

Definition at line 28 of file L1TOverlapReader.cc.

References edm::ParameterSet::getUntrackedParameter().

28  : edm::EDAnalyzer(){
29  printLayerMap = pset.getUntrackedParameter<bool>("printLayerMap", false);
30  }
T getUntrackedParameter(std::string const &, T const &) const
virtual L1TOverlapReader::~L1TOverlapReader ( void  )
inlinevirtual

Definition at line 31 of file L1TOverlapReader.cc.

31 {}

Member Function Documentation

void L1TOverlapReader::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 62 of file L1TOverlapReader.cc.

References a, L1TMuonOverlapParams::LayerMapNode::bendingLayer, L1TMuonOverlapParams::LayerMapNode::connectedToLayer, gather_cfg::cout, l1t::LUT::data(), TauDecayModes::dec, edm::EventSetup::get(), cond::hash, L1TMuonOverlapParams::LayerMapNode::hwNumber, i, j, L1TMuonOverlapParams::LayerMapNode::logicNumber, l1t::LUT::maxSize(), gen::n, and edm::ESHandle< class >::product().

62  {
63 
64  // Pull the config from the ES
66  evSetup.get<L1TMuonOverlapParamsRcd>().get( handle1 ) ;
67  boost::shared_ptr<L1TMuonOverlapParams> ptr1(new L1TMuonOverlapParams(*(handle1.product ())));
68 
69  cout<<"Some fields in L1TMuonOverlapParams: "<<endl;
70 
71  cout<<" fwVersion() = "<<ptr1->fwVersion()<<endl;
72  cout<<" nPdfAddrBits() = "<<ptr1->nPdfAddrBits()<<endl;
73  cout<<" nPdfValBits() = "<<ptr1->nPdfValBits()<<endl;
74  cout<<" nHitsPerLayer() = "<<ptr1->nHitsPerLayer()<<endl;
75  cout<<" nPhiBits() = "<<ptr1->nPhiBits()<<endl;
76  cout<<" nPhiBins() = "<<ptr1->nPhiBins()<<endl;
77  cout<<" nRefHits() = "<<ptr1->nRefHits()<<endl;
78  cout<<" nTestRefHits() = "<<ptr1->nTestRefHits()<<endl;
79  cout<<" nProcessors() = "<<ptr1->nProcessors()<<endl;
80  cout<<" nLogicRegions() = "<<ptr1->nLogicRegions()<<endl;
81  cout<<" nInputs() = "<<ptr1->nInputs()<<endl;
82  cout<<" nLayers() = "<<ptr1->nLayers()<<endl;
83  cout<<" nRefLayers() = "<<ptr1->nRefLayers()<<endl;
84  cout<<" nGoldenPatterns() = "<<ptr1->nGoldenPatterns()<<endl;
85 
86  const std::vector<int>* gp = ptr1->generalParams();
87  cout<<" number of general parameters: = "<<gp->size()<<endl;
88  cout<<" ";
89  for(auto a : *gp) cout<<a<<", ";
90  cout<<endl;
91 
92  const std::vector<L1TMuonOverlapParams::LayerMapNode> *lm = ptr1->layerMap();
93  if( lm->size() ){
94  cout<<" layerMap() = ["<<lm->size()<<"] ";
96  for(unsigned int i=0; i<lm->size(); i++) lm_[i] = (*lm)[i];
97  cout << hash( lm_, sizeof(L1TMuonOverlapParams::LayerMapNode)*(lm->size()) ) << endl;
98  if( printLayerMap ){
100  for(unsigned int i=0; i<lm->size(); i++){
101  cout<<" ["<<i<<"]: hwNumber = "<<lm_[i].hwNumber<<" logicNumber = "<<lm_[i].logicNumber<<" bendingLayer = "<<lm_[i].bendingLayer<<" connectedToLayer = "<<lm_[i].connectedToLayer<<" ("<<flush;
102  char *n = (char*)(&(lm_[i]));
103  for(unsigned int j=0; j<sizeof(L1TMuonOverlapParams::LayerMapNode); j++) cout<<"0x"<<hex<<int(*(n+j))<<dec<<", ";
104  cout<<endl;
105  }
106 // hash( (void*)(&(lm_[i])), sizeof(L1TMuonOverlapParams::LayerMapNode) ) <<endl;
107  }
108  delete [] lm_;
109  } else {
110  cout<<" layerMap() = [0] "<<endl;
111  }
112 
113  const std::vector<L1TMuonOverlapParams::RefLayerMapNode> *rlm = ptr1->refLayerMap();
114  if( rlm->size() ){
115  cout<<" refLayerMap() = ["<<rlm->size()<<"] ";
117  for(unsigned int i=0; i<rlm->size(); i++) rlm_[i] = (*rlm)[i];
118  cout << hash( rlm_, sizeof(L1TMuonOverlapParams::RefLayerMapNode)*(rlm->size()) ) << endl;
119  delete [] rlm_;
120  } else {
121  cout<<" refLayerMap() = [0] "<<endl;
122  }
123 
124  const std::vector<L1TMuonOverlapParams::RefHitNode> *rhn = ptr1->refHitMap();
125  if( rhn->size() ){
126  cout<<" refHitMap() = ["<<rhn->size()<<"] ";
128  for(unsigned int i=0; i<rhn->size(); i++) rhn_[i] = (*rhn)[i];
129  cout << hash( rhn_, sizeof(L1TMuonOverlapParams::RefHitNode)*(rhn->size()) ) << endl;
130  delete [] rhn_;
131  } else {
132  cout<<" refHitMap() = [0] "<<endl;
133  }
134 
135  const std::vector<int> *gpsm = ptr1->globalPhiStartMap();
136  if( gpsm->size() ){
137  cout<<" globalPhiStartMap() = ["<<gpsm->size()<<"] ";
138  int gpsm_[gpsm->size()];
139  for(unsigned int i=0; i<gpsm->size(); i++) gpsm_[i] = (*gpsm)[i];
140  cout << hash( gpsm_, sizeof(int)*(gpsm->size()) ) << endl;
141  } else {
142  cout<<" globalPhiStartMap() = [0] "<<endl;
143  }
144 
145  const std::vector<L1TMuonOverlapParams::LayerInputNode> *lim = ptr1->layerInputMap();
146  if( lim->size() ){
147  cout<<" layerInputMap() = ["<<lim->size()<<"] ";
149  for(unsigned int i=0; i<lim->size(); i++) lim_[i] = (*lim)[i];
150  cout << hash( lim_, sizeof(L1TMuonOverlapParams::LayerInputNode)*(lim->size()) ) << endl;
151  delete [] lim_;
152  } else {
153  cout<<" layerInputMap() = [0] "<<endl;
154  }
155 
156  const std::vector<int> *css = ptr1->connectedSectorsStart();
157  if( css->size() ){
158  cout<<" connectedSectorsStart() = ["<<css->size()<<"] ";
159  int css_[css->size()];
160  for(unsigned int i=0; i<css->size(); i++) css_[i] = (*css)[i];
161  cout << hash( css_, sizeof(int)*(css->size()) ) << endl;
162  } else {
163  cout<<" connectedSectorsStart() = [0] "<<endl;
164  }
165 
166  const std::vector<int> *cse = ptr1->connectedSectorsEnd();
167  if( cse->size() ){
168  cout<<" connectedSectorsEnd() = ["<<cse->size()<<"] ";
169  int cse_[cse->size()];
170  for(unsigned int i=0; i<cse->size(); i++) cse_[i] = (*cse)[i];
171  cout << hash( cse_, sizeof(int)*(cse->size()) ) << endl;
172  } else {
173  cout<<" connectedSectorsEnd() = [0] "<<endl;
174  }
175 
176 
177  const l1t::LUT *clut = ptr1->chargeLUT();
178  if( clut->maxSize() ){
179  cout<<" chargeLUT = ["<<clut->maxSize()<<"] ";
180  int clut_[clut->maxSize()];
181  for(unsigned int i=0; i<clut->maxSize(); i++) clut_[i] = clut->data(i);
182  cout << hash( clut_, sizeof(int)*(clut->maxSize()) ) << endl;
183  } else {
184  cout<<" chargeLUT = [0] "<<endl;
185  }
186 
187  const l1t::LUT *elut = ptr1->etaLUT();
188  if( elut->maxSize() ){
189  cout<<" etaLUT = ["<<elut->maxSize()<<"] ";
190  int elut_[elut->maxSize()];
191  for(unsigned int i=0; i<elut->maxSize(); i++) elut_[i] = elut->data(i);
192  cout << hash( elut_, sizeof(int)*(elut->maxSize()) ) << endl;
193  } else {
194  cout<<" chargeLUT = [0] "<<endl;
195  }
196 
197  const l1t::LUT *ptlut = ptr1->ptLUT();
198  if( ptlut->maxSize() ){
199  cout<<" ptLUT = ["<<ptlut->maxSize()<<"] "<<flush;
200  int ptlut_[ptlut->maxSize()];
201  for(unsigned int i=0; i<ptlut->maxSize(); i++) ptlut_[i] = ptlut->data(i);
202  cout << hash( ptlut_, sizeof(int)*(ptlut->maxSize()) ) << endl;
203  } else {
204  cout<<" ptLUT = [0] "<<endl;
205  }
206 
207  const l1t::LUT *plut = ptr1->pdfLUT();
208  if( plut->maxSize() ){
209  cout<<" pdfLUT = ["<<plut->maxSize()<<"] "<<flush;
210  int plut_[plut->maxSize()];
211  for(unsigned int i=0; i<plut->maxSize(); i++) plut_[i] = plut->data(i);
212  cout << hash( plut_, sizeof(int)*(plut->maxSize()) ) << endl;
213  } else {
214  cout<<" pdfLUT = [0] "<<endl;
215  }
216 
217  const l1t::LUT *mlut = ptr1->meanDistPhiLUT();
218  if( mlut->maxSize() ){
219  cout<<" meanDistPhiLUT = ["<<mlut->maxSize()<<"] "<<flush;
220  int mlut_[mlut->maxSize()];
221  for(unsigned int i=0; i<mlut->maxSize(); i++) mlut_[i] = mlut->data(i);
222  cout << hash( mlut_, sizeof(int)*(mlut->maxSize()) ) << endl;
223  } else {
224  cout<<" meanDistPhiLUT = [0] "<<endl;
225  }
226 
227 }
int i
Definition: DBlmapReader.cc:9
unsigned int hwNumber
short layer number used within OMTF emulator
unsigned int maxSize() const
Definition: LUT.h:53
unsigned int logicNumber
logic numer of the layer
int j
Definition: DBlmapReader.cc:9
bool bendingLayer
Is this a bending layers?
string hash(void *buf, size_t len) const
Definition: LUT.h:29
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
double a
Definition: hdecay.h:121
tuple cout
Definition: gather_cfg.py:145
int data(unsigned int address) const
Definition: LUT.h:46
string L1TOverlapReader::hash ( void *  buf,
size_t  len 
) const

Definition at line 40 of file L1TOverlapReader.cc.

References Exception, cond::hash, i, AlCaHLTBitMon_QueryRunRegistry::string, and tmp.

40  {
41  char tmp[SHA_DIGEST_LENGTH*2+1];
42  bzero(tmp,sizeof(tmp));
43  SHA_CTX ctx;
44  if( !SHA1_Init( &ctx ) )
45  throw cms::Exception("L1TCaloParamsReader::hash")<<"SHA1 initialization error";
46 
47  if( !SHA1_Update( &ctx, buf, len ) )
48  throw cms::Exception("L1TCaloParamsReader::hash")<<"SHA1 processing error";
49 
50  unsigned char hash[SHA_DIGEST_LENGTH];
51  if( !SHA1_Final(hash, &ctx) )
52  throw cms::Exception("L1TCaloParamsReader::hash")<<"SHA1 finalization error";
53 
54  // re-write bytes in hex
55  for(unsigned int i=0; i<20; i++)
56  ::sprintf(&tmp[i*2], "%02x", hash[i]);
57 
58  tmp[20*2] = 0;
59  return string(tmp);
60 }
int i
Definition: DBlmapReader.cc:9
string hash(void *buf, size_t len) const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100

Member Data Documentation

bool L1TOverlapReader::printLayerMap
private

Definition at line 23 of file L1TOverlapReader.cc.