Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:39

0001 //FAMOS Headers
0002 #include "FastSimulation/Event/interface/FSimEvent.h"
0003 
0004 //C++ Headers
0005 
0006 FSimEvent::FSimEvent(const edm::ParameterSet& kine) : FBaseSimEvent(kine), id_(edm::EventID(0, 0, 0)), weight_(0) {}
0007 
0008 FSimEvent::~FSimEvent() {}
0009 
0010 void FSimEvent::fill(const HepMC::GenEvent& hev, edm::EventID& Id) {
0011   FBaseSimEvent::fill(hev);
0012   id_ = Id;
0013 }
0014 
0015 void FSimEvent::fill(const std::vector<SimTrack>& simTracks, const std::vector<SimVertex>& simVertices) {
0016   FBaseSimEvent::fill(simTracks, simVertices);
0017   id_ = edm::EventID();
0018 }
0019 
0020 edm::EventID FSimEvent::id() const { return id_; }
0021 
0022 float FSimEvent::weight() const { return weight_; }
0023 
0024 unsigned int FSimEvent::nTracks() const { return FBaseSimEvent::nTracks(); }
0025 
0026 unsigned int FSimEvent::nVertices() const { return FBaseSimEvent::nVertices(); }
0027 
0028 unsigned int FSimEvent::nGenParts() const { return FBaseSimEvent::nGenParts(); }
0029 
0030 void FSimEvent::load(edm::SimTrackContainer& c, edm::SimTrackContainer& m) const {
0031   for (unsigned int i = 0; i < nTracks(); ++i) {
0032     //    SimTrack t = SimTrack(ip,p,iv,ig);
0033     const SimTrack& t = embdTrack(i);
0034     // Save all tracks
0035     c.push_back(t);
0036     // Save also some muons for later parameterization
0037     if (abs(t.type()) == 13 && t.momentum().perp2() > 1.0 && fabs(t.momentum().eta()) < 3.0 && track(i).noEndVertex()) {
0038       // Actually save the muon mother (and the attached muon) in case
0039       if (!track(i).noMother() && track(i).mother().closestDaughterId() == (int)i) {
0040         const SimTrack& T = embdTrack(track(i).mother().id());
0041         m.push_back(T);
0042       }
0043       m.push_back(t);
0044     }
0045   }
0046 }
0047 
0048 void FSimEvent::load(edm::SimVertexContainer& c) const {
0049   for (unsigned int i = 0; i < nVertices(); ++i) {
0050     //    SimTrack t = SimTrack(ip,p,iv,ig);
0051     c.push_back(embdVertex(i));
0052   }
0053 }
0054 
0055 void FSimEvent::load(FSimVertexTypeCollection& c) const {
0056   for (unsigned int i = 0; i < nVertices(); ++i) {
0057     c.push_back(embdVertexType(i));
0058   }
0059 }