39 #include "CLHEP/Units/GlobalPhysicalConstants.h" 40 #include "CLHEP/Units/GlobalSystemOfUnits.h" 49 caloGeometry_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
91 LogDebug(
"EcalRecHitDebug") <<
"total # EB rechits to be re-calibrated: " <<
EBRecHits->size();
99 LogDebug(
"EcalRecHitDebug") <<
"total # EE uncalibrated rechits to be re-calibrated: " <<
EERecHits->size();
112 ebTimeDigis = pEBTimeDigis.
product();
113 edm::LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # ebTimeDigis: " << ebTimeDigis->
size();
119 eeTimeDigis = pEETimeDigis.
product();
120 edm::LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # eeTimeDigis: " << eeTimeDigis->
size();
126 std::unique_ptr<GlobalPoint>
vertex;
137 if (!(*VertexHandle).empty())
140 vertex = std::make_unique<GlobalPoint>(myVertex->
x(), myVertex->
y(), myVertex->
z());
149 if (!(*VertexHandle).empty())
151 assert((*VertexHandle)[0].vertexId() == 0);
152 const SimVertex* myVertex = &(*VertexHandle)[0];
153 vertex = std::make_unique<GlobalPoint>(
165 if (timeDigi != ebTimeDigis->
end()) {
166 if (timeDigi->sampleOfInterest() >= 0) {
167 float myTime = (*timeDigi)[timeDigi->sampleOfInterest()];
177 EBDetailedTimeRecHits->push_back(aHit);
186 if (timeDigi != eeTimeDigis->
end()) {
187 if (timeDigi->sampleOfInterest() >= 0) {
188 float myTime = (*timeDigi)[timeDigi->sampleOfInterest()];
197 EEDetailedTimeRecHits->push_back(aHit);
201 LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # EB rechits: " << EBDetailedTimeRecHits->size();
202 LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # EE rechits: " << EEDetailedTimeRecHits->size();
210 assert(
nullptr != cellGeometry);
212 cellGeometry->getPosition(
double(
layer) + 0.5);
214 return (layerPos.
mag() * cm - tofVector.
mag() * cm) / (
float)c_light;
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double z() const
z coordinate
#define DEFINE_FWK_MODULE(type)
const math::XYZTLorentzVectorD & position() const
edm::EDGetTokenT< EcalTimeDigiCollection > eeTimeDigiCollection_
T const * product() const
std::vector< EcalRecHit >::const_iterator const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< EcalTimeDigiCollection > ebTimeDigiCollection_
constexpr std::array< uint8_t, layerIndexSize > layer
T const * product() const
double deltaTimeOfFlight(GlobalPoint &vertex, const DetId &detId, int layer) const
edm::EDGetTokenT< reco::VertexCollection > recoVertex_
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
double x() const
x coordinate
~EcalDetailedTimeRecHitProducer() override
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
double y() const
y coordinate
const_iterator end() const
Log< level::Info, false > LogInfo
EcalDetailedTimeRecHitProducer(const edm::ParameterSet &ps)
bool correctForVertexZPosition_
std::string EEDetailedTimeRecHitCollection_
edm::EDGetTokenT< EBRecHitCollection > EBRecHitCollection_
iterator find(key_type k)
const CaloGeometry * m_geometry
std::string EBDetailedTimeRecHitCollection_
edm::EDGetTokenT< edm::SimVertexContainer > simVertex_
edm::EDGetTokenT< EERecHitCollection > EERecHitCollection_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry_
void produce(edm::Event &evt, const edm::EventSetup &es) override