-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernized DetIdAssociatorESProducer
- removed framework constructs from DetIdAssociators - created DetIdAssociatorMakers which get configurations from the ParameterSet, set what EventSetup data products will be consumed and then create the appropriate DetIdAssociator.
- Loading branch information
Showing
22 changed files
with
532 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
TrackingTools/TrackAssociator/plugins/CaloDetIdAssociatorMaker.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: TrackingTools/TrackAssociator | ||
// Class : CaloDetIdAssociatorMaker | ||
// | ||
// Implementation: | ||
// [Notes on implementation] | ||
// | ||
// Original Author: Christopher Jones | ||
// Created: Thu, 30 May 2019 15:05:57 GMT | ||
// | ||
|
||
// system include files | ||
|
||
// user include files | ||
#include "CaloDetIdAssociatorMaker.h" | ||
#include "Geometry/Records/interface/CaloGeometryRecord.h" | ||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "TrackingTools/Records/interface/DetIdAssociatorRecord.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "CaloDetIdAssociator.h" | ||
|
||
// | ||
// constants, enums and typedefs | ||
// | ||
|
||
// | ||
// static data member definitions | ||
// | ||
|
||
// | ||
// constructors and destructor | ||
// | ||
CaloDetIdAssociatorMaker::CaloDetIdAssociatorMaker(edm::ParameterSet const& pSet, | ||
edm::ESConsumesCollectorT<DetIdAssociatorRecord>&& iCollector): | ||
geomToken_{ iCollector.consumesFrom<CaloGeometry, CaloGeometryRecord>()}, | ||
etaBinSize{pSet.getParameter<double>("etaBinSize")}, | ||
nPhi{pSet.getParameter<int>("nPhi")}, | ||
nEta{pSet.getParameter<int>("nEta")} | ||
{ | ||
} | ||
|
||
std::unique_ptr<DetIdAssociator> | ||
CaloDetIdAssociatorMaker::make(const DetIdAssociatorRecord& iRecord) const { | ||
return make(iRecord.get(geomToken_), nPhi, nEta, etaBinSize); | ||
} | ||
|
||
std::unique_ptr<DetIdAssociator> | ||
CaloDetIdAssociatorMaker::make(CaloGeometry const& iGeom, int nPhi, int nEta, double etaBinSize ) const { | ||
return std::unique_ptr<DetIdAssociator>( | ||
new CaloDetIdAssociator(nPhi, nEta, etaBinSize, &iGeom) | ||
); | ||
} | ||
|
||
|
55 changes: 55 additions & 0 deletions
55
TrackingTools/TrackAssociator/plugins/CaloDetIdAssociatorMaker.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef TrackingTools_TrackAssociator_CaloDetIdAssociatorMaker_h | ||
#define TrackingTools_TrackAssociator_CaloDetIdAssociatorMaker_h | ||
// -*- C++ -*- | ||
// | ||
// Package: TrackingTools/TrackAssociator | ||
// Class : CaloDetIdAssociatorMaker | ||
// | ||
/**\class CaloDetIdAssociatorMaker CaloDetIdAssociatorMaker.h "CaloDetIdAssociatorMaker.h" | ||
Description: [one line class summary] | ||
Usage: | ||
<usage> | ||
*/ | ||
// | ||
// Original Author: Christopher Jones | ||
// Created: Thu, 30 May 2019 14:59:09 GMT | ||
// | ||
|
||
// system include files | ||
#include <memory> | ||
|
||
// user include files | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Framework/interface/ESConsumesCollector.h" | ||
#include "FWCore/Utilities/interface/ESGetToken.h" | ||
#include "DetIdAssociatorMaker.h" | ||
|
||
// forward declarations | ||
class DetIdAssociator; | ||
class DetIdAssociatorRecord; | ||
class CaloGeometry; | ||
class CaloGeometryRecord; | ||
|
||
class CaloDetIdAssociatorMaker : public DetIdAssociatorMaker | ||
{ | ||
|
||
public: | ||
CaloDetIdAssociatorMaker(edm::ParameterSet const&, | ||
edm::ESConsumesCollectorT<DetIdAssociatorRecord>&& ); | ||
|
||
// ---------- const member functions --------------------- | ||
std::unique_ptr<DetIdAssociator> make(const DetIdAssociatorRecord&) const final; | ||
|
||
private: | ||
virtual std::unique_ptr<DetIdAssociator> make(CaloGeometry const&, int nPhi, int nEta, double etaBinSize ) const; | ||
const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geomToken_; | ||
const double etaBinSize; | ||
const int nPhi; | ||
const int nEta; | ||
}; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
TrackingTools/TrackAssociator/plugins/DetIdAssociatorMaker.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#ifndef TrackingTools_TrackAssociator_DetIdAssociatorMaker_h | ||
#define TrackingTools_TrackAssociator_DetIdAssociatorMaker_h | ||
// -*- C++ -*- | ||
// | ||
// Package: TrackingTools/TrackAssociator | ||
// Class : DetIdAssociatorMaker | ||
// | ||
/**\class DetIdAssociatorMaker DetIdAssociatorMaker.h "DetIdAssociatorMaker.h" | ||
Description: [one line class summary] | ||
Usage: | ||
<usage> | ||
*/ | ||
// | ||
// Original Author: Christopher Jones | ||
// Created: Thu, 30 May 2019 14:52:58 GMT | ||
// | ||
|
||
// system include files | ||
|
||
// user include files | ||
|
||
// forward declarations | ||
class DetIdAssociator; | ||
class DetIdAssociatorRecord; | ||
|
||
class DetIdAssociatorMaker | ||
{ | ||
|
||
public: | ||
DetIdAssociatorMaker() = default; | ||
virtual ~DetIdAssociatorMaker() = default; | ||
|
||
// ---------- const member functions --------------------- | ||
virtual std::unique_ptr<DetIdAssociator> make(const DetIdAssociatorRecord&) const = 0; | ||
|
||
// ---------- static member functions -------------------- | ||
|
||
// ---------- member functions --------------------------- | ||
|
||
private: | ||
DetIdAssociatorMaker(const DetIdAssociatorMaker&) = delete; | ||
|
||
const DetIdAssociatorMaker& operator=(const DetIdAssociatorMaker&) = delete; | ||
|
||
// ---------- member data -------------------------------- | ||
|
||
}; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
TrackingTools/TrackAssociator/plugins/EcalDetIdAssociatorMaker.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef TrackingTools_TrackAssociator_EcalDetIdAssociatorMaker_h | ||
#define TrackingTools_TrackAssociator_EcalDetIdAssociatorMaker_h | ||
// -*- C++ -*- | ||
// | ||
// Package: TrackingTools/TrackAssociator | ||
// Class : EcalDetIdAssociatorMaker | ||
// | ||
/**\class EcalDetIdAssociatorMaker EcalDetIdAssociatorMaker.h "EcalDetIdAssociatorMaker.h" | ||
Description: [one line class summary] | ||
Usage: | ||
<usage> | ||
*/ | ||
// | ||
// Original Author: Christopher Jones | ||
// Created: Thu, 30 May 2019 16:11:48 GMT | ||
// | ||
|
||
// system include files | ||
|
||
// user include files | ||
|
||
// forward declarations | ||
#include "CaloDetIdAssociatorMaker.h" | ||
#include "EcalDetIdAssociator.h" | ||
|
||
class EcalDetIdAssociatorMaker : public CaloDetIdAssociatorMaker | ||
{ | ||
|
||
public: | ||
using CaloDetIdAssociatorMaker::CaloDetIdAssociatorMaker; | ||
|
||
private: | ||
std::unique_ptr<DetIdAssociator> make(CaloGeometry const& geom, int nPhi, int nEta, double etaBinSize ) const final { | ||
return std::unique_ptr<DetIdAssociator>( new EcalDetIdAssociator(nPhi,nEta, etaBinSize, &geom) ); | ||
} | ||
|
||
}; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.