11 #include "TLorentzVector.h"
15 #include <sys/types.h>
21 edm::LogInfo(
"SUSY_HLT_VBF_Mu") <<
"Constructor SUSY_HLT_VBF_Mu::SUSY_HLT_VBF_Mu " << std::endl;
51 edm::LogInfo(
"SUSY_HLT_VBF_Mu") <<
"Destructor SUSY_HLT_VBF_Mu::~SUSY_HLT_VBF_Mu " << std::endl;
60 edm::LogError(
"SUSY_HLT_VBF_Mu") <<
"Initialization of HLTConfigProvider failed!!";
64 bool pathFound =
false;
66 for(
size_t j = 0;
j <allTrigNames.size(); ++
j) {
73 LogDebug(
"SUSY_HLT_VBF_Mu") <<
"Path not found" <<
"\n";
77 edm::LogInfo(
"SUSY_HLT_VBF_Mu") <<
"SUSY_HLT_VBF_Mu::beginRun" << std::endl;
82 edm::LogInfo(
"SUSY_HLT_VBF_Mu") <<
"SUSY_HLT_VBF_Mu::bookHistograms" << std::endl;
90 edm::LogInfo(
"SUSY_HLT_VBF_Mu") <<
"SUSY_HLT_VBF_Mu::beginLuminosityBlock" << std::endl;
98 edm::LogInfo(
"SUSY_HLT_VBF_Mu") <<
"SUSY_HLT_VBF_Mu::analyze" << std::endl;
106 if ( !pfJetCollection.
isValid() ){
107 edm::LogError (
"SUSY_HLT_VBF_Mu") <<
"invalid collection: PFJets" <<
"\n";
113 if ( !caloJetCollection.
isValid() ){
114 edm::LogError (
"SUSY_HLT_VBF_Mu") <<
"invalid collection: CaloJets" <<
"\n";
123 if ( !MuonCollection.
isValid() ){
124 edm::LogError (
"SUSY_HLT_VBF_Mu") <<
"invalid collection: Muons " <<
"\n";
135 if ( !caloMETCollection.
isValid() ){
136 edm::LogError (
"SUSY_HLT_VBF_Mu") <<
"invalid collection: CaloMET" <<
"\n";
143 if ( !pfMETCollection.
isValid() ){
144 edm::LogError (
"SUSY_HLT_VBF_Mu") <<
"invalid collection: PFMET" <<
"\n";
155 edm::LogError (
"SUSY_HLT_VBF_Mu") <<
"invalid collection: TriggerResults" <<
"\n";
160 if(!triggerSummary.
isValid()) {
161 edm::LogError (
"SUSY_HLT_VBF_Mu") <<
"invalid collection: TriggerSummary" <<
"\n";
169 std::vector<float> ptMuon, etaMuon, phiMuon;
172 if( !(filterIndexMu >= triggerSummary->sizeFilters()) ){
174 for(
size_t j = 0;
j < keys.size(); ++
j ){
176 if(fabs(foundObject.
id()) == 13){
179 for(
unsigned int x=0;
x<ptMuon.size();
x++){
180 if(fabs(ptMuon[
x] - foundObject.
pt()) < 0.01)
188 ptMuon.push_back(foundObject.
pt());
189 etaMuon.push_back(foundObject.
eta());
190 phiMuon.push_back(foundObject.
phi());
203 if( !(filterIndexMet >= triggerSummary->sizeFilters()) ){
205 for(
size_t j = 0;
j < keys.size(); ++
j ){
214 std::vector<float> ptJet,
etaJet, phiJet;
215 if( !(dijetFilterIndex >= triggerSummary->sizeFilters()) ){
216 const trigger::Keys& KEYS(triggerSummary->filterKeys(dijetFilterIndex));
217 const size_t nK(KEYS.size());
220 for (
size_t i=0;
i < nK ;
i++ ) {
225 for (
size_t j=i;
j < nK;
j++) {
229 double tmpdeta = fabs( TO1.
eta() - TO2.
eta() );
230 double tmpopposite = TO1.
eta() * TO2.
eta() ;
232 TLorentzVector j1 ( TO1.
px(), TO1.
py(), TO1.
pz(), TO1.
energy());
233 TLorentzVector j2 ( TO2.
px(), TO2.
py(), TO2.
pz(), TO2.
energy());
234 double tmpmass = ( j1 + j2 ).M();
235 if(
dijet < tmpmass ) {
249 if( filterIndexCaloMET < triggerSummary->sizeFilters() ) {
252 float met_h = triggerObjects[ keys[0] ].pt();
261 if( filterIndexHt < triggerSummary->sizeFilters() ) {
264 float ht = triggerObjects[ keys[0] ].pt();
271 bool hasFired =
false;
274 unsigned int numTriggers = trigNames.
size();
276 for(
unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex ){
277 if (trigNames.
triggerName(hltIndex).find(
triggerPath_) != std::string::npos && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex)) hasFired =
true;
284 int indexOfMatchedMuon = -1;
285 int offlineCounter = 0;
286 for(reco::MuonCollection::const_iterator
muon = MuonCollection->begin();
muon != MuonCollection->end() ; ++
muon) {
287 for(
size_t off_i = 0; off_i < ptMuon.size(); ++off_i) {
289 indexOfMatchedMuon = offlineCounter;
300 for (reco::PFJetCollection::const_iterator i_pfjet = pfJetCollection->begin(); i_pfjet != pfJetCollection->end(); ++i_pfjet){
302 if (fabs(i_pfjet->eta()) >
etaThrJet_)
continue;
303 pfHT += i_pfjet->pt();
310 size_t jetCol = pfJetCollection->size();
312 for (
size_t i=0;
i < jetCol ;
i++ ) {
316 for (
size_t j=
i;
j <jetCol ;
j++) {
322 double tmpdetaOff = fabs( pfJetCollection->at(
i).eta() - pfJetCollection->at(
j).eta() );
323 double tmpoppositeOff = pfJetCollection->at(
i).eta() * pfJetCollection->at(
j).eta() ;
325 TLorentzVector j1Off ( pfJetCollection->at(
i).px(), pfJetCollection->at(
i).py(), pfJetCollection->at(
i).pz(), pfJetCollection->at(
i).energy());
326 TLorentzVector j2Off ( pfJetCollection->at(
j).px(), pfJetCollection->at(
j).py(), pfJetCollection->at(
j).pz(), pfJetCollection->at(
j).energy());
327 double tmpmassOff = ( j1Off + j2Off ).M();
381 edm::LogInfo(
"SUSY_HLT_VBF_Mu") <<
"SUSY_HLT_VBF_Mu::endLuminosityBlock" << std::endl;
387 edm::LogInfo(
"SUSY_HLT_VBF_Mu") <<
"SUSY_HLT_VBF_Mu::endRun" << std::endl;
404 h_ht = ibooker_.
book1D(
"h_ht",
"h_ht",30, 0.0, 1500.0 );
T getParameter(std::string const &) const
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * h_triggerMuPhi
edm::EDGetTokenT< reco::CaloMETCollection > theCaloMETCollection_
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
MonitorElement * h_num_met
MonitorElement * h_den_muonpt
MonitorElement * h_triggerCaloMet
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::InputTag triggerMetFilter_
const std::vector< std::string > & triggerNames() const
names of trigger paths
edm::EDGetTokenT< reco::MuonCollection > theMuonCollection_
double mjjOnlinethreshold
double muonOnlinethreshold
Strings::size_type size() const
double deltaR(const T1 &t1, const T2 &t2)
MonitorElement * h_num_muoneta
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< reco::PFJetCollection > thePfJetCollection_
HLTConfigProvider fHltConfig
std::vector< Muon > MuonCollection
collection of Muon objects
Single trigger physics object (e.g., an isolated muon)
SUSY_HLT_VBF_Mu(const edm::ParameterSet &ps)
MonitorElement * h_num_mjj
edm::InputTag triggerDiJetFilter_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
MonitorElement * h_DiJetMass
MonitorElement * book1D(Args &&...args)
MonitorElement * h_den_met
edm::InputTag triggerHTFilter_
edm::InputTag triggerMuFilter_
MonitorElement * h_triggerMuPt
MonitorElement * h_den_mjj
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
static const char *const trigNames[]
void setCurrentFolder(const std::string &fullpath)
virtual ~SUSY_HLT_VBF_Mu()
std::string const & triggerName(unsigned int index) const
std::vector< size_type > Keys
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
edm::EDGetTokenT< reco::CaloJetCollection > theCaloJetCollection_
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
MonitorElement * h_num_muonpt
MonitorElement * h_num_ht
double pfmetOnlinethreshold
MonitorElement * h_triggerMetPhi
MonitorElement * h_triggerMuEta
void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
MonitorElement * h_den_ht
void bookHistos(DQMStore::IBooker &)
MonitorElement * h_triggerMet
edm::InputTag triggerCaloMETFilter_
MonitorElement * h_den_muoneta
void endLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)