9 #include "../interface/HLTOniaSource.h"
30 std::vector<std::string> myTriggerPaths;
31 myTriggerPaths.push_back(
"HLT_Mu0_Track0_Jpsi");
32 myTriggerPaths.push_back(
"HLT_Mu3_Track0_Jpsi");
33 myTriggerPaths.push_back(
"HLT_Mu5_Track0_Jpsi");
37 std::vector<edm::InputTag> myOniaMuonTags;
39 myOniaMuonTags.push_back(
edm::InputTag(
"hltMu0TrackJpsiL3Filtered0",
"",
"HLT"));
40 myOniaMuonTags.push_back(
edm::InputTag(
"hltMu3TrackJpsiL3Filtered3",
"",
"HLT"));
41 myOniaMuonTags.push_back(
edm::InputTag(
"hltMu5TrackJpsiL3Filtered5",
"",
"HLT"));
56 std::vector<edm::InputTag> pxlTagsAfterFilter;
57 pxlTagsAfterFilter.push_back(
edm::InputTag(
"hltMu0TrackJpsiPixelMassFiltered",
"",
"HLT"));
58 pxlTagsAfterFilter.push_back(
edm::InputTag(
"hltMu3TrackJpsiPixelMassFiltered",
"",
"HLT"));
59 pxlTagsAfterFilter.push_back(
edm::InputTag(
"hltMu5TrackJpsiPixelMassFiltered",
"",
"HLT"));
63 std::vector<edm::InputTag> trxTagsAfterFilter;
64 trxTagsAfterFilter.push_back(
edm::InputTag(
"hltMu0TrackJpsiTrackMassFiltered",
"",
"HLT"));
65 trxTagsAfterFilter.push_back(
edm::InputTag(
"hltMu3TrackJpsiTrackMassFiltered",
"",
"HLT"));
66 trxTagsAfterFilter.push_back(
edm::InputTag(
"hltMu5TrackJpsiTrackMassFiltered",
"",
"HLT"));
80 edm::LogVerbatim (
"oniatriggermonitor") <<
"[HLTOniaSource]: Could not access DQM Store.";
151 mypixelCands = * pixelCands;
163 mytrackCands = * trackCands;
173 if (recoBeamSpotHandle.
isValid()) {
184 if( rawTriggerEvent.
isValid() ){
188 std::vector<reco::RecoChargedCandidateRef> myMuonFilterCands;
189 std::vector<reco::RecoChargedCandidateRef> myPixelFilterCands;
190 std::vector<reco::RecoChargedCandidateRef> myTrackFilterCands;
193 size_t indexM = rawTriggerEvent->filterIndex(
oniaMuonTag_[
i]);
195 if ( indexM < rawTriggerEvent->
size() ){
203 if ( indexP < rawTriggerEvent->
size() ){
213 if ( indexT < rawTriggerEvent->
size() ){
221 if( myMuonFilterCands.size() > 0){
241 std::stringstream myMeName;
245 myMeName<<meName<<
"_Pt";
246 myMap[meName+
"pt"]=
dbe_->
book1D(myMeName.str(), myMeName.str(),200, 0.0, 20.0);
251 myMeName<<meName<<
"_P";
252 myMap[meName+
"p"]=
dbe_->
book1D(myMeName.str(), myMeName.str(),250, 0.0, 50.0);
257 myMeName<<meName<<
"_Eta";
258 myMap[meName+
"eta"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 50, -2.5, 2.5 );
263 myMeName<<meName<<
"_Phi";
264 myMap[meName+
"phi"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 144, -3.1416, 3.1416 );
269 myMeName<<meName<<
"_Phi";
270 myMap[meName+
"phi"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 144, -3.1416, 3.1416 );
275 myMeName<<meName<<
"_Charge";
276 myMap[meName+
"charge"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 3, -1.5, 1.5 );
281 myMeName<<meName<<
"_Dz";
282 myMap[meName+
"dz"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 400, -20.0, 20.0 );
287 myMeName<<meName<<
"_Dxy";
288 myMap[meName+
"dxy"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 100, -0.5, 0.5 );
293 myMeName<<meName<<
"_EtaPhi";
294 myMap[meName+
"etaphi"]=
dbe_->
book2D(myMeName.str(), myMeName.str(), 144, -3.1416, 3.1416 ,50, -2.5, 2.5 );
296 myMap[meName+
"etaphi"]->setAxisTitle(
"Eta", 2);
300 myMeName<<meName<<
"_EtaPt";
301 myMap[meName+
"etapt"]=
dbe_->
book2D(myMeName.str(), myMeName.str(), 100, 0.0, 100.0, 50, -2.5, 2.5 );
303 myMap[meName+
"etapt"]->setAxisTitle(
"Eta", 2);
307 myMeName<<meName<<
"_ValidHits";
308 myMap[meName+
"validhits"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 50, 0.0, 50.0 );
309 myMap[meName+
"validhits"]->
setAxisTitle(
"ValidHits", 1);
313 myMeName<<meName<<
"_NormChi2";
314 myMap[meName+
"normchi"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 300, 0.0, 30.0 );
315 myMap[meName+
"normchi"]->
setAxisTitle(
"Normalized Chi2", 1);
319 myMeName<<meName<<
"_NrCandidates";
320 myMap[meName+
"nrcand"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 50, 0.0, 50.0 );
321 myMap[meName+
"nrcand"]->
setAxisTitle(
"Nr per Event", 1);
328 std::stringstream meName;
331 meName<<label1<<
"_"<<label2<<
"_SameCharge_InvariantMass";
332 massME_[label1+label2+
"same"]=
dbe_->
book1D(meName.str(), meName.str(),120, 0.0, 6.0);
333 massME_[label1+label2+
"same"]->setAxisTitle(
"mass (GeV)", 1);
337 meName<<label1<<
"_"<<label2<<
"_OppositeCharge_InvariantMass";
338 massME_[label1+label2+
"opposite"]=
dbe_->
book1D(meName.str(), meName.str(),120, 0.0, 6.0);
339 massME_[label1+label2+
"opposite"]->setAxisTitle(
"mass (GeV)", 1);
343 meName<<label1<<
"_"<<label2<<
"_SameCharge_HighestPT_InvariantMass";
344 massME_[label1+label2+
"same"+
"highestpt"]=
dbe_->
book1D(meName.str(), meName.str(),120, 0.0, 6.0);
345 massME_[label1+label2+
"same"+
"highestpt"]->setAxisTitle(
"mass (GeV)", 1);
349 meName<<label1<<
"_"<<label2<<
"_OppositeCharge_HighestPT_InvariantMass";
350 massME_[label1+label2+
"opposite"+
"highestpt"]=
dbe_->
book1D(meName.str(), meName.str(),120, 0.0, 6.0);
351 massME_[label1+label2+
"opposite"+
"highestpt"]->setAxisTitle(
"mass (GeV)", 1);
357 meName<<label1<<
"_"<<label2<<
"_SameCharge_HighestPT_MaxDzMuonTrack";
358 massME_[label1+label2+
"same"+
"highestpt"+
"maxdzmuontrack"]=
dbe_->
book1D(meName.str(), meName.str(),50, 0.0, 5.0);
359 massME_[label1+label2+
"same"+
"highestpt"+
"maxdzmuontrack"]->setAxisTitle(
"MaxDz Muon-Track", 1);
362 meName<<label1<<
"_"<<label2<<
"_SameCharge_MaxDzMuonTrack";
363 massME_[label1+label2+
"same"+
"maxdzmuontrack"]=
dbe_->
book1D(meName.str(), meName.str(),50, 0.0, 5.0);
364 massME_[label1+label2+
"same"+
"maxdzmuontrack"]->setAxisTitle(
"MaxDz Muon-Track", 1);
367 meName<<label1<<
"_"<<label2<<
"_OppositeCharge_HighestPT_MaxDzMuonTrack";
368 massME_[label1+label2+
"opposite"+
"highestpt"+
"maxdzmuontrack"]=
dbe_->
book1D(meName.str(), meName.str(),50, 0.0, 5.0);
369 massME_[label1+label2+
"opposite"+
"highestpt"+
"maxdzmuontrack"]->setAxisTitle(
"MaxDz Muon-Track", 1);
372 meName<<label1<<
"_"<<label2<<
"_OppositeCharge_MaxDzMuonTrack";
373 massME_[label1+label2+
"opposite"+
"maxdzmuontrack"]=
dbe_->
book1D(meName.str(), meName.str(),50, 0.0, 5.0);
374 massME_[label1+label2+
"opposite"+
"maxdzmuontrack"]->setAxisTitle(
"MaxDz Muon-Track", 1);
387 typedef reco::TrackCollection::const_iterator cand;
389 for (cand tk=myCollection.begin(); tk!=myCollection.end(); tk++) {
392 if(mapME[collectionLabel+
"pt"]){ mapME[collectionLabel+
"pt"]->Fill(tk->pt()); }
393 if(mapME[collectionLabel+
"p"]) { mapME[collectionLabel+
"p"]->Fill(tk->p()); }
394 if(mapME[collectionLabel+
"eta"]) { mapME[collectionLabel+
"eta"]->Fill(tk->eta()); }
395 if(mapME[collectionLabel+
"phi"]) { mapME[collectionLabel+
"phi"]->Fill(tk->phi()); }
396 if(mapME[collectionLabel+
"etaphi"]){ mapME[collectionLabel+
"etaphi"]->Fill(tk->phi(),tk->eta()); }
397 if(mapME[collectionLabel+
"etapt"]){ mapME[collectionLabel+
"etapt"]->Fill(tk->pt(),tk->eta()); }
398 if(mapME[collectionLabel+
"charge"]){ mapME[collectionLabel+
"charge"]->Fill(tk->charge()); }
406 if(mapME[collectionLabel+
"nrcand"]){ mapME[collectionLabel+
"nrcand"]->Fill(num);}
414 for (
unsigned int i=0;
i!=candidateVector.size();
i++) {
418 if(mapME[collectionLabel+
"pt"]){ mapME[collectionLabel+
"pt"]->Fill(tk.
pt()); }
419 if(mapME[collectionLabel+
"p"]) { mapME[collectionLabel+
"p"]->Fill(tk.
p()); }
420 if(mapME[collectionLabel+
"eta"]) { mapME[collectionLabel+
"eta"]->Fill(tk.
eta()); }
421 if(mapME[collectionLabel+
"phi"]) { mapME[collectionLabel+
"phi"]->Fill(tk.
phi()); }
422 if(mapME[collectionLabel+
"etaphi"]){ mapME[collectionLabel+
"etaphi"]->Fill(tk.
phi(),tk.
eta()); }
423 if(mapME[collectionLabel+
"etapt"]){ mapME[collectionLabel+
"etapt"]->Fill(tk.
pt(),tk.
eta()); }
424 if(mapME[collectionLabel+
"charge"]){ mapME[collectionLabel+
"charge"]->Fill(tk.
charge()); }
433 if(mapME[collectionLabel+
"nrcand"]){ mapME[collectionLabel+
"nrcand"]->Fill( candidateVector.size());}
445 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
446 for (cand
i=myCollection.begin();
i!=myCollection.end();
i++) {
451 if(mapME[collectionLabel+
"pt"]){ mapME[collectionLabel+
"pt"]->Fill(tk.
pt()); }
452 if(mapME[collectionLabel+
"p"]) { mapME[collectionLabel+
"p"]->Fill(tk.
p()); }
453 if(mapME[collectionLabel+
"eta"]) { mapME[collectionLabel+
"eta"]->Fill(tk.
eta()); }
454 if(mapME[collectionLabel+
"phi"]) { mapME[collectionLabel+
"phi"]->Fill(tk.
phi()); }
455 if(mapME[collectionLabel+
"etaphi"]){ mapME[collectionLabel+
"etaphi"]->Fill(tk.
phi(),tk.
eta()); }
456 if(mapME[collectionLabel+
"etapt"]){ mapME[collectionLabel+
"etapt"]->Fill(tk.
pt(),tk.
eta()); }
457 if(mapME[collectionLabel+
"charge"]){ mapME[collectionLabel+
"charge"]->Fill(tk.
charge()); }
465 if(mapME[collectionLabel+
"nrcand"]){ mapME[collectionLabel+
"nrcand"]->Fill(num);}
473 for(
size_t i = 0 ;
i< cand1.size();
i++) {
479 if(cand1[
i]->
charge() * cand2[0]->charge() < 0) chargeLabel =
"opposite";
480 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]){
481 massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]->Fill((cand1[
i]->
p4()+cand2[0]->
p4()).mass());
483 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"+
"maxdzmuontrack"]){
491 for (
size_t j= 0;
j< cand2.size();
j++) {
493 if(cand2[
j]->
p() < 3)
continue;
496 if(cand1[
i]->
charge() * cand2[
j]->charge() < 0) chargeLabel =
"opposite";
497 if(
massME_[cand1Label+cand2Label+chargeLabel]){
498 massME_[cand1Label+cand2Label+chargeLabel]->Fill((cand1[
i]->
p4()+cand2[
j]->
p4()).mass());
500 if(
massME_[cand1Label+cand2Label+chargeLabel+
"maxdzmuontrack"]){
513 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
515 for(
size_t i = 0 ;
i< cand1.size();
i++) {
517 if(cand2.begin() != cand2.end() && cand2.begin()->p()>3) {
518 cand candItr = cand2.begin();
521 if(cand1[
i]->
charge() * candItr->charge() < 0) chargeLabel =
"opposite";
522 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]){
523 massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]->Fill((cand1[
i]->
p4()+candItr->p4()).mass());
526 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"+
"maxdzmuontrack"]){
533 for (cand candItr2= cand2.begin(); candItr2!=cand2.end(); candItr2++) {
534 if(candItr2->p() < 3)
continue;
537 if(cand1[
i]->
charge() * candItr2->charge() < 0) chargeLabel =
"opposite";
538 if(
massME_[cand1Label+cand2Label+chargeLabel]){
539 massME_[cand1Label+cand2Label+chargeLabel]->Fill((cand1[
i]->
p4()+candItr2->p4()).mass());
541 if(
massME_[cand1Label+cand2Label+chargeLabel+
"maxdzmuontrack"]){
554 typedef reco::TrackCollection::const_iterator cand;
557 for(
size_t i = 0 ;
i< cand1.size();
i++) {
559 if(cand2.begin() != cand2.end() && cand2.begin()->p()>3) {
560 cand candItr = cand2.begin();
566 if(cand1[
i]->
charge() * candItr->charge() < 0) chargeLabel =
"opposite";
567 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]){
568 massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]->Fill((cand1[
i]->
p4()+bestPtCandLVector).mass());
571 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"+
"maxdzmuontrack"]){
577 for (cand candIter= cand2.begin(); candIter!=cand2.end(); candIter++) {
579 if(candIter->p() < 3)
continue;
585 if(cand1[
i]->
charge() * candIter->charge() < 0) chargeLabel =
"opposite";
586 if(
massME_[cand1Label+cand2Label+chargeLabel]){
587 massME_[cand1Label+cand2Label+chargeLabel]->Fill((cand1[
i]->
p4()+candLVector).mass());
589 if(
massME_[cand1Label+cand2Label+chargeLabel+
"maxdzmuontrack"]){
601 if(hltConfig.
init(run , setup, triggerProcessName, changed)){
602 edm::LogVerbatim(
"hltoniasource") <<
"Successfully initialized HLTConfigProvider with process name: "<<triggerProcessName;
604 std::stringstream os;
605 std::vector<std::string> triggerNames = hltConfig.
triggerNames();
607 for(
size_t i = 0;
i < triggerNames.size();
i++) {
609 edm::LogVerbatim(
"hltoniasource") <<
"[HLTOniaSource]: Trigger Path: "<<triggerNames[
i];
610 std::vector<std::string> moduleNames = hltConfig.
moduleLabels( triggerNames[
i] );
611 for(
size_t j = 0;
j < moduleNames.size();
j++) {
612 TString
name = moduleNames[
j];
620 edm::LogVerbatim(
"hltoniasource") <<
"Could not initialize HLTConfigProvider with process name: "<<triggerProcessName;
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag triggerSummaryRAWTag_
std::map< std::string, MonitorElement * > pixelAfterFilterME_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual double p() const GCC11_FINAL
magnitude of momentum vector
std::map< std::string, MonitorElement * > pixelME_
std::vector< edm::InputTag > pixelTagsAfterFilter_
void bookOniaTriggerMEs(std::map< std::string, MonitorElement * > &, std::string)
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< Track > TrackCollection
collection of Tracks
std::vector< edm::InputTag > oniaMuonTag_
std::map< std::string, MonitorElement * > trackME_
std::map< std::string, MonitorElement * > massME_
void fillInvariantMass(std::vector< reco::RecoChargedCandidateRef > &, reco::RecoChargedCandidateCollection &, std::string, std::string)
std::vector< edm::InputTag > trackTagsAfterFilter_
std::map< std::string, MonitorElement * > trackAfterFilterME_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
HLTOniaSource(const edm::ParameterSet &)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
edm::InputTag beamSpotTag_
std::vector< std::string > triggerPath_
reco::BeamSpot::Point BSPosition_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
void bookOniaTriggerInvariantMassMEs(std::map< std::string, MonitorElement * > &, std::string, std::string)
virtual int charge() const GCC11_FINAL
electric charge
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
std::string hltProcessName_
std::string subsystemFolder_
std::map< std::string, MonitorElement * > muonME_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void fillOniaTriggerMEs(edm::Handle< reco::RecoChargedCandidateCollection > &, std::string, std::map< std::string, MonitorElement * > &)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
virtual float pt() const GCC11_FINAL
transverse momentum
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)
bool checkHLTConfiguration(const edm::Run &, const edm::EventSetup &, std::string)