132 if(orig_v.size() != mcp_v.size())
throw cet::exception(__FUNCTION__) <<
"MCParticle and Origin_t vector size not same!";
137 for(
size_t i=0; i < mcp_v.size(); ++i) {
139 auto const& mcp = mcp_v[i];
143 _track_index.insert(std::make_pair((
size_t)(mcp.TrackId()),(
size_t)(this->
size())));
147 auto& mini_mcp = (*this->rbegin());
149 for(
size_t i=0; i<(size_t)(mcp.NumberDaughters()); ++i)
150 mini_mcp._daughters.insert(mcp.Daughter(i));
152 mini_mcp._track_id = mcp.TrackId();
153 mini_mcp._pdgcode = mcp.PdgCode();
154 mini_mcp._mother = mcp.Mother();
155 mini_mcp._process = mcp.Process();
156 mini_mcp._start_vtx = mcp.Position();
157 mini_mcp._start_mom = mcp.Momentum();
158 mini_mcp._end_vtx = mcp.EndPosition();
159 mini_mcp._end_mom = mcp.EndMomentum();
160 mini_mcp._origin = orig_v[i];
163 for(
size_t i=0; i<4; ++i) {
164 mini_mcp._start_mom[i] *= 1.e3;
165 mini_mcp._end_mom[i] *= 1.e3;
178 std::set<size_t> det_path_index;
180 for(
size_t i=0; i<mcp.NumberTrajectoryPoints(); ++i) {
184 det_path_index.insert(i);
188 if(det_path_index.size()) {
189 if( (*det_path_index.begin()) )
190 det_path_index.insert( (*det_path_index.begin())-1 );
191 if( det_path_index.size()>1 ) {
192 if( ((*det_path_index.rbegin())+1) < mcp.NumberTrajectoryPoints() )
193 det_path_index.insert( (*det_path_index.rbegin())+1 );
195 mini_mcp._det_path.reserve(det_path_index.size());
196 for(
auto const&
index : det_path_index) {
198 TLorentzVector vec(mcp.Momentum(
index));
199 for(
size_t i=0; i<4; ++i) vec[i] *= 1.e3;
201 mini_mcp._det_path.push_back(std::make_pair(mcp.Position(
index),vec));
std::map< unsigned int, unsigned int > _track_index
Track ID => Index Map.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
fInnerVessel push_back(Point(-578.400000, 0.000000, 0.000000))
std::set< int > _pdg_list
PDG code list for which particle's trajectory within the detector is saved.
vector< vector< double > > clear
bool InDetector(const double &x, const double &y, const double &z) const
cet::coded_exception< error, detail::translate > exception