Skip to content

Commit

Permalink
Merge pull request cms-sw#2896 from deguio/consumesMigration2
Browse files Browse the repository at this point in the history
Consumes migration -- DQM
  • Loading branch information
ktf committed Mar 18, 2014
2 parents 67d5eda + 0331913 commit a29b121
Show file tree
Hide file tree
Showing 24 changed files with 41 additions and 149 deletions.
5 changes: 1 addition & 4 deletions DQM/SiPixelMonitorTrack/src/SiPixelHitEfficiencySource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ void SiPixelHitEfficiencySource::endJob(void) {
void SiPixelHitEfficiencySource::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {

edm::Handle<reco::VertexCollection> vertexCollectionHandle;
//iEvent.getByLabel("offlinePrimaryVertices", vertexCollectionHandle);
iEvent.getByToken( vertexCollectionToken_, vertexCollectionHandle );
if(!vertexCollectionHandle.isValid()) return;
nvtx_=0;
Expand Down Expand Up @@ -239,7 +238,6 @@ void SiPixelHitEfficiencySource::analyze(const edm::Event& iEvent, const edm::Ev

//get the map
edm::Handle<TrajTrackAssociationCollection> match;
//iEvent.getByLabel(tracksrc_,match);
iEvent.getByToken( tracksrc_, match );
const TrajTrackAssociationCollection ttac = *(match.product());

Expand Down Expand Up @@ -687,8 +685,7 @@ float y=predTrajState.globalPosition().y();
if(tracker.isValid()){
const TrackerGeometry *tkgeom=&(*tracker);
edm::Handle<edmNew::DetSetVector<SiPixelCluster> > clusterCollectionHandle;
//iEvent.getByLabel("siPixelClusters", clusterCollectionHandle);
iEvent.getByToken( clusterCollectionToken_, clusterCollectionHandle );
iEvent.getByToken( clusterCollectionToken_, clusterCollectionHandle );
if(clusterCollectionHandle.isValid()){
const edmNew::DetSetVector<SiPixelCluster>& clusterCollection=*clusterCollectionHandle;
edmNew::DetSetVector<SiPixelCluster>::const_iterator itClusterSet=clusterCollection.begin();
Expand Down
4 changes: 0 additions & 4 deletions DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,10 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe

// get collection of DetSetVector of clusters from Event
edm::Handle< edmNew::DetSetVector<SiStripCluster> > cluster_detsetvektor;
// iEvent.getByLabel(clusterProducerStrip_, cluster_detsetvektor);
iEvent.getByToken(clusterProducerStripToken_, cluster_detsetvektor);

//get pixel clusters
edm::Handle< edmNew::DetSetVector<SiPixelCluster> > cluster_detsetvektor_pix;
// iEvent.getByLabel(clusterProducerPix_, cluster_detsetvektor_pix);
iEvent.getByToken(clusterProducerPixToken_, cluster_detsetvektor_pix);

if (!cluster_detsetvektor.isValid()) return;
Expand Down Expand Up @@ -661,12 +659,10 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe

// EventHistory
edm::Handle<EventWithHistory> event_history;
// iEvent.getByLabel(historyProducer_,event_history);
iEvent.getByToken(historyProducerToken_,event_history);

// Phase of APV
edm::Handle<APVCyclePhaseCollection> apv_phase_collection;
// iEvent.getByLabel(apvPhaseProducer_,apv_phase_collection);
iEvent.getByToken(apvPhaseProducerToken_,apv_phase_collection);

if (event_history.isValid()
Expand Down
8 changes: 1 addition & 7 deletions DQM/SiStripMonitorCluster/src/SiStripMonitorHLT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,7 @@ void SiStripMonitorHLT::analyze(const edm::Event& iEvent, const edm::EventSetup&

// get from event
std::string HLTProducer = conf_.getParameter<std::string>("HLTProducer");
/*
edm::Handle<int> filter_decision; iEvent.getByLabel(HLTProducer, "", filter_decision); // filter decision
edm::Handle<uint> sum_of_clustch; iEvent.getByLabel(HLTProducer, "", sum_of_clustch); // sum of cluster charges
// first element of pair: layer: TIB1, ...., TEC; second element: nr of clusters above threshold
edm::Handle<std::map<uint,std::vector<SiStripCluster> > > clusters_in_subcomponents;
if(HLTProducer=="ClusterMTCCFilter") iEvent.getByLabel(HLTProducer, "", clusters_in_subcomponents);
*/

edm::Handle<int> filter_decision; iEvent.getByToken(filerDecisionToken_,filter_decision); // filter decision
edm::Handle<uint> sum_of_clustch; iEvent.getByToken(sumOfClusterToken_, sum_of_clustch); // sum of cluster charges
// first element of pair: layer: TIB1, ...., TEC; second element: nr of clusters above threshold
Expand Down
14 changes: 0 additions & 14 deletions DQM/SiStripMonitorDigi/src/SiStripBaselineValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,10 @@ void SiStripBaselineValidator::beginJob()

void SiStripBaselineValidator::analyze(const edm::Event& e, const edm::EventSetup& es)
{
/* edm::Handle<reco::TrackCollection> tracks;
e.getByLabel("hiSelectedTracks", tracks);
int ntracks =0;
for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); track++) {
ntracks++;
}
*/


edm::Handle< edm::DetSetVector<SiStripRawDigi> > moduleRawDigi;
// e.getByLabel(srcProcessedRawDigi_,moduleRawDigi);
e.getByToken( moduleRawDigiToken_, moduleRawDigi );
edm::DetSetVector<SiStripRawDigi>::const_iterator itRawDigis = moduleRawDigi->begin();

// uint32_t Nmodule = moduleRawDigi->size();

int NumResAPVs=0;
for (; itRawDigis != moduleRawDigi->end(); ++itRawDigis) { ///loop over modules

Expand Down
11 changes: 0 additions & 11 deletions DQM/SiStripMonitorDigi/src/SiStripMonitorDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,14 +571,6 @@ void SiStripMonitorDigi::analyze(const edm::Event& iEvent, const edm::EventSetup
float iOrbitSec = iEvent.orbitNumber()/NORBITS_PER_SECOND;

digi_detset_handles.clear();
/*
for(std::vector<edm::InputTag>::iterator itDigiProducerList = digiProducerList.begin();
itDigiProducerList != digiProducerList.end(); ++itDigiProducerList ) {
edm::Handle< edm::DetSetVector<SiStripDigi> > digi_handle;
iEvent.getByLabel((*itDigiProducerList),digi_handle);
*/
std::vector<edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > >::const_iterator iToken = digiProducerTokenList.begin();
for(std::vector<edm::InputTag>::const_iterator iter = digiProducerList.begin(), iEnd = digiProducerList.end();
iter != iEnd; ++iter, ++iToken) {
Expand Down Expand Up @@ -746,7 +738,6 @@ void SiStripMonitorDigi::analyze(const edm::Event& iEvent, const edm::EventSetup

//check Stable beams bit
edm::Handle<L1GlobalTriggerEvmReadoutRecord> gtEvm_handle;
// iEvent.getByLabel("gtEvmDigis", gtEvm_handle);
iEvent.getByToken( gtEvmToken_, gtEvm_handle );
L1GlobalTriggerEvmReadoutRecord const* gtevm = gtEvm_handle.product();

Expand Down Expand Up @@ -832,12 +823,10 @@ void SiStripMonitorDigi::analyze(const edm::Event& iEvent, const edm::EventSetup
// get EventHistory

edm::Handle<EventWithHistory> event_history;
// iEvent.getByLabel(historyProducer_,event_history);
iEvent.getByToken(historyProducerToken_,event_history);

// get Phase of APV
edm::Handle<APVCyclePhaseCollection> apv_phase_collection;
// iEvent.getByLabel(apvPhaseProducer_,apv_phase_collection);
iEvent.getByToken(apvPhaseProducerToken_,apv_phase_collection);

if (event_history.isValid()
Expand Down
2 changes: 0 additions & 2 deletions DQM/SiStripMonitorHardware/src/SiStripFEDEmulatorModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,9 @@ namespace sistrip {
edm::Handle<edm::DetSetVector<SiStripRawDigi> > lDigisHandle;
try { //to get the digis from the event
if (!byModule_) {
// iEvent.getByLabel(spyReorderedDigisTag_, lDigisHandle);
iEvent.getByToken(spyReorderedDigisToken_, lDigisHandle);
}
else { //digis supplied by module
// iEvent.getByLabel(spyVirginRawDigisTag_, lDigisHandle);
iEvent.getByToken(spyVirginRawDigisToken_, lDigisHandle);
}//end of by module check
} catch (const cms::Exception& e) {
Expand Down
2 changes: 0 additions & 2 deletions DQM/SiStripMonitorHardware/src/SiStripFEDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ SiStripFEDMonitorPlugin::analyze(const edm::Event& iEvent,

//get raw data
edm::Handle<FEDRawDataCollection> rawDataCollectionHandle;
// iEvent.getByLabel(rawDataTag_,rawDataCollectionHandle);
iEvent.getByToken(rawDataToken_,rawDataCollectionHandle);
const FEDRawDataCollection& rawDataCollection = *rawDataCollectionHandle;

Expand All @@ -218,7 +217,6 @@ SiStripFEDMonitorPlugin::analyze(const edm::Event& iEvent,
//add the deltaBX value if the product exist

edm::Handle<EventWithHistory> he;
// iEvent.getByLabel("consecutiveHEs",he);
iEvent.getByToken(heToken_,he);

if(he.isValid() && !he.failedToGet()) {
Expand Down
3 changes: 0 additions & 3 deletions DQM/SiStripMonitorTrack/src/SiStripMonitorMuonHLT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,21 +138,18 @@ SiStripMonitorMuonHLT::analyze (const edm::Event & iEvent, const edm::EventSetup
//Access to L3MuonCand
edm::Handle < reco::RecoChargedCandidateCollection > l3mucands;
bool accessToL3Muons = true;
// iEvent.getByLabel (l3collectionTag_, l3mucands);
iEvent.getByToken (l3collectionToken_, l3mucands);
reco::RecoChargedCandidateCollection::const_iterator cand;

//Access to clusters
edm::Handle < edm::LazyGetter < SiStripCluster > >clusters;
bool accessToClusters = true;
// iEvent.getByLabel (clusterCollectionTag_, clusters);
iEvent.getByToken (clusterCollectionToken_, clusters);
edm::LazyGetter < SiStripCluster >::record_iterator clust;

//Access to Tracks
edm::Handle<reco::TrackCollection > trackCollection;
bool accessToTracks = true;
// iEvent.getByLabel (TrackCollectionTag_, trackCollection);
iEvent.getByToken (TrackCollectionToken_, trackCollection);
reco::TrackCollection::const_iterator track;
/////////////////////////////////////////////////////
Expand Down
3 changes: 0 additions & 3 deletions DQM/SiStripMonitorTrack/src/SiStripMonitorTrack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ void SiStripMonitorTrack::trackStudy(const edm::Event& ev, const edm::EventSetup

// trajectory input
edm::Handle<TrajTrackAssociationCollection> TItkAssociatorCollection;
// ev.getByLabel(TrackProducer_, TrackLabel_, TItkAssociatorCollection);
ev.getByToken(trackTrajToken_, TItkAssociatorCollection);
if( TItkAssociatorCollection.isValid()){
trackStudyFromTrajectory(TItkAssociatorCollection,es);
Expand All @@ -517,7 +516,6 @@ void SiStripMonitorTrack::trackStudy(const edm::Event& ev, const edm::EventSetup

// track input
edm::Handle<reco::TrackCollection > trackCollectionHandle;
// ev.getByLabel(TrackProducer_, TrackLabel_, trackCollectionHandle);//takes the track collection
ev.getByToken(trackToken_, trackCollectionHandle);//takes the track collection
if (!trackCollectionHandle.isValid()){
edm::LogError("SiStripMonitorTrack")<<"also Track Collection is not valid !! " << TrackLabel_<<std::endl;
Expand Down Expand Up @@ -616,7 +614,6 @@ void SiStripMonitorTrack::AllClusters(const edm::Event& ev, const edm::EventSetu
const TrackerTopology* const tTopo = tTopoHandle.product();

edm::Handle< edmNew::DetSetVector<SiStripCluster> > siStripClusterHandle;
// ev.getByLabel( Cluster_src_, siStripClusterHandle);
ev.getByToken( clusterToken_, siStripClusterHandle);
if (!siStripClusterHandle.isValid()){
edm::LogError("SiStripMonitorTrack")<< "ClusterCollection is not valid!!" << std::endl;
Expand Down
2 changes: 0 additions & 2 deletions DQM/TrackingMonitor/src/GetLumi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ GetLumi::getRawValue(const edm::Event& iEvent)
// DPGAnalysis/SiStripTools/src/DigiLumiCorrHistogramMaker.cc
// the scale factor 6.37 should follow the lumi prescriptions
edm::Handle<LumiDetails> lumi;
// iEvent.getLuminosityBlock().getByLabel(lumiInputTag_,lumi);
iEvent.getLuminosityBlock().getByToken(lumiSummaryToken_,lumi);


Expand Down Expand Up @@ -80,7 +79,6 @@ GetLumi::getRawValue(edm::LuminosityBlock const& lumiBlock,
// accumulate HF data at every LS as it is closed.
// note: lumi unit from DIPLumiSummary and Detail is microbarns
edm::Handle<LumiSummary> lumiSummary_;
// lumiBlock.getByLabel(lumiInputTag_, lumiSummary_);
lumiBlock.getByToken(lumiSummaryToken_, lumiSummary_);
if(lumiSummary_->isValid()){
lumi = lumiSummary_->avgInsDelLumi();
Expand Down
2 changes: 0 additions & 2 deletions DQM/TrackingMonitor/src/TrackEfficiencyMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,8 @@ void TrackEfficiencyMonitor::analyze(const edm::Event& iEvent, const edm::EventS


edm::Handle<reco::TrackCollection> tkTracks;
// iEvent.getByLabel(theTKTracksLabel_, tkTracks);
iEvent.getByToken(theTKTracksToken_, tkTracks);
edm::Handle<reco::TrackCollection> staTracks;
// iEvent.getByLabel(theSTATracksLabel_, staTracks);
iEvent.getByToken(theSTATracksToken_, staTracks);
edm::ESHandle<NavigationSchool> nav;
iSetup.get<NavigationSchoolRecord>().get("CosmicNavigationSchool", nav);
Expand Down
2 changes: 0 additions & 2 deletions DQM/TrackingMonitor/src/TrackSplittingMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,11 @@ void TrackSplittingMonitor::analyze(const edm::Event& iEvent, const edm::EventSe
iSetup.get<MuonGeometryRecord>().get(rpcGeometry);

edm::Handle<std::vector<reco::Track> > splitTracks;
// iEvent.getByLabel(splitTracks_, splitTracks);
iEvent.getByToken(splitTracksToken_, splitTracks);
if (!splitTracks.isValid()) return;

edm::Handle<std::vector<reco::Muon> > splitMuons;
if (plotMuons_){
// iEvent.getByLabel(splitMuons_, splitMuons);
iEvent.getByToken(splitMuonsToken_, splitMuons);
}

Expand Down
2 changes: 0 additions & 2 deletions DQM/TrackingMonitor/src/VertexMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ VertexMonitor::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
size_t totalNumPV = 0;
size_t totalNumBADndofPV = 0;
edm::Handle< reco::VertexCollection > pvHandle;
// iEvent.getByLabel(primaryVertexInputTag_, pvHandle );
iEvent.getByToken(pvToken_, pvHandle );
if ( pvHandle.isValid() )
{
Expand All @@ -114,7 +113,6 @@ VertexMonitor::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)

size_t totalNumGoodPV = 0;
edm::Handle< reco::VertexCollection > selpvHandle;
// iEvent.getByLabel(selectedPrimaryVertexInputTag_, selpvHandle );
iEvent.getByToken(selpvToken_, selpvHandle );
if ( selpvHandle.isValid() )
totalNumGoodPV = selpvHandle->size();
Expand Down
2 changes: 0 additions & 2 deletions DQM/TrackingMonitor/src/dEdxAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,11 @@ void dEdxAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet

if ( doDeDxPlots_ || doAllPlots_ ){
edm::Handle<reco::TrackCollection> trackCollectionHandle;
// iEvent.getByLabel(TrackName,trackCollectionHandle);
iEvent.getByToken(trackToken_, trackCollectionHandle );
if(!trackCollectionHandle.isValid())return;

for(unsigned int i=0;i<dEdxInputList_.size();i++){
edm::Handle<reco::DeDxDataValueMap> dEdxObjectHandle;
// iEvent.getByLabel(AlgoNames[i],dEdxObjectHandle);
iEvent.getByToken(dEdxTokenList_[i], dEdxObjectHandle );
if(!dEdxObjectHandle.isValid())continue;
const edm::ValueMap<reco::DeDxData> dEdxColl = *dEdxObjectHandle.product();
Expand Down
2 changes: 1 addition & 1 deletion DQM/TrigXMonitor/interface/HLTScalers.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class HLTScalers: public edm::EDAnalyzer
std::string folderName_; // dqm folder name
std::string processname_;
std::vector <std::pair<std::string, std::vector<std::string> > > pairPDPaths_;
edm::InputTag trigResultsSource_;
edm::EDGetTokenT<edm::TriggerResults> trigResultsSource_;

DQMStore * dbe_;
MonitorElement *scalersPD_;
Expand Down
9 changes: 6 additions & 3 deletions DQM/TrigXMonitor/src/HLTScalers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ HLTScalers::HLTScalers(const edm::ParameterSet &ps):
folderName_(ps.getUntrackedParameter<std::string>("dqmFolder", "HLT/HLTScalers_EvF")),
processname_(ps.getParameter<std::string>("processname")),
pairPDPaths_(),
trigResultsSource_(ps.getParameter<edm::InputTag>("triggerResults")),
trigResultsSource_(consumes<TriggerResults>(ps.getParameter<edm::InputTag>("triggerResults"))),
dbe_(0),
scalersN_(0),
scalersException_(0),
Expand Down Expand Up @@ -145,10 +145,13 @@ void HLTScalers::analyze(const edm::Event &e, const edm::EventSetup &c)
// it just tells you how the merging is doing.

edm::Handle<TriggerResults> hltResults;
bool b = e.getByLabel(trigResultsSource_, hltResults);
bool b = e.getByToken(trigResultsSource_, hltResults);
if ( !b ) {
Labels l;
labelsForToken(trigResultsSource_, l);

edm::LogInfo("HLTScalers") << "getByLabel for TriggerResults failed"
<< " with label " << trigResultsSource_;
<< " with label " << l.module;
return;
}

Expand Down
53 changes: 1 addition & 52 deletions DQM/TrigXMonitor/src/L1Scalers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -422,59 +422,8 @@ void L1Scalers::analyze(const edm::Event &e, const edm::EventSetup &iSetup)

}//tt41Good

} // getbylabel succeeded
}


// // HACK
// // getting very basic uncalRH
// edm::Handle<FEDRawDataCollection> theRaw;
// bool getFed = e.getByLabel(fedRawCollection_, theRaw);
// if ( ! getFed ) {
// edm::LogInfo("FEDSizeFilter") << fedRawCollection_ << " not available";
// }
// else { // got the fed raw data
// unsigned int totalFEDsize = 0 ;
// for (unsigned int i=fedStart_; i<=fedStop_; ++i) {
// LogDebug("Parameter") << "Examining fed " << i << " with size "
// << theRaw->FEDData(i).size() ;
// totalFEDsize += theRaw->FEDData(i).size() ;
// }
// pixFedSize_->Fill(totalFEDsize);
// if( (myGTFEbx!=-1) ) pixFedSizeBx_->Fill(myGTFEbx,totalFEDsize);

// LogDebug("Parameter") << "Total FED size: " << totalFEDsize;
// }

// // HF - stolen from HLTrigger/special
// // getting very basic uncalRH
// double maxHFenergy = -1;
// edm::Handle<HFRecHitCollection> crudeHits;
// bool getHF = e.getByLabel(HcalRecHitCollection_, crudeHits);
// if ( ! getHF ) {
// LogDebug("Status") << HcalRecHitCollection_ << " not available";
// }
// else {

// LogDebug("Status") << "Filtering, with " << crudeHits->size()
// << " recHits to consider" ;
// for ( HFRecHitCollection::const_iterator hitItr = crudeHits->begin();
// hitItr != crudeHits->end(); ++hitItr ) {
// HFRecHit hit = (*hitItr);

// // masking noisy channels
// std::vector<int>::iterator result;
// result = std::find( maskedList_.begin(), maskedList_.end(),
// HcalDetId(hit.id()).hashed_index() );
// if (result != maskedList_.end())
// continue;
// hfEnergy_->Fill(hit.energy());
// if( (hit.energy()>maxHFenergy) ) maxHFenergy = hit.energy();
// }
// }

// if( (maxHFenergy!=-1 && myGTFEbx!=-1) ) hfEnergyMaxTowerBx_->Fill(myGTFEbx,maxHFenergy);
// // END HACK

return;

}
Expand Down
11 changes: 8 additions & 3 deletions DQMOffline/JetMET/interface/HCALRecHitAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
#include "DataFormats/HcalRecHit/interface/HFRecHit.h"
#include "DataFormats/HcalRecHit/interface/HORecHit.h"
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"

#include <string>
#include <map>
#include "DQMServices/Core/interface/MonitorElement.h"
Expand All @@ -34,9 +39,9 @@ class HCALRecHitAnalyzer: public edm::EDAnalyzer {
DQMStore* dbe_;

// Inputs from Configuration
edm::InputTag hBHERecHitsLabel_;
edm::InputTag hFRecHitsLabel_;
edm::InputTag hORecHitsLabel_;
edm::EDGetTokenT<HBHERecHitCollection> hBHERecHitsLabel_;
edm::EDGetTokenT<HFRecHitCollection> hFRecHitsLabel_;
edm::EDGetTokenT<HORecHitCollection> hORecHitsLabel_;
bool debug_;
bool finebinning_;
std::string FolderName_;
Expand Down
Loading

0 comments on commit a29b121

Please sign in to comment.