once again. check FED of this det.
110 int nhbherechits = 0;
116 myebrechits = * ebrechits;
118 nebrechits = myebrechits.
size();
119 float ebrechitenergy = -1.0;
123 for (ebrechititer
i=myebrechits.
begin();
i!=myebrechits.
end();
i++) {
124 ebrechitenergy =
i->energy();
129 else {nebrechits = 0;}
133 myeerechits = * eerechits;
135 neerechits = myeerechits.
size();
136 float eerechitenergy = -1.0;
140 for (eerechititer
i=myeerechits.
begin();
i!=myeerechits.
end();
i++) {
141 eerechitenergy =
i->energy();
146 else {neerechits = 0;}
150 myhbherechits = * hbherechits;
152 nhbherechits = myhbherechits.
size();
153 float hbherechitenergy = -1.0;
157 for (hbherechititer
i=myhbherechits.
begin();
i!=myhbherechits.
end();
i++) {
158 hbherechitenergy =
i->energy();
163 else {nhbherechits = 0;}
167 myhorechits = * horechits;
169 nhorechits = myhorechits.
size();
170 float horechitenergy = -1.0;
174 for (horechititer
i=myhorechits.
begin();
i!=myhorechits.
end();
i++) {
175 horechitenergy =
i->energy();
180 else {nhorechits = 0;}
184 myhfrechits = * hfrechits;
186 nhfrechits = myhfrechits.
size();
187 float hfrechitenergy = -1.0;
191 for (hfrechititer
i=myhfrechits.
begin();
i!=myhfrechits.
end();
i++) {
192 hfrechitenergy =
i->energy();
197 else {nhfrechits = 0;}
221 std::vector<int>::iterator it;
224 for( l1extra::L1EmParticleCollection::const_iterator emItr = l1EGIso->begin();
225 emItr != l1EGIso->end() ;++emItr ){
227 float pt = emItr -> pt();
231 int etaIndex = emItr->gctEmCand()->etaIndex() ;
232 int phiIndex = emItr->gctEmCand()->phiIndex() ;
233 double etaLow = l1CaloGeom->etaBinLowEdge( etaIndex ) ;
234 double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ;
235 double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
236 double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
239 for (
int n=0;
n < (int)feds.size();
n++) {
248 for( l1extra::L1EmParticleCollection::const_iterator emItr = l1EGNonIso->begin();
249 emItr != l1EGNonIso->end() ;++emItr ){
251 float pt = emItr -> pt();
255 int etaIndex = emItr->gctEmCand()->etaIndex() ;
256 int phiIndex = emItr->gctEmCand()->phiIndex() ;
257 double etaLow = l1CaloGeom->etaBinLowEdge( etaIndex ) ;
258 double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ;
259 double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
260 double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
263 for (
int n=0;
n < (int)feds.size();
n++) {
278 for (l1extra::L1JetParticleCollection::const_iterator jetItr=l1extjetc->begin(); jetItr != l1extjetc->end(); jetItr++) {
280 double pt = jetItr-> pt();
281 double eta = jetItr->
eta();
282 double phi = jetItr->
phi();
287 for (
int n=0;
n < (int)feds.size();
n++) {
300 for (l1extra::L1JetParticleCollection::const_iterator jetItr=l1extjetf->begin(); jetItr != l1extjetf->end(); jetItr++) {
302 double pt = jetItr -> pt();
303 double eta = jetItr ->
eta();
304 double phi = jetItr ->
phi();
310 for (
int n=0;
n < (int)feds.size();
n++) {
323 for (l1extra::L1JetParticleCollection::const_iterator jetItr=l1exttaujet->begin(); jetItr != l1exttaujet->end(); jetItr++) {
325 double pt = jetItr -> pt();
326 double eta = jetItr ->
eta();
327 double phi = jetItr ->
phi();
332 for (
int n=0;
n < (int)feds.size();
n++) {
352 if( fed >= 10 && fed <= 45){
363 std::vector<EcalRecHit> seeds;
366 std::vector<EBDetId> usedXtals;
378 for (itb=pi0ebrechits->begin(); itb!=pi0ebrechits->end(); itb++) {
379 double energy = itb->energy();
397 std::vector<float> eClus;
398 std::vector<float> etClus;
399 std::vector<float> etaClus;
400 std::vector<float> phiClus;
401 std::vector<EBDetId> max_hit;
402 std::vector< std::vector<EcalRecHit> > RecHitsCluster;
403 std::vector<float> s4s9Clus;
413 for (std::vector<EcalRecHit>::iterator itseed=seeds.begin(); itseed!=seeds.end(); itseed++) {
414 EBDetId seed_id = itseed->id();
415 std::vector<EBDetId>::const_iterator usedIds;
417 bool seedAlreadyUsed=
false;
418 for(usedIds=usedXtals.begin(); usedIds!=usedXtals.end(); usedIds++){
419 if(*usedIds==seed_id){
420 seedAlreadyUsed=
true;
425 if(seedAlreadyUsed)
continue;
428 std::vector< std::pair<DetId, float> > clus_used;
430 std::vector<EcalRecHit> RecHitsInWindow;
432 double simple_energy = 0;
434 for (std::vector<DetId>::iterator det=clus_v.begin(); det!=clus_v.end(); det++) {
437 bool HitAlreadyUsed=
false;
438 for(usedIds=usedXtals.begin(); usedIds!=usedXtals.end(); usedIds++){
445 if(HitAlreadyUsed)
continue;
459 usedXtals.push_back(*det);
460 RecHitsInWindow.push_back(
EBRecHits[nn]);
461 clus_used.push_back( std::pair<DetId, float>(*det, 1) );
462 simple_energy = simple_energy +
EBRecHits[nn].energy();
467 float theta_s = 2. * atan(
exp(-clus_pos.eta()));
468 float p0x_s = simple_energy *
sin(theta_s) *
cos(clus_pos.phi());
469 float p0y_s = simple_energy *
sin(theta_s) *
sin(clus_pos.phi());
470 float et_s =
sqrt( p0x_s*p0x_s + p0y_s*p0y_s);
472 eClus.push_back(simple_energy);
473 etClus.push_back(et_s);
474 etaClus.push_back(clus_pos.eta());
475 phiClus.push_back(clus_pos.phi());
476 max_hit.push_back(seed_id);
477 RecHitsCluster.push_back(RecHitsInWindow);
484 for(
int i=0;
i<4;
i++)s4s9_tmp[
i]= 0;
486 int seed_ieta = seed_id.
ieta();
487 int seed_iphi = seed_id.
iphi();
491 for(
unsigned int j=0;
j<RecHitsInWindow.size();
j++){
494 int ieta = det.
ieta();
495 int iphi = det.
iphi();
499 float en = RecHitsInWindow[
j].energy();
504 if(dx <= 0 && dy <=0) s4s9_tmp[0] += en;
505 if(dx >= 0 && dy <=0) s4s9_tmp[1] += en;
506 if(dx <= 0 && dy >=0) s4s9_tmp[2] += en;
507 if(dx >= 0 && dy >=0) s4s9_tmp[3] += en;
510 float s4s9_max = *std::max_element( s4s9_tmp,s4s9_tmp+4)/simple_energy;
511 s4s9Clus.push_back(s4s9_max);
535 std::vector<EcalRecHit> seedsEndCap;
538 std::vector<EEDetId> usedXtalsEndCap;
539 usedXtalsEndCap.clear();
543 for (ite=pi0eerechits->begin(); ite!=pi0eerechits->end(); ite++) {
544 double energy = ite->energy();
550 int fed = elid.
dccId();
567 std::vector<float> eClusEndCap;
568 std::vector<float> etClusEndCap;
569 std::vector<float> etaClusEndCap;
570 std::vector<float> phiClusEndCap;
571 std::vector< std::vector<EcalRecHit> > RecHitsClusterEndCap;
572 std::vector<float> s4s9ClusEndCap;
578 for (std::vector<EcalRecHit>::iterator itseed=seedsEndCap.begin(); itseed!=seedsEndCap.end(); itseed++) {
579 EEDetId seed_id = itseed->id();
580 std::vector<EEDetId>::const_iterator usedIds;
582 bool seedAlreadyUsed=
false;
583 for(usedIds=usedXtalsEndCap.begin(); usedIds!=usedXtalsEndCap.end(); usedIds++){
584 if(*usedIds==seed_id){
585 seedAlreadyUsed=
true;
590 if(seedAlreadyUsed)
continue;
593 std::vector< std::pair<DetId, float> > clus_used;
595 std::vector<EcalRecHit> RecHitsInWindow;
597 double simple_energy = 0;
599 for (std::vector<DetId>::iterator det=clus_v.begin(); det!=clus_v.end(); det++) {
602 bool HitAlreadyUsed=
false;
603 for(usedIds=usedXtalsEndCap.begin(); usedIds!=usedXtalsEndCap.end(); usedIds++){
610 if(HitAlreadyUsed)
continue;
615 int fed = elid.
dccId();
624 usedXtalsEndCap.push_back(*det);
625 RecHitsInWindow.push_back(
EERecHits[nn]);
626 clus_used.push_back( std::pair<DetId, float>(*det, 1) );
627 simple_energy = simple_energy +
EERecHits[nn].energy();
632 float theta_s = 2. * atan(
exp(-clus_pos.eta()));
633 float p0x_s = simple_energy *
sin(theta_s) *
cos(clus_pos.phi());
634 float p0y_s = simple_energy *
sin(theta_s) *
sin(clus_pos.phi());
635 float et_s =
sqrt( p0x_s*p0x_s + p0y_s*p0y_s);
637 eClusEndCap.push_back(simple_energy);
638 etClusEndCap.push_back(et_s);
639 etaClusEndCap.push_back(clus_pos.eta());
640 phiClusEndCap.push_back(clus_pos.phi());
641 RecHitsClusterEndCap.push_back(RecHitsInWindow);
646 for(
int i=0;
i<4;
i++) s4s9_tmp[
i]= 0;
648 int ixSeed = seed_id.
ix();
649 int iySeed = seed_id.
iy();
650 for(
unsigned int j=0;
j<RecHitsInWindow.size();
j++){
652 int dx = ixSeed - det_this.
ix();
653 int dy = iySeed - det_this.
iy();
655 float en = RecHitsInWindow[
j].energy();
657 if(dx <= 0 && dy <=0) s4s9_tmp[0] += en;
658 if(dx >= 0 && dy <=0) s4s9_tmp[1] += en;
659 if(dx <= 0 && dy >=0) s4s9_tmp[2] += en;
660 if(dx >= 0 && dy >=0) s4s9_tmp[3] += en;
663 float s4s9_max = *std::max_element( s4s9_tmp,s4s9_tmp+4)/simple_energy;
664 s4s9ClusEndCap.push_back(s4s9_max);
681 Nalcapi0clusters = 0;
EcalElectronicsMapping * TheMapping
double JETSregionPhiMargin_
const CaloSubdetectorGeometry * geometry_es
std::vector< EEDetId > detIdEERecHits
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
float ohHighestEnergyHFRecHit
Sin< T >::type sin(const T &t)
double JETSregionEtaMargin_
std::vector< T >::const_iterator const_iterator
Exp< T >::type exp(const T &t)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< EBDetId > detIdEBRecHits
std::vector< EcalRecHit > EBRecHits
int diff_nphi_s(Int_t nphi1, Int_t nphi2)
int iphi() const
get the crystal iphi
int diff_neta_s(Int_t neta1, Int_t neta2)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
double EMregionPhiMargin_
double seleXtalMinEnergy_
float ohHighestEnergyHORecHit
Cos< T >::type cos(const T &t)
const CaloSubdetectorTopology * topology_ee
const CaloSubdetectorGeometry * geometry_ee
std::vector< int > FEDListUsed
int ieta() const
get the crystal ieta
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
void convxtalid(Int_t &nphi, Int_t &neta)
const_iterator end() const
float ohHighestEnergyEERecHit
std::vector< EcalRecHit > EERecHits
float ohHighestEnergyEBRecHit
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
double EMregionEtaMargin_
PositionCalc posCalculator_
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
int DCCid(const EBDetId &id) const
returns the DCC of an EBDetId
std::vector< int > ListOfFEDS(double etaLow, double etaHigh, double phiLow, double phiHigh, double etamargin, double phimargin)
double clusSeedThrEndCap_
T const * product() const
const CaloSubdetectorTopology * topology_eb
math::XYZPoint Calculate_Location(const std::vector< std::pair< DetId, float > > &iDetIds, const EcalRecHitCollection *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=0)
float ohHighestEnergyHBHERecHit
std::vector< int > FEDListUsedBarrel
const_iterator begin() const
std::vector< int > FEDListUsedEndcap
const CaloSubdetectorGeometry * geometry_eb