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) {
102 const DetId detId ( (*it).id() ) ;
104 double time = (*it).time();
116 #ifdef ecal_time_debug 148 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
150 #ifdef ecal_time_debug 168 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
170 #ifdef ecal_time_debug 174 #ifdef ecal_time_debug 187 #ifdef ecal_time_debug 188 std::cout <<
"[EcalTimeMapDigitizer]::Zeroing the used samples" << std::endl;
197 #ifdef ecal_time_debug 198 std::cout <<
"[EcalTimeMapDigitizer]::Finalizing hits and fill output collection" << std::endl;
205 const unsigned int ssize (
m_index.size() ) ;
209 for(
unsigned int i ( 0 ) ;
i != ssize ; ++
i )
212 #ifdef ecal_time_debug 213 std::cout <<
"----- in digi loop " <<
i << std::endl;
218 unsigned int nTimeHits=0;
231 output.
back().setSize(nTimeHits);
233 for (
unsigned int j ( 0 ) ; j != nTimeHits; ++j )
235 output.
back().setSample(j,timeHits[j]);
238 #ifdef ecal_time_debug 239 std::cout <<
"setting interesting sample " << j << std::endl;
241 output.
back().setSampleOfInterest(j);
245 #ifdef ecal_time_debug 246 std::cout <<
"digi " << output.
back().id().rawId() <<
"\t" << output.
back().size();
247 if (output.
back().sampleOfInterest()>0)
248 std::cout <<
"\tBX0 time " << output.
back().sample(output.
back().sampleOfInterest()) << std::endl;
250 std::cout <<
"\tNo in time hits" << std::endl;
253 #ifdef ecal_time_debug 254 std::cout <<
"[EcalTimeMapDigitizer]::Output collection size " << output.
size() << std::endl;
265 assert( 0 != cellGeometry ) ;
267 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)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
static EBDetId detIdFromDenseIndex(uint32_t di)
unsigned int samplesSize() const
TimeSamples * vSamAll(unsigned int i)
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()
TimeSamples * findSignal(const DetId &detId)
double timeOfFlight(const DetId &detId, int layer) const
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
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