112 using namespace reco;
113 using namespace TMath;
116 <<
"3. entering CastorClusterProducer";
128 int nTowers = InputTowers->size();
130 if (nTowers==0)
LogDebug(
"CastorClusterProducer")<<
"Warning: You are trying to run the Cluster algorithm with 0 input towers.";
134 for (
size_t i = 0;
i < InputTowers->size(); ++
i) {
136 if (tower_p->eta() > 0.) posInputTowers.
push_back(tower_p);
137 if (tower_p->eta() < 0.) negInputTowers.
push_back(tower_p);
143 iEvent.
put(OutputClustersfromClusterAlgo);
154 iEvent.
getByLabel(
"CastorTowerReco",ctCollection);
158 if (bjCollection->size()==0)
LogDebug(
"CastorClusterProducer")<<
"Warning: You are trying to run the Cluster algorithm with 0 input basicjets.";
160 for (
unsigned i=0;
i< bjCollection->size();
i++) {
161 const BasicJet* bj = &(*bjCollection)[
i];
166 double emEnergy = 0.;
167 double hadEnergy = 0.;
177 std::vector<CandidatePtr>::const_iterator itParticle;
178 for (itParticle=ccp.begin();itParticle!=ccp.end();++itParticle){
190 for (
size_t l=0;
l<ctCollection->size();
l++) {
201 fhot += castorcand->
fhot()*castorcand->
energy();
206 double Erechit = rechit_p->energy();
210 if (module < 3) zrechit = -14390 - 24.75 - 49.5*(module-1);
211 if (module > 2) zrechit = -14390 - 99 - 49.5 - 99*(module-3);
212 zmean += Erechit*zrechit;
213 z2mean += Erechit*zrechit*zrechit;
219 width =
sqrt(width/energy);
224 double sigmaz2 = z2mean - zmean*zmean;
225 if(sigmaz2 > 0) sigmaz =
sqrt(sigmaz2);
227 CastorCluster cc(energy,
position,emEnergy,hadEnergy,emEnergy/energy,width,depth,fhot,sigmaz,usedTowers);
228 OutputClustersfromBasicJets->push_back(cc);
231 iEvent.
put(OutputClustersfromBasicJets);
double emEnergy() const
tower em energy
virtual double energy() const GCC11_FINAL
energy
std::vector< CastorCluster > CastorClusterCollection
collection of CastorCluster objects
double phiangle(double testphi)
edm::Ref< CastorTowerCollection > CastorTowerRef
CastorRecHitRefs::iterator rechitsBegin() const
fist iterator over CastorRecHit constituents
Jets made from CaloTowers.
static int position[TOTALCHAMBERS][3]
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ROOT::Math::RhoEtaPhiPoint TowerPoint
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
double fhot() const
tower hotcell/tot ratio
double depth() const
tower depth in z
double hadEnergy() const
tower had energy
CastorRecHitRefs::iterator rechitsEnd() const
last iterator over CastorRecHit constituents
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
ProductID id() const
Accessor for product ID.
Power< A, B >::type pow(const A &a, const B &b)
virtual Constituents getJetConstituents() const
list of constituents