CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
L1TGlobalSummary Class Reference
Inheritance diagram for L1TGlobalSummary:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginRun (Run const &, EventSetup const &) override
 
virtual void endRun (Run const &, EventSetup const &) override
 
 L1TGlobalSummary (const edm::ParameterSet &)
 
virtual ~L1TGlobalSummary ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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 ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

InputTag algInputTag_
 
EDGetToken algToken_
 
std::vector< int > decisionCount_
 
bool dumpRecord_
 
bool dumpTriggerResults_
 
bool dumpTriggerSummary_
 
InputTag extInputTag_
 
EDGetToken extToken_
 
std::vector< int > finalCount_
 
int finalOrCount
 
L1TGlobalUtilgtUtil_
 
std::vector< int > intermCount_
 
int maxBx_
 
int minBx_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 32 of file L1TGlobalSummary.cc.

Constructor & Destructor Documentation

L1TGlobalSummary::L1TGlobalSummary ( const edm::ParameterSet iConfig)
explicit

Definition at line 59 of file L1TGlobalSummary.cc.

References edm::ParameterSet::getParameter().

59  {
60  algInputTag_ = iConfig.getParameter<InputTag>("AlgInputTag");
61  extInputTag_ = iConfig.getParameter<InputTag>("ExtInputTag");
62  algToken_ = consumes<BXVector<GlobalAlgBlk>>(algInputTag_);
63  extToken_ = consumes<BXVector<GlobalExtBlk>>(extInputTag_);
64  dumpRecord_ = iConfig.getParameter<bool>("DumpRecord");
65  dumpTriggerResults_ = iConfig.getParameter<bool>("DumpTrigResults");
66  dumpTriggerSummary_ = iConfig.getParameter<bool>("DumpTrigSummary");
67  minBx_ = iConfig.getParameter<int>("MinBx");
68  maxBx_ = iConfig.getParameter<int>("MaxBx");
69  gtUtil_ = new L1TGlobalUtil(iConfig, consumesCollector(), *this, algInputTag_, extInputTag_);
70  finalOrCount = 0;
71 }
T getParameter(std::string const &) const
L1TGlobalUtil * gtUtil_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
virtual L1TGlobalSummary::~L1TGlobalSummary ( )
inlinevirtual

Definition at line 35 of file L1TGlobalSummary.cc.

35 {};

Member Function Documentation

void L1TGlobalSummary::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 144 of file L1TGlobalSummary.cc.

References gather_cfg::cout, TauDecayModes::dec, edm::first(), edm::Event::getByToken(), i, edm::HandleBase::isValid(), LogDebug, masks, mergeVDriftHistosByStation::name, makeHLTPrescaleTable::prescales, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, and TriggerAnalyzer::veto.

144  {
145 
147  iEvent.getByToken(algToken_,alg);
148 
150  iEvent.getByToken(extToken_,ext);
151 
152  LogDebug("l1t|Global") << "retrieved L1 GT data blocks" << endl;
153 
155 
156  //Fill the L1 result maps
157  gtUtil_->retrieveL1(iEvent,evSetup,algToken_);
158 
159  LogDebug("l1t|Global") << "retrieved L1 data from GT Util" << endl;
160 
161  // grab the map for the final decisions
162  const std::vector<std::pair<std::string, bool> > initialDecisions = gtUtil_->decisionsInitial();
163  const std::vector<std::pair<std::string, bool> > intermDecisions = gtUtil_->decisionsInterm();
164  const std::vector<std::pair<std::string, bool> > finalDecisions = gtUtil_->decisionsFinal();
165  const std::vector<std::pair<std::string, int> > prescales = gtUtil_->prescales();
166  const std::vector<std::pair<std::string, bool> > masks = gtUtil_->masks();
167  const std::vector<std::pair<std::string, bool> > vetoMasks = gtUtil_->vetoMasks();
168 
169  if ((decisionCount_.size() != gtUtil_->decisionsInitial().size())
170  ||(intermCount_.size() != gtUtil_->decisionsInterm().size())
171  ||(finalCount_.size() != gtUtil_->decisionsFinal().size())){
172  LogError("l1t|Global") << "gtUtil sizes inconsistent across run." << endl;
173  return;
174  }
175 
177  cout << " Bit Algorithm Name Init aBXM Final PS Factor Masked Veto " << endl;
178  cout << "============================================================================================================" << endl;
179  }
180  for(unsigned int i=0; i<initialDecisions.size(); i++) {
181 
182  // get the name and trigger result
183  std::string name = (initialDecisions.at(i)).first;
184  if(name == "NULL") continue;
185 
186  bool resultInit = (initialDecisions.at(i)).second;
187 
188  // get prescaled and final results (need some error checking here)
189  bool resultInterm = (intermDecisions.at(i)).second;
190  bool resultFin = (finalDecisions.at(i)).second;
191 
192  // get the prescale and mask (needs some error checking here)
193  int prescale = (prescales.at(i)).second;
194  bool mask = (masks.at(i)).second;
195  bool veto = (vetoMasks.at(i)).second;
196 
197  if (resultInit) decisionCount_[i]++;
198  if (resultInterm) intermCount_[i]++;
199  if (resultFin) finalCount_[i]++;
200 
201  //cout << i << " " << decisionCount_[i] << "\n";
202 
204  cout << std::dec << setfill(' ') << " " << setw(5) << i << " " << setw(40) << name.c_str() << " " << setw(7) << resultInit << setw(7) << resultInterm << setw(7) << resultFin << setw(10) << prescale << setw(11) << mask << setw(9) << veto << endl;
205  }
206  }
207  bool finOR = gtUtil_->getFinalOR();
208  if (finOR) finalOrCount++;
210  cout << " FinalOR = " << finOR <<endl;
211  cout << "===========================================================================================================" << endl;
212  }
213  }
214 
215  if (dumpRecord_){
216  int i = 0; // now now just printing BX=0...
217 
218  // Dump the coutput record
219  cout << " ------ ext ----------" << endl;
220  if(ext.isValid()) {
221  if(i>=ext->getFirstBX() && i<=ext->getLastBX()) {
222  for(std::vector<GlobalExtBlk>::const_iterator extBlk = ext->begin(i); extBlk != ext->end(i); ++extBlk) {
223  extBlk->print(cout);
224  }
225  } else {
226  cout << "No Ext Conditions stored for this bx " << i << endl;
227  }
228  } else {
229  LogError("L1TGlobalSummary") << "No ext Data in this event " << endl;
230  }
231 
232  // Dump the coutput record
233  cout << " ------ alg ----------" << endl;
234  if(alg.isValid()) {
235  if(i>=alg->getFirstBX() && i<=alg->getLastBX()) {
236  for(std::vector<GlobalAlgBlk>::const_iterator algBlk = alg->begin(i); algBlk != alg->end(i); ++algBlk) {
237  algBlk->print(cout);
238  }
239  } else {
240  cout << "No Alg Decisions stored for this bx " << i << endl;
241  }
242  } else {
243  LogError("L1TGlobalSummary") << "No alg Data in this event " << endl;
244  }
245  }
246 
247 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
const std::vector< std::pair< std::string, int > > & prescales()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
L1TGlobalUtil * gtUtil_
const std::vector< std::pair< std::string, bool > > & masks()
U second(std::pair< T, U > const &p)
const std::vector< std::pair< std::string, bool > > & decisionsInterm()
const std::vector< std::pair< std::string, bool > > & vetoMasks()
std::vector< int > finalCount_
const std::vector< std::pair< std::string, bool > > & decisionsInitial()
std::vector< int > decisionCount_
bool isValid() const
Definition: HandleBase.h:75
bool getFinalOR() const
constexpr uint32_t masks[]
Definition: CaloRecHit.cc:12
const std::vector< std::pair< std::string, bool > > & decisionsFinal()
tuple cout
Definition: gather_cfg.py:145
std::vector< int > intermCount_
void retrieveL1(const edm::Event &iEvent, const edm::EventSetup &evSetup)
initialize the class (mainly reserve)
void L1TGlobalSummary::beginRun ( Run const &  ,
EventSetup const &  evSetup 
)
overridevirtual

Definition at line 88 of file L1TGlobalSummary.cc.

References lumiContext::fill, and findQualityFiles::size.

88  {
89  decisionCount_.clear();
90  intermCount_.clear();
91  finalCount_.clear();
92 
93  finalOrCount = 0;
94  gtUtil_->retrieveL1Setup(evSetup);
95 
96  int size = gtUtil_->decisionsInitial().size();
97  decisionCount_ .resize(size);
98  intermCount_ .resize(size);
99  finalCount_ .resize(size);
100  std::fill(decisionCount_.begin(), decisionCount_.end(), 0);
101  std::fill(intermCount_.begin(), intermCount_.end(), 0);
102  std::fill(finalCount_.begin(), finalCount_.end(), 0);
103 
104 }
string fill
Definition: lumiContext.py:319
L1TGlobalUtil * gtUtil_
std::vector< int > finalCount_
const std::vector< std::pair< std::string, bool > > & decisionsInitial()
std::vector< int > decisionCount_
void retrieveL1Setup(const edm::EventSetup &evSetup)
std::vector< int > intermCount_
tuple size
Write out results.
void L1TGlobalSummary::endRun ( Run const &  ,
EventSetup const &   
)
overridevirtual

Definition at line 106 of file L1TGlobalSummary.cc.

References TauDecayModes::dec, edm::first(), i, masks, mergeVDriftHistosByStation::name, makeHLTPrescaleTable::prescales, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, and TriggerAnalyzer::veto.

106  {
107 
108  if(dumpTriggerSummary_) {
109 
110  const std::vector<std::pair<std::string, int> > prescales = gtUtil_->prescales();
111  const std::vector<std::pair<std::string, bool> > masks = gtUtil_->masks();
112  const std::vector<std::pair<std::string, bool> > vetoMasks = gtUtil_->vetoMasks();
113 
114  // Dump the results
115  LogVerbatim("L1TGlobalSummary") << " " << endl;
116  LogVerbatim("L1TGlobalSummary") << " L1T menu Name : " << gtUtil_->gtTriggerMenuName() << endl;
117  LogVerbatim("L1TGlobalSummary") << " L1T menu Version: " << gtUtil_->gtTriggerMenuVersion() << endl;
118  LogVerbatim("L1TGlobalSummary") << " L1T menu Comment: " << gtUtil_->gtTriggerMenuComment() << endl;
119  LogVerbatim("L1TGlobalSummary") << " " << endl;
120  LogVerbatim("L1TGlobalSummary") << " Bit Algorithm Name Init PScd Final PS Factor Masked Veto " << endl;
121  LogVerbatim("L1TGlobalSummary") << "============================================================================================================" << endl;
122  for(unsigned int i=0; i<prescales.size(); i++) {
123 
124 
125  // get the prescale and mask (needs some error checking here)
126  int resultInit = decisionCount_[i];
127  int resultPre = intermCount_[i];
128  int resultFin = finalCount_[i];
129 
130  std::string name = (prescales.at(i)).first;
131  int prescale = (prescales.at(i)).second;
132  bool mask = (masks.at(i)).second;
133  bool veto = (vetoMasks.at(i)).second;
134 
135  if(name != "NULL") LogVerbatim("L1TGlobalSummary") << std::dec << setfill(' ') << " " << setw(5) << i << " " << setw(40) << name.c_str() << " " << setw(7) << resultInit << setw(7) << resultPre << setw(7) << resultFin << setw(10) << prescale << setw(11) << mask << setw(9) << veto << endl;
136  }
137  LogVerbatim("L1TGlobalSummary") << " Final OR Count = " << finalOrCount <<endl;
138  LogVerbatim("L1TGlobalSummary") << "===========================================================================================================" << endl;
139  }
140 
141 }
int i
Definition: DBlmapReader.cc:9
const std::string & gtTriggerMenuComment() const
const std::vector< std::pair< std::string, int > > & prescales()
L1TGlobalUtil * gtUtil_
const std::vector< std::pair< std::string, bool > > & masks()
const std::string & gtTriggerMenuVersion() const
U second(std::pair< T, U > const &p)
const std::vector< std::pair< std::string, bool > > & vetoMasks()
std::vector< int > finalCount_
const std::string & gtTriggerMenuName() const
std::vector< int > decisionCount_
constexpr uint32_t masks[]
Definition: CaloRecHit.cc:12
std::vector< int > intermCount_
void L1TGlobalSummary::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 73 of file L1TGlobalSummary.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_25ns10e33_v2_cff::InputTag.

73  {
75  // These parameters are part of the L1T/HLT interface, avoid changing if possible::
76  desc.add<edm::InputTag> ("AlgInputTag", edm::InputTag(""))->setComment("InputTag for uGT Algorithm Block (required parameter: default value is invalid)");
77  desc.add<edm::InputTag> ("ExtInputTag", edm::InputTag(""))->setComment("InputTag for uGT External Block (required parameter: default value is invalid)");
78  // These parameters have well defined default values and are not currently
79  // part of the L1T/HLT interface. They can be cleaned up or updated at will:
80  desc.add<int> ("MinBx",0);
81  desc.add<int> ("MaxBx",0);
82  desc.add<bool> ("DumpTrigResults",false);
83  desc.add<bool> ("DumpRecord",false);
84  desc.add<bool> ("DumpTrigSummary",true);
85  descriptions.add("L1TGlobalSummary", desc);
86 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

InputTag L1TGlobalSummary::algInputTag_
private

Definition at line 42 of file L1TGlobalSummary.cc.

EDGetToken L1TGlobalSummary::algToken_
private

Definition at line 44 of file L1TGlobalSummary.cc.

std::vector<int> L1TGlobalSummary::decisionCount_
private

Definition at line 53 of file L1TGlobalSummary.cc.

bool L1TGlobalSummary::dumpRecord_
private

Definition at line 46 of file L1TGlobalSummary.cc.

bool L1TGlobalSummary::dumpTriggerResults_
private

Definition at line 47 of file L1TGlobalSummary.cc.

bool L1TGlobalSummary::dumpTriggerSummary_
private

Definition at line 48 of file L1TGlobalSummary.cc.

InputTag L1TGlobalSummary::extInputTag_
private

Definition at line 43 of file L1TGlobalSummary.cc.

EDGetToken L1TGlobalSummary::extToken_
private

Definition at line 45 of file L1TGlobalSummary.cc.

std::vector<int> L1TGlobalSummary::finalCount_
private

Definition at line 55 of file L1TGlobalSummary.cc.

int L1TGlobalSummary::finalOrCount
private

Definition at line 56 of file L1TGlobalSummary.cc.

L1TGlobalUtil* L1TGlobalSummary::gtUtil_
private

Definition at line 51 of file L1TGlobalSummary.cc.

std::vector<int> L1TGlobalSummary::intermCount_
private

Definition at line 54 of file L1TGlobalSummary.cc.

int L1TGlobalSummary::maxBx_
private

Definition at line 50 of file L1TGlobalSummary.cc.

int L1TGlobalSummary::minBx_
private

Definition at line 49 of file L1TGlobalSummary.cc.