CMS 3D CMS Logo

HLTLevel1GTSeed Class Reference

Description: filter L1 bits and extract seed objects from L1 GT for HLT algorithms. More...

#include <HLTrigger/HLTfilters/interface/HLTLevel1GTSeed.h>

Inheritance diagram for HLTLevel1GTSeed:

HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 filter the event
 HLTLevel1GTSeed (const edm::ParameterSet &)
 constructor
virtual ~HLTLevel1GTSeed ()
 destructor

Private Member Functions

void convertStringToBitNumber ()
 for seeding via technical triggers, convert the "name" to tokenNumber (seeding via bit numbers)
void debugPrint (bool)
 debug print grouped in a single function can be called for a new menu (bool "true") or for a new event
const std::vector< L1GtObject > * objectTypeVec (const int chipNumber, const std::string &cndName)
 get the vector of object types for a condition cndName on the GTL chip chipNumber
void updateAlgoLogicParser (const std::vector< bool > &gtWord, const std::vector< unsigned int > &triggerMask, const int physicsDaqPartition)
 update the tokenResult members from m_l1AlgoLogicParser for a new event
void updateAlgoLogicParser (const L1GtTriggerMenu *)
 update the tokenNumber (holding the bit numbers) from m_l1AlgoLogicParser for a new L1 Trigger menu

Private Attributes

L1GtLogicParser m_l1AlgoLogicParser
 logic parser for m_l1SeedsLogicalExpression
std::vector
< L1GtLogicParser::OperandToken
m_l1AlgoSeeds
 list of required algorithms for seeding
std::vector< std::vector
< const std::vector
< L1GtObject > * > > 
m_l1AlgoSeedsObjType
 vector of object-type vectors for each condition in the required algorithms for seeding
std::vector< const std::vector
< L1GtLogicParser::TokenRPN > * > 
m_l1AlgoSeedsRpn
 vector of Rpn vectors for the required algorithms for seeding
edm::InputTag m_l1CenJetTag
edm::InputTag m_l1CollectionsTag
 InputTag for L1 particle collections (except muon).
edm::InputTag m_l1ExtraTag
edm::InputTag m_l1ForJetTag
const L1GtTriggerMenum_l1GtMenu
 trigger menu
unsigned long long m_l1GtMenuCacheID
edm::InputTag m_l1GtObjectMapTag
 InputTag for L1 Global Trigger object maps.
edm::InputTag m_l1GtReadoutRecordTag
 InputTag for the L1 Global Trigger DAQ readout record.
const L1GtTriggerMaskm_l1GtTmAlgo
 trigger masks
unsigned long long m_l1GtTmAlgoCacheID
const L1GtTriggerMaskm_l1GtTmTech
unsigned long long m_l1GtTmTechCacheID
edm::InputTag m_l1IsoEGTag
edm::InputTag m_l1MuonCollectionTag
 InputTag for L1 muon collection.
edm::InputTag m_l1MuonTag
 cached InputTags
edm::InputTag m_l1NoIsoEGTag
std::string m_l1SeedsLogicalExpression
 logical expression for the required L1 algorithms; the algorithms are specified by name
edm::InputTag m_l1TauJetTag
bool m_l1TechTriggerSeeding
 seeding done via technical trigger bits, if value is "true";
std::vector< unsigned intm_triggerMaskAlgoTrig
std::vector< unsigned intm_triggerMaskTechTrig
bool saveTags_
 Whether to save these tags.


Detailed Description

Description: filter L1 bits and extract seed objects from L1 GT for HLT algorithms.

Implementation: This class is an HLTFilter (-> EDFilter). It implements:

Author:
: Vasile Mihai Ghete - HEPHY Vienna
$Date$ $Revision$

Definition at line 44 of file HLTLevel1GTSeed.h.


Constructor & Destructor Documentation

HLTLevel1GTSeed::HLTLevel1GTSeed ( const edm::ParameterSet parSet  )  [explicit]

constructor

Definition at line 77 of file HLTLevel1GTSeed.cc.

References convertStringToBitNumber(), lat::endl(), L1GtLogicParser::expressionSeedsOperandList(), edm::InputTag::label(), LogDebug, m_l1AlgoLogicParser, m_l1AlgoSeeds, m_l1AlgoSeedsObjType, m_l1AlgoSeedsRpn, m_l1CollectionsTag, m_l1GtMenuCacheID, m_l1GtObjectMapTag, m_l1GtReadoutRecordTag, m_l1GtTmAlgoCacheID, m_l1GtTmTechCacheID, m_l1MuonCollectionTag, m_l1SeedsLogicalExpression, m_l1TechTriggerSeeding, L1GtLogicParser::operandTokenVector(), and size.

00077                                                               :
00078     // seeding done via technical trigger bits, if value is "true"
00079     m_l1TechTriggerSeeding( parSet.getParameter<bool>("L1TechTriggerSeeding") ),
00080 
00081     // logical expression for the required L1 algorithms
00082     m_l1SeedsLogicalExpression( parSet.getParameter<std::string>("L1SeedsLogicalExpression") ),
00083 
00084     // InputTag for the L1 Global Trigger DAQ readout record
00085     m_l1GtReadoutRecordTag( parSet.getParameter<edm::InputTag>("L1GtReadoutRecordTag") ),
00086 
00087     // InputTag for L1 Global Trigger object maps
00088     m_l1GtObjectMapTag( parSet.getParameter<edm::InputTag>("L1GtObjectMapTag") ),
00089 
00090     // InputTag for L1 particle collections (except muon)
00091     m_l1CollectionsTag( parSet.getParameter<edm::InputTag>("L1CollectionsTag") ),
00092 
00093     // InputTag for L1 muon collection
00094     m_l1MuonCollectionTag( parSet.getParameter<edm::InputTag>("L1MuonCollectionTag") ),
00095 
00097     m_l1MuonTag   ( edm::InputTag(m_l1MuonCollectionTag.label()) ),
00098     m_l1ExtraTag  ( edm::InputTag(m_l1CollectionsTag.label()) ),
00099     m_l1IsoEGTag  ( edm::InputTag(m_l1CollectionsTag.label(), "Isolated") ),
00100     m_l1NoIsoEGTag( edm::InputTag(m_l1CollectionsTag.label(), "NonIsolated") ),
00101     m_l1CenJetTag ( edm::InputTag(m_l1CollectionsTag.label(), "Central") ),
00102     m_l1ForJetTag ( edm::InputTag(m_l1CollectionsTag.label(), "Forward") ),
00103     m_l1TauJetTag ( edm::InputTag(m_l1CollectionsTag.label(), "Tau") ),
00104 
00105     // save tags to TriggerFilterObjectWithRefs
00106     saveTags_( parSet.getUntrackedParameter<bool>("saveTags", true) )
00107 {
00108     if (m_l1SeedsLogicalExpression != "L1GlobalDecision") {
00109 
00110         // check also the logical expression - add/remove spaces if needed
00111         m_l1AlgoLogicParser = L1GtLogicParser(m_l1SeedsLogicalExpression);
00112 
00113         // list of required algorithms for seeding
00114         // dummy values for tokenNumber and tokenResult
00115         m_l1AlgoSeeds.reserve((m_l1AlgoLogicParser.operandTokenVector()).size());
00116         m_l1AlgoSeeds = m_l1AlgoLogicParser.expressionSeedsOperandList();
00117         size_t l1AlgoSeedsSize = m_l1AlgoSeeds.size();
00118 
00119         //
00120         m_l1AlgoSeedsRpn.reserve(l1AlgoSeedsSize);
00121         m_l1AlgoSeedsObjType.reserve(l1AlgoSeedsSize);
00122     }
00123 
00124     // for seeding via technical triggers, convert the "name" to tokenNumber
00125     // (seeding via bit numbers)
00126     if (m_l1TechTriggerSeeding) {
00127         convertStringToBitNumber();
00128     }
00129 
00130     LogDebug("HLTLevel1GTSeed") << "\n"
00131         << "L1 Seeding via Technical Triggers      " << m_l1TechTriggerSeeding
00132         << "\n"
00133         << "L1 Seeds Logical Expression:           " << m_l1SeedsLogicalExpression
00134         << "\n"
00135         << "Input tag for L1 GT DAQ record:        " << m_l1GtReadoutRecordTag.label()
00136         << " \n"
00137         << "Input tag for L1 GT object map record: " << m_l1GtObjectMapTag.label()
00138         << " \n"
00139         << "Input tag for L1 extra collections:    " << m_l1CollectionsTag.label()
00140         << " \n"
00141         << "Input tag for L1 muon  collections:    " << m_l1MuonCollectionTag.label()
00142         << " \n"
00143         << std::endl;
00144 
00145     // register the products
00146     produces<trigger::TriggerFilterObjectWithRefs>();
00147 
00148     // initialize cached IDs
00149     m_l1GtMenuCacheID = 0ULL;
00150 
00151     m_l1GtTmAlgoCacheID = 0ULL;
00152     m_l1GtTmTechCacheID = 0ULL;
00153 
00154 
00155 }

HLTLevel1GTSeed::~HLTLevel1GTSeed (  )  [virtual]

destructor

Definition at line 158 of file HLTLevel1GTSeed.cc.

00158                                   {
00159     // empty now
00160 }


Member Function Documentation

void HLTLevel1GTSeed::convertStringToBitNumber (  )  [private]

for seeding via technical triggers, convert the "name" to tokenNumber (seeding via bit numbers)

Definition at line 1013 of file HLTLevel1GTSeed.cc.

References lat::endl(), Exception, cmsPerfPublish::fail(), i, m_l1AlgoLogicParser, m_l1AlgoSeeds, m_l1SeedsLogicalExpression, and L1GtLogicParser::operandTokenVector().

Referenced by HLTLevel1GTSeed().

01013                                                {
01014 
01015     std::vector<L1GtLogicParser::OperandToken>& algOpTokenVector =
01016         m_l1AlgoLogicParser.operandTokenVector();
01017 
01018     for (size_t i = 0; i < algOpTokenVector.size(); ++i) {
01019 
01020         std::string bitString = (algOpTokenVector[i]).tokenName;
01021         std::istringstream bitStream(bitString);
01022         int bitInt;
01023 
01024         if ((bitStream >> bitInt).fail() ) {
01025 
01026             throw cms::Exception("FailModule")
01027             << "\nL1 Seeds Logical Expression: = '" << m_l1SeedsLogicalExpression << "'"
01028             << "\n  Conversion to integer failed for " << bitString
01029             << std::endl;
01030         }
01031 
01032         (algOpTokenVector[i]).tokenNumber = bitInt;
01033 
01034     }
01035 
01036 
01037     for (size_t i = 0; i < m_l1AlgoSeeds.size(); ++i) {
01038 
01039         std::string bitString = (m_l1AlgoSeeds[i]).tokenName;
01040         std::istringstream bitStream(bitString);
01041         int bitInt;
01042 
01043         if ((bitStream >> bitInt).fail() ) {
01044 
01045             throw cms::Exception("FailModule")
01046             << "\nL1 Seeds Logical Expression: = '" << m_l1SeedsLogicalExpression << "'"
01047             << "\n  Conversion to integer failed for " << bitString
01048             << std::endl;
01049         }
01050 
01051         (m_l1AlgoSeeds[i]).tokenNumber = bitInt;
01052     }
01053 
01054 
01055 }

void HLTLevel1GTSeed::debugPrint ( bool  newMenu  )  [private]

debug print grouped in a single function can be called for a new menu (bool "true") or for a new event

Definition at line 1059 of file HLTLevel1GTSeed.cc.

References lat::endl(), L1GtTriggerMenu::gtTriggerMenuName(), i, j, k, LogDebug, LogTrace, m_l1AlgoLogicParser, m_l1AlgoSeeds, m_l1AlgoSeedsObjType, m_l1AlgoSeedsRpn, m_l1GtMenu, m_l1TechTriggerSeeding, VarParsing::obj, L1GtLogicParser::operandTokenVector(), and size.

Referenced by updateAlgoLogicParser().

01059                                              {
01060 
01061 
01062 
01063     if (m_l1TechTriggerSeeding) {
01064         LogDebug("HLTLevel1GTSeed")
01065                 << "\n\nupdateAlgoLogicParser: seeding via technical trigger"
01066                 << "\n   update event quantities."
01067                 << std::endl;
01068 
01069     }
01070     else {
01071 
01072         if (newMenu) {
01073             LogDebug("HLTLevel1GTSeed")
01074                     << "\n\nupdateAlgoLogicParser: L1 trigger menu changed to "
01075                     << m_l1GtMenu->gtTriggerMenuName() << std::endl;
01076         }
01077         else {
01078             LogDebug("HLTLevel1GTSeed")
01079                     << "\n\nupdateAlgoLogicParser: L1 trigger menu unchanged ("
01080                     << m_l1GtMenu->gtTriggerMenuName()
01081                     << ")\n   update event quantities." << std::endl;
01082         }
01083     }
01084 
01085     std::vector<L1GtLogicParser::OperandToken>& algOpTokenVector =
01086         m_l1AlgoLogicParser.operandTokenVector();
01087 
01088     LogTrace("HLTLevel1GTSeed")
01089         << "\n\nupdateAlgoLogicParser: algOpTokenVector.size() = "
01090         << algOpTokenVector.size() << std::endl;
01091 
01092     for (size_t i = 0; i < algOpTokenVector.size(); ++i) {
01093 
01094         LogTrace("HLTLevel1GTSeed") << "      "
01095             << std::setw(5) << (algOpTokenVector[i]).tokenNumber << "\t"
01096             << std::setw(25) << (algOpTokenVector[i]).tokenName << "\t"
01097             << (algOpTokenVector[i]).tokenResult
01098             << std::endl;
01099     }
01100 
01101     LogTrace("HLTLevel1GTSeed")
01102         << std::endl;
01103 
01104     LogTrace("HLTLevel1GTSeed")
01105         << "\nupdateAlgoLogicParser: m_l1AlgoSeeds.size() = "
01106         << m_l1AlgoSeeds.size()
01107         << std::endl;
01108 
01109     for (size_t i = 0; i < m_l1AlgoSeeds.size(); ++i) {
01110 
01111         LogTrace("HLTLevel1GTSeed")
01112         << "      " << std::setw(5) << (m_l1AlgoSeeds[i]).tokenNumber << "\t"
01113         << std::setw(25) << (m_l1AlgoSeeds[i]).tokenName << "\t"
01114         << (m_l1AlgoSeeds[i]).tokenResult
01115         << std::endl;
01116     }
01117 
01118     LogTrace("HLTLevel1GTSeed")
01119         << std::endl;
01120 
01121 
01122     if (!newMenu) {
01123         return;
01124     }
01125 
01126     LogTrace("HLTLevel1GTSeed")
01127         << "\nupdateAlgoLogicParser: m_l1AlgoSeedsRpn.size() = "
01128         << m_l1AlgoSeedsRpn.size()
01129         << std::endl;
01130 
01131     for (size_t i = 0; i < m_l1AlgoSeedsRpn.size(); ++i) {
01132 
01133         LogTrace("HLTLevel1GTSeed")
01134             << "  Rpn vector size: " << (m_l1AlgoSeedsRpn[i])->size()
01135             << std::endl;
01136 
01137         for (size_t j = 0; j < (m_l1AlgoSeedsRpn[i])->size(); ++j) {
01138 
01139             LogTrace("HLTLevel1GTSeed")
01140                 << "      ( " << (*(m_l1AlgoSeedsRpn[i]))[j].operation << ", "
01141                 << (*(m_l1AlgoSeedsRpn[i]))[j].operand << " )" << std::endl;
01142 
01143         }
01144     }
01145 
01146     LogTrace("HLTLevel1GTSeed")
01147         << std::endl;
01148 
01149     LogTrace("HLTLevel1GTSeed")
01150         << "\nupdateAlgoLogicParser: "
01151         << "algorithms in seed expression: m_l1AlgoSeedsObjType.size() = "
01152         << m_l1AlgoSeedsObjType.size()
01153         << std::endl;
01154 
01155     for (size_t i = 0; i < m_l1AlgoSeedsObjType.size(); ++i) {
01156 
01157         LogTrace("HLTLevel1GTSeed")
01158             << "  Conditions for an algorithm: vector size: "
01159             << (m_l1AlgoSeedsObjType[i]).size()
01160             << std::endl;
01161 
01162         for (size_t j = 0; j < (m_l1AlgoSeedsObjType[i]).size(); ++j) {
01163 
01164             LogTrace("HLTLevel1GTSeed")
01165                 << "    Condition object type vector: size: "
01166                 << ((m_l1AlgoSeedsObjType[i])[j])->size()
01167                 << std::endl;
01168 
01169             for (size_t k = 0; k < ((m_l1AlgoSeedsObjType[i])[j])->size(); ++k) {
01170 
01171 
01172                 L1GtObject obj = (*((m_l1AlgoSeedsObjType[i])[j]))[k];
01173                 LogTrace("HLTLevel1GTSeed") << "      " << obj << " ";
01174 
01175             }
01176 
01177             LogTrace("HLTLevel1GTSeed") << std::endl;
01178 
01179         }
01180     }
01181 
01182     LogTrace("HLTLevel1GTSeed")
01183         << std::endl;
01184 
01185 
01186 
01187 }

bool HLTLevel1GTSeed::filter ( edm::Event iEvent,
const edm::EventSetup evSetup 
) [virtual]

filter the event

Implements HLTFilter.

Definition at line 164 of file HLTLevel1GTSeed.cc.

References L1GtTriggerMenu::buildGtConditionMap(), CenJet, lat::endl(), ETM, ETT, L1GtLogicParser::expressionResult(), L1GtLogicParser::expressionSeedsOperandList(), ForJet, edm::EventSetup::get(), edm::Event::getByLabel(), L1GlobalTriggerObjectMap::getCombinationsInCond(), L1GtTriggerMask::gtTriggerMask(), HTT, i, edm::isDebugEnabled(), IsoEG, JetCounts, LogDebug, LogTrace, m_l1AlgoLogicParser, m_l1AlgoSeeds, m_l1AlgoSeedsObjType, m_l1AlgoSeedsRpn, m_l1CenJetTag, m_l1ExtraTag, m_l1ForJetTag, m_l1GtMenu, m_l1GtMenuCacheID, m_l1GtObjectMapTag, m_l1GtReadoutRecordTag, m_l1GtTmAlgo, m_l1GtTmAlgoCacheID, m_l1GtTmTech, m_l1GtTmTechCacheID, m_l1IsoEGTag, m_l1MuonTag, m_l1NoIsoEGTag, m_l1SeedsLogicalExpression, m_l1TauJetTag, m_l1TechTriggerSeeding, m_triggerMaskAlgoTrig, m_triggerMaskTechTrig, module(), Mu, NoIsoEG, VarParsing::obj, L1GlobalTriggerObjectMap::operandTokenVector(), path(), edm::ESHandle< T >::product(), edm::Event::put(), saveTags_, TauJet, trigger::TriggerL1CenJet, trigger::TriggerL1ETM, trigger::TriggerL1ETT, trigger::TriggerL1ForJet, trigger::TriggerL1HTT, trigger::TriggerL1IsoEG, trigger::TriggerL1Mu, trigger::TriggerL1NoIsoEG, trigger::TriggerL1TauJet, and updateAlgoLogicParser().

00164                                                                            {
00165 
00166     // all HLT filters must create and fill a HLT filter object,
00167     // recording any reconstructed physics objects satisfying
00168     // this HLT filter, and place it in the event.
00169 
00170     // the filter object
00171     std::auto_ptr<trigger::TriggerFilterObjectWithRefs> filterObject (
00172         new trigger::TriggerFilterObjectWithRefs( path(), module() ) );
00173     if (saveTags_) {
00174       filterObject->addCollectionTag( m_l1MuonTag );
00175       filterObject->addCollectionTag( m_l1ExtraTag );
00176       filterObject->addCollectionTag( m_l1IsoEGTag );
00177       filterObject->addCollectionTag( m_l1NoIsoEGTag );
00178       filterObject->addCollectionTag( m_l1CenJetTag );
00179       filterObject->addCollectionTag( m_l1ForJetTag );
00180       filterObject->addCollectionTag( m_l1TauJetTag );
00181     }
00182 
00183     // get L1GlobalTriggerReadoutRecord and GT decision
00184     edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecord;
00185     iEvent.getByLabel(m_l1GtReadoutRecordTag, gtReadoutRecord);
00186 
00187     //
00188     boost::uint16_t gtFinalOR = gtReadoutRecord->finalOR();
00189     int physicsDaqPartition = 0;
00190     bool gtDecision = static_cast<bool> (gtFinalOR & (1 << physicsDaqPartition));
00191 
00192     // GT global decision "false" possible only when running on MC or on random triggers
00193     if ( !gtDecision) {
00194 
00195         iEvent.put(filterObject);
00196         return false;
00197 
00198     }
00199     else {
00200 
00201         // by convention, "L1GlobalDecision" logical expression means global decision
00202         if (m_l1SeedsLogicalExpression == "L1GlobalDecision") {
00203 
00204             // return the full L1GlobalTriggerObjectMapRecord in filter format FIXME
00205             iEvent.put(filterObject);
00206 
00207             return true;
00208 
00209         }
00210 
00211     }
00212 
00213 
00214 
00215     // seeding done via technical trigger bits
00216     if (m_l1TechTriggerSeeding) {
00217 
00218         // get / update the trigger mask from the EventSetup
00219         // local cache & check on cacheIdentifier
00220         unsigned long long l1GtTmTechCacheID =
00221             evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
00222 
00223         if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
00224 
00225             edm::ESHandle< L1GtTriggerMask > l1GtTmTech;
00226             evSetup.get< L1GtTriggerMaskTechTrigRcd >().get( l1GtTmTech );
00227             m_l1GtTmTech = l1GtTmTech.product();
00228 
00229             m_triggerMaskTechTrig = m_l1GtTmTech->gtTriggerMask();
00230 
00231             m_l1GtTmTechCacheID = l1GtTmTechCacheID;
00232 
00233         }
00234 
00235         // get Global Trigger technical trigger word, update the tokenResult members
00236         // from m_l1AlgoLogicParser and get the result for the logical expression
00237         const std::vector<bool>& gtTechTrigWord = gtReadoutRecord->technicalTriggerWord();
00238         updateAlgoLogicParser(gtTechTrigWord, m_triggerMaskTechTrig, physicsDaqPartition);
00239 
00240         // always empty filter - GT not aware of objects for technical triggers
00241         iEvent.put(filterObject);
00242 
00243         bool seedsResult = m_l1AlgoLogicParser.expressionResult();
00244 
00245         if (seedsResult) {
00246             return true;
00247         } else {
00248             return false;
00249         }
00250 
00251     }
00252 
00253     // seeding via physics algorithms
00254 
00255     // get / update the trigger menu from the EventSetup
00256     // local cache & check on cacheIdentifier
00257 
00258     unsigned long long l1GtMenuCacheID = evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
00259 
00260     if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
00261 
00262         edm::ESHandle< L1GtTriggerMenu> l1GtMenu;
00263         evSetup.get< L1GtTriggerMenuRcd>().get(l1GtMenu) ;
00264         m_l1GtMenu =  l1GtMenu.product();
00265         (const_cast<L1GtTriggerMenu*>(m_l1GtMenu))->buildGtConditionMap();
00266 
00267         m_l1GtMenuCacheID = l1GtMenuCacheID;
00268 
00269         // update also the tokenNumber members (holding the bit numbers) from m_l1AlgoLogicParser
00270         updateAlgoLogicParser(m_l1GtMenu);
00271     }
00272 
00273     // get / update the trigger mask from the EventSetup
00274     // local cache & check on cacheIdentifier
00275 
00276     unsigned long long l1GtTmAlgoCacheID =
00277         evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
00278 
00279     if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
00280 
00281         edm::ESHandle< L1GtTriggerMask > l1GtTmAlgo;
00282         evSetup.get< L1GtTriggerMaskAlgoTrigRcd >().get( l1GtTmAlgo );
00283         m_l1GtTmAlgo = l1GtTmAlgo.product();
00284 
00285         m_triggerMaskAlgoTrig = m_l1GtTmAlgo->gtTriggerMask();
00286 
00287         m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
00288 
00289     }
00290 
00291 
00292     // get Global Trigger decision word, update the tokenResult members
00293     // from m_l1AlgoLogicParser and get the result for the logical expression
00294     const std::vector<bool>& gtDecisionWord = gtReadoutRecord->decisionWord();
00295     updateAlgoLogicParser(gtDecisionWord, m_triggerMaskAlgoTrig, physicsDaqPartition);
00296 
00297     bool seedsResult = m_l1AlgoLogicParser.expressionResult();
00298 
00299     if (edm::isDebugEnabled() ) {
00300         // define an output stream to print into
00301         // it can then be directed to whatever log level is desired
00302         std::ostringstream myCoutStream;
00303         gtReadoutRecord->printGtDecision(myCoutStream);
00304 
00305         LogTrace("HLTLevel1GTSeed")
00306             << myCoutStream.str()
00307             << "\nHLTLevel1GTSeed::filter "
00308             << "\nLogical expression (names) = '" << m_l1SeedsLogicalExpression << "'"
00309             << "\n  Result for logical expression: " << seedsResult << "\n"
00310             << std::endl;
00311     }
00312 
00313     // the evaluation of the logical expression is false - skip event
00314     if ( !seedsResult) {
00315 
00316         iEvent.put(filterObject);
00317         return false;
00318 
00319     }
00320 
00321     // define index lists for all particle types
00322 
00323     std::list<int> listMuon;
00324 
00325     std::list<int> listIsoEG;
00326     std::list<int> listNoIsoEG;
00327 
00328     std::list<int> listCenJet;
00329     std::list<int> listForJet;
00330     std::list<int> listTauJet;
00331 
00332     std::list<int> listETM;
00333     std::list<int> listETT;
00334     std::list<int> listHTT;
00335 
00336     std::list<int> listJetCounts;
00337 
00338     // get handle to object maps (one object map per algorithm)
00339     edm::Handle<L1GlobalTriggerObjectMapRecord> gtObjectMapRecord;
00340     iEvent.getByLabel(m_l1GtObjectMapTag, gtObjectMapRecord);
00341 
00342     // loop over the list of required algorithms for seeding
00343     int iAlgo = -1;
00344 
00345     for (std::vector<L1GtLogicParser::OperandToken>::const_iterator
00346         itSeed = m_l1AlgoSeeds.begin(); itSeed != m_l1AlgoSeeds.end(); ++itSeed) {
00347 
00348         //
00349         iAlgo++;
00350         //
00351         int algBit = (*itSeed).tokenNumber;
00352         std::string algName = (*itSeed).tokenName;
00353         bool algResult = (*itSeed).tokenResult;
00354 
00355         //LogTrace("HLTLevel1GTSeed")
00356         //    << "\nHLTLevel1GTSeed::filter "
00357         //    << "\n  Algoritm " << algName << " with bit number " << algBit
00358         //    << " in the object map seed list"
00359         //    << "\n  Algorithm result = " << algResult << "\n"
00360         //    << std::endl;
00361 
00362 
00363         // algorithm result is false - no seeds
00364         if ( !algResult) {
00365             continue;
00366         }
00367 
00368         // algorithm result is true - get object map, loop over conditions in the algorithm
00369         const L1GlobalTriggerObjectMap* objMap = gtObjectMapRecord->getObjectMap(algBit);
00370 
00371         const std::vector<L1GtLogicParser::OperandToken>& opTokenVecObjMap =
00372             objMap->operandTokenVector();
00373 
00374         const std::vector<L1GtLogicParser::TokenRPN>& algoSeedsRpn = *(m_l1AlgoSeedsRpn.at(iAlgo));
00375 
00376         const std::vector< const std::vector<L1GtObject>* >&  algoSeedsObjTypeVec = m_l1AlgoSeedsObjType[iAlgo];
00377 
00378         //
00379         L1GtLogicParser logicParserConditions(algoSeedsRpn, opTokenVecObjMap);
00380 
00381         // get list of required conditions for seeding - loop over
00382         std::vector<L1GtLogicParser::OperandToken> condSeeds =
00383             logicParserConditions.expressionSeedsOperandList();
00384 
00385         if (edm::isDebugEnabled() ) {
00386 
00387             LogTrace("HLTLevel1GTSeed")
00388                 << "\n  HLTLevel1GTSeed::filter "
00389                << "\n    condSeeds.size() = "
00390                 << condSeeds.size()
00391                 << std::endl;
00392 
00393 
00394             for (size_t i = 0; i < condSeeds.size(); ++i) {
00395 
00396                 LogTrace("HLTLevel1GTSeed")
00397                 << "      " << std::setw(5) << (condSeeds[i]).tokenNumber << "\t"
00398                 << std::setw(25) << (condSeeds[i]).tokenName << "\t"
00399                 << (condSeeds[i]).tokenResult
00400                 << std::endl;
00401             }
00402 
00403             LogTrace("HLTLevel1GTSeed")
00404                 << std::endl;
00405         }
00406 
00407         for (std::vector<L1GtLogicParser::OperandToken>::const_iterator
00408             itCond = condSeeds.begin(); itCond != condSeeds.end(); itCond++) {
00409 
00410             std::string cndName = (*itCond).tokenName;
00411             int cndNumber = (*itCond).tokenNumber;
00412             bool cndResult = (*itCond).tokenResult;
00413 
00414             const std::vector<L1GtObject>* cndObjTypeVec = algoSeedsObjTypeVec.at(cndNumber);
00415 
00416             //LogTrace("HLTLevel1GTSeed")
00417             //    << "\n  HLTLevel1GTSeed::filter "
00418             //    << "\n    Condition " << cndName << " with number " << cndNumber
00419             //    << " in the seed list"
00420             //    << "\n    Condition result = " << cndResult << "\n"
00421             //    << std::endl;
00422 
00423             if ( !cndResult) {
00424                 continue;
00425             }
00426 
00427             // loop over combinations for a given condition
00428 
00429             const CombinationsInCond* cndComb = objMap->getCombinationsInCond(cndNumber);
00430 
00431             for (std::vector<SingleCombInCond>::const_iterator
00432                 itComb = (*cndComb).begin(); itComb != (*cndComb).end(); itComb++) {
00433 
00434                 // loop over objects in a combination for a given condition
00435                 int iObj = 0;
00436                 for (SingleCombInCond::const_iterator
00437                     itObject = (*itComb).begin(); itObject != (*itComb).end(); itObject++) {
00438 
00439                     // get object type and push indices on the list
00440                     const L1GtObject objTypeVal = (*cndObjTypeVec).at(iObj);
00441 
00442                     //LogTrace("HLTLevel1GTSeed")
00443                     //    << "\n    HLTLevel1GTSeed::filter "
00444                     //    << "\n      Add object of type " << objTypeVal
00445                     //    << " and index " << (*itObject) << " to the seed list."
00446                     //    << std::endl;
00447 
00448                     switch (objTypeVal) {
00449                         case Mu: {
00450                                 listMuon.push_back(*itObject);
00451                             }
00452 
00453                             break;
00454                         case NoIsoEG: {
00455                                 listNoIsoEG.push_back(*itObject);
00456                             }
00457 
00458                             break;
00459                         case IsoEG: {
00460                                 listIsoEG.push_back(*itObject);
00461                             }
00462 
00463                             break;
00464                         case CenJet: {
00465                                 listCenJet.push_back(*itObject);
00466                             }
00467 
00468                             break;
00469                         case ForJet: {
00470                                 listForJet.push_back(*itObject);
00471                             }
00472 
00473                             break;
00474                         case TauJet: {
00475                                 listTauJet.push_back(*itObject);
00476                             }
00477 
00478                             break;
00479                         case ETM: {
00480                                 listETM.push_back(*itObject);
00481 
00482                             }
00483 
00484                             break;
00485                         case ETT: {
00486                                 listETT.push_back(*itObject);
00487 
00488                             }
00489 
00490                             break;
00491                         case HTT: {
00492                                 listHTT.push_back(*itObject);
00493 
00494                             }
00495 
00496                             break;
00497                         case JetCounts: {
00498                                 listJetCounts.push_back(*itObject);
00499                             }
00500 
00501                             break;
00502                         default: {
00503                                 // should not arrive here
00504                             }
00505                             break;
00506                     }
00507 
00508                     iObj++;
00509 
00510                 }
00511 
00512             }
00513 
00514 
00515         }
00516 
00517     }
00518 
00519     // eliminate duplicates
00520 
00521     listMuon.sort();
00522     listMuon.unique();
00523 
00524     listIsoEG.sort();
00525     listIsoEG.unique();
00526 
00527     listNoIsoEG.sort();
00528     listNoIsoEG.unique();
00529 
00530     listCenJet.sort();
00531     listCenJet.unique();
00532 
00533     listForJet.sort();
00534     listForJet.unique();
00535 
00536     listTauJet.sort();
00537     listTauJet.unique();
00538 
00539     // no need to eliminate duplicates for energy sums and jet counts
00540     // they are global quantities
00541 
00542 
00543     //
00544     // record the L1 physics objects in the HLT filterObject
00545     //
00546 
00547     // muon
00548     if (listMuon.size()) {
00549 
00550         edm::Handle<l1extra::L1MuonParticleCollection> l1Muon;
00551         iEvent.getByLabel(m_l1MuonTag, l1Muon);
00552 
00553         for (std::list<int>::const_iterator itObj = listMuon.begin(); itObj != listMuon.end(); ++itObj) {
00554 
00555             filterObject->addObject(trigger::TriggerL1Mu,l1extra::L1MuonParticleRef(l1Muon, *itObj));
00556 
00557         }
00558     }
00559 
00560 
00561     // EG (isolated)
00562     if (listIsoEG.size()) {
00563         edm::Handle<l1extra::L1EmParticleCollection> l1IsoEG;
00564         iEvent.getByLabel(m_l1IsoEGTag, l1IsoEG);
00565 
00566         for (std::list<int>::const_iterator
00567             itObj = listIsoEG.begin(); itObj != listIsoEG.end(); ++itObj) {
00568 
00569             filterObject->addObject(trigger::TriggerL1IsoEG,l1extra::L1EmParticleRef(l1IsoEG, *itObj));
00570 
00571         }
00572     }
00573 
00574     // EG (no isolation)
00575     if (listNoIsoEG.size()) {
00576         edm::Handle<l1extra::L1EmParticleCollection> l1NoIsoEG;
00577         iEvent.getByLabel(m_l1NoIsoEGTag, l1NoIsoEG);
00578 
00579         for (std::list<int>::const_iterator
00580             itObj = listNoIsoEG.begin(); itObj != listNoIsoEG.end(); ++itObj) {
00581 
00582             filterObject->addObject(trigger::TriggerL1NoIsoEG,l1extra::L1EmParticleRef(l1NoIsoEG, *itObj));
00583 
00584         }
00585     }
00586 
00587     // central jets
00588     if (listCenJet.size()) {
00589         edm::Handle<l1extra::L1JetParticleCollection> l1CenJet;
00590         iEvent.getByLabel(m_l1CenJetTag, l1CenJet);
00591 
00592         for (std::list<int>::const_iterator
00593             itObj = listCenJet.begin(); itObj != listCenJet.end(); ++itObj) {
00594 
00595             filterObject->addObject(trigger::TriggerL1CenJet,l1extra::L1JetParticleRef(l1CenJet, *itObj));
00596 
00597         }
00598     }
00599 
00600     // forward jets
00601     if (listForJet.size()) {
00602         edm::Handle<l1extra::L1JetParticleCollection> l1ForJet;
00603         iEvent.getByLabel(m_l1ForJetTag, l1ForJet);
00604 
00605         for (std::list<int>::const_iterator
00606             itObj = listForJet.begin(); itObj != listForJet.end(); ++itObj) {
00607 
00608             filterObject->addObject(trigger::TriggerL1ForJet,l1extra::L1JetParticleRef(l1ForJet, *itObj));
00609 
00610         }
00611     }
00612 
00613     // tau jets
00614     if (listTauJet.size()) {
00615         edm::Handle<l1extra::L1JetParticleCollection> l1TauJet;
00616         iEvent.getByLabel(m_l1TauJetTag, l1TauJet);
00617 
00618         for (std::list<int>::const_iterator itObj = listTauJet.begin();
00619             itObj != listTauJet.end(); ++itObj) {
00620 
00621             filterObject->addObject(trigger::TriggerL1TauJet,l1extra::L1JetParticleRef(l1TauJet, *itObj));
00622 
00623         }
00624     }
00625 
00626     // energy sums
00627     if (listETM.size() || listETT.size() || listHTT.size()) {
00628         edm::Handle<l1extra::L1EtMissParticleCollection> l1EnergySums;
00629         iEvent.getByLabel(m_l1ExtraTag, l1EnergySums);
00630 
00631         for (std::list<int>::const_iterator
00632             itObj = listETM.begin(); itObj != listETM.end(); ++itObj) {
00633 
00634             filterObject->addObject(trigger::TriggerL1ETM,l1extra::L1EtMissParticleRef(l1EnergySums, *itObj));
00635 
00636         }
00637 
00638         for (std::list<int>::const_iterator
00639             itObj = listETT.begin(); itObj != listETT.end(); ++itObj) {
00640 
00641             filterObject->addObject(trigger::TriggerL1ETT,l1extra::L1EtMissParticleRef(l1EnergySums, *itObj));
00642 
00643         }
00644 
00645         for (std::list<int>::const_iterator
00646             itObj = listHTT.begin(); itObj != listHTT.end(); ++itObj) {
00647 
00648             filterObject->addObject(trigger::TriggerL1HTT,l1extra::L1EtMissParticleRef(l1EnergySums, *itObj));
00649 
00650         }
00651 
00652     }
00653 
00654 
00655     // TODO FIXME uncomment if block when JetCounts implemented
00656 
00657     //    // jet counts
00658     //    if (listJetCounts.size()) {
00659     //        edm::Handle<l1extra::L1JetCounts> l1JetCounts;
00660     //        iEvent.getByLabel(m_l1CollectionsTag.label(), l1JetCounts);
00661     //
00662     //        for (std::list<int>::const_iterator itObj = listJetCounts.begin();
00663     //                itObj != listJetCounts.end(); ++itObj) {
00664     //
00665     //            filterObject->addObject(trigger::TriggerL1JetCounts,l1extra::L1JetCountsRefProd(l1JetCounts));
00666     //                  // FIXME: RefProd!
00667     //
00668     //        }
00669     //
00670     //    }
00671 
00672 
00673     if ( edm::isDebugEnabled() ) {
00674         LogDebug("HLTLevel1GTSeed")
00675             << "\nHLTLevel1GTSeed::filter "
00676             << "\n  Dump TriggerFilterObjectWithRefs\n"
00677             << std::endl;
00678 
00679         std::vector<l1extra::L1MuonParticleRef> seedsL1Mu;
00680 
00681         std::vector<l1extra::L1EmParticleRef> seedsL1IsoEG;
00682         std::vector<l1extra::L1EmParticleRef> seedsL1NoIsoEG;
00683 
00684         std::vector<l1extra::L1JetParticleRef> seedsL1CenJet;
00685         std::vector<l1extra::L1JetParticleRef> seedsL1ForJet;
00686         std::vector<l1extra::L1JetParticleRef> seedsL1TauJet;
00687 
00688         std::vector<l1extra::L1EtMissParticleRef> seedsL1ETM;
00689         std::vector<l1extra::L1EtMissParticleRef> seedsL1ETT;
00690         std::vector<l1extra::L1EtMissParticleRef> seedsL1HTT;
00691 
00692         filterObject->getObjects(trigger::TriggerL1Mu, seedsL1Mu);
00693         const size_t sizeSeedsL1Mu = seedsL1Mu.size();
00694 
00695         filterObject->getObjects(trigger::TriggerL1IsoEG, seedsL1IsoEG);
00696         const size_t sizeSeedsL1IsoEG = seedsL1IsoEG.size();
00697 
00698         filterObject->getObjects(trigger::TriggerL1NoIsoEG, seedsL1NoIsoEG);
00699         const size_t sizeSeedsL1NoIsoEG = seedsL1NoIsoEG.size();
00700 
00701         filterObject->getObjects(trigger::TriggerL1CenJet, seedsL1CenJet);
00702         const size_t sizeSeedsL1CenJet = seedsL1CenJet.size();
00703 
00704         filterObject->getObjects(trigger::TriggerL1ForJet, seedsL1ForJet);
00705         const size_t sizeSeedsL1ForJet = seedsL1ForJet.size();
00706 
00707         filterObject->getObjects(trigger::TriggerL1TauJet, seedsL1TauJet);
00708         const size_t sizeSeedsL1TauJet = seedsL1TauJet.size();
00709 
00710         filterObject->getObjects(trigger::TriggerL1ETM, seedsL1ETM);
00711         const size_t sizeSeedsL1ETM = seedsL1ETM.size();
00712 
00713         filterObject->getObjects(trigger::TriggerL1ETT, seedsL1ETT);
00714         const size_t sizeSeedsL1ETT = seedsL1ETT.size();
00715 
00716         filterObject->getObjects(trigger::TriggerL1HTT, seedsL1HTT);
00717         const size_t sizeSeedsL1HTT = seedsL1HTT.size();
00718 
00719         LogTrace("HLTLevel1GTSeed") << "  L1Mu seeds:      " << sizeSeedsL1Mu << "\n"
00720             << "  L1IsoEG seeds:   " << sizeSeedsL1IsoEG << "\n"
00721             << "  L1NoIsoEG seeds: " << sizeSeedsL1NoIsoEG << "\n"
00722             << "  L1CenJet seeds:  " << sizeSeedsL1CenJet << "\n"
00723             << "  L1ForJet seeds:  " << sizeSeedsL1ForJet << "\n"
00724             << "  L1TauJet seeds:  " << sizeSeedsL1TauJet << "\n"
00725             << "  L1ETM seeds:     " << sizeSeedsL1ETM << "\n"
00726             << "  L1ETT seeds:     " << sizeSeedsL1ETT << "\n"
00727             << "  L1HTT seeds:     " << sizeSeedsL1HTT << "\n"
00728             << std::endl;
00729 
00730         for (size_t i = 0; i != sizeSeedsL1Mu; i++) {
00731 
00732             l1extra::L1MuonParticleRef obj = l1extra::L1MuonParticleRef(seedsL1Mu[i]);
00733 
00734             LogTrace("HLTLevel1GTSeed")
00735                 << "L1Mu     " << "\t"
00736                 << "q*PT = " << obj->charge()*obj->pt() << "\t"
00737                 << "eta =  " << obj->eta() << "\t"
00738                 << "phi =  " << obj->phi();
00739         }
00740 
00741         for (size_t i = 0; i != sizeSeedsL1IsoEG; i++) {
00742 
00743             l1extra::L1EmParticleRef obj = l1extra::L1EmParticleRef(seedsL1IsoEG[i]);
00744 
00745             LogTrace("HLTLevel1GTSeed")
00746                 << "L1IsoEG   " << "\t"
00747                 << "ET =   " << obj->et() << "\t"
00748                 << "eta =  " << obj->eta() << "\t"
00749                 << "phi =  " << obj->phi();
00750         }
00751 
00752         for (size_t i = 0; i != sizeSeedsL1NoIsoEG; i++) {
00753 
00754             l1extra::L1EmParticleRef obj = l1extra::L1EmParticleRef(seedsL1NoIsoEG[i]);
00755 
00756             LogTrace("HLTLevel1GTSeed")
00757                 << "L1NoIsoEG" << "\t"
00758                 << "ET =   " << obj->et() << "\t"
00759                 << "eta =  " << obj->eta() << "\t"
00760                 << "phi =  " << obj->phi();
00761         }
00762 
00763         for (size_t i = 0; i != sizeSeedsL1CenJet; i++) {
00764 
00765             l1extra::L1JetParticleRef obj = l1extra::L1JetParticleRef(seedsL1CenJet[i]);
00766 
00767             LogTrace("HLTLevel1GTSeed")
00768                 << "L1CenJet " << "\t"
00769                 << "ET =   " << obj->et() << "\t"
00770                 << "eta =  " << obj->eta() << "\t"
00771                 << "phi =  " << obj->phi();
00772         }
00773 
00774         for (size_t i = 0; i != sizeSeedsL1ForJet; i++) {
00775 
00776             l1extra::L1JetParticleRef obj = l1extra::L1JetParticleRef(seedsL1ForJet[i]);
00777 
00778             LogTrace("HLTLevel1GTSeed")
00779                 << "L1ForJet " << "\t"
00780                 << "ET =   " << obj->et() << "\t"
00781                 << "eta =  " << obj->eta() << "\t"
00782                 << "phi =  " << obj->phi();
00783         }
00784 
00785         for (size_t i = 0; i != sizeSeedsL1TauJet; i++) {
00786 
00787             l1extra::L1JetParticleRef obj = l1extra::L1JetParticleRef(seedsL1TauJet[i]);
00788 
00789             LogTrace("HLTLevel1GTSeed")
00790                 << "L1TauJet " << "\t"
00791                 << "ET =   " << obj->et() << "\t"
00792                 << "eta =  " << obj->eta() << "\t"
00793                 << "phi =  " << obj->phi();
00794         }
00795 
00796         for (size_t i = 0; i != sizeSeedsL1ETM; i++) {
00797 
00798             l1extra::L1EtMissParticleRef obj = l1extra::L1EtMissParticleRef(seedsL1ETM[i]);
00799 
00800             LogTrace("HLTLevel1GTSeed")
00801                 << "L1ETM    " << "\t"
00802                 << "ET =   " << obj->etMiss() << "\t"
00803                 << "phi =  " << obj->phi();
00804         }
00805 
00806         for (size_t i = 0; i != sizeSeedsL1ETT; i++) {
00807 
00808             l1extra::L1EtMissParticleRef obj = l1extra::L1EtMissParticleRef(seedsL1ETT[i]);
00809 
00810             LogTrace("HLTLevel1GTSeed")
00811                 << "L1ETT    " << "\t"
00812                 << "ET =   " << obj->etTotal();
00813         }
00814 
00815         for (size_t i = 0; i != sizeSeedsL1HTT; i++) {
00816 
00817             l1extra::L1EtMissParticleRef obj = l1extra::L1EtMissParticleRef(seedsL1HTT[i]);
00818 
00819             LogTrace("HLTLevel1GTSeed")
00820                 << "L1HTT    " << "\t"
00821                 << "ET =   " << obj->etHad();
00822         }
00823 
00824         LogTrace("HLTLevel1GTSeed") << " \n\n"
00825             << std::endl;
00826 
00827 
00828     }
00829 
00830     //
00831 
00832     iEvent.put(filterObject);
00833 
00834     return seedsResult;
00835 
00836 }

const std::vector< L1GtObject > * HLTLevel1GTSeed::objectTypeVec ( const int  chipNumber,
const std::string &  cndName 
) [private]

get the vector of object types for a condition cndName on the GTL chip chipNumber

Definition at line 838 of file HLTLevel1GTSeed.cc.

References asciidump::at, lat::endl(), Exception, L1GtTriggerMenu::gtConditionMap(), and m_l1GtMenu.

Referenced by updateAlgoLogicParser().

00839                                                 {
00840 
00841     bool foundCond = false;
00842 
00843     const ConditionMap& conditionMap = (m_l1GtMenu->gtConditionMap()).at(chipNr);
00844 
00845     CItCond itCond = conditionMap.find(cndName);
00846     if (itCond != conditionMap.end()) {
00847         foundCond = true;
00848         return (&((itCond->second)->objectType()));
00849     }
00850 
00851     if ( !foundCond) {
00852 
00853         // it should never be happen, all conditions are in the maps
00854         throw cms::Exception("FailModule")
00855         << "\nCondition " << cndName << " not found in the condition map"
00856         << " for chip number " << chipNr
00857         << std::endl;
00858     }
00859 
00860     // dummy return - prevent compiler warning
00861     return 0;
00862 
00863 }

void HLTLevel1GTSeed::updateAlgoLogicParser ( const std::vector< bool > &  gtWord,
const std::vector< unsigned int > &  triggerMask,
const int  physicsDaqPartition 
) [private]

update the tokenResult members from m_l1AlgoLogicParser for a new event

Definition at line 952 of file HLTLevel1GTSeed.cc.

References debugPrint(), i, edm::isDebugEnabled(), m_l1AlgoLogicParser, m_l1AlgoSeeds, and L1GtLogicParser::operandTokenVector().

00953                                                                                    {
00954 
00955     std::vector<L1GtLogicParser::OperandToken>& algOpTokenVector =
00956         m_l1AlgoLogicParser.operandTokenVector();
00957 
00958     for (size_t i = 0; i < algOpTokenVector.size(); ++i) {
00959         int iBit = (algOpTokenVector[i]).tokenNumber;
00960         bool iResult = gtWord.at(iBit);
00961 
00962         int triggerMaskBit = triggerMask[iBit] & (1 << physicsDaqPartition);
00963         //LogTrace("HLTLevel1GTSeed")
00964         //<< "\nTrigger bit: " << iBit
00965         //<< " mask = " << triggerMaskBit
00966         //<< " DAQ partition " << physicsDaqPartition
00967         //<< std::endl;
00968 
00969         if (triggerMaskBit) {
00970             iResult = false;
00971 
00972             //LogTrace("HLTLevel1GTSeed")
00973             //<< "\nMasked trigger: " << iBit << ". Result set to false\n"
00974             //<< std::endl;
00975         }
00976 
00977         (algOpTokenVector[i]).tokenResult = iResult;
00978 
00979     }
00980 
00981     for (size_t i = 0; i < m_l1AlgoSeeds.size(); ++i) {
00982         int iBit = (m_l1AlgoSeeds[i]).tokenNumber;
00983         bool iResult = gtWord.at(iBit);
00984 
00985         int triggerMaskBit = triggerMask[iBit] & (1 << physicsDaqPartition);
00986         //LogTrace("HLTLevel1GTSeed")
00987         //<< "\nTrigger bit: " << iBit
00988         //<< " mask = " << triggerMaskBit
00989         //<< " DAQ partition " << physicsDaqPartition
00990         //<< std::endl;
00991 
00992         if (triggerMaskBit) {
00993             iResult = false;
00994 
00995             //LogTrace("HLTLevel1GTSeed")
00996             //<< "\nMasked trigger: " << iBit << ". Result set to false\n"
00997             //<< std::endl;
00998         }
00999 
01000         (m_l1AlgoSeeds[i]).tokenResult = iResult;
01001 
01002     }
01003 
01004     if (edm::isDebugEnabled() ) {
01005         bool newMenu = false;
01006         debugPrint(newMenu);
01007     }
01008 
01009 }

void HLTLevel1GTSeed::updateAlgoLogicParser ( const L1GtTriggerMenu l1GtMenu  )  [private]

update the tokenNumber (holding the bit numbers) from m_l1AlgoLogicParser for a new L1 Trigger menu

Definition at line 868 of file HLTLevel1GTSeed.cc.

References debugPrint(), lat::endl(), Exception, L1GtTriggerMenu::gtAlgorithmMap(), L1GtTriggerMenu::gtTriggerMenuName(), i, edm::isDebugEnabled(), m_l1AlgoLogicParser, m_l1AlgoSeeds, m_l1AlgoSeedsObjType, m_l1AlgoSeedsRpn, objectTypeVec(), and L1GtLogicParser::operandTokenVector().

Referenced by filter().

00868                                                                            {
00869 
00870     const AlgorithmMap& algorithmMap = l1GtMenu->gtAlgorithmMap();
00871 
00872     std::vector<L1GtLogicParser::OperandToken>& algOpTokenVector =
00873         m_l1AlgoLogicParser.operandTokenVector();
00874 
00875     size_t jSeed = 0;
00876     size_t l1AlgoSeedsSize = m_l1AlgoSeeds.size();
00877 
00878     for (size_t i = 0; i < algOpTokenVector.size(); ++i) {
00879 
00880         CItAlgo itAlgo = algorithmMap.find((algOpTokenVector[i]).tokenName);
00881         if (itAlgo != algorithmMap.end()) {
00882 
00883             int bitNr = (itAlgo->second).algoBitNumber();
00884             int chipNr = (itAlgo->second).algoChipNumber();
00885 
00886             (algOpTokenVector[i]).tokenNumber = bitNr;
00887 
00888             // algOpTokenVector and m_l1AlgoSeeds must have the same ordering
00889             // of the algorithms
00890             if (jSeed < l1AlgoSeedsSize) {
00891 
00892                 //LogTrace("HLTLevel1GTSeed") << "(m_l1AlgoSeeds[jSeed]).tokenName: "
00893                 //    << (m_l1AlgoSeeds[jSeed]).tokenName
00894                 //    << std::endl;
00895 
00896                 if ((m_l1AlgoSeeds[jSeed]).tokenName == (algOpTokenVector[i]).tokenName) {
00897 
00898                     (m_l1AlgoSeeds[jSeed]).tokenNumber = bitNr;
00899 
00900                     const std::vector<L1GtLogicParser::TokenRPN>& aRpnVector =
00901                         (itAlgo->second).algoRpnVector();
00902                     size_t aRpnVectorSize = aRpnVector.size();
00903 
00904                     m_l1AlgoSeedsRpn.push_back(&aRpnVector);
00905 
00906                     // loop over RpnVector to fill for each condition the object type
00907                     std::vector< const std::vector<L1GtObject>*> tmpObjTypeVec;
00908                     tmpObjTypeVec.reserve(aRpnVectorSize);
00909 
00910                     for (size_t opI = 0; opI < aRpnVectorSize; ++opI) {
00911 
00912                         std::string cName = (aRpnVector[opI]).operand;
00913 
00914                         if (!cName.empty()) {
00915 
00916                             tmpObjTypeVec.push_back(objectTypeVec(chipNr, cName));
00917 
00918                             //LogTrace("HLTLevel1GTSeed")
00919                             //    << "    Push object vector for condition: " << cName
00920                             //    << std::endl;
00921                         }
00922                     }
00923 
00924                     m_l1AlgoSeedsObjType.push_back(tmpObjTypeVec);
00925 
00926                     jSeed++;
00927                 }
00928             }
00929         }
00930         else {
00931 
00932             throw cms::Exception("FailModule")
00933                 << "\nAlgorithm  " << (algOpTokenVector[i]).tokenName
00934                 << " not found in the trigger menu " << l1GtMenu->gtTriggerMenuName()
00935                 << std::endl;
00936 
00937         }
00938 
00939     }
00940 
00941     //
00942     if (edm::isDebugEnabled() ) {
00943         bool newMenu = true;
00944         debugPrint(newMenu);
00945     }
00946 
00947 }


Member Data Documentation

L1GtLogicParser HLTLevel1GTSeed::m_l1AlgoLogicParser [private]

logic parser for m_l1SeedsLogicalExpression

Definition at line 102 of file HLTLevel1GTSeed.h.

Referenced by convertStringToBitNumber(), debugPrint(), filter(), HLTLevel1GTSeed(), and updateAlgoLogicParser().

std::vector<L1GtLogicParser::OperandToken> HLTLevel1GTSeed::m_l1AlgoSeeds [private]

list of required algorithms for seeding

Definition at line 105 of file HLTLevel1GTSeed.h.

Referenced by convertStringToBitNumber(), debugPrint(), filter(), HLTLevel1GTSeed(), and updateAlgoLogicParser().

std::vector< std::vector< const std::vector<L1GtObject>* > > HLTLevel1GTSeed::m_l1AlgoSeedsObjType [private]

vector of object-type vectors for each condition in the required algorithms for seeding

Definition at line 111 of file HLTLevel1GTSeed.h.

Referenced by debugPrint(), filter(), HLTLevel1GTSeed(), and updateAlgoLogicParser().

std::vector< const std::vector<L1GtLogicParser::TokenRPN>* > HLTLevel1GTSeed::m_l1AlgoSeedsRpn [private]

vector of Rpn vectors for the required algorithms for seeding

Definition at line 108 of file HLTLevel1GTSeed.h.

Referenced by debugPrint(), filter(), HLTLevel1GTSeed(), and updateAlgoLogicParser().

edm::InputTag HLTLevel1GTSeed::m_l1CenJetTag [private]

Definition at line 139 of file HLTLevel1GTSeed.h.

Referenced by filter().

edm::InputTag HLTLevel1GTSeed::m_l1CollectionsTag [private]

InputTag for L1 particle collections (except muon).

Definition at line 129 of file HLTLevel1GTSeed.h.

Referenced by HLTLevel1GTSeed().

edm::InputTag HLTLevel1GTSeed::m_l1ExtraTag [private]

Definition at line 136 of file HLTLevel1GTSeed.h.

Referenced by filter().

edm::InputTag HLTLevel1GTSeed::m_l1ForJetTag [private]

Definition at line 140 of file HLTLevel1GTSeed.h.

Referenced by filter().

const L1GtTriggerMenu* HLTLevel1GTSeed::m_l1GtMenu [private]

trigger menu

Definition at line 86 of file HLTLevel1GTSeed.h.

Referenced by debugPrint(), filter(), and objectTypeVec().

unsigned long long HLTLevel1GTSeed::m_l1GtMenuCacheID [private]

Definition at line 87 of file HLTLevel1GTSeed.h.

Referenced by filter(), and HLTLevel1GTSeed().

edm::InputTag HLTLevel1GTSeed::m_l1GtObjectMapTag [private]

InputTag for L1 Global Trigger object maps.

Definition at line 126 of file HLTLevel1GTSeed.h.

Referenced by filter(), and HLTLevel1GTSeed().

edm::InputTag HLTLevel1GTSeed::m_l1GtReadoutRecordTag [private]

InputTag for the L1 Global Trigger DAQ readout record.

Definition at line 123 of file HLTLevel1GTSeed.h.

Referenced by filter(), and HLTLevel1GTSeed().

const L1GtTriggerMask* HLTLevel1GTSeed::m_l1GtTmAlgo [private]

trigger masks

Definition at line 90 of file HLTLevel1GTSeed.h.

Referenced by filter().

unsigned long long HLTLevel1GTSeed::m_l1GtTmAlgoCacheID [private]

Definition at line 91 of file HLTLevel1GTSeed.h.

Referenced by filter(), and HLTLevel1GTSeed().

const L1GtTriggerMask* HLTLevel1GTSeed::m_l1GtTmTech [private]

Definition at line 93 of file HLTLevel1GTSeed.h.

Referenced by filter().

unsigned long long HLTLevel1GTSeed::m_l1GtTmTechCacheID [private]

Definition at line 94 of file HLTLevel1GTSeed.h.

Referenced by filter(), and HLTLevel1GTSeed().

edm::InputTag HLTLevel1GTSeed::m_l1IsoEGTag [private]

Definition at line 137 of file HLTLevel1GTSeed.h.

Referenced by filter().

edm::InputTag HLTLevel1GTSeed::m_l1MuonCollectionTag [private]

InputTag for L1 muon collection.

Definition at line 132 of file HLTLevel1GTSeed.h.

Referenced by HLTLevel1GTSeed().

edm::InputTag HLTLevel1GTSeed::m_l1MuonTag [private]

cached InputTags

Definition at line 135 of file HLTLevel1GTSeed.h.

Referenced by filter().

edm::InputTag HLTLevel1GTSeed::m_l1NoIsoEGTag [private]

Definition at line 138 of file HLTLevel1GTSeed.h.

Referenced by filter().

std::string HLTLevel1GTSeed::m_l1SeedsLogicalExpression [private]

logical expression for the required L1 algorithms; the algorithms are specified by name

Definition at line 120 of file HLTLevel1GTSeed.h.

Referenced by convertStringToBitNumber(), filter(), and HLTLevel1GTSeed().

edm::InputTag HLTLevel1GTSeed::m_l1TauJetTag [private]

Definition at line 141 of file HLTLevel1GTSeed.h.

Referenced by filter().

bool HLTLevel1GTSeed::m_l1TechTriggerSeeding [private]

seeding done via technical trigger bits, if value is "true";

Definition at line 116 of file HLTLevel1GTSeed.h.

Referenced by debugPrint(), filter(), and HLTLevel1GTSeed().

std::vector<unsigned int> HLTLevel1GTSeed::m_triggerMaskAlgoTrig [private]

Definition at line 96 of file HLTLevel1GTSeed.h.

Referenced by filter().

std::vector<unsigned int> HLTLevel1GTSeed::m_triggerMaskTechTrig [private]

Definition at line 97 of file HLTLevel1GTSeed.h.

Referenced by filter().

bool HLTLevel1GTSeed::saveTags_ [private]

Whether to save these tags.

Definition at line 144 of file HLTLevel1GTSeed.h.

Referenced by filter().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:32 2009 for CMSSW by  doxygen 1.5.4