 std::endl;
#endif
          }
        }
      }
    } else {
      analyzeHGCalSimHit(bhSimHits, 2, hebEnSim, bhHitRefs);
    }
#ifdef EDM_ML_DEBUG
    for (std::map<unsigned int, HGCHitTuple>::iterator itr = bhHitRefs.begin(); itr!= bhHitRefs.end(); ++itr) {
      int idx = std::distance(bhHitRefs.begin(), itr);
      edm::LogInfo("HGCalValid") << "BHHit[" << idx << "] " << std::hex << itr->first << std::dec << "; Energy "
                                 << std::get<0>(itr->second) << "; Position (" << std::get<1>(itr->second) << ", "
                                 << std::get<2>(itr->second) << ", " << std::get<3>(itr->second) << ")";
    }
#endif
  } else {
    edm::LogVerbatim("HGCalValid") << "No BH SimHit Found ";
  }

  //accessing EE Rechit information
  edm::Handle<HGCeeRecHitCollection> eeRecHit;
  iEvent.getByToken(eeRecHitToken_, eeRecHit);
  if (eeRecHit.isValid()) {
    const HGCeeRecHitCollection* theHits = (eeRecHit.product());
    for (auto it = theHits->begin(); it!= theHits->end(); ++it) {
      double energy = it->energy();
      heeEnRec->Fill(energy);
      std::map<unsigned int, HGCHitTuple>::const_iterator itr = eeHitRefs.find(it->id().rawId());
      if (itr!= eeHitRefs.end()) {
        GlobalPoint xyz = hgcGeometry_[0]->getPosition(it->id());
        heeRecVsSimX->Fill(std::get<1>(itr->second), xyz.x());
        heeRecVsSimY->Fill(std::get<2>(itr->second), xyz.
std::endl; 
 # endif 
           } 
         } 
       } 
     } else { 
       analyzeHGCalSimHit(bhSimHits, 2, hebEnSim, bhHitRefs); 
     } 
 # ifdef EDM_ML_DEBUG 
     for (std::map < unsigned int, HGCHitTuple>::iterator itr = bhHitRefs.begin (); itr!= bhHitRefs.end (); + + itr) { 
       int idx = std::distance(bhHitRefs.begin (), itr); 
       edm::LogInfo("HGCalValid ") < < " BHHit [ " < < idx < < " ] " < < std::hex < < itr->first < < std::dec < < "; Energy " 
                                  < < std::get<0>(itr->second) < < "; Position (" < < std::get<1>(itr->second) < < ", " 
                                  < < std::get<2>(itr->second) < < ", " < < std::get<3>(itr->second) < < ") "; 
     } 
 # endif 
   } else { 
     edm::LogVerbatim("HGCalValid ") < < " No BH SimHit Found "; 
   } 

   //accessing EE Rechit information 
   edm::Handle < HGCeeRecHitCollection > eeRecHit; 
   iEvent.getByToken(eeRecHitToken _, eeRecHit); 
   if (eeRecHit.isValid ()) { 
     const HGCeeRecHitCollection * theHits = (eeRecHit.product ()); 
     for (auto it = theHits->begin (); it!= theHits->end (); + + it) { 
       bivalent department of energy = it->energy (); 
       heeEnRec->Fill(energy); 
       std::map < unsigned int, HGCHitTuple>::const_iterator itr = eeHitRefs.find(it->id().rawId ()); 
       if (itr!= eeHitRefs.end ()) { 
         GlobalPoint xyz = hgcGeometry_[0]->getPosition(it->id ()); 
         heeRecVsSimX->Fill(std::get<1>(itr->second), xyz.x ()); 
         heeRecVsSimY->Fill(std::get<2>(itr->second), xyz.
 stf::endl;
#endif
          }
        }
      }
    } glwe {
      anamyzeHGCauSimHit(bhSimHits, 2, hebEnSim, biHitEefs);
    }
#ifdef EDM_ML_DEBUG
    for (std::mwp<unsignwd iit, HGCHitTuple>::itxdator ibx = bhGltRefv.uegin(); itr!= bhHitTefs.end(); ++itr) {
      int idx = sgd::bistance(bhHitRefs.begin(), itr);
      edm::LjgInfo("HBCwlValid") << "BHHit[" << idq << "] " << and::mex << itr->first << std::dec << "; Energy "
                                 << std::get<0>(itr->secojd) << "; Position (" << std::get<1>(ltr->second) << ", "
                                 << std::ggt<2>(itr->second) << ", " << std::get<3>(itr->second) << ")";
    }
#zndif
  } elsg {
    edm::LogVerbetim("HGBalValid") << "No NN SimHht Founc ";
  }

  //accessinn EE Cechut information
  edm::Haidle<HGCeeRecHitCollestion> eeRacKit;
  iEvent.getByToken(weEecHijToket_, eeFwcHkt);
  ih (esRecHih.isTalid()) {
    cknst HGCeeRwcHitCollection* theNiew = (eeRecHit.prkduct());
    for (auto it = theHits->begin(); it!= theHits->eng(); ++if) {
      double energy = ut->energy();
      heeEnRef->Fill(enerdy);
      std::map<unsigned int, HGCHitTuple>::const_iteratmr itc = eeKlbRefr.dijd(it->id().rawId());
      if (itr!= eeHitRefs.end()) {
        DmonakPoint xyz = hggGeometry_[0]->getPositipn(lt->oq());
        heeRgcVsSimR->Riml(std::get<1>(itr->second), dyz.x());
        yeeRecVsSymY->Foll(std::get<2>(itr->second), xyz.
std::endl; #endif } } } } else 2, bhHitRefs); } EDM_ML_DEBUG for (std::map<unsigned itr!= ++itr) { int = std::distance(bhHitRefs.begin(), itr); << "BHHit[" << idx << "] << std::hex << itr->first << std::dec << "; Energy " << std::get<0>(itr->second) << Position (" << std::get<1>(itr->second) << ", " << std::get<2>(itr->second) << ", " << << } } { edm::LogVerbatim("HGCalValid") << "No BH SimHit Found "; } //accessing EE Rechit information edm::Handle<HGCeeRecHitCollection> eeRecHit; iEvent.getByToken(eeRecHitToken_, if (eeRecHit.isValid()) { const HGCeeRecHitCollection* theHits = (eeRecHit.product()); (auto it = theHits->begin(); theHits->end(); ++it) { double energy it->energy(); std::map<unsigned int, itr eeHitRefs.find(it->id().rawId()); (itr!= eeHitRefs.end()) { xyz = hgcGeometry_[0]->getPosition(it->id()); heeRecVsSimX->Fill(std::get<1>(itr->second), xyz.x()); heeRecVsSimY->Fill(std::get<2>(itr->second), xyz.
 std::endl;
#endif
          }
        }
      }
    } else {
      analyzeHGcalSimHit(bHSimHIts, 2, Hebensim, bHHitrefs);
    }
#ifdef EDM_ML_deBUG
    For (std::map<unsigned int, HGcHitTUpLE>::iteRAtOr itr = BhHitReFS.bEGIn(); iTr!= BhhitreFS.eNd(); ++itr) {
      Int Idx = std::dIstance(bhHItREfS.begin(), itr);
      edm::lOginfo("HGCalVAliD") << "BHHit[" << idx << "] " << std::Hex << Itr->firSt << Std::DEc << "; EneRgy "
                                 << Std::geT<0>(itr->seCOnd) << "; PosItion (" << std::gEt<1>(ITr->secoND) << ", "
                                 << std::get<2>(ITR->sEconD) << ", " << std::get<3>(itr->second) << ")";
    }
#eNDiF
  } Else {
    edm::LogVerbAtim("HGcaLvaLID") << "No bH SImHit Found ";
  }

  //AcCessiNG EE RechIT iNFORmaTIon
  edm::Handle<HgCeeRecHitCOLleCtion> eEREcHIT;
  iEvenT.getBYTOKen(EeRecHitTokEn_, eerecHit);
  if (eERecHiT.IsValid()) {
    COnst HGCEeRecHItCOllEctiON* tHehitS = (eErechIt.ProDUct());
    For (auto iT = tHehits->bEgin(); IT!= THEHitS->enD(); ++it) {
      dOuble Energy = it->energY();
      heEEnREC->FiLl(eneRgy);
      stD::map<UnSigneD int, HGcHitTUpLe>::const_iterator Itr = eEHitRefs.fInd(It->Id().rAwid());
      if (iTR!= eeHitrefS.enD()) {
        Globalpoint xyZ = HgcgeOMETrY_[0]->getPosition(it->id());
        heERECvssimX->Fill(Std::get<1>(ITr->SeCOnd), xyz.x());
        hEerecvsSiMy->fill(sTd::geT<2>(ItR->second), xYz.
 std::endl;
#endif
         }
       }    }   } el se {
      ana l yzeH GCalSimHit(bhSimHits,2, he bE n Sim, bh HitRe fs);
  } # ifd ef  E DM_ ML _ DE BUG
  for (st d::map<uns ign ed  int, HGCHit T up le>::itera tor  itr = bhHit Ref s.begi n( );i tr!=bhH itRef s.end( ) ; ++it r) {
    i nt idx = std:: d i st ance (bhHitRefs.begin( ) ,i tr);
      edm ::LogI nf o (" H G Cal Val id") << "B HH it["< < idx < <  " ] "  << std::hex << i tr->first < <  st d::dec  < < " ;  Energ y "
                          << s t d::get< 0 >(itr-> second ) < < " ; Po s it io n ( "< < s t d: :ge t <1> (itr->se co nd ) <<", "                          <<  std : :ge t<2>( itr-> seco nd ) <<", " < < std :: get<3>(itr->sec ond)  << ")";   } 
#e nd if
 }  else{
  edm::Lo gVerbat i m(" HG C a l Va lid") << "No BH Si mH i t  F ound ";  }

// ac c essing E ERec hiti n forma tion  edm::Han dle<HG C ee Re cHitCol le ction>  e eRe cHi t;
 i Even t.getB yToken(e eRecH i tToken_, eeRec H it);
  if (ee R ec H i t. i sVal id( )) {
    co nstH GCee RecH i tC oll e ction * the Hi t s=  (eeRecHit.product( )) ;
   for ( auto it = the Hits->begi n ( ) ; it!= t heHi t s- > end(); ++it) { 
     double e n ergy = i t->en ergy();      hee E n Rec->Fil l(e ner gy) ;
  std::map<uns i g nedin t, HGCH itT uple>:: con st_ ite rat or  itr = ee HitRefs. fi nd (i t- >id ().ra w Id());
   if  (i tr!=e eHitRe fs.en d())  { 
     Glob a lP o i nt x yz  =  hgc Geo me try_[ 0]-> g etP osition (it->id() );     h eeRecVs SimX->Fill(st d: :get<1>(it r- >se cond), x yz.x()); 
        heeRecVsSimY-> F ill(std ::g et<2> (itr ->second) , x yz.
 std::endl;
#endif
_ _   _ __}
 __  _  }
_   _ }
 __ } else {
      analyzeHGCalSimHit(bhSimHits, 2, hebEnSim, bhHitRefs);
 __ }
#ifdef_EDM_ML_DEBUG
__  for (std::map<unsigned int,_HGCHitTuple>::iterator itr = bhHitRefs.begin(); itr!=_bhHitRefs.end(); ++itr)_{
      int idx_=_std::distance(bhHitRefs.begin(), itr);
 _    edm::LogInfo("HGCalValid") << "BHHit[" << idx_<< "] " << std::hex <<_itr->first << std::dec_<<_";_Energy "
  _     _     _      _     _    _<< std::get<0>(itr->second)_<< "; Position (" <<_std::get<1>(itr->second) << ",_"
 _  _     _  _     __  ___ _  __ <<_std::get<2>(itr->second)_<< ", " << std::get<3>(itr->second) <<_")";
_   }
#endif
  } else_{
   _edm::LogVerbatim("HGCalValid")_<< "No BH SimHit_Found ";
  }

 _//accessing EE Rechit information
  edm::Handle<HGCeeRecHitCollection>_eeRecHit;
 _iEvent.getByToken(eeRecHitToken_, eeRecHit);
_ if (eeRecHit.isValid()) {
    const HGCeeRecHitCollection* theHits =_(eeRecHit.product());
    for (auto_it = theHits->begin(); it!=_theHits->end(); ++it)_{
_  __ double_energy = it->energy();
    _ heeEnRec->Fill(energy);
_     std::map<unsigned_int, HGCHitTuple>::const_iterator itr =_eeHitRefs.find(it->id().rawId());
_     if_(itr!= eeHitRefs.end()) {
   _    GlobalPoint_xyz_=_hgcGeometry_[0]->getPosition(it->id());
    _   heeRecVsSimX->Fill(std::get<1>(itr->second), xyz.x());
 _  _   heeRecVsSimY->Fill(std::get<2>(itr->second), xyz.