test
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 Member Functions | Private Attributes
L1TGlobalPrescalesVetosViewer Class Reference
Inheritance diagram for L1TGlobalPrescalesVetosViewer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 L1TGlobalPrescalesVetosViewer (const edm::ParameterSet &pset)
 
virtual ~L1TGlobalPrescalesVetosViewer (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 ()
 
 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 & 
itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

std::string hash (void *buf, size_t len) const
 

Private Attributes

int32_t bxmask_map_verbosity
 
int32_t prescale_table_verbosity
 

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 12 of file L1TGlobalPrescalesVetosViewer.cc.

Constructor & Destructor Documentation

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

Definition at line 22 of file L1TGlobalPrescalesVetosViewer.cc.

References bxmask_map_verbosity, edm::ParameterSet::getUntrackedParameter(), and prescale_table_verbosity.

22  : edm::EDAnalyzer(){
23  prescale_table_verbosity = pset.getUntrackedParameter<int32_t>("prescale_table_verbosity", 0);
24  bxmask_map_verbosity = pset.getUntrackedParameter<int32_t>("bxmask_map_verbosity", 0);
25  }
T getUntrackedParameter(std::string const &, T const &) const
virtual L1TGlobalPrescalesVetosViewer::~L1TGlobalPrescalesVetosViewer ( void  )
inlinevirtual

Definition at line 27 of file L1TGlobalPrescalesVetosViewer.cc.

27 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 57 of file L1TGlobalPrescalesVetosViewer.cc.

References cuy::col, gather_cfg::cout, end, edm::EventSetup::get(), cond::hash, i, PrescalesVetos_cff::L1TGlobalPrescalesVetos, masks, edm::ESHandle< class >::product(), and findQualityFiles::size.

57  {
58 
60  evSetup.get<L1TGlobalPrescalesVetosRcd>().get( handle1 ) ;
61  boost::shared_ptr<L1TGlobalPrescalesVetos> ptr(new L1TGlobalPrescalesVetos(*(handle1.product ())));
62 
63  edm::LogInfo("")<<"L1TGlobalPrescalesVetosViewer:";
64 
65  cout<<endl;
66  cout<<" version_ = "<<ptr->version_<<endl;
67  cout<<" bxmask_default_ = "<<ptr->bxmask_default_<<endl;
68 
69  size_t len_prescale_table_ = 0;
70  for(size_t col=0; col<ptr->prescale_table_.size(); col++){
71  size_t nRows = (ptr->prescale_table_)[ col ].size();
72  len_prescale_table_ += nRows;
73  if( prescale_table_verbosity > 0 ){
74  int column[ nRows ];
75  for(size_t row=0; row<nRows; row++)
76  column[ row ] = (ptr->prescale_table_)[ col ][ row ];
77  cout << " prescale_table_[" << col<< "][" << nRows << "] = ";
78  if( nRows )
79  cout << hash( column, sizeof(int)*nRows ) << endl;
80  else cout << 0 << endl;
81  }
82  }
83  int prescale_table_[len_prescale_table_];
84  for(size_t col=0, pos=0; col<ptr->prescale_table_.size(); col++){
85  size_t nRows = (ptr->prescale_table_)[ col ].size();
86  for(size_t row=0; row<nRows; row++,pos++)
87  prescale_table_[ pos ] = (ptr->prescale_table_)[ col ][ row ];
88  }
89  cout << " prescale_table_[["<<len_prescale_table_<<"]] = ";
90  if( len_prescale_table_ )
91  cout << hash( prescale_table_, sizeof(int)*len_prescale_table_ ) << endl;
92  else cout << 0 << endl;
93 
94  size_t len_bxmask_map_ = 0;
95  for(std::map<int, std::vector<int> >::const_iterator it = (ptr->bxmask_map_).begin(); it != (ptr->bxmask_map_).end(); it++){
96  len_bxmask_map_ += it->second.size();
97  if( bxmask_map_verbosity > 0 ){
98  int masks[ it->second.size() ];
99  for(size_t i=0; i<it->second.size(); i++)
100  masks[ i ] = it->second[i];
101  cout << " bxmask_map_[" << it->first << "][" << it->second.size() << "] = ";
102  if( it->second.size() )
103  cout << hash( masks, sizeof(int)*it->second.size() ) << endl;
104  else cout << 0 << endl;
105  }
106  }
107  int bxmask_map_[ len_bxmask_map_ ];
108  size_t pos = 0;
109  for(std::map<int, std::vector<int> >::const_iterator it = (ptr->bxmask_map_).begin(); it != (ptr->bxmask_map_).end(); it++){
110  for(size_t i=0; i<it->second.size(); i++,pos++) bxmask_map_[ pos ] = it->second[i];
111  }
112  cout << " bxmask_map_[["<< len_bxmask_map_ <<"]] = ";
113  if( len_bxmask_map_ )
114  cout << hash( bxmask_map_, sizeof(int)*len_bxmask_map_ ) << endl;
115  else cout << 0 << endl;
116 
117  int veto_[ (ptr->veto_).size() ];
118  for(size_t i=0; i<(ptr->veto_).size(); i++) veto_[i] = (ptr->veto_)[i];
119  cout << " veto_[" << (ptr->veto_).size() << "] = ";
120  if( (ptr->veto_).size() )
121  cout << hash( veto_, sizeof(int)*(ptr->veto_).size() ) << endl;
122  else cout << 0 << endl;
123 
124  int exp_ints_[ (ptr->exp_ints_).size() ];
125  for(size_t i=0; i<(ptr->exp_ints_).size(); i++) exp_ints_[i] = (ptr->exp_ints_)[i];
126  cout << " exp_ints_[" << (ptr->exp_ints_).size() << "] = ";
127  if( (ptr->exp_ints_).size() )
128  cout << hash( exp_ints_, sizeof(int)*(ptr->exp_ints_).size() ) << endl;
129  else cout << 0 << endl;
130 
131  int exp_doubles_[ (ptr->exp_doubles_).size() ];
132  for(size_t i=0; i<(ptr->exp_doubles_).size(); i++) exp_ints_[i] = (ptr->exp_doubles_)[i];
133  cout << " exp_doubles_[" << (ptr->exp_doubles_).size() << "] = ";
134  if( (ptr->exp_doubles_).size() )
135  cout << hash( exp_doubles_, sizeof(int)*(ptr->exp_doubles_).size() ) << endl;
136  else cout << 0 << endl;
137 }
int i
Definition: DBlmapReader.cc:9
#define end
Definition: vmac.h:37
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
constexpr uint32_t masks[]
Definition: CaloRecHit.cc:12
tuple cout
Definition: gather_cfg.py:145
int col
Definition: cuy.py:1008
std::string hash(void *buf, size_t len) const
tuple size
Write out results.
std::string L1TGlobalPrescalesVetosViewer::hash ( void *  buf,
size_t  len 
) const
private

Definition at line 35 of file L1TGlobalPrescalesVetosViewer.cc.

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

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

Member Data Documentation

int32_t L1TGlobalPrescalesVetosViewer::bxmask_map_verbosity
private

Definition at line 15 of file L1TGlobalPrescalesVetosViewer.cc.

Referenced by L1TGlobalPrescalesVetosViewer().

int32_t L1TGlobalPrescalesVetosViewer::prescale_table_verbosity
private

Definition at line 14 of file L1TGlobalPrescalesVetosViewer.cc.

Referenced by L1TGlobalPrescalesVetosViewer().