18 #include "CLHEP/Random/RandFlat.h"
34 std::cout <<
"FP420ClusterMain constructor: ElectronPerADC = " << ElectronPerADC_ << std::endl;
35 std::cout <<
" clusterMode = " << clusterMode_ << std::endl;
36 std::cout <<
" ChannelThreshold = " << ChannelThreshold << std::endl;
37 std::cout <<
" SeedThreshold = " << SeedThreshold << std::endl;
38 std::cout <<
" ClusterThreshold = " << ClusterThreshold << std::endl;
39 std::cout <<
" MaxVoidsInCluster = " << MaxVoidsInCluster << std::endl;
72 std::cout <<
"FP420ClusterMain constructor: sn0 = " <<
sn0 <<
" pn0=" <<
pn0 <<
" dn0=" <<
dn0 <<
" rn0=" <<
rn0 << std::endl;
73 std::cout <<
"FP420ClusterMain constructor: ENC = " <<
ENC_ << std::endl;
84 std::cout <<
"using a SingleNoiseValue and good electrode flags" << std::endl;
88 std::cout <<
"using Noise and BadElectrode flags accessed from DB" << std::endl;
92 if ( clusterMode_ ==
"ClusterProducerFP420" ) {
105 std::cout <<
"ERROR:FP420ClusterMain: No valid clusterizer selected" << std::endl;
120 std::vector<ClusterNoiseFP420>& electrodnoise)
130 std::cout <<
"FP420ClusterMain: OK1" << std::endl;
134 int number_detunits = 0;
135 int number_localelectroderechits = 0;
145 for (
int det=1; det<
dn0; det++) {
146 for (
int sector=1; sector<
sn0; sector++) {
147 for (
int zmodule=1; zmodule<
pn0; zmodule++) {
152 std::cout <<
" FP420ClusterMain:1 run loop index no iu = " << detID << std::endl;
179 std::vector<HDigiFP420> dcollector;
182 std::cout <<
" FP420ClusterMain:2 number_detunits = " << number_detunits << std::endl;
184 digiRange = input->get(detID);
189 std::cout <<
" FP420ClusterMain: input->get DONE dcollector.size()=" << dcollector.size() << std::endl;
194 for ( ;sort_begin != sort_end; ++sort_begin ) {
195 dcollector.push_back(*sort_begin);
197 if (dcollector.size()>0) {
202 std::cout <<
" FP420ClusterMain: channel Begin = " << (digiRangeIteratorBegin)->channel() << std::endl;
203 std::cout <<
" FP420ClusterMain: channel end = " << (digiRangeIteratorEnd-1)->channel() << std::endl;
206 std::cout <<
" FP420ClusterMain:3 noise treatment " << std::endl;
210 std::vector<ClusterFP420> collector;
229 for(
int electrode=0; electrode <
numStrips; ++electrode){
232 theElectrodData.
setData(noise,badFlag);
233 vnoise.push_back(theElectrodData);
237 std::cout <<
" FP420ClusterMain:5 BadElectrodeProbability added " << std::endl;
247 std::cout <<
" FP420ClusterMain:6 threeThreshold OK " << std::endl;
267 if (collector.size()>0){
269 inputRange.first = collector.begin();
270 inputRange.second = collector.end();
273 std::cout <<
" FP420ClusterMain:7 collector.size()>0 " << std::endl;
278 unsigned int detID0 = 0;
280 std::cout <<
" FP420ClusterMain:8 first soutput->put " << std::endl;
282 soutput->
put(inputRange,detID0);
287 std::cout <<
" FP420ClusterMain:9 soutput->put " << std::endl;
289 soutput->
put(inputRange,detID);
291 number_localelectroderechits += collector.size();
295 std::cout <<
"[FP420ClusterMain] execution in mode " <<
clusterMode_ <<
" generating " << number_localelectroderechits <<
" ClusterFP420s in " << number_detunits <<
" DetUnits." << std::endl;
306 for (
int det=1; det<
dn0; det++) {
307 for (
int sector=1; sector<
sn0; sector++) {
308 for (
int zmodule=1; zmodule<
pn0; zmodule++) {
312 std::cout <<
" iu = " << iu <<
" sector = " << sector <<
" zmodule = " << zmodule <<
" zside = " <<
zside <<
" det=" << det << std::endl;
313 std::vector<ClusterFP420> collector;
316 outputRange = soutput->
get(iu);
320 for ( ;sort_begin != sort_end; ++sort_begin ) {
321 collector.push_back(*sort_begin);
325 std::cout <<
" =========== FP420ClusterMain:check: iu= " << iu <<
" zside = " <<
zside << std::endl;
326 std::cout <<
" ======renew collector size = " << collector.size() << std::endl;
329 std::vector<ClusterFP420>::const_iterator simHitIter = collector.begin();
330 std::vector<ClusterFP420>::const_iterator simHitIterEnd = collector.end();
332 for (;simHitIter != simHitIterEnd; ++simHitIter) {
339 for(
unsigned int i = 0;
i < icluster.
amplitudes().size();
i++ ) {
344 std::cout <<
" =======================" << std::endl;
363 std::cout <<
"======= FP420ClusterMain: end of check " << std::endl;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void run(edm::Handle< DigiCollectionFP420 > &input, ClusterCollectionFP420 *soutput, std::vector< ClusterNoiseFP420 > &noise)
Runs the algorithm.
inputRange
Get input source.
std::vector< ClusterFP420 >::const_iterator ContainerIterator
ClusterProducerFP420 * threeThreshold_
std::vector< HDigiFP420 >::const_iterator ContainerIterator
std::vector< ClusterNoiseFP420::ElectrodData > ElectrodNoiseVector
void put(Range input, unsigned int detID)
const std::vector< short > & amplitudes() const
double BadElectrodeProbability_
static std::string const input
float barycenterW() const
static unsigned packMYIndex(int rn0, int pn0, int sn0, int det, int zside, int sector, int zmodule)
std::pair< ContainerIterator, ContainerIterator > Range
const Range get(unsigned int detID) const
FP420ClusterMain(const edm::ParameterSet &conf, int dn, int sn, int pn, int rn)
std::vector< ClusterFP420 > clusterizeDetUnitPixels(HDigiFP420Iter begin, HDigiFP420Iter end, unsigned int detid, const ElectrodNoiseVector &vnoise, unsigned int xytype, int verb)
bool UseNoiseBadElectrodeFlagFromDB_
std::pair< ContainerIterator, ContainerIterator > Range