80 edm::LogInfo(
"SUSY_HLT_Muon_Hadronic") <<
"SUSY_HLT_Muon_Hadronic::analyze" << std::endl;
88 if ( !pfMETCollection.
isValid() ){
89 edm::LogError (
"SUSY_HLT_Muon_Hadronic") <<
"invalid collection: PFMET" <<
"\n";
97 if ( !pfJetCollection.
isValid() ){
98 edm::LogError (
"SUSY_HLT_Muon_Hadronic") <<
"invalid collection: PFJets" <<
"\n";
103 if ( !caloJetCollection.
isValid() ){
104 edm::LogError (
"SUSY_HLT_Muon_Hadronic") <<
"invalid collection: CaloJets" <<
"\n";
113 if ( !MuonCollection.
isValid() ){
114 edm::LogError (
"SUSY_HLT_Mu_Hadronic") <<
"invalid collection: Muons " <<
"\n";
125 edm::LogError (
"SUSY_HLT_Muon_Hadronic") <<
"invalid collection: TriggerResults" <<
"\n";
130 if(!triggerSummary.
isValid()) {
131 edm::LogError (
"SUSY_HLT_Muon_Hadronic") <<
"invalid collection: TriggerSummary" <<
"\n";
137 std::vector<Lepton> onlineMuons;
140 if( !(filterIndex >= triggerSummary->
sizeFilters()) ){
142 for(
size_t j = 0; j < keys.size(); ++j ){
144 if(fabs(foundObject.
id()) == 13){
148 Lepton theMuon; theMuon.
pt = foundObject.
pt(); theMuon.
phi = foundObject.
phi(); theMuon.
eta = foundObject.
eta();
149 onlineMuons.push_back(theMuon);
155 bool hasFired =
false;
156 bool hasFiredAuxiliaryForMuonLeg =
false;
157 bool hasFiredAuxiliaryForHadronicLeg =
false;
159 unsigned int numTriggers = trigNames.
size();
160 for(
unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex ){
168 if(hasFiredAuxiliaryForMuonLeg || hasFiredAuxiliaryForHadronicLeg || !
e.isRealData()) {
170 std::vector<Lepton> offlineMuons;
171 for(reco::MuonCollection::const_iterator
muon = MuonCollection->begin();
muon != MuonCollection->end() ; ++
muon) {
174 offlineMuons.push_back(theMuon);
177 std::sort(onlineMuons.begin(), onlineMuons.end(),
comparePt);
178 std::sort(offlineMuons.begin(), offlineMuons.end(),
comparePt);
190 int indexOfMatchedMuon = -1;
191 int offlineCounter = 0;
192 for(std::vector<Lepton>::iterator offline_muon = offlineMuons.begin(); (offline_muon != offlineMuons.end() && indexOfMatchedMuon == -1); offline_muon++) {
193 for(std::vector<Lepton>::iterator online_muon = onlineMuons.begin(); online_muon != onlineMuons.end(); online_muon++) {
194 if(
sqrt( (offline_muon->phi-online_muon->phi)*(offline_muon->phi-online_muon->phi) +
195 (offline_muon->eta-online_muon->eta)*(offline_muon->eta-online_muon->eta)) < 0.5) {
196 indexOfMatchedMuon = offlineCounter;
205 for (reco::PFJetCollection::const_iterator i_pfjet = pfJetCollection->begin(); i_pfjet != pfJetCollection->end(); ++i_pfjet){
207 if (fabs(i_pfjet->eta()) >
etaThrJet_)
continue;
208 pfHT += i_pfjet->pt();
210 for (reco::CaloJetCollection::const_iterator i_calojet = caloJetCollection->begin(); i_calojet != caloJetCollection->end(); ++i_calojet){
211 if (i_calojet->pt() <
ptThrJet_)
continue;
212 if (fabs(i_calojet->eta()) >
etaThrJet_)
continue;
213 caloHT += i_calojet->pt();
216 if((hasFiredAuxiliaryForMuonLeg || !
e.isRealData()) && !offlineMuons.empty() && pfMETCollection->begin()->et() >
METOffline_ && pfHT >
HTOffline_) {
217 if(hasFired && indexOfMatchedMuon >= 0) {
225 if((hasFiredAuxiliaryForHadronicLeg || !
e.isRealData()) && indexOfMatchedMuon >= 0 && offlineMuons.at(indexOfMatchedMuon).pt >
ptMuonOffline_ && pfHT >
HTOffline_) {
231 if((hasFiredAuxiliaryForHadronicLeg || !
e.isRealData()) && indexOfMatchedMuon >= 0 && offlineMuons.at(indexOfMatchedMuon).pt >
ptMuonOffline_ && pfMETCollection->begin()->et() >
METOffline_) {
bool wasrun() const
Was at least one path run?
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
trigger::size_type sizeFilters() const
bool accept() const
Has at least one path accepted the event?
const Keys & filterKeys(trigger::size_type index) const
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
edm::InputTag triggerFilter_
std::string triggerPathAuxiliaryForHadronic_
Strings::size_type size() const
MonitorElement * h_MuTurnOn_den
std::vector< Muon > MuonCollection
collection of Muon objects
MonitorElement * h_triggerMuEta
edm::EDGetTokenT< reco::PFJetCollection > thePfJetCollection_
Single trigger physics object (e.g., an isolated muon)
std::string triggerPathAuxiliaryForMuon_
MonitorElement * h_triggerMuPt
edm::EDGetTokenT< reco::CaloJetCollection > theCaloJetCollection_
const TriggerObjectCollection & getObjects() const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * h_pfMetTurnOn_num
MonitorElement * h_triggerMuPhi
MonitorElement * h_pfHTTurnOn_den
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
edm::EDGetTokenT< reco::MuonCollection > theMuonCollection_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
static const char *const trigNames[]
std::string const & triggerName(unsigned int index) const
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
std::vector< size_type > Keys
MonitorElement * h_pfHTTurnOn_num
MonitorElement * h_MuTurnOn_num
MonitorElement * h_pfMetTurnOn_den
bool comparePt(Lepton a, Lepton b)