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.empty()){
194 LogDebug(
"l1t|Global") <<
"i Algo: "<< algBit <<
"\t" << algName <<
" masked\n";
195 for (
unsigned int ibx=0; ibx< maskedBxs.size(); ibx++){
224 if (iEvent.
run() == 1){
231 <<
"Prescale column extracted from GlobalAlgBlk too large: " <<
m_PreScaleColumn 233 <<
"\tResetting prescale column to 0" 239 const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[
m_PreScaleColumn];
246 for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->begin(); itAlgo !=
m_algorithmMap->end(); itAlgo++) {
250 int algBit = (itAlgo->second).getIndex();
252 bool decisionInitial = algBlk->getAlgoDecisionInitial(algBit);
256 bool decisionInterm = algBlk->getAlgoDecisionInterm(algBit);
260 bool decisionFinal = algBlk->getAlgoDecisionFinal(algBit);
277 std::ifstream inputPrescaleFile;
281 std::vector<std::vector<int> > vec;
282 std::vector<std::vector<int> > prescale_vec;
284 if( inputPrescaleFile ){
292 while( getline(inputPrescaleFile,line) ){
294 if( !line.compare(0, prefix1.size(), prefix1) )
continue;
297 istringstream
split(line);
302 while( split >> value ){
305 vec.push_back(std::vector<int>());
308 vec[
col].push_back(value);
321 int NumPrescaleSets = 0;
322 for(
int iCol=0; iCol<
int(vec.size()); iCol++ ){
323 if( !vec[iCol].
empty() ){
324 int firstRow = vec[iCol][0];
326 if( firstRow >= 0 ) NumPrescaleSets++;
333 if( NumPrescaleSets > 0 ){
335 for(
int iSet=0; iSet<NumPrescaleSets; iSet++ ){
336 prescale_vec.push_back(std::vector<int>());
338 int inputDefaultPrescale = 1;
339 prescale_vec[iSet].push_back(inputDefaultPrescale);
344 for(
int iBit=1; iBit<
int(vec[0].
size()); iBit++ ){
345 unsigned int algoBit = vec[0][iBit];
348 for(
int iSet=0; iSet<
int(vec.size()); iSet++ ){
350 if( !vec[iSet].
empty() ){
351 useSet = vec[iSet][0];
355 if( useSet<0 )
continue;
357 int prescale = vec[iSet][iBit];
358 prescale_vec[useSet][algoBit] = prescale;
363 <<
"\nPrescale file has algo bit: " << algoBit
365 <<
"\nSomething is wrong. Ignoring." 375 <<
"\nFilling the prescale vectors with prescale 1" 376 <<
"\nSetting prescale set to 0" 382 prescale_vec.push_back(std::vector<int>());
384 int inputDefaultPrescale = 0;
385 prescale_vec[
col].push_back(inputDefaultPrescale);
390 inputPrescaleFile.close();
457 std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo =
m_algorithmMap->find(algName);
459 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)