1 #include "../interface/ClusterTask.h"
44 lowEMax_ = taskParams.getUntrackedParameter<
double>(
"lowEMax");
59 throw cms::Exception(
"EventSetup") <<
"CaloTopology missing" << std::endl;
66 throw cms::Exception(
"EventSetup") <<
"CaloSubdetectorGeometry missing" << std::endl;
85 MEs_[
kBCE]->setAxisTitle(
"energy (GeV)", 1);
86 MEs_[
kBCNum]->setAxisTitle(
"number of clusters", 1);
87 MEs_[
kBCSize]->setAxisTitle(
"number of clusters", 1);
88 MEs_[
kSCE]->setAxisTitle(
"energy (GeV)", 1);
93 MEs_[
kSCNum]->setAxisTitle(
"number of clusters", 1);
97 MEs_[
kPi0]->setAxisTitle(
"mass (GeV)", 1);
98 MEs_[
kJPsi]->setAxisTitle(
"mass (GeV)", 1);
99 MEs_[
kZ]->setAxisTitle(
"mass (GeV)", 1);
102 for(
int i(0);
i < 2;
i++)
109 for(
int iFED(0); iFED < 54; iFED++){
144 vector<reco::BasicCluster const*> lowMassCands;
146 for(reco::BasicClusterCollection::const_iterator bcItr(_bcs.begin()); bcItr != _bcs.end(); ++bcItr){
154 id = subgeom->getClosestCell(gp);
157 if(
id.null() || (
id.subdetId() ==
EcalBarrel && !isBarrel) || (
id.subdetId() ==
EcalEndcap && isBarrel))
continue;
159 float energy(bcItr->energy());
171 float size(bcItr->size());
179 int zside(
position.z() > 0 ? 1 : 0);
184 if(
energy > 10.)
continue;
190 if(hitItr->energy() < 0.5)
continue;
192 if(hitItr->energy() /
energy > 0.95)
continue;
194 lowMassCands.push_back(&(*bcItr));
206 for(vector<reco::BasicCluster const*>::iterator bcItr1(lowMassCands.begin()); bcItr1 != lowMassCands.end(); ++bcItr1){
208 float energy1(bc1.energy());
209 float px1(energy1 *
sin(bc1.position().theta()) *
cos(bc1.phi()));
210 float py1(energy1 *
sin(bc1.position().theta()) *
sin(bc1.phi()));
211 float pz1(energy1 *
cos(bc1.position().theta()));
213 for(vector<reco::BasicCluster const*>::iterator bcItr2(lowMassCands.begin()); bcItr2 != lowMassCands.end(); ++bcItr2){
214 if(*bcItr1 == *bcItr2)
continue;
216 float energy2(bc2.energy());
217 float px2(energy2 *
sin(bc2.position().theta()) *
cos(bc2.phi()));
218 float py2(energy2 *
sin(bc2.position().theta()) *
sin(bc2.phi()));
219 float pz2(energy2 *
cos(bc2.position().theta()));
221 float ptpair(
sqrt((px1 + px2) * (px1 + px2) + (py1 + py2) * (py1 + py2)));
222 if(ptpair < 2.5)
continue;
224 float epair(energy1 + energy2);
225 float pzpair(
abs(pz1 + pz2));
227 if(epair < pzpair + 1.
e-10)
continue;
228 float eta(0.5 *
log((epair + pzpair)/(epair - pzpair)));
229 float phi(atan2(px1 + px2, py1 + py2));
232 for(reco::BasicClusterCollection::const_iterator bcItr(_bcs.begin()); bcItr != _bcs.end(); ++bcItr){
233 float dEta(bcItr->eta() -
eta);
234 float dPhi(bcItr->phi() -
phi);
235 if(
sqrt(dEta * dEta +
dPhi *
dPhi) < 0.2) iso += bcItr->energy() *
sin(bcItr->position().theta());
237 if(iso > 0.5)
continue;
239 float mass(
sqrt(epair * epair - pzpair * pzpair - ptpair * ptpair));
266 for(reco::SuperClusterCollection::const_iterator scItr(_scs.begin()); scItr != _scs.end(); ++scItr){
269 DetId id(scItr->seed()->seed());
274 id = subgeom->getClosestCell(gp);
277 if(
id.null() || (
id.subdetId() ==
EcalBarrel && !isBarrel) || (
id.subdetId() ==
EcalEndcap && isBarrel))
continue;
279 float energy(scItr->energy());
289 if(seedItr == hits->
end())
continue;
302 int zside(
position.z() > 0 ? 1 : 0);
307 float et(
energy *
sin(scItr->position().theta()));
309 subLeading = leading;
312 else if(!subLeading || et > subLeading->
energy() *
sin(subLeading->
position().theta())){
313 subLeading = &(*scItr);
327 if(!leading || !subLeading)
return;
332 float mass(
sqrt(
e *
e - px * px - py * py - pz * pz));
const math::XYZPoint & position() const
cluster centroid position
std::vector< std::pair< Collections, Collections > > dependencies_
#define DEFINE_ECALDQM_WORKER(TYPE)
const EcalRecHitCollection * eeHits_
bool filterRunType(const std::vector< short > &)
Sin< T >::type sin(const T &t)
std::vector< EcalRecHit >::const_iterator const_iterator
const CaloSubdetectorGeometry * eeGeometry_
static void setMEData(std::vector< MEData > &)
void beginEvent(const edm::Event &, const edm::EventSetup &)
double dPhi(double phi1, double phi2)
const EcalRecHitCollection * ebHits_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void beginRun(const edm::Run &, const edm::EventSetup &)
void runOnRecHits(const EcalRecHitCollection &, Collections)
Cos< T >::type cos(const T &t)
double energy() const
cluster energy
void runOnSuperClusters(const reco::SuperClusterCollection &, Collections)
const_iterator end() const
std::vector< MESet * > MEs_
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
const CaloTopology * topology_
iterator find(key_type k)
ClusterTask(const edm::ParameterSet &, const edm::ParameterSet &)
static int position[264][3]
void runOnBasicClusters(const reco::BasicClusterCollection &, Collections)
double phi() const
azimuthal angle of cluster centroid
tuple size
Write out results.
const CaloSubdetectorGeometry * ebGeometry_