18 #include "CLHEP/Random/RandFlat.h"
23 : dn0(dn), sn0(sn), pn0(pn), rn0(rn) {
33 std::cout <<
"FP420ClusterMain constructor: ElectronPerADC = " << ElectronPerADC_ << std::endl;
34 std::cout <<
" clusterMode = " << clusterMode_ << std::endl;
35 std::cout <<
" ChannelThreshold = " << ChannelThreshold << std::endl;
36 std::cout <<
" SeedThreshold = " << SeedThreshold << std::endl;
37 std::cout <<
" ClusterThreshold = " << ClusterThreshold << std::endl;
38 std::cout <<
" MaxVoidsInCluster = " << MaxVoidsInCluster << std::endl;
70 std::cout <<
"FP420ClusterMain constructor: sn0 = " <<
sn0 <<
" pn0=" <<
pn0 <<
" dn0=" <<
dn0 <<
" rn0=" <<
rn0
72 std::cout <<
"FP420ClusterMain constructor: ENC = " <<
ENC_ << std::endl;
83 std::cout <<
"using a SingleNoiseValue and good electrode flags" << std::endl;
87 std::cout <<
"using Noise and BadElectrode flags accessed from DB" << std::endl;
91 if (clusterMode_ ==
"ClusterProducerFP420") {
100 std::cout <<
"ERROR:FP420ClusterMain: No valid clusterizer selected" << std::endl;
117 std::cout <<
"FP420ClusterMain: OK1" << std::endl;
120 int number_detunits = 0;
121 int number_localelectroderechits = 0;
131 for (
int det = 1; det <
dn0; det++) {
132 for (
int sector = 1; sector <
sn0; sector++) {
133 for (
int zmodule = 1; zmodule <
pn0; zmodule++) {
138 std::cout <<
" FP420ClusterMain:1 run loop index no iu = " << detID << std::endl;
140 float moduleThickness = 0;
162 std::vector<HDigiFP420> dcollector;
165 std::cout <<
" FP420ClusterMain:2 number_detunits = " << number_detunits << std::endl;
167 digiRange = input->get(detID);
172 std::cout <<
" FP420ClusterMain: input->get DONE dcollector.size()=" << dcollector.size() << std::endl;
177 for (; sort_begin != sort_end; ++sort_begin) {
178 dcollector.push_back(*sort_begin);
180 if (!dcollector.empty()) {
184 std::cout <<
" FP420ClusterMain: channel Begin = " << (digiRangeIteratorBegin)->channel() << std::endl;
185 std::cout <<
" FP420ClusterMain: channel end = " << (digiRangeIteratorEnd - 1)->channel() << std::endl;
188 std::cout <<
" FP420ClusterMain:3 noise treatment " << std::endl;
191 std::vector<ClusterFP420> collector;
207 std::cout <<
" FP420ClusterMain:4 numStrips = " << numStrips << std::endl;
209 for (
int electrode = 0; electrode < numStrips; ++electrode) {
212 theElectrodData.
setData(noise, badFlag);
213 vnoise.push_back(theElectrodData);
217 std::cout <<
" FP420ClusterMain:5 BadElectrodeProbability added " << std::endl;
225 digiRangeIteratorBegin, digiRangeIteratorEnd, detID, vnoise,
xytype,
verbosity);
228 std::cout <<
" FP420ClusterMain:6 threeThreshold OK " << std::endl;
246 if (!collector.empty()) {
248 inputRange.first = collector.begin();
249 inputRange.second = collector.end();
252 std::cout <<
" FP420ClusterMain:7 collector.size()>0 " << std::endl;
257 unsigned int detID0 = 0;
259 std::cout <<
" FP420ClusterMain:8 first soutput->put " << std::endl;
261 soutput->
put(inputRange, detID0);
266 std::cout <<
" FP420ClusterMain:9 soutput->put " << std::endl;
268 soutput->
put(inputRange, detID);
270 number_localelectroderechits += collector.size();
275 << number_localelectroderechits <<
" ClusterFP420s in " << number_detunits <<
" DetUnits."
286 for (
int det = 1; det <
dn0; det++) {
287 for (
int sector = 1; sector <
sn0; sector++) {
288 for (
int zmodule = 1; zmodule <
pn0; zmodule++) {
292 std::cout <<
" iu = " << iu <<
" sector = " << sector <<
" zmodule = " << zmodule <<
" zside = " <<
zside
293 <<
" det=" << det << std::endl;
294 std::vector<ClusterFP420> collector;
297 outputRange = soutput->
get(iu);
301 for (; sort_begin != sort_end; ++sort_begin) {
302 collector.push_back(*sort_begin);
306 std::cout <<
" =========== FP420ClusterMain:check: iu= " << iu <<
" zside = " <<
zside << std::endl;
307 std::cout <<
" ======renew collector size = " << collector.size() << std::endl;
310 std::vector<ClusterFP420>::const_iterator simHitIter = collector.begin();
311 std::vector<ClusterFP420>::const_iterator simHitIterEnd = collector.end();
313 for (; simHitIter != simHitIterEnd; ++simHitIter) {
322 for (
unsigned int i = 0;
i < icluster.
amplitudes().size();
i++) {
327 std::cout <<
" =======================" << std::endl;
346 std::cout <<
"======= FP420ClusterMain: end of check " << std::endl;
T getUntrackedParameter(std::string const &, T const &) const
std::vector< ClusterFP420 >::const_iterator ContainerIterator
std::vector< HDigiFP420 >::const_iterator ContainerIterator
std::unique_ptr< const ClusterProducerFP420 > threeThreshold_
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
T getParameter(std::string const &) const
void run(edm::Handle< DigiCollectionFP420 > &input, ClusterCollectionFP420 *soutput) const
Runs the algorithm.
FP420ClusterMain(const edm::ParameterSet &conf, int dn, int sn, int pn, int rn)
bool UseNoiseBadElectrodeFlagFromDB_
std::pair< ContainerIterator, ContainerIterator > Range