42 #include "CLHEP/Units/GlobalPhysicalConstants.h" 43 #include "CLHEP/Units/GlobalSystemOfUnits.h" 59 if(correctForVertexZPosition_) {
60 if(not useMCTruthVertex_) {
96 EBRecHits = pEBRecHits.
product();
98 LogDebug(
"EcalRecHitDebug") <<
"total # EB rechits to be re-calibrated: " << EBRecHits->
size();
104 EERecHits = pEERecHits.
product();
106 LogDebug(
"EcalRecHitDebug") <<
"total # EE uncalibrated rechits to be re-calibrated: " << EERecHits->
size();
118 if ( pEBTimeDigis.
isValid() ) {
119 ebTimeDigis = pEBTimeDigis.
product();
120 edm::LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # ebTimeDigis: " << ebTimeDigis->
size() ;
125 if ( pEETimeDigis.
isValid() ) {
126 eeTimeDigis = pEETimeDigis.
product();
127 edm::LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # eeTimeDigis: " << eeTimeDigis->
size() ;
130 std::unique_ptr< EBRecHitCollection > EBDetailedTimeRecHits(
new EBRecHitCollection );
131 std::unique_ptr< EERecHitCollection > EEDetailedTimeRecHits(
new EERecHitCollection );
133 std::unique_ptr<GlobalPoint> vertex;
147 if (!(*VertexHandle).empty())
150 vertex.reset(
new GlobalPoint(myVertex->
x(),myVertex->
y(),myVertex->
z()) );
162 if (!(*VertexHandle).empty())
164 assert ((*VertexHandle)[0].vertexId() == 0);
165 const SimVertex* myVertex= &(*VertexHandle)[0];
173 if (EBRecHits && ebTimeDigis) {
178 if (timeDigi!=ebTimeDigis->
end())
180 if (timeDigi->sampleOfInterest()>=0)
182 float myTime=(*timeDigi)[timeDigi->sampleOfInterest()];
194 EBDetailedTimeRecHits->push_back( aHit );
198 if (EERecHits && eeTimeDigis)
202 it != EERecHits->
end(); ++it) {
206 if (timeDigi!=eeTimeDigis->
end())
208 if (timeDigi->sampleOfInterest()>=0)
210 float myTime=(*timeDigi)[timeDigi->sampleOfInterest()];
221 EEDetailedTimeRecHits->push_back( aHit );
225 LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # EB rechits: " << EBDetailedTimeRecHits->size();
226 LogInfo(
"EcalDetailedTimeRecHitInfo") <<
"total # EE rechits: " << EEDetailedTimeRecHits->size();
236 assert(
nullptr != cellGeometry ) ;
237 GlobalPoint layerPos = cellGeometry->getPosition(
double(layer)+0.5 );
239 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