112 for (
unsigned int i=0;
i<tp.product()->size();
i++) {
146 theEndcapGeometry = &(*theEndcapGeometry_handle);
147 theBarrelGeometry = &(*theBarrelGeometry_handle);
151 map<EcalTrigTowerDetId, float> mapTow_Et;
154 for (
unsigned int i=0;
i<rechit_EB_col.product()->size();
i++) {
155 const EBDetId & myid1=(*rechit_EB_col.product())[
i].
id();
157 float theta = theBarrelGeometry->getGeometry(myid1)->getPosition().theta();
158 float Etsum=((*rechit_EB_col.product())[
i].
energy())*
sin(theta);
159 bool test_alreadyin=
false;
160 map<EcalTrigTowerDetId, float>::iterator ittest= mapTow_Et.find(towid1);
161 if (ittest!= mapTow_Et.end()) test_alreadyin=
true;
162 if (test_alreadyin)
continue;
165 unsigned int count=0;
166 while( j<rechit_EB_col.product()->size() && !loopend){
168 const EBDetId & myid2=(*rechit_EB_col.product())[j].
id();
170 if( towid1==towid2 ) {
171 float theta=theBarrelGeometry->getGeometry(myid2)->getPosition().theta();
172 Etsum += (*rechit_EB_col.product())[j].
energy()*
sin(theta);
175 if (count>1800) loopend=
true;
177 mapTow_Et.insert(pair<EcalTrigTowerDetId,float>(towid1, Etsum));
181 for (
unsigned int i=0;
i<rechit_EE_col.product()->size();
i++) {
182 const EEDetId & myid1=(*rechit_EE_col.product())[
i].
id();
184 float theta=theEndcapGeometry->getGeometry(myid1)->getPosition().theta();
185 float Etsum=(*rechit_EE_col.product())[
i].
energy()*
sin(theta);
186 bool test_alreadyin=
false;
187 map<EcalTrigTowerDetId, float>::iterator ittest= mapTow_Et.find(towid1);
188 if (ittest!= mapTow_Et.end()) test_alreadyin=
true;
189 if (test_alreadyin)
continue;
192 unsigned int count=0;
193 while( j<rechit_EE_col.product()->size() && !loopend){
194 const EEDetId & myid2=(*rechit_EE_col.product())[j].
id();
196 if( towid1==towid2 ) {
197 float theta=theEndcapGeometry->getGeometry(myid2)->getPosition().theta();
198 Etsum += (*rechit_EE_col.product())[j].
energy()*
sin(theta);
202 if (count>500) loopend=
true;
205 mapTow_Et.insert(pair<EcalTrigTowerDetId,float>(towid1, Etsum));
211 for (
unsigned int i=0;
i<tp.product()->size();
i++) {
214 map<EcalTrigTowerDetId, float>::iterator it= mapTow_Et.find(TPtowid);
215 float Et = ecalScale.getTPGInGeV(d.
compressedEt(), TPtowid) ;
223 if (it!= mapTow_Et.end()) {
void setEventSetup(const edm::EventSetup &evtSetup)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
int ieta() const
get the tower ieta
int compressedEt() const
get the encoded/compressed Et of interesting sample
int ietaAbs() const
get the absolute value of the tower ieta
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int iphi() const
get the tower iphi
const EcalTrigTowerDetId & id() const
edm::InputTag rechits_labelEE_
edm::InputTag rechits_labelEB_
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
bool fineGrain() const
get the fine-grain bit of interesting sample
int ttFlag() const
get the Trigger tower Flag of interesting sample