285 const std::vector< PileupSummaryInfo >& PupInfo = *PupInfo_h;
312 mySimEvent_->fill(*simTracksHandle, *simVerticesHandle);
314 HepMC::GenVertex *
primaryVertex = *(hevH)->GetEvent()->vertices_begin();
315 const float mm2cm = 0.1;
316 vtx_x_ = primaryVertex->position().x() * mm2cm;
317 vtx_y_ = primaryVertex->position().y() * mm2cm;
318 vtx_z_ = primaryVertex->position().z() * mm2cm;
324 std::vector<FSimTrack *> allselectedgentracks;
325 const float eeInnerRadius = 25.;
326 const float eeOuterRadius = 160.;
328 for (
unsigned int i = 0;
i <
npart; ++
i) {
329 std::vector<float> xp, yp, zp;
333 int reachedEE = ReachHGCal::notReach;
340 if (myTrack.noEndVertex())
343 bool reachesHGCal = toHGCalPropagator.propagate(
344 myTrack.momentum(), myTrack.vertex().position(), myTrack.charge(), propcoords);
347 if (reachesHGCal &&
vtx.Rho() < eeOuterRadius &&
vtx.Rho() > eeInnerRadius) {
348 reachedEE = ReachHGCal::onEESurface;
351 for (
int i = 0;
i < myTrack.nDaughters(); ++
i) dpt += myTrack.daughter(
i).momentum().pt();
352 if (
abs(myTrack.type()) == 11) fbrem = dpt / myTrack.momentum().pt();
353 }
else if (reachesHGCal &&
vtx.Rho() > eeOuterRadius)
354 reachedEE = ReachHGCal::outsideEESurface;
357 for (
unsigned il = 1; il <=
nlayers; ++il) {
358 const float charge = myTrack.charge();
361 indiv_particleProp.propagate(myTrack.momentum(), myTrack.vertex().position(),
charge,
364 xp.push_back(propCoords.
x);
365 yp.push_back(propCoords.
y);
366 zp.push_back(propCoords.
z);
369 vtx = myTrack.endVertex().position();
371 auto orig_vtx = myTrack.vertex().position();
388 toHGCalPropagator.propagate(myTrack.momentum(), orig_vtx, myTrack.charge(), hitsHGCal);
409 gen_n_ = genParticlesHandle->size();
411 for (
const auto& particle : *genParticlesHandle) {
414 gen_pt_.push_back(particle.pt());
419 std::vector<int>
daughters(particle.daughterRefVector().size(), 0);
420 for (
unsigned j = 0; j < particle.daughterRefVector().size(); ++j) {
421 daughters[j] =
static_cast<int>(particle.daughterRefVector().at(j).key());
429 for (
size_t i = 0;
i < allselectedgentracks.size();
i++) {
430 const auto tracki = allselectedgentracks.at(
i);
432 for (
size_t j =
i + 1; j < allselectedgentracks.size(); j++) {
433 const auto trackj = allselectedgentracks.at(j);
435 if (!tracki->noMother()) {
438 if (!trackj->noMother()) {
444 for(
const auto& PVI : PupInfo)
446 if(PVI.getBunchCrossing() == 0)
const MagneticField * aField_
std::vector< int > genpart_mother_
std::vector< std::vector< int > > gen_daughters_
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::vector< float > > genpart_posy_
edm::EDGetToken gen_PU_token_
edm::ESWatcher< PDTRecord > pdt_watcher_
std::vector< float > genpart_phi_
edm::EDGetToken gen_token_
std::vector< float > gen_energy_
std::vector< float > genpart_exy_
std::unique_ptr< FSimEvent > mySimEvent_
edm::EDGetToken simVertices_token_
std::vector< float > gen_eta_
std::vector< std::vector< float > > genpart_posz_
std::vector< int > gen_status_
std::vector< float > genpart_dvy_
std::vector< int > genpart_reachedEE_
std::vector< int > gen_pdgid_
std::vector< float > genpart_exx_
std::vector< float > gen_phi_
std::vector< int > genpart_pid_
std::vector< int > gen_charge_
std::vector< bool > genpart_fromBeamPipe_
Abs< T >::type abs(const T &t)
edm::EDGetToken hepmcev_token_
std::vector< float > genpart_fbrem_
std::vector< float > genpart_eta_
std::vector< float > genpart_pt_
std::vector< float > genpart_ovz_
edm::ESWatcher< IdealMagneticFieldRecord > magfield_watcher_
HGCalTriggerTools triggerTools_
std::vector< std::vector< float > > genpart_posx_
std::vector< float > genpart_ovy_
std::vector< float > gen_pt_
std::vector< float > genpart_exphi_
bool check(const edm::EventSetup &iSetup)
std::vector< float > genpart_energy_
math::XYZTLorentzVectorD toVector()
std::vector< float > genpart_ovx_
std::vector< float > genpart_exeta_
edm::EDGetToken simTracks_token_
std::vector< float > genpart_dvz_
std::vector< int > genpart_gen_
std::vector< float > genpart_dvx_