Skip to content

Commit

Permalink
Merge pull request #3486 from slava77/DThltFix-71X-from-pt
Browse files Browse the repository at this point in the history
Reco -- DT consumes for RECO and validation (not including performance changes)
  • Loading branch information
ktf committed Apr 29, 2014
2 parents 6370f4d + 8a389a2 commit 5a3ea09
Show file tree
Hide file tree
Showing 25 changed files with 104 additions and 69 deletions.
1 change: 0 additions & 1 deletion EventFilter/DTRawToDigi/plugins/DTUnpackingModule.h
Expand Up @@ -9,7 +9,6 @@

#include <FWCore/Framework/interface/EDProducer.h>
#include "FWCore/Utilities/interface/InputTag.h"

#include <DataFormats/FEDRawData/interface/FEDRawDataCollection.h>

#include <iostream>
Expand Down
7 changes: 3 additions & 4 deletions EventFilter/DTTFRawToDigi/interface/DTTFFEDReader.h
Expand Up @@ -17,6 +17,7 @@
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTTrackContainer.h"
#include <DataFormats/FEDRawData/interface/FEDRawDataCollection.h>

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include <FWCore/ParameterSet/interface/ParameterSet.h>
Expand Down Expand Up @@ -45,7 +46,7 @@ class DTTFFEDReader : public edm::stream::EDProducer<> {

private:

edm::InputTag DTTFInputTag;
edm::EDGetTokenT<FEDRawDataCollection> DTTFToken_;

bool verbose_;

Expand Down Expand Up @@ -91,8 +92,6 @@ class DTTFFEDReader : public edm::stream::EDProducer<> {
int wheel(int channel);

void calcCRC(int myD1, int myD2, int &myC);

edm::InputTag getDTTFInputTag() { return DTTFInputTag; }


};
#endif
14 changes: 9 additions & 5 deletions EventFilter/DTTFRawToDigi/interface/DTTFFEDSim.h
Expand Up @@ -18,6 +18,10 @@
#include <FWCore/Framework/interface/EDProducer.h>
#include <FWCore/ParameterSet/interface/ParameterSet.h>
#include <FWCore/Utilities/interface/InputTag.h>
#include <DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h>
#include <DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h>
#include <DataFormats/L1DTTrackFinder/interface/L1MuDTTrackContainer.h>


#include <string>

Expand All @@ -42,8 +46,11 @@ class DTTFFEDSim : public edm::EDProducer {

unsigned int eventNum;

edm::InputTag DTDigiInputTag;
edm::InputTag DTPHTFInputTag;
edm::EDGetTokenT<FEDRawDataCollection> DTTFToken_;

edm::EDGetTokenT<L1MuDTChambPhContainer> DTDigiPhToken_;
edm::EDGetTokenT<L1MuDTChambThContainer> DTDigiThToken_;
edm::EDGetTokenT<L1MuDTTrackContainer> DTPHTFToken_;

// utilities
int channel(int wheel, int sector, int bx);
Expand All @@ -56,8 +63,5 @@ class DTTFFEDSim : public edm::EDProducer {

void calcCRC(int myD1, int myD2, int &myC);

edm::InputTag getDTDigiInputTag() { return DTDigiInputTag; }
edm::InputTag getDTPHTFInputTag() { return DTPHTFInputTag; }

};
#endif
5 changes: 2 additions & 3 deletions EventFilter/DTTFRawToDigi/src/DTTFFEDReader.cc
Expand Up @@ -31,10 +31,9 @@ DTTFFEDReader::DTTFFEDReader(const edm::ParameterSet& pset) {
produces<L1MuDTChambThContainer>();
produces<L1MuDTTrackContainer>("DATA");

DTTFInputTag = pset.getParameter<edm::InputTag>("DTTF_FED_Source");
DTTFToken_ = consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("DTTF_FED_Source"));

verbose_ = pset.getUntrackedParameter<bool>("verbose",false);
consumes<FEDRawDataCollection>(getDTTFInputTag());
}

DTTFFEDReader::~DTTFFEDReader(){}
Expand Down Expand Up @@ -109,7 +108,7 @@ void DTTFFEDReader::process(edm::Event& e) {
//--> Header

edm::Handle<FEDRawDataCollection> data;
e.getByLabel(getDTTFInputTag(),data);
e.getByToken(DTTFToken_,data);
FEDRawData dttfdata = data->FEDData(0x030C);
if ( dttfdata.size() == 0 ) return;

Expand Down
11 changes: 6 additions & 5 deletions EventFilter/DTTFRawToDigi/src/DTTFFEDSim.cc
Expand Up @@ -29,8 +29,9 @@ DTTFFEDSim::DTTFFEDSim(const edm::ParameterSet& pset) : eventNum(0) {

produces<FEDRawDataCollection>();

DTDigiInputTag = pset.getParameter<edm::InputTag>("DTDigi_Source");
DTPHTFInputTag = pset.getParameter<edm::InputTag>("DTTracks_Source");
DTDigiPhToken_ = consumes<L1MuDTChambPhContainer>(pset.getParameter<edm::InputTag>("DTDigi_Source"));
DTDigiThToken_ = consumes<L1MuDTChambThContainer>(pset.getParameter<edm::InputTag>("DTDigi_Source"));
DTPHTFToken_ = consumes<L1MuDTTrackContainer>(pset.getParameter<edm::InputTag>("DTTracks_Source"));

}

Expand All @@ -56,15 +57,15 @@ bool DTTFFEDSim::fillRawData(edm::Event& e,
int lines = 2;

edm::Handle<L1MuDTChambPhContainer> phtrig;
e.getByLabel(getDTDigiInputTag(),phtrig);
e.getByToken(DTDigiPhToken_,phtrig);
lines += phtrig->bxSize(-1, 1);

edm::Handle<L1MuDTChambThContainer> thtrig;
e.getByLabel(getDTDigiInputTag(),thtrig);
e.getByToken(DTDigiThToken_,thtrig);
lines += thtrig->bxSize(-1, 1);

edm::Handle<L1MuDTTrackContainer> trtrig;
e.getByLabel(getDTPHTFInputTag(),trtrig);
e.getByToken(DTPHTFToken_,trtrig);
lines += trtrig->bxSize(-1, 1)*3;

FEDRawData& dttfdata = data.FEDData(0x30C);
Expand Down
7 changes: 4 additions & 3 deletions RecoLocalMuon/DTRecHit/plugins/DTRecHitProducer.cc
Expand Up @@ -32,14 +32,15 @@ using namespace std;

DTRecHitProducer::DTRecHitProducer(const ParameterSet& config) :
// Set verbose output
debug(config.getUntrackedParameter<bool>("debug", false)),
theDTDigiLabel(config.getParameter<InputTag>("dtDigiLabel"))
debug(config.getUntrackedParameter<bool>("debug", false))
{
if(debug)
cout << "[DTRecHitProducer] Constructor called" << endl;

produces<DTRecHitCollection>();

DTDigiToken_ = consumes<DTDigiCollection>(config.getParameter<InputTag>("dtDigiLabel"));

// Get the concrete reconstruction algo from the factory
string theAlgoName = config.getParameter<string>("recAlgo");
theAlgo = DTRecHitAlgoFactory::get()->create(theAlgoName,
Expand All @@ -61,7 +62,7 @@ void DTRecHitProducer::produce(Event& event, const EventSetup& setup) {

// Get the digis from the event
Handle<DTDigiCollection> digis;
event.getByLabel(theDTDigiLabel, digis);
event.getByToken(DTDigiToken_, digis);

// Pass the EventSetup to the algo
theAlgo->setES(setup);
Expand Down
3 changes: 2 additions & 1 deletion RecoLocalMuon/DTRecHit/plugins/DTRecHitProducer.h
Expand Up @@ -11,6 +11,7 @@

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/DTDigi/interface/DTDigiCollection.h"

namespace edm {
class ParameterSet;
Expand All @@ -35,7 +36,7 @@ class DTRecHitProducer : public edm::stream::EDProducer<> {
// Switch on verbosity
const bool debug;
// The label to be used to retrieve DT digis from the event
edm::InputTag theDTDigiLabel;
edm::EDGetTokenT<DTDigiCollection> DTDigiToken_;
// The reconstruction algorithm
DTRecHitBaseAlgo *theAlgo;
// static string theAlgoName;
Expand Down
6 changes: 3 additions & 3 deletions RecoLocalMuon/DTSegment/src/DTClusterer.cc
Expand Up @@ -17,6 +17,7 @@
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
using namespace edm;

#include "Geometry/DTGeometry/interface/DTLayer.h"
Expand All @@ -25,7 +26,6 @@ using namespace edm;
#include "Geometry/Records/interface/MuonGeometryRecord.h"

#include "DataFormats/DTRecHit/interface/DTRecHit1DPair.h"
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
#include "DataFormats/DTRecHit/interface/DTRecClusterCollection.h"
#include "DataFormats/DTRecHit/interface/DTRangeMapAccessor.h"

Expand All @@ -41,7 +41,7 @@ DTClusterer::DTClusterer(const edm::ParameterSet& pset) {
debug = pset.getUntrackedParameter<bool>("debug");

// the name of the 1D rec hits collection
theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel");
recHits1DToken_ = consumes<DTRecHitCollection>(pset.getParameter<InputTag>("recHits1DLabel"));
// min number of hits to build a cluster
theMinHits = pset.getParameter<unsigned int>("minHits");
// min number of hits to build a cluster
Expand All @@ -67,7 +67,7 @@ void DTClusterer::produce(edm::Event& event, const edm::EventSetup& setup) {

// Get the 1D rechits from the event
Handle<DTRecHitCollection> allHits;
event.getByLabel(theRecHits1DLabel, allHits);
event.getByToken(recHits1DToken_, allHits);

// Create the pointer to the collection which will store the rechits
auto_ptr<DTRecClusterCollection> clusters(new DTRecClusterCollection());
Expand Down
3 changes: 2 additions & 1 deletion RecoLocalMuon/DTSegment/src/DTClusterer.h
Expand Up @@ -26,6 +26,7 @@ namespace edm {
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/DTRecHit/interface/DTSLRecCluster.h"
#include "DataFormats/DTRecHit/interface/DTRecHit1DPair.h"
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
class DTSuperLayer;

/* C++ Headers */
Expand Down Expand Up @@ -74,7 +75,7 @@ class DTClusterer : public edm::EDProducer {

unsigned int theMinHits; // min number of hits to build a cluster
unsigned int theMinLayers; // min number of layers to build a cluster
edm::InputTag theRecHits1DLabel;
edm::EDGetTokenT<DTRecHitCollection> recHits1DToken_;
protected:

};
Expand Down
11 changes: 5 additions & 6 deletions RecoLocalMuon/DTSegment/src/DTRecSegment2DExtendedProducer.cc
Expand Up @@ -10,6 +10,7 @@
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
using namespace edm;

#include "Geometry/DTGeometry/interface/DTLayer.h"
Expand All @@ -18,8 +19,6 @@ using namespace edm;

#include "DataFormats/DTRecHit/interface/DTRecHit1DPair.h"
#include "DataFormats/DTRecHit/interface/DTRecHit1D.h"
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
#include "DataFormats/DTRecHit/interface/DTRecClusterCollection.h"
#include "DataFormats/DTRecHit/interface/DTSLRecSegment2D.h"
#include "DataFormats/DTRecHit/interface/DTRecSegment2DCollection.h"
#include "DataFormats/DTRecHit/interface/DTRangeMapAccessor.h"
Expand All @@ -38,8 +37,8 @@ DTRecSegment2DExtendedProducer::DTRecSegment2DExtendedProducer(const edm::Parame
debug = pset.getUntrackedParameter<bool>("debug");

// the name of the 1D rec hits collection
theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel");
theRecClusLabel = pset.getParameter<InputTag>("recClusLabel");
recHits1DToken_ = consumes<DTRecHitCollection>(pset.getParameter<InputTag>("recHits1DLabel"));
recClusToken_ = consumes<DTRecClusterCollection>(pset.getParameter<InputTag>("recClusLabel"));

if(debug)
cout << "[DTRecSegment2DExtendedProducer] Constructor called" << endl;
Expand Down Expand Up @@ -70,11 +69,11 @@ void DTRecSegment2DExtendedProducer::produce(edm::Event& event, const

// Get the 1D rechits from the event
Handle<DTRecHitCollection> allHits;
event.getByLabel(theRecHits1DLabel, allHits);
event.getByToken(recHits1DToken_, allHits);

// Get the 1D clusters from the event
Handle<DTRecClusterCollection> dtClusters;
event.getByLabel(theRecClusLabel, dtClusters);
event.getByToken(recClusToken_, dtClusters);
theAlgo->setClusters(vector<DTSLRecCluster>(dtClusters->begin(),
dtClusters->end()));

Expand Down
7 changes: 4 additions & 3 deletions RecoLocalMuon/DTSegment/src/DTRecSegment2DExtendedProducer.h
Expand Up @@ -12,7 +12,8 @@

/* Base Class Headers */
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
#include "DataFormats/DTRecHit/interface/DTRecClusterCollection.h"

namespace edm {
class ParameterSet;
Expand Down Expand Up @@ -53,8 +54,8 @@ class DTRecSegment2DExtendedProducer : public edm::EDProducer {
DTCombinatorialExtendedPatternReco* theAlgo;

//static std::string theAlgoName;
edm::InputTag theRecHits1DLabel;
edm::InputTag theRecClusLabel;
edm::EDGetTokenT<DTRecHitCollection> recHits1DToken_;
edm::EDGetTokenT<DTRecClusterCollection> recClusToken_;
};
#endif // DTRecHit_DTRecSegment2DExtendedProducer_h

6 changes: 3 additions & 3 deletions RecoLocalMuon/DTSegment/src/DTRecSegment2DProducer.cc
Expand Up @@ -11,6 +11,7 @@
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
using namespace edm;

#include "Geometry/DTGeometry/interface/DTLayer.h"
Expand All @@ -19,7 +20,6 @@ using namespace edm;

#include "DataFormats/DTRecHit/interface/DTRecHit1DPair.h"
#include "DataFormats/DTRecHit/interface/DTRecHit1D.h"
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
#include "DataFormats/DTRecHit/interface/DTSLRecSegment2D.h"
#include "DataFormats/DTRecHit/interface/DTRecSegment2DCollection.h"
#include "DataFormats/DTRecHit/interface/DTRangeMapAccessor.h"
Expand All @@ -38,7 +38,7 @@ DTRecSegment2DProducer::DTRecSegment2DProducer(const edm::ParameterSet& pset) {
debug = pset.getUntrackedParameter<bool>("debug");

// the name of the 1D rec hits collection
theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel");
recHits1DToken_ = consumes<DTRecHitCollection>(pset.getParameter<InputTag>("recHits1DLabel"));

if(debug)
cout << "[DTRecSegment2DProducer] Constructor called" << endl;
Expand Down Expand Up @@ -72,7 +72,7 @@ void DTRecSegment2DProducer::produce(edm::Event& event, const

// Get the 1D rechits from the event
Handle<DTRecHitCollection> allHits;
event.getByLabel(theRecHits1DLabel, allHits);
event.getByToken(recHits1DToken_, allHits);

// Create the pointer to the collection which will store the rechits
auto_ptr<DTRecSegment2DCollection> segments(new DTRecSegment2DCollection());
Expand Down
4 changes: 2 additions & 2 deletions RecoLocalMuon/DTSegment/src/DTRecSegment2DProducer.h
Expand Up @@ -12,7 +12,7 @@

/* Base Class Headers */
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"

namespace edm {
class ParameterSet;
Expand Down Expand Up @@ -53,7 +53,7 @@ class DTRecSegment2DProducer : public edm::stream::EDProducer<> {
DTRecSegment2DBaseAlgo* theAlgo;

//static std::string theAlgoName;
edm::InputTag theRecHits1DLabel;
edm::EDGetTokenT<DTRecHitCollection> recHits1DToken_;
};
#endif // DTRecHit_DTRecSegment2DProducer_h

11 changes: 5 additions & 6 deletions RecoLocalMuon/DTSegment/src/DTRecSegment4DProducer.cc
Expand Up @@ -10,13 +10,12 @@
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include "RecoLocalMuon/DTSegment/src/DTSegmentUpdator.h"
#include "RecoLocalMuon/DTSegment/src/DTRecSegment4DAlgoFactory.h"

#include "DataFormats/Common/interface/OwnVector.h"
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
#include "DataFormats/DTRecHit/interface/DTRecSegment2DCollection.h"
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"

#include "Geometry/Records/interface/MuonGeometryRecord.h"
Expand All @@ -34,10 +33,10 @@ DTRecSegment4DProducer::DTRecSegment4DProducer(const ParameterSet& pset){
cout << "[DTRecSegment4DProducer] Constructor called" << endl;

// the name of the 1D rec hits collection
theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel");
recHits1DToken_ = consumes<DTRecHitCollection>(pset.getParameter<InputTag>("recHits1DLabel"));

// the name of the 2D rec hits collection
theRecHits2DLabel = pset.getParameter<InputTag>("recHits2DLabel");
recHits2DToken_ = consumes<DTRecSegment2DCollection>(pset.getParameter<InputTag>("recHits2DLabel"));

// Get the concrete 4D-segments reconstruction algo from the factory
string theReco4DAlgoName = pset.getParameter<string>("Reco4DAlgoName");
Expand All @@ -57,12 +56,12 @@ void DTRecSegment4DProducer::produce(Event& event, const EventSetup& setup){

// Get the 1D rechits from the event
Handle<DTRecHitCollection> all1DHits;
event.getByLabel(theRecHits1DLabel,all1DHits);
event.getByToken(recHits1DToken_, all1DHits);

// Get the 2D rechits from the event
Handle<DTRecSegment2DCollection> all2DSegments;
if(the4DAlgo->wants2DSegments())
event.getByLabel(theRecHits2DLabel, all2DSegments);
event.getByToken(recHits2DToken_, all2DSegments);

// Create the pointer to the collection which will store the rechits
auto_ptr<DTRecSegment4DCollection> segments4DCollection(new DTRecSegment4DCollection());
Expand Down
7 changes: 4 additions & 3 deletions RecoLocalMuon/DTSegment/src/DTRecSegment4DProducer.h
Expand Up @@ -8,7 +8,8 @@
*/

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
#include "DataFormats/DTRecHit/interface/DTRecSegment2DCollection.h"

namespace edm {
class ParameterSet;
Expand Down Expand Up @@ -38,9 +39,9 @@ class DTRecSegment4DProducer: public edm::stream::EDProducer<> {
// Switch on verbosity
bool debug;

edm::InputTag theRecHits1DLabel;
edm::EDGetTokenT<DTRecHitCollection> recHits1DToken_;
//static std::string theAlgoName;
edm::InputTag theRecHits2DLabel;
edm::EDGetTokenT<DTRecSegment2DCollection> recHits2DToken_;
// The 4D-segments reconstruction algorithm
DTRecSegment4DBaseAlgo* the4DAlgo;
};
Expand Down

0 comments on commit 5a3ea09

Please sign in to comment.