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();
177 LogDebug(
"l1t|Global")<<
"Number of bunch crossings stored: " << (*m_triggerMaskAlgoTrig).size() << endl;
180 std::map<int, std::vector<int> >::const_iterator it=triggerAlgoMaskAlgoTrig->begin();
182 std::vector<int> maskedBxs;
185 while(it != triggerAlgoMaskAlgoTrig->end())
187 std::vector<int>
masks = it->second;
190 for (
unsigned int imask=0; imask< masks.size(); imask++){
191 if (masks.at(imask) == algBit) maskedBxs.push_back(it->first);
198 if (!maskedBxs.empty()){
199 LogDebug(
"l1t|Global") <<
"i Algo: "<< algBit <<
"\t" << algName <<
" masked\n";
200 for (
unsigned int ibx=0; ibx< maskedBxs.size(); ibx++){
228 const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[
m_PreScaleColumn];
235 for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->begin(); itAlgo !=
m_algorithmMap->end(); itAlgo++) {
239 int algBit = (itAlgo->second).getIndex();
241 bool decisionInitial = algBlk->getAlgoDecisionInitial(algBit);
245 bool decisionInterm = algBlk->getAlgoDecisionInterm(algBit);
249 bool decisionFinal = algBlk->getAlgoDecisionFinal(algBit);
256 LogDebug(
"l1t|Global") <<
"Number of bunch crossings stored: " << (*m_triggerMaskAlgoTrig).size() << endl;
259 std::map<int, std::vector<int> >::const_iterator it=triggerAlgoMaskAlgoTrig->begin();
261 std::vector<int> maskedBxs;
265 while(it != triggerAlgoMaskAlgoTrig->end())
267 std::vector<int>
masks = it->second;
270 for (
unsigned int imask=0; imask< masks.size(); imask++){
271 if (masks.at(imask) == algBit) maskedBxs.push_back(it->first);
277 if (!maskedBxs.empty()){
278 LogDebug(
"l1t|Global") <<
"Algo: "<< algBit <<
"\t" << algName <<
" masked\n";
279 for (
unsigned int ibx=0; ibx< maskedBxs.size(); ibx++){
295 std::ifstream inputPrescaleFile;
299 std::vector<std::vector<int> > vec;
300 std::vector<std::vector<int> > prescale_vec;
302 if( inputPrescaleFile ){
310 while( getline(inputPrescaleFile,line) ){
312 if( !line.compare(0, prefix1.size(), prefix1) )
continue;
315 istringstream
split(line);
320 while( split >> value ){
323 vec.push_back(std::vector<int>());
326 vec[
col].push_back(value);
339 int NumPrescaleSets = 0;
340 for(
int iCol=0; iCol<
int(vec.size()); iCol++ ){
341 if( !vec[iCol].
empty() ){
342 int firstRow = vec[iCol][0];
344 if( firstRow >= 0 ) NumPrescaleSets++;
351 if( NumPrescaleSets > 0 ){
353 for(
int iSet=0; iSet<NumPrescaleSets; iSet++ ){
354 prescale_vec.push_back(std::vector<int>());
356 int inputDefaultPrescale = 1;
357 prescale_vec[iSet].push_back(inputDefaultPrescale);
362 for(
int iBit=1; iBit<
int(vec[0].
size()); iBit++ ){
363 unsigned int algoBit = vec[0][iBit];
366 for(
int iSet=0; iSet<
int(vec.size()); iSet++ ){
368 if( !vec[iSet].
empty() ){
369 useSet = vec[iSet][0];
373 if( useSet<0 )
continue;
375 int prescale = vec[iSet][iBit];
376 prescale_vec[useSet][algoBit] = prescale;
381 <<
"\nPrescale file has algo bit: " << algoBit
383 <<
"\nSomething is wrong. Ignoring." 393 <<
"\nFilling the prescale vectors with prescale 1" 394 <<
"\nSetting prescale set to 0" 400 prescale_vec.push_back(std::vector<int>());
402 int inputDefaultPrescale = 0;
403 prescale_vec[
col].push_back(inputDefaultPrescale);
408 inputPrescaleFile.close();
475 std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->find(algName);
477 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)