133 const std::vector<CaloParticle>&
caloParticles = *caloParticleHandle;
134 const int pdgId[3] = {11, 13, 22};
137 int mhit[3] = {0,0,0};
138 for (
auto it_caloPart = caloParticles.begin();
139 it_caloPart != caloParticles.end(); ++it_caloPart) {
140 double cut = (
cutOnPt_) ? it_caloPart->pt() : it_caloPart->energy();
143 if (
std::abs(it_caloPart->pdgId()) == pdgId[0])
type = 1;
144 else if (
std::abs(it_caloPart->pdgId()) == pdgId[1])
type = 2;
145 else if (it_caloPart->pdgId() == pdgId[2])
type = 3;
146 else if (it_caloPart->threeCharge() != 0)
type = 4;
154 float seedEnergy = 0.;
155 int simClusterCount = 0;
157 for (
const auto & simCluster : simClusterRefVector) {
160 std::cout <<
">>> simCluster.energy() = " << simCluster->energy() << std::endl;
162 const std::vector<std::pair<uint32_t,float> > hits_and_fractions = simCluster->hits_and_fractions();
165 for (
auto it_haf = hits_and_fractions.begin();
166 it_haf != hits_and_fractions.end(); ++it_haf) {
168 DetId hitid = (it_haf->first);
173 (
algo_ == 1 || algo_ == 2)) {
176 for (
auto it_hit = rechitsEE.
begin();
177 it_hit < rechitsEE.
end(); ++it_hit) {
180 if (detid == hitid) {
182 if (hitlayer != layer) {
184 std::cout <<
" recHit ID problem EE " << std::endl;
191 if(seedEnergy < it_hit->energy()){
192 seedEnergy = it_hit->energy();
198 if (!
found) ++mhit[0];
201 (algo_ == 1 || algo_ == 3)) {
204 for (
auto it_hit = rechitsFH.
begin();
205 it_hit < rechitsFH.
end(); ++it_hit) {
208 if (detid == hitid) {
210 if (hitlayer != layer) {
212 std::cout <<
" recHit ID problem FH " << std::endl;
219 if(seedEnergy < it_hit->energy()){
220 seedEnergy = it_hit->energy();
226 if (!
found) ++mhit[1];
229 (algo_ == 1 || algo_ == 3)) {
232 for (
auto it_hit = rechitsBH.
begin();
233 it_hit < rechitsBH.
end(); ++it_hit) {
236 if (detid == hitid) {
238 if (hitlayer != layer) {
240 std::cout <<
" recHit ID problem BH " << std::endl;
247 if (seedEnergy < it_hit->energy()){
248 seedEnergy = it_hit->energy();
254 if (!
found) ++mhit[2];
261 float sumCalibRecHitCalib_fraction = 0;
266 double ebyp = sumCalibRecHitCalib_fraction / it_caloPart->energy();
270 }
else if (seedDet == 200) {
273 }
else if (seedDet == 300){
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< HGCRecHitCollection > _recHitsBH
edm::EDGetTokenT< std::vector< CaloParticle > > _caloParticles
edm::EDGetTokenT< HGCRecHitCollection > _recHitsFH
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Abs< T >::type abs(const T &t)
TH1F * h_LayerOccupancy_[6]
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
TH1F * h_EoP_CPene_300_calib_fraction_[6]
const_iterator end() const
edm::EDGetTokenT< HGCRecHitCollection > _recHitsEE
std::vector< float > Energy_layer_calib_fraction
hgcal::RecHitTools recHitTools
TH1F * h_EoP_CPene_200_calib_fraction_[6]
std::vector< float > Energy_layer_calib
Detector det() const
get the detector field from this detid
TH1F * h_EoP_CPene_100_calib_fraction_[6]
const_iterator begin() const