Get the candidates from the AOD trigger summary JMS This is the unpacking that you might have otherwise had to do
557 myRecMatches.clear();
563 myHltFakeCands.clear();
564 for (
unsigned iLabel = 0; iLabel <
numHltLabels; iLabel++){
566 std::vector<HltFakeStruct> tempFake;
568 myHltFakeCands.push_back(tempFake);
583 LogTrace(
"HLTMuonVal") <<
"Checking trigger result for "
584 <<
"trigger information stored in the following block "
589 if (!passedRequiredTrigger) {
590 LogTrace (
"HLTMuonVal") <<
"You didn't pass the required trigger"
600 double genMuonPt = -1;
601 double recMuonPt = -1;
604 LogTrace (
"HLTMuonVal") <<
"\n\nStarting to look for gen muons\n\n";
610 LogTrace (
"HLTMuonVal") <<
"\n\n\n\nDone getting gen, now getting reco\n\n\n";
624 MuonCollection::const_iterator
muon;
627 <<
"\nYou have tracks to compare to... ignoring RECO muons"
628 <<
" for the rest of this job";
632 LogTrace (
"HLTMuonVal") <<
"Beginning loop over reco muons" << endl;
634 for ( muon = muTracks->begin(); muon != muTracks->end(); ++
muon ) {
639 LogTrace (
"HLTMuonVal") <<
"... Applying selection" << endl;
643 LogTrace (
"HLTMuonVal") <<
"Passed selection!" << endl;
649 float pt = muon->pt();
650 float eta = muon->eta();
651 MatchStruct newMatchStruct;
652 newMatchStruct.recCand = &*
muon;
653 myRecMatches.push_back(newMatchStruct);
656 <<
" with pt = " << pt
657 <<
", eta = " <<
eta;
673 for (
unsigned iMatch = 0; iMatch < myRecMatches.size(); iMatch++) {
674 LogTrace (
"HLTMuonVal") <<
"Cand #" << iMatch <<
" ";
675 LogTrace (
"HLTMuonVal") <<
"Pt = " << myRecMatches[iMatch].recCand->pt()
686 LogTrace (
"HLTMuonVal") <<
"\n\n\nSUCESS finding beamspot\n\n\n" << endl;
689 LogWarning (
"HLTMuonVal") <<
"FAILED to get the beamspot for this event";
695 LogTrace(
"HLTMuonVal") <<
"\n\n\n\ngenMuonPt: " << genMuonPt <<
", "
696 <<
"recMuonPt: " << recMuonPt
697 <<
"\nCustom name = " << muonSelection.
customLabel << endl
698 <<
"\nNow preparing to get trigger objects"
706 vector<TriggerObject> l1Particles;
707 vector<TriggerObject> l1RawParticles;
708 vector<TriggerObject> l1Seeds;
713 vector< vector<TriggerObject> > hltParticles(numHltLabels);
716 vector< vector<RecoChargedCandidateRef> > hltCands(numHltLabels);
719 vector<L1MuonParticleRef> l1Cands;
790 LogTrace (
"HLTMuonVal") <<
"\n\n\nLooking for AOD branch named "
791 <<
"hltTriggerSummaryAOD\n\n\n";
794 if ( !aodTriggerEvent.
isValid() ) {
795 LogInfo(
"HLTMuonVal") <<
"No AOD trigger summary found! Returning...";
799 LogTrace (
"HLTMuonVal") <<
"\n\n\nFound a branch! Getting objects\n\n\n";
806 LogTrace (
"HLTMuonVal") <<
"\n\n\nFound a collection with size "
807 << objects.size() <<
"\n\n\n";
809 if (objects.size() < 1) {
811 <<
"You found the collection, but doesn't have any entries";
826 LogTrace (
"HLTMuonVal") <<
"\n\n L1Collection tag is "
827 << collectionTag << endl
828 <<
" and size filters is "
829 << aodTriggerEvent->sizeFilters()
830 <<
"Looking up L1 information in trigSummaryAod";
835 int indexHltColl = 0;
836 vector<string>::const_iterator iHltColl;
840 collectionTag =
InputTag((*iHltColl) ,
"",
853 LogTrace (
"HLTMuonVal") <<
"At the end of parsing the L2/L3 filters, you have found "
854 <<
"L2 = " << ((hltParticles.size() > 0) ? hltParticles[0].
size() : 0)
855 <<
"L3 = " << ((hltParticles.size() > 1) ? hltParticles[1].
size() : 0)
866 LogTrace (
"HLTMuonVal") <<
"\n\n L1Seed colelction tag is "
867 << collectionTag << endl
868 <<
" and size filters is "
869 << aodTriggerEvent->sizeFilters()
870 <<
"Looking up L1 Seed information in trigSummaryAod";
875 LogTrace (
"HLTMuonVal") <<
"At the end of parsing the L1 filter, you have found "
876 << l1Particles.size() <<
" objects: ";
891 for (
size_t i = 0;
i < myRecMatches.size();
i++ ) {
892 myRecMatches[
i].l1Cand = nullTriggerObject;
893 myRecMatches[
i].l1Seed = nullTriggerObject;
894 myRecMatches[
i].hltCands.
assign( numHltLabels, nullTriggerObject );
897 myRecMatches[
i].hltRawCands.assign(numHltLabels, nullLorentzVector);
898 myRecMatches[
i].l1RawCand = nullLorentzVector;
911 for (
size_t i = 0;
i < l1Particles.size();
i++ ) {
914 double eta = l1Cand.
eta();
915 double phi = l1Cand.
phi();
925 if ( match != -1 && myRecMatches[match].l1Cand.
pt() < 0 ) {
926 myRecMatches[
match].l1Cand = l1Cand;
927 LogTrace (
"HLTMuonVal") <<
"Found a rec match to L1 particle (aod) "
928 <<
" rec pt = " << myRecMatches[
match].recCand->pt()
929 <<
", l1 pt = " << myRecMatches[
match].l1Cand.pt();
942 for (
size_t i = 0;
i < l1Seeds.size();
i++ ) {
945 double eta = l1Cand.
eta();
946 double phi = l1Cand.
phi();
955 int match =
findRecMatch( eta, phi, maxDeltaR, myRecMatches );
956 if ( match != -1 && myRecMatches[match].l1Seed.pt() < 0 ) {
957 myRecMatches[
match].l1Seed = l1Cand;
958 LogTrace (
"HLTMuonVal") <<
"Found a rec match to L1 particle (aod) "
959 <<
" rec pt = " << myRecMatches[
match].recCand->pt()
960 <<
", l1 pt = " << myRecMatches[
match].l1Seed.pt();
975 for (
size_t i = 0;
i < l1Cands.size();
i++ ) {
979 double eta = l1Cand.
eta();
980 double phi = l1Cand.phi();
989 int match =
findRecMatch( eta, phi, maxDeltaR, myRecMatches );
990 if ( match != -1 && myRecMatches[match].l1RawCand.energy() < 0 ) {
991 myRecMatches[
match].l1RawCand = l1Cand;
992 LogTrace (
"HLTMuonVal") <<
"Found an L1 match to a RAW object";
1007 vector<unsigned int> numHltCands( numHltLabels, 0) ;
1009 LogTrace (
"HLTMuonVal") <<
"Looking for HLT matches for numHltLabels = "
1014 int triggerLevel = (
i < ( numHltLabels / 2 ) ) ? 2 : 3;
1019 for (
size_t candNum = 0; candNum < hltParticles[
i].size(); candNum++ ) {
1022 double eta = hltCand.
eta();
1023 double phi = hltCand.
phi();
1030 HltFakeStruct tempFakeCand;
1031 tempFakeCand.myHltCand = hltCand;
1033 int match =
findRecMatch( eta, phi, maxDeltaR, myRecMatches );
1037 if ( match != -1 && myRecMatches[match].hltCands[
i].
pt() < 0 ) {
1038 myRecMatches[
match].hltCands[
i] = hltCand;
1040 LogTrace (
"HLTMuonVal") <<
"Found a HLT cand match! "
1041 <<
" rec pt = " << myRecMatches[
match].recCand->pt()
1042 <<
", hlt pt = " << myRecMatches[
match].hltCands[
i].pt();
1046 tempFakeCand.isAFake =
false;
1053 }
else if (match == -1){
1054 tempFakeCand.isAFake =
true;
1059 myHltFakeCands[
i].push_back(tempFakeCand);
1060 LogTrace (
"HLTMuonVal") <<
"\n\nWas this a fake hlt cand? "
1061 << tempFakeCand.isAFake;
1067 LogTrace(
"HLTMuonVal") <<
"Number of HLT Cands: " << numHltCands[
i];
1072 LogTrace (
"HLTMuonVal") <<
"Looking at RAW Candidates for "
1076 for (
size_t candNum = 0; candNum < hltCands[
i].size(); candNum++ ) {
1079 double eta = hltCand.
eta();
1080 double phi = hltCand.phi();
1090 int match =
findRecMatch( eta, phi, maxDeltaR, myRecMatches );
1094 if ( match != -1 && myRecMatches[match].hltCands[
i].
pt() < 0 ) {
1095 myRecMatches[
match].hltRawCands[
i] = hltCand;
1096 LogTrace (
"HLTMuonVal") <<
"Found a RAW hlt match to reco";
std::string theHltProcessName
edm::InputTag HltAodInputTag
virtual bool applyTriggerSelection(MuonSelectionStruct mySelection, const edm::Event &event)
edm::InputTag RecoMuonInputTag
math::XYZTLorentzVector LorentzVector
Single trigger physics object (e.g., an isolated muon)
int findRecMatch(double eta, double phi, double maxdeltaR, std::vector< MatchStruct > matches)
std::string theL1CollectionLabel
unsigned int numHltLabels
std::string theTriggerName
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
StringCutObjectSelector< reco::Muon > recoMuonSelector
std::vector< std::string > theHltCollectionLabels
void getAodTriggerObjectsForModule(edm::InputTag collectionTag, edm::Handle< trigger::TriggerEvent > aodTriggerEvent, trigger::TriggerObjectCollection trigObjs, std::vector< trigger::TriggerObject > &foundObjects, MuonSelectionStruct muonSelection)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
virtual bool applyTrackSelection(MuonSelectionStruct mySelection, reco::Muon candMuon)
edm::InputTag BeamSpotInputTag
std::string theL1SeedModuleForHLTPath
tuple size
Write out results.
edm::InputTag TriggerResultLabel