59 virtual void endJob()
override ;
89 input_(iConfig.getUntrackedParameter<std::
string>(
"inputtowers",
"")),
90 basicjets_(iConfig.getUntrackedParameter<std::
string>(
"basicjets",
"")),
91 clusteralgo_(iConfig.getUntrackedParameter<bool>(
"ClusterAlgo",
false))
98 produces<CastorClusterCollection>();
118 using namespace reco;
119 using namespace TMath;
122 <<
"3. entering CastorClusterProducer";
134 int nTowers = InputTowers->size();
136 if (nTowers==0)
LogDebug(
"CastorClusterProducer")<<
"Warning: You are trying to run the Cluster algorithm with 0 input towers.";
140 for (
size_t i = 0;
i < InputTowers->size(); ++
i) {
142 if (tower_p->eta() > 0.) posInputTowers.
push_back(tower_p);
143 if (tower_p->eta() < 0.) negInputTowers.
push_back(tower_p);
149 iEvent.
put(OutputClustersfromClusterAlgo);
164 if (bjCollection->size()==0)
LogDebug(
"CastorClusterProducer")<<
"Warning: You are trying to run the Cluster algorithm with 0 input basicjets.";
166 for (
unsigned i=0;
i< bjCollection->size();
i++) {
167 const BasicJet* bj = &(*bjCollection)[
i];
172 double emEnergy = 0.;
173 double hadEnergy = 0.;
183 std::vector<CandidatePtr>::const_iterator itParticle;
184 for (itParticle=ccp.begin();itParticle!=ccp.end();++itParticle){
196 for (
size_t l=0;
l<ctCollection->size();
l++) {
207 fhot += castorcand->
fhot()*castorcand->
energy();
212 double Erechit = rechit_p->energy();
216 if (module < 3) zrechit = -14390 - 24.75 - 49.5*(module-1);
217 if (module > 2) zrechit = -14390 - 99 - 49.5 - 99*(module-3);
218 zmean += Erechit*zrechit;
219 z2mean += Erechit*zrechit*zrechit;
225 width =
sqrt(width/energy);
230 double sigmaz2 = z2mean - zmean*zmean;
231 if(sigmaz2 > 0) sigmaz =
sqrt(sigmaz2);
233 CastorCluster cc(energy,position,emEnergy,hadEnergy,emEnergy/energy,width,depth,fhot,sigmaz,usedTowers);
234 OutputClustersfromBasicJets->push_back(cc);
237 iEvent.
put(OutputClustersfromBasicJets);
245 double phi = testphi;
254 <<
"Starting CastorClusterProducer";
260 <<
"Ending CastorClusterProducer";
edm::EDGetTokenT< CastorTowerCollection > tok_input_
double emEnergy() const
tower em energy
virtual double energy() const GCC11_FINAL
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
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
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
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.
volatile std::atomic< bool > shutdown_flag false
Power< A, B >::type pow(const A &a, const B &b)
virtual Constituents getJetConstituents() const
list of constituents