85 : input_(iConfig.getUntrackedParameter<
std::
string>(
"inputtowers",
"")),
86 basicjets_(iConfig.getUntrackedParameter<
std::
string>(
"basicjets",
"")),
87 clusteralgo_(iConfig.getUntrackedParameter<
bool>(
"ClusterAlgo",
false)) {
93 produces<CastorClusterCollection>();
109 using namespace reco;
110 using namespace TMath;
112 LogDebug(
"CastorClusterProducer") <<
"3. entering CastorClusterProducer";
120 auto OutputClustersfromClusterAlgo = std::make_unique<CastorClusterCollection>();
123 int nTowers = InputTowers->size();
126 LogDebug(
"CastorClusterProducer") <<
"Warning: You are trying to run the Cluster algorithm with 0 input towers.";
130 for (
size_t i = 0;
i < InputTowers->size(); ++
i) {
132 if (tower_p->eta() > 0.)
134 if (tower_p->eta() < 0.)
152 auto OutputClustersfromBasicJets = std::make_unique<CastorClusterCollection>();
154 if (bjCollection->empty())
156 <<
"Warning: You are trying to run the Cluster algorithm with 0 input basicjets.";
158 for (
unsigned i = 0;
i < bjCollection->size();
i++) {
159 const BasicJet* bj = &(*bjCollection)[
i];
164 double emEnergy = 0.;
165 double hadEnergy = 0.;
175 std::vector<CandidatePtr>::const_iterator itParticle;
176 for (itParticle = ccp.begin(); itParticle != ccp.end(); ++itParticle) {
177 const CastorTower* castorcand = dynamic_cast<const CastorTower*>(itParticle->get());
188 for (
size_t l = 0;
l < ctCollection->size();
l++) {
201 fhot += castorcand->
fhot() * castorcand->
energy();
208 double Erechit = rechit_p->energy();
210 int module =
id.module();
213 zrechit = -14390 - 24.75 - 49.5 * (module - 1);
215 zrechit = -14390 - 99 - 49.5 - 99 * (module - 3);
216 zmean += Erechit * zrechit;
217 z2mean += Erechit * zrechit * zrechit;
228 double sigmaz2 = z2mean - zmean * zmean;
230 sigmaz =
sqrt(sigmaz2);
234 OutputClustersfromBasicJets->push_back(
cc);
243 double phi = testphi;