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"));
86 edm::LogVerbatim (
"oniatriggermonitor") <<
"[HLTOniaSource]: Could not access DQM Store.";
157 mypixelCands = * pixelCands;
169 mytrackCands = * trackCands;
179 if (recoBeamSpotHandle.
isValid()) {
189 if( rawTriggerEvent.
isValid() ){
193 std::vector<reco::RecoChargedCandidateRef> myMuonFilterCands;
194 std::vector<reco::RecoChargedCandidateRef> myPixelFilterCands;
195 std::vector<reco::RecoChargedCandidateRef> myTrackFilterCands;
198 size_t indexM = rawTriggerEvent->filterIndex(
oniaMuonTag_[
i]);
200 if ( indexM < rawTriggerEvent->
size() ){
208 if ( indexP < rawTriggerEvent->
size() ){
218 if ( indexT < rawTriggerEvent->
size() ){
226 if( myMuonFilterCands.size() > 0){
246 std::stringstream myMeName;
250 myMeName<<meName<<
"_Pt";
251 myMap[meName+
"pt"]=
dbe_->
book1D(myMeName.str(), myMeName.str(),200, 0.0, 20.0);
256 myMeName<<meName<<
"_P";
257 myMap[meName+
"p"]=
dbe_->
book1D(myMeName.str(), myMeName.str(),250, 0.0, 50.0);
262 myMeName<<meName<<
"_Eta";
263 myMap[meName+
"eta"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 50, -2.5, 2.5 );
268 myMeName<<meName<<
"_Phi";
269 myMap[meName+
"phi"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 144, -3.1416, 3.1416 );
274 myMeName<<meName<<
"_Phi";
275 myMap[meName+
"phi"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 144, -3.1416, 3.1416 );
280 myMeName<<meName<<
"_Charge";
281 myMap[meName+
"charge"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 3, -1.5, 1.5 );
286 myMeName<<meName<<
"_Dz";
287 myMap[meName+
"dz"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 400, -20.0, 20.0 );
292 myMeName<<meName<<
"_Dxy";
293 myMap[meName+
"dxy"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 100, -0.5, 0.5 );
298 myMeName<<meName<<
"_EtaPhi";
299 myMap[meName+
"etaphi"]=
dbe_->
book2D(myMeName.str(), myMeName.str(), 144, -3.1416, 3.1416 ,50, -2.5, 2.5 );
301 myMap[meName+
"etaphi"]->setAxisTitle(
"Eta", 2);
305 myMeName<<meName<<
"_EtaPt";
306 myMap[meName+
"etapt"]=
dbe_->
book2D(myMeName.str(), myMeName.str(), 100, 0.0, 100.0, 50, -2.5, 2.5 );
308 myMap[meName+
"etapt"]->setAxisTitle(
"Eta", 2);
312 myMeName<<meName<<
"_ValidHits";
313 myMap[meName+
"validhits"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 50, 0.0, 50.0 );
314 myMap[meName+
"validhits"]->
setAxisTitle(
"ValidHits", 1);
318 myMeName<<meName<<
"_NormChi2";
319 myMap[meName+
"normchi"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 300, 0.0, 30.0 );
320 myMap[meName+
"normchi"]->
setAxisTitle(
"Normalized Chi2", 1);
324 myMeName<<meName<<
"_NrCandidates";
325 myMap[meName+
"nrcand"]=
dbe_->
book1D(myMeName.str(), myMeName.str(), 50, 0.0, 50.0 );
326 myMap[meName+
"nrcand"]->
setAxisTitle(
"Nr per Event", 1);
333 std::stringstream meName;
336 meName<<label1<<
"_"<<label2<<
"_SameCharge_InvariantMass";
337 massME_[label1+label2+
"same"]=
dbe_->
book1D(meName.str(), meName.str(),120, 0.0, 6.0);
338 massME_[label1+label2+
"same"]->setAxisTitle(
"mass (GeV)", 1);
342 meName<<label1<<
"_"<<label2<<
"_OppositeCharge_InvariantMass";
343 massME_[label1+label2+
"opposite"]=
dbe_->
book1D(meName.str(), meName.str(),120, 0.0, 6.0);
344 massME_[label1+label2+
"opposite"]->setAxisTitle(
"mass (GeV)", 1);
348 meName<<label1<<
"_"<<label2<<
"_SameCharge_HighestPT_InvariantMass";
349 massME_[label1+label2+
"same"+
"highestpt"]=
dbe_->
book1D(meName.str(), meName.str(),120, 0.0, 6.0);
350 massME_[label1+label2+
"same"+
"highestpt"]->setAxisTitle(
"mass (GeV)", 1);
354 meName<<label1<<
"_"<<label2<<
"_OppositeCharge_HighestPT_InvariantMass";
355 massME_[label1+label2+
"opposite"+
"highestpt"]=
dbe_->
book1D(meName.str(), meName.str(),120, 0.0, 6.0);
356 massME_[label1+label2+
"opposite"+
"highestpt"]->setAxisTitle(
"mass (GeV)", 1);
362 meName<<label1<<
"_"<<label2<<
"_SameCharge_HighestPT_MaxDzMuonTrack";
363 massME_[label1+label2+
"same"+
"highestpt"+
"maxdzmuontrack"]=
dbe_->
book1D(meName.str(), meName.str(),50, 0.0, 5.0);
364 massME_[label1+label2+
"same"+
"highestpt"+
"maxdzmuontrack"]->setAxisTitle(
"MaxDz Muon-Track", 1);
367 meName<<label1<<
"_"<<label2<<
"_SameCharge_MaxDzMuonTrack";
368 massME_[label1+label2+
"same"+
"maxdzmuontrack"]=
dbe_->
book1D(meName.str(), meName.str(),50, 0.0, 5.0);
369 massME_[label1+label2+
"same"+
"maxdzmuontrack"]->setAxisTitle(
"MaxDz Muon-Track", 1);
372 meName<<label1<<
"_"<<label2<<
"_OppositeCharge_HighestPT_MaxDzMuonTrack";
373 massME_[label1+label2+
"opposite"+
"highestpt"+
"maxdzmuontrack"]=
dbe_->
book1D(meName.str(), meName.str(),50, 0.0, 5.0);
374 massME_[label1+label2+
"opposite"+
"highestpt"+
"maxdzmuontrack"]->setAxisTitle(
"MaxDz Muon-Track", 1);
377 meName<<label1<<
"_"<<label2<<
"_OppositeCharge_MaxDzMuonTrack";
378 massME_[label1+label2+
"opposite"+
"maxdzmuontrack"]=
dbe_->
book1D(meName.str(), meName.str(),50, 0.0, 5.0);
379 massME_[label1+label2+
"opposite"+
"maxdzmuontrack"]->setAxisTitle(
"MaxDz Muon-Track", 1);
392 typedef reco::TrackCollection::const_iterator cand;
394 for (cand tk=myCollection.begin(); tk!=myCollection.end(); tk++) {
397 if(mapME[collectionLabel+
"pt"]){ mapME[collectionLabel+
"pt"]->Fill(tk->pt()); }
398 if(mapME[collectionLabel+
"p"]) { mapME[collectionLabel+
"p"]->Fill(tk->p()); }
399 if(mapME[collectionLabel+
"eta"]) { mapME[collectionLabel+
"eta"]->Fill(tk->eta()); }
400 if(mapME[collectionLabel+
"phi"]) { mapME[collectionLabel+
"phi"]->Fill(tk->phi()); }
401 if(mapME[collectionLabel+
"etaphi"]){ mapME[collectionLabel+
"etaphi"]->Fill(tk->phi(),tk->eta()); }
402 if(mapME[collectionLabel+
"etapt"]){ mapME[collectionLabel+
"etapt"]->Fill(tk->pt(),tk->eta()); }
403 if(mapME[collectionLabel+
"charge"]){ mapME[collectionLabel+
"charge"]->Fill(tk->charge()); }
411 if(mapME[collectionLabel+
"nrcand"]){ mapME[collectionLabel+
"nrcand"]->Fill(num);}
419 for (
unsigned int i=0;
i!=candidateVector.size();
i++) {
423 if(mapME[collectionLabel+
"pt"]){ mapME[collectionLabel+
"pt"]->Fill(tk.
pt()); }
424 if(mapME[collectionLabel+
"p"]) { mapME[collectionLabel+
"p"]->Fill(tk.
p()); }
425 if(mapME[collectionLabel+
"eta"]) { mapME[collectionLabel+
"eta"]->Fill(tk.
eta()); }
426 if(mapME[collectionLabel+
"phi"]) { mapME[collectionLabel+
"phi"]->Fill(tk.
phi()); }
427 if(mapME[collectionLabel+
"etaphi"]){ mapME[collectionLabel+
"etaphi"]->Fill(tk.
phi(),tk.
eta()); }
428 if(mapME[collectionLabel+
"etapt"]){ mapME[collectionLabel+
"etapt"]->Fill(tk.
pt(),tk.
eta()); }
429 if(mapME[collectionLabel+
"charge"]){ mapME[collectionLabel+
"charge"]->Fill(tk.
charge()); }
438 if(mapME[collectionLabel+
"nrcand"]){ mapME[collectionLabel+
"nrcand"]->Fill( candidateVector.size());}
450 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
451 for (cand
i=myCollection.begin();
i!=myCollection.end();
i++) {
456 if(mapME[collectionLabel+
"pt"]){ mapME[collectionLabel+
"pt"]->Fill(tk.
pt()); }
457 if(mapME[collectionLabel+
"p"]) { mapME[collectionLabel+
"p"]->Fill(tk.
p()); }
458 if(mapME[collectionLabel+
"eta"]) { mapME[collectionLabel+
"eta"]->Fill(tk.
eta()); }
459 if(mapME[collectionLabel+
"phi"]) { mapME[collectionLabel+
"phi"]->Fill(tk.
phi()); }
460 if(mapME[collectionLabel+
"etaphi"]){ mapME[collectionLabel+
"etaphi"]->Fill(tk.
phi(),tk.
eta()); }
461 if(mapME[collectionLabel+
"etapt"]){ mapME[collectionLabel+
"etapt"]->Fill(tk.
pt(),tk.
eta()); }
462 if(mapME[collectionLabel+
"charge"]){ mapME[collectionLabel+
"charge"]->Fill(tk.
charge()); }
470 if(mapME[collectionLabel+
"nrcand"]){ mapME[collectionLabel+
"nrcand"]->Fill(num);}
478 for(
size_t i = 0 ;
i< cand1.size();
i++) {
484 if(cand1[
i]->
charge() * cand2[0]->charge() < 0) chargeLabel =
"opposite";
485 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]){
486 massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]->Fill((cand1[
i]->
p4()+cand2[0]->
p4()).mass());
488 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"+
"maxdzmuontrack"]){
496 for (
size_t j= 0;
j< cand2.size();
j++) {
498 if(cand2[
j]->
p() < 3)
continue;
501 if(cand1[
i]->
charge() * cand2[
j]->charge() < 0) chargeLabel =
"opposite";
502 if(
massME_[cand1Label+cand2Label+chargeLabel]){
503 massME_[cand1Label+cand2Label+chargeLabel]->Fill((cand1[
i]->
p4()+cand2[
j]->
p4()).mass());
505 if(
massME_[cand1Label+cand2Label+chargeLabel+
"maxdzmuontrack"]){
518 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
520 for(
size_t i = 0 ;
i< cand1.size();
i++) {
522 if(cand2.begin() != cand2.end() && cand2.begin()->p()>3) {
523 cand candItr = cand2.begin();
526 if(cand1[
i]->
charge() * candItr->charge() < 0) chargeLabel =
"opposite";
527 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]){
528 massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]->Fill((cand1[
i]->
p4()+candItr->p4()).mass());
531 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"+
"maxdzmuontrack"]){
538 for (cand candItr2= cand2.begin(); candItr2!=cand2.end(); candItr2++) {
539 if(candItr2->p() < 3)
continue;
542 if(cand1[
i]->
charge() * candItr2->charge() < 0) chargeLabel =
"opposite";
543 if(
massME_[cand1Label+cand2Label+chargeLabel]){
544 massME_[cand1Label+cand2Label+chargeLabel]->Fill((cand1[
i]->
p4()+candItr2->p4()).mass());
546 if(
massME_[cand1Label+cand2Label+chargeLabel+
"maxdzmuontrack"]){
559 typedef reco::TrackCollection::const_iterator cand;
562 for(
size_t i = 0 ;
i< cand1.size();
i++) {
564 if(cand2.begin() != cand2.end() && cand2.begin()->p()>3) {
565 cand candItr = cand2.begin();
571 if(cand1[
i]->
charge() * candItr->charge() < 0) chargeLabel =
"opposite";
572 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]){
573 massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"]->Fill((cand1[
i]->
p4()+bestPtCandLVector).mass());
576 if(
massME_[cand1Label+cand2Label+chargeLabel+
"highestpt"+
"maxdzmuontrack"]){
582 for (cand candIter= cand2.begin(); candIter!=cand2.end(); candIter++) {
584 if(candIter->p() < 3)
continue;
590 if(cand1[
i]->
charge() * candIter->charge() < 0) chargeLabel =
"opposite";
591 if(
massME_[cand1Label+cand2Label+chargeLabel]){
592 massME_[cand1Label+cand2Label+chargeLabel]->Fill((cand1[
i]->
p4()+candLVector).mass());
594 if(
massME_[cand1Label+cand2Label+chargeLabel+
"maxdzmuontrack"]){
606 if(hltConfig.
init(run , setup, triggerProcessName, changed)){
607 edm::LogVerbatim(
"hltoniasource") <<
"Successfully initialized HLTConfigProvider with process name: "<<triggerProcessName;
609 std::stringstream os;
610 std::vector<std::string> triggerNames = hltConfig.
triggerNames();
612 for(
size_t i = 0;
i < triggerNames.size();
i++) {
614 edm::LogVerbatim(
"hltoniasource") <<
"[HLTOniaSource]: Trigger Path: "<<triggerNames[
i];
615 std::vector<std::string> moduleNames = hltConfig.
moduleLabels( triggerNames[
i] );
616 for(
size_t j = 0;
j < moduleNames.size();
j++) {
617 TString
name = moduleNames[
j];
625 edm::LogVerbatim(
"hltoniasource") <<
"Could not initialize HLTConfigProvider with process name: "<<triggerProcessName;
virtual void endJob() override
T getUntrackedParameter(std::string const &, T const &) const
virtual double p() const
magnitude of momentum vector
edm::InputTag triggerSummaryRAWTag_
std::map< std::string, MonitorElement * > pixelAfterFilterME_
virtual float pt() const
transverse momentum
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::map< std::string, MonitorElement * > pixelME_
virtual float phi() const
momentum azimuthal angle
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.
edm::InputTag beamSpotTag_
std::vector< std::string > triggerPath_
virtual float eta() const
momentum pseudorapidity
virtual int charge() const
electric charge
reco::BeamSpot::Point BSPosition_
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
edm::EDGetTokenT< reco::TrackCollection > pixelToken_
void bookOniaTriggerInvariantMassMEs(std::map< std::string, MonitorElement * > &, std::string, std::string)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
std::string hltProcessName_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trackToken_
virtual void beginJob() override
std::string subsystemFolder_
std::map< std::string, MonitorElement * > muonME_
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
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.
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.
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryRAWToken_
void setCurrentFolder(const std::string &fullpath)
bool checkHLTConfiguration(const edm::Run &, const edm::EventSetup &, std::string)