40 edm::FileInPath f1(
"L1Trigger/L1TGlobal/data/Luminosity/startup/prescale_L1TGlobal.csv");
161 <<
"\nSetting prescale column to 0" 166 const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[
m_PreScaleColumn];
168 for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->begin(); itAlgo !=
m_algorithmMap->end(); itAlgo++) {
172 int algBit = (itAlgo->second).getIndex();
175 if(
size_t(algBit) < prescaleSet.size() ) {
178 LogDebug(
"l1t|Global")<<
"Number of bunch crossings stored: " << (*m_triggerMaskAlgoTrig).size() << endl;
181 std::map<int, std::vector<int> >::const_iterator it=triggerAlgoMaskAlgoTrig->begin();
183 std::vector<int> maskedBxs;
186 while(it != triggerAlgoMaskAlgoTrig->end())
188 std::vector<int>
masks = it->second;
191 for (
unsigned int imask=0; imask< masks.size(); imask++){
192 if (masks.at(imask) == algBit) maskedBxs.push_back(it->first);
199 if (!maskedBxs.empty()){
200 LogDebug(
"l1t|Global") <<
"i Algo: "<< algBit <<
"\t" << algName <<
" masked\n";
201 for (
unsigned int ibx=0; ibx< maskedBxs.size(); ibx++){
230 if (iEvent.
run() == 1){
237 <<
"Prescale column extracted from GlobalAlgBlk too large: " <<
m_PreScaleColumn 239 <<
"\tResetting prescale column to 0" 245 const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[
m_PreScaleColumn];
252 for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->begin(); itAlgo !=
m_algorithmMap->end(); itAlgo++) {
256 int algBit = (itAlgo->second).getIndex();
258 bool decisionInitial = algBlk->getAlgoDecisionInitial(algBit);
262 bool decisionInterm = algBlk->getAlgoDecisionInterm(algBit);
266 bool decisionFinal = algBlk->getAlgoDecisionFinal(algBit);
271 if(
size_t(algBit) < prescaleSet.size()) {
285 std::ifstream inputPrescaleFile;
289 std::vector<std::vector<int> > vec;
290 std::vector<std::vector<int> > prescale_vec;
292 if( inputPrescaleFile ){
300 while( getline(inputPrescaleFile,line) ){
302 if( !line.compare(0, prefix1.size(), prefix1) )
continue;
305 istringstream
split(line);
310 while( split >> value ){
313 vec.push_back(std::vector<int>());
316 vec[
col].push_back(value);
329 int NumPrescaleSets = 0;
330 for(
int iCol=0; iCol<
int(vec.size()); iCol++ ){
331 if( !vec[iCol].
empty() ){
332 int firstRow = vec[iCol][0];
334 if( firstRow >= 0 ) NumPrescaleSets++;
341 if( NumPrescaleSets > 0 ){
343 for(
int iSet=0; iSet<NumPrescaleSets; iSet++ ){
344 prescale_vec.push_back(std::vector<int>());
346 int inputDefaultPrescale = 1;
347 prescale_vec[iSet].push_back(inputDefaultPrescale);
352 for(
int iBit=1; iBit<
int(vec[0].
size()); iBit++ ){
353 unsigned int algoBit = vec[0][iBit];
356 for(
int iSet=0; iSet<
int(vec.size()); iSet++ ){
358 if( !vec[iSet].
empty() ){
359 useSet = vec[iSet][0];
363 if( useSet<0 )
continue;
365 int prescale = vec[iSet][iBit];
366 prescale_vec[useSet][algoBit] = prescale;
371 <<
"\nPrescale file has algo bit: " << algoBit
373 <<
"\nSomething is wrong. Ignoring." 383 <<
"\nFilling the prescale vectors with prescale 1" 384 <<
"\nSetting prescale set to 0" 390 prescale_vec.push_back(std::vector<int>());
392 int inputDefaultPrescale = 0;
393 prescale_vec[
col].push_back(inputDefaultPrescale);
398 inputPrescaleFile.close();
465 std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->find(algName);
467 bit = (itAlgo->second).getIndex();
const_iterator end(int bx) const
const bool getInitialDecisionByBit(int &bit, bool &decision) const
const L1TUtmTriggerMenu * m_l1GtMenu
std::string m_preScaleFileName
const bool getAlgBitFromName(const std::string &AlgName, int &bit) const
const std::vector< std::vector< int > > & prescaleTable() const
void retrieveL1Event(const edm::Event &iEvent, const edm::EventSetup &evSetup)
bool m_algorithmTriggersUnmasked
bool getByToken(EDGetToken token, Handle< PROD > &result) const
unsigned long long m_l1GtPfAlgoCacheID
const bool getPrescaleByBit(int &bit, int &prescale) const
const bool getIntermDecisionByBit(int &bit, bool &decision) const
unsigned int m_numberOfPreScaleColumns
unsigned int m_PreScaleColumn
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
std::unique_ptr< L1TGlobalUtilHelper > m_l1tGlobalUtilHelper
const bool getInitialDecisionByName(const std::string &algName, bool &decision) const
std::vector< std::pair< std::string, bool > > m_decisionsInitial
bool valid() const
check that the L1TGlobalUtil has been properly initialised
void resetDecisionVectors()
clear decision vectors on a menu change
const std::map< int, std::vector< int > > & triggerAlgoBxMask() const
const std::map< std::string, L1TUtmAlgorithm > * m_algorithmMap
U second(std::pair< T, U > const &p)
const std::map< int, std::vector< int > > m_initialTriggerMaskAlgoTrig
static const PrescalesVetosHelper * readFromEventSetup(const L1TGlobalPrescalesVetos *es)
std::vector< std::pair< std::string, std::vector< int > > > m_masks
const std::map< int, std::vector< int > > * m_triggerMaskAlgoTrig
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool m_readPrescalesFromFile
const bool getFinalDecisionByName(const std::string &algName, bool &decision) const
void OverridePrescalesAndMasks(std::string filename, unsigned int psColumn=1)
const bool getMaskByName(const std::string &algName, std::vector< int > &mask) const
std::vector< std::pair< std::string, bool > > m_decisionsInterm
const bool getAlgNameFromBit(int &bit, std::string &AlgName) const
unsigned long long m_l1GtMenuCacheID
const l1t::PrescalesVetosHelper * m_l1GtPrescalesVetoes
void resetPrescaleVectors()
const bool getFinalDecisionByBit(int &bit, bool &decision) const
std::vector< std::pair< std::string, bool > > m_decisionsFinal
const bool getPrescaleByName(const std::string &algName, int &prescale) const
std::string fullPath() const
const bool getMaskByBit(int &bit, std::vector< int > &mask) const
bool m_algorithmTriggersUnprescaled
edm::Handle< BXVector< GlobalAlgBlk > > m_uGtAlgBlk
const std::vector< std::pair< std::string, std::vector< int > > > & masks()
const bool getIntermDecisionByName(const std::string &algName, bool &decision) const
const unsigned int m_maxNumberPhysTriggers
const_iterator begin(int bx) const
virtual ~L1TGlobalUtil()
destructor
void retrieveL1Setup(const edm::EventSetup &evSetup)
T const * product() const
std::vector< std::pair< std::string, int > > m_prescales
void loadPrescalesAndMasks()
unsigned int m_numberPhysTriggers
void retrieveL1(const edm::Event &iEvent, const edm::EventSetup &evSetup)
initialize the class (mainly reserve)