87 input_(iConfig.getUntrackedParameter<std::
string>(
"inputtowers",
"")),
88 basicjets_(iConfig.getUntrackedParameter<std::
string>(
"basicjets",
"")),
89 clusteralgo_(iConfig.getUntrackedParameter<bool>(
"ClusterAlgo",
false))
92 produces<CastorClusterCollection>();
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);
239 double phi = testphi;
248 <<
"Starting CastorClusterProducer";
254 <<
"Ending CastorClusterProducer";
double emEnergy() const
tower em energy
virtual double energy() const GCC11_FINAL
energy
#define DEFINE_FWK_MODULE(type)
virtual void produce(edm::Event &, const edm::EventSetup &)
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]
CastorClusterProducer(const edm::ParameterSet &)
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< reco::CastorCluster > CastorClusterCollection
std::vector< reco::CastorTower > CastorTowerCollection
ROOT::Math::RhoEtaPhiPoint TowerPoint
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
ROOT::Math::RhoZPhiPoint CellPoint
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double > > XYZPointD
point in space with cartesian internal representation
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