38 edm::FileInPath f1(
"L1Trigger/L1TGlobal/data/Luminosity/startup/prescale_L1TGlobal.csv");
156 <<
"\nSetting prescale column to 0" 161 const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[
m_PreScaleColumn];
163 for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->begin(); itAlgo !=
m_algorithmMap->end(); itAlgo++) {
167 int algBit = (itAlgo->second).getIndex();
172 LogDebug(
"l1t|Global")<<
"Number of bunch crossings stored: " << (*m_triggerMaskAlgoTrig).size() << endl;
175 std::map<int, std::vector<int> >::const_iterator it=triggerAlgoMaskAlgoTrig->begin();
177 std::vector<int> maskedBxs;
180 while(it != triggerAlgoMaskAlgoTrig->end())
182 std::vector<int>
masks = it->second;
185 for (
unsigned int imask=0; imask< masks.size(); imask++){
186 if (masks.at(imask) == algBit) maskedBxs.push_back(it->first);
193 if (maskedBxs.size()>0){
194 LogDebug(
"l1t|Global") <<
"i Algo: "<< algBit <<
"\t" << algName <<
" masked\n";
195 for (
unsigned int ibx=0; ibx< maskedBxs.size(); ibx++){
223 const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[
m_PreScaleColumn];
230 for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->begin(); itAlgo !=
m_algorithmMap->end(); itAlgo++) {
234 int algBit = (itAlgo->second).getIndex();
236 bool decisionInitial = algBlk->getAlgoDecisionInitial(algBit);
240 bool decisionInterm = algBlk->getAlgoDecisionInterm(algBit);
244 bool decisionFinal = algBlk->getAlgoDecisionFinal(algBit);
251 LogDebug(
"l1t|Global") <<
"Number of bunch crossings stored: " << (*m_triggerMaskAlgoTrig).size() << endl;
254 std::map<int, std::vector<int> >::const_iterator it=triggerAlgoMaskAlgoTrig->begin();
256 std::vector<int> maskedBxs;
260 while(it != triggerAlgoMaskAlgoTrig->end())
262 std::vector<int>
masks = it->second;
265 for (
unsigned int imask=0; imask< masks.size(); imask++){
266 if (masks.at(imask) == algBit) maskedBxs.push_back(it->first);
272 if (maskedBxs.size()>0){
273 LogDebug(
"l1t|Global") <<
"Algo: "<< algBit <<
"\t" << algName <<
" masked\n";
274 for (
unsigned int ibx=0; ibx< maskedBxs.size(); ibx++){
290 std::ifstream inputPrescaleFile;
294 std::vector<std::vector<int> > vec;
295 std::vector<std::vector<int> > prescale_vec;
297 if( inputPrescaleFile ){
305 while( getline(inputPrescaleFile,line) ){
307 if( !line.compare(0, prefix1.size(), prefix1) )
continue;
310 istringstream
split(line);
315 while( split >> value ){
318 vec.push_back(std::vector<int>());
321 vec[
col].push_back(value);
334 int NumPrescaleSets = 0;
335 for(
int iCol=0; iCol<
int(vec.size()); iCol++ ){
336 if( vec[iCol].
size() > 0 ){
337 int firstRow = vec[iCol][0];
339 if( firstRow >= 0 ) NumPrescaleSets++;
346 if( NumPrescaleSets > 0 ){
348 for(
int iSet=0; iSet<NumPrescaleSets; iSet++ ){
349 prescale_vec.push_back(std::vector<int>());
351 int inputDefaultPrescale = 1;
352 prescale_vec[iSet].push_back(inputDefaultPrescale);
357 for(
int iBit=1; iBit<
int(vec[0].
size()); iBit++ ){
358 unsigned int algoBit = vec[0][iBit];
361 for(
int iSet=0; iSet<
int(vec.size()); iSet++ ){
363 if( vec[iSet].
size() > 0 ){
364 useSet = vec[iSet][0];
368 if( useSet<0 )
continue;
370 int prescale = vec[iSet][iBit];
371 prescale_vec[useSet][algoBit] = prescale;
376 <<
"\nPrescale file has algo bit: " << algoBit
378 <<
"\nSomething is wrong. Ignoring." 388 <<
"\nFilling the prescale vectors with prescale 1" 389 <<
"\nSetting prescale set to 0" 395 prescale_vec.push_back(std::vector<int>());
397 int inputDefaultPrescale = 0;
398 prescale_vec[
col].push_back(inputDefaultPrescale);
403 inputPrescaleFile.close();
470 std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->find(algName);
472 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
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)