CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
SUSYDQMAnalyzer Class Reference

#include <SUSYDQMAnalyzer.h>

Inheritance diagram for SUSYDQMAnalyzer:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 SUSYDQMAnalyzer (const edm::ParameterSet &)
 
 ~SUSYDQMAnalyzer () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

double _maxAbsEta
 
double _maxNJets
 
double _ptThreshold
 
MonitorElementhCaloAlpha_T
 
MonitorElementhCaloHT
 
MonitorElementhCaloMET
 
MonitorElementhCaloMHT
 
MonitorElementhPFAlpha_T
 
MonitorElementhPFHT
 
MonitorElementhPFMET
 
MonitorElementhPFMHT
 
edm::ParameterSet iConfig
 
std::string SUSYFolder
 
edm::EDGetTokenT< reco::CaloJetCollectiontheCaloJetCollectionToken
 
edm::EDGetTokenT< reco::CaloMETCollectiontheCaloMETCollectionToken
 
edm::EDGetTokenT< std::vector< reco::PFJet > > thePFJetCollectionToken
 
edm::EDGetTokenT< reco::PFMETCollectionthePFMETCollectionToken
 

Static Private Attributes

static const char * messageLoggerCatregory = "SUSYDQM"
 

Detailed Description

Definition at line 26 of file SUSYDQMAnalyzer.h.

Constructor & Destructor Documentation

SUSYDQMAnalyzer::SUSYDQMAnalyzer ( const edm::ParameterSet pSet)
explicit

Definition at line 72 of file SUSYDQMAnalyzer.cc.

References edm::ParameterSet::getParameter(), messageLoggerCatregory, and AlCaHLTBitMon_QueryRunRegistry::string.

73 {
74  iConfig = pSet;
75 
76  SUSYFolder = iConfig.getParameter<std::string>("folderName");
77  // Load parameters
78  thePFMETCollectionToken = consumes<reco::PFMETCollection> (iConfig.getParameter<edm::InputTag>("PFMETCollectionLabel"));
79  theCaloMETCollectionToken = consumes<reco::CaloMETCollection> (iConfig.getParameter<edm::InputTag>("CaloMETCollectionLabel"));
80 
81  //remove TCMET and JPT related variables due to anticipated changes in RECO
82  //theTCMETCollectionToken = consumes<reco::METCollection> (iConfig.getParameter<edm::InputTag>("TCMETCollectionLabel"));
83 
84  theCaloJetCollectionToken = consumes<reco::CaloJetCollection> (iConfig.getParameter<edm::InputTag>("CaloJetCollectionLabel"));
85  //theJPTJetCollectionToken = consumes<reco::JPTJetCollection> (iConfig.getParameter<edm::InputTag>("JPTJetCollectionLabel"));
86  thePFJetCollectionToken = consumes<std::vector<reco::PFJet> > (iConfig.getParameter<edm::InputTag>("PFJetCollectionLabel"));
87 
88  _ptThreshold = iConfig.getParameter<double>("ptThreshold");
89  _maxNJets = iConfig.getParameter<double>("maxNJets");
90  _maxAbsEta = iConfig.getParameter<double>("maxAbsEta");
91 
92 }
std::string SUSYFolder
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::CaloJetCollection > theCaloJetCollectionToken
edm::EDGetTokenT< reco::PFMETCollection > thePFMETCollectionToken
edm::EDGetTokenT< reco::CaloMETCollection > theCaloMETCollectionToken
edm::ParameterSet iConfig
edm::EDGetTokenT< std::vector< reco::PFJet > > thePFJetCollectionToken
SUSYDQMAnalyzer::~SUSYDQMAnalyzer ( )
override

Definition at line 273 of file SUSYDQMAnalyzer.cc.

273  {
274 }

Member Function Documentation

void SUSYDQMAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 141 of file SUSYDQMAnalyzer.cc.

References funct::abs(), edm::Event::getByToken(), edm::HandleBase::isValid(), metsig::jet, edm::Handle< T >::product(), reco::LeafCandidate::pt(), HT< T >::ScalarSum, and HT< T >::v.

142 {
143  //###########################################################
144  // HTand MHT
145 
146  //===========================================================
147  // Calo HT, MHT and alpha_T
148 
150 
151  iEvent.getByToken(theCaloJetCollectionToken, CaloJetcoll);
152 
153  if(!CaloJetcoll.isValid()) return;
154 
155  std::vector<math::XYZTLorentzVector> Ps;
156  for (reco::CaloJetCollection::const_iterator jet = CaloJetcoll->begin(); jet!=CaloJetcoll->end(); ++jet){
157  if ((jet->pt()>_ptThreshold) && (abs(jet->eta()) < _maxAbsEta)){
158  if(Ps.size()>_maxNJets) {
159  edm::LogInfo(messageLoggerCatregory)<<"NMax Jets exceded..";
160  break;
161  }
162  Ps.push_back(jet->p4());
163  }
164  }
165 
166  hCaloAlpha_T->Fill( alpha_T()(Ps));
167 
169 
170  hCaloHT->Fill(CaloHT.ScalarSum);
171  hCaloMHT->Fill(CaloHT.v.Mod());
172 
173  //===========================================================
174  // PF HT, MHT and alpha_T
175 
177 
178  iEvent.getByToken(thePFJetCollectionToken, PFjetcoll);
179 
180  if(!PFjetcoll.isValid()) return;
181 
182  Ps.clear();
183  for (reco::PFJetCollection::const_iterator jet = PFjetcoll->begin(); jet!=PFjetcoll->end(); ++jet){
184  if ((jet->pt()>_ptThreshold) && (abs(jet->eta()) < _maxAbsEta)){
185  if(Ps.size()>_maxNJets) {
186  edm::LogInfo(messageLoggerCatregory)<<"NMax Jets exceded..";
187  break;
188  }
189  Ps.push_back(jet->p4());
190  }
191  }
192  hPFAlpha_T->Fill( alpha_T()(Ps));
193 
195 
196  hPFHT->Fill(PFHT.ScalarSum);
197  hPFMHT->Fill(PFHT.v.Mod());
198 
199  //===========================================================
200  // JPT HT, MHT and alpha_T
201 
202  //edm::Handle<reco::JPTJetCollection> JPTjetcoll;
203 
204  //iEvent.getByToken(theJPTJetCollectionToken, JPTjetcoll);
205 
206  //if(!JPTjetcoll.isValid()) return;
207 
208  //Ps.clear();
209  //for (reco::JPTJetCollection::const_iterator jet = JPTjetcoll->begin(); jet!=JPTjetcoll->end(); ++jet){
210  //if ((jet->pt()>_ptThreshold) && (abs(jet->eta())<_maxAbsEta)){
211  // if(Ps.size()>_maxNJets) {
212  // edm::LogInfo(messageLoggerCatregory)<<"NMax Jets exceded..";
213  // break;
214  // }
215  // Ps.push_back(jet->p4());
216  //}
217  //}
218  //hJPTAlpha_T->Fill( alpha_T()(Ps));
219 
220  //HT<reco::JPTJetCollection> JPTHT(JPTjetcoll, _ptThreshold, _maxAbsEta);
221 
222  //hJPTHT->Fill(JPTHT.ScalarSum);
223  //hJPTMHT->Fill(JPTHT.v.Mod());
224 
225  //###########################################################
226  // MET
227 
228  //===========================================================
229  // Calo MET
230 
232  iEvent.getByToken(theCaloMETCollectionToken, calometcoll);
233 
234  if(!calometcoll.isValid()) return;
235 
236  const CaloMETCollection *calometcol = calometcoll.product();
237  const CaloMET *calomet;
238  calomet = &(calometcol->front());
239 
240  hCaloMET->Fill(calomet->pt());
241 
242  //===========================================================
243  // PF MET
244 
246  iEvent.getByToken(thePFMETCollectionToken, pfmetcoll);
247 
248  if(!pfmetcoll.isValid()) return;
249 
250  const PFMETCollection *pfmetcol = pfmetcoll.product();
251  const PFMET *pfmet;
252  pfmet = &(pfmetcol->front());
253 
254  hPFMET->Fill(pfmet->pt());
255 
256  //===========================================================
257  // TC MET
258 
259  //edm::Handle<reco::METCollection> tcmetcoll;
260  //iEvent.getByToken(theTCMETCollectionToken, tcmetcoll);
261 
262  //if(!tcmetcoll.isValid()) return;
263 
264  //const METCollection *tcmetcol = tcmetcoll.product();
265  //const MET *tcmet;
266  //tcmet = &(tcmetcol->front());
267 
268  //hTCMET->Fill(tcmet->pt());
269 
270 }
MonitorElement * hCaloMHT
MonitorElement * hCaloHT
MonitorElement * hPFAlpha_T
MonitorElement * hPFMHT
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
double pt() const final
transverse momentum
edm::EDGetTokenT< reco::CaloJetCollection > theCaloJetCollectionToken
edm::EDGetTokenT< reco::PFMETCollection > thePFMETCollectionToken
MonitorElement * hCaloMET
void Fill(long long x)
Collection of Calo MET.
MonitorElement * hPFHT
MonitorElement * hCaloAlpha_T
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< reco::CaloMETCollection > theCaloMETCollectionToken
T const * product() const
Definition: Handle.h:74
static const char * messageLoggerCatregory
edm::EDGetTokenT< std::vector< reco::PFJet > > thePFJetCollectionToken
Definition: HT.h:21
MonitorElement * hPFMET
Collection of PF MET.
void SUSYDQMAnalyzer::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivate

Definition at line 97 of file SUSYDQMAnalyzer.cc.

References DQMStore::IBooker::book1D(), dir, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

99  {
100  // if( dqm ) {
101  //===========================================================
102  // book HT histos.
104  dir+="HT";
105  ibooker.setCurrentFolder(dir);
106  hCaloHT = ibooker.book1D("Calo_HT", "", 500, 0., 2000);
107  hPFHT = ibooker.book1D("PF_HT" , "", 500, 0., 2000);
108  //hJPTHT = ibooker.book1D("JPT_HT" , "", 500, 0., 2000);
109  //===========================================================
110  // book MET histos.
111 
112  dir=SUSYFolder;
113  dir+="MET";
114  ibooker.setCurrentFolder(dir);
115  hCaloMET = ibooker.book1D("Calo_MET", "", 500, 0., 1000);
116  hPFMET = ibooker.book1D("PF_MET" , "", 500, 0., 1000);
117  //hTCMET = ibooker.book1D("TC_MET" , "", 500, 0., 1000);
118 
119  //===========================================================
120  // book MHT histos.
121 
122  dir=SUSYFolder;
123  dir+="MHT";
124  ibooker.setCurrentFolder(dir);
125  hCaloMHT = ibooker.book1D("Calo_MHT", "", 500, 0., 1000);
126  hPFMHT = ibooker.book1D("PF_MHT" , "", 500, 0., 1000);
127  //hJPTMHT = ibooker.book1D("JPT_MHT" , "", 500, 0., 1000);
128 
129  //===========================================================
130  // book alpha_T histos.
131 
132  dir=SUSYFolder;
133  dir+="Alpha_T";
134  ibooker.setCurrentFolder(dir);
135  hCaloAlpha_T = ibooker.book1D("Calo_AlphaT", "", 100, 0., 1.);
136  //hJPTAlpha_T = ibooker.book1D("PF_AlphaT" , "", 100, 0., 1.);
137  hPFAlpha_T = ibooker.book1D("PF_AlphaT" , "", 100, 0., 1.);
138  // }
139 }
std::string SUSYFolder
MonitorElement * hCaloMHT
MonitorElement * hCaloHT
MonitorElement * hPFAlpha_T
MonitorElement * hPFMHT
MonitorElement * hCaloMET
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * hPFHT
MonitorElement * hCaloAlpha_T
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * hPFMET

Member Data Documentation

double SUSYDQMAnalyzer::_maxAbsEta
private

Definition at line 47 of file SUSYDQMAnalyzer.h.

double SUSYDQMAnalyzer::_maxNJets
private

Definition at line 46 of file SUSYDQMAnalyzer.h.

double SUSYDQMAnalyzer::_ptThreshold
private

Definition at line 45 of file SUSYDQMAnalyzer.h.

MonitorElement* SUSYDQMAnalyzer::hCaloAlpha_T
private

Definition at line 67 of file SUSYDQMAnalyzer.h.

MonitorElement* SUSYDQMAnalyzer::hCaloHT
private

Definition at line 55 of file SUSYDQMAnalyzer.h.

MonitorElement* SUSYDQMAnalyzer::hCaloMET
private

Definition at line 59 of file SUSYDQMAnalyzer.h.

MonitorElement* SUSYDQMAnalyzer::hCaloMHT
private

Definition at line 63 of file SUSYDQMAnalyzer.h.

MonitorElement* SUSYDQMAnalyzer::hPFAlpha_T
private

Definition at line 69 of file SUSYDQMAnalyzer.h.

MonitorElement* SUSYDQMAnalyzer::hPFHT
private

Definition at line 57 of file SUSYDQMAnalyzer.h.

MonitorElement* SUSYDQMAnalyzer::hPFMET
private

Definition at line 60 of file SUSYDQMAnalyzer.h.

MonitorElement* SUSYDQMAnalyzer::hPFMHT
private

Definition at line 65 of file SUSYDQMAnalyzer.h.

edm::ParameterSet SUSYDQMAnalyzer::iConfig
private

Definition at line 32 of file SUSYDQMAnalyzer.h.

const char * SUSYDQMAnalyzer::messageLoggerCatregory = "SUSYDQM"
staticprivate

Definition at line 50 of file SUSYDQMAnalyzer.h.

Referenced by SUSYDQMAnalyzer().

std::string SUSYDQMAnalyzer::SUSYFolder
private

Definition at line 49 of file SUSYDQMAnalyzer.h.

edm::EDGetTokenT<reco::CaloJetCollection> SUSYDQMAnalyzer::theCaloJetCollectionToken
private

Definition at line 39 of file SUSYDQMAnalyzer.h.

edm::EDGetTokenT<reco::CaloMETCollection> SUSYDQMAnalyzer::theCaloMETCollectionToken
private

Definition at line 41 of file SUSYDQMAnalyzer.h.

edm::EDGetTokenT<std::vector<reco::PFJet> > SUSYDQMAnalyzer::thePFJetCollectionToken
private

Definition at line 38 of file SUSYDQMAnalyzer.h.

edm::EDGetTokenT<reco::PFMETCollection> SUSYDQMAnalyzer::thePFMETCollectionToken
private

Definition at line 37 of file SUSYDQMAnalyzer.h.