38 edm::FileInPath f1(
"L1Trigger/L1TGlobal/data/Luminosity/startup/prescale_L1TGlobal.csv");
152 <<
"\nSetting prescale column to 0" 157 const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[
m_PreScaleColumn];
159 for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->begin(); itAlgo !=
m_algorithmMap->end(); itAlgo++) {
163 int algBit = (itAlgo->second).getIndex();
168 LogDebug(
"l1t|Global")<<
"Number of bunch crossings stored: " << (*m_triggerMaskAlgoTrig).size() << endl;
171 std::map<int, std::vector<int> >::const_iterator it=triggerAlgoMaskAlgoTrig->begin();
173 std::vector<int> maskedBxs;
176 while(it != triggerAlgoMaskAlgoTrig->end())
178 std::vector<int>
masks = it->second;
181 for (
unsigned int imask=0; imask< masks.size(); imask++){
182 if (masks.at(imask) == algBit) maskedBxs.push_back(it->first);
189 if (maskedBxs.size()>0){
190 LogDebug(
"l1t|Global") <<
"i Algo: "<< algBit <<
"\t" << algName <<
" masked\n";
191 for (
unsigned int ibx=0; ibx< maskedBxs.size(); ibx++){
219 const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[
m_PreScaleColumn];
226 for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->begin(); itAlgo !=
m_algorithmMap->end(); itAlgo++) {
230 int algBit = (itAlgo->second).getIndex();
232 bool decisionInitial = algBlk->getAlgoDecisionInitial(algBit);
236 bool decisionInterm = algBlk->getAlgoDecisionInterm(algBit);
240 bool decisionFinal = algBlk->getAlgoDecisionFinal(algBit);
247 LogDebug(
"l1t|Global") <<
"Number of bunch crossings stored: " << (*m_triggerMaskAlgoTrig).size() << endl;
250 std::map<int, std::vector<int> >::const_iterator it=triggerAlgoMaskAlgoTrig->begin();
252 std::vector<int> maskedBxs;
256 while(it != triggerAlgoMaskAlgoTrig->end())
258 std::vector<int>
masks = it->second;
261 for (
unsigned int imask=0; imask< masks.size(); imask++){
262 if (masks.at(imask) == algBit) maskedBxs.push_back(it->first);
268 if (maskedBxs.size()>0){
269 LogDebug(
"l1t|Global") <<
"Algo: "<< algBit <<
"\t" << algName <<
" masked\n";
270 for (
unsigned int ibx=0; ibx< maskedBxs.size(); ibx++){
286 std::ifstream inputPrescaleFile;
290 std::vector<std::vector<int> > vec;
291 std::vector<std::vector<int> > prescale_vec;
293 if( inputPrescaleFile ){
301 while( getline(inputPrescaleFile,line) ){
303 if( !line.compare(0, prefix1.size(), prefix1) )
continue;
306 istringstream
split(line);
311 while( split >> value ){
314 vec.push_back(std::vector<int>());
317 vec[
col].push_back(value);
330 int NumPrescaleSets = 0;
331 for(
int iCol=0; iCol<
int(vec.size()); iCol++ ){
332 if( vec[iCol].
size() > 0 ){
333 int firstRow = vec[iCol][0];
335 if( firstRow >= 0 ) NumPrescaleSets++;
342 if( NumPrescaleSets > 0 ){
344 for(
int iSet=0; iSet<NumPrescaleSets; iSet++ ){
345 prescale_vec.push_back(std::vector<int>());
347 int inputDefaultPrescale = 1;
348 prescale_vec[iSet].push_back(inputDefaultPrescale);
353 for(
int iBit=1; iBit<
int(vec[0].
size()); iBit++ ){
354 unsigned int algoBit = vec[0][iBit];
357 for(
int iSet=0; iSet<
int(vec.size()); iSet++ ){
359 if( vec[iSet].
size() > 0 ){
360 useSet = vec[iSet][0];
364 if( useSet<0 )
continue;
366 int prescale = vec[iSet][iBit];
367 prescale_vec[useSet][algoBit] = prescale;
372 <<
"\nPrescale file has algo bit: " << algoBit
374 <<
"\nSomething is wrong. Ignoring." 384 <<
"\nFilling the prescale vectors with prescale 1" 385 <<
"\nSetting prescale set to 0" 391 prescale_vec.push_back(std::vector<int>());
393 int inputDefaultPrescale = 0;
394 prescale_vec[
col].push_back(inputDefaultPrescale);
399 inputPrescaleFile.close();
466 std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->find(algName);
468 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_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
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
const bool getMaskByBit(int &bit, std::vector< int > &mask) const
bool m_algorithmTriggersUnprescaled
edm::Handle< BXVector< GlobalAlgBlk > > m_uGtAlgBlk
std::string fullPath() const
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)