59 virtual void endJob()
override ;
88 input_(iConfig.getUntrackedParameter<std::
string>(
"inputtowers",
"")),
89 basicjets_(iConfig.getUntrackedParameter<std::
string>(
"basicjets",
"")),
90 clusteralgo_(iConfig.getUntrackedParameter<bool>(
"ClusterAlgo",
false))
97 produces<CastorClusterCollection>();
117 using namespace reco;
118 using namespace TMath;
121 <<
"3. entering CastorClusterProducer";
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);
148 iEvent.
put(OutputClustersfromClusterAlgo);
163 if (bjCollection->size()==0)
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];
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;
224 width =
sqrt(width/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);
236 iEvent.
put(OutputClustersfromBasicJets);
244 double phi = testphi;
253 <<
"Starting CastorClusterProducer";
259 <<
"Ending CastorClusterProducer";
edm::EDGetTokenT< CastorTowerCollection > tok_input_
double emEnergy() const
tower em energy
virtual void beginJob() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< CastorTowerCollection > tok_tower_
virtual void endJob() override
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.
virtual double eta() const
momentum pseudorapidity
ProductID id() const
Accessor for product ID.
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
Abs< T >::type abs(const T &t)
std::vector< reco::CastorTower > CastorTowerCollection
edm::EDGetTokenT< reco::BasicJetCollection > tok_jets_
ROOT::Math::RhoEtaPhiPoint TowerPoint
virtual void produce(edm::Event &, const edm::EventSetup &) override
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
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.
volatile std::atomic< bool > shutdown_flag false
virtual double phi() const
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)