117 using namespace reco;
118 using namespace TMath;
121 <<
"3. entering CastorClusterProducer";
130 auto OutputClustersfromClusterAlgo = std::make_unique<CastorClusterCollection>();
133 int nTowers = InputTowers->size();
135 if (nTowers==0)
LogDebug(
"CastorClusterProducer")<<
"Warning: You are trying to run the Cluster algorithm with 0 input towers.";
139 for (
size_t i = 0;
i < InputTowers->size(); ++
i) {
141 if (tower_p->eta() > 0.) posInputTowers.
push_back(tower_p);
142 if (tower_p->eta() < 0.) negInputTowers.
push_back(tower_p);
161 auto OutputClustersfromBasicJets = std::make_unique<CastorClusterCollection>();
163 if (bjCollection->empty())
LogDebug(
"CastorClusterProducer")<<
"Warning: You are trying to run the Cluster algorithm with 0 input basicjets.";
165 for (
unsigned i=0;
i< bjCollection->size();
i++) {
166 const BasicJet* bj = &(*bjCollection)[
i];
168 double energy = bj->
energy();
171 double emEnergy = 0.;
172 double hadEnergy = 0.;
182 std::vector<CandidatePtr>::const_iterator itParticle;
183 for (itParticle=ccp.begin();itParticle!=ccp.end();++itParticle){
195 for (
size_t l=0;
l<ctCollection->size();
l++) {
206 fhot += castorcand->
fhot()*castorcand->
energy();
211 double Erechit = rechit_p->energy();
215 if (module < 3) zrechit = -14390 - 24.75 - 49.5*(module-1);
216 if (module > 2) zrechit = -14390 - 99 - 49.5 - 99*(module-3);
217 zmean += Erechit*zrechit;
218 z2mean += Erechit*zrechit*zrechit;
223 depth = depth/energy;
224 width =
sqrt(width/energy);
227 zmean = zmean/energy;
228 z2mean = z2mean/energy;
229 double sigmaz2 = z2mean - zmean*zmean;
230 if(sigmaz2 > 0) sigmaz =
sqrt(sigmaz2);
232 CastorCluster cc(energy,
position,emEnergy,hadEnergy,emEnergy/energy,width,depth,fhot,sigmaz,usedTowers);
233 OutputClustersfromBasicJets->push_back(cc);
edm::EDGetTokenT< CastorTowerCollection > tok_input_
double emEnergy() const
tower em energy
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< CastorTowerCollection > tok_tower_
double phiangle(double testphi)
edm::Ref< CastorTowerCollection > CastorTowerRef
CastorRecHitRefs::iterator rechitsBegin() const
fist iterator over CastorRecHit constituents
virtual Constituents getJetConstituents() const
list of constituents
Jets made from CaloTowers.
ProductID id() const
Accessor for product ID.
double energy() const final
energy
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< reco::BasicJetCollection > tok_jets_
ROOT::Math::RhoEtaPhiPoint TowerPoint
double fhot() const
tower hotcell/tot ratio
double depth() const
tower depth in z
double hadEnergy() const
tower had energy
Structure Point Contains parameters of Gaussian fits to DMRs.
static int position[264][3]
CastorRecHitRefs::iterator rechitsEnd() const
last iterator over CastorRecHit constituents
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
double phi() const final
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)