1 |
loizides |
1.11 |
// $Id: FillerMCParticles.cc,v 1.10 2009/03/18 14:57:58 loizides Exp $
|
2 |
bendavid |
1.1 |
|
3 |
|
|
#include "MitProd/TreeFiller/interface/FillerMCParticles.h"
|
4 |
|
|
#include "FWCore/MessageLogger/interface/MessageLogger.h"
|
5 |
|
|
#include "DataFormats/Common/interface/Handle.h"
|
6 |
bendavid |
1.8 |
#include "DataFormats/Common/interface/RefToPtr.h"
|
7 |
bendavid |
1.1 |
#include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
|
8 |
bendavid |
1.8 |
#include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
|
9 |
|
|
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
|
10 |
bendavid |
1.4 |
#include "SimDataFormats/Track/interface/SimTrack.h"
|
11 |
|
|
#include "SimDataFormats/Track/interface/SimTrackContainer.h"
|
12 |
|
|
#include "SimDataFormats/Vertex/interface/SimVertex.h"
|
13 |
|
|
#include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
|
14 |
bendavid |
1.1 |
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
|
15 |
|
|
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"
|
16 |
|
|
#include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h"
|
17 |
|
|
#include "SimDataFormats/TrackingAnalysis/interface/TrackingVertexContainer.h"
|
18 |
|
|
#include "MitAna/DataTree/interface/Names.h"
|
19 |
|
|
|
20 |
|
|
using namespace std;
|
21 |
|
|
using namespace edm;
|
22 |
|
|
using namespace mithep;
|
23 |
|
|
|
24 |
|
|
//--------------------------------------------------------------------------------------------------
|
25 |
|
|
FillerMCParticles::FillerMCParticles(const ParameterSet &cfg, const char *name, bool active) :
|
26 |
|
|
BaseFiller(cfg, name, active),
|
27 |
|
|
genActive_(Conf().getUntrackedParameter<bool>("genActive",true)),
|
28 |
bendavid |
1.8 |
useAodGen_(Conf().getUntrackedParameter<bool>("useAodGen",true)),
|
29 |
bendavid |
1.1 |
simActive_(Conf().getUntrackedParameter<bool>("simActive",true)),
|
30 |
bendavid |
1.4 |
trackingActive_(Conf().getUntrackedParameter<bool>("trackingActive",false)),
|
31 |
bendavid |
1.1 |
genEdmName_(Conf().getUntrackedParameter<string>("genEdmName","source")),
|
32 |
bendavid |
1.4 |
simEdmName_(Conf().getUntrackedParameter<string>("simEdmName","g4SimHits")),
|
33 |
loizides |
1.9 |
trackingEdmName_(Conf().getUntrackedParameter<string>("trackingEdmName",
|
34 |
|
|
"mergedtruth:MergedTrackTruth")),
|
35 |
loizides |
1.3 |
genMapName_(Conf().getUntrackedParameter<string>("genMapName","GenMap")),
|
36 |
|
|
simMapName_(Conf().getUntrackedParameter<string>("simMapName","SimMap")),
|
37 |
bendavid |
1.4 |
trackingMapName_(Conf().getUntrackedParameter<string>("trackingMapName","TrackingMap")),
|
38 |
bendavid |
1.1 |
mitName_(Conf().getUntrackedParameter<string>("mitName",Names::gkMCPartBrn)),
|
39 |
|
|
mcParticles_(new mithep::MCParticleArr(250)),
|
40 |
bendavid |
1.8 |
genMap_(genActive_?new mithep::GenParticleBarcodeMap:0),
|
41 |
|
|
aodGenMap_((genActive_&&useAodGen_)?new mithep::AODGenParticleMap:0),
|
42 |
|
|
simMap_(simActive_?new mithep::SimTrackTidMap:0),
|
43 |
bendavid |
1.4 |
trackingMap_(trackingActive_?new mithep::TrackingParticleMap:0)
|
44 |
bendavid |
1.1 |
{
|
45 |
|
|
// Constructor.
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
//--------------------------------------------------------------------------------------------------
|
49 |
|
|
FillerMCParticles::~FillerMCParticles()
|
50 |
|
|
{
|
51 |
|
|
// Destructor.
|
52 |
|
|
|
53 |
|
|
delete mcParticles_;
|
54 |
|
|
delete genMap_;
|
55 |
bendavid |
1.8 |
delete aodGenMap_;
|
56 |
bendavid |
1.1 |
delete simMap_;
|
57 |
bendavid |
1.4 |
delete trackingMap_;
|
58 |
bendavid |
1.1 |
}
|
59 |
|
|
|
60 |
|
|
//--------------------------------------------------------------------------------------------------
|
61 |
|
|
void FillerMCParticles::BookDataBlock(TreeWriter &tws)
|
62 |
|
|
{
|
63 |
loizides |
1.3 |
// Add branch to tree and publish our maps.
|
64 |
bendavid |
1.1 |
|
65 |
loizides |
1.9 |
tws.AddBranch(mitName_,&mcParticles_);
|
66 |
|
|
OS()->add<mithep::MCParticleArr>(mcParticles_,mitName_);
|
67 |
loizides |
1.2 |
|
68 |
loizides |
1.9 |
if (genActive_ && !genMapName_.empty()) {
|
69 |
|
|
genMap_->SetBrName(mitName_);
|
70 |
|
|
if (genMap_)
|
71 |
|
|
OS()->add(genMap_,genMapName_);
|
72 |
|
|
}
|
73 |
|
|
if (simActive_ && !simMapName_.empty()) {
|
74 |
|
|
simMap_->SetBrName(mitName_);
|
75 |
|
|
if (simMap_)
|
76 |
|
|
OS()->add(simMap_,simMapName_);
|
77 |
|
|
}
|
78 |
|
|
if (trackingActive_ && !trackingMapName_.empty()) {
|
79 |
|
|
trackingMap_->SetBrName(mitName_);
|
80 |
|
|
if (trackingMap_)
|
81 |
|
|
OS()->add(trackingMap_,trackingMapName_);
|
82 |
|
|
}
|
83 |
bendavid |
1.1 |
}
|
84 |
|
|
|
85 |
|
|
//--------------------------------------------------------------------------------------------------
|
86 |
|
|
void FillerMCParticles::FillDataBlock(const edm::Event &event,
|
87 |
loizides |
1.2 |
const edm::EventSetup &setup)
|
88 |
bendavid |
1.1 |
{
|
89 |
loizides |
1.9 |
// Loop over generated or simulated particles and fill their information.
|
90 |
bendavid |
1.1 |
|
91 |
bendavid |
1.7 |
mcParticles_->Delete();
|
92 |
bendavid |
1.1 |
|
93 |
bendavid |
1.8 |
if (genActive_)
|
94 |
loizides |
1.3 |
genMap_->Reset();
|
95 |
bendavid |
1.1 |
|
96 |
bendavid |
1.8 |
if (genActive_ && !useAodGen_) {
|
97 |
bendavid |
1.1 |
Handle<edm::HepMCProduct> hHepMCProduct;
|
98 |
|
|
GetProduct(genEdmName_, hHepMCProduct, event);
|
99 |
|
|
|
100 |
|
|
const HepMC::GenEvent &GenEvent = hHepMCProduct->getHepMCData();
|
101 |
|
|
|
102 |
loizides |
1.9 |
// loop over all hepmc particles and copy their information
|
103 |
bendavid |
1.1 |
for (HepMC::GenEvent::particle_const_iterator pgen = GenEvent.particles_begin();
|
104 |
|
|
pgen != GenEvent.particles_end(); ++pgen) {
|
105 |
|
|
|
106 |
|
|
HepMC::GenParticle *mcPart = (*pgen);
|
107 |
|
|
if(!mcPart) continue;
|
108 |
|
|
|
109 |
|
|
mithep::MCParticle *genParticle = mcParticles_->Allocate();
|
110 |
|
|
new (genParticle) mithep::MCParticle(mcPart->momentum().x(),mcPart->momentum().y(),
|
111 |
loizides |
1.11 |
mcPart->momentum().z(),mcPart->momentum().e(),
|
112 |
|
|
mcPart->pdg_id(),mcPart->status());
|
113 |
bendavid |
1.1 |
genParticle->SetIsGenerated();
|
114 |
|
|
genMap_->Add(mcPart->barcode(), genParticle);
|
115 |
|
|
}
|
116 |
|
|
}
|
117 |
|
|
|
118 |
bendavid |
1.8 |
if (genActive_ && useAodGen_) {
|
119 |
loizides |
1.9 |
|
120 |
bendavid |
1.8 |
aodGenMap_->Reset();
|
121 |
|
|
|
122 |
|
|
Handle<reco::GenParticleCollection> hGenPProduct;
|
123 |
|
|
GetProduct(genEdmName_, hGenPProduct, event);
|
124 |
|
|
|
125 |
loizides |
1.9 |
// element by element aligned collection of hepmc barcodes associated to
|
126 |
|
|
// the genparticles
|
127 |
bendavid |
1.8 |
Handle<std::vector<int> > genBarcodes;
|
128 |
|
|
if (simActive_)
|
129 |
|
|
GetProduct(genEdmName_, genBarcodes, event);
|
130 |
|
|
|
131 |
|
|
const reco::GenParticleCollection genParticles = *(hGenPProduct.product());
|
132 |
|
|
|
133 |
loizides |
1.11 |
// loop over all genparticles and copy their information
|
134 |
bendavid |
1.8 |
for (reco::GenParticleCollection::const_iterator pgen = genParticles.begin();
|
135 |
|
|
pgen != genParticles.end(); ++pgen) {
|
136 |
|
|
|
137 |
|
|
mithep::MCParticle *mcPart = mcParticles_->Allocate();
|
138 |
|
|
new (mcPart) mithep::MCParticle(pgen->px(),pgen->py(),
|
139 |
|
|
pgen->pz(),pgen->energy(),
|
140 |
|
|
pgen->pdgId(),
|
141 |
|
|
pgen->status());
|
142 |
|
|
|
143 |
|
|
mcPart->SetIsGenerated();
|
144 |
|
|
|
145 |
loizides |
1.9 |
// add hepmc barcode association, needed to merge in sim particles
|
146 |
bendavid |
1.8 |
if (simActive_) {
|
147 |
|
|
int genBarcode = genBarcodes->at(pgen - genParticles.begin());
|
148 |
|
|
genMap_->Add(genBarcode, mcPart);
|
149 |
|
|
}
|
150 |
|
|
|
151 |
|
|
edm::Ptr<reco::GenParticle> thePtr(hGenPProduct, pgen - genParticles.begin());
|
152 |
|
|
aodGenMap_->Add(thePtr, mcPart);
|
153 |
|
|
}
|
154 |
|
|
}
|
155 |
|
|
|
156 |
bendavid |
1.1 |
if (simActive_) {
|
157 |
loizides |
1.3 |
simMap_->Reset();
|
158 |
bendavid |
1.4 |
|
159 |
|
|
Handle<edm::SimTrackContainer> hSimTrackProduct;
|
160 |
|
|
GetProduct(simEdmName_, hSimTrackProduct, event);
|
161 |
|
|
|
162 |
|
|
const edm::SimTrackContainer simTracks = *(hSimTrackProduct.product());
|
163 |
|
|
|
164 |
bendavid |
1.1 |
// loop through all simParticles
|
165 |
bendavid |
1.4 |
for (SimTrackContainer::const_iterator iM = simTracks.begin();
|
166 |
|
|
iM != simTracks.end(); ++iM) {
|
167 |
|
|
|
168 |
bendavid |
1.8 |
mithep::MCParticle *outSimParticle = 0;
|
169 |
bendavid |
1.1 |
|
170 |
bendavid |
1.4 |
if (genActive_ && (iM->genpartIndex() >= 0) ) {
|
171 |
|
|
outSimParticle = genMap_->GetMit(iM->genpartIndex());
|
172 |
loizides |
1.9 |
if (verbose_>1) {
|
173 |
|
|
printf("Sim px,py,pz,e = %f,%f,%f,%f\nGen px,py,pz,e = %f,%f,%f,%f\n",
|
174 |
|
|
iM->momentum().px(),iM->momentum().py(),
|
175 |
|
|
iM->momentum().pz(),iM->momentum().e(),
|
176 |
|
|
outSimParticle->Px(),outSimParticle->Py(),
|
177 |
|
|
outSimParticle->Pz(),outSimParticle->E());
|
178 |
|
|
}
|
179 |
|
|
} else {
|
180 |
bendavid |
1.1 |
outSimParticle = mcParticles_->Allocate();
|
181 |
bendavid |
1.4 |
new (outSimParticle) mithep::MCParticle(iM->momentum().px(),
|
182 |
|
|
iM->momentum().py(),
|
183 |
|
|
iM->momentum().pz(),
|
184 |
|
|
iM->momentum().e(),
|
185 |
loizides |
1.9 |
iM->type(), -99);
|
186 |
bendavid |
1.1 |
}
|
187 |
|
|
|
188 |
|
|
outSimParticle->SetIsSimulated();
|
189 |
bendavid |
1.8 |
simMap_->Add(iM->trackId(), outSimParticle);
|
190 |
bendavid |
1.4 |
}
|
191 |
|
|
}
|
192 |
|
|
|
193 |
loizides |
1.10 |
// loop through TrackingParticles and build association map to MCParticles
|
194 |
bendavid |
1.4 |
if (trackingActive_) {
|
195 |
|
|
trackingMap_->Reset();
|
196 |
|
|
|
197 |
|
|
Handle<TrackingParticleCollection> hTrackingParticleProduct;
|
198 |
|
|
GetProduct(trackingEdmName_, hTrackingParticleProduct, event);
|
199 |
|
|
|
200 |
bendavid |
1.5 |
const TrackingParticleCollection trackingParticles = *(hTrackingParticleProduct.product());
|
201 |
bendavid |
1.4 |
|
202 |
|
|
// loop through all TrackingParticles
|
203 |
bendavid |
1.5 |
for (TrackingParticleCollection::const_iterator iM = trackingParticles.begin();
|
204 |
bendavid |
1.4 |
iM != trackingParticles.end(); ++iM) {
|
205 |
|
|
|
206 |
|
|
if ( simActive_ && iM->g4Tracks().size() ) {
|
207 |
loizides |
1.9 |
if (verbose_>1) {
|
208 |
|
|
printf("Tracking particle has %i SimTracks\n",iM->g4Tracks().size());
|
209 |
|
|
if (iM->g4Tracks().size()>1) {
|
210 |
|
|
for (std::vector<SimTrack>::const_iterator iST = iM->g4Tracks().begin();
|
211 |
|
|
iST != iM->g4Tracks().end(); ++iST) {
|
212 |
|
|
printf("g4 trackid = %i\n",iST->trackId());
|
213 |
|
|
}
|
214 |
|
|
}
|
215 |
|
|
TrackingParticleRef theRef(hTrackingParticleProduct, iM-trackingParticles.begin());
|
216 |
|
|
const SimTrack &theSimTrack = iM->g4Tracks().at(iM->g4Tracks().size()-1);
|
217 |
|
|
printf("trackId = %i\n",theSimTrack.trackId());
|
218 |
|
|
mithep::MCParticle *outSimParticle = simMap_->GetMit(theSimTrack.trackId());
|
219 |
|
|
trackingMap_->Add(theRef, outSimParticle);
|
220 |
|
|
}
|
221 |
bendavid |
1.4 |
}
|
222 |
bendavid |
1.1 |
}
|
223 |
|
|
}
|
224 |
|
|
|
225 |
|
|
mcParticles_->Trim();
|
226 |
|
|
}
|
227 |
|
|
|
228 |
|
|
//--------------------------------------------------------------------------------------------------
|
229 |
|
|
void FillerMCParticles::ResolveLinks(const edm::Event &event,
|
230 |
loizides |
1.2 |
const edm::EventSetup &setup)
|
231 |
bendavid |
1.1 |
{
|
232 |
loizides |
1.9 |
// Loop over generated and simulated particles and resolve their links.
|
233 |
bendavid |
1.1 |
|
234 |
bendavid |
1.8 |
if (genActive_ && !useAodGen_) {
|
235 |
bendavid |
1.1 |
|
236 |
|
|
Handle<edm::HepMCProduct> hHepMCProduct;
|
237 |
|
|
GetProduct(genEdmName_, hHepMCProduct, event);
|
238 |
|
|
|
239 |
|
|
const HepMC::GenEvent &GenEvent = hHepMCProduct->getHepMCData();
|
240 |
|
|
|
241 |
|
|
for (HepMC::GenEvent::particle_const_iterator pgen = GenEvent.particles_begin();
|
242 |
|
|
pgen != GenEvent.particles_end(); ++pgen) {
|
243 |
|
|
|
244 |
|
|
HepMC::GenParticle *mcPart = (*pgen);
|
245 |
|
|
if(!mcPart) continue;
|
246 |
|
|
|
247 |
loizides |
1.11 |
// check if genpart has a decay vertex
|
248 |
bendavid |
1.1 |
HepMC::GenVertex *dVertex = mcPart->end_vertex();
|
249 |
|
|
if (!dVertex) continue;
|
250 |
|
|
|
251 |
loizides |
1.11 |
// find corresponding mithep genparticle parent in association table
|
252 |
bendavid |
1.1 |
mithep::MCParticle *genParent = genMap_->GetMit(mcPart->barcode());
|
253 |
|
|
|
254 |
loizides |
1.11 |
// set decay vertex
|
255 |
|
|
// division by 10.0 is needed due to HepMC use of mm instead of cm for distance units
|
256 |
bendavid |
1.1 |
genParent->SetVertex(dVertex->point3d().x()/10.0,
|
257 |
|
|
dVertex->point3d().y()/10.0,
|
258 |
|
|
dVertex->point3d().z()/10.0);
|
259 |
|
|
|
260 |
loizides |
1.11 |
// loop through daugthers
|
261 |
loizides |
1.3 |
for (HepMC::GenVertex::particles_out_const_iterator pgenD =
|
262 |
|
|
dVertex->particles_out_const_begin();
|
263 |
|
|
pgenD != dVertex->particles_out_const_end(); ++pgenD) {
|
264 |
bendavid |
1.1 |
HepMC::GenParticle *mcDaughter = (*pgenD);
|
265 |
|
|
mithep::MCParticle *genDaughter = genMap_->GetMit(mcDaughter->barcode());
|
266 |
|
|
genParent->AddDaughter(genDaughter);
|
267 |
|
|
if (!(genDaughter->HasMother()))
|
268 |
|
|
genDaughter->SetMother(genParent);
|
269 |
|
|
}
|
270 |
|
|
}
|
271 |
|
|
}
|
272 |
|
|
|
273 |
loizides |
1.11 |
// loop over aod GenParticle candidates and resolve their links
|
274 |
bendavid |
1.8 |
if (genActive_ && useAodGen_) {
|
275 |
|
|
|
276 |
|
|
Handle<reco::GenParticleCollection> hGenPProduct;
|
277 |
|
|
GetProduct(genEdmName_, hGenPProduct, event);
|
278 |
|
|
|
279 |
|
|
const reco::GenParticleCollection genParticles = *(hGenPProduct.product());
|
280 |
|
|
|
281 |
loizides |
1.11 |
// loop over all genparticles and copy their information
|
282 |
bendavid |
1.8 |
for (reco::GenParticleCollection::const_iterator pgen = genParticles.begin();
|
283 |
|
|
pgen != genParticles.end(); ++pgen) {
|
284 |
|
|
|
285 |
|
|
int nDaughters = pgen->numberOfDaughters();
|
286 |
|
|
|
287 |
|
|
if (nDaughters>0) {
|
288 |
|
|
|
289 |
|
|
edm::Ptr<reco::GenParticle> thePtr(hGenPProduct, pgen - genParticles.begin());
|
290 |
|
|
MCParticle *mcMother = aodGenMap_->GetMit(thePtr);
|
291 |
|
|
for (int i=0; i<nDaughters; ++i) {
|
292 |
|
|
const reco::Candidate *genDaughter = pgen->daughter(i);
|
293 |
|
|
MCParticle *mcDaughter = aodGenMap_->GetMit(refToPtr(pgen->daughterRef(i)));
|
294 |
loizides |
1.11 |
// set mother decay vertex
|
295 |
bendavid |
1.8 |
if (i==0)
|
296 |
|
|
mcMother->SetVertex(genDaughter->vx(),genDaughter->vy(),genDaughter->vz());
|
297 |
|
|
|
298 |
loizides |
1.11 |
// set mother-daughter links
|
299 |
bendavid |
1.8 |
mcMother->AddDaughter(mcDaughter);
|
300 |
|
|
if (!mcDaughter->HasMother())
|
301 |
|
|
mcDaughter->SetMother(mcMother);
|
302 |
|
|
|
303 |
|
|
}
|
304 |
|
|
}
|
305 |
|
|
}
|
306 |
|
|
|
307 |
|
|
}
|
308 |
|
|
|
309 |
loizides |
1.11 |
// loop over SimTracks and resolve links
|
310 |
bendavid |
1.1 |
if (simActive_) {
|
311 |
bendavid |
1.4 |
Handle<edm::SimTrackContainer> hSimTrackProduct;
|
312 |
|
|
GetProduct(simEdmName_, hSimTrackProduct, event);
|
313 |
|
|
|
314 |
|
|
const edm::SimTrackContainer simTracks = *(hSimTrackProduct.product());
|
315 |
|
|
|
316 |
|
|
Handle<std::vector<SimVertex> > hSimVertexProduct;
|
317 |
|
|
GetProduct(simEdmName_, hSimVertexProduct, event);
|
318 |
|
|
|
319 |
|
|
const edm::SimVertexContainer simVertexes = *(hSimVertexProduct.product());
|
320 |
|
|
|
321 |
bendavid |
1.1 |
// loop through all simParticles
|
322 |
bendavid |
1.4 |
for (SimTrackContainer::const_iterator iM = simTracks.begin();
|
323 |
|
|
iM != simTracks.end(); ++iM) {
|
324 |
|
|
|
325 |
|
|
if (iM->vertIndex()>=0) {
|
326 |
bendavid |
1.8 |
mithep::MCParticle *simDaughter = simMap_->GetMit(iM->trackId());
|
327 |
bendavid |
1.4 |
const SimVertex &theVertex = simVertexes.at(iM->vertIndex());
|
328 |
|
|
if (theVertex.parentIndex()>=0) {
|
329 |
bendavid |
1.8 |
mithep::MCParticle *simParent = simMap_->GetMit(theVertex.parentIndex());
|
330 |
loizides |
1.9 |
simParent->SetVertex(theVertex.position().x(),
|
331 |
|
|
theVertex.position().y(),
|
332 |
|
|
theVertex.position().z());
|
333 |
bendavid |
1.6 |
//make sure we don't double count the decay tree
|
334 |
|
|
if ( !simParent->HasDaughter(simDaughter) ) {
|
335 |
|
|
simParent->AddDaughter(simDaughter);
|
336 |
|
|
}
|
337 |
|
|
if ( !simDaughter->HasMother() ) {
|
338 |
|
|
simDaughter->SetMother(simParent);
|
339 |
|
|
}
|
340 |
bendavid |
1.1 |
}
|
341 |
loizides |
1.9 |
}
|
342 |
|
|
}
|
343 |
|
|
}
|
344 |
bendavid |
1.4 |
|
345 |
loizides |
1.9 |
if (verbose_>1 && trackingActive_) {
|
346 |
|
|
Handle<TrackingParticleCollection> hTrackingParticleProduct;
|
347 |
|
|
GetProduct(trackingEdmName_, hTrackingParticleProduct, event);
|
348 |
|
|
|
349 |
|
|
const TrackingParticleCollection trackingParticles = *(hTrackingParticleProduct.product());
|
350 |
|
|
|
351 |
|
|
// loop through all simParticles
|
352 |
|
|
for (TrackingParticleCollection::const_iterator iM = trackingParticles.begin();
|
353 |
|
|
iM != trackingParticles.end(); ++iM) {
|
354 |
|
|
|
355 |
|
|
TrackingParticleRef theRef(hTrackingParticleProduct, iM-trackingParticles.begin());
|
356 |
|
|
|
357 |
|
|
mithep::MCParticle *simParent = trackingMap_->GetMit(theRef);
|
358 |
|
|
printf("MCParticle pdg = %i, Daughter Pdgs: ", simParent->PdgId());
|
359 |
|
|
for (UInt_t i=0; i<simParent->NDaughters(); ++i) {
|
360 |
|
|
printf("%i, ", simParent->Daughter(i)->PdgId());
|
361 |
bendavid |
1.1 |
}
|
362 |
loizides |
1.9 |
printf("\n");
|
363 |
|
|
|
364 |
|
|
printf("TrackingParticle pdg = %i, Daughter Pdgs: ", iM->pdgId());
|
365 |
|
|
for (TrackingVertexRefVector::iterator v= iM->decayVertices().begin();
|
366 |
|
|
v != iM->decayVertices().end(); ++v) {
|
367 |
|
|
for (TrackingParticleRefVector::iterator pd = v->get()->daughterTracks().begin();
|
368 |
|
|
pd != v->get()->daughterTracks().end(); ++pd) {
|
369 |
|
|
printf("%i, ", pd->get()->pdgId());
|
370 |
|
|
}
|
371 |
|
|
}
|
372 |
|
|
printf("\n");
|
373 |
bendavid |
1.1 |
}
|
374 |
|
|
}
|
375 |
|
|
}
|