40 #include "CLHEP/Units/GlobalPhysicalConstants.h" 41 #include "CLHEP/Units/GlobalSystemOfUnits.h" 55 if (correctForVertexZPosition_) {
56 if (not useMCTruthVertex_) {
89 EBRecHits = pEBRecHits.
product();
91 LogDebug(
"EcalRecHitDebug") <<
"total # EB rechits to be re-calibrated: " << EBRecHits->
size();
97 EERecHits = pEERecHits.
product();
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.reset(
new GlobalPoint(myVertex->
x(), myVertex->
y(), myVertex->
z()));
149 if (!(*VertexHandle).empty())
151 assert((*VertexHandle)[0].vertexId() == 0);
152 const SimVertex* myVertex = &(*VertexHandle)[0];
159 if (EBRecHits && ebTimeDigis) {
164 if (timeDigi != ebTimeDigis->
end()) {
165 if (timeDigi->sampleOfInterest() >= 0) {
166 float myTime = (*timeDigi)[timeDigi->sampleOfInterest()];
176 EBDetailedTimeRecHits->push_back(aHit);
180 if (EERecHits && eeTimeDigis) {
185 if (timeDigi != eeTimeDigis->
end()) {
186 if (timeDigi->sampleOfInterest() >= 0) {
187 float myTime = (*timeDigi)[timeDigi->sampleOfInterest()];
196 EEDetailedTimeRecHits->push_back(aHit);
200 LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # EB rechits: " << EBDetailedTimeRecHits->size();
201 LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # EE rechits: " << EEDetailedTimeRecHits->size();
209 assert(
nullptr != cellGeometry);
211 cellGeometry->getPosition(
double(layer) + 0.5);
213 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.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double y() const
y coordinate
edm::EDGetTokenT< EcalTimeDigiCollection > eeTimeDigiCollection_
Global3DPoint GlobalPoint
std::vector< EcalRecHit >::const_iterator const_iterator
edm::EDGetTokenT< EcalTimeDigiCollection > ebTimeDigiCollection_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::VertexCollection > recoVertex_
double z() const
z coordinate
const math::XYZTLorentzVectorD & position() const
~EcalDetailedTimeRecHitProducer() override
const_iterator end() const
EcalDetailedTimeRecHitProducer(const edm::ParameterSet &ps)
double x() const
x coordinate
T const * product() const
bool correctForVertexZPosition_
std::string EEDetailedTimeRecHitCollection_
edm::EDGetTokenT< EBRecHitCollection > EBRecHitCollection_
iterator find(key_type k)
double deltaTimeOfFlight(GlobalPoint &vertex, const DetId &detId, int layer) const
const CaloGeometry * m_geometry
std::string EBDetailedTimeRecHitCollection_
edm::EDGetTokenT< edm::SimVertexContainer > simVertex_
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
edm::EDGetTokenT< EERecHitCollection > EERecHitCollection_
T const * product() const
void produce(edm::Event &evt, const edm::EventSetup &es) override
const_iterator begin() const