18 #include "CLHEP/Units/GlobalPhysicalConstants.h" 19 #include "CLHEP/Units/GlobalSystemOfUnits.h" 40 unsigned int size = 0;
51 edm::LogError(
"TimeDigiError") <<
"[EcalTimeMapDigitizer]::ERROR::This subdetector " << myDet
52 <<
" is not implemented";
59 for (
unsigned int i(0);
i !=
size; ++
i) {
65 edm::LogInfo(
"TimeDigiInfo") <<
"[EcalTimeDigitizer]::Subdetector " <<
m_subDet <<
"::Reserved size for time digis " 68 #ifdef ecal_time_debug 69 std::cout <<
"[EcalTimeDigitizer]::Subdetector " <<
m_subDet <<
"::Reserved size for time digis " <<
m_vSam.size()
78 for (std::vector<PCaloHit>::const_iterator it =
hits.begin(), itEnd =
hits.end(); it != itEnd; ++it) {
93 const DetId detId((*it).id());
95 double time = (*it).time();
107 #ifdef ecal_time_debug 108 std::cout << (*it).id() <<
"\t" << (*it).depth() <<
"\t" << jitter <<
"\t" << (*it).energy() <<
"\t" 130 for (
unsigned int i(0);
i !=
size; ++
i) {
131 #ifdef ecal_time_debug 146 for (
unsigned int i(0);
i !=
size; ++
i) {
147 #ifdef ecal_time_debug 151 #ifdef ecal_time_debug 162 #ifdef ecal_time_debug 163 std::cout <<
"[EcalTimeMapDigitizer]::Zeroing the used samples" << std::endl;
169 #ifdef ecal_time_debug 170 std::cout <<
"[EcalTimeMapDigitizer]::Finalizing hits and fill output collection" << std::endl;
177 const unsigned int ssize(
m_index.size());
181 for (
unsigned int i(0);
i != ssize; ++
i) {
182 #ifdef ecal_time_debug 183 std::cout <<
"----- in digi loop " <<
i << std::endl;
188 unsigned int nTimeHits = 0;
200 output.back().setSize(nTimeHits);
202 for (
unsigned int j(0);
j != nTimeHits; ++
j)
204 output.back().setSample(
j, timeHits[
j]);
205 if (timeBX[
j] == 0) {
206 #ifdef ecal_time_debug 207 std::cout <<
"setting interesting sample " <<
j << std::endl;
209 output.back().setSampleOfInterest(
j);
213 #ifdef ecal_time_debug 215 if (
output.back().sampleOfInterest() > 0)
218 std::cout <<
"\tNo in time hits" << std::endl;
221 #ifdef ecal_time_debug 222 std::cout <<
"[EcalTimeMapDigitizer]::Output collection size " <<
output.size() << std::endl;
229 assert(
nullptr != cellGeometry);
231 (cellGeometry)->getPosition(
double(
layer) + 0.5);
232 return layerPos.
mag() * cm / c_light;
static EEDetId detIdFromDenseIndex(uint32_t din)
unsigned int samplesSizeAll() const
void run(EcalTimeDigiCollection &output)
static const int m_maxBunch
constexpr bool isNotFinite(T x)
const CaloSubdetectorGeometry * m_geometry
unsigned int samplesSize() const
Log< level::Error, false > LogError
unsigned int nhits[time_average_capacity]
constexpr Detector det() const
get the detector field from this detid
std::vector< TimeSamples > m_vSam
void setGeometry(const CaloSubdetectorGeometry *geometry)
double timeOfFlight(const DetId &detId, int layer) const
static EBDetId detIdFromDenseIndex(uint32_t di)
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
const TimeSamples * operator[](unsigned int i) const
static const int kEcalDepthMask
std::vector< unsigned int > VecInd
TimeSamples * vSamAll(unsigned int i)
static const int kEcalDepthOffset
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
static const unsigned short time_average_capacity
Log< level::Info, false > LogInfo
static const int m_minBunch
void blankOutUsedSamples()
TimeSamples * findSignal(const DetId &detId)
void add(const std::vector< PCaloHit > &hits, int bunchCrossing)
EcalTimeMapDigitizer(EcalSubdetector myDet)
float average_time[time_average_capacity]
virtual ~EcalTimeMapDigitizer()
float tot_energy[time_average_capacity]
static const float MIN_ENERGY_THRESHOLD
TimeSamples * vSam(unsigned int i)