86 input_(iConfig.getUntrackedParameter<std::string>(
"inputtowers",
"")),
87 basicjets_(iConfig.getUntrackedParameter<std::string>(
"basicjets",
"")),
88 clusteralgo_(iConfig.getUntrackedParameter<bool>(
"ClusterAlgo",
false))
91 produces<CastorClusterCollection>();
111 using namespace reco;
112 using namespace TMath;
115 <<
"3. entering CastorClusterProducer";
127 int nTowers = InputTowers->size();
129 if (nTowers==0)
LogDebug(
"CastorClusterProducer")<<
"Warning: You are trying to run the Cluster algorithm with 0 input towers.";
133 for (
size_t i = 0;
i < InputTowers->size(); ++
i) {
135 if (tower_p->eta() > 0.) posInputTowers.
push_back(tower_p);
136 if (tower_p->eta() < 0.) negInputTowers.
push_back(tower_p);
142 iEvent.
put(OutputClustersfromClusterAlgo);
153 iEvent.
getByLabel(
"CastorTowerReco",ctCollection);
157 if (bjCollection->size()==0)
LogDebug(
"CastorClusterProducer")<<
"Warning: You are trying to run the Cluster algorithm with 0 input basicjets.";
159 for (
unsigned i=0;
i< bjCollection->size();
i++) {
160 const BasicJet* bj = &(*bjCollection)[
i];
165 double emEnergy = 0.;
166 double hadEnergy = 0.;
176 std::vector<CandidatePtr>::const_iterator itParticle;
177 for (itParticle=ccp.begin();itParticle!=ccp.end();++itParticle){
189 for (
size_t l=0;
l<ctCollection->size();
l++) {
200 fhot += castorcand->
fhot()*castorcand->
energy();
205 Point rcell = cell_p->position();
206 double Ecell = cell_p->energy();
207 zmean += Ecell*cell_p->z();
208 z2mean += Ecell*cell_p->z()*cell_p->z();
214 width =
sqrt(width/energy);
219 double sigmaz2 = z2mean - zmean*zmean;
220 if(sigmaz2 > 0) sigmaz =
sqrt(sigmaz2);
222 CastorCluster cc(energy,position,emEnergy,hadEnergy,emEnergy/energy,width,depth,fhot,sigmaz,usedTowers);
223 OutputClustersfromBasicJets->push_back(cc);
226 iEvent.
put(OutputClustersfromBasicJets);
234 double phi = testphi;
243 <<
"Starting CastorClusterProducer";
249 <<
"Ending CastorClusterProducer";
CastorCell_iterator cellsEnd() const
last iterator over CastorCell constituents
double emEnergy() const
tower em energy
#define DEFINE_FWK_MODULE(type)
virtual void produce(edm::Event &, const edm::EventSetup &)
CastorCell_iterator cellsBegin() const
fist iterator over CastorCell constituents
double phiangle(double testphi)
edm::Ref< CastorTowerCollection > CastorTowerRef
Jets made from CaloTowers.
virtual double eta() const
momentum pseudorapidity
static int position[TOTALCHAMBERS][3]
CastorClusterProducer(const edm::ParameterSet &)
virtual double energy() const
energy
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
double energy() const
tower energy
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
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
virtual double phi() const
momentum azimuthal angle
double phi() const
azimuthal angle of tower centroid
Power< A, B >::type pow(const A &a, const B &b)
virtual Constituents getJetConstituents() const
list of constituents