41 #include "CLHEP/Units/GlobalPhysicalConstants.h" 42 #include "CLHEP/Units/GlobalSystemOfUnits.h" 89 caloGeometry_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
113 using namespace reco;
129 LogDebug(
"EcalRecHitDebug") <<
"total # EB rechits to be re-calibrated: " <<
EBRecHits->size();
137 LogDebug(
"EcalRecHitDebug") <<
"total # EE uncalibrated rechits to be re-calibrated: " <<
EERecHits->size();
150 ebTimeDigis = pEBTimeDigis.
product();
151 edm::LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # ebTimeDigis: " << ebTimeDigis->
size();
157 eeTimeDigis = pEETimeDigis.
product();
158 edm::LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # eeTimeDigis: " << eeTimeDigis->
size();
164 std::unique_ptr<GlobalPoint>
vertex;
175 if (!(*VertexHandle).empty())
178 vertex = std::make_unique<GlobalPoint>(myVertex->
x(), myVertex->
y(), myVertex->
z());
187 if (!(*VertexHandle).empty())
189 assert((*VertexHandle)[0].vertexId() == 0);
190 const SimVertex* myVertex = &(*VertexHandle)[0];
191 vertex = std::make_unique<GlobalPoint>(
203 if (timeDigi != ebTimeDigis->
end()) {
204 if (timeDigi->sampleOfInterest() >= 0) {
205 float myTime = (*timeDigi)[timeDigi->sampleOfInterest()];
215 EBDetailedTimeRecHits->push_back(aHit);
224 if (timeDigi != eeTimeDigis->
end()) {
225 if (timeDigi->sampleOfInterest() >= 0) {
226 float myTime = (*timeDigi)[timeDigi->sampleOfInterest()];
235 EEDetailedTimeRecHits->push_back(aHit);
239 LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # EB rechits: " << EBDetailedTimeRecHits->size();
240 LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # EE rechits: " << EEDetailedTimeRecHits->size();
248 assert(
nullptr != cellGeometry);
250 cellGeometry->getPosition(
double(
layer) + 0.5);
252 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
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_
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.
#define DEFINE_FWK_MODULE(type)
double x() const
x coordinate
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