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;
75 std::cout <<
"FP420ClusterMain constructor: sn0 = " <<
sn0 <<
" pn0=" <<
pn0 <<
" dn0=" <<
dn0 <<
" rn0=" <<
rn0 << std::endl;
76 std::cout <<
"FP420ClusterMain constructor: ENC = " <<
ENC_ << std::endl;
87 std::cout <<
"using a SingleNoiseValue and good electrode flags" << std::endl;
91 std::cout <<
"using Noise and BadElectrode flags accessed from DB" << std::endl;
95 if ( clusterMode_ ==
"ClusterProducerFP420" ) {
108 std::cout <<
"ERROR:FP420ClusterMain: No valid clusterizer selected" << std::endl;
123 std::vector<ClusterNoiseFP420>& electrodnoise)
133 std::cout <<
"FP420ClusterMain: OK1" << std::endl;
137 int number_detunits = 0;
138 int number_localelectroderechits = 0;
148 for (
int det=1; det<
dn0; det++) {
149 for (
int sector=1; sector<
sn0; sector++) {
150 for (
int zmodule=1; zmodule<
pn0; zmodule++) {
151 for (
int zside=1; zside<
rn0; zside++) {
153 unsigned int detID =
theFP420NumberingScheme->FP420NumberingScheme::packMYIndex(rn0, pn0, sn0, det, zside, sector, zmodule);
155 std::cout <<
" FP420ClusterMain:1 run loop index no iu = " << detID << std::endl;
182 std::vector<HDigiFP420> dcollector;
185 std::cout <<
" FP420ClusterMain:2 number_detunits = " << number_detunits << std::endl;
187 digiRange = input->get(detID);
192 std::cout <<
" FP420ClusterMain: input->get DONE dcollector.size()=" << dcollector.size() << std::endl;
197 for ( ;sort_begin != sort_end; ++sort_begin ) {
198 dcollector.push_back(*sort_begin);
200 if (dcollector.size()>0) {
205 std::cout <<
" FP420ClusterMain: channel Begin = " << (digiRangeIteratorBegin)->channel() << std::endl;
206 std::cout <<
" FP420ClusterMain: channel end = " << (digiRangeIteratorEnd-1)->channel() << std::endl;
209 std::cout <<
" FP420ClusterMain:3 noise treatment " << std::endl;
213 std::vector<ClusterFP420> collector;
232 for(
int electrode=0; electrode <
numStrips; ++electrode){
235 theElectrodData.
setData(noise,badFlag);
236 vnoise.push_back(theElectrodData);
240 std::cout <<
" FP420ClusterMain:5 BadElectrodeProbability added " << std::endl;
250 std::cout <<
" FP420ClusterMain:6 threeThreshold OK " << std::endl;
270 if (collector.size()>0){
272 inputRange.first = collector.begin();
273 inputRange.second = collector.end();
276 std::cout <<
" FP420ClusterMain:7 collector.size()>0 " << std::endl;
281 unsigned int detID0 = 0;
283 std::cout <<
" FP420ClusterMain:8 first soutput->put " << std::endl;
285 soutput->put(inputRange,detID0);
290 std::cout <<
" FP420ClusterMain:9 soutput->put " << std::endl;
292 soutput->put(inputRange,detID);
294 number_localelectroderechits += collector.size();
298 std::cout <<
"[FP420ClusterMain] execution in mode " <<
clusterMode_ <<
" generating " << number_localelectroderechits <<
" ClusterFP420s in " << number_detunits <<
" DetUnits." << std::endl;
309 for (
int det=1; det<
dn0; det++) {
310 for (
int sector=1; sector<
sn0; sector++) {
311 for (
int zmodule=1; zmodule<
pn0; zmodule++) {
312 for (
int zside=1; zside<
rn0; zside++) {
314 unsigned int iu =
theFP420NumberingScheme->FP420NumberingScheme::packMYIndex(rn0, pn0, sn0, det, zside, sector, zmodule);
315 std::cout <<
" iu = " << iu <<
" sector = " << sector <<
" zmodule = " << zmodule <<
" zside = " << zside <<
" det=" << det << std::endl;
316 std::vector<ClusterFP420> collector;
319 outputRange = soutput->get(iu);
323 for ( ;sort_begin != sort_end; ++sort_begin ) {
324 collector.push_back(*sort_begin);
328 std::cout <<
" =========== FP420ClusterMain:check: iu= " << iu <<
" zside = " << zside << std::endl;
329 std::cout <<
" ======renew collector size = " << collector.size() << std::endl;
332 std::vector<ClusterFP420>::const_iterator simHitIter = collector.begin();
333 std::vector<ClusterFP420>::const_iterator simHitIterEnd = collector.end();
335 for (;simHitIter != simHitIterEnd; ++simHitIter) {
342 for(
unsigned int i = 0;
i < icluster.
amplitudes().size();
i++ ) {
347 std::cout <<
" =======================" << std::endl;
366 std::cout <<
"======= FP420ClusterMain: end of check " << std::endl;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
inputRange
Get input source.
void run(edm::Handle< DigiCollectionFP420 > &input, std::auto_ptr< ClusterCollectionFP420 > &soutput, std::vector< ClusterNoiseFP420 > &noise)
Runs the algorithm.
std::vector< ClusterFP420 >::const_iterator ContainerIterator
ClusterProducerFP420 * threeThreshold_
std::vector< HDigiFP420 >::const_iterator ContainerIterator
std::vector< ClusterNoiseFP420::ElectrodData > ElectrodNoiseVector
const std::vector< short > & amplitudes() const
double BadElectrodeProbability_
static std::string const input
float barycenterW() const
std::pair< ContainerIterator, ContainerIterator > Range
FP420NumberingScheme * theFP420NumberingScheme
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