18 #include "CLHEP/Units/GlobalPhysicalConstants.h" 19 #include "CLHEP/Units/GlobalSystemOfUnits.h" 57 edm::LogError(
"TimeDigiError") <<
"[EcalTimeMapDigitizer]::ERROR::This subdetector " << myDet <<
" is not implemented";
65 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
73 edm::LogInfo(
"TimeDigiInfo") <<
"[EcalTimeDigitizer]::Subdetector " <<
m_subDet <<
"::Reserved size for time digis " <<
m_vSam.size();
75 #ifdef ecal_time_debug 76 std::cout <<
"[EcalTimeDigitizer]::Subdetector " <<
m_subDet <<
"::Reserved size for time digis " <<
m_vSam.size() << std::endl;
89 for(std::vector<PCaloHit>::const_iterator it = hits.begin(), itEnd = hits.end(); it != itEnd; ++it) {
104 const DetId detId ( (*it).id() ) ;
106 double time = (*it).time();
118 #ifdef ecal_time_debug 150 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
152 #ifdef ecal_time_debug 170 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
172 #ifdef ecal_time_debug 176 #ifdef ecal_time_debug 189 #ifdef ecal_time_debug 190 std::cout <<
"[EcalTimeMapDigitizer]::Zeroing the used samples" << std::endl;
199 #ifdef ecal_time_debug 200 std::cout <<
"[EcalTimeMapDigitizer]::Finalizing hits and fill output collection" << std::endl;
207 const unsigned int ssize (
m_index.size() ) ;
211 for(
unsigned int i ( 0 ) ;
i != ssize ; ++
i )
214 #ifdef ecal_time_debug 215 std::cout <<
"----- in digi loop " <<
i << std::endl;
220 unsigned int nTimeHits=0;
233 output.
back().setSize(nTimeHits);
235 for (
unsigned int j ( 0 ) ; j != nTimeHits; ++j )
237 output.
back().setSample(j,timeHits[j]);
240 #ifdef ecal_time_debug 241 std::cout <<
"setting interesting sample " << j << std::endl;
243 output.
back().setSampleOfInterest(j);
247 #ifdef ecal_time_debug 248 std::cout <<
"digi " << output.
back().id().rawId() <<
"\t" << output.
back().size();
249 if (output.
back().sampleOfInterest()>0)
250 std::cout <<
"\tBX0 time " << output.
back().sample(output.
back().sampleOfInterest()) << std::endl;
252 std::cout <<
"\tNo in time hits" << std::endl;
255 #ifdef ecal_time_debug 256 std::cout <<
"[EcalTimeMapDigitizer]::Output collection size " << output.
size() << std::endl;
267 assert(
nullptr != cellGeometry ) ;
268 GlobalPoint layerPos = (cellGeometry)->getPosition(
double(layer)+0.5 );
269 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
const CaloSubdetectorGeometry * m_geometry
void push_back(T const &t)
const TimeSamples * operator[](unsigned int i) const
unsigned int nhits[time_average_capacity]
std::vector< TimeSamples > m_vSam
void setGeometry(const CaloSubdetectorGeometry *geometry)
static EBDetId detIdFromDenseIndex(uint32_t di)
unsigned int samplesSize() const
static const int kEcalDepthMask
TimeSamples * vSamAll(unsigned int i)
static const int kEcalDepthOffset
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static const unsigned short time_average_capacity
static const int m_minBunch
void blankOutUsedSamples()
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.
TimeSamples * findSignal(const DetId &detId)
double timeOfFlight(const DetId &detId, int layer) const
void add(const std::vector< PCaloHit > &hits, int bunchCrossing)
ESHandle< TrackerGeometry > geometry
EcalTimeMapDigitizer(EcalSubdetector myDet)
float average_time[time_average_capacity]
virtual ~EcalTimeMapDigitizer()
void reserve(size_type n)
float tot_energy[time_average_capacity]
std::vector< unsigned int > VecInd
Detector det() const
get the detector field from this detid
static const float MIN_ENERGY_THRESHOLD
TimeSamples * vSam(unsigned int i)
const_reference back() const