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

Constructor & Destructor Documentation

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

Definition at line 23 of file L1TGlobalPrescalesVetosViewer.cc.

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

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

Definition at line 28 of file L1TGlobalPrescalesVetosViewer.cc.

28 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 58 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.

58  {
59 
61  evSetup.get<L1TGlobalPrescalesVetosRcd>().get( handle1 ) ;
62  boost::shared_ptr<L1TGlobalPrescalesVetos> ptr(new L1TGlobalPrescalesVetos(*(handle1.product ())));
63 
64  edm::LogInfo("")<<"L1TGlobalPrescalesVetosViewer:";
65 
66  cout<<endl;
67  cout<<" version_ = "<<ptr->version_<<endl;
68  cout<<" bxmask_default_ = "<<ptr->bxmask_default_<<endl;
69 
70  size_t len_prescale_table_ = 0;
71  for(size_t col=0; col<ptr->prescale_table_.size(); col++){
72  size_t nRows = (ptr->prescale_table_)[ col ].size();
73  len_prescale_table_ += nRows;
74  if( prescale_table_verbosity > 0 ){
75  int column[ nRows ];
76  for(size_t row=0; row<nRows; row++)
77  column[ row ] = (ptr->prescale_table_)[ col ][ row ];
78  cout << " prescale_table_[" << col<< "][" << nRows << "] = ";
79  if( nRows )
80  cout << hash( column, sizeof(int)*nRows ) << endl;
81  else cout << 0 << endl;
82  }
83  }
84  int prescale_table_[len_prescale_table_];
85  for(size_t col=0, pos=0; col<ptr->prescale_table_.size(); col++){
86  size_t nRows = (ptr->prescale_table_)[ col ].size();
87  for(size_t row=0; row<nRows; row++,pos++)
88  prescale_table_[ pos ] = (ptr->prescale_table_)[ col ][ row ];
89  }
90  cout << " prescale_table_[["<<len_prescale_table_<<"]] = ";
91  if( len_prescale_table_ )
92  cout << hash( prescale_table_, sizeof(int)*len_prescale_table_ ) << endl;
93  else cout << 0 << endl;
94 
95  if( prescale_table_verbosity > 1 ){
96  cout << endl << " Detailed view on the prescales * masks: " << endl;
97  for(size_t col=0; col<ptr->prescale_table_.size(); col++)
98  cout << setw(8) << " Index " << col;
99  cout << endl;
100  size_t nRows = (ptr->prescale_table_)[ 0 ].size();
101  for(size_t row=0; row<nRows; row++){
102  for(size_t col=0; col<ptr->prescale_table_.size(); col++)
103  cout << setw(8) << (ptr->prescale_table_)[ col ][ row ] ;
104  cout << endl;
105  }
106  cout << endl;
107  }
108 
109  size_t len_bxmask_map_ = 0;
110  for(std::map<int, std::vector<int> >::const_iterator it = (ptr->bxmask_map_).begin(); it != (ptr->bxmask_map_).end(); it++){
111  len_bxmask_map_ += it->second.size();
112  if( bxmask_map_verbosity > 0 ){
113  int masks[ it->second.size() ];
114  for(size_t i=0; i<it->second.size(); i++)
115  masks[ i ] = it->second[i];
116  cout << " bxmask_map_[" << it->first << "][" << it->second.size() << "] = ";
117  if( it->second.size() )
118  cout << hash( masks, sizeof(int)*it->second.size() ) << endl;
119  else cout << 0 << endl;
120  }
121  }
122  int bxmask_map_[ len_bxmask_map_ ];
123  size_t pos = 0;
124  for(std::map<int, std::vector<int> >::const_iterator it = (ptr->bxmask_map_).begin(); it != (ptr->bxmask_map_).end(); it++){
125  for(size_t i=0; i<it->second.size(); i++,pos++) bxmask_map_[ pos ] = it->second[i];
126  }
127  cout << " bxmask_map_[["<< len_bxmask_map_ <<"]] = ";
128  if( len_bxmask_map_ )
129  cout << hash( bxmask_map_, sizeof(int)*len_bxmask_map_ ) << endl;
130  else cout << 0 << endl;
131 
132  int veto_[ (ptr->veto_).size() ];
133  for(size_t i=0; i<(ptr->veto_).size(); i++) veto_[i] = (ptr->veto_)[i];
134  cout << " veto_[" << (ptr->veto_).size() << "] = ";
135  if( (ptr->veto_).size() )
136  cout << hash( veto_, sizeof(int)*(ptr->veto_).size() ) << endl;
137  else cout << 0 << endl;
138 
139  int exp_ints_[ (ptr->exp_ints_).size() ];
140  for(size_t i=0; i<(ptr->exp_ints_).size(); i++) exp_ints_[i] = (ptr->exp_ints_)[i];
141  cout << " exp_ints_[" << (ptr->exp_ints_).size() << "] = ";
142  if( (ptr->exp_ints_).size() )
143  cout << hash( exp_ints_, sizeof(int)*(ptr->exp_ints_).size() ) << endl;
144  else cout << 0 << endl;
145 
146  int exp_doubles_[ (ptr->exp_doubles_).size() ];
147  for(size_t i=0; i<(ptr->exp_doubles_).size(); i++) exp_ints_[i] = (ptr->exp_doubles_)[i];
148  cout << " exp_doubles_[" << (ptr->exp_doubles_).size() << "] = ";
149  if( (ptr->exp_doubles_).size() )
150  cout << hash( exp_doubles_, sizeof(int)*(ptr->exp_doubles_).size() ) << endl;
151  else cout << 0 << endl;
152 }
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 36 of file L1TGlobalPrescalesVetosViewer.cc.

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

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

Referenced by L1TGlobalPrescalesVetosViewer().

int32_t L1TGlobalPrescalesVetosViewer::prescale_table_verbosity
private

Definition at line 15 of file L1TGlobalPrescalesVetosViewer.cc.

Referenced by L1TGlobalPrescalesVetosViewer().